Prevent App Refresh via F5

Started by Mario, June 15, 2017, 11:00:50 AM

Previous topic - Next topic

Mario

In the next release, a new option allowRefresh i available in app.json.
If this option is specified as false, Pressing <F5> in app app no longer works. The app does not refresh.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier


thrinn

Mario,
in the release notes it says:
QuoteIf this option is set to true, pressing in app no longer causes a reload.]
Should be "is set to false", like correctly described above.
Thorsten
Win 10 / 64, IMatch 2018, IMA

Carlo Didier

I can still use F5 in my app. Is my syntax for the app.json correct?
{
  "type": "app",
  "id": "FFFD07EA-9973-44FE-88B2-688F45439158",
  "version": "1.0",
  "author": [
    "Carlo Didier"
  ],
  "name": {
    "": "Assign Events"
  },
  "description": {
    "": "Automatically assign events"
  },
  "defaultDocument": "index.html",
  "icon": {
    "": "app.png"
  },
  "allowRefresh": "false",
  "runAs": "modal",
  "windowSizing": {
    "sizing": "both",
    "width": 1200,
    "height": 800
  }
}

Mario

Are you using the app panel or your browser?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier


Mario

Make sure you use proper syntax:

"allowRefresh" : false,

not "false" as in your example.

"false" is a string, not a Boolean.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Ahh, ok. All other settings had "", like
"runAs": "modal",
so I supposed I nedded it here too.
Now it works.

Thanks!

Mario

This is independent from modal.
You just used a string where you have to use a Boolean. This could not work,
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Quote from: Mario on November 18, 2017, 08:07:53 AM
This is independent from modal.
You just used a string where you have to use a Boolean. This could not work,
I understand, but without further knowledge, I just saw that all parameters were quoted, so I supposed I had to quote this one too. I have no idea how those JSON files are interpreted.

Mario

QuoteI have no idea how those JSON files are interpreted.

Best to refer to http://json.org/ to learn about it. Or the beginner's guide at https://www.w3schools.com/js/js_json_intro.asp.

The name is always a string. But for the value a string, a Boolean or a number are not the same.

{
  "a" : "string",
  "b": 100,
  "c": false
}
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Ok. Thanks.
I'm used to XML data structures and this is quite different.

Mario

JSON has replaced XML in many areas for good reasons (faster, tighter, easier).
And JSON is the native JavaScript object format, which makes it super-easy to convert between the two.
All modern web services use JSON as their main data format.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

JSON is definetely better human readable than XML  :)
But I do system administration and there we do not have web services or applications for our work. That's for our application programmers.