Re: Couple of HTML questions

2021-09-13 Thread Colin Holgate via use-livecode
I found a small styled text editor that I could add my buttons to, and can now 
edit text and send it to a PHP script to store online. Then a LiveCode stack 
can retrieve those files.

One problem I ran into was getting all of the characters to survive the ordeal. 
I could successfully get the text from the HTML editor to the online file, by 
using escape(the html of the text), but LiveCode doesn’t seem to have escape or 
unescape. It does have URLDecode, but if I used URLEncode the text wouldn’t 
fully upload to the PHP script.

In the end I had to use a replaceText for each of the unicode characters that 
were in the downloaded text. So far those have been bullets, checkmarks, and 
ellipses, and I do these lines:

put replaceText(it,"%u2026","…") into newtext

put replaceText(newtext,"%u221A","√") into newtext

set the htmltext of fld  “rich text field" to replaceText(newtext,"%u2022","•")



___
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: Couple of HTML questions

2021-09-13 Thread Colin Holgate via use-livecode
I read the instructions more carefully, and the selected text does get posted.

I am using 9.6.3, wonder if the version matters?
___
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: Couple of HTML questions

2021-09-13 Thread matthias rebbe via use-livecode
Colin,

i my previous comment i posted a link to a html5 stack which posts the selected 
text of a field to a Livecode Server script. Posting should definitely work.



