Ignore:
Timestamp:
2010-12-21T23:19:21+13:00 (11 years ago)
Author:
davidb
Message:

Introduction of 'web-2.0' capabilities, triggered by setting the macro _activateweb20_ to 1. This in turn adds in a 'login' and 'logout' feature in the main navigation bar.

File:
1 edited

Legend:

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

    r23501 r23519  
    151151<div class="bannerextra">_pagebannerextra_</div>
    152152<!-- end of page banner -->
    153 _If_("_cgiargtalkback_" eq "1",_talkback:uploadForm_)
     153_If_("_activateweb20_" eq "2",
     154  _If_("_activatetalkback_" eq "1",_talkback:uploadForm_)
     155)
    154156}
    155157
     
    162164<p>
    163165<!-- end of page banner -->
    164 _If_("_cgiargtalkback_" eq "1",_talkback:uploadForm_)
     166_If_("_activateweb20_" eq "2",
     167  _If_("_activatetalkback_" eq "1",_talkback:uploadForm_)
     168)
    165169}
    166170
     
    191195}
    192196
     197_loginscript_ {
     198   function appendUsernameArgs(id,addOn)
     199   \{
     200     var a=document.getElementById(id);
     201     var url = a.getAttribute("href");
     202     if (url == "") \{
     203       url = document.location.toString();
     204     \}
     205
     206     //alert("url before = " + url);
     207
     208     // clear out any earlier user name/authentication values
     209     url = url.replace(/(&|\\\\?)uan=\\d\{0,1\}/g,"");
     210     url = url.replace(/(&|\\\\?)un=[a-z0-9:\\-]*/g,"");
     211     url = url.replace(/(&|\\\\?)pw=[a-z0-9:\\-]*/g,"");
     212
     213     //alert("url after = " + url);
     214
     215     var gwcgi = "_gwcgi_";
     216
     217     var tailUrl = url.substr(url.length-gwcgi.length);
     218
     219     url += (tailUrl == "_gwcgi_") ? "?" : "&";
     220     url += addOn;
     221
     222     //alert("url with add on = " + url);
     223
     224     a.setAttribute("href",url);
     225   \}
     226}
     227
     228
    193229# imagescript only used in nav_ns4.dm
    194230_globalscripts_{
    195 
    196 _If_("_activateseaweed_" eq "1",_seaweed_)
     231_If_("_activateweb20_" eq "2",
     232  <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
     233  _If_("_activateseaweed_" eq "1",_seaweedscript_)
     234  _If_("_activatetalkback_" eq "1",_talkbackscript_)
     235)
    197236_If_(_pagescriptfileextra_,_pagescriptfileextra_)
    198237<script language="javascript" type="text/javascript">
     238_loginscript_
    199239_If_(_pagescriptextra_,_pagescriptextra_)
    200240_collectionspecificscript_
     
    205245
    206246_globalscripts_ [v=1] {
     247_If_("_activateweb20_" eq "2",
     248  <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
     249  _If_("_activateseaweed_" eq "1",_seaweedscript_)
     250  _If_("_activatetalkback_" eq "1",_talkbackscript_)
     251)
     252_If_(_pagescriptfileextra_,_pagescriptfileextra_)
    207253<script language="javascript" type="text/javascript">
    208254<!--
     255_loginscript_
    209256_If_(_cgiargx_,_scriptdetach_)
    210 _pagescriptextra_
     257_If_(_pagescriptextra_,_pagescriptextra_)
    211258_collectionspecificscript_
    212259// -->
Note: See TracChangeset for help on using the changeset viewer.