Re: Gzip in HTML5

2019-07-12 Thread Alain Vezina via use-livecode
Thanks a  lot Hermann,

Your PDF file is a trove of information to develop in HTML5.

Alain Vezina


> Le 12 juil. 2019 à 13:01, hh via use-livecode  
> a écrit :
> 
> Nothing directly/manually.
> The "need" for Gzip is meant to speed up serving the HTML5 standalone.
> This is done (after configuring the .htaccess file) by the server.
> 
> The standalone builder gives you the files exactly as you need them.
> What you can change to your taste is the html file connected to the 
> standalone.
> 
> Here is the pdf of a talk I gave in 2016, the second part contains
> an example customized html file and moreover (on page 15) some hints
> how to optimize serving html5 standalones using Gzip/Apache:
> 
> http://hyperhh.org/html5/community/LCD-01f.pdf
> 
> Compare your serving speed to the speed of the last samples of 
> http://hyperhh.org/html5/ (which is optimized) using Safari.
> 
> If have here a loading time of at most 7 seconds for the first time
> and 4 seconds when using the same LC version.
> [http://hh.on-rev.com/html5/ is (currently) much slower...]
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

RE: Local files in browser widget

2019-07-12 Thread Ralph DiMola via use-livecode
I was looking at my code that works. I move the file into the documents folder 
and do "file:"&the documents folder&slash&"mydoc.html"

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
J. Landman Gay via use-livecode
Sent: Friday, July 12, 2019 3:47 PM
To: How to use LiveCode
Cc: J. Landman Gay
Subject: Re: Local files in browser widget

On 7/12/19 1:52 PM, Klaus major-k via use-livecode wrote:
> Hi Jaques,
> 
>> Am 12.07.2019 um 20:43 schrieb J. Landman Gay via use-livecode 
>> :
>>
>> On 7/12/19 9:10 AM, Devin Asay via use-livecode wrote:
>>> On Jul 11, 2019, at 9:34 PM, J. Landman Gay via use-livecode 
>>>  wrote:

 I think I asked this before but it isn't working now. I thought 
 specialFolderPath("resources") was okay for read-only files. It fails on 
 Android.

 put specialFolderPath("resources") & "/tFolder/tFile.html" into 
 tPath set the url of widget "browser" to ("file://" & tPath)

 I get an error that the file was not found. It's there, the folder was 
 included in the Copy Files pane in standalone settings. When I insert an 
 answer dialog to view the path, there's a string that ends with 
 "...base.apk/tFolder/tFile.html" so I think that's right.

 Do I need more or fewer slashes?
>>> J,
>>> I don’t think you need the slashes after file: at all. (“file:” & 
>>> specialFolderPath(“resources”) & “/tFolder/tFile.hmtl”) should do it.
>>> Also check case on folder and file names. Case matters in mobile file 
>>> systems in my experience.
>>
>> Thanks Devin, but unfortunately it still doesn't work. Capitalization is 
>> correct (all lower case.) I also tried adding the internet library and 
>> tsNet, even though I don't use those, just to see if they were required. 
>> Still no go.
> 
> just to be sure, did you:
> ...
> replace SPACE with "%20" in tPath
> ...
> ?

I didn't, but there are no spaces in the file name.

But I've just found something interesting. Devin was right, I don't need any 
slashes to read the resources folder in the apk. But I can't use it as a URL in 
a browser. I can use it to copy the file from the resources folder to the 
documents folder, but it fails if I directly set the URL of the browser widget.

   put specialFolderPath("resources") & "/tFolder/tFile" into tSourcePath
   answer (there is a file tSourcePath) -> TRUE
   set the URL of widget "browser" to ("file:" & tSourcePath) -> file not found
   put specialFolderPath("documents") & "/tFolder/" into tDir
   if there is no folder tDir then create folder tDir
   put tDir & tFile into tLocalPath
   put url ("file:" & tSourcePath) into url ("file://" & tLocalPath)
   set the URL of widget "browser" to ("file://" & tLocalPath) -> OK

Maybe browsers can't read files inside packages?

-- 
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Local files in browser widget

2019-07-12 Thread J. Landman Gay via use-livecode

On 7/12/19 1:52 PM, Klaus major-k via use-livecode wrote:

Hi Jaques,


Am 12.07.2019 um 20:43 schrieb J. Landman Gay via use-livecode 
:

On 7/12/19 9:10 AM, Devin Asay via use-livecode wrote:

On Jul 11, 2019, at 9:34 PM, J. Landman Gay via use-livecode 
 wrote:


I think I asked this before but it isn't working now. I thought 
specialFolderPath("resources") was okay for read-only files. It fails on 
Android.

put specialFolderPath("resources") & "/tFolder/tFile.html" into tPath
set the url of widget "browser" to ("file://" & tPath)

I get an error that the file was not found. It's there, the folder was included in the 
Copy Files pane in standalone settings. When I insert an answer dialog to view the path, 
there's a string that ends with "...base.apk/tFolder/tFile.html" so I think 
that's right.

Do I need more or fewer slashes?

J,
I don’t think you need the slashes after file: at all. (“file:” & 
specialFolderPath(“resources”) & “/tFolder/tFile.hmtl”) should do it.
Also check case on folder and file names. Case matters in mobile file systems 
in my experience.


Thanks Devin, but unfortunately it still doesn't work. Capitalization is 
correct (all lower case.) I also tried adding the internet library and tsNet, 
even though I don't use those, just to see if they were required. Still no go.


just to be sure, did you:
...
replace SPACE with "%20" in tPath
...
?


I didn't, but there are no spaces in the file name.

But I've just found something interesting. Devin was right, I don't need 
any slashes to read the resources folder in the apk. But I can't use it 
as a URL in a browser. I can use it to copy the file from the resources 
folder to the documents folder, but it fails if I directly set the URL 
of the browser widget.


  put specialFolderPath("resources") & "/tFolder/tFile" into tSourcePath
  answer (there is a file tSourcePath) -> TRUE
  set the URL of widget "browser" to ("file:" & tSourcePath) -> file 
not found

  put specialFolderPath("documents") & "/tFolder/" into tDir
  if there is no folder tDir then create folder tDir
  put tDir & tFile into tLocalPath
  put url ("file:" & tSourcePath) into url ("file://" & tLocalPath)
  set the URL of widget "browser" to ("file://" & tLocalPath) -> OK

Maybe browsers can't read files inside packages?

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: import from multi-page png, and automating pdf-> png

2019-07-12 Thread Dalton Calford via use-livecode
https://www.xpdfreader.com/pdftopng-man.html
Is probably the tool you are looking for

On Fri, 12 Jul 2019 at 14:49, Dalton Calford 
wrote:

> You can use gimp to automate the conversion of pdf's to specified output
> file formats/sizes.   This is good for batch work.
> xpdfreader also has some good utilities/functionality depending upon what
> you are trying to do.
>
> On Fri, 12 Jul 2019 at 14:46, Dr. Hawkins via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>>
>> As I’m trying to get a temporary workaround for the engine
>> pixel-rendering a pdf widget rather than including the pdf, I have a two
>> part question:
>>
>> 1) is there a straightforward way to batch convert pdf to png of
>> specified density?
>> 2) for a multipage png, is there a “decent” way to use import to get a
>> chunk of a specified page, or do I need to know the pixel height of the
>> page and do the math?
>> —
>> Richard E. Hawkins, Esq.
>> The Hawkins Law Firm
>> 3430 E. Flamingo Rd.
>> Suite 232
>> Las Vegas, NV  89121
>> (702) 508-8462
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Local files in browser widget

