Subversion Repositories wimsdev

Rev

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

Rev 16892 Rev 16893
Line 830... Line 830...
830
*/
830
*/
831
/*
831
/*
832
5/2016 changed  to 'setAttribute()' because of trouble on Chromium/Safari/IE
832
5/2016 changed  to 'setAttribute()' because of trouble on Chromium/Safari/IE
833
10/2016 corrected contex-reset-flaw when using "userdraw text,color" and added inputs to the things we can remove
833
10/2016 corrected contex-reset-flaw when using "userdraw text,color" and added inputs to the things we can remove
834
7/2017 added 'userdraw clickfill,color' to removable things...one user_filling per click
834
7/2017 added 'userdraw clickfill,color' to removable things...one user_filling per click
-
 
835
 
-
 
836
7/2022: preserve div's with math (katex | wims_mathml)...hope this does not interfere with other things
-
 
837
https://wimsedu.info/?topic=geometrie-interactive-avec-canvasdraw
835
*/
838
*/
836
fprintf(js_include_file,"\n/* add clear button */\
839
fprintf(js_include_file,"\n/* add clear button */\
837
clear_draw_area%d = function(){\
840
clear_draw_area%d = function(){\
838
 if(typeof(fill_canvas_no) === 'number'){\
841
 if(typeof(fill_canvas_no) === 'number'){\
839
  var chk = document.getElementById('wims_canvas%d'+fill_canvas_no);\
842
  var chk = document.getElementById('wims_canvas%d'+fill_canvas_no);\
Line 842... Line 845...
842
   fill_canvas_no--;userdraw_x.splice(p,1);userdraw_y.splice(p,1);userdraw_radius.splice(p,1);\
845
   fill_canvas_no--;userdraw_x.splice(p,1);userdraw_y.splice(p,1);userdraw_radius.splice(p,1);\
843
   return;\
846
   return;\
844
  };\
847
  };\
845
 };\
848
 };\
846
 if( typeof(context_userdraw) === 'object' ){\
849
 if( typeof(context_userdraw) === 'object' ){\
847
  while( document.getElementById(canvas_div.lastChild.id).tagName == 'DIV'){\
850
  if(document.getElementById(canvas_div.lastChild.id).tagName == 'DIV'){\
-
 
851
   var mathtxt = document.getElementById(canvas_div.lastChild.id).innerHTML;\
-
 
852
   if(mathtxt.indexOf('katex') == -1 && mathtxt.indexOf('wims_mathml') == -1 || canvas_div.lastChild.id.indexOf('placed') != -1){\
848
   document.getElementById(canvas_div.lastChild.id).innerHTML = null;\
853
    document.getElementById(canvas_div.lastChild.id).innerHTML = null;\
849
   canvas_div.removeChild(document.getElementById(canvas_div.lastChild.id));\
854
    canvas_div.removeChild(document.getElementById(canvas_div.lastChild.id));\
-
 
855
   };\
850
  };\
856
  };\
851
  context_userdraw.clearRect(0,0,xsize,ysize);\
857
  context_userdraw.clearRect(0,0,xsize,ysize);\
852
  if( typeof(userdraw_text) !== 'undefined'){ userdraw_text = []; };\
858
  if( typeof(userdraw_text) !== 'undefined'){ userdraw_text = []; };\
853
  if( document.getElementById(\"canvas_input0\") ){\
859
  if( document.getElementById(\"canvas_input0\") ){\
854
   var p = 0;var inp;\
860
   var p = 0;var inp;\