Suggestion Issue: Sitelock Suggestions


Pages: 1

rob1221

  • Master Stencyler
  • *
November 20, 2019, 12:52:26 pm
1. Wildcards aren't currently supported.  I added this bit of code to my preloader template to do that on my end:
Code: [Select]
var r:EReg = new EReg(site, "");
if (r.match(currURL))
{
    ok = true;
}

2. The URL shown on the sitelock screen is the first one in the list, but clicking will attempt to open the entire sitelock string which will fail if there is more than one URL.

3. I don't like how small the text is.  In my template I changed that using this code:
Code: [Select]
var txtFormat = new openfl.text.TextFormat(null, 25);
txt.setTextFormat(txtFormat);


Issue updated by Justin - December 07, 2019, 01:56:50 am
  • Tags added: 4.1.0


Justin

  • Master Stencyler
  • *
October 13, 2020, 07:23:27 pm
All three suggestions taken for private build 10620, and will be available in public release 4.1.0.

1. Wildcards

For the first one, here's what I went with.

Code: [Select]
var useRegex = site.indexOf("*") >= 0 || (site.startsWith("^") && site.endsWith("$"));

if(useRegex)
{
var r:EReg = new EReg(site, "");
ok = r.match(currURL);
}
else
{
ok = (currURL.indexOf(site) >= 0);
}

If the individual sitelock url contains the wildcard character (*) or starts and ends with the beginning/ending of string characters (^...$), then it will be treated as a regular expression. The reason I don't want to treat everything as a regex is because that would change how existing urls are matched.

For example, in the UI, the format is stated as "website.com, website2.com". If we were to look at just the first one, that used to match only sites that contain "website.com", but as a regex, that would now match other things like "website_com". Changing everything to be regex would change the behavior of probably every sitelock url ever.

2. Sitelock link

Clicking opens only the first url. If you're using regex, or a pattern that only matches a portion of the url, the first sitelock url should be a full link instead.

3. Text size

Changed as requested, but if we get more requests like this in the future, it would be better to build more options for users changing this themselves.
  • Status changed from New to Resolved
  • Issue Assigned from (none) to Justin


rob1221

  • Master Stencyler
  • *
June 10, 2022, 09:53:00 am
I updated Stencyl only recently so I didn't verify the changes earlier, but I ran into an issue today when I got an email about the sitelock screen appearing when it should not.  I looked into the changes and saw the standard site checking was changed to this:

ok = (currURL.indexOf(site) >= 0);

That caused a problem with my sitelock containing multiple URLs because an earlier one was matched but the last one wasn't and "ok" was flipped from true to false.


Justin

  • Master Stencyler
  • *
June 10, 2022, 07:41:15 pm
Oops. Fixed in the latest build (4.1.0-beta3/b11027).


Pages: 1

Details

  • Reported
    November 20, 2019, 12:52:26 pm
  • Updated
    June 10, 2022, 07:41:15 pm

  • View Status
    Public
  • Type
    Suggestion
  • Status
    Resolved
  • Priority
    Normal
  • Version
    (none)
  • Fixed in
    (none)
  • Assigned to
    Justin
  • Category
    Engine

Tags