2019-07-12 Thread Klaus major-k via use-livecode
Hi Jaques,

> Am 12.07.2019 um 20:43 schrieb J. Landman Gay via use-livecode 
> :
> 
> On 7/12/19 9:10 AM, Devin Asay via use-livecode wrote:
>> On Jul 11, 2019, at 9:34 PM, J. Landman Gay via use-livecode 
>>  wrote:
>>> 
>>> I think I asked this before but it isn't working now. I thought 
>>> specialFolderPath("resources") was okay for read-only files. It fails on 
>>> Android.
>>> 
>>> put specialFolderPath("resources") & "/tFolder/tFile.html" into tPath
>>> set the url of widget "browser" to ("file://" & tPath)
>>> 
>>> I get an error that the file was not found. It's there, the folder was 
>>> included in the Copy Files pane in standalone settings. When I insert an 
>>> answer dialog to view the path, there's a string that ends with 
>>> "...base.apk/tFolder/tFile.html" so I think that's right.
>>> 
>>> Do I need more or fewer slashes?
>> J,
>> I don’t think you need the slashes after file: at all. (“file:” & 
>> specialFolderPath(“resources”) & “/tFolder/tFile.hmtl”) should do it.
>> Also check case on folder and file names. Case matters in mobile file 
>> systems in my experience.
> 
> Thanks Devin, but unfortunately it still doesn't work. Capitalization is 
> correct (all lower case.) I also tried adding the internet library and tsNet, 
> even though I don't use those, just to see if they were required. Still no go.

