Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
59 user(s) are online (48 user(s) are browsing Forums)

Members: 1
Guests: 58

gurus2000, more...
Support us!
Recent OS4 Files
OS4Depot.net





javascript (up)loading , editing, & saving(downloading a textfile a
Just can't stay away
Joined:
2009/2/9 19:32
From Brussels Belgium
Posts: 1080
i did find different examples , eg http://cssdeck.com/labs/7bx7mmcm
of scripts that should be able to load edit & save a textfile.

Till now they all fail with Odyssey when trying to save the modified file.
Instead the "blob" created does appear as a page over the current editor page.


Is this an odyssey problem & i there a way to get around it?

There exists online applications (google etc) that work well under odyssey
so there must be solutions.to improve the scripts i did find.
Any idea how?




   Report Go to top

Re: javascript (up)loading , editing, & saving(downloading a textfile a
Just can't stay away
Joined:
2008/1/6 17:56
From Pennsylvania, USA
Posts: 1247
@JosDuchIt
I can't help you make the script work but maybe it's a good thing that the script doesn't work. If the script could save the text you edited, what's to stop it from saving a virus to your system??

   Report Go to top

Re: javascript (up)loading , editing, & saving(downloading a textfile a
Not too shy to talk
Joined:
2007/2/6 13:57
From Donostia (SPAIN)
Posts: 366
@JosDuchIt

Not sure, but maybe Odyssey webkit/JS is too old and doesn't "know" such new features/functions/tricks it uses for saving files on those pages you visited.


Try http://eligrey.com/demos/FileSaver.js/ maybe it works on Odyssey

   Report Go to top

Re: javascript (up)loading , editing, & saving(downloading a textfile a
Just can't stay away
Joined:
2009/2/9 19:32
From Brussels Belgium
Posts: 1080
@jabirulo
thanks for link.

It works under odyssey as do other similar example scripts, like this:
the (edited or new) file to save appears (here in a new/ others in the current tab) with some strange name (in this case data:text/plain;charset=UTF-8;base64,dGhlcmUgaXQgaXMK- Of course you then can save it (as html) on your HD.(it won't be html but the format you were using).
If you fill in the file name in the input widget, you expect that the file is downloaded to that location.
It isn't, whether i use
mynew.txt (expected in browser's drawer)
ram:mynew.txt
file:///ram:mynew.txt

Can anybody confirm this behaviour ?

@xenix: I was worried of this too, but reading about this, convinced me that it is possible to save/download a newly created/modified file(eg what's the point of the scripts presenting an input "filename" widget (I only tested scripts that have such possibility) if you can't save to that path?
The risk is said to be at most the same as when you download any file:
That possibility exists since html.





   Report Go to top

Re: javascript (up)loading , editing, & saving(downloading a textfile a
Just can't stay away
Joined:
2009/2/9 19:32
From Brussels Belgium
Posts: 1080
I have been looking further into the subject

Edit: Odyssey1.23 25/12/2013 uses (use javascript:alert(navigator.userAgent) )as your URL ) AppleWebkit/538.1
it is not clear what version of javascriptcore is used (i couldn't find a list of succcesive versions of webkit & javascriptcore)
It is possible though to detect the date of the examples & see if they were coded before or after that date
The example i gave seems to have been published on 2012/12/18

https:thiscouldbebetter.wordpress.com/2012/12/18/loading-editing-and-saving-a-text-file-in-html5-using-javascrip/
it makes use of javascript.HTML(?) "blobs" (binary large object)

Filesaver.js is dated 9/11/2014 it uses a saveAs() function said to be part of the W3C fileSaver API
Iits status is given here :
http://www.w3.org/TR/file-writer-api/
24 april 2014
"Work on this document has been discontinued and it should not be referenced or used as a basis for implementation."
Its first definition dated form 2009, so it is not unreasonable to think webkit oct 2013 might have implemented in.

I cannot conclude from this that there is something wrong with the javascriptcore or webkit used or Odyssey1.23 (or if there is where the problem originaties)

Continuing search for work-around. that works

To be a bit more complete
html5 added "localstorage" only in 2015
https://w3c.github.io/webstorage/
which makes things even simpler.(??)
You can check it at
http://html5-demos.appspot.com/static/a.download.html

It works under chrome & Firefox (on my wife's PC) not under mobile Safari 8 on IOS8.4 (Ipad)
& hence not under Odyssey

====================================

A warning about privacy dangers i did stumble on,
http://thehackernews.com/2014/07/html ... gerprint-widely-used.html

This might be of interest for site builders trying to get the most out of html5
http://modernizr.com/docs/

This has helped me too

https://developer.apple.com/library/sa ... le_ref/doc/uid/TP40007874




Edited by JosDuchIt on 2015/8/4 13:59:58
Edited by JosDuchIt on 2015/8/4 14:21:35
   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project