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 - 2004, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.296 2004/08/09 15:30:53 grubba Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.297 2005/05/19 14:46:52 stewa 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:543: Inside #if defined(manual)
     <form onsubmit='return alter_image(this.label);'>   <input type='text' size='40' name='label' />   </form></ex-box></desc>      <attr name='short'><p>    Returns a relative path to the image, i.e. a shorter one.   </p>   </attr>"+gtextargs,    + "gtext-js":#"<desc tag='tag'><p><short> +  Inserts javascript funcations that are used by gtext when using the magic attributes. +  This is normally inserted at the first instance of a gtext, but it may +  be necessary to insert the gtext using this tag if the first gtext in a page +  may be hidden, for example if contained in an if tag. +  </short></p> + </desc>", +    "gtext-url":#"<desc type='cont'><p><short>    Returns an internal URL to an image with the specified attributes    applied.</short></p>   </desc>      <attr name='short'><p>    Returns a relative path to the image, i.e. a shorter one.   </p>   </attr>   <noex>"+gtextargs+"</noex>",]);
Roxen.git/server/modules/graphics/graphic_text.pike:841:    "dither",    "fs",    "*-*",    "gamma",   });      private constant theme = ({ "fgcolor", "bgcolor", "font" });      private constant hreffilter = ([ "split":1, "magic":1, "noxml":1, "alt":1 ]);    + string gtext_javascript(RequestID id) { +  string res=""; +  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->root_id->misc->gtext_magic_java="yes"; +  } +  return res; + } +    private mapping mk_gtext_arg(mapping arg, RequestID id)   {    mapping p=([]); //Picture rendering arguments.      #if ROXEN_COMPAT < 2.2    if(compat_level < "2.2") {    p->compat = compat_level;    p->font = m_delete(arg, "nfont");    }   #endif
Roxen.git/server/modules/graphics/graphic_text.pike:987:    string ext="";    if(query("ext")) ext="."+(p->format || "gif");    if(!args->short)    return ({ query_absolute_internal_location(id) +    image_cache->store( ({p,content}), id )+ext });    return ({ "+"+image_cache->store( ({p,content}), id )+ext });    }    }   }    + class TagGTextJS { +  inherit RXML.Tag; +  constant name = "gtext-js"; +  constant flags = RXML.FLAG_EMPTY_ELEMENT; +  +  class Frame { +  inherit RXML.Frame; +  +  array do_return(RequestID id) { +  return ({ gtext_javascript(id) }); +  } +  } + } +    class TagGTextID {    inherit RXML.Tag;    constant name = "gtext-id";    constant flags = RXML.FLAG_EMPTY_ELEMENT;       class Frame {    inherit RXML.Frame;       array do_return(RequestID id) {    mapping p=mk_gtext_arg(args,id);
Roxen.git/server/modules/graphics/graphic_text.pike:1131:    RXML_CONTEXT->set_root_id_misc("gtext_mi", id->root_id->misc->gtext_mi);       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);    }       arg->name=sn;    string res="<script type='text/javascript'>\n"; -  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->root_id->misc->gtext_magic_java="yes"; -  } +  res += gtext_javascript(id);       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")?