Rev 8129 | Rev 8146 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8129 | Rev 8130 | ||
---|---|---|---|
Line 208... | Line 208... | ||
208 | fprintf(stdout,"<!-- include actual object code via include file -->\n<script type=\"text/javascript\" src=\"%s\"></script>\n",getfile_cmd); |
208 | fprintf(stdout,"<!-- include actual object code via include file -->\n<script type=\"text/javascript\" src=\"%s\"></script>\n",getfile_cmd); |
209 | fprintf(js_include_file,"\ |
209 | fprintf(js_include_file,"\ |
210 | \"use strict\";\n\ |
210 | \"use strict\";\n\ |
211 | var read_dragdrop;\ |
211 | var read_dragdrop;\ |
212 | var read_canvas;\ |
212 | var read_canvas;\ |
- | 213 | var set_clock;\ |
|
- | 214 | var userdraw_x = [];var userdraw_y = [];var userdraw_radius = [];\ |
|
213 | var wims_canvas_function%d = function(){\n<!-- common used stuff -->\n\ |
215 | var wims_canvas_function%d = function(){\n<!-- common used stuff -->\n\ |
214 | var xsize = %d;\ |
216 | var xsize = %d;\ |
215 | var ysize = %d;\ |
217 | var ysize = %d;\ |
216 | var precision = 100;\ |
218 | var precision = 100;\ |
217 | var canvas_div = document.getElementById(\"canvas_div%d\");\ |
219 | var canvas_div = document.getElementById(\"canvas_div%d\");\ |
Line 983... | Line 985... | ||
983 | if( use_userdraw == TRUE ){ /* only one object type may be drawn*/ |
985 | if( use_userdraw == TRUE ){ /* only one object type may be drawn*/ |
984 | canvas_error("Only one userdraw primitive may be used: read documentation !!"); |
986 | canvas_error("Only one userdraw primitive may be used: read documentation !!"); |
985 | } |
987 | } |
986 | reply_precision = precision; |
988 | reply_precision = precision; |
987 | use_userdraw = TRUE; |
989 | use_userdraw = TRUE; |
988 | fprintf(js_include_file,"\n<!-- begin userdraw mouse events -->\n |
990 | fprintf(js_include_file,"\n<!-- begin userdraw mouse events -->\nuserdraw_x = new Array();userdraw_y = new Array();userdraw_radius = new Array();var xy_cnt=0;var canvas_userdraw = create_canvas%d(%d,xsize,ysize);var context_userdraw = canvas_userdraw.getContext(\"2d\");var use_dashed = %d;if(use_dashed == 1){if( context_userdraw.setLineDash ){context_userdraw.setLineDash([%d,%d]);}else{if(context_userdraw.mozDash){context_userdraw.mozDash = [%d,%d];};};};if(wims_status != \"done\"){canvas_div.addEventListener(\"mousedown\",user_draw,false);canvas_div.addEventListener(\"mousemove\",user_drag,false);canvas_div.addEventListener(\"touchstart\",user_draw,false);canvas_div.addEventListener(\"touchmove\",user_drag,false);}\n<!-- end userdraw mouse events -->",canvas_root_id,DRAW_CANVAS,use_dashed,dashtype[0],dashtype[1],dashtype[0],dashtype[1]); |
989 | draw_type = get_string_argument(infile,0); |
991 | draw_type = get_string_argument(infile,0); |
990 | stroke_color = get_color(infile,1); |
992 | stroke_color = get_color(infile,1); |
991 | if( strcmp(draw_type,"point") == 0 ){ |
993 | if( strcmp(draw_type,"point") == 0 ){ |
992 | if( js_function[DRAW_CIRCLES] != 1 ){ js_function[DRAW_CIRCLES] = 1;} |
994 | if( js_function[DRAW_CIRCLES] != 1 ){ js_function[DRAW_CIRCLES] = 1;} |
993 | if(reply_format == 0 ){reply_format = 8;} |
995 | if(reply_format == 0 ){reply_format = 8;} |
Line 2771... | Line 2773... | ||
2771 | fill_color = get_color(infile,1); |
2773 | fill_color = get_color(infile,1); |
2772 | if(js_function[DRAW_FLOODFILL] != 1 ){/* use only once */ |
2774 | if(js_function[DRAW_FLOODFILL] != 1 ){/* use only once */ |
2773 | js_function[DRAW_FLOODFILL] = 1; |
2775 | js_function[DRAW_FLOODFILL] = 1; |
2774 | add_js_floodfill(js_include_file,canvas_root_id); |
2776 | add_js_floodfill(js_include_file,canvas_root_id); |
2775 | } |
2777 | } |
2776 | fprintf(js_include_file,"\n<!-- begin command clickfill -->\nvar marge_xy = %d; |
2778 | fprintf(js_include_file,"\n<!-- begin command clickfill -->\nvar marge_xy = %d;userdraw_x = new Array();userdraw_y = new Array();var user_clickfill_cnt = 0;\ncanvas_div.addEventListener(\"mousedown\",clickfill,false);function clickfill(evt){var x = evt.clientX - findPosX(canvas_div) + document.body.scrollLeft + document.documentElement.scrollLeft;var y = evt.clientY - findPosY(canvas_div) + document.body.scrollTop + document.documentElement.scrollTop;if(evt.which != 1){for(var p=0; p < user_clickfill_cnt;p++){if(userdraw_x[p] + marge_xy > x && userdraw_x[p] - marge_xy < x){if(userdraw_y[p] + marge_xy > y && userdraw_y[p] - marge_xy < y){if(confirm(\"Clear ?\")){floodfill(1,userdraw_x[p],userdraw_y[p],canvas_div.style.backgroundColor || [255,255,255,0]);userdraw_x.splice(p,2);userdraw_y.splice(p,2);user_clickfill_cnt--;return;};};};};};userdraw_x[user_clickfill_cnt] = x;userdraw_y[user_clickfill_cnt] = y;user_clickfill_cnt++;floodfill(1,x,y,[%s,%d]);};",clickfillmarge,fill_color,(int) (fill_opacity/0.0039215)); |
2777 | add_read_canvas(1,reply_precision); |
2779 | add_read_canvas(1,reply_precision); |
2778 | reset(); |
2780 | reset(); |
2779 | break; |
2781 | break; |
2780 | case SETPIXEL: |
2782 | case SETPIXEL: |
2781 | /* |
2783 | /* |
Line 2964... | Line 2966... | ||
2964 | /* string_length = snprintf(NULL,0,"set_clock = function(num,type,diff){var name = eval(\"clocks\"+num);switch(type){case 1:name.H = parseInt(name.H+diff);break;case 2:name.M = parseInt(name.M+diff);break;case 3:name.S = parseInt(name.S+diff);break;default: break;};name = clock(name.xc,name.yc,name.radius,name.H,name.M,name.S,name.type,name.interaction,name.H_color,name.M_color,name.S_color,name.bg_color,name.fg_color);};\n"); |
2966 | /* string_length = snprintf(NULL,0,"set_clock = function(num,type,diff){var name = eval(\"clocks\"+num);switch(type){case 1:name.H = parseInt(name.H+diff);break;case 2:name.M = parseInt(name.M+diff);break;case 3:name.S = parseInt(name.S+diff);break;default: break;};name = clock(name.xc,name.yc,name.radius,name.H,name.M,name.S,name.type,name.interaction,name.H_color,name.M_color,name.S_color,name.bg_color,name.fg_color);};\n"); |
2965 | check_string_length(string_length);tmp_buffer = my_newmem(string_length+1); |
2967 | check_string_length(string_length);tmp_buffer = my_newmem(string_length+1); |
2966 | snprintf(tmp_buffer,string_length,"set_clock = function(num,type,diff){var name = eval(\"clocks\"+num);switch(type){case 1:name.H = parseInt(name.H+diff);break;case 2:name.M = parseInt(name.M+diff);break;case 3:name.S = parseInt(name.S+diff);break;default: break;};name = clock(name.xc,name.yc,name.radius,name.H,name.M,name.S,name.type,name.interaction,name.H_color,name.M_color,name.S_color,name.bg_color,name.fg_color);};\n"); |
2968 | snprintf(tmp_buffer,string_length,"set_clock = function(num,type,diff){var name = eval(\"clocks\"+num);switch(type){case 1:name.H = parseInt(name.H+diff);break;case 2:name.M = parseInt(name.M+diff);break;case 3:name.S = parseInt(name.S+diff);break;default: break;};name = clock(name.xc,name.yc,name.radius,name.H,name.M,name.S,name.type,name.interaction,name.H_color,name.M_color,name.S_color,name.bg_color,name.fg_color);};\n"); |
2967 | add_to_buffer(tmp_buffer); |
2969 | add_to_buffer(tmp_buffer); |
2968 | */ |
2970 | */ |
2969 | fprintf(js_include_file," |
2971 | fprintf(js_include_file,"set_clock = function(num,type,diff){if(wims_status == \"done\"){return;};var name = eval(\"clocks\"+num);switch(type){case 1:name.H = parseInt(name.H+diff);break;case 2:name.M = parseInt(name.M+diff);break;case 3:name.S = parseInt(name.S+diff);break;default: break;};name = new clock(name.xc,name.yc,name.radius,name.H,name.M,name.S,name.type,name.interaction,name.H_color,name.M_color,name.S_color,name.bg_color,name.fg_color);};\n"); |
2970 | } |
2972 | } |
2971 | else |
2973 | else |
2972 | { |
2974 | { |
2973 | canvas_error("interactive clock may not be used together with other reply_types..."); |
2975 | canvas_error("interactive clock may not be used together with other reply_types..."); |
2974 | } |
2976 | } |
2975 | fprintf(stdout,"<p style=\"text-align:center\"><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,1,1)\" value=\"H+\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,2,1)\" value=\"M+\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,3,1)\" value=\"S+\" /><br /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,1,-1)\" value=\"H−\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,2,-1)\" value=\"M−\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,3,-1)\" value=\"S−\" /></p>",input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt); |
- | |
2976 | } |
2977 | } |
- | 2978 | fprintf(stdout,"<p style=\"text-align:center\"><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,1,1)\" value=\"H+\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,2,1)\" value=\"M+\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,3,1)\" value=\"S+\" /><br /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,1,-1)\" value=\"H−\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,2,-1)\" value=\"M−\" /><input style=\"%s\" type=\"button\" onclick=\"javascript:set_clock(%d,3,-1)\" value=\"S−\" /></p>",input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt,input_style,clock_cnt); |
|
2977 | break; |
2979 | break; |
2978 | case 2:if( reply_format == 0 ){ |
2980 | case 2:if( reply_format == 0 ){ |
2979 | reply_format = 19; /* "onclick */ |
2981 | reply_format = 19; /* "onclick */ |
2980 | fprintf(js_include_file,"\n<!-- begin onclick handler for clocks -->\nvar reply = new Array();\n\ncanvas_div.addEventListener( 'mousedown', user_click,false);\n\nfunction user_click(evt){if(evt.which == 1){var canvas_rect = clock_canvas.getBoundingClientRect();\nvar x = evt.clientX - canvas_rect.left;\nvar y = evt.clientY - canvas_rect.top;\nvar p = 0;\nvar name;\nvar t = true;\nwhile(t){try{name = eval('clocks'+p);\nif( x < name.xc + name.radius && x > name.xc - name.radius ){if( y < name.yc + name.radius && y > name.yc - name.radius ){reply[0] = p;\nname = clock(name |
2982 | fprintf(js_include_file,"\n<!-- begin onclick handler for clocks -->\nvar reply = new Array();\n\ncanvas_div.addEventListener( 'mousedown', user_click,false);\n\nfunction user_click(evt){if(evt.which == 1){var canvas_rect = clock_canvas.getBoundingClientRect();\nvar x = evt.clientX - canvas_rect.left;\nvar y = evt.clientY - canvas_rect.top;\nvar p = 0;\nvar name;\nvar t = true;\nwhile(t){try{name = eval('clocks'+p);\nif( x < name.xc + name.radius && x > name.xc - name.radius ){if( y < name.yc + name.radius && y > name.yc - name.radius ){reply[0] = p;\nname = new clock(name.xc,name.yc,name.radius,name.H,name.M,name.S,name.type,name.interaction,name.H_color,name.M_color,name.S_color,\"lightblue\",name.fg_color);\n};\n}else{clock_ctx.clearRect(name.xc-name.radius,name.yc-name.radius,name.xc+name.radius,name.yc+name.radius);\nname = new clock(name.xc,name.yc,name.radius,name.H,name.M,name.S,name.type,name.interaction,name.H_color,name.M_color,name.S_color,name.bg_color,name.fg_color);\n};\np++;\n}catch(e){t=false;\n};\n};\n};\n};\n\n<!-- end onclick handler for clocks -->\n "); |
2981 | } |
2983 | } |
2982 | else |
2984 | else |
2983 | { |
2985 | { |
2984 | if( reply_format != 19){ |
2986 | if( reply_format != 19){ |
2985 | canvas_error("clickable clock(s) may not be used together with other reply_types..."); |
2987 | canvas_error("clickable clock(s) may not be used together with other reply_types..."); |
Line 2988... | Line 2990... | ||
2988 | break; |
2990 | break; |
2989 | default: canvas_error("interactive must be set 0,1 or 2");break; |
2991 | default: canvas_error("interactive must be set 0,1 or 2");break; |
2990 | } |
2992 | } |
2991 | break; |
2993 | break; |
2992 | case 8: |
2994 | case 8: |
- | 2995 | if(clock_cnt == 0 ){ /* set opacity's just once .... it should be a argument to clock() , for now it's OK */ |
|
2993 | fprintf(js_include_file,"var clock_bg_opacity = %.2f;var clock_fg_opacity = %.2f;",fill_opacity,stroke_opacity); |
2996 | fprintf(js_include_file,"var clock_bg_opacity = %.2f;var clock_fg_opacity = %.2f;",fill_opacity,stroke_opacity); |
- | 2997 | } |
|
2994 | temp = get_string(infile,1); |
2998 | temp = get_string(infile,1); |
2995 | if( strstr( temp,",") != 0 ){ temp = str_replace(temp,",","\",\""); } |
2999 | if( strstr( temp,",") != 0 ){ temp = str_replace(temp,",","\",\""); } |
2996 | if( strlen(temp) < 1 ){temp = ",\"\",\"\",\"\",\"\",\"\"";} |
3000 | if( strlen(temp) < 1 ){temp = ",\"\",\"\",\"\",\"\",\"\"";} |
2997 | string_length = snprintf(NULL,0,"clocks%d = new clock(%d,%d,%d,%d,%d,%d,%d,%d,\"%s\");\n",clock_cnt,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],int_data[6],int_data[7],temp); |
3001 | string_length = snprintf(NULL,0,"var clocks%d = new clock(%d,%d,%d,%d,%d,%d,%d,%d,\"%s\");\n",clock_cnt,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],int_data[6],int_data[7],temp); |
2998 | check_string_length(string_length);tmp_buffer = my_newmem(string_length+1); |
3002 | check_string_length(string_length);tmp_buffer = my_newmem(string_length+1); |
2999 | snprintf(tmp_buffer,string_length,"clocks%d = new clock(%d,%d,%d,%d,%d,%d,%d,%d,\"%s\");\n",clock_cnt,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],int_data[6],int_data[7],temp); |
3003 | snprintf(tmp_buffer,string_length,"var clocks%d = new clock(%d,%d,%d,%d,%d,%d,%d,%d,\"%s\");\n",clock_cnt,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],int_data[6],int_data[7],temp); |
3000 | add_to_buffer(tmp_buffer); |
3004 | add_to_buffer(tmp_buffer); |
3001 | clock_cnt++; |
3005 | clock_cnt++; |
3002 | break; |
3006 | break; |
3003 | default:break; |
3007 | default:break; |
3004 | } |
3008 | } |
Line 3487... | Line 3491... | ||
3487 | y1,y2,y3,y4....y_n |
3491 | y1,y2,y3,y4....y_n |
3488 | 3492 | ||
3489 | x/y in pixels |
3493 | x/y in pixels |
3490 | 3494 | ||
3491 | 2 = x1,x2,x3,x4....x_n |
3495 | 2 = x1,x2,x3,x4....x_n |
3492 | y1,y2,y3,y4....y_n |
3496 | y1,y2,y3,y4....y_n |
3493 | x/y in xrange / yrange coordinate system |
3497 | x/y in xrange / yrange coordinate system |
3494 | 3498 | ||
3495 | 3 = x1,x2,x3,x4....x_n |
3499 | 3 = x1,x2,x3,x4....x_n |
3496 | y1,y2,y3,y4....y_n |
3500 | y1,y2,y3,y4....y_n |
3497 | r1,r2,r3,r4....r_n |
3501 | r1,r2,r3,r4....r_n |
3498 | 3502 | ||
3499 | x/y in pixels |
3503 | x/y in pixels |
3500 | r in pixels |
3504 | r in pixels |
3501 | 3505 | ||
3502 | 4 = x1,x2,x3,x4....x_n |
3506 | 4 = x1,x2,x3,x4....x_n |
3503 | y1,y2,y3,y4....y_n |
3507 | y1,y2,y3,y4....y_n |
3504 | r1,r2,r3,r4....r_n |
3508 | r1,r2,r3,r4....r_n |
3505 | 3509 | ||
3506 | x/y in xrange / yrange coordinate system |
3510 | x/y in xrange / yrange coordinate system |
3507 | r in pixels |
3511 | r in pixels |
3508 | 3512 | ||
3509 | 5 = Ax1,Ax2,Ax3,Ax4....Ax_n |
3513 | 5 = Ax1,Ax2,Ax3,Ax4....Ax_n |
3510 | Ay1,Ay2,Ay3,Ay4....Ay_n |
3514 | Ay1,Ay2,Ay3,Ay4....Ay_n |
3511 | Bx1,Bx2,Bx3,Bx4....Bx_n |
3515 | Bx1,Bx2,Bx3,Bx4....Bx_n |
3512 | By1,By2,By3,By4....By_n |
3516 | By1,By2,By3,By4....By_n |
3513 | Cx1,Cx2,Cx3,Cx4....Cx_n |
3517 | Cx1,Cx2,Cx3,Cx4....Cx_n |
3514 | Cy1,Cy2,Cy3,Cy4....Cy_n |
3518 | Cy1,Cy2,Cy3,Cy4....Cy_n |
3515 | .... |
3519 | .... |
3516 | Zx1,Zx2,Zx3,Zx4....Zx_n |
3520 | Zx1,Zx2,Zx3,Zx4....Zx_n |
3517 | Zy1,Zy2,Zy3,Zy4....Zy_n |
3521 | Zy1,Zy2,Zy3,Zy4....Zy_n |
3518 | |
3522 | |
3519 | x/y in pixels |
3523 | x/y in pixels |
3520 | 3524 | ||
3521 | 6 = Ax1,Ax2,Ax3,Ax4....Ax_n |
3525 | 6 = Ax1,Ax2,Ax3,Ax4....Ax_n |
3522 | Ay1,Ay2,Ay3,Ay4....Ay_n |
3526 | Ay1,Ay2,Ay3,Ay4....Ay_n |
3523 | Bx1,Bx2,Bx3,Bx4....Bx_n |
3527 | Bx1,Bx2,Bx3,Bx4....Bx_n |
Line 3529... | Line 3533... | ||
3529 | Zy1,Zy2,Zy3,Zy4....Zy_n |
3533 | Zy1,Zy2,Zy3,Zy4....Zy_n |
3530 | 3534 | ||
3531 | x/y in xrange / yrange coordinate system |
3535 | x/y in xrange / yrange coordinate system |
3532 | |
3536 | |
3533 | 7 = x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n |
3537 | 7 = x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n |
3534 | |
3538 | |
3535 | x/y in pixels |
3539 | x/y in pixels |
3536 | 3540 | ||
3537 | 8 = x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n |
3541 | 8 = x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n |
3538 | |
3542 | |
3539 | x/y in xrange / yrange coordinate system |
3543 | x/y in xrange / yrange coordinate system |
3540 | 3544 | ||
3541 | 9 = x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n |
3545 | 9 = x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n |
3542 | 3546 | ||
3543 | x/y in pixels |
3547 | x/y in pixels |
3544 | 3548 | ||
3545 | 10 = x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n |
3549 | 10 = x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n |
3546 | 3550 | ||
3547 | x/y in xrange / yrange coordinate system |
3551 | x/y in xrange / yrange coordinate system |
3548 | 3552 | ||
3549 | 11 = Ax1,Ay1,Ax2,Ay2 |
3553 | 11 = Ax1,Ay1,Ax2,Ay2 |
3550 | Bx1,By1,Bx2,By2 |
3554 | Bx1,By1,Bx2,By2 |
3551 | Cx1,Cy1,Cx2,Cy2 |
3555 | Cx1,Cy1,Cx2,Cy2 |
3552 | Dx1,Dy1,Dx2,Dy2 |
3556 | Dx1,Dy1,Dx2,Dy2 |
3553 | ...... |
3557 | ...... |
3554 | Zx1,Zy1,Zx2,Zy2 |
3558 | Zx1,Zy1,Zx2,Zy2 |
3555 | |
3559 | |
3556 | x/y in xrange / yrange coordinate system |
3560 | x/y in xrange / yrange coordinate system |
3557 | 3561 | ||
3558 | 12 = Ax1,Ay1,Ax2,Ay2 |
3562 | 12 = Ax1,Ay1,Ax2,Ay2 |
3559 | Bx1,By1,Bx2,By2 |
3563 | Bx1,By1,Bx2,By2 |
3560 | Cx1,Cy1,Cx2,Cy2 |
3564 | Cx1,Cy1,Cx2,Cy2 |
3561 | Dx1,Dy1,Dx2,Dy2 |
3565 | Dx1,Dy1,Dx2,Dy2 |
3562 | ...... |
3566 | ...... |
3563 | Zx1,Zy1,Zx2,Zy2 |
3567 | Zx1,Zy1,Zx2,Zy2 |
3564 | |
3568 | |
3565 | x/y in pixels |
3569 | x/y in pixels |
3566 | 3570 | ||
3567 | 13 = Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2,Cx1:Cy1:Cx2:Cy2,Dx1:Dy1:Dx2:Dy2, ... ,Zx1:Zy1:Zx2:Zy2 |
3571 | 13 = Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2,Cx1:Cy1:Cx2:Cy2,Dx1:Dy1:Dx2:Dy2, ... ,Zx1:Zy1:Zx2:Zy2 |
3568 | 3572 | ||
3569 | x/y in xrange / yrange coordinate system |
3573 | x/y in xrange / yrange coordinate system |
3570 | 14 = Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2....Zx1:Zy1:Zx2:Zy2 |
3574 | 14 = Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2....Zx1:Zy1:Zx2:Zy2 |
3571 | x/y in pixels |
3575 | x/y in pixels |
3572 | 15 = reply from inputfields,textareas |
3576 | 15 = reply from inputfields,textareas |
3573 | reply1,reply2,reply3,...,reply_n |
3577 | reply1,reply2,reply3,...,reply_n |
3574 | only fields set write (a.g. will not read 'readonly' inputfield values' |
3578 | only fields set write (a.g. will not read 'readonly' inputfield values' |
3575 | 3579 | ||
3576 | 16 = read mathml inputfields only |
3580 | 16 = read mathml inputfields only |
3577 | 3581 | ||
3578 | 17 = read userdraw text only (x1:y1:text1,x2:y2:text2...x_n:y_n:text_n |
3582 | 17 = read userdraw text only (x1:y1:text1,x2:y2:text2...x_n:y_n:text_n |
3579 | when ready : calculate size_t of string via snprintf(NULL,0,"blah blah..."); |
3583 | when ready : calculate size_t of string via snprintf(NULL,0,"blah blah..."); |
3580 | 3584 | ||
3581 | 18 = read clock(s) : H1:M1:S1,H2:M2:S2,...H_n:M_n:S_n |
3585 | 18 = read clock(s) : H1:M1:S1,H2:M2:S2,...H_n:M_n:S_n |
3582 | 19 = return clicked object number (analogue to shape-library onclick) |
3586 | 19 = return clicked object number (analogue to shape-library onclick) |
Line 3633... | Line 3637... | ||
3633 | t++;\ |
3637 | t++;\ |
3634 | };\ |
3638 | };\ |
3635 | };\ |
3639 | };\ |
3636 | if( typeof userdraw_text != 'undefined' ){\ |
3640 | if( typeof userdraw_text != 'undefined' ){\ |
3637 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+input_reply + \"\\n\"+userdraw_text;\ |
3641 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+input_reply + \"\\n\"+userdraw_text;\ |
3638 | }\ |
3642 | }\ |
3639 | else\ |
3643 | else\ |
3640 | {\ |
3644 | {\ |
3641 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+input_reply;\ |
3645 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+input_reply;\ |
3642 | }\ |
3646 | }\ |
3643 | }\ |
3647 | }\ |
3644 | else\ |
3648 | else\ |
3645 | {\ |
3649 | {\ |
3646 | if( typeof userdraw_text != 'undefined' ){\ |
3650 | if( typeof userdraw_text != 'undefined' ){\ |
3647 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_text;\ |
3651 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_text;\ |
3648 | }\ |
3652 | }\ |
3649 | else\ |
3653 | else\ |
3650 | {\ |
3654 | {\ |
3651 | return userdraw_x+\"\\n\"+userdraw_y;\ |
3655 | return userdraw_x+\"\\n\"+userdraw_y;\ |
3652 | }\ |
3656 | }\ |
3653 | };\ |
3657 | };\ |
3654 | };\n\ |
3658 | };\n\ |
3655 | <!-- end function 1 read_canvas() -->"); |
3659 | <!-- end function 1 read_canvas() -->"); |
3656 | break; |
3660 | break; |
3657 | case 2: fprintf(js_include_file,"\ |
3661 | case 2: fprintf(js_include_file,"\ |
3658 | \n<!-- begin function 2 read_canvas() -->\n\ |
3662 | \n<!-- begin function 2 read_canvas() -->\n\ |
3659 | read_canvas = function(){\ |
3663 | read_canvas = function(){\ |
3660 | if( userdraw_x.length == 0){alert(\"nothing drawn...\");return;}\ |
3664 | if( userdraw_x.length == 0){alert(\"nothing drawn...\");return;}\ |
3661 | set_reply_precision();\ |
3665 | set_reply_precision();\ |
3662 | var reply_x = new Array();var reply_y = new Array();var p = 0;\ |
3666 | var reply_x = new Array();var reply_y = new Array();var p = 0;\ |
3663 | var prec = %d;\ |
3667 | var prec = %d;\ |
3664 | while(userdraw_x[p]){\ |
3668 | while(userdraw_x[p]){\ |
3665 | reply_x[p] = (Math.round(prec*(px2x(userdraw_x[p]))))/prec;\ |
3669 | reply_x[p] = (Math.round(prec*(px2x(userdraw_x[p]))))/prec;\ |
3666 | reply_y[p] = (Math.round(prec*(px2y(userdraw_y[p]))))/prec;\ |
3670 | reply_y[p] = (Math.round(prec*(px2y(userdraw_y[p]))))/prec;\ |
3667 | p++;\ |
3671 | p++;\ |
3668 | };\ |
3672 | };\ |
3669 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3673 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3670 | if( document.getElementById(\"canvas_input0\")){\ |
3674 | if( document.getElementById(\"canvas_input0\")){\ |
3671 | var p = 0;var input_reply = new Array();\ |
3675 | var p = 0;var input_reply = new Array();\ |
3672 | if( document.getElementById(\"canvas_input0\")){\ |
3676 | if( document.getElementById(\"canvas_input0\")){\ |
3673 | var t = 0;\ |
3677 | var t = 0;\ |
3674 | while(document.getElementById(\"canvas_input\"+t)){\ |
3678 | while(document.getElementById(\"canvas_input\"+t)){\ |
3675 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3679 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3676 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3680 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3677 | p++;\ |
3681 | p++;\ |
3678 | };\ |
3682 | };\ |
3679 | t++;\ |
3683 | t++;\ |
3680 | };\ |
3684 | };\ |
3681 | };\ |
3685 | };\ |
Line 3702... | Line 3706... | ||
3702 | break; |
3706 | break; |
3703 | case 3: fprintf(js_include_file,"\ |
3707 | case 3: fprintf(js_include_file,"\ |
3704 | \n<!-- begin function 3 read_canvas() -->\n\ |
3708 | \n<!-- begin function 3 read_canvas() -->\n\ |
3705 | read_canvas = function(){\ |
3709 | read_canvas = function(){\ |
3706 | if( userdraw_x.length == 0){alert(\"nothing drawn...\");return;}\ |
3710 | if( userdraw_x.length == 0){alert(\"nothing drawn...\");return;}\ |
3707 | set_reply_precision();\ |
3711 | set_reply_precision();\ |
3708 | if( document.getElementById(\"canvas_input0\") || document.getElementById(\"mathml0\") ){\ |
3712 | if( document.getElementById(\"canvas_input0\") || document.getElementById(\"mathml0\") ){\ |
3709 | var p = 0;var input_reply = new Array();\ |
3713 | var p = 0;var input_reply = new Array();\ |
3710 | if( document.getElementById(\"canvas_input0\")){\ |
3714 | if( document.getElementById(\"canvas_input0\")){\ |
3711 | var t = 0;\ |
3715 | var t = 0;\ |
3712 | while(document.getElementById(\"canvas_input\"+t)){\ |
3716 | while(document.getElementById(\"canvas_input\"+t)){\ |
3713 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3717 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3714 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3718 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3715 | p++;\ |
3719 | p++;\ |
3716 | };\ |
3720 | };\ |
Line 3721... | Line 3725... | ||
3721 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_radius+\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3725 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_radius+\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3722 | }\ |
3726 | }\ |
3723 | else\ |
3727 | else\ |
3724 | {\ |
3728 | {\ |
3725 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_radius+\"\\n\"+input_reply;\ |
3729 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_radius+\"\\n\"+input_reply;\ |
3726 | }\ |
3730 | }\ |
3727 | }\ |
3731 | }\ |
3728 | else\ |
3732 | else\ |
3729 | {\ |
3733 | {\ |
3730 | if( typeof userdraw_text != 'undefined' ){\ |
3734 | if( typeof userdraw_text != 'undefined' ){\ |
3731 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_radius+\"\\n\"+userdrawW_text;\ |
3735 | return userdraw_x+\"\\n\"+userdraw_y+\"\\n\"+userdraw_radius+\"\\n\"+userdrawW_text;\ |
3732 | }\ |
3736 | }\ |
3733 | else\ |
3737 | else\ |
Line 3760... | Line 3764... | ||
3760 | };\ |
3764 | };\ |
3761 | t++;\ |
3765 | t++;\ |
3762 | };\ |
3766 | };\ |
3763 | };\ |
3767 | };\ |
3764 | if( typeof userdraw_text != 'undefined' ){\ |
3768 | if( typeof userdraw_text != 'undefined' ){\ |
3765 | return reply_x+\"\\n\"+reply_y +\"\\n\"+userdraw_radius+\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3769 | return reply_x+\"\\n\"+reply_y +\"\\n\"+userdraw_radius+\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3766 | }\ |
3770 | }\ |
3767 | else\ |
3771 | else\ |
3768 | {\ |
3772 | {\ |
3769 | return reply_x+\"\\n\"+reply_y +\"\\n\"+userdraw_radius+\"\\n\"+input_reply;\ |
3773 | return reply_x+\"\\n\"+reply_y +\"\\n\"+userdraw_radius+\"\\n\"+input_reply;\ |
3770 | }\ |
- | |
3771 | }\ |
- | |
3772 | else\ |
- | |
3773 | {\ |
- | |
3774 | if( typeof userdraw_text != 'undefined' ){\ |
- | |
3775 | return reply_x+\"\\n\"+reply_y+\"\\n\"+userdraw_radius+\"\\n\"+userdraw_text;\ |
- | |
3776 | }\ |
- | |
3777 | else\ |
- | |
3778 | {\ |
- | |
3779 | return reply_x+\"\\n\"+reply_y+\"\\n\"+userdraw_radius;\ |
- | |
3780 | }\ |
- | |
3781 | };\ |
- | |
3782 | };\n\ |
- | |
3783 | <!-- end function 4 read_canvas() -->",reply_precision); |
- | |
3784 | break; |
- | |
3785 | /* |
- | |
3786 | attention: we reset userdraw_x / userdraw_y : because userdraw_x = [][] userdraw_y = [][] |
- | |
3787 | used for userdraw multiple paths |
- | |
3788 | */ |
- | |
3789 | case 5: fprintf(js_include_file,"\ |
- | |
3790 | \n<!-- begin function 5 read_canvas() -->\n\ |
- | |
3791 | read_canvas = function(){\ |
- | |
3792 | set_reply_precision();\ |
- | |
3793 | var p = 0;\ |
- | |
3794 | var reply = \"\";\ |
- | |
3795 | for(p = 0; p < userdraw_x.length;p++){\ |
- | |
3796 | if(userdraw_x[p] != null ){\ |
- | |
3797 | reply = reply + userdraw_x[p]+\"\\n\"+userdraw_y[p]+\"\\n\";\ |
- | |
3798 | };\ |
- | |
3799 | };\ |
- | |
3800 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
- | |
3801 | userdraw_x = [];userdraw_y = [];\ |
- | |
3802 | if( document.getElementById(\"canvas_input0\") || document.getElementById(\"mathml0\") ){\ |
- | |
3803 | var p = 0;var input_reply = new Array();\ |
- | |
3804 | if( document.getElementById(\"canvas_input0\")){\ |
- | |
3805 | var t = 0;\ |
- | |
3806 | while(document.getElementById(\"canvas_input\"+t)){\ |
- | |
3807 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
- | |
3808 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
- | |
3809 | p++;\ |
- | |
3810 | };\ |
- | |
3811 | t++;\ |
- | |
3812 | };\ |
- | |
3813 | };\ |
- | |
3814 | if( typeof userdraw_text != 'undefined' ){\ |
- | |
3815 | return reply +\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
- | |
3816 | }\ |
- | |
3817 | else\ |
- | |
3818 | {\ |
- | |
3819 | return reply +\"\\n\"+input_reply;\ |
- | |
3820 | }\ |
3774 | }\ |
3821 | }\ |
3775 | }\ |
3822 | else\ |
3776 | else\ |
3823 | {\ |
3777 | {\ |
3824 | if( typeof userdraw_text != 'undefined' ){\ |
3778 | if( typeof userdraw_text != 'undefined' ){\ |
- | 3779 | return reply_x+\"\\n\"+reply_y+\"\\n\"+userdraw_radius+\"\\n\"+userdraw_text;\ |
|
- | 3780 | }\ |
|
- | 3781 | else\ |
|
- | 3782 | {\ |
|
- | 3783 | return reply_x+\"\\n\"+reply_y+\"\\n\"+userdraw_radius;\ |
|
- | 3784 | }\ |
|
- | 3785 | };\ |
|
- | 3786 | };\n\ |
|
- | 3787 | <!-- end function 4 read_canvas() -->",reply_precision); |
|
- | 3788 | break; |
|
- | 3789 | /* |
|
- | 3790 | attention: we reset userdraw_x / userdraw_y : because userdraw_x = [][] userdraw_y = [][] |
|
- | 3791 | used for userdraw multiple paths |
|
- | 3792 | */ |
|
- | 3793 | case 5: fprintf(js_include_file,"\ |
|
- | 3794 | \n<!-- begin function 5 read_canvas() -->\n\ |
|
- | 3795 | read_canvas = function(){\ |
|
- | 3796 | set_reply_precision();\ |
|
- | 3797 | var p = 0;\ |
|
- | 3798 | var reply = \"\";\ |
|
- | 3799 | for(p = 0; p < userdraw_x.length;p++){\ |
|
- | 3800 | if(userdraw_x[p] != null ){\ |
|
- | 3801 | reply = reply + userdraw_x[p]+\"\\n\"+userdraw_y[p]+\"\\n\";\ |
|
- | 3802 | };\ |
|
- | 3803 | };\ |
|
- | 3804 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
|
- | 3805 | userdraw_x = [];userdraw_y = [];\ |
|
- | 3806 | if( document.getElementById(\"canvas_input0\") || document.getElementById(\"mathml0\") ){\ |
|
- | 3807 | var p = 0;var input_reply = new Array();\ |
|
- | 3808 | if( document.getElementById(\"canvas_input0\")){\ |
|
- | 3809 | var t = 0;\ |
|
- | 3810 | while(document.getElementById(\"canvas_input\"+t)){\ |
|
- | 3811 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
|
- | 3812 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
|
- | 3813 | p++;\ |
|
- | 3814 | };\ |
|
- | 3815 | t++;\ |
|
- | 3816 | };\ |
|
- | 3817 | };\ |
|
- | 3818 | if( typeof userdraw_text != 'undefined' ){\ |
|
- | 3819 | return reply +\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
|
- | 3820 | }\ |
|
- | 3821 | else\ |
|
- | 3822 | {\ |
|
- | 3823 | return reply +\"\\n\"+input_reply;\ |
|
- | 3824 | }\ |
|
- | 3825 | }\ |
|
- | 3826 | else\ |
|
- | 3827 | {\ |
|
- | 3828 | if( typeof userdraw_text != 'undefined' ){\ |
|
3825 | return reply+\"\\n\"+userdraw_text;\ |
3829 | return reply+\"\\n\"+userdraw_text;\ |
3826 | }\ |
3830 | }\ |
3827 | else\ |
3831 | else\ |
3828 | {\ |
3832 | {\ |
3829 | return reply;\ |
3833 | return reply;\ |
3830 | }\ |
3834 | }\ |
3831 | };\ |
3835 | };\ |
Line 3855... | Line 3859... | ||
3855 | reply = reply + tmp_x + \"\\n\" + tmp_y +\"\\n\";\ |
3859 | reply = reply + tmp_x + \"\\n\" + tmp_y +\"\\n\";\ |
3856 | };\ |
3860 | };\ |
3857 | };\ |
3861 | };\ |
3858 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3862 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3859 | userdraw_x = [];userdraw_y = [];\ |
3863 | userdraw_x = [];userdraw_y = [];\ |
3860 | if( document.getElementById(\"canvas_input0\") ){\ |
3864 | if( document.getElementById(\"canvas_input0\") ){\ |
3861 | var p = 0;var input_reply = new Array();\ |
3865 | var p = 0;var input_reply = new Array();\ |
3862 | if( document.getElementById(\"canvas_input0\")){\ |
3866 | if( document.getElementById(\"canvas_input0\")){\ |
3863 | var t = 0;\ |
3867 | var t = 0;\ |
3864 | while(document.getElementById(\"canvas_input\"+t)){\ |
3868 | while(document.getElementById(\"canvas_input\"+t)){\ |
3865 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3869 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3866 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3870 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3867 | p++;\ |
3871 | p++;\ |
3868 | };\ |
3872 | };\ |
3869 | t++;\ |
3873 | t++;\ |
3870 | };\ |
3874 | };\ |
3871 | };\ |
3875 | };\ |
3872 | if( typeof userdraw_text != 'undefined' ){\ |
3876 | if( typeof userdraw_text != 'undefined' ){\ |
3873 | return reply +\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3877 | return reply +\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3874 | }\ |
3878 | }\ |
3875 | else\ |
3879 | else\ |
3876 | {\ |
3880 | {\ |
3877 | return reply +\"\\n\"+input_reply;\ |
3881 | return reply +\"\\n\"+input_reply;\ |
3878 | }\ |
3882 | }\ |
3879 | }\ |
3883 | }\ |
3880 | else\ |
3884 | else\ |
3881 | {\ |
3885 | {\ |
3882 | if( typeof userdraw_text != 'undefined' ){\ |
3886 | if( typeof userdraw_text != 'undefined' ){\ |
3883 | return reply +\"\\n\"+userdraw_text;\ |
3887 | return reply +\"\\n\"+userdraw_text;\ |
3884 | }\ |
3888 | }\ |
3885 | else\ |
3889 | else\ |
3886 | {\ |
3890 | {\ |
3887 | return reply;\ |
3891 | return reply;\ |
3888 | }\ |
3892 | }\ |
3889 | };\ |
3893 | };\ |
3890 | };\n\ |
3894 | };\n\ |
3891 | <!-- end function 6 read_canvas() -->",reply_precision); |
3895 | <!-- end function 6 read_canvas() -->",reply_precision); |
3892 | break; |
3896 | break; |
3893 | case 7: fprintf(js_include_file,"\ |
3897 | case 7: fprintf(js_include_file,"\ |
3894 | \n<!-- begin function 7 read_canvas() -->\n\ |
3898 | \n<!-- begin function 7 read_canvas() -->\n\ |
3895 | read_canvas = function(){\ |
3899 | read_canvas = function(){\ |
Line 3900... | Line 3904... | ||
3900 | reply[p] = userdraw_x[p] +\":\" + userdraw_y[p];\ |
3904 | reply[p] = userdraw_x[p] +\":\" + userdraw_y[p];\ |
3901 | p++;\ |
3905 | p++;\ |
3902 | };\ |
3906 | };\ |
3903 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3907 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3904 | if( document.getElementById(\"canvas_input0\") ){\ |
3908 | if( document.getElementById(\"canvas_input0\") ){\ |
3905 | var p = 0;var input_reply = new Array();\ |
3909 | var p = 0;var input_reply = new Array();\ |
3906 | if( document.getElementById(\"canvas_input0\")){\ |
3910 | if( document.getElementById(\"canvas_input0\")){\ |
3907 | var t = 0;\ |
3911 | var t = 0;\ |
3908 | while(document.getElementById(\"canvas_input\"+t)){\ |
3912 | while(document.getElementById(\"canvas_input\"+t)){\ |
3909 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3913 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3910 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3914 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3911 | p++;\ |
3915 | p++;\ |
3912 | };\ |
3916 | };\ |
3913 | t++;\ |
3917 | t++;\ |
3914 | };\ |
3918 | };\ |
3915 | };\ |
3919 | };\ |
3916 | if( typeof userdraw_text != 'undefined' ){\ |
3920 | if( typeof userdraw_text != 'undefined' ){\ |
3917 | return reply+\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3921 | return reply+\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3918 | }\ |
3922 | }\ |
3919 | else\ |
3923 | else\ |
3920 | {\ |
3924 | {\ |
3921 | return reply+\"\\n\"+input_reply;\ |
3925 | return reply+\"\\n\"+input_reply;\ |
3922 | }\ |
3926 | }\ |
3923 | }\ |
3927 | }\ |
3924 | else\ |
3928 | else\ |
3925 | {\ |
3929 | {\ |
3926 | if( typeof userdraw_text != 'undefined' ){\ |
3930 | if( typeof userdraw_text != 'undefined' ){\ |
3927 | return reply+\"\\n\"+userdraw_text;\ |
3931 | return reply+\"\\n\"+userdraw_text;\ |
3928 | }\ |
3932 | }\ |
3929 | else\ |
3933 | else\ |
3930 | {\ |
3934 | {\ |
3931 | return reply;\ |
3935 | return reply;\ |
3932 | }\ |
3936 | }\ |
3933 | };\ |
3937 | };\ |
3934 | };\n\ |
3938 | };\n\ |
3935 | <!-- end function 7 read_canvas() -->"); |
3939 | <!-- end function 7 read_canvas() -->"); |
3936 | break; |
3940 | break; |
Line 3984... | Line 3988... | ||
3984 | set_reply_precision();\ |
3988 | set_reply_precision();\ |
3985 | var reply = new Array();\ |
3989 | var reply = new Array();\ |
3986 | var p = 0;\ |
3990 | var p = 0;\ |
3987 | while(userdraw_x[p]){\ |
3991 | while(userdraw_x[p]){\ |
3988 | reply[p] = userdraw_x[p] +\":\" + userdraw_y[p] + \":\" + userdraw_radius[p];\ |
3992 | reply[p] = userdraw_x[p] +\":\" + userdraw_y[p] + \":\" + userdraw_radius[p];\ |
3989 | p++;\ |
3993 | p++;\ |
3990 | };\ |
3994 | };\ |
3991 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3995 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3992 | if( document.getElementById(\"canvas_input0\") ){\ |
3996 | if( document.getElementById(\"canvas_input0\") ){\ |
3993 | var p = 0;var input_reply = new Array();\ |
3997 | var p = 0;var input_reply = new Array();\ |
3994 | if( document.getElementById(\"canvas_input0\")){\ |
3998 | if( document.getElementById(\"canvas_input0\")){\ |
3995 | var t = 0;\ |
3999 | var t = 0;\ |
3996 | while(document.getElementById(\"canvas_input\"+t)){\ |
4000 | while(document.getElementById(\"canvas_input\"+t)){\ |
3997 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
4001 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3998 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
4002 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
Line 4321... | Line 4325... | ||
4321 | \n<!-- begin function 19 read_canvas() -->\n\ |
4325 | \n<!-- begin function 19 read_canvas() -->\n\ |
4322 | read_canvas = function(){\ |
4326 | read_canvas = function(){\ |
4323 | return reply[0];\ |
4327 | return reply[0];\ |
4324 | };\n\ |
4328 | };\n\ |
4325 | <!-- end function 19 read_canvas() -->"); |
4329 | <!-- end function 19 read_canvas() -->"); |
- | 4330 | break; |
|
4326 | case 20: fprintf(js_include_file,"\ |
4331 | case 20: fprintf(js_include_file,"\ |
4327 | \n<!-- begin function 20 read_canvas() -->\n\ |
4332 | \n<!-- begin function 20 read_canvas() -->\n\ |
4328 | read_canvas = function(){\ |
4333 | read_canvas = function(){\ |
4329 | var prec = %d;\ |
4334 | var prec = %d;\ |
4330 | var len = ext_drag_images.length;\ |
4335 | var len = ext_drag_images.length;\ |
Line 5978... | Line 5983... | ||
5978 | case DRAW_CLOCK: |
5983 | case DRAW_CLOCK: |
5979 | fprintf(js_include_file,"\n<!-- begin command clock -->\n\ |
5984 | fprintf(js_include_file,"\n<!-- begin command clock -->\n\ |
5980 | var clock_canvas = create_canvas%d(%d,xsize,ysize);\ |
5985 | var clock_canvas = create_canvas%d(%d,xsize,ysize);\ |
5981 | var clock_ctx = clock_canvas.getContext(\"2d\");\ |
5986 | var clock_ctx = clock_canvas.getContext(\"2d\");\ |
5982 | var clock = function(xc,yc,radius,H,M,S,type,interaction,h_color,m_color,s_color,bg_color,fg_color){\ |
5987 | var clock = function(xc,yc,radius,H,M,S,type,interaction,h_color,m_color,s_color,bg_color,fg_color){\ |
- | 5988 | clock_ctx.clearRect(xc - radius,yc - radius,2*radius,2*radius);\ |
|
5983 | clock_ctx.save();\ |
5989 | clock_ctx.save();\ |
5984 | clock_ctx.clearRect(xc-radius,yc-radius,xc+radius,yc+radius);\ |
- | |
5985 | clock_ctx.globalAlpha = clock_bg_opacity;\ |
5990 | clock_ctx.globalAlpha = clock_bg_opacity;\ |
5986 | this.type = type || 0;\ |
5991 | this.type = type || 0;\ |
5987 | this.interaction = interaction || 0;\ |
5992 | this.interaction = interaction || 0;\ |
5988 | this.H = H;\ |
5993 | this.H = H;\ |
5989 | this.M = M;\ |
5994 | this.M = M;\ |