Jump to content

lynkfs

Moderators
  • Content Count

    740
  • Joined

  • Last visited

  • Days Won

    146

lynkfs last won the day on February 4

lynkfs had the most liked content!

About lynkfs

  • Rank

Profile Information

  • Gender
    Male
  • Location
    Australia

Recent Profile Visitors

3,446 profile views
  1. The listbox items map to the <input type=text> html element, which are single line items (EditBox) A multi line item would have to map to say a <textarea> element (Memo) In this case you would have to roll your own listbox component, which generates html like below You can delve a bit in the SmartCl.Controls.ListBox unit to see how this component has been put together. For instance Height can be set by coding W3ListBox.ItemHeight := 60;
  2. There is no expiration date on local storage However, users can manipulate local storage themselves, or the browser can decide to purge when it needs memory, so there is no guarantee it will always exist. Local storage is also specific per protocol, so http:// and https:// point to different storage objects. Also storage in private browsing mode gets handled with specific rules. You can set an expiration yourself if necessary though
  3. 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
  4. https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity is probably a good starting point
  5. 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
  6. Got hold of an iPhone, and yes, I see the problem. Testing some possible solutions, probably tomorrow though
  7. The standard generated index.html should prevent what you're experiencing : <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"/> At least on Android and iPad it does. However there have been problems reported in mobile Safari ( https://stackoverflow.com/questions/37808180/disable-viewport-zooming-ios-10-safari https://stackoverflow.com/questions/10614481/disable-double-tap-zoom-option-in-browser-on-touch-devices If your problem is indeed linked to mobile/Safari on iPhones, then you can also disable z
  8. 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,
  9. 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
  10. Apparently the signature of the promise.then function (executor function) in the compiled js file needs to be exactly like this : promise.then(function () { //console.log('success'); }, function () { //console.log('error'); }) As long as the compiler ejects this structure, it works fine Probably other team members could shed some more light on this ?
  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)
  12. @jarto unearthed an interesting problem to do with promises Basically the <promise>.then function has as parameters 2 call back functions. The first one will be executed on success, the second if there is an error. mypromise.then(procedure begin ...success... end, procedure begin ...error... end) This works fine. However defining these callbacks as regular external procedures and substituting these in the promise function call goes awfully wrong : procedure SuccessProc; begin writeln('success'); end; mypromise.then(SuccessProc, ErrorProc); This co
  13. 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'
×
×
  • Create New...