Jump to content

lynkfs@gmail.com

Moderators
  • Content count

    283
  • Joined

  • Last visited

  • Days Won

    66

lynkfs@gmail.com last won the day on November 13

lynkfs@gmail.com had the most liked content!

About lynkfs@gmail.com

  • Rank

Profile Information

  • Gender
    Male
  • Location
    Australia
  1. RTTI metadata only for some classes

    Good on you ! Care to share ?
  2. Force a late Resize

    Nothing which jumps out ....
  3. Force a late Resize

    A bit difficult to get around your question without code examples. For timing problems I've implemented a mutation observe mechanism into my native framework, which works like a treat. This basically provides an 'onchange' trigger over code-blocks. It may or may not be applicable in your case though
  4. GPU Processing

    I've used the gpu.js library as well. Works fine
  5. Scrolling

    Binding to element was just for testing purposes, to document is better of course Need to test any differences a bit more .... , I'll let you know if I find any
  6. Scrolling

    Thanks @jarto I see what you've done here. Wonderful, much appreciated I'll do some testing on devices I have available Cheers by the way, any chance of yourself glancing over the js-code 2 posts back ?
  7. Smart 2.9.9 [alpha] is here!

    I've read your reply and admire the way of thinking. Just to check, the following code in the present alpha returns 0, 100, 98, 98 respectively How would these values differ in the new code base ?
  8. Smart 2.9.9 [alpha] is here!

    off the cuff reaction : It is always difficult to reconcile different systems, in this case the positioning systems as implemented by SMS(Delphi) and by HTML(browser), and it is a bit of a philosophical question as well. However my personal opinion is that its important to stay as much in sync with the browser as possible. So for instance defining clientHeight in SMS as "the usable size inside the control after padding has been taken off" is IMHO not a good idea. ClientHeight in the browsers border-box terminology is height minus border minus scrollbar width (https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements). It would be very confusing to have to deal with the difference between <mycomponent>.clientHeight and <mycomponent>.handle.clientHeight returning different values. As such, if positioning in sms needs to be redefined, I would suggest to keep with the border-box model keep SMS and browser positioning terminoloy as much the same as possible : same naming convention and typing positioning rules are complicated and depend on may different parameters (HTML rules, CSS rules, platform dependencies), so use the browser to calculate positioning values when possible, rather than re-coding those rules in sms Cheers
  9. Scrolling

    This pull-to-refresh on mobile is hard to tackle So far the piece of js below embedded in the main html seems to be the best fit (mash-up of various sources on stackoverflow) It inhibits pull-to-refresh on iOS (chrome and safari, both on iPhone and iPad) and on Android (Chrome and firefox, both on Samsung) while maintaining native scrolling. Not tested on other platforms <!DOCTYPE html> <html manifest="app.manifest"> <head> <meta charset="UTF-8" /> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes"> <meta name="format-detection" content="telephone=yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"/> <title>index</title> </head> <body> <script> window.addEventListener('load', function() { var element = document.getElementById("Component5"); var initialY = null, previousY = null, bindScrollEvent = function(e){ previousY = initialY = e.touches[0].clientY; // Pull to reload won't be activated if the element is not initially at scrollTop === 0 if(element.scrollTop <= 0){ element.addEventListener('touchmove', blockScroll); } }, blockScroll = function(e){ if(previousY && previousY < e.touches[0].clientY){ //Scrolling up e.preventDefault(); } else if(initialY >= e.touches[0].clientY){ //Scrolling down //As soon as you scroll down, there is no risk of pulling to reload element.removeEventListener('touchmove', blockScroll); } previousY = e.touches[0].clientY; }, unbindScrollEvent = function(e){ element.removeEventListener('touchmove', blockScroll); }; element.addEventListener('touchstart', bindScrollEvent, {passive: false }); element.addEventListener('touchend', unbindScrollEvent, {passive: false }); }); </script> <script type="text/javascript" src="main.js"></script> </body> </html> If someone can validate this code, please do and let me know how this behaves in other mobile environments Source (www.lynkfs.com/Experiments/tryout/index.sproj), demo (www.lynkfs.com/Experiments/tryout)
  10. Scrolling

    Hi @jarto I'm working on this as well. Can you share your (Safari) solution ? By the way, beautiful comparison list
  11. Pagespeed ranking 98/100

    Googles PageSpeed tool (https://developers.google.com/speed/pagespeed/insights/) checks any website or webapp on various speedfactors, and returns a rating both for desktop and mobile. Most of these factors are easy to implement. Just tick the relevant minifying, packing, obfuscation boxes in the "Compiler-Code generation" section of the Project Options. The PageSpeed tool also flags un-optimised images and even optimises them to download. The more difficult option is the rule about "prioritising visible content". This is obviously difficult to do in regular SMS projects. Both the CSS and JS files generated by the compiler don't make any distinction between 'above' or 'below' the fold. To circumvent this, the following works for me : Get the generated HTML code for the first form. Easiest is execute the project in the IDE, go to the "Console section" in DevTools and type 'copy(document.body.innerHTML);' This copies the generated HTML to the clipboard. Insert this code in the HTML template in the top of the <body> section Insert the keyword 'async' in the <script> section where the main.js file is loaded This basically quickly renders the first page in HTML only and the user will see it pretty quickly. It won't do anything until the js file has loaded but that's generally ok. CSS files, unless really really big, usually don't pose a problem as they can fit into the initial congestion window (typically 14.6kB compressed) Doing this gives me a 98/100 rating both for mobile and desktop. The remaining 2% is about 'leveraging browser caching' which doesn't bother me too much. Haven't checked yet what the sms manifest file options may do to this rule.
  12. How to correctly style custom innerHTML?

    Understand Using the regular new alpha, the attached project works too DevSpinner.sproj
  13. How to correctly style custom innerHTML?

    It may not help you much, but doing a quick 100% conversion of the fiddle on the top of this thread ( https://jsfiddle.net/8g4aqh17/) in the native framework (click on 'JSpinner') didn't produce any errors.
  14. form OnActivate / OnDeactivate ?

    I see Don't know why they are removed there
  15. Scrolling

    Finally found out what's wrong with the scripts in the <body> section (see previous comments in this thread). I'm not a javascript expert but what happened is that there were 2 scripts stacked on top of each other. The typo in the closing </script"> tag in the first script also completely invalidates the following second script. This second invalidated script happens to be the standard script generated from the "default.html" template : which, when looking at it a bit closer, is also the main culprit in inhibiting native scrolling on iOS. So, in the end simply deleting all <body> scripts is one of the keys to enable native scrolling everywhere.
×