areza
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by areza
-
-
HiI wrote this componentA professional editor that takes advantage of the capabilities of TinyMCETwo of my problem, I need your help
1.Component of the output html text for what to do, the following
Function TUniXTinyMCE.GetPlainText: String;begin// Result:= UniSession. Query['????????']; Or Other SolutionEnd;2.The problem with this view is not the first time, but the time to update the page with the error go away
Grateful
----
Component Body
----
Unit UniXTinyMCE;InterfaceUsesSysUtils, Classes, Controls,Ext, ExtPascal, ExtForm,UniGUIBaseClasses, UniGUIClasses,UniPageControl,UniGUIApplication,UniGUIUtils, ExtPascalUtils,uniHTMLFrame, uniGUIServer, UniGUIForm;ConstPackageVersion = '1.1.0';TypeTMyExtButton = Class(TExtButton);TButtonList = RecordJSName: String;OnClick: TNotifyEvent;End;TUniXTinyMCE = Class(TUniHTMLFrame)Private{ Private declarations }Function GetVersion: String;Protected{ Protected declarations }Public{ Public declarations }Constructor Create(Owner: TComponent); Override;Destructor Destroy; Override;Procedure Loaded; Override;procedure SetHtmlText(HtmlText: string);Function GetPlainText: String;Published{ Published declarations }Property Vesrion: String Read GetVersion;End;Procedure Register;ImplementationFunction GetWindowJSName: String;VarI: Integer;C: TList;UF: TUniForm;FC: TClass;BeginResult := '';FC := UniSession.MainFormClass;C := UniSession.FormsList;For I := 0 To C.Count - 1 DoBeginUF := TUniForm(C);If SameText(UF.ClassName, FC.ClassName) ThenBeginResult := UF.WebForm.ExtForm.JSName;Exit;End;End;End;// ------------------------------------------------------------------------------Procedure Register;BeginRegisterComponents('uniGUI Editor', [TUniXTinyMCE]);End;// ------------------------------------------------------------------------------Constructor TUniXTinyMCE.Create(Owner: TComponent);BeginInherited;End;// ------------------------------------------------------------------------------Destructor TUniXTinyMCE.Destroy;BeginInherited;End;// ------------------------------------------------------------------------------Function TUniXTinyMCE.GetPlainText: String;begin// Result:= UniSession. Query['????????']; Or Other SolutionEnd;// -------------------------------------------------------------------------------procedure TUniXTinyMCE.SetHtmlText(HtmlText: string);beginUniSession.AddJS('tinyMCE.get("ed1").setContent(' + StrToJS(HtmlText) + ')');end;// ------------------------------------------------------------------------------Function TUniXTinyMCE.GetVersion: String;BeginResult := PackageVersion;End;// ------------------------------------------------------------------------------Procedure TUniXTinyMCE.Loaded;varFilesFolder: String;BeginInherited;If Not WebMode ThenExit;FilesFolder := StringReplace(IncludeTrailingBackslash(uniGUIServer.UniServerInstance.FilesFolder), '\','/', [RfReplaceAll]);If uniGUIServer.UniServerInstance.CustomFiles.IndexOf(FilesFolder + 'tiny_mce/tiny_mce.js') < 0 ThenbeginuniGUIServer.UniServerInstance.CustomFiles.Add(FilesFolder + 'tiny_mce/tiny_mce.js');self.HTML.Clear;self.HTML.Add('<textarea id="ed1" style="width: 100%; height: 100%;"></textarea>');self.HTML.Add('<script>');self.HTML.Add('tinyMCE.init({');self.HTML.Add('theme : "advanced",');self.HTML.Add('plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu'+ ',paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",');self.HTML.Add('theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",');self.HTML.Add('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",');self.HTML.Add('theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",');self.HTML.Add('theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",');self.HTML.Add('theme_advanced_toolbar_location : "top",');self.HTML.Add('theme_advanced_toolbar_align : "left",');self.HTML.Add('theme_advanced_statusbar_location : "bottom",');self.HTML.Add('theme_advanced_resizing : true,');self.HTML.Add('extended_valid_elements : "img[class=myclass|!src|border:0|alt|title|width|height]",');self.HTML.Add('mode: "exact",');self.HTML.Add('elements : "ed1"');self.HTML.Add('});');self.HTML.Add('</script>');End;End;End.
TUniXTinyMCE Component
in General
Posted
1.Component of the output html text for what to do, the following
2.The problem with this view is not the first time, but the time to update the page with the error go away
Grateful
----
Component Body
----
UniXTinyMCE.rar