picyka
uniGUI Subscriber-
Posts
1082 -
Joined
-
Last visited
-
Days Won
34
Content Type
Profiles
Forums
Events
Everything posted by picyka
-
Creating a Self Signed Certificate in 3 Secondes...
picyka replied to Abaksoft's topic in Sample Projects
I would like to generate for the domain of my system https://xxxx.domain.com.br -
Creating a Self Signed Certificate in 3 Secondes...
picyka replied to Abaksoft's topic in Sample Projects
I don't quite understand this, but does this work for domains too? -
"Could not load root certificate" from letsencrypt.org
picyka replied to erich.wanker's topic in General
does let's encrypt work with UNIGUI? -
clipboard Copy Text from the dbgrid column to Clipboard
picyka replied to Fábio Matte's topic in General
A tip for those who want to copy text with few codes, I believe this could be implemented natively in unigui ServerModule -> CustomMeta <script language="JavaScript"> function addslashes(str) { return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'); }; async function copyText(texto) { try { await navigator.clipboard.writeText(texto); } catch (err) { console.error('Failed to copy: ', err); } }; async function pasteText(jsName) { navigator.clipboard.readText().then(texto => { let txt = addslashes(texto); txt = txt.replace(/(?:\r\n|\r|\n)/g, '\\n'); let cmd = jsName + ".setValue('" + txt + "');"; eval(cmd); }); }; </script> procedure TUniMainModule.Copy(Control : TUniFormControl; MsgSucess : Boolean); begin var lTexto := String(Control.Text); Self.CopyStr(lTexto, MsgSucess); end; procedure TUniMainModule.CopyStr(Text: String; MsgSucess: Boolean); begin try var lTexto := TStringUtils.JsEncode(Text); var lJsString := 'copyText(' + QuotedStr(lTexto) + ');'; UniSession.JSCode(lJsString); if MsgSucess then TToastUtils.Sucess('Copiado!',True,'Sucesso',1000); except on E: Exception do TMessageUtils.Error(E.Message); end; end; procedure TUniMainModule.Paste(Control : TUniFormControl); begin try var lJsName := Control.JSName; var lJsString := 'pasteText(' + QuotedStr(lJsName) + ');'; UniSession.JSCode(lJsString); except on E: Exception do TMessageUtils.Error(E.Message); end; end; class function TStringUtils.JsEncode(const Src: String; const useNumericReference: boolean): String; var i, l: integer; Buf, P: PAnsiChar; ch: integer; begin Result := ''; l := Length(Src); if l = 0 then Exit; if useNumericReference then GetMem(Buf, l * 6) // to be on the *very* safe side else GetMem(Buf, l * 2); // to be on the *very* safe side try P := Buf; for i := low(Src) to high(Src) do begin ch := Ord(Src[i]); case ch of 8: begin // Backspace if useNumericReference then begin ALStrMove('\u0008', P, 6); Inc(P, 6); end else begin ALStrMove('\b', P, 2); Inc(P, 2); end; end; 9: begin // Tab if useNumericReference then begin ALStrMove('\u0009', P, 6); Inc(P, 6); end else begin ALStrMove('\t', P, 2); Inc(P, 2); end; end; 10: begin // New line if useNumericReference then begin ALStrMove('\u000A', P, 6); Inc(P, 6); end else begin ALStrMove('\n', P, 2); Inc(P, 2); end; end; 11: begin // Vertical tab if useNumericReference then begin ALStrMove('\u000B', P, 6); Inc(P, 6); end else begin ALStrMove('\v', P, 2); Inc(P, 2); end; end; 12: begin // Form feed if useNumericReference then begin ALStrMove('\u000C', P, 6); Inc(P, 6); end else begin ALStrMove('\f', P, 2); Inc(P, 2); end; end; 13: begin // Carriage return if useNumericReference then begin ALStrMove('\u000D', P, 6); Inc(P, 6); end else begin ALStrMove('\r', P, 2); Inc(P, 2); end; end; 34: begin // Double quote if useNumericReference then begin ALStrMove('\u0022', P, 6); Inc(P, 6); end else begin ALStrMove('\"', P, 2); Inc(P, 2); end; end; 38: begin // & ... we need to encode it because in javascript ' or & will be converted to ' and error unterminated string ALStrMove('\u0026', P, 6); Inc(P, 6); end; 39: begin // Apostrophe or single quote if useNumericReference then begin ALStrMove('\u0027', P, 6); Inc(P, 6); end else begin ALStrMove('\''', P, 2); Inc(P, 2); end; end; 60: begin // < ... mostly to hide all </script> tag inside javascript. // http://www.wwco.com/~wls/blog/2007/04/25/using-script-in-a-javascript-literal/ ALStrMove('\u003C', P, 6); Inc(P, 6); end; 62: begin // > ... mostly to hide all HTML tag inside javascript. ALStrMove('\u003E', P, 6); Inc(P, 6); end; 92: begin // Backslash character (\). if useNumericReference then begin ALStrMove('\u005C', P, 6); Inc(P, 6); end else begin ALStrMove('\\', P, 2); Inc(P, 2); end; end; else Begin P^ := AnsiChar(ch); Inc(P); end; end; end; SetString(Result, Buf, P - Buf); finally FreeMem(Buf); end; end; -
@Farshad Mohajeri Could you apply this correction to the source?
-
Version: 68 When you send a file, where its name has blank spaces, unigui is putting %20 in place of the space MultiCompleted Event Object Files Files[0].FileName
-
perfect, thank you for always helping us.
-
TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 3.
picyka replied to erich.wanker's topic in General
It's hard to generate the error.. -
TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 3.
picyka replied to erich.wanker's topic in General
No, but I can create one, I just attached the error stack -
TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 3.
picyka replied to erich.wanker's topic in General
It's not hard to simulate, my case here, when I have a combo connected to a column as a filter -
TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 3.
picyka replied to erich.wanker's topic in General
I have these errors every day. Test_WIN-EM5F97TDNDI_20230510090448.el -
Could put these properties in the next build
-
Does MQTT work with Unigui?
-
HyperServer farm, how to know if I'm using it or not?
picyka replied to eduardosuruagy's topic in General
http://unigui.com/doc/online_help/setting-up-a-hyperserver-serve.htm -
@Sherzod = JSMan
-
Could you post an example?
-
😍👀
-
I don't know the degree of difficulty, but it would be great if you could search by the name of the font, to avoid putting duplicates or to know its index...
-
Hi, it's me again. Does anyone have problems with excel staying in protected mode?
-
Yes
-
Você pode ignorar essa exceção
-
Follow the example. Look at the code in the servermodule -> CustomMeta Also note the code in the MainModule ExecuteTimerLigacao Notice the ajax Event on UniFrame1 it never fires demo.zip
-
if (Http.responseText.includes("true")) { alert(top.UniFrameGerDadosLigacoes0.JSName); top.ajaxRequest(top.UniFrameGerDadosLigacoes0.JSName, '_call', ['value=true']); } that doesn't work either..