just to be sure, did you:
...
replace SPACE with "%20" in tPath
...
?

> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: import from multi-page png, and automating pdf-> png

2019-07-12 Thread Dalton Calford via use-livecode
You can use gimp to automate the conversion of pdf's to specified output
file formats/sizes.   This is good for batch work.
xpdfreader also has some good utilities/functionality depending upon what
you are trying to do.

On Fri, 12 Jul 2019 at 14:46, Dr. Hawkins via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> As I’m trying to get a temporary workaround for the engine pixel-rendering
> a pdf widget rather than including the pdf, I have a two part question:
>
> 1) is there a straightforward way to batch convert pdf to png of specified
> density?
> 2) for a multipage png, is there a “decent” way to use import to get a
> chunk of a specified page, or do I need to know the pixel height of the
> page and do the math?
> —
> Richard E. Hawkins, Esq.
> The Hawkins Law Firm
> 3430 E. Flamingo Rd.
> Suite 232
> Las Vegas, NV  89121
> (702) 508-8462
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

import from multi-page png, and automating pdf-> png

2019-07-12 Thread Dr. Hawkins via use-livecode

As I’m trying to get a temporary workaround for the engine pixel-rendering a 
pdf widget rather than including the pdf, I have a two part question:

1) is there a straightforward way to batch convert pdf to png of specified 
density?
2) for a multipage png, is there a “decent” way to use import to get a chunk of 
a specified page, or do I need to know the pixel height of the page and do the 
math?
— 
Richard E. Hawkins, Esq.
The Hawkins Law Firm
3430 E. Flamingo Rd.
Suite 232
Las Vegas, NV  89121
(702) 508-8462

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Local files in browser widget

2019-07-12 Thread J. Landman Gay via use-livecode

On 7/12/19 9:10 AM, Devin Asay via use-livecode wrote:

On Jul 11, 2019, at 9:34 PM, J. Landman Gay via use-livecode 
 wrote:


I think I asked this before but it isn't working now. I thought 
specialFolderPath("resources") was okay for read-only files. It fails on 
Android.

put specialFolderPath("resources") & "/tFolder/tFile.html" into tPath
set the url of widget "browser" to ("file://" & tPath)

I get an error that the file was not found. It's there, the folder was included in the 
Copy Files pane in standalone settings. When I insert an answer dialog to view the path, 
there's a string that ends with "...base.apk/tFolder/tFile.html" so I think 
that's right.

Do I need more or fewer slashes?


J,

I don’t think you need the slashes after file: at all. (“file:” & 
specialFolderPath(“resources”) & “/tFolder/tFile.hmtl”) should do it.

Also check case on folder and file names. Case matters in mobile file systems 
in my experience.


Thanks Devin, but unfortunately it still doesn't work. Capitalization is 
correct (all lower case.) I also tried adding the internet library and 
tsNet, even though I don't use those, just to see if they were required. 
Still no go.



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Question about "the screen" property of stacks...

2019-07-12 Thread Bob Sneidar via use-livecode
Thanks Mark. I was playing with this to try and determine how to get a stack 
window to move to a position where it is fully visible on the screen it belongs 
to. Turns out not to be trivial, at least not for me. I worked out the math, 
and was feeling pretty proud of myself, until I realized the primary monitor 
may not be to the left of any secondary monitor. I then realized a second (or 
third) monitor may not even be right or left, but might be top or bottom! 

At this point my brain blew a fuse and I gave up. ;-)

There may be a command like get the screenLoc of screen 2, but I was not able 
to find it in the dictionary. That would be a handy edition. To that end, here 
is a function that will do it:

function getScreenCenter pStack
-- pStack must be the name or the filename (not the short name) of a 
stack
put the screen of pStack into tStackScreen
put line tStackScreen of the screenRects into tScreenRect
put item 1 of tScreenRect + ((item 3 of tScreenRect - item 1 of 
tScreenRect) /2) \
into item 1 of tNewStackLoc
put item 2 of tScreenRect + ((item 4 of tScreenRect - item 2 of 
tScreenRect) /2) \
into item 2 of tNewStackLoc
return tNewStackLoc
end getScreenCenter

Bob S


