Jump to content
uniGUI Discussion Forums


uniGUI Subscriber
  • Content Count

  • Joined

  • Last visited

  • Days Won


CastleSoft last won the day on April 29

CastleSoft had the most liked content!

Community Reputation

37 Excellent

About CastleSoft

  • Rank
    Active Member

Profile Information

  • Gender

Recent Profile Visitors

360 profile views
  1. CastleSoft

    reCAPTCHA V3 support ?

    Would it be possible to add support for V3 (or make an additional) reCaptcha control ? V3 doesn't require the 'checkbox - I'm not a robot' question. It just displays a 'hovering' logo right bottom side of the page. No user interaction is required with v3, which is nice. The sample howto for php is below: The basic JS code <script src="https://www.google.com/recaptcha/api.js?render=your reCAPTCHA site key here"></script> <script> grecaptcha.ready(function() { // do request for recaptcha token // response is promise with passed token grecaptcha.execute('your reCAPTCHA site key here', {action:'validate_captcha'}) .then(function(token) { // add token value to form document.getElementById('g-recaptcha-response').value = token; }); }); </script> The basic HTML code <form id="form_id" method="post" action="your_action.php"> <input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response"> <input type="hidden" name="action" value="validate_captcha"> .... your fields </form> The basic PHP code if(isset($_POST['g-recaptcha-response'])){ $captcha=$_POST['g-recaptcha-response']; } else $captcha = false; if(!$captcha){ //Do something with error } else{ $secret = 'Your secret key here'; $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret= .$secret.&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']); if($response.success==false) { //Do something with error } } ... The Captcha is valid you can continue with the rest of your code
  2. A repeater panel like on ASP.NET would be nice. Basically create the layout you want in a row, the row repeats. Image, HTML, Text, etc A flexible grid style..
  3. CastleSoft


    Code is now available via Github: https://github.com/CastleSoft/uiXtra Contains the latest source code (v1.07 - RIO release, uniGUI 1.5 (latest release) - Forum patches/updates in this thread ** Thank you all ** ) MIT lic.. Feel free to FORK / hack / etc. Sorry. I don't have much time these days to monitor the forums. Enjoy.. PS.. v1.06 is the original release for pre RIO / pre 1.5 / pre patches - if anyone needs it.
  4. I have a custom control based on TUniCustomHTMLFrame which works with a <canvas> element. I have a Javascript function called resizeCanv() which is as follows: function resizeCanv(){ var canvas = $( "canvas#'+JSName+'" )[0]; canvas.width = canvas.parentElement.clientWidth; canvas.height = canvas.parentElement.clientHeight; } In my TUniFAKECanvas controls .create the HTML.Text is set to <canvas id="'+JSName+'"></canvas> and the resizeCanv() is called. It all works great. I then added the Align to allow me to use 'client' for sizing. When the form is resized, the HTMLFrame resizes ok, but I need to call my resizeCanv() javascript function. Inside the custom control, what should I hook / trap and whats the recommended way inside a custom control to trap a forms align=client so the child controls can be resized/moved etc ? Thanks
  5. CastleSoft

    Multiple Mobile Layouts

    Thanks.. Looks good. I'll give it a try.
  6. CastleSoft

    Multiple Mobile Layouts

    Any plans for reactive or multi-layout mobile support in the gui ?
  7. CastleSoft


    A few minor tweaks and another another freebie. iTyped - https://github.com/luisvinicius167/ityped Simply add the uniTyped control (resize to your size). var s: TStrings; begin s := TStringList.Create; s.Add('Welcome to the jungle'); s.Add('Restarting soo...'); UniTyped1.text := s; UniTyped1.PlayTyped; s.Free; end; or Just set the properties in the control and do a UniTyped.PlayTyped. Source code and Example below (includes the sweetalert/jquerytoast/iTyped). https://goo.gl/bnU2Ab
  8. CastleSoft


    A few more fixes. - Z-Index for jToast fixed - buttonsStyling (typo / spelling incorrect in SweetAlert2) New css file added to jToast. (re-grab the files/jtoast and files/sweetalert folders in any code you use for the updated). Added 'custom' to jToast.. when 'Pos: custom' the Left and Top are used for positioning. *** If you are using an older version you may need to ignore the buttonStyling missing error and toggle the 'buttonsStyling' and save to fix. *** If you have Z-Index issues.. Clear your browser cache and try again. Enjoy. uniExtensions-V5.zip
  9. CastleSoft


    Updated SweetAlert2 control (REST) removed, fix Z-Order issue when the alert appears behind the form. Added TEST / DEMO Added a new control wrapper for jToast https://github.com/kamranahmedse/jquery-toast-plugin (uniJToast currently has properties, a simple ShowMessage and events for Before/After Show/Hide.) Enjoy. uniExtensions.zip
  10. CastleSoft


    To fix the Floating behind the Login form you could add the following to the ServerModule.CustomCSS .swal2-container { z-index:20000; } OR.. The next post has an updated version (new files/sweetalert with the extra css). + a new jQuery Toast control + DEMO / Test (c:\tmp was the original folder containing the files).
  11. CastleSoft


    Add RTTI To the uses clause.. Will fix the problem..
  12. CastleSoft


    Add RTTI To the uses clause.. Will fix the problem..
  13. CastleSoft


    RESTComponents can be removed. Originally I planned on using the TJSon.OjectToJson method.. But removed the code and went simple strings instead. So it shouldn't be needed.
  14. CastleSoft


    Attached is a simple wrapper for the SweetAlert2 library. (QUICK HACK.. No unit testing, no tidy up etc..) ** No warranty - Use at your own risk ** FREE for commercial use, etc.. (just don't remove the copyright header). 1) Compile the Package/Install 2) Make sure your path includes the control folder 3) Copy the files/sweetalert folder into your project 4) Drag/Drop the uniSweetAlert control onto your form. Simple usage like: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSweetAlert1.ShowMessage; // or like UniSweetAlert1.Error('Oops','Something went wrong'); // or like UniSweetAlert1.Error('Oops','Error again','FixMe',3000); // or like UniSweetAlert1.Question('Is this true','Please click one of the options below:','YES','NO',3000); // or like UniSweetAlert1.title := 'Hello'; UniSweetAlert1.text := 'Testing'; UniSweetAlert1.alertType := TAlertType.success; UniSweetAlert1.ShowMessage; end; // Events for Confirm or Cancel/Dismiss procedure TMainForm.UniSweetAlert1Dismiss(Sender: TObject); begin UniButton1.Caption := 'DIS'; uniMemo1.Lines.Add('Dis'); end; procedure TMainForm.UniSweetAlert1Success(Sender: TObject); begin UniButton1.Caption := 'CLICKED'; uniMemo1.Lines.Add('Clicked'); end; Either (1) set properties and call .ShowMessage; Or call the Error, Info, etc methods. Enjoy.. Regards Andrew 2017-07-29-uniSweetAlert V3.zip
  15. CastleSoft

    DOCTYPE change ?

    Is it possible to change the default DOCTYPE in a uniGUI application from the default: <!DOCTYPE html public> To the following: <!DOCTYPE html> The "public" is causing issues when I try and use a few Syncfusion components in a uniGUI application. Also it appears that Chrome isn't very happy with the PUBLIC tag either, for example if I use the following (non UniGUI test case) in Chrome all is good. <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="./Syncfusion/content/ej/web/default-theme/ej.web.all.min.css"> <script src="./Syncfusion/scripts/jquery-2.1.4.min.js"></script> <script src="./Syncfusion/scripts/jsrender.min.js"></script> <script src="./Syncfusion/scripts/jquery.validate.min.js"></script> <script src="./Syncfusion/scripts/jquery.validate.unobtrusive.min.js"></script> <script src="./Syncfusion/scripts/ej/web/ej.web.all.min.js"></script> <script language="javascript" type="text/javascript"> $(function () { $("#Spreadsheet").ejSpreadsheet({ loadComplete: "loadComplete" }); }); function loadComplete(args) { // ajaxRequest({URL_CALLBACK}, 'loadComplete', ['param=value']); this.XLSelection.selectRange("A1:C3"); this.XLDragFill.positionAutoFillElement(); } </script> </head> <body> <div id="Spreadsheet" style="width:100%; height:100%"></div> </body> </html> If I change the <!DOCTYPE> to include the word "Public" chrome hangs. In uniGUI if I wish to embed the Spreadsheet control (above) I do the following: 1) ServerModule - CustomFiles /Syncfusion/content/ej/web/default-theme/ej.web.all.min.css /Syncfusion/scripts/jquery-2.1.4.min.js /Syncfusion/scripts/jsrender.min.js /Syncfusion/scripts/jquery.validate.min.js /Syncfusion/scripts/jquery.validate.unobtrusive.min.js /Syncfusion/scripts/ej/web/ej.web.all.min.js 2) Drop a uniHTMLFrame onto the MainForm 3) Add the following to the AfterScript properties: $(function () { $("#Spreadsheet").ejSpreadsheet({ loadComplete: "loadComplete" }); }); function loadComplete(args) { this.XLSelection.selectRange("A1:C3"); this.XLDragFill.positionAutoFillElement(); } 4) Set the HTML to the following: <div id="Spreadsheet" style="width:100%; height:100%"></div> And uniGUI has the embedded SpreadSheet in a mainform showing. (see attached) ** Minus the range selection and it appears the AjaxRequest isn't working. (not shown in the example). Also Chrome freezes (like the standalone) test case, due to the <!DOCTYPE html public> text. Sample - UNIGUI project and testing.html file http://goo.gl/vh8yNX ** NOTE ** Includes Syncfusion COMMUNITY Edition javascript files (not for redistribution, you must have either a paid or community lic..)