added class for internal links, some cleanup
authorTimm S. Mueller <tmueller@neoscientists.org>
Mon, 19 Mar 2007 01:53:10 +0100
changeset 162e97a1e4e7d44
parent 161 bef6c06848eb
child 163 358378de6a06
added class for internal links, some cleanup
cgi-bin/loona.lua
     1.1 --- a/cgi-bin/loona.lua	Sun Mar 18 20:03:05 2007 +0100
     1.2 +++ b/cgi-bin/loona.lua	Mon Mar 19 01:53:10 2007 +0100
     1.3 @@ -438,16 +438,15 @@
     1.4  --	internal link, propagation of lang, profile, session
     1.5  
     1.6  function loona:link(section, text, ...)
     1.7 -	return self:ilink(self:href(section, unpack(arg)), text or section)
     1.8 +	return self:ilink(self:href(section, unpack(arg)), text or section,
     1.9 +	' class="intlink"')
    1.10  end
    1.11  
    1.12  
    1.13  --	external link (opens in a new window), no argument propagation
    1.14  
    1.15  function loona:elink(target, text)
    1.16 -	return self:ilink(target, text or target,
    1.17 -		not self.config.extlinksamewindow and
    1.18 -		' class="extlink" onclick="void(window.open(this.href, \'\', \'\')); return false;"')
    1.19 +	return self:ilink(target, text or target, self.config.extlinkextra)
    1.20  end
    1.21  
    1.22  
    1.23 @@ -1349,6 +1348,8 @@
    1.24  	o.config.htdocsdir = posix.abspath(o.config.htdocsdir or "../htdocs")
    1.25  	o.config.htmlcachedir = 
    1.26  		posix.abspath(o.config.htmlcachedir or "../var/htmlcache")
    1.27 +	o.config.extlinkextra = o.config.extlinksamewindow and ' class="extlink"'
    1.28 +		or ' class="extlink" onclick="void(window.open(this.href, \'\', \'\')); return false;"'
    1.29  	
    1.30  	-- Create proxy for on-demand loading of locales
    1.31