> On Jul 11, 2019, at 10:08 , Mark Waddingham via use-livecode 
>  wrote:
> 
> On 2019-07-11 17:17, Paul Dupuis via use-livecode wrote:
>> The screen of stack X returns the number of the monitor (the line
>> number for the screenRects) that the stack/window is on.
> 
>> If someone from the mothership can verify, I would be happy to open a
>> doc bug, update the dictionary, and generate a PR for an update to the
>> screen property Dictionary entry to clarify these two points.
> 
> The engine compares the content rect (not effective!) of the stack to the
> working area of each screen and takes the screen with which it shares the
> most area (the intersection of the stack's rect and the working area rect
> of the screen is a rectangle - and its the area of that which is used).

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Gzip in HTML5

2019-07-12 Thread hh via use-livecode
Nothing directly/manually.
The "need" for Gzip is meant to speed up serving the HTML5 standalone.
This is done (after configuring the .htaccess file) by the server.

The standalone builder gives you the files exactly as you need them.
What you can change to your taste is the html file connected to the standalone.

Here is the pdf of a talk I gave in 2016, the second part contains
an example customized html file and moreover (on page 15) some hints
how to optimize serving html5 standalones using Gzip/Apache:

http://hyperhh.org/html5/community/LCD-01f.pdf

Compare your serving speed to the speed of the last samples of 
http://hyperhh.org/html5/ (which is optimized) using Safari.

If have here a loading time of at most 7 seconds for the first time
and 4 seconds when using the same LC version.
[http://hh.on-rev.com/html5/ is (currently) much slower...]
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Bug Inconsistencies with AWSS3 commands

2019-07-12 Thread Martin Koob via use-livecode
As you may have read in my other post I am trying to move from mergAWSS3 to the 
LC9 AWSS3 commands so I can build my application for windows. I have had some 
success but I am running into some inconsistencies that I think are bugs.  I 
have made a demo stack and created a bug report.  
https://quality.livecode.com/show_bug.cgi?id=22235

Can someone try this out and see if they get the same results?

Thanks

Martin Koob

Sent from my iPhone
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Gzip in HTML5

2019-07-12 Thread Alain Vezina via use-livecode
Is there anybody who can tell me which files and folders I have to Gzip in 
HTML5 app. ?
The doc says you have to Gzip the engine.  What do they mean by engine, 
considering that the biggest folder is the JavaScript one.

I Gziped that folder, but I saw no difference in time to download my test app.

Alain Vezina
Logilangue
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


tsNet and AWSS3 questions

2019-07-12 Thread KOOB via use-livecode
I have posted this on the forums and have not got any response.
‘
So I am trying on the use-list.

I am changing from using mergAWSS3 commands to using the new AWSS3 commands in 
LC 9.0.4.

I have two questions about how tsNet and the new AWSS3 commands work together

1. It seems I need to use tsNetGetStatus to monitor progress on uploads and 
downloads with AWSS3PutObject and AWSS3GetObject. If I use tsNetGetStatus do I 
have to call tsNetInit first? Does this just have to be called one time when 
the application opens or each time tsNetGetStatus is called?

2. In my application I used mergAWSS3Cancel to give the user the option to be 
able to cancel downloads or uploads that were taking too long or appeared to be 
stuck. I don’t see an equivalent in the AWSS3 commands nor in the tsNet 
commands. Is there a way to cancel a tsNet operation in progress?

Thanks for any input.

Martin Koob

Sent from my iPad

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Local files in browser widget

2019-07-12 Thread Devin Asay via use-livecode
On Jul 11, 2019, at 9:34 PM, J. Landman Gay via use-livecode 
 wrote:
> 
> I think I asked this before but it isn't working now. I thought 
> specialFolderPath("resources") was okay for read-only files. It fails on 
> Android.
> 
> put specialFolderPath("resources") & "/tFolder/tFile.html" into tPath
> set the url of widget "browser" to ("file://" & tPath)
> 
> I get an error that the file was not found. It's there, the folder was 
> included in the Copy Files pane in standalone settings. When I insert an 
> answer dialog to view the path, there's a string that ends with 
> "...base.apk/tFolder/tFile.html" so I think that's right.
> 
> Do I need more or fewer slashes?

J,

I don’t think you need the slashes after file: at all. (“file:” & 
specialFolderPath(“resources”) & “/tFolder/tFile.hmtl”) should do it.

Also check case on folder and file names. Case matters in mobile file systems 
in my experience.

D


Devin Asay
Director
Office of Digital Humanities
Brigham Young University

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode