Changeset 1242

Show
Ignore:
Timestamp:
2008-10-24 09:11:45 (3 months ago)
Author:
gaspard
Message:

commit 48317208d4fff498af29c68c9383f882f25aac26
Author: Gaspard Bucher <gaspard@teti.ch>

Popup option for images (id starts with '0') should open image in new window.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/helpers/application_helper.rb

    r1237 r1242  
    505505        # if the id starts with '0' or it is not an Image, link to data 
    506506        link = zen_path(img, :format => img.c_ext) 
     507        link_tag = "<a class='popup' href='#{link}' target='_blank'>" 
    507508      end 
    508509    end 
     
    534535    else 
    535536      link = "http://#{link}" unless link =~ %r{(^/|.+://.+)} 
    536       prefix + "<a href='#{link}'>" + image + "</a>" + suffix 
     537      link_tag ||= "<a href='#{link}'>" 
     538      prefix + link_tag + image + "</a>" + suffix 
    537539    end 
    538540  end 
  • trunk/lib/parser/lib/rules/zena.rb

    r1236 r1242  
    16521652     
    16531653    def r_javascripts 
    1654       if @params[:list] == 'all' || @params[:list].nil? 
     1654      if @params[:list].nil? 
    16551655        list = %w{ prototype effects tablekit zena } 
     1656      elsif @params[:list] == 'all' 
     1657        list = %w{ prototype effects dragdrop tablekit zena } 
    16561658      else 
    16571659        list = @params[:list].split(',').map{|e| e.strip} 
  • trunk/test/helpers/zazen_test.rb

    r1236 r1242  
    4545    assert_equal "<p><img src='/en/projects/cleanWater/image24_std.jpg' width='545' height='400' alt='it&apos;s a lake' class='std'/></p>", zazen('!24!') 
    4646    # ** [!024!] inline image, default format, link to full image. 
    47     assert_equal "<p><a href='/oo/projects/cleanWater/image24.jpg'><img src='/en/projects/cleanWater/image24_std.jpg' width='545' height='400' alt='it&apos;s a lake' class='std'/></a></p>", zazen('!024!') 
     47    assert_equal "<p><a class='popup' href='/oo/projects/cleanWater/image24.jpg' target='_blank'><img src='/en/projects/cleanWater/image24_std.jpg' width='545' height='400' alt='it&apos;s a lake' class='std'/></a></p>", zazen('!024!') 
    4848  end 
    4949