Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1:   // This is a roxen module. Copyright © 1996 - 2001, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.285 2001/11/27 18:21:16 mast Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.286 2001/11/30 20:42:58 mast Exp $";      #include <module.h>   inherit "module";         // ------------------- Module registration ---------------------      constant module_type = MODULE_TAG;   constant module_name = "Graphics: Graphic text";   constant module_doc =
Roxen.git/server/modules/graphics/graphic_text.pike:1002:    array do_return(RequestID id) {    return ({ do_gtext(args, (string) content, id) });    }    }   }      private string do_gtext(mapping arg, string c, RequestID id)   {    if((c-" ")=="") return "";    -  id = id->root_id; -  +     c=fix_text(c,arg,id);    mapping p=mk_gtext_arg(arg,id);       string ext="";    if(query("ext")) ext="."+(p->format || "gif");       string lp="%s", url="", ea=" ";       int input=0;    if(arg->submit)
Roxen.git/server/modules/graphics/graphic_text.pike:1097:       string num2 = image_cache->store( ({ p, c }),id );    size = image_cache->metadata( num2, id );    if(size) {    arg->width=(string)max(arg->xsize,size->xsize);    arg->height=(string)max(arg->ysize,size->ysize);    }       if(!id->supports->images) return sprintf(lp,arg->alt);    -  string sn = "gtext" + id->misc->gtext_mi++; +  string sn = "gtext" + id->root_id->misc->gtext_mi++;    if(!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);    }       arg->name=sn;    string res="<script>\n"; -  if(!id->misc->gtext_magic_java) { +  if(!id->root_id->misc->gtext_magic_java) {    res += "function gtext_mo(ri,hi,txt)\n"    "{\n"    " document.images[ri].src = hi.src;\n"    " if( txt != 0 )\n"    " setTimeout(\"top.window.status = '\"+txt+\"'\", 100);\n"    "}";    } -  id->misc->gtext_magic_java="yes"; +  id->root_id->misc->gtext_magic_java="yes";       return    res+    " "+sn+"l = new Image("+arg->width+", "+arg->height+");"+sn+"l.src = \""+arg->src+"\";\n"    " "+sn+"h = new Image("+arg->width+", "+arg->height+");"+sn+"h.src = \"" +    query_absolute_internal_location(id)+num2+ext+"\";\n"    "</script>\n"+    "<a"+ea+"href=\""+url+"\" "+    (input?"onClick='document.forms[0].submit();' ":"")    +"onMouseover=\"gtext_mo('"+sn+"',"+sn+"h,"+((strlen(magic) && magic != "magic")?