Branch: Tag:

2003-04-22

2003-04-22 11:20:41 by Anders Johansson <anders@roxen.com>

Removed check for id->supports->images and made the check for js_image_object optional.

Rev: server/modules/graphics/graphic_text.pike:1.292

1:   // This is a roxen module. Copyright © 1996 - 2001, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.291 2002/02/06 22:31:02 nilsson Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.292 2003/04/22 11:20:41 anders Exp $";      #include <module.h>   inherit "module";
37:    TYPE_FLAG|VAR_MORE|VAR_NOT_CFIF,    "Append the image format (.gif, .png, .jpg, etc) to the generated "    "images. This is not necessary, but might seem nicer."); +  defvar("honor_supports", 1, "Honor supports", +  TYPE_FLAG|VAR_MORE, +  "Normally javascript tags generated by the 'magic' attribute are not " +  "sent to clients that don't support javascript image objects. " +  "This check can be disabled to always output those javascript tags.");   }      TAGDOCUMENTATION;
562:      private roxen.ImageCache image_cache;   private string compat_level; + private int honor_supports;      string status() {    array s=image_cache->status();
584:    roxen.dump( "etc/modules/GText.pmod" );    if(query("colorparse")) module_dependencies(conf, ({ "wiretap" }) );    compat_level = conf->query("compat_level"); +  honor_supports = query("honor_supports");   }      private constant nbsp = Roxen.iso88591["&nbsp;"];
1114:    arg->height=(string)max(arg->ysize,size->ysize);    }    -  if(!id->supports->images) return sprintf(lp,arg->alt); -  +     string sn = "gtext" + id->root_id->misc->gtext_mi++; -  if(!id->supports->js_image_object) { +  if(honor_supports && !id->supports->js_image_object) {    return (!input)?    ("<a"+ea+"href=\""+url+"\">"+Roxen.make_tag("img",arg+(["name":sn]),xml)+"</a>"):    Roxen.make_tag("input",arg+(["type":"image"]),xml);