Ignore:
Timestamp:
11/01/10 03:26:07 (10 years ago)
Author:
alno
Message:

WebIf: implement usage of javascript in webif. Path for script to set in 'httpjscript=<path>/oscam.js'
If path is empty an internal script is used but it is empty in the moment. Hope for good ideas of community

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oscam-http-helpers.c

    r3482 r3790  
    409409}
    410410
     411void send_js(FILE *f){
     412    if(strlen(cfg->http_jscript) > 0 && file_exists(cfg->http_jscript) == 1){
     413        FILE *fp;
     414        char buffer[1024];
     415        int read;
     416
     417        if((fp = fopen(cfg->http_jscript,"r"))==NULL) return;
     418        while((read = fread(&buffer,sizeof(char),1024,fp)) > 0) fwrite(&buffer, sizeof(char), read, f);
     419        fclose (fp);
     420    } else {
     421        fputs(JSCRIPT, f);
     422    }
     423}
     424
    411425void send_error(FILE *f, int status, char *title, char *extra, char *text){
    412426  send_headers(f, status, title, extra, "text/html");
Note: See TracChangeset for help on using the changeset viewer.