Changeset 14946 in project


Ignore:
Timestamp:
06/09/09 01:40:29 (11 years ago)
Author:
azul
Message:

Small fix: in the html for an image, if a tag property is available in the query string but the image does not have that tag, ignore it. Also, in the gallery of images that have a given tag, if an image is clicked, carry the "tag=" information in the query string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/svnwiki-image/trunk/svnwiki-image.scm

    r14936 r14946  
    6666    next = target;
    6767  });
     68  if (!found)
     69    return;
    6870  if (prev)
    69     svnwikiImage.addTagLinksOne(ul, linkTags, prev, '⇩ Previous in tag ' + tag, tag);
     71    svnwikiImage.addTagLinksOne(ul, linkTags, prev, '⇩ Previous in tag: ' + tag, tag);
     72  svnwikiImage.addTagLinksOne(ul, linkTags, tag, 'Tag: ' + tag, tag);
    7073  if (next)
    71     svnwikiImage.addTagLinksOne(ul, linkTags, next, 'Next in tag ' + tag + ' ⇹', tag);
     74    svnwikiImage.addTagLinksOne(ul, linkTags, next, 'Next in tag: ' + tag + ' ⇹', tag);
    7275}
    7376
     
    122125svnwikiImage.imagesList = [];
    123126
    124 svnwikiImage.tagsDisplayImages = function () {
     127svnwikiImage.tagsDisplayImages = function (tag) {
    125128  svnwikiTagsLoader.hideAll();
    126129  if (!svnwikiImage.imagesList.length) {
    127130    svnwikiImage.loadImagesList();
    128131  }
     132  svnwikiImage.currentTag = tag;
    129133  svnwikiImage.updateImagesDisplay();
    130134}
     
    145149}
    146150
     151svnwikiImage.currentTag = null;
     152
    147153svnwikiImage.updateImagesDisplay = function() {
    148154  document.getElementById('tag-list-images').style.display = 'inline'
     
    151157  for (i = 0; i < svnwikiImage.imagesList.length; i ++) {
    152158    url = svnwikiImage.imagesList[i][0];
     159    if (svnwikiImage.currentTag)
     160      url += '?tag=' + svnwikiImage.currentTag;
    153161    name = svnwikiImage.imagesList[i][1];
    154162    var img = svnwikiJavascript.makeElement('img');
     
    383391
    384392(define (tags-view env)
    385   (let-from-environment env (return)
     393  (let-from-environment env (return path)
    386394    (return
    387395      (list
    388396        'image
    389397        "Images"
    390         "svnwikiImage.tagsDisplayImages()"
     398        (format #f "svnwikiImage.tagsDisplayImages('~A')" (svnwiki-basename path))
    391399        (lambda (files)
    392400          (html-stream
Note: See TracChangeset for help on using the changeset viewer.