Subversion Repositories wimsdev

Rev

Rev 17008 | Rev 17442 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17008 Rev 17170
Line 610... Line 610...
610
  setvar("wims_html_onload",wsbuf2);
610
  setvar("wims_html_onload",wsbuf2);
611
  if(wsbuf2[0]) ol=" onload="; else ol="";
611
  if(wsbuf2[0]) ol=" onload="; else ol="";
612
 
612
 
613
  output("<!DOCTYPE html>\
613
  output("<!DOCTYPE html>\
614
    \n<html lang=\"%s\"><head>\n\
614
    \n<html lang=\"%s\"><head>\n\
615
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\"/>\n\
615
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\">\n\
616
    %s\n", lang, hbuf);
616
    %s\n", lang, hbuf);
617
  if(robot_access){
617
  if(robot_access){
618
    output("<link rel=\"stylesheet\" href=\"html/themes/_css/robots.css\" />");
618
    output("<link rel=\"stylesheet\" href=\"html/themes/_css/robots.css\">");
619
  }
619
  }
620
 
620
 
621
  _headmathjax(p);
621
  _headmathjax(p);
622
 
622
 
623
  if(ol[0]) {
623
  if(ol[0]) {
Line 921... Line 921...
921
  s=getvar("wims_ref_target");
921
  s=getvar("wims_ref_target");
922
  if(href_target[0]!=0) s=href_target;
922
  if(href_target[0]!=0) s=href_target;
923
  if(s!=NULL && *s!=0 && !isspace(*s)) {
923
  if(s!=NULL && *s!=0 && !isspace(*s)) {
924
    snprintf(st,sizeof(st)," target=\"%s\"",s);
924
    snprintf(st,sizeof(st)," target=\"%s\"",s);
925
    if(strcmp(s,"_parent")!=0) {
925
    if(strcmp(s,"_parent")!=0) {
926
      new=1; wn="<input type=\"hidden\" name=\"wims_window\" value=\"yes\" />\n";
926
      new=1; wn="<input type=\"hidden\" name=\"wims_window\" value=\"yes\">\n";
927
    }
927
    }
928
  }
928
  }
929
  else st[0]=0;
929
  else st[0]=0;
930
  a=getvar("wims_ref_anchor"); if(a==NULL) a="";
930
  a=getvar("wims_ref_anchor"); if(a==NULL) a="";
931
  opt=find_word_start(find_word_end(find_word_start(p)));
931
  opt=find_word_start(find_word_end(find_word_start(p)));
Line 973... Line 973...
973
        s1=getvar("wims_session");
973
        s1=getvar("wims_session");
974
        if(s1==NULL) internal_error("exec_form() error.\n");
974
        if(s1==NULL) internal_error("exec_form() error.\n");
975
        snprintf(st,sizeof(st),"%.10s%s",s1,href_target+4);
975
        snprintf(st,sizeof(st),"%.10s%s",s1,href_target+4);
976
        s=st;
976
        s=st;
977
      }
977
      }
978
      output("<input type=\"hidden\" name=\"%s\" value=\"%s\" />\n",
978
      output("<input type=\"hidden\" name=\"%s\" value=\"%s\">\n",
979
           ro_name[follow_list[i]],s);
979
           ro_name[follow_list[i]],s);
980
    }
980
    }
981
  }
981
  }
982
  p1=find_word_start(p);p2=find_word_end(p1);
982
  p1=find_word_start(p);p2=find_word_end(p1);
983
  if(p2>p1) {
983
  if(p2>p1) {
Line 985... Line 985...
985
    int i;
985
    int i;
986
    i=p2-p1; if(i>60) i=60;
986
    i=p2-p1; if(i>60) i=60;
987
    memmove(buf,p1,i);buf[i]=0;
987
    memmove(buf,p1,i);buf[i]=0;
988
    for(i=0;i<CMD_NO && strcmp(buf,commands[i]);i++);
988
    for(i=0;i<CMD_NO && strcmp(buf,commands[i]);i++);
989
    if(i<CMD_NO) {
989
    if(i<CMD_NO) {
990
      output("<input type=\"hidden\" name=\"cmd\" value=\"%s\" />\n",buf);
990
      output("<input type=\"hidden\" name=\"cmd\" value=\"%s\">\n",buf);
991
      if(i!=cmd_intro && i!=cmd_new)
991
      if(i!=cmd_intro && i!=cmd_new)
992
        output("<input type=\"hidden\" name=\"module\" value=\"%s\" />\n",
992
        output("<input type=\"hidden\" name=\"module\" value=\"%s\">\n",
993
            getvar(ro_name[ro_module]));
993
            getvar(ro_name[ro_module]));
994
    }
994
    }
995
  }
995
  }