> Am 14.09.2021 um 00:42 schrieb Colin Holgate via use-livecode 
> :
> 
> I do see a message when trying the post, that says exception thrown, see 
> JavaScript Console. There are too many error lines to be sure which one of 
> them is important. I get no error when trying to set the style of the text, 
> which makes me think that the field is a plain text field.
> 
> When I test the stack inside LiveCode, the style changes and the post are 
> working.
> 
>> On Sep 13, 2021, at 3:14 PM, Sean Cole (Pi) via use-livecode 
>>  wrote:
>> 
>> Hi Colin,
>> If it is HTML5 deployment you are looking to do from LC, how time critical
>> is your project? At the moment, HTML5 deployment is still quite broken in
>> many ways. It may be best to wait until LC10 which is using a whole new
>> engine (which looks very promising).
>> 
>> That said, the current engine 'CAN' do what you have 'asked' for sure, both
>> 'post tData to URL(tUrl)' and 'set the textstyle of char 10 to 20 of fld
>> "myField" to "bold"' (although that will depend on what texttype is already
>> in that field potentially - it can be a bit kooky at times).
>> 
>> Other things in html5 deployment you will run into that will most likely
>> frustrate a little.
>> 
>> Regarding 'post', note the following from the LC dictionary:
>> Cross-platform note: The HTML5 engine only supports HTTP and HTTPs
>> protocols. ((ie, you can't use file;//, ftp://, etc))
>> Cross-platform note: URLs fetched by the HTML5 engine from a domain other
>> than that of the hosting the page may be blocked by web browsers, unless
>> the server hosting the URL sets the "Access-Control-Origin" header
>> appropriately. ((But as you are likely hosting the PHP you will have
>> control over that))
>> 
>> If you run into any specific HTML5 deployment issues I'd be happy to help
>> you through if you want to PM me at all.
>> 
>> Sean
>> 
>> On Mon, 13 Sept 2021 at 20:20, matthias rebbe via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>>> Hi Colin,
>>> 
>>> just tried here with a Livecode Server script not with a php script.
>>> 
>>> Posting data from an Html5 stack to an url definitely works.
>>> (see https://livecode.dermattes.de/postmr/postmr.html <
>>> https://livecode.dermattes.de/postmr/postmr.html>)
>>> 
>>> What i do not get working is setting the text style. Even if i set the
>>> style already in the IDE and built the html5 standalone the text style is
>>> reset to plain when the html5 stack is displayed in the browser.
>>> 
>>> Regards,
>>> Matthias
>>> 
>>> 
>>> 
 Am 13.09.2021 um 04:53 schrieb Colin Holgate via use-livecode <
>>> use-livecode@lists.runrev.com>:
 
 I want to have an online text editor, that can post some styled text,
>>> that then gets read into a desktop stack. There are a lot of HTML styled
>>> text editors around, but I thought I may as well try using LiveCode for
>>> that part as well.
 
 Two issues I’ve hit are the setting of the style of the text, and then
>>> posting the text to a PHP script, that stores the HTML changes.
 
 Can these lines work in an HTML published stack?:
 
 post data to URL theurl
 
 and:
 
 set the textstyle of the selection to bold
 
 
 
 ___
 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
>>> 
>> ___
>> 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


___
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: Couple of HTML questions

2021-09-13 Thread Colin Holgate via use-livecode
I do see a message when trying the post, that says exception thrown, see 
JavaScript Console. There are too many error lines to be sure which one of them 
is important. I get no error when trying to set the style of the text, which 
makes me think that the field is a plain text field.

When I test the stack inside LiveCode, the style changes and the post are 
working.

> On Sep 13, 2021, at 3:14 PM, Sean Cole (Pi) via use-livecode 
>  wrote:
> 
> Hi Colin,
> If it is HTML5 deployment you are looking to do from LC, how time critical
> is your project? At the moment, HTML5 deployment is still quite broken in
> many ways. It may be best to wait until LC10 which is using a whole new
> engine (which looks very promising).
> 
> That said, the current engine 'CAN' do what you have 'asked' for sure, both
> 'post tData to URL(tUrl)' and 'set the textstyle of char 10 to 20 of fld
> "myField" to "bold"' (although that will depend on what texttype is already
> in that field potentially - it can be a bit kooky at times).
> 
> Other things in html5 deployment you will run into that will most likely
> frustrate a little.
> 
> Regarding 'post', note the following from the LC dictionary:
> Cross-platform note: The HTML5 engine only supports HTTP and HTTPs
> protocols. ((ie, you can't use file;//, ftp://, etc))
> Cross-platform note: URLs fetched by the HTML5 engine from a domain other
> than that of the hosting the page may be blocked by web browsers, unless
> the server hosting the URL sets the "Access-Control-Origin" header
> appropriately. ((But as you are likely hosting the PHP you will have
> control over that))
> 
> If you run into any specific HTML5 deployment issues I'd be happy to help
> you through if you want to PM me at all.
> 
> Sean
> 
> On Mon, 13 Sept 2021 at 20:20, matthias rebbe via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi Colin,
>> 
>> just tried here with a Livecode Server script not with a php script.
>> 
>> Posting data from an Html5 stack to an url definitely works.
>> (see https://livecode.dermattes.de/postmr/postmr.html <
>> https://livecode.dermattes.de/postmr/postmr.html>)
>> 
>> What i do not get working is setting the text style. Even if i set the
>> style already in the IDE and built the html5 standalone the text style is
>> reset to plain when the html5 stack is displayed in the browser.
>> 
>> Regards,
>> Matthias
>> 
>> 
>> 
>>> Am 13.09.2021 um 04:53 schrieb Colin Holgate via use-livecode <
>> use-livecode@lists.runrev.com>:
>>> 
>>> I want to have an online text editor, that can post some styled text,
>> that then gets read into a desktop stack. There are a lot of HTML styled
>> text editors around, but I thought I may as well try using LiveCode for
>> that part as well.
>>> 
>>> Two issues I’ve hit are the setting of the style of the text, and then
>> posting the text to a PHP script, that stores the HTML changes.
>>> 
>>> Can these lines work in an HTML published stack?:
>>> 
>>> post data to URL theurl
>>> 
>>> and:
>>> 
>>> set the textstyle of the selection to bold
>>> 
>>> 
>>> 
>>> ___
>>> 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
>> 
> ___
> 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: Couple of HTML questions

2021-09-13 Thread Colin Holgate via use-livecode
My PHP script is at an https location, so no problems there. Currently I had 
been trying to set the text style of the selection, I didn’t yet try setting 
the text style of a character range.

The post does seem to be failing though, and given that I don’t need any HTML5 
features, only a simple styled text editor that is able to post the styled text 
to a PHP script, I will try to find some free code for doing that. Or maybe 
work out how to do it myself!

Does anyone know of any HTML and Javascript code for editing styled text? I 
think I can figure out the JavaScript to post the innerHTML of a Div.


> On Sep 13, 2021, at 3:14 PM, Sean Cole (Pi) via use-livecode 
>  wrote:
> 
> Hi Colin,
> If it is HTML5 deployment you are looking to do from LC, how time critical
> is your project? At the moment, HTML5 deployment is still quite broken in
> many ways. It may be best to wait until LC10 which is using a whole new
> engine (which looks very promising).
> 
> That said, the current engine 'CAN' do what you have 'asked' for sure, both
> 'post tData to URL(tUrl)' and 'set the textstyle of char 10 to 20 of fld
> "myField" to "bold"' (although that will depend on what texttype is already
> in that field potentially - it can be a bit kooky at times).
> 
> Other things in html5 deployment you will run into that will most likely
> frustrate a little.
> 
> Regarding 'post', note the following from the LC dictionary:
> Cross-platform note: The HTML5 engine only supports HTTP and HTTPs
> protocols. ((ie, you can't use file;//, ftp://, etc))
> Cross-platform note: URLs fetched by the HTML5 engine from a domain other
> than that of the hosting the page may be blocked by web browsers, unless
> the server hosting the URL sets the "Access-Control-Origin" header
> appropriately. ((But as you are likely hosting the PHP you will have
> control over that))
> 
> If you run into any specific HTML5 deployment issues I'd be happy to help
> you through if you want to PM me at all.
> 
> Sean
> 
> On Mon, 13 Sept 2021 at 20:20, matthias rebbe via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi Colin,
>> 
>> just tried here with a Livecode Server script not with a php script.
>> 
>> Posting data from an Html5 stack to an url definitely works.
>> (see https://livecode.dermattes.de/postmr/postmr.html <
>> https://livecode.dermattes.de/postmr/postmr.html>)
>> 
>> What i do not get working is setting the text style. Even if i set the
>> style already in the IDE and built the html5 standalone the text style is
>> reset to plain when the html5 stack is displayed in the browser.
>> 
>> Regards,
>> Matthias
>> 
>> 
>> 
>>> Am 13.09.2021 um 04:53 schrieb Colin Holgate via use-livecode <
>> use-livecode@lists.runrev.com>:
>>> 
>>> I want to have an online text editor, that can post some styled text,
>> that then gets read into a desktop stack. There are a lot of HTML styled
>> text editors around, but I thought I may as well try using LiveCode for
>> that part as well.
>>> 
>>> Two issues I’ve hit are the setting of the style of the text, and then
>> posting the text to a PHP script, that stores the HTML changes.
>>> 
>>> Can these lines work in an HTML published stack?:
>>> 
>>> post data to URL theurl
>>> 
>>> and:
>>> 
>>> set the textstyle of the selection to bold
>>> 
>>> 
>>> 
>>> ___
>>> 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
>> 
> ___
> 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: Couple of HTML questions

2021-09-13 Thread Sean Cole (Pi) via use-livecode
Hi Colin,
If it is HTML5 deployment you are looking to do from LC, how time critical
is your project? At the moment, HTML5 deployment is still quite broken in
many ways. It may be best to wait until LC10 which is using a whole new
engine (which looks very promising).

That said, the current engine 'CAN' do what you have 'asked' for sure, both
'post tData to URL(tUrl)' and 'set the textstyle of char 10 to 20 of fld
"myField" to "bold"' (although that will depend on what texttype is already
in that field potentially - it can be a bit kooky at times).

Other things in html5 deployment you will run into that will most likely
frustrate a little.

Regarding 'post', note the following from the LC dictionary:
Cross-platform note: The HTML5 engine only supports HTTP and HTTPs
protocols. ((ie, you can't use file;//, ftp://, etc))
Cross-platform note: URLs fetched by the HTML5 engine from a domain other
than that of the hosting the page may be blocked by web browsers, unless
the server hosting the URL sets the "Access-Control-Origin" header
appropriately. ((But as you are likely hosting the PHP you will have
control over that))

If you run into any specific HTML5 deployment issues I'd be happy to help
you through if you want to PM me at all.

Sean

On Mon, 13 Sept 2021 at 20:20, matthias rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Colin,
>
> just tried here with a Livecode Server script not with a php script.
>
> Posting data from an Html5 stack to an url definitely works.
> (see https://livecode.dermattes.de/postmr/postmr.html <
> https://livecode.dermattes.de/postmr/postmr.html>)
>
> What i do not get working is setting the text style. Even if i set the
> style already in the IDE and built the html5 standalone the text style is
> reset to plain when the html5 stack is displayed in the browser.
>
> Regards,
> Matthias
>
>
>
> > Am 13.09.2021 um 04:53 schrieb Colin Holgate via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > I want to have an online text editor, that can post some styled text,
> that then gets read into a desktop stack. There are a lot of HTML styled
> text editors around, but I thought I may as well try using LiveCode for
> that part as well.
> >
> > Two issues I’ve hit are the setting of the style of the text, and then
> posting the text to a PHP script, that stores the HTML changes.
> >
> > Can these lines work in an HTML published stack?:
> >
> > post data to URL theurl
> >
> > and:
> >
> > set the textstyle of the selection to bold
> >
> >
> >
> > ___
> > 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
>
___
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: Couple of HTML questions

2021-09-13 Thread matthias rebbe via use-livecode
Hi Colin,

just tried here with a Livecode Server script not with a php script.

Posting data from an Html5 stack to an url definitely works. 
(see https://livecode.dermattes.de/postmr/postmr.html 
) 

What i do not get working is setting the text style. Even if i set the style 
already in the IDE and built the html5 standalone the text style is reset to 
plain when the html5 stack is displayed in the browser.

Regards,
Matthias



> Am 13.09.2021 um 04:53 schrieb Colin Holgate via use-livecode 
> :
> 
> I want to have an online text editor, that can post some styled text, that 
> then gets read into a desktop stack. There are a lot of HTML styled text 
> editors around, but I thought I may as well try using LiveCode for that part 
> as well.
> 
> Two issues I’ve hit are the setting of the style of the text, and then 
> posting the text to a PHP script, that stores the HTML changes.
> 
> Can these lines work in an HTML published stack?:
> 
> post data to URL theurl
> 
> and:
> 
> set the textstyle of the selection to bold
> 
> 
> 
> ___
> 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