Rev 8130 | Rev 8193 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8130 | Rev 8146 | ||
---|---|---|---|
Line 202... | Line 202... | ||
202 | /* |
202 | /* |
203 | The sequence in which stuff is finally printed is important !! |
203 | The sequence in which stuff is finally printed is important !! |
204 | for example, when writing a 'include.js" the may not be a "script tag <script>" etc etc |
204 | for example, when writing a 'include.js" the may not be a "script tag <script>" etc etc |
205 | */ |
205 | */ |
206 | fprintf(stdout,"\n<script type=\"text/javascript\">var wims_status = \"$status\";</script>\n<!-- canvasdraw div and tooltip placeholder, if needed -->\n<div tabindex=\"0\" id=\"canvas_div%d\" style=\"position:relative;width:%dpx;height:%dpx;margin-left:auto;margin-right:auto;\" ></div><div id=\"tooltip_placeholder_div%d\" style=\"display:block;margin-bottom:4px;\"><span id=\"tooltip_placeholder%d\" style=\"display:none;\"></span></div>\n",canvas_root_id,xsize,ysize,canvas_root_id,canvas_root_id); |
206 | fprintf(stdout,"\n<script type=\"text/javascript\">var wims_status = \"$status\";</script>\n<!-- canvasdraw div and tooltip placeholder, if needed -->\n<div tabindex=\"0\" id=\"canvas_div%d\" style=\"position:relative;width:%dpx;height:%dpx;margin-left:auto;margin-right:auto;\" ></div><div id=\"tooltip_placeholder_div%d\" style=\"display:block;margin-bottom:4px;\"><span id=\"tooltip_placeholder%d\" style=\"display:none;\"></span></div>\n",canvas_root_id,xsize,ysize,canvas_root_id,canvas_root_id); |
207 | fprintf(js_include_file,"\n<!-- begin generated javascript include for canvasdraw -->\n"); |
- | |
208 | fprintf(stdout,"<!-- include actual object code via include file -->\n<script type=\"text/javascript\" src=\"%s\"></script>\n",getfile_cmd); |
207 | 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,"\ |
208 | fprintf(js_include_file,"\n<!-- begin generated javascript include for canvasdraw -->\n\ |
210 | \"use strict\";\n\ |
209 | \"use strict\";\n\ |
- | 210 | <!-- these variables and functions must be global -->\n\ |
|
211 | var read_dragdrop;\ |
211 | var read_dragdrop;\ |
212 | var read_canvas;\ |
212 | var read_canvas;\ |
213 | var set_clock;\ |
213 | var set_clock;\ |
- | 214 | var clear_draw_area;\ |
|
214 | var userdraw_x = [];var userdraw_y = [];var userdraw_radius = [];\ |
215 | var userdraw_x = [];var userdraw_y = [];var userdraw_radius = [];\n\ |
215 | var wims_canvas_function%d = function(){\n<!-- common used stuff -->\n\ |
216 | var wims_canvas_function%d = function(){\n<!-- common used stuff -->\n\ |
216 | var xsize = %d;\ |
217 | var xsize = %d;\ |
217 | var ysize = %d;\ |
218 | var ysize = %d;\ |
218 | var precision = 100;\ |
219 | var precision = 100;\ |
219 | var canvas_div = document.getElementById(\"canvas_div%d\");\ |
220 | var canvas_div = document.getElementById(\"canvas_div%d\");\ |
Line 2220... | Line 2221... | ||
2220 | default: break; |
2221 | default: break; |
2221 | } |
2222 | } |
2222 | } |
2223 | } |
2223 | reset(); |
2224 | reset(); |
2224 | break; |
2225 | break; |
2225 | case |
2226 | case CLEARBUTTON: |
2226 | /* |
2227 | /* |
2227 | |
2228 | @clearbutton value |
- | 2229 | @adds a button to clear the userdraw canvas with text 'value' |
|
- | 2230 | @uses the tooltip placeholder div element: may not be used with command 'intooltip' |
|
2228 | |
2231 | @use command 'inputstyle' to style the button... |
2229 | */ |
2232 | */ |
- | 2233 | add_clear_button(js_include_file,canvas_root_id,input_style,get_string(infile,1)); |
|
2230 | break; |
2234 | break; |
2231 | case INPUTSTYLE: |
2235 | case INPUTSTYLE: |
2232 | /* |
2236 | /* |
2233 | @ inputstyle style_description |
2237 | @ inputstyle style_description |
2234 | @ example: inputstyle color:blue;font-weight:bold;font-style:italic;font-size:16pt |
2238 | @ example: inputstyle color:blue;font-weight:bold;font-style:italic;font-size:16pt |
Line 6519... | Line 6523... | ||
6519 | *triangle="triangle", |
6523 | *triangle="triangle", |
6520 | *ftriangle="ftriangle", |
6524 | *ftriangle="ftriangle", |
6521 | *mathml="mathml", |
6525 | *mathml="mathml", |
6522 | *html="html", |
6526 | *html="html", |
6523 | *input="input", |
6527 | *input="input", |
6524 | * |
6528 | *clearbutton="clearbutton", |
6525 | *inputstyle="inputstyle", |
6529 | *inputstyle="inputstyle", |
6526 | *textarea="textarea", |
6530 | *textarea="textarea", |
6527 | *trange="trange", |
6531 | *trange="trange", |
6528 | *ranget="ranget", |
6532 | *ranget="ranget", |
6529 | *xrange="xrange", |
6533 | *xrange="xrange", |
Line 7065... | Line 7069... | ||
7065 | } |
7069 | } |
7066 | if( strcmp(input_type, blink) == 0 ){ |
7070 | if( strcmp(input_type, blink) == 0 ){ |
7067 | free(input_type); |
7071 | free(input_type); |
7068 | return BLINK; |
7072 | return BLINK; |
7069 | } |
7073 | } |
7070 | if( strcmp(input_type, |
7074 | if( strcmp(input_type, clearbutton) == 0){ |
7071 | free(input_type); |
7075 | free(input_type); |
7072 | return |
7076 | return CLEARBUTTON; |
7073 | } |
7077 | } |
7074 | if( strcmp(input_type, translation) == 0 || strcmp(input_type, translate) == 0 ){ |
7078 | if( strcmp(input_type, translation) == 0 || strcmp(input_type, translate) == 0 ){ |
7075 | free(input_type); |
7079 | free(input_type); |
7076 | return TRANSLATION; |
7080 | return TRANSLATION; |
7077 | } |
7081 | } |