996
}
996
}
997
 
997
 
Line 1197... Line 1197...
1197
    for(p1=bbuf;p1<bbuf+512 && *p1;p1++)
1197
    for(p1=bbuf;p1<bbuf+512 && *p1;p1++)
1198
      if(*p1=='<' || *p1=='>') *p1='?';
1198
      if(*p1=='<' || *p1=='>') *p1='?';
1199
    *p1=0;
1199
    *p1=0;
1200
    if(bbuf[0]==0) snprintf(bbuf,sizeof(bbuf),"Fail");
1200
    if(bbuf[0]==0) snprintf(bbuf,sizeof(bbuf),"Fail");
1201
    snprintf(outbuf+strlen(outbuf),sizeof(outbuf)-strlen(outbuf),
1201
    snprintf(outbuf+strlen(outbuf),sizeof(outbuf)-strlen(outbuf),
1202
       " <img src=\"%s\" alt=\"Error\" /> <small><pre>%s</pre></small> <br /> ",
1202
       " <img src=\"%s\" alt=\"Error\"> <small><pre>%s</pre></small> <br> ",
1203
       url,bbuf);
1203
       url,bbuf);
1204
    setvar("ins_warn","fail");
1204
    setvar("ins_warn","fail");
1205
    setvar("ins_cnt","0");
1205
    setvar("ins_cnt","0");
1206
    goto reset;
1206
    goto reset;
1207
  }
1207
  }
Line 1244... Line 1244...
1244
      snprintf(altbuf,sizeof(altbuf)," alt=\"\"");
1244
      snprintf(altbuf,sizeof(altbuf)," alt=\"\"");
1245
    else
1245
    else
1246
      snprintf(altbuf,sizeof(altbuf)," alt=\"%s\"",ins_alt);
1246
      snprintf(altbuf,sizeof(altbuf)," alt=\"%s\"",ins_alt);
1247
  if(strcasecmp(tag,"form")!=0) {
1247
  if(strcasecmp(tag,"form")!=0) {
1248
    snprintf(outbuf+strlen(outbuf),sizeof(outbuf)-strlen(outbuf),
1248
    snprintf(outbuf+strlen(outbuf),sizeof(outbuf)-strlen(outbuf),
1249
       "<img src=\"%s\" style=\"border:solid;border-width:%dpx;margin-bottom:%dpx;%s\" %s %s />",
1249
       "<img src=\"%s\" style=\"border:solid;border-width:%dpx;margin-bottom:%dpx;%s\" %s %s>",
1250
       url, border, vspace, buf2, at, altbuf);
1250
       url, border, vspace, buf2, at, altbuf);
1251
  }
1251
  }
1252
  else {
1252
  else {
1253
    char *n, *nend;
1253
    char *n, *nend;
1254
/* fix: add quotes at name=" " */
1254
/* fix: add quotes at name=" " */
1255
    if(*tag2!=0) {n="name=\"" ; nend="\"";} else {n=""; nend="";}
1255
    if(*tag2!=0) {n="name=\"" ; nend="\"";} else {n=""; nend="";}
1256
    snprintf(outbuf+strlen(outbuf),sizeof(outbuf)-strlen(outbuf),
1256
    snprintf(outbuf+strlen(outbuf),sizeof(outbuf)-strlen(outbuf),
1257
        "<input type=\"image\" %s%s%s src=\"%s\" style=\"border:solid;border-width:%dpx;margin-bottom:%dpx;%s\" %s %s />",
1257
        "<input type=\"image\" %s%s%s src=\"%s\" style=\"border:solid;border-width:%dpx;margin-bottom:%dpx;%s\" %s %s>",
1258
        n,tag2,nend,url,border,vspace,buf2,at,altbuf);
1258
        n,tag2,nend,url,border,vspace,buf2,at,altbuf);
1259
  }
1259
  }
1260
  if(middle) snprintf(outbuf+strlen(outbuf),
1260
  if(middle) snprintf(outbuf+strlen(outbuf),
1261
           sizeof(outbuf)-strlen(outbuf),"%s",mathalign_sup2);
1261
           sizeof(outbuf)-strlen(outbuf),"%s",mathalign_sup2);
1262
  setvar("ins_warn",""); ins_alt[0]=0;
1262
  setvar("ins_warn",""); ins_alt[0]=0;