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

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - string cvs_version="$Id: graphic_text.pike,v 1.7 1996/12/10 00:15:42 per Exp $"; + string cvs_version="$Id: graphic_text.pike,v 1.8 1996/12/10 01:59:35 per Exp $";   #include <module.h>   inherit "module";   inherit "roxenlib";         array register_module()   {    return ({ MODULE_LOCATION | MODULE_PARSER,    "Graphics text",    "Makes a few new tags:<p>"
Roxen.git/server/modules/graphics/graphic_text.pike:507:    " document [imgName].src = imgOff;\n"    " }\n"    "}\n"    "// -->\n"    "</script>\n");   }         string magic_image(string url, int xs, int ys, string sn,    string image_1, string image_2, string alt, -  string mess,object id,string input) +  string mess,object id,string input,string extra_args)   {    if(!id->supports->images) return alt;    if(!id->supports->javascript)    return (!input)? -  ("<a href=\""+url+"\"><img src="+image_1+" name="+ +  ("<a "+extra_args+"href=\""+url+"\"><img src="+image_1+" name="+    sn+" border=0 alt=\""+alt+"\" ></a>\n"): -  ("<input type=image src="+image_1+" name="+input+">"); +  ("<input type=image "+extra_args+" src="+image_1+" name="+input+">");       return    ("<script>\n"    "<!-- \n"    "if(version == \"3\")\n"    "{\n"    " "+sn+" = new Image("+xs+", "+ys+");\n"    " "+sn+".src = \""+image_1+"\";\n"    " "+sn+"2 = new Image("+xs+", "+ys+");\n"    " "+sn+"2.src = \""+image_2+"\";\n"    "}\n"    "// -->\n"    "</script>\n"+ -  ("<a href=\""+url+"\" "+(input?"onClick='document.forms[0].submit();' ":"") +  ("<a "+extra_args+"href=\""+url+"\" "+(input?"onClick='document.forms[0].submit();' ":"")    +"onMouseover=\"img_act('"+sn+"','"    +(mess||url)+"');return true;\"\n"    "\n"    "onMouseout=\"img_inact('"+sn+"')\"><img \n"    " src="+image_1+" name="+sn+" border=0 alt=\""+alt+"\" ></a>\n"));   }    -  +  + string extra_args(mapping in) + { +  string s=""; +  foreach(indices(in), string i) +  { +  switch(i) +  { +  case "target": +  case "onClick": +  s+=i+"='"+in[s]+"' "; +  m_delete(in, i); +  break; +  } +  } +  return s; + } +    string tag_graphicstext(string t, mapping arg, string contents,    object id, object foo, mapping defines)   {    if(!strlen(contents)) return ""; // There is no need to make this image.       string pre, post, defalign, gt, rest, magic;    int i, split;          // No images here, let's generate an alternative..
Roxen.git/server/modules/graphics/graphic_text.pike:586:    if(arg->submit)    {    input=1;    m_delete(arg,"submit");    }       string lp, url;    if(arg->href)    {    url = arg->href; -  lp = "<a href=\""+arg->href+"\">"; +  lp = "<a href=\""+arg->href+"\" "+extra_args(arg)+">";    if(!arg->fg) arg->fg=defines->link||"#0000ff";    m_delete(arg,"href");    }       // Modify the 'arg' mapping...    if(defines->fg && !arg->fg) arg->fg=defines->fg;    if(defines->bg && !arg->bg) arg->bg=defines->bg;    if(defines->font && !arg->font) arg->font=defines->font||QUERY(default_font);    if(!arg->font) arg->font = QUERY(default_font);   
Roxen.git/server/modules/graphics/graphic_text.pike:690:    if(arg->bevel) arg->pressed=1;    int num2 = find_or_insert(arg);    array size = write_text(num2,gt,1,0);    if(!defines->magic_java) res = magic_javascript_header(id);    defines->magic_java="yes";    return res + magic_image(url||"", size[0], size[1],    "i"+(num+""+hash(gt,0x7fffffff))+"g",    query_location()+num+"/"+quote(gt),    query_location()+num2+"/"+quote(gt),    replace(gt, "\"","'"),(magic=="magic"?0:magic), -  id,input?(arg->name||"submit"):0); +  id,input?(arg->name||"submit"):0, +  extra_args(arg));    }    if(input && id->supports->images)    return (pre+"<input type=image name=\""+arg->name+"\" border=0 alt=\""+    replace(gt,"\"","'")+"\" src="+query_location()+num+"/"+quote(gt)    +" align="+(arg->align?arg->align:defalign)+    " width="+size[0]+" height="+size[1]+">"+rest+post);    return (pre+(lp?lp:"")+    "<img border=0 alt=\""+replace(gt,"\"","'")+"\" src="+    query_location()+num+"/"+quote(gt)    +" align="+(arg->align?arg->align:defalign)+