Jump to content

Daniel Eiszele

Members
  • Content Count

    59
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Daniel Eiszele

  1. Hi @COMFIED, I'm not sure if the following answers your question or not. Add System.JSON to your uses clause and run the following. Some follow up questions would be, is the object you are passing always a single key/value pair and is the name of the key known or not known? There are many ways to do this; some type safe, others not - just depends on your use case really. var aString : String; anObject : variant; begin aString := '{"v" : "this is sample text"}'; anObject := TJSON.parse(aString); Showmessage(anObject.v); end;
  2. With great power comes great responsibility!
  3. Sorry, you are correct with 1. Being locked inside for 3 weeks with my kids is getting to me the new amendments look good.
  4. Looks close. I'm not behind a computer, but I think you need to compute the absolute values of the tdatetimes and change the test to >0 as TDatetime's can be negative?
  5. Universal Coordinated Time (UTC) does not observe daylight savings time, so to compute it for a timezone that does observe daylight savings it is important to know whether it is in effect or not to be able to remove it. For a timezone that doesn't observe daylight savings at the date noted, then there will be no difference in results from the functions. If we take into account the below function it is doing the time difference based on "todays" date. For me, that is 1 hour different to what it would be for the same comparison using the example date above as I am not currently in daylight time
  6. Sorry, not explaining myself well. I'll send a proper example shortly.
  7. Hi @jarto, are you taking into account the fact that Stockholm isn't in daylight savings time at the date noted above? I am East coast Australia which is in daylight time and if I use the encoded time then everything appears to line up as per @IgorSavkic suggestion.
  8. Hi @jarto, I agree with @IgorSavkic, the current implementation doesn't take into account the possibility that the date in question is within daylight savings time. To be correct the "computation" date should be the date that has been encoded, not "now" as is the current implementation.
  9. I vote for remove. As far as my understanding goes it does not follow the html "standard". I too was trying to work out why it was being set to 0 as a "default"?
  10. Thanks @IgorSavkic, your second suggestion led me to realise that casting the NodePathAPI global variable to variant lets me use the function as intended without having to concatenate the parts into a string to begin with ie filePath:= variant(NodePathAPI).join(filePart1, filePart2, filePart3) Admittedly it foregoes type checking, but in this case that is an acceptable result for what I need it for. Your answer also reminds me that I should look into Class Helpers more, so I don't unintentionally hack the RTL to pieces
  11. I'm not sure if there is an incompatibility between Javascript and Pascal in this instance but the function prototype for the Join function doesn't seem compatible with what javascript is expecting. The SMS definition is shown in point 1 below, but Javascript is looking for a comma delimited list of strings, not an array of string. I have been able to work around this with the function at point 2 but I'm not sure if I'm misinterpreting or using the function incorrectly. Ideas?
  12. Finally had a reason to check this out. Bravo, very useful!
  13. Hi @jartocan you make these adjustments to the vertical alignment CSS in SmartCL.CSS.Stylesheet when you do the next update please (no rush). I just realised the vertical alignment was not quite right when word wrapping is in affect.
  14. HI @jarto, adding "justify-content: flex-start", "justify-content: center" and "justify-content: flex-end" to the alignment CSS appears to fix the justification issues without wrecking the word wrapping.
  15. Hi @jarto, I'm just playing around with the align-items and justify-content parameters of the flex display model. I'll report back when/if I get it locked away. I am just wondering what it means for a checkbox or radio item to be right justified though. I'm wondering if the checkbox should relocate to the opposite side of the text?
  16. @lynkfs I think your suggestion has hit the nail on the head It works in all the cases I've tested it in at least. It looks like the only browser which needs a bit of kneading is Safari which needs the webkit prefix for it to work.
  17. Any chance this link can provide a clue? It seems to work but I don't know if it's too much of a hack? https://codepen.io/patrickclay/pen/btFsn
  18. I seem to remember they were working in a previous version of SMS so something must have changed? I loaded an old project which I had to amend to get it to compile, so this suggests the combobox at least has changed?
  19. Can anyone confirm whether or not wordwrap is working for Checkbox components in the current Alpha (3.9.1.169)? Dropping a checkbox on the form, typing a really long caption and setting wordwrap to true in the property inspector doesnt seem to work.
  20. I imagine the smartmobilestudio team could alter the "UserAgent" Header sent with html requests to include some parse-able content that identifies it as the internal browser?
  21. I'm in the middle of a project where I'm asking myself the same question:)
  22. @jarto Note that after executing the above noted "open" function from the SMS internal browser that SMS must be force closed from the Windows Task Dialog.
  23. Try using BrowserApi.Windowobject.open( ) instead. Note that "window" is of type THandle which means you can utilise any valid javascript method/property on it, but code completion will not work. "Windowobject" on the other hand is of type Jwindow and is built with code completion in mind.
  24. Would something like this work? https://www.codexworld.com/how-to/open-url-in-new-browser-window-tab-javascript/
  25. From a security perspective (and don't quote me), I don't think the file contents of the image are available to the user so they couldn't use javascript to send the file to a malicious user. On the other hand, the get request would provide this data which the user could use for any purposes. Also, the file host resolves to null with the htmlrequest, if you open a file directly from the filesystem, which breaches the browsers Cross Origin policy as the Get Request is attempting to connect to localhost. Anyone with better knowledge of HTML security or terminology should feel free to ju
×
×
  • Create New...