Advanced richtext editor : TinyMce

Published on by Yousfi Benameur

  
this is a demo of awesome richtext editor i pointed in previous posts(cool web app-see the link below).
TinyMCE is a platform independent web-based JavaScript WYSIWYG HTML editor control released as open source under LGPL.TinyMCE enables to convert HTML TEXTAREA fields or other HTML elements to editor instances.
it can work on local files.
Can visit this web page [http://www.tinymce.com/download/download.php] and download the tinyMCE3.5.11(there is for sure other recent  versions-it's always updated).make all things as the image below explains.
save the prg below in the same folder of "examples"(can be another location but must change the relative path or the tinyMCE  [src="../jscripts/tiny_mce/tiny_mce.js" ] in the script tag.it seems the path is always relative (dont admit absolute path).
the code is javascript overlapped with vfp.it builds an internetexplorer.application and tests the 4 skins given by the application.
the richtext editor is very complete.can achieve the code of 2 buttons (open file and save file as to make a complet app...)
try the various buttons of tinyMCE and see how its wonderfull.

of course can make a project, add a config.fpw and generate an executable.
With a browser embed on a form its absolutly the same result.see the code*2*
*can read more on http://www.tinymce.com/index.php
this code is  tested on windows10 pro+vfp9SP2 and ie11 emulation.


*Before begin running the code achieve the downnload of tinyMCE 3.5.11.its free richtext web editor for personal use.

*Before begin running the code achieve the downnload of tinyMCE 3.5.11.its free richtext web editor for personal use.

Click on code to select [then copy] -click outside to deselect

 
    *1*
Local m.yrep
m.yrep=Addbs(Justpath(Sys(16,1)))
Set Defa To (yrep)

Local m.x,m.myvar
m.xx=Int(Val(Inputbox("Skin 1(default),2(O2k7 skin),3(silver),4(black)","","1")))
If Empty(m.xx)
    Return .F.
Endi
If !Inlist(m.xx,1,2,3,4)
	m.x=1
Endi
Do Case
	Case m.xx=1
		TEXT to m.myvar noshow
	// Default skin
	tinyMCE.init({
		// General options
		mode : "exact",
		elements : "ytextarea",
		theme : "advanced",
		plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
        save_enablewhendirty: true,
    	
        


		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
		ENDTEXT


	Case m.xx=2
		TEXT to m.myvar  noshow
	// O2k7 skin
	tinyMCE.init({
		// General options
		mode : "exact",
		elements : "ytextarea",
		theme : "advanced",
		skin : "o2k7",
		plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
        save_enablewhendirty: true,
    	
        


		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
		ENDTEXT


	Case m.xx=3
		TEXT to m.myvar noshow
	// O2k7 skin (silver)
	tinyMCE.init({
		// General options
		mode : "exact",
		elements : "ytextarea",
		theme : "advanced",
		skin : "o2k7",
		skin_variant : "silver",
		plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
        save_enablewhendirty: true,
    	
        


		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
		ENDTEXT

	Case m.xx=4
		TEXT to m.myvar noshow
	// O2k7 skin (silver)
	tinyMCE.init({
		// General options
		mode : "exact",
		elements : "ytextarea",
		theme : "advanced",
		skin : "o2k7",
		skin_variant : "black",
		plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
        save_enablewhendirty: true,
    	
        


		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
		ENDTEXT
Endcase

Local m.my
TEXT to m.my textmerge noshow
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>full Richtext tinyMCE with Skins</title>

<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
<<m.myvar>>
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true"
	 <div>
        <textarea id="ytextarea" name="elm1" rows="36" cols="80" style="width:100%"> type your texts here     </textarea><br />
     </div>
<!--	<input type="submit" name="save" value="Submit" /> -->
	<input type="reset" name="reset" value="Reset" />
</form>
</body>
ENDTEXT
Set Safe Off
Local m.lcdest
m.lcdest=m.yrep+"ytest.html"
Strtofile(m.my,m.lcdest)

Declare Integer BringWindowToTop In user32 Integer
Publi apie
apie=Newobject("internetexplorer.application")
With apie
	.menubar=0
	.Toolbar=0
	.StatusBar=0
	.Resizable=1
	.Width=900
	.Height=650
	.Top=(Sysmetric(2)-.Height)/2
	.Left=(Sysmetric(1)-.Width)/2
	.Navigate(m.lcdest)
	BringWindowToTop(.HWnd)
	.Visible=.T.
Endwith
retu

*i disabled the save button in the script for 4 skins.
*can try with ie browser embed on vfp form also.



this is the full app.can restrict in code the buttons shown as customization.....
this is the full app.can restrict in code the buttons shown as customization.....
this is the full app.can restrict in code the buttons shown as customization.....
this is the full app.can restrict in code the buttons shown as customization.....

this is the full app.can restrict in code the buttons shown as customization.....

Click on code to select [then copy] -click outside to deselect


*2*
*promptly said, promptly made!
*tinyMCE richtext editor on a form and with same prerequisities as code *1*
if !_vfp.startmode=0
on shutdown quit
endi

if !file("../jscripts/tiny_mce/tiny_mce.js")
messagebox("../jscripts/tiny_mce/tiny_mce.js must exist",16+4096,"error",2000)
return .f.
else
*messagebox("../jscripts/tiny_mce/tiny_mce.js exists ok")
endi

Publi yform
yform=Newobject("ytinyMCE")
yform.Show
Read Events
Retu
*
Define Class ytinyMCE As Form
    Height = 566
	Width = 905
	ShowWindow = 2
	AutoCenter = .T.
	Caption = "yTinyMce"
	BackColor = Rgb(0,0,0)
	Name = "Form1"

	Add Object obrowser As OleControl With ;
		oleclass="shell.explorer.2", ;
		Top = 37, ;
		Left = 0, ;
		Height = 527, ;
		Width = 901, ;
		Anchor = 15, ;
		Name = "oBrowser"

	Add Object combo1 As ComboBox With ;
		Anchor = 768, ;
		Height = 25, ;
		Left = 36, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 132, ;
		Name = "Combo1"
        
     Add Object label1 As Label With ;
    	AutoSize = .T., ;
		FontBold = .T.,;
		FontSize = 10,;
		Anchor = 768,;
		BackStyle = 0,;
		Caption = "Warning: if interactive change skin in combo , page is not saved!",;
		Height = 18,;
		Left = 186,;
		Top = 2,;
		Width = 346,;
		ForeColor = Rgb(255,255,255),;
		Name = "Label1"   

	Procedure ybuild
		Local m.x,m.myvar
		m.xx=Thisform.combo1.Value

		Do Case
			Case m.xx=1
				TEXT to m.myvar noshow
			// Default skin
			tinyMCE.init({
				// General options
				mode : "exact",
				elements : "ytextarea",
				theme : "advanced",
				plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

				// Theme options
				theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
				theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
				theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_statusbar_location : "bottom",
				theme_advanced_resizing : true,
		        save_enablewhendirty: true,




				// Example content CSS (should be your site CSS)
				content_css : "css/content.css",

				// Drop lists for link/image/media/template dialogs
				template_external_list_url : "lists/template_list.js",
				external_link_list_url : "lists/link_list.js",
				external_image_list_url : "lists/image_list.js",
				media_external_list_url : "lists/media_list.js",

				// Replace values for the template plugin
				template_replace_values : {
					username : "Some User",
					staffid : "991234"
				}
			});
				ENDTEXT

			Case m.xx=2
				TEXT to m.myvar  noshow
			// O2k7 skin
			tinyMCE.init({
				// General options
				mode : "exact",
				elements : "ytextarea",
				theme : "advanced",
				skin : "o2k7",
				plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

				// Theme options
				theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
				theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
				theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_statusbar_location : "bottom",
				theme_advanced_resizing : true,
		        save_enablewhendirty: true,

				// Example content CSS (should be your site CSS)
				content_css : "css/content.css",

				// Drop lists for link/image/media/template dialogs
				template_external_list_url : "lists/template_list.js",
				external_link_list_url : "lists/link_list.js",
				external_image_list_url : "lists/image_list.js",
				media_external_list_url : "lists/media_list.js",

				// Replace values for the template plugin
				template_replace_values : {
					username : "Some User",
					staffid : "991234"
				}
			});
				ENDTEXT

			Case m.xx=3
				TEXT to m.myvar noshow
			// O2k7 skin (silver)
			tinyMCE.init({
				// General options
				mode : "exact",
				elements : "ytextarea",
				theme : "advanced",
				skin : "o2k7",
				skin_variant : "silver",
				plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
				// Theme options
				theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
				theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
				theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_statusbar_location : "bottom",
				theme_advanced_resizing : true,
		        save_enablewhendirty: true,

				// Example content CSS (should be your site CSS)
				content_css : "css/content.css",

				// Drop lists for link/image/media/template dialogs
				template_external_list_url : "lists/template_list.js",
				external_link_list_url : "lists/link_list.js",
				external_image_list_url : "lists/image_list.js",
				media_external_list_url : "lists/media_list.js",

				// Replace values for the template plugin
				template_replace_values : {
					username : "Some User",
					staffid : "991234"
				}
			});
				ENDTEXT

			Case m.xx=4
				TEXT to m.myvar noshow
			// O2k7 skin (silver)
			tinyMCE.init({
				// General options
				mode : "exact",
				elements : "ytextarea",
				theme : "advanced",
				skin : "o2k7",
				skin_variant : "black",
				plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

				// Theme options
				theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
				theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
				theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_statusbar_location : "bottom",
				theme_advanced_resizing : true,
		        save_enablewhendirty: true,

				// Example content CSS (should be your site CSS)
				content_css : "css/content.css",

				// Drop lists for link/image/media/template dialogs
				template_external_list_url : "lists/template_list.js",
				external_link_list_url : "lists/link_list.js",
				external_image_list_url : "lists/image_list.js",
				media_external_list_url : "lists/media_list.js",

				// Replace values for the template plugin
				template_replace_values : {
					username : "Some User",
					staffid : "991234"
				}
			});
				ENDTEXT
		Endcase

		Local m.my
		TEXT to m.my textmerge noshow
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<title>full Richtext tinyMCE with Skins</title>

		<!-- TinyMCE -->
		<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript">
		<<m.myvar>>
		</script>
		<!-- /TinyMCE -->
		</head>
		<body>
		<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true"
			 <div>
		        <textarea id="ytextarea" name="elm1" rows="30" cols="80" style="width:100%"> type your texts here     </textarea><br />
		     </div>
		<!--	<input type="submit" name="save" value="Submit" /> -->
			<input type="reset" name="reset" value="Reset" />
		</form>
		</body>
		ENDTEXT
		Set Safe Off
		Local m.lcdest
		m.lcdest=m.yrep+"ytest.html"
		Strtofile(m.my,m.lcdest)
		Thisform.obrowser.Navigate(m.lcdest)
	Endproc

	Procedure Init
		Publi m.yrep
		m.yrep=Addbs(Justpath(Sys(16,1)))
		Set Defa To (yrep)
		Thisform.ybuild()
	Endproc

	Procedure Destroy
		Erase Addbs(Sys(2023)+"ytest.html"
		Clea Events
	Endproc

	Procedure obrowser.Init
		This.silent=.T.
	Endproc

	Procedure combo1.Click
		Thisform.ybuild()
	Endproc

	Procedure combo1.Init

		With This
			.AddItem("Skin 1(default)")
			.AddItem("skin 2 (O2k7 )")
			.AddItem("skin 3(silver)")
			.AddItem("skin 4(black)")
			.ListIndex=1
			.Value=1
			.Style=2
		Endwith
	Endproc

Enddefine
*
*-- EndDefine: ytinyMCE




With this can compile a project created to an executable application.

With this can compile a project created to an executable application.

Click on code to select [then copy] -click outside to deselect


*3*
 *this needs only a web link to tinymce.min.js , no need to download or install anything.its a very basic richtext editor.

Local m.myvar
TEXT to m.myvar  noshow
<!DOCTYPE html>
<html>
<head>
<title> A basic tinyMCE richtext editor</title>
  <script src="http://tinymce.cachefly.net/4.3/tinymce.min.js"></script>
  <script>tinymce.init({ selector:'textarea' });</script>
</head>
<body>
  <textarea rows="15" cols="80" style="width:100%">Easy (and free!) </textarea>
</body>
</html>
ENDTEXT
Set Safe Off
Local m.lcdest
m.lcdest=Addbs(Sys(2023))+"ytest.html"
Strtofile(m.myvar,m.lcdest)

Declare Integer BringWindowToTop In user32 Integer
Publi apie
apie=Newobject("internetexplorer.application")
With apie
    .menubar=0
	.Toolbar=0
	.StatusBar=0
	.Resizable=1
	.Width=800
	.Height=400
	.Top=(Sysmetric(2)-.Height)/2
	.Left=(Sysmetric(1)-.Width)/2
	.Navigate(m.lcdest)
	BringWindowToTop(.HWnd)
	.Visible=.T.
Endwith


*tip & trick

can copy and paste any portion of a web page in the tinyMCE editor.it accepts text+images+...the save method is not effective here , but the print is fully capable and can print the pasted section into a pdf file with a virtual printer (as pdfcreator for ex.).

that ensure  to save only the desired section of a web page.

 

To be informed of the latest articles, subscribe:
Comment on this post