Jump to content

freedowsRoO

Members
  • Posts

    188
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by freedowsRoO

  1. 11 minutes ago, Sherzod said:

    Well, right, how many clicks, as many request.

    Just click, wait the download finish and click again and reapeat. 

     

    In the first time that you click the application will send 1 file to save, the second time the application will send two, the third time three and etc...

  2. On 5/23/2020 at 2:16 PM, Sherzod said:

    Sorry, is not very clear...

     

    I managed to reproduce the problem. The problem is when i call the html2canvas function but i don´t know how to fix it.

     

    To reproduce the problem, just click to 'send file' button more than one time.

    SendFile.rar

  3. On 5/23/2020 at 4:53 PM, andyhill said:

    AjaxEvent ONE

    Inside AjaxEvent ONE at end of event call AjaxEvent TWO

     

    Thanks for reply but i have only one ajaxevent. The server trigger the unissession.sendfile many times.. 

  4.  

    12 hours ago, 55143681 said:

    If I put UnimPanel1 in a form,the code has effect,

    but,

    If I create the UnimPanel dynamicly,the code has no effect,

    why?

    the code:

        //生成UnimPanel
      newPanel:=TUnimPanel.Create(Self);
        newPanel.Name:=concat('newPanel',ownerNo);//关联到唯一编号上,便于知道点击了谁
        newPanel.Parent:=UnimScrollBox1;
        newPanel.Height:=panelHeight;
        newPanel.BorderStyle:=ubsDefault;//ubsNone 可以取消边框
        newPanel.Align:=alTop;
        newPanel.AlignWithMargins:=true;//保留边界空间
        newPanel.OnMouseDown:=showDetail;//设置点击函数
      newPanel.JSInterface.JSCode(#1'.bodyElement.dom.style.setProperty("border-color", "red", "important");');
      newPanel.JSInterface.JSCode(#1'.bodyElement.dom.style.setProperty("border-radius","10px");');

     

    Try this

    newPanel.ClientEvents.UniEvents.Add('beforeInit=function beforeInit(sender, config){sender.cls="YOURCSS CLASS";}')

     

  5. On 5/19/2020 at 4:29 PM, Sherzod said:

    Hello, 

    OK, but do you have a simple testcase to check first?.. 

     

    Sorry, i did not manage to reproduce them. The error occurs only in my application, i made a video to try to explain better.

     

    Note in the video that the application stops at breakpoint only once, but on the client appears to save the file many times.

     

  6. Hello!

    How can i have sure that ajaxEvent finish the execution? I need to use a function after the ajaxEvent  are processed. 

     

    I'm triyng to use 'UniSession.SendFile()' in the event ajaxEvent but the application send more than one file to the client side, The first time that i click the button the application send 1 file per time, if i click the second time the application send 2 files and so on.... 

     

    Is difficult to explain....

  7. On 4/13/2020 at 11:41 AM, eduardosuruagy said:

    Is it possible to leave the image on the server and send it by email? I would not like to download it.

    How i do that? I save just de base64 string in my database and after that i decode de base64 string to get the img.

  8. 6 hours ago, Sherzod said:

     

    One possible solution (for example, a snapshot of the button itself):

    
    procedure TMainForm.UniButton1Click(Sender: TObject);
    begin
      with UniButton1 do
        JSInterface.JSCode('html2canvas(document.querySelector("#' + JSId +'")).then(function(canvas) {ajaxRequest('#1', "getData", ["base64Data="+canvas.toDataURL()])});');
    end;

     

    
    procedure TMainForm.UniButton1AjaxEvent(Sender: TComponent; EventName: string;
      Params: TUniStrings);
    begin
      if EventName='getData' then
      begin
        // Params.Values['base64Data']
        // Here you need to decode the Base64 string
        // data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAZ...AAAABJRU5ErkJggg==
      end;
    
    end;

     

    Nice! Thanks a lot!

    • Like 1
  9. On 4/13/2020 at 1:09 PM, Sherzod said:

    Ok sorry, then need to send to the server, or send it by email from the client side. We will try...

    Hello, any ideia about this?

     

    How can i retrieve a variable in server side from this code? For example, if i want to get the 'uri' on server side, how i can do that?

    2. MainForm.Script:
    
    function canvasSaveAs(uri, filename) {
        var link = document.createElement('a');
        if (typeof link.download === 'string') {
            link.href = uri;
            link.download = filename;
            document.body.appendChild(link);
            link.click();
            document.body.removeChild(link);
        } else {
            window.open(uri);
        }
    }

     

  10. 17 hours ago, Sherzod said:

    Hello,

    Maybe something like this at the moment?

    CustomCSS:

    
    .CodeMirror-wrapping {
        position: relative !important;
    }

     

    Yep!! It works! Thanks!

  11. Hello! How are you??

    The TUniSyntaxEdit  has a bug that the layouconfig.width = 100% doesn't work.... I also tried to set the aligment = AlClient and doesn't work.  Can you check this please?

  12. 6 minutes ago, Sherzod said:

    Hi,

    In CustomFiles:

    
    https://cdn.quilljs.com/1.3.6/quill.snow.css
    files/style.css

     

    Thanks sherzod but not work yet.

     

    My CustomFiles:

    https://cdn.quilljs.com/1.3.6/quill.snow.css
    files/style.css

     

    My HTML:

    <div id="editor-container">
    
    </div>
    
    <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script>
    <script  src="files/script.js"></script>

     

    My unigui test project: 

    EmailBI.rar

  13. Hello!

    I am trying to use a text editor in my application but I am not getting it, i don't know what the best place to declare the scripts because they need to be before my DIV. 

     

    My HTML code is this:

    <!DOCTYPE html>
    <html lang="en" >
    <head>
      <meta charset="UTF-8">
      <link rel='stylesheet' href='https://cdn.quilljs.com/1.3.6/quill.snow.css'>
      <link rel="stylesheet" href="./style.css">  
      <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script>	
    </head>
    <body>
    
    <div id="editor-container">
      
    </div>
    
    <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script>
    <script  src="./script.js"></script>
    
    </body>
    </html>

     

    I need to make the HTML above works in UNIGUI, I'm putting the following lines inside: ServerModule> Custom Files

    <link rel='stylesheet' href='https://cdn.quilljs.com/1.3.6/quill.snow.css'>
    files/style.css

     

    And the following lines inside: HTMLFrame > HTML

    <div id="editor-container">
    
    </div>
    
    <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script>
    <script  src="files/script.js"></script>

     

    I'm trying a lot of things and nothing works. I guess the problem is in the HTMLFrame because when i look the code by pressing F12 the scripts:

    <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script>
    <script  src="files/script.js"></script>

    Doesn't appears in the code.

     

    Thanks in advance.

     

    The HTML project with the editor: .editor.rar

×
×
  • Create New...