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 - 2000, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.231 2000/08/15 20:16:07 mast Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.232 2000/08/21 01:04:55 nilsson Exp $";      #include <module.h>   inherit "module";         // ------------------- Module registration ---------------------      constant module_type = MODULE_PARSER;   constant module_name = "Graphic text";   constant module_doc =
Roxen.git/server/modules/graphics/graphic_text.pike:853:    }       if(arg->href)    {    url = arg->href;    lp = replace(Roxen.make_tag("a",arg-hreffilter),"%","%%")+"%s</a>";    if(!p->fgcolor) p->fgcolor=id->misc->gtext_link||"#0000ff";    m_delete(arg, "href");    }    -  if(!arg->noxml) { arg["/"]="/"; m_delete(arg, "noxml"); } -  if(!arg->border) arg->border=arg->border||"0"; +  int xml=!arg->noxml; +  m_delete(arg, "noxml"); +  if(!arg->border) arg->border="0";       if(arg->split)    {    string res="",split=arg->split;    if(lower_case(split)=="split") split=" ";    m_delete(arg,"split");    c=replace(c, "\n", " ");    int setalt=!arg->alt;    foreach(c/split-({""}), string word)    {    string fn = image_cache->store( ({ p, word }),id );    mapping size = image_cache->metadata( fn, id, 1 );    if(setalt) arg->alt=word;    arg->src=query_internal_location()+fn+ext;    if( size )    {    arg->width = (string)size->xsize;    arg->height = (string)size->ysize;    } -  res+=Roxen.make_tag( "img", arg )+" "; +  res+=Roxen.make_tag( "img", arg, xml )+" ";    }    return sprintf(lp,res);    }       string num = image_cache->store( ({ p, c }), id );    mapping size = image_cache->metadata( num, id, 1 );    if(!arg->alt) arg->alt=replace(c,"\"","'");       arg->src=query_internal_location()+num+ext;    if(size) {
Roxen.git/server/modules/graphics/graphic_text.pike:918:    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="i"+id->misc->gtext_mi++;    if(!id->supports->js_image_object) {    return (!input)? -  ("<a "+ea+"href=\""+url+"\">"+Roxen.make_tag("img",arg+(["name":sn]))+"</a>"): -  Roxen.make_tag("input",arg+(["type":"image"])); +  ("<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="\n<script>\n";    if(!id->misc->gtext_magic_java) {    res += "function i(ri,hi,txt)\n"    "{\n"    " document.images[ri].src = hi.src;\n"    " if( txt != 0 )\n"    " setTimeout(\"top.window.status = '\"+txt+\"'\", 100);\n"
Roxen.git/server/modules/graphics/graphic_text.pike:945:    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_internal_location()+num2+ext+"\";\n"    "</script>\n"+    "<a "+ea+"href=\""+url+"\" "+    (input?"onClick='document.forms[0].submit();' ":"")    +"onMouseover=\"i('"+sn+"',"+sn+"h,"+((strlen(magic) && magic != "magic")?    "'"+replace(magic,"'","`")+"'":    "0")+"); return true;\" "    "onMouseout=\"document.images['"+sn+"'].src = "+sn+"l.src;\">" -  +Roxen.make_tag("img",arg)+"</a>"; +  +Roxen.make_tag("img",arg,xml)+"</a>";    }       if(input) -  return Roxen.make_tag("input",arg+(["type":"image"])); +  return Roxen.make_tag("input",arg+(["type":"image"]),xml);    -  return sprintf(lp,Roxen.make_tag("img",arg)); +  return sprintf(lp,Roxen.make_tag("img",arg,xml));   }      array(string) simpletag_gh(string t, mapping m, string c, RequestID id) {    int i;    if(sscanf(t, "%s%d", t, i)==2 && i>1)    m->scale = (string)(1.0 / ((float)i*0.6));    if(!m->valign) m->valign="top";    return ({ "<p>"+simpletag_gtext("",m,c,id)+"</p><br />" });   }