Changeset 282 for trunk/gsdl/src/recpt


Ignore:
Timestamp:
1999-06-17T15:06:58+12:00 (25 years ago)
Author:
sjboddie
Message:

got detach button working properly - the close book icon is now disabled
when page is detached as the javascript close() function I was using is
too unreliable over different browsers
note that in my last comment I meant the "cl" arg (not the "c" arg).

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/browsetools.cpp

    r281 r282  
    1212/*
    1313   $Log$
     14   Revision 1.8  1999/06/17 03:06:53  sjboddie
     15   got detach button working properly - the close book icon is now disabled
     16   when page is detached as the javascript close() function I was using is
     17   too unreliable over different browsers
     18   note that in my last comment I meant the "cl" arg (not the "c" arg).
     19
    1420   Revision 1.7  1999/06/16 23:53:14  sjboddie
    1521   tidied a few things up. documentaction::define_external_macros now
     
    218224   
    219225    // detach button
    220     buttons.push_back ("_imagedetach_");
     226    buttons.push_back ("_document:imagedetach_");
    221227
    222228    // highlighting button
    223229    if (args["hl"] == "1")
    224       buttons.push_back ("_imagenohighlight_");
     230      buttons.push_back ("_document:imagenohighlight_");
    225231    else
    226       buttons.push_back ("_imagehighlight_");
     232      buttons.push_back ("_document:imagehighlight_");
    227233
    228234    // expand/contract contents button - only have this if it's
     
    232238      if (response.docInfo[0].metadata[0].values[0] == "Hierarchy")
    233239    if (args["gc"] == "1")
    234       buttons.push_back ("_imagecontracttoc_");
     240      buttons.push_back ("_document:imagecontracttoc_");
    235241    else
    236       buttons.push_back ("_imageexpandtoc_");
     242      buttons.push_back ("_document:imageexpandtoc_");
    237243    }
    238244   
    239245    // expand/contract text button
    240246    if (args.getintarg("gt"))
    241       buttons.push_back ("_imagecontracttext_");
     247      buttons.push_back ("_document:imagecontracttext_");
    242248    else
    243       buttons.push_back ("_imageexpandtext_");
     249      buttons.push_back ("_document:imageexpandtext_");
    244250
    245251    text_tarray::const_iterator here = buttons.begin();
     
    472478    if ((classifytype == "Document") && (is_top((*thissection).OID)) &&
    473479    (args.getintarg("x")))
    474       textout << "<a href=\"\" onClick = \"close_detach();\">";
     480      textout << outconvert << disp << icon << "</td><td";
     481
    475482    else {
    476483      if (!gt) {
     
    504511    count ++;
    505512      }
    506     }
    507    
    508     textout << outconvert << disp << icon << "</a></td><td";
     513   
     514      textout << outconvert << disp << icon << "</a></td><td";
     515    }
    509516    if (colsremaining > 1) textout << " colspan=" << colsremaining;
    510517    textout << outconvert << disp << ">" << title << "</td></tr>\n";
     
    567574      tabcount ++;
    568575     
     576      textout << outconvert << disp << "<tr>" << tab << "<td valign=top>";
     577
    569578      if (is_top(*thisparent) && args["x"] == "1") {
    570     textout << outconvert << disp << "<tr>" << tab << "<td valign=top><a href=\"\" "
    571         << "onClick = \"close_detach()\">" << icon << "</a></td>";
     579    textout << outconvert << disp << icon;
    572580      } else {
    573581    text_t link;
     
    583591      else link = doclink + "&cl=" + arg_cl + "&d=" + *thisparent + ".pr\">";
    584592
    585     textout << outconvert << disp << "<tr>" << tab << "<td valign=top>"
    586         << link << icon << "</a></td>";
     593    textout << outconvert << disp << link << icon << "</a>";
    587594      }
    588       textout << "<td";
     595      textout << "</td><td";
    589596      if (colnum > 1) textout << outconvert << " colspan=" << text_t(colnum);
    590597      textout << outconvert << disp << ">" << title << "</td></tr>\n";
  • trunk/gsdl/src/recpt/documentaction.cpp

    r281 r282  
    1212/*
    1313   $Log$
     14   Revision 1.7  1999/06/17 03:06:58  sjboddie
     15   got detach button working properly - the close book icon is now disabled
     16   when page is detached as the javascript close() function I was using is
     17   too unreliable over different browsers
     18   note that in my last comment I meant the "cl" arg (not the "c" arg).
     19
    1420   Revision 1.6  1999/06/16 23:53:15  sjboddie
    1521   tidied a few things up. documentaction::define_external_macros now
     
    131137  arg_ainfo.defaultstatus = cgiarginfo::weak;
    132138  arg_ainfo.argdefault = "0";
    133   arg_ainfo.savedarginfo = cgiarginfo::can;
     139  arg_ainfo.savedarginfo = cgiarginfo::must;
    134140  argsinfo.addarginfo (NULL, arg_ainfo);
    135141}
     
    240246  }
    241247
    242   get_top (arg_cl, topparent);
    243 
    244   collectproto->get_filterinfo (collection, filterinfo, err, logout);
    245   if (err == noError) {
    246     // check that there's a browse filter
    247     if (filterinfo.filterNames.find ("BrowseFilter") != filterinfo.filterNames.end()) {
    248      
    249       metadata.push_back ("Title");
    250       metadata.push_back ("classifytype");
    251       get_children ("", collection, metadata, collectproto, response, logout);
    252 
    253       // don't do anything unless there are classifications
    254       if (!response.docInfo.empty()) {
    255 
    256     ResultDocInfo_tarray::const_iterator dochere = response.docInfo.begin();
    257     ResultDocInfo_tarray::const_iterator docend = response.docInfo.end();
     248  // don't want navigation bar if page is 'detached'
     249  if (!args.getintarg("x")) {
     250
     251    get_top (arg_cl, topparent);
     252   
     253    collectproto->get_filterinfo (collection, filterinfo, err, logout);
     254    if (err == noError) {
     255      // check that there's a browse filter
     256      if (filterinfo.filterNames.find ("BrowseFilter") != filterinfo.filterNames.end()) {
    258257   
    259     navigationbar = "<!-- Navigation Bar -->\n";
     258    metadata.push_back ("Title");
     259    metadata.push_back ("classifytype");
     260    get_children ("", collection, metadata, collectproto, response, logout);
     261   
     262    // don't do anything unless there are classifications
     263    if (!response.docInfo.empty()) {
    260264     
    261     // calculate width of spacers and set macro
    262     if (args.getintarg("v") == 0) {
    263       disp.expandstring ("Global", "_pagewidth_", width);
    264       twidth = width.getint();
     265      ResultDocInfo_tarray::const_iterator dochere = response.docInfo.begin();
     266      ResultDocInfo_tarray::const_iterator docend = response.docInfo.end();
    265267     
    266       disp.expandstring ("query", "_searchwidth_", width);
    267       iwidth += width.getint();
     268      navigationbar = "<!-- Navigation Bar -->\n";
    268269     
     270      // calculate width of spacers and set macro
     271      if (args.getintarg("v") == 0) {
     272        disp.expandstring ("Global", "_pagewidth_", width);
     273        twidth = width.getint();
     274       
     275        disp.expandstring ("query", "_searchwidth_", width);
     276        iwidth += width.getint();
     277       
     278        while (dochere != docend) {
     279          disp.expandstring ("document", "_" + (*dochere).metadata[0].values[0] + "width_", width);
     280          iwidth += width.getint();
     281          dochere ++;
     282        }
     283        if ((twidth - iwidth) < int(response.docInfo.size())) swidth = 2;
     284        else swidth = (twidth - iwidth) / response.docInfo.size();
     285        disp.setmacro ("widthtspace", "Global", swidth);
     286      }
     287     
     288      navigationbar += "<nobr>\n";
     289      if (args["a"] == "q") {
     290        navigationbar += "_icontabsearchgreen_";
     291      } else {
     292        navigationbar += "_imagesearch_";
     293        javaimagesnavbar = "_javasearch_";
     294      }
     295      dochere = response.docInfo.begin();
    269296      while (dochere != docend) {
    270         disp.expandstring ("document", "_" + (*dochere).metadata[0].values[0] + "width_", width);
    271         iwidth += width.getint();
     297        const text_t &title = (*dochere).metadata[0].values[0];
     298        const text_t &classifytype = (*dochere).metadata[1].values[0];
     299       
     300        // if we're inside a document all the classification buttons should be enabled
     301        if (arg_d.empty() && ((*dochere).OID == topparent))
     302          navigationbar += "_imagespacer__icontab" + title + "green_";
     303        else {
     304          navigationbar += "_imagespacer__image" + title + "_";
     305         
     306          // set the _httpbrowseXXX_ macro for this classification
     307          text_t link = (*dochere).OID;
     308          if (classifytype == "AZList" || classifytype == "Datelist") link += ".fc";
     309          disp.setmacro ("httpbrowse" + title, "Global",
     310                 "_httpdocument_&cl=" + link);
     311        }
     312        javaimagesnavbar += "_java" + title + "_";
    272313        dochere ++;
    273314      }
    274       if ((twidth - iwidth) < int(response.docInfo.size())) swidth = 2;
    275       else swidth = (twidth - iwidth) / response.docInfo.size();
    276       disp.setmacro ("widthtspace", "Global", swidth);
     315      navigationbar += "\n</nobr>\n";
     316      navigationbar += "<!-- End of Navigation Bar -->\n";
     317      disp.setmacro ("navigationbar", "Global", navigationbar);
     318      if (args.getintarg("v") == 0)
     319        disp.setmacro ("javaimagesnavbar", "Global", javaimagesnavbar);
    277320    }
    278    
    279     navigationbar += "<nobr>\n";
    280     if (args["a"] == "q") {
    281       navigationbar += "_icontabsearchgreen_";
    282     } else {
    283       navigationbar += "_imagesearch_";
    284       javaimagesnavbar = "_javasearch_";
    285     }
    286     dochere = response.docInfo.begin();
    287     while (dochere != docend) {
    288       const text_t &title = (*dochere).metadata[0].values[0];
    289       const text_t &classifytype = (*dochere).metadata[1].values[0];
    290 
    291       // if we're inside a document all the classification buttons should be enabled
    292       if (arg_d.empty() && ((*dochere).OID == topparent))
    293         navigationbar += "_imagespacer__icontab" + title + "green_";
    294       else {
    295         navigationbar += "_imagespacer__image" + title + "_";
    296 
    297         // set the _httpbrowseXXX_ macro for this classification
    298         text_t link = (*dochere).OID;
    299         if (classifytype == "AZList" || classifytype == "Datelist") link += ".fc";
    300         disp.setmacro ("httpbrowse" + title, "Global",
    301                "_httpdocument_&cl=" + link);
    302       }
    303       javaimagesnavbar += "_java" + title + "_";
    304       dochere ++;
    305     }
    306     navigationbar += "\n</nobr>\n";
    307     navigationbar += "<!-- End of Navigation Bar -->\n";
    308     disp.setmacro ("navigationbar", "Global", navigationbar);
    309     if (args.getintarg("v") == 0)
    310       disp.setmacro ("javaimagesnavbar", "Global", javaimagesnavbar);
    311       }
    312     }
    313   } else {
    314     logout << text_t2ascii
    315        << "Error (documentaction::define_external_macros()) in call to get_filterinfo() "
    316        << get_comerror_string (err);
     321      }
     322    } else {
     323      logout << text_t2ascii
     324         << "Error (documentaction::define_external_macros()) in call to get_filterinfo() "
     325         << get_comerror_string (err);
     326    }
    317327  }
    318328}
     
    326336  // define_internal_macros sets the following macros:
    327337
     338  // _random_               a random number - used for setting target tags to display
     339  //                        a random page when you hit the 'detach' button
     340
    328341  // _pagetitle_            the title to be displayed at the top of the browser window
    329342 
     
    347360  if (collectproto == NULL) return;
    348361
     362  disp.setmacro("random", "document", rand());
    349363 
    350364  text_tarray metadata;
Note: See TracChangeset for help on using the changeset viewer.