Changeset 6295
- Timestamp:
- 02/12/10 17:28:21 (2 years ago)
- Location:
- trunk/ImageGalleryPlugin
- Files:
-
- 7 edited
-
data/System/ImageGalleryPlugin.txt (modified) (7 diffs)
-
lib/Foswiki/Plugins/ImageGalleryPlugin.pm (modified) (2 diffs)
-
lib/Foswiki/Plugins/ImageGalleryPlugin/Core.pm (modified) (16 diffs)
-
lib/Foswiki/Plugins/ImageGalleryPlugin/DEPENDENCIES (modified) (1 diff)
-
pub/System/ImageGalleryPlugin/style.css (modified) (1 diff)
-
pub/System/ImageGalleryPlugin/style.css.gz (modified) (previous)
-
pub/System/ImageGalleryPlugin/style.uncompressed.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ImageGalleryPlugin/data/System/ImageGalleryPlugin.txt
r4425 r6295 1 %META:TOPICINFO{author="ProjectContributor" date="12 34443922" format="1.1" version="1.2"}%1 %META:TOPICINFO{author="ProjectContributor" date="1252914561" format="1.1" version="1.3"}% 2 2 ---+!! <nop>ImageGalleryPlugin 3 3 <table style="float:right"> … … 40 40 | include | regular expression an image must match to be part of the gallery | 41 41 | exclude | regular expression an image must _not_ match to be part of the gallery | 42 | frontend | select gallery interface, possible values are =lightbox= and =default=; \ 43 (defaults to =lightbox= if Foswiki:Extensions/JQueryPlugin is installed and =default= otherwise) | 42 44 | field | specify which property of the image has to match using =include= or =exclude=; \ 43 45 possible values: name, comment (default: name) | … … 56 58 limit while preserving aspect ratio %BR% (default: 0) | 57 59 | minheight | minimal display height of an image %BR% (default: 0) | 60 | header | header part of the gallery; only used if there is a =format= | 58 61 | format | html format of an image %BR% \ 59 62 (default: <a href="$origurl"><img src="$imageurl" title="$comment" width="$width" height="$height"/></a>) | 63 | footer | footer part of the gallery; only used if there is a =format= | 60 64 | titles | toggles image and thumnail titles on and off %BR% \ 61 (default: o n) |65 (default: off) | 62 66 | title | html format of an image title; "off" will hide the image's title %BR% \ 63 (default: $comment ($imgnr/$nrimgs) $reddot) |67 (default: $comment ($imgnr/$nrimgs)) | 64 68 | thumbtitle | html format of a thumbnail title; "off" will hide the thumbnail's title %BR% \ 65 (default: $comment $reddot) |69 (default: $comment) | 66 70 | sort | set the initial order of the images, can be name, date, size or comment (default:date) | 67 71 | reverse | invert the initial order of the images, can be on or off (default:off) | … … 78 82 | $nrimages | the total number of images in the gallery | 79 83 | $n | a linefeed | 80 | $reddot | render a red-dot anchor to access the attachment |81 84 | $width | the display width of the image | 82 85 | $height | the display height of the image | … … 139 142 prefix the comment of the attachment with a sequence number. For example: given a 140 143 picture whose comment is "My old bike" that should be put at position 12 141 in your image gallery then change the comment to "12 - My old bike". This144 in your image gallery then change the comment to "12 <nop>- My old bike". This 142 145 will put the image at the desired position. Sequence numbers don't necessarily need 143 146 to be unique, that is if there's another picture with a comment like 144 "12 - My new bike" then the natural order of the both is relevant. In general,147 "12 <nop>- My new bike" then the natural order of the both is relevant. In general, 145 148 a picture will be put at position =<nr>= if its attachment comment has the format 146 149 <verbatim> … … 158 161 --> 159 162 | Plugin Author: | Michael Daum, Will Norris | 160 | Copyright ©: | 2002-2009, Will Norris; 2005-20 09, Michael Daum http://michaeldaumconsulting.com |163 | Copyright ©: | 2002-2009, Will Norris; 2005-2010, Michael Daum http://michaeldaumconsulting.com | 161 164 | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | 162 165 | Release: | %$RELEASE% | 163 166 | Version: | %$VERSION% | 164 167 | Change History: | <!-- versions below in reverse order --> | 168 | 12 Feb 2010 | new =frontend= parameter defaulting to "lightbox" when Foswiki:Extensions/JQueryPlugin is installed | 165 169 | 03 Jul 2009 | shipping minified and compressed css files now | 166 170 | 24 Apr 2009 | converted to foswiki plugin | … … 191 195 | 10 May 2005 | fixed igp id clash error found by Martin Cleaver; \ 192 196 capture <nop>ImageMagick error messages; \ 193 don't trust attachment info -check for attachment existence as well;\197 don't trust attachment info, check for attachment existence as well;\ 194 198 added refresh query parameter to recompute images | 195 199 | 09 May 2005 | fixed errors reported by Marcel Trap; \ -
trunk/ImageGalleryPlugin/lib/Foswiki/Plugins/ImageGalleryPlugin.pm
r4425 r6295 1 1 # Copyright (C) 2002-2009 Will Norris. All Rights Reserved. (wbniv@saneasylumstudios.com) 2 # Copyright (C) 2005-20 09Michael Daum http://michaeldaumconsulting.com2 # Copyright (C) 2005-2010 Michael Daum http://michaeldaumconsulting.com 3 3 # 4 4 # This program is free software; you can redistribute it and/or … … 24 24 25 25 $VERSION = '$Rev$'; 26 $RELEASE = '5. 01';26 $RELEASE = '5.10'; 27 27 $NO_PREFS_IN_TOPIC = 1; 28 28 $SHORTDESCRIPTION = 'Displays image gallery with auto-generated thumbnails from attachments'; -
trunk/ImageGalleryPlugin/lib/Foswiki/Plugins/ImageGalleryPlugin/Core.pm
r4425 r6295 2 2 # 3 3 # Copyright (C) 2002-2009 Will Norris. All Rights Reserved. (wbniv@saneasylumstudios.com) 4 # Copyright (C) 2005-20 09Michael Daum http://michaeldaumconsulting.com4 # Copyright (C) 2005-2010 Michael Daum http://michaeldaumconsulting.com 5 5 # 6 6 # This program is free software; you can redistribute it and/or … … 19 19 20 20 use strict; 21 use Foswiki::Func (); 22 use Foswiki::Plugins (); 21 23 use constant DEBUG => 0; # toggle me 22 24 use vars qw(%imageSuffixes); … … 42 44 43 45 $this->{id} = $id; 46 $this->{session} = $Foswiki::Plugins::SESSION; 44 47 $this->{query} = Foswiki::Func::getCgiQuery(); 45 48 $this->{topic} = $topic; … … 180 183 $this->{minwidth} = $this->{maxwidth} if $this->{minwidth} > $this->{maxwidth}; 181 184 $this->{format} = $params->{format}; 185 $this->{frontend} = $params->{frontend}; 186 $this->{header} = $params->{header}; 187 $this->{footer} = $params->{footer}; 182 188 $this->{title} = $params->{title} || ' $comment ($imgnr/$nrimgs)'; 183 189 $this->{doTitles} = ($this->{title} eq 'off')?0:1; … … 216 222 $this->{reverse} = $params->{rev} || $params->{reverse} || 'off'; 217 223 $this->{reverse} = 'off' unless $this->{reverse} =~ /^on|off$/; 224 225 unless (defined $this->{frontend}) { 226 $this->{frontend} = (Foswiki::Func::getContext()->{JQueryPluginEnabled})?'lightbox':'default'; 227 } 218 228 219 229 return 1; … … 275 285 my $id = $this->{query}->param("id") || ''; 276 286 277 if ($this->{format}) { 287 if ($this->{frontend} eq 'lightbox') { 288 require Foswiki::Plugins::JQueryPlugin; 289 Foswiki::Plugins::JQueryPlugin::createPlugin('slimbox'); 290 $this->{header} = "<noautolink><div class=\"igp jqSlimbox {itemSelector:'.igpThumbNail', singleMode:true}\" id='igp$this->{id}'>\n<a name='igp$this->{id}'></a>\n"; 291 $this->{footer} = "<span class='foswikiClear'></span></div></noautolink>"; 292 $this->{format} = "<a href='\$imageurl' class='igpThumbNail {origurl:\"\$origurl\"}' title='\$comment'><img src='\$thumburl' alt='\$name' /></a>" 293 unless defined $this->{format}; 294 $result = $this->renderFormatted(); 295 } elsif ($this->{format}) { 278 296 $result = $this->renderFormatted(); 279 297 } else { … … 333 351 $result .= 334 352 "<link rel='parent' href='". 335 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view').353 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}). 336 354 "' title='Thumbnails' />\n"; 337 355 if ($firstImg && $firstImg->{name} ne $filename) { 338 356 $result .= 339 357 "<link rel='first' href='". 340 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',358 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 341 359 'id'=>$this->{id}, 342 360 'filename'=>$firstImg->{name}, … … 347 365 $result .= 348 366 "<link rel='last' href='". 349 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',367 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 350 368 'id'=>$this->{id}, 351 369 'filename'=>$lastImg->{name}, … … 356 374 $result .= 357 375 "<link rel='next' href='". 358 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',376 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 359 377 'id'=>$this->{id}, 360 378 'filename'=>$nextImg->{name}, … … 365 383 $result .= 366 384 "<link rel='previous' href='". 367 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',385 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 368 386 'id'=>$this->{id}, 369 387 'filename'=>$prevImg->{name}, … … 401 419 if ($firstImg && $firstImg->{name} ne $filename) { 402 420 $result .= "<a class='igpNaviFirst' title='go to first' href='". 403 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',421 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 404 422 'id'=>$this->{id}, 405 423 'filename'=>$firstImg->{name}, … … 411 429 if ($prevImg) { 412 430 $result .= "<a class='igpNaviPrev' title='go to previous' href='". 413 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',431 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 414 432 'id'=>$this->{id}, 415 433 'filename'=>$prevImg->{name}, … … 421 439 if ($nextImg) { 422 440 $result .= "<a class='igpNaviNext' title='go to next' href='". 423 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',441 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 424 442 'id'=>$this->{id}, 425 443 'filename'=>$nextImg->{name}, … … 431 449 if ($lastImg && $lastImg->{name} ne $filename) { 432 450 $result .= "<a class='igpNaviLast' title='go to last' href='". 433 Foswiki::Func::getScriptUrl($this->{web}, $this->{topic}, 'view',451 $this->{session}->getScriptUrl(0, 'view', $this->{web}, $this->{topic}, 434 452 'id'=>$this->{id}, 435 453 'filename'=>$lastImg->{name}, … … 440 458 } 441 459 $result .= "<a class='igpNaviDone' href='". 442 Foswiki::Func::getScriptUrl($this->{web},$this->{topic}, 'view', "#"=>"igp$this->{id}").460 $this->{session}->getScriptUrl(0, 'view', $this->{web},$this->{topic}, "#"=>"igp$this->{id}"). 443 461 "'><span>done</span></a>"; 444 462 … … 823 841 $format =~ s/\$web/$image->{IGP_web}/gos; 824 842 $format =~ s/\$topic/$image->{IGP_topic}/gos; 843 $format =~ s/\$id/$this->{id}/gos; 825 844 826 845 } -
trunk/ImageGalleryPlugin/lib/Foswiki/Plugins/ImageGalleryPlugin/DEPENDENCIES
r3681 r6295 1 1 Image::Magick,>=6.2.4.5,cpan,Required. 2 2 Graphics::Magick,>=1.1.11,cpan,Optional. 3 Foswiki::Plugins::JQueryPlugin,>=6283,perl,Optional 3 4 -
trunk/ImageGalleryPlugin/pub/System/ImageGalleryPlugin/style.css
r4425 r6295 12 12 .igpNaviNext{background-image:url(control-right.png);}.igpNaviLast:hover, 13 13 .igpNaviLast{background-image:url(control-end.png);}.igpNaviFirst.igpNaviDisabled{background-image:url(control-start-gray.png);}.igpNaviPrev.igpNaviDisabled{background-image:url(control-left-gray.png);}.igpNaviNext.igpNaviDisabled{background-image:url(control-right-gray.png);}.igpNaviLast.igpNaviDisabled{background-image:url(control-end-gray.png);}.igpNaviDone:hover, 14 .igpNaviDone{background-image:url(cross.png);} 14 .igpNaviDone{background-image:url(cross.png);}.jqSlimbox .igpThumbNail{float:left;padding:5px;} -
trunk/ImageGalleryPlugin/pub/System/ImageGalleryPlugin/style.uncompressed.css
r4425 r6295 107 107 } 108 108 109 .jqSlimbox .igpThumbNail { 110 float:left; 111 padding:5px; 112 }
Note: See TracChangeset
for help on using the changeset viewer.
