Changeset 27150 for main


Ignore:
Timestamp:
2013-03-28T17:46:57+13:00 (11 years ago)
Author:
ak19
Message:

Shifting position of RSS link in GS2 to header area. Smaller icon. Changes to demo collection's extra.dm macro file, as the RSS link will appear on all pages in the header now the user specifies that it should appear. Moved the actual rsslink macro and javascript into nav_css which defines the header, rather than in base and style.dm where the rsslink macro and associated javacsript function were before'

Location:
main/trunk/greenstone2
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/collect/demo/macros/extra.dm

    r27099 r27150  
    1 package about
    2 
    3 _pagescriptextra_ {
    4  _rssscript_
    5 }
    6 _pagefooterextra_ {
     1package Global
     2_optrsslink_ {
    73_rsslink_
    84}
    9 
  • main/trunk/greenstone2/macros/base.dm

    r27099 r27150  
    423423
    424424
    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 
    433425###########################################################################
    434426# Metadata formatting stuff
  • main/trunk/greenstone2/macros/nav_css.dm

    r23519 r27150  
    1414#######################################################################
    1515
    16 _globallinks_ {_If_("_cgiargu_" ne "1",_homelink_) _helplink_ _preflink__optloginlink_}
     16_globallinks_ {_If_("_cgiargu_" ne "1",_homelink_) _helplink_ _preflink__optloginlink_ _optrsslink_}
    1717_homelink_  {_navtaborig_(_httppagehome_,_linktextHOME_,_textdescrhome_)}
    1818_helplink_  {_navtaborig_(_httppagehelp_,_linktextHELP_,_textdescrhelp_)}
     
    3636      </script>
    3737    )
     38}
     39
     40
     41# if a collection should have an rss link,
     42# set _optrsslink_ for that collection's global package to contain _rsslink_
     43_optrsslink_ {}
     44
     45# RSS link and default RSS icon for embedding in the link
     46# RSS icon from http://webneel.com/post/freedownload/web-design/icon-design/25-web-rss-icons
     47# 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
     48# And the javascript that's used for appending "&hostname=host:port" to the link to the RSS feed
     49# The script is activated on loading the rss icon <img>, since onLoad doesn't work on <a>
     50# The rsslink that embeds rssicon are two macros defined in base.dm
     51# To use this script, define pagescriptextra macro to contain the domainscript macro
     52# Can do so at collectionlevel in a collection's extra.dm (try to add it to package about)
     53
     54_rssicon_ {<img class="icon" src="_httpimages_/rssicon.png" alt="_collectionname_ RSS feed" title="_collectionname_ RSS feed" onLoad="addDomainToRSSAnchor(this)">}
     55
     56_rsslink_ {<a id="rss" href="_gwcgi_?site=localhost&amp;a=rss&amp;c=_cgiargc_&amp;l=_cgiargl_&amp;w=_cgiargw_">_rssicon_</a>
     57<script type="text/javascript">
     58function addDomainToRSSAnchor (imgtag)
     59  \{
     60     parent = imgtag.parentNode;
     61     if (parent && parent.href)
     62     \{
     63        parent.href += "&hostname="+location.hostname;
     64    if(location.port) \{
     65           parent.href += ":"+location.port;
     66        \}
     67     \}
     68  \}
     69</script>
    3870}
    3971
  • main/trunk/greenstone2/macros/style.dm

    r27099 r27150  
    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 }
    250231
    251232# imagescript only used in nav_ns4.dm
Note: See TracChangeset for help on using the changeset viewer.