Re: [greenstone-devel] CSS for GS interface

From Stefan Boddie
DateTue, 03 Jun 2003 16:44:45 +1200
Subject Re: [greenstone-devel] CSS for GS interface
In-Reply-To (OF150F2822-7FD3B87F-ON69256D23-002A0EB9-69256D23-002A0EDF-ntu-edu-au)
Stephen.DeGabrielle@ntu.edu.au wrote:
> I have tried it by changing pref.dm like such;
>
>
> _formatoption_ {
> <td>_textformat_</td>
> <td><select name="v" onChange="updatev();">
> <option value="0"selected>_textgraphical_
> <option value="1"selected>_texttextual_
> <option value="2"selected>_textcsstextual_
> </select></td>
> }
>
>
>
> english.dm ;
>
> _textcsstextual_ {cssTextual}
>
> -but it doesn't stick - I get the option - but it always assumes
> graphical when the page reloads.
>
> I think it is the receptionist doing this (correct me if I am wrong)
>


You're right. In the check_mainargs() function of
src/recpt/receptionist.cpp there's a couple of lines of code making sure
the "v" argument is either "0" or "1".


> the javascript is
>
> function updatev () {
> value =
> document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
> href = location.href;
> if (href.match(/&v=\d/)) href = href.replace(/&v=\d/, "&v=" + value);
> else href += "&v=" + value;
> location.href = href + getargs();
> }
>
> (From pref.dm)
>
> does anyone know how I can get past this problem.
>
>

You can either remove the offending code from receptionist.cpp (it's not
really useful anyway and most similar range checking code for arguments
has already been removed) or use a different argument.

My preference would probably be to use a new argument. For example:

In your main.cfg file add something like

cgiarg shortname=modern "longname=modern interface"
multiplechar=false argdefault=0
defaultstatus=weak savedarginfo=must

The above dynamically creates a new cgi argument called "modern". Next
add the following to your main.cfg:

pageparam modern 0

This declares the new "modern" argument to be a page parameter (i.e. an
option for use within macro files) and gives it a default value of 0
(i.e. macro definitions which don't have "modern=n" set will be treated
as if they have "modern=0").

Finally, update the "macroprecedence" field in main.cfg to include the
new argument (i.e. it'd become something like "macroprecedence
c,v,l,modern").


Having done all of the above you should be able to add "modern"
arguments to any macro definitions you like. For example, as a test, try
overriding the 537 macro in base.dm with something like:

537 [modern=1] {5000}

To switch to the new interface version you then just need to set the
modern cgi argument to 1. For testing purposes you can just append
"&modern=1" to any greenstone url. Eventually you'd probably want to
alter the preferences page to have some way to set this option though.


I hope some of this helps (and that it's not too late).

cheers,
Stefan.


>
> s.
>
>
>
>
>
> _________________________________________________
> Stephen De Gabrielle
> Digitisation Officer
> AraDA Project
>
> Northern Territory University Library
> http://www.ntu.edu.au/library
> Tel: (08) 8946 7009 from overseas: 61 8 8946 7009
> Postal address: P.O.Box 41246, Casuarina, NT, 0811, Australia
> CRICOS Provider No: 00300K
>
>
> *"Gordon Paynter" <gordon.paynter@ucr.edu>*
> Sent by: greenstone-devel-bounces@list.scms.waikato.ac.nz
> 10/05/2003 11:18 AM MST
> Please respond to gordon.paynter
>
> To: <greenstone-devel@orc.cs.waikato.ac.nz>
> cc:
> bcc:
> Subject: Re: [greenstone-devel] CSS for GS interface
>
>
> Stephen De Gabrielle wrote:
> > I am also working on using CSS to replace the rollover menus, with the
> > goal of making pages with less images, that also 'degrade gracefully' on
> > older browsers. This would also remove the need for javascript to create
> > rollovers, and the need for the less attractive text mode. How does the
> > development team feel about this? I am getting close and would like to
> > submit the changes as a patch (a CSS file and changes to some macro
> > files).
>
> Disc: not really actively developing anymore.
>
> This sounds like a great idea (No Javascript? I'm sold!) and something
> I've often wantesd to do myself, but I've always been hestitant about
> making big changes to the interface like this. Greenstone runs on a lot
> of platforms, some of which are very old and need that text mode, and we
> don't want to have to debug all of them.
>
> One way around this that I have thought about though is extending the
> text/graphics mode flag in the macro files. From memory, macros can be
> marked [v=0] for text and [v=1] for graphics, and this can be set in
> preferences or as a default in the main.cfg file.
>
> Can anyone say how difficult it would be to set it up so that [v=2]
> indicated a "modern web browser" interface, where we could develop a CSS
> version. This would let us include a new interface without sacrificing
> the old one, yet anyone who wanted to use the new one could simply switch
> over by updating their main.cfg.
>
>
> Does anyone know if the [v=N] flag can be given any value, or is it only 0
> or 1? Is there any other reason this scheme wouldn't work?
>
> Gordon
>
>
>
>
> _______________________________________________
> greenstone-devel mailing list
> greenstone-devel@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>
>
>
> _________________________________________________
> Stephen De Gabrielle
> Digitisation Officer
> AraDA Project
>
> Northern Territory University Library
> http://www.ntu.edu.au/library
> Tel: (08) 8946 7009 from overseas: 61 8 8946 7009
> Postal address: P.O.Box 41246, Casuarina, NT, 0811, Australia
> CRICOS Provider No: 00300K
>
>
> *"Gordon Paynter" <gordon.paynter@ucr.edu>*
> Sent by: greenstone-devel-bounces@list.scms.waikato.ac.nz
> 10/05/2003 11:18 AM MST
> Please respond to gordon.paynter
>
> To: <greenstone-devel@orc.cs.waikato.ac.nz>
> cc:
> bcc:
> Subject: Re: [greenstone-devel] CSS for GS interface
>
>
> Stephen De Gabrielle wrote:
> > I am also working on using CSS to replace the rollover menus, with the
> > goal of making pages with less images, that also 'degrade gracefully' on
> > older browsers. This would also remove the need for javascript to create
> > rollovers, and the need for the less attractive text mode. How does the
> > development team feel about this? I am getting close and would like to
> > submit the changes as a patch (a CSS file and changes to some macro
> > files).
>
> Disc: not really actively developing anymore.
>
> This sounds like a great idea (No Javascript? I'm sold!) and something
> I've often wantesd to do myself, but I've always been hestitant about
> making big changes to the interface like this. Greenstone runs on a lot
> of platforms, some of which are very old and need that text mode, and we
> don't want to have to debug all of them.
>
> One way around this that I have thought about though is extending the
> text/graphics mode flag in the macro files. From memory, macros can be
> marked [v=0] for text and [v=1] for graphics, and this can be set in
> preferences or as a default in the main.cfg file.
>
> Can anyone say how difficult it would be to set it up so that [v=2]
> indicated a "modern web browser" interface, where we could develop a CSS
> version. This would let us include a new interface without sacrificing
> the old one, yet anyone who wanted to use the new one could simply switch
> over by updating their main.cfg.
>
>
> Does anyone know if the [v=N] flag can be given any value, or is it only 0
> or 1? Is there any other reason this scheme wouldn't work?
>
> Gordon
>
>
>
>
> _______________________________________________
> greenstone-devel mailing list
> greenstone-devel@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> greenstone-devel mailing list
> greenstone-devel@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel