Changeset 27099

Show
Ignore:
Timestamp:
19.03.2013 17:57:43 (6 years ago)
Author:
ak19
Message:

GS2 RSS feed link from demo about page. This commit adds the necessary rss icon, macros for rss link and rss icon and a javascript function to correct the url, as well as a extra.dm for demo collection which makes use of these.

Location:
main/trunk/greenstone2
Files:
2 added
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/base.dm

    r26977 r27099  
    422422_imagegreenstone_[v=1] {_textdescrgreenstone_} 
    423423 
     424 
     425# RSS link and default RSS icon for embedding in the link 
     426# RSS icon from http://webneel.com/post/freedownload/web-design/icon-design/25-web-rss-icons 
     427 
     428_rssicon_ {<img class="icon" src="_httpimages_/rssicon.png" alt="_collectionname_ RSS feed" title="_collectionname_ RSS feed" onLoad="addDomainToRSSAnchor(this)">} 
     429 
     430_rsslink_ {<a id="rss" href="_gwcgi_?site=localhost&amp;a=rss&amp;c=_cgiargc_&amp;l=_cgiargl_&amp;w=_cgiargw_">_rssicon_</a>} 
     431# e.g. rss link: http://localhost:8283/greenstone/cgi-bin/library.cgi?site=localhost&a=rss&c=demo&l=en&w=utf-8&hostname=localhost:8283 
     432 
    424433########################################################################### 
    425434# Metadata formatting stuff 
  • main/trunk/greenstone2/macros/style.dm

    r27018 r27099  
    229229} 
    230230 
     231# Javascript that's used for appending "&hostname=host:port" to the link to the RSS feed 
     232# The script is activated on loading the rss icon <img>, since onLoad doesn't work on <a> 
     233# The rsslink that embeds rssicon are two macros defined in base.dm 
     234# To use this script, define pagescriptextra macro to contain the domainscript macro 
     235# Can do so at collectionlevel in a collection's extra.dm (try to add it to package about) 
     236 
     237_rssscript_ { 
     238  function addDomainToRSSAnchor (imgtag)  
     239  \{ 
     240     parent = imgtag.parentNode; 
     241     if (parent && parent.href)  
     242     \{ 
     243        parent.href += "&hostname="+location.hostname; 
     244    if(location.port) \{ 
     245           parent.href += ":"+location.port;     
     246        \} 
     247     \} 
     248  \}  
     249} 
    231250 
    232251# imagescript only used in nav_ns4.dm 
     
    256275_imagescript_ 
    257276</script> 
    258  
    259277} 
    260278 
  • main/trunk/greenstone2/macros/zextra.dm

    r23062 r27099  
    1212# redefined macros that have already been defined in the main macro 
    1313# files in this folder 
     14 
     15#package Global 
     16 
     17# '_httpdomain_' is useful for external access to RSS feeds in Greenstone collections 
     18# Uncomment the line below if for some reason you are not using the default Greenstone 
     19# where both 'cgi-bin' and 'collect' are contained within '/greenstone/...' in the URL 
     20 
     21# Make the _httpdomain_ the proper full domain URL. ('localhost' used 
     22#  here for testing purposes.) 
     23 
     24#_httpdomain_ { http://localhost:8282}