Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 09/26/2020 in Posts

  1. 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
  2. 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
  3. 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
  4. 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
  5. Fixed now in the Alpha branch. Thank you @Tim Koscielski
    2 points
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. There's a small update available. It adds a possibility to change TW3ListBox line text.
    1 point
  13. 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
  14. 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
  15. 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
  16. jarto

    Sample - Scrollbar

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

    Sample - Scrollbar

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

    License code expired

    Thank you so much! It has been resolved now! Tammy
    1 point
  19. 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
  20. 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
  21. 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
  22. @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
  23. @JimKueneman No, I haven't changed anything in WebSockets code.
    1 point
  24. 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
  25. 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...