Skip to content

Commit

Permalink
Item10329: initial release
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/JQPrettyPhotoContrib@11317 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Apr 6, 2011
0 parents commit cc8e0b3
Show file tree
Hide file tree
Showing 54 changed files with 1,661 additions and 0 deletions.
56 changes: 56 additions & 0 deletions data/System/JQPrettyPhotoContrib.txt
@@ -0,0 +1,56 @@
%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1302089745" format="1.1" reprev="2" version="2"}%
---+!! %TOPIC%
%SHORTDESCRIPTION%

%TOC%

This package integrates the great [[http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/][prettyphoto]]
jquery lightbox clone by Stephane Caron

prettyPhoto is a full blown media lightbox supporting images, videos, flash, !YouTube, iframes and ajax.
It can be used as a drop-in replacement of JQueryPlugin's version of slimbox, another lightbox clone, shipped with foswiki by default.

prettyPhoto has been integrated by means of minimal invasive markup, that is any DIV element with a class =jqPrettyPhoto= will be converted into a media lightbox automatically without any extra provisions, similar to the way slimbox is used. Additional parameter to the plugin itself can be passed using JQueryMetadata.

Note that Foswiki:Extensions/TopicInteractionPlugin as well as Foswiki:Extensions/ImageGalleryPlugin
will automatically switch from slimbox to prettyPhoto for lightboxing.

---++ Examples

(using Foswiki:Extensions/ImagePlugin)

%JQREQUIRE{"prettyphoto"}%
<div class="jqPrettyPhoto">
%IMAGE{"1.jpg" size="60x60>" crop="on"}%
%IMAGE{"3.jpg" size="60x60>" crop="on"}%
%IMAGE{"2.jpg" size="60x60>" crop="on"}%
%IMAGE{"4.jpg" size="60x60>" crop="on"}%
%IMAGE{"5.jpg" size="60x60>" crop="on"}%
%CLEAR%
</div>

---++ Installation Instructions

%$INSTALL_INSTRUCTIONS%

---++ Info
<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

| Author(s): | Michael Daum|
| Copyright: | &copy; 2011 Michael Daum http://michaeldaumconsulting.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 06 Apr 2011: | initial release |
| Dependencies: | %$DEPENDENCIES% |
| Home page: | Foswiki:Extensions/%TOPIC% |
| Support: | Foswiki:Support/%TOPIC% |

%META:FILEATTACHMENT{name="5.jpg" attachment="5.jpg" attr="" comment="" date="1302089011" size="44257" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="4.jpg" attachment="4.jpg" attr="" comment="" date="1302089012" size="98304" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="3.jpg" attachment="3.jpg" attr="" comment="" date="1302089014" size="35532" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="2.jpg" attachment="2.jpg" attr="" comment="" date="1302089016" size="84412" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="1.jpg" attachment="1.jpg" attr="" comment="" date="1302089018" size="61924" user="ProjectContributor" version="1"}%
46 changes: 46 additions & 0 deletions lib/Foswiki/Contrib/JQPrettyPhotoContrib.pm
@@ -0,0 +1,46 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# JQPrettyPhotoContrib is Copyright (C) 2011 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
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html

package Foswiki::Plugins::JQPrettyPhotoContrib;

use strict;
use warnings;

=begin TML
---+ package JQPrettyPhotoContrib
=cut


our $VERSION = '$Rev$';
our $RELEASE = '1.00';
our $SHORTDESCRIPTION = 'Yet another nice lightbox plugin';
our $NO_PREFS_IN_TOPIC = 1;

=begin TML
---++ init() -> $boolean
call this to init the plugin from perl
=cut

sub init {
require Foswiki::Plugins::JQueryPlugin ();
Foswiki::Plugins::JQueryPlugin::registerPlugin("PrettyPhoto", "Foswiki::Plugins::JQPrettyPhotoContrib::Core");
}

1;
8 changes: 8 additions & 0 deletions lib/Foswiki/Contrib/JQPrettyPhotoContrib/Config.spec
@@ -0,0 +1,8 @@
# ---+ Extensions
# ---++ JQueryPlugin
# ---+++ Extra plugins
# **STRING**
$Foswiki::cfg{JQueryPlugin}{Plugins}{PrettyPhoto}{Module} = 'Foswiki::Contrib::JQPrettyPhotoContrib::Core';
# **BOOLEAN**
$Foswiki::cfg{JQueryPlugin}{Plugins}{PrettyPhoto}{Enabled} = 1;
1;
65 changes: 65 additions & 0 deletions lib/Foswiki/Contrib/JQPrettyPhotoContrib/Core.pm
@@ -0,0 +1,65 @@
# See bottom of file for license and copyright information

package Foswiki::Contrib::JQPrettyPhotoContrib::Core;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin ();
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
---+ package Foswiki::Contrib::JQPrettyPhotoContrib::Core
This is the perl stub for the prettyPhoto plugin.
=cut

=begin TML
---++ ClassMethod new( $class, $session, ... )
Constructor
=cut

sub new {
my $class = shift;
my $session = shift || $Foswiki::Plugins::SESSION;

my $this = bless(
$class->SUPER::new(
$session,
name => 'PrettyPhoto',
version => '3.0',
author => 'Stephane Caron',
homepage => 'http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/',
css => ['jquery.prettyPhoto.css'],
javascript => ['jquery.prettyPhoto.js', 'jquery.prettyPhoto.init.js'],
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQPrettyPhotoContrib',
),
$class
);

return $this;
}

