Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 08/04/2020 in all areas

  1. jarto

    Update

    Hi all, as you probably have noticed, I've been very quiet lately. When COVID-19 spread around the world, the restrictions hit my personal life pretty hard. In UAE, all the schools were closed very early and remained closed all the way to the end of the semester. There was also a strict lock down and lots of restrictions. Doing a lock down with three small children and having to home school them basically meant that my chances of spending many hours of time on development went to nil. Luckily it seems like the schools will open in 3 weeks, which should give me a possibility to concen
    5 points
  2. Works from server only, the one specified in the credentials page var document external 'document': variant; var console external 'console': variant; var gapi external 'gapi': variant; implementation { TForm1 } procedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components var Script := document.createElement('script'); Script.src := 'https://apis.google.com/js/api.js'; Script.setAttribute('async',''); Script.setAttribute('defer',''); document.head.appendChild(Script); Script.onload := procedure begin writeln('loaded'
    3 points
  3. A new update is available: IDE: When a property is changed, the IDE adds the required unit into uses clauses. RTL: Bug fix to TRESTCall: Call OnRemove only if it is assigned.
    3 points
  4. Decided to start working with SMS again, but I needed better tooling, so I started creating them. I have also decided to share some of them. Here are bindings for the browser-ui-state library: Bindings for the browser-ui-state lib and a small demo showing you how to both the library and the bindings Cheers
    2 points
  5. A new update is available: IDE: Fix compilation without saving, when SMS is run from Program Files Change embedded browser to always use localhost This lets us use Chrome's Powerful Features through http RTL: Add RemoteUrl as a property for TNJWebSocketServer Bug fixes and improvements to TW3Slider Works now with mobile devices Set default max value to 100
    2 points
  6. lynkfs

    routing

    Routing is the link between specific url's and specific functionality in an app, so f.i. https://<server>/index.html starts up your app in the browser as per normal https://<server>/login executes a specific view (f.i a login form) Smart per default produces single page app's, without routing functionality There are a couple of strategies which can be followed to implement routing (and which will work to some extent) : use # formatted urls. Browsers have a 'hashchange' event built in, which fires every time a url changes,
    2 points
  7. Fixed now in the Alpha branch. Thank you @Tim Koscielski
    2 points
  8. TW3FacebookLogin is a non-visual component, which is available in the Designer's Cloud-tab. It lets you add Single-Sign-On to your web page using Facebook credentials. To use this, you need an AppID, which you can obtain by registering at https://developers.facebook.com When you register, you need to specify the App Domains where you're going to host your web app. So, if you plan to have it at https://myserver.example.com/mywebapp/index.html, then you need to register myserver.example.com as App Domain. Then add TW3FacebookLogin to your form and set the necessary properties
    2 points
  9. TW3GoogleLogin is a non-visual component, which is available in the Designer's Cloud-tab. It lets you add Single-Sign-On to your web page using Google credentials. To use this, you need a ClientID, which you can obtain by registering at Google: https://developers.google.com/identity/sign-in/web/sign-in When you register, you need to specify the URI where you're going to host your web app. This is also where you need to copy the html code that Smart Mobile Studio produces when you compile your app. So, if you plan to have it at https://myserver.example.com/mywebapp/index.html, then yo
    2 points
  10. A new update is available. This one contains two new controls: TW3GoogleLogin TW3FacebookLogin Both are non-visual components, but they are available in the Designer under the Cloud-tab. These two controls let you add Single-Sign-On via Google and Facebook to your web page. To use them, Add the control to the form Set the AppId- or ClientId-properties You need to register at Google or Facebook to get these ids You also need to copy the app to the registered URI that you specify during registration Set the OnLogin and OnLogo
    2 points
  11. lynkfs

    font choice

    Styling on the web is really messy, and takes a lot of effort to get it right. As a matter of personal interest, I'm collecting as many 'design rules' underpinning good styling as I can. Like : In the typography area, I came across this site. It uses machine learning to identify font-families which work well together. It uses Google fonts as its domain, and outputs a header, sub-header and text font (similar to h1, h2 and p) I really like its recommendations (usually using the 'similar' setting)
    2 points
  12. Yep, got it working nicely. I'm in the process of writing this into a non-visual component, which can be added to the component palette.
    2 points
  13. jarto

    Facebook or Google OAuth

    I thought I'd test this. When I try to compile, I get an error in FaceBook.SDK.pas: Syntax Error: Class "JFBUIParams" isn't defined completely [line: 15, column: 35, file: FaceBook.SDK] Edit: Got the SDK to compile by changing into this: JFBUIParams = class external end;
    2 points
  14. IElite

    Update

    I think the Pandemic has thrown a Monkey Wrench into everyone's lives. Family comes first!
    2 points
  15. There's a small update available. It adds a possibility to change TW3ListBox line text.
    1 point
  16. 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;
    1 point
  17. COMFIED

    Preventing Code Tampering

    I am building a financial transaction system on sms. Is there a way to detect/prevent code tampering? - so that in case the compiled HTML/ JS code is modified it will refused to run.
    1 point
  18. I've always loved the basic data-structures as described in this link. Since I needed a double linked list the other day, I transcribed all of the major basic structures from js into object pascal : Array Hash Table Set Singly Linked List Doubly Linked List Stack Queue Tree Graph Source and test-files here
    1 point
  19. jarto

    Sample - Scrollbar

    @gabr42 just fixed the update issues. Now it works again.
    1 point
  20. jarto

    Sample - Scrollbar

    The fix is now available in the alpha branch.
    1 point
  21. Tams11

    License code expired

    Thank you so much! It has been resolved now! Tammy
    1 point
  22. lynkfs

    touch-action in CSS

    This looks like a non-solvable problem. Apparently Apple changes his/her mind often how to implement this in the various mobile iOS Safari versions and the OS hardware event checking seems to take precedence over html processing. If you change the <body> part of the index.html file to this <body> <script type="text/javascript"> /* This prevents the window being moved by touches, to give the impression of a native app */ document.ontouchmove = function(e) { e.preventDefault(); } document.addEventListener("touchstart", event => {window.alert("tou
    1 point
  23. First of all, that's a beautiful clock. Looks very nice 🙂 I can reproduce the AM/PM -bug, so let me have a look at it. Transparency can be controlled with normal properties like this: Ctrl.AlphaBlend:=True; Ctrl.Opacity:=0; You can also make your procedure more versatile, so it can be used with any control: procedure TFormClock.TransparentControl(ACtrl: TW3CustomControl); begin w3_setstyle(ACtrl.Handle, 'background', 'transparent'); w3_setstyle(ACtrl.Handle, 'outline', 'none'); w3_setstyle(ACtrl.Handle, '-webkit-box-shadow', 'none'); w3_setstyle(ACtrl.Handle, 'box-
    1 point
  24. lynkfs

    SEO

    Search Engine Optimisation - SEO Over the years I have made quite a few websites with Smart, but eventually stopped doing that. Reason is that Smart produces single page applications (or multiple if you like) and SEO for these type of apps is essentially impossible. Search engine crawlers look for html, which is what feeds their indexing effort. This is completely absent in the standard index.html file, so essentially they see an empty page. Google's googlebot is supposed to be able to execute the js bit during its crawling, but I find the indexing results below par. The
    1 point
  25. @lynkfs Oh, that helped so much! I've struggled at the concept of calling these external js apis when class references don't exists and also had no experience with using promises. But you helped me get going and now I'm making very good progress 🙂 Now I have TW3FacebookLogin- and TW3GoogleLogin-classes that both work. I'll have to read up a bit to add the necessary parameters (besides ClientId of the app), but I should be able to get them into alpha and component palette next week.
    1 point
  26. @JimKueneman No, I haven't changed anything in WebSockets code.
    1 point
  27. lynkfs

    panel.zoom and firefox

    zoom is not supported in firefox (https://caniuse.com/#search=zoom) and opera The workaround is to use the "transform" css function W3Panel1.handle.style.transform := "scale(1.5)"; You can scale to different values for x and y as in "scale(2, 3)"
    1 point
  28. Your code should work, except for the script placement. The below code is pretty much the same as yours, just embedded in a button click handler (which you might have done too) var W3Button : TW3Button := TW3Button.Create(W3Panel); W3Button.SetBounds(580,-10+160*(cartitems.length+1),200,40); W3Button.Caption := 'Make Payment'; W3Button.OnClick := procedure(sender:TObject) begin var PayPal : TW3Panel := TW3Panel.Create(W3Panel); Paypal.SetBounds(140,100 + 160*(cartitems.length+1),400,800); //position below cart Paypal.StyleClass := 'DIV';
    1 point
  29. Percentage based positioning has the advantage of having a 'responsive' page layout with little effort. Responsive in this respect means that page layouts will scale seamlessly on devices which may have slightly different pixel dimensions horizontally and/or vertically. So instead of having an editbox on absolute positioning 100,100,400,35 in pixel terms, it is sometimes easier to define all or some of these in percentages. Conveniently 10%-left is interpreted by the browser as starting on 10% of the viewport width, 10%-top starts at 10% of the viewport height etc. Mixing pixels
    1 point
  30. A third option is to add a stylesheet in code: Add SmartCL.Css.Stylesheet to uses clauses and do: var MyStylesheet := TW3StyleSheet.Create; MyStylesheet.InnerHtml := #".TMyControlStyle { font-size: small; text-align: center; text-decoration: none; padding: 0; border: 1px solid #bbb; background-color: #C3D9FF; } .TMyOtherStyle { ..... }";
    1 point
×
×
  • Create New...