Changeset 3878 for trunk/gsdl


Ignore:
Timestamp:
2003-03-14T08:35:39+13:00 (21 years ago)
Author:
dana
Message:

added usability stuff -- major addition is usabilityscript and usability interfaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/base.dm

    r3861 r3878  
    3434_iconcollection_ {}
    3535_collectionname_ {}
     36
     37package Usability
     38
     39_content_ {
     40<h2>_textaboutusabilitytitle_</h2>
     41<p>_textaboutusability_
     42}
     43_pagetitle_{_textaboutusabilitypagetitle_}
     44
     45package Privacy
     46_content_ {
     47<h2>_textaboutprivacytitle_</h2>
     48<p>_textaboutprivacy_
     49}
     50_pagetitle_{_textaboutprivacypagetitle_}
     51
     52package Global
     53 
    3654
    3755_imagecollection_ {_If_("_iconcollection_" ne "",
     
    89107_widthtspace_ {2}
    90108
     109_usability_ {}
     110
    91111# all cgi args are set as _cgiargX_ macros - those I've put here
    92112# are those that need to default to something
     
    142162
    143163_gsimage_ [v=1] {<a href="_1_">_5_</a><br>}
     164
     165_usabilityscript_ {
     166
     167//this is for where something goes wrong and an error message has to be shown.
     168function failnicely(message,usabwindow)\{
     169  var errhtml='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
     170  errhtml+='<head><title>_greenstoneusabilitytext__texterror_</title><meta http-equiv="Content-Type" content="text/html; charset=_cgiargw_"></head><body bgcolor="#FFFFFF">';
     171  errhtml+='_usabbanner_'; 
     172  errhtml+=message;
     173  errhtml+='<p><form action=""><input type="button" value="_textclosewindow_" onClick="window.close();"></form>';
     174  errhtml+='</body></html>';
     175  usabwindow.document.write(errhtml);
     176  usabwindow.document.close();
     177\}
     178
     179function usabilityfunction()\{
     180
     181  checkusab=window.open("","checkusab","scrollbars=1,toolbars=0,height=600,width=400");
     182
     183  //set up the window
     184  var winhtml='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
     185  winhtml += '<html><head><title>_greenstoneusabilitytext_</title>';
     186  winhtml += '<script type="text/javascript">\\n';
     187 
     188  //this function is for getting the time when the complaint data is sent
     189  winhtml += 'function gettime()\\{\\n';
     190  winhtml += 'document.usabform.sendtime.value = (new Date()).toString();\\}\\n';
     191
     192  //this function is to allow the user to track the usability report   
     193  winhtml+='function viewdetails()\\{\\n';
     194  winhtml+='\\t alert(\\'_textunderdev_\\');\\}';   
     195
     196
     197  //this function is to allow the user to track the usability report   
     198  winhtml+='function trackreport()\\{\\n';
     199  winhtml+='\\t alert(\\'_textunderdev_\\');\\}';       
     200
     201  //this function is to show the privacy/about data in a new window
     202  winhtml+='function infowindow(url)\\{  \\
     203   infowin = window.open(url,\\'infowin\\'); \\
     204 \\}';
     205 
     206  winhtml += '</script>'
     207
     208  //need a character type for valid html
     209  winhtml+='<meta http-equiv="Content-Type" content="text/html; charset=_cgiargw_"></head><body bgcolor=\"#FFFFFF\">';
     210
     211  //get the location of the cgi program
     212  cgiloc='_gwcgi_';
     213  if(cgiloc.lastIndexOf("/")<0)\{
     214     failnicely('_cannotfindcgierror_', checkusab);
     215     return;
     216  \}   
     217  cgiloc=cgiloc.substring(0,(cgiloc.lastIndexOf("/")+1));   
     218  cgiloc+='perl.cgi';
     219   
     220  //adds the banner with the koru-thing and the links to about and privacy
     221  //information
     222  winhtml+='_usabbanner_';
     223  winhtml+='_aboutprivacylinks_';
     224   
     225
     226  // set up the form   
     227  winhtml += '<form name="usabform" method="post" action="'+cgiloc+'" onSubmit="gettime();" target="_blank">';
     228  winhtml += '_usabinterface_';
     229
     230  //get javascript environment variables
     231
     232  // to replace &s in the URL with &amp;s
     233  urlgs=new String(window.location);
     234  a=urlgs.split("&");
     235  urlgs=a.join("&amp;");
     236  winhtml+=('<input type="hidden" name="URL" value="'+urlgs+'">');
     237 
     238  winhtml+=('<input type="hidden" name="resolution" value="'+window.screen.width+'x'+window.screen.height+'">');
     239  winhtml+=('<input type="hidden" name="screencolour" value="'+window.screen.color+'">');
     240
     241  //colordepth and pixeldepth are NS and IE versions of the same thing.
     242   if(screen.colorDepth)\{
     243    winhtml+=('<input type="hidden" name="pixeldepth" value="'+window.screen.colorDepth+'">');
     244   \}
     245  else\{
     246    winhtml+=('<input type="hidden" name="pixeldepth" value="'+window.screen.pixelDepth+'">');
     247   \}
     248   
     249  winhtml+=('<input type="hidden" name="browser" value="'+navigator.platform+' ,'+navigator.appName+', '+navigator.appVersion+', '+navigator.appCodeName+', '+navigator.appUserAgent+'">');
     250  winhtml+=('<input type="hidden" name="language" value="'+navigator.language+'">');       
     251  winhtml+=('<input type="hidden" name="opentime" value="'+(new Date()).toString()+'">');   
     252  winhtml+=('<input type="hidden" name="sendtime" value="None">');
     253  if(eval(document.getElementsByTagName != undefined))\{   
     254   //get interface variables
     255   if(document.getElementsByTagName("form"))\{
     256     docarray=document.getElementsByTagName("input");
     257     if(docarray.length>0)\{
     258       for(i=0; i<docarray.length; i++)\{
     259          //this leaves out uninteresting inputs, such as buttons
     260      //and unchecked checkboxes
     261         if(docarray[i].type!='reset' && docarray[i].type!='button' &&
     262        docarray[i].type!='image' && docarray[i].type!='submit'
     263        && !((docarray[i].type=='radio'|| docarray[i].type=='checkbox') &&
     264        !docarray[i].checked))\{
     265           winhtml+=('<input type="hidden" name="'+docarray[i].type+'-'+docarray[i].name+'" value="'+docarray[i].value+'">');
     266     \}     
     267       \}
     268     \}
     269     docarray=document.getElementsByTagName("select")
     270     if(docarray.length>0)\{
     271        for(i=0; i<docarray.length; i++)\{
     272           winhtml+=('<input type="hidden" name="'+docarray[i].type+'-'+docarray[i].name+'" value="'+docarray[i].value+'">');
     273         \}
     274      \}
     275      docarray=document.getElementsByTagName("textarea")
     276      if(docarray.length>0)\{
     277        for(i=0; i<docarray.length; i++)\{
     278           winhtml+=('<input type="hidden" name="'+docarray[i].type+'-'+docarray[i].name+'" value="'+docarray[i].value+'">');
     279         \}
     280      \}
     281   \}
     282 \}
     283  //finish the form
     284  winhtml += '</form>';
     285 
     286  winhtml +='</body></html>'
     287
     288   
     289  //write to the window
     290  checkusab.document.write(winhtml);
     291  checkusab.document.close();   
     292  return;   
     293
     294\}
     295}
     296
     297#####################################################################
     298#
     299#  These macros are for use by the usability logging (I'd like to
     300#  complain)  functionality - they are to be included in a JavaScript
     301#  string, hence the \s
     302#
     303#####################################################################
     304
     305_usabinterface_{}
     306
     307#the banner to "brand" any boxes as part of the usability interface
     308_usabbanner_{<table width=\"100%\"><tr><td><h1 style="font-size:20px; font-family:sans-serif; vertical-align:middle">_greenstoneusabilitytext_</h1></td><td align="right" width="135"><img src=\"_httpusabbanner_\" title=\"_textusabbanner_\" alt=\"_textusabbanner_\"></td></tr></table>}
     309
     310#the about and privacy lins separated by a mid dot.
     311_aboutprivacylinks_ {<a href="javascript:infowindow(\\'_gwcgi_?e=_compressedoptions_&amp;a=p&amp;p=Usability\\')">_textabout_</a> &#8226; <a href="javascript:infowindow(\\'_gwcgi_?e=_compressedoptions_&amp;a=p&amp;p=Privacy\\')">_textprivacy_</a>}
     312
     313#gives a text only interface with some guff about privacy
     314_usabtextonly_{ \\
     315_textonlyusabinterface_ \\
     316_usabyesnosubmit_}
     317
     318_usabyesnosubmit_{<p><input type="submit" value="_textyes_"><input type="button" value="_textno_" onClick="window.close();">}
     319
     320#gives an interface with the privacy guff at the bottom, and
     321#steps to describe the problem
     322_usabstepwise_{\\
     323<p>_textwhatdoing_<br> \\
     324<textarea name="doingwhat" rows="3" cols="40"></textarea> \\
     325<p>_textwhatexpected_<br> \\
     326<textarea name="whatexpected" rows="6" cols="40"></textarea> \\
     327<p>_textwhathappened_<br> \\
     328<textarea name="whathappened" rows="6" cols="40"></textarea> \\
     329_usabtextonly_}
     330
     331#gives a multipart interface allowing the user to fill out less or more.
     332_usabmulti_{\\
     333_textonlyusabinterface_\\
     334<table width="100%" style="width:100%"><tr><td><a href="javascript:viewdetails()">_textviewdetails_</a></td><td style="text-align:right"><input type="button" value="_textdontsend_" onClick="window.close()"></td><td style="text-align:right"><input type="submit" value="_textsend_"></td></tr></table>\\
     335<br><a href="http://nzdl2.cs.waikato.ac.nz/dana/gsdl/test.html" target="_blank">_texttrackreport_</a>\\
     336<p style="color:#009966; font-weight:bold; font-size:14px; font-family:sans-serif">_textoptionally_:\\
     337<p style="font-family:sans-serif">_textmoredetails_:\\
     338<textarea name="moredetails" rows="6" cols="45"></textarea>\\
     339<table><tr><td>\\
     340<p style="font-family:sans-serif">_textcharacterise_: </td>\\
     341<td><select name="probtype">\\
     342<option>\\
     343<option>_textbadrender_\\
     344<option>_textcontenterror_\\
     345<option>_textstrangebehaviour_\\
     346<option>_textunexpected_\\
     347<option>_textfunctionality_\\
     348</select></td></tr>\\
     349<tr><td><p style="font-family:sans-serif">_textseverity_: </td>\\
     350<td><select name="severity">\\
     351<option>\\
     352<option>_textmajor_\\
     353<option>_textmedium_\\
     354<option>_textminor_\\
     355<option>_texttrivial_\\
     356</select>\\
     357</td></tr></table>\\
     358<br><br><input type="submit" align="right" value="_textsend_">}
     359
    144360
    145361#######################################################################
     
    187403# the page.
    188404
    189 _javalinks_ {_imagehome__imagehelp__imagepref_}
     405_javalinks_ {_imagehome__imagehelp__imagepref__usability_}
    190406_javalinks_ [v=1] {
    191407_imagehome_<br>
     
    227443_httpclearhistory_ {_gwcgi_?e=_compressedoptions_&a=dh}
    228444
     445_httppageusab_ {javascript:usabilityfunction()}
    229446_httpgreenstone_ {_httppagex_(gsdl)}
    230447_httpdownload_ {http://www.nzdl.org/download}
     
    255472_heightgsdl_ {77}
    256473
     474_httpusabbanner_ {_httpimg_/usabbanner.gif}
     475
    257476_httpiconitext_ {_httpimg_/itext.gif}
    258477_widthitext_ {16}
     
    532751_imagepref2_ {_gsimage_(_httppagepref_,_httpiconcprefof_,_httpiconcprefon_,pref,_textimagepref_)}
    533752
     753<<<<<<< base.dm
     754_imageusab_ {_gsimage_(_httppageusab_,_httpiconcusabof_,_httpiconcusabon_,usab,_textimageusab_)}
     755
     756
     757_imagegreenstone_ {<img src="_httpicongsdl_" width="_widthgsdl_" height="_heightgsdl_" border="0" alt="_textimagegreenstone_" hspace=0>}
     758=======
    534759_imagegreenstone_ {<img src="_httpicongsdl_" width="_widthgsdl_" height="_heightgsdl_" border="0" alt="_textimagegreenstone_" title="_textimagegreenstone_" hspace=0>}
     760>>>>>>> 1.79
    535761_imagegreenstone_[v=1] {_textimagegreenstone_}
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
Note: See TracChangeset for help on using the changeset viewer.