1;

__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2011 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
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read LICENSE in the root of this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As per the GPL, removal of this notice is prohibited.
Empty file.
57 changes: 57 additions & 0 deletions lib/Foswiki/Contrib/JQPrettyPhotoContrib/MANIFEST
@@ -0,0 +1,57 @@
data/System/JQPrettyPhotoContrib.txt 0644
lib/Foswiki/Contrib/JQPrettyPhotoContrib/Config.spec 0644
lib/Foswiki/Contrib/JQPrettyPhotoContrib/Core.pm 0644
lib/Foswiki/Contrib/JQPrettyPhotoContrib.pm 0644
pub/System/JQPrettyPhotoContrib/1.jpg 0644
pub/System/JQPrettyPhotoContrib/2.jpg 0644
pub/System/JQPrettyPhotoContrib/3.jpg 0644
pub/System/JQPrettyPhotoContrib/4.jpg 0644
pub/System/JQPrettyPhotoContrib/5.jpg 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_rounded/btnNext.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_rounded/btnPrevious.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_rounded/contentPattern.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_rounded/default_thumbnail.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_rounded/loader.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_rounded/sprite.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_square/btnNext.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_square/btnPrevious.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_square/contentPattern.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_square/default_thumbnail.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_square/loader.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/dark_square/sprite.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/default/default_thumb.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/default/loader.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/default/sprite_next.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/default/sprite.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/default/sprite_prev.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/default/sprite_x.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/default/sprite_y.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/btnNext.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/btnPrevious.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/contentPatternBottom.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/contentPatternLeft.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/contentPatternRight.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/contentPatternTop.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/default_thumbnail.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/loader.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/facebook/sprite.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_rounded/btnNext.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_rounded/btnPrevious.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_rounded/default_thumbnail.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_rounded/loader.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_rounded/sprite.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_square/btnNext.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_square/btnPrevious.png 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_square/default_thumbnail.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_square/loader.gif 0644
pub/System/JQPrettyPhotoContrib/images/prettyPhoto/light_square/sprite.png 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.css 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.css.gz 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.init.js 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.init.js.gz 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.init.uncompressed.js 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.js 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.js.gz 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.uncompressed.css 0644
pub/System/JQPrettyPhotoContrib/jquery.prettyPhoto.uncompressed.js 0644
pub/System/JQPrettyPhotoContrib/Makefile 0644
24 changes: 24 additions & 0 deletions lib/Foswiki/Contrib/JQPrettyPhotoContrib/build.pl
@@ -0,0 +1,24 @@
#!/usr/bin/perl -w
BEGIN { unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); }
use Foswiki::Contrib::Build;

# Create the build object
$build = new Foswiki::Contrib::Build('JQPrettyPhotoContrib');

# (Optional) Set the details of the repository for uploads.
# This can be any web on any accessible Foswiki installation.
# These defaults will be used when expanding tokens in .txt
# files, but be warned, they can be overridden at upload time!

# name of web to upload to
$build->{UPLOADTARGETWEB} = 'Extensions';
# Full URL of pub directory
$build->{UPLOADTARGETPUB} = 'http://foswiki.org/pub';
# Full URL of bin directory
$build->{UPLOADTARGETSCRIPT} = 'http://foswiki.org/bin';
# Script extension
$build->{UPLOADTARGETSUFFIX} = '';

# Build the target on the command line, or the default target
$build->build($build->{target});

Binary file added pub/System/JQPrettyPhotoContrib/1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pub/System/JQPrettyPhotoContrib/2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pub/System/JQPrettyPhotoContrib/3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pub/System/JQPrettyPhotoContrib/4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pub/System/JQPrettyPhotoContrib/5.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions pub/System/JQPrettyPhotoContrib/Makefile
@@ -0,0 +1,7 @@
FOSWIKI_ROOT?=~/foswiki/trunk/core
TARGET=\
jquery.prettyPhoto.js \
jquery.prettyPhoto.init.js \
jquery.prettyPhoto.css

-include $(FOSWIKI_ROOT)/pub/System/JQueryPlugin/Makefile.include
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,24 @@
jQuery(function($) {
var defaults = {
show_title: true,
itemSelector:'a[href]',
title_attr:'data-description',
slideshow: 5000
};

$(".jqPrettyPhoto:not(.jqInitedPrettyPhoto)").livequery(function() {
var $this = $(this),
opts = $.extend({}, defaults, $this.metadata()),
groupRel = "prettyPhoto["+Math.floor(Math.random() * 100)+"]";

$this.addClass("jqInitedPrettyPhoto");
$this.find(opts.itemSelector).attr('rel', groupRel).each(function() {
var $el = $(this),
imgOpts = $.extend({}, $el.metadata()),
text = $el.find("img").attr('alt') || '',
href = imgOpts.origUrl || $el.attr('href');

$el.attr("href", href).attr('data-description', escape('<a href="' + href + '" title="click to download">'+text+'</a>'));
}).prettyPhoto(opts);
});
});

0 comments on commit cc8e0b3

Please sign in to comment.