Re: Browser selections
Perhaps you wish to select the text (not getting the selected text what is more difficult) of a textarea with id='j1" then you can do: on mouseUp put 10 into selStart; put 20 into selEnd do "document.getElementById('j1')." & \ "setSelectionRange("& selStart,selEnd &");" in widget "browser" end mouseUp p.s. My 'native' HTML5 field works also in a browser widget (it's more difficult to realize because the widget has not as much features available as a browser). I have it ready soon, may be in a few days. ___ 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: Browser selections
On 9/12/19 5:01 PM, hh via use-livecode wrote: JLG wrote: Is there a way select text by script in a browser widget? I thought I'd done that before but I don't see a command for it now. You certainly didn't that without javascript. Here is a demostack that shows how to do that, only a few lines are needed for using a javascriptHandler: http://forums.livecode.com/viewtopic.php?p=174936#p174936 Thanks Hermann. I may have been thinking of a native field, it was a long time ago. I'll take a look at your example. -- 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: Browser selections
> JLG wrote: > Is there a way select text by script in a browser widget? I thought I'd > done that before but I don't see a command for it now. You certainly didn't that without javascript. Here is a demostack that shows how to do that, only a few lines are needed for using a javascriptHandler: http://forums.livecode.com/viewtopic.php?p=174936#p174936 ___ 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
Browser selections
Is there a way select text by script in a browser widget? I thought I'd done that before but I don't see a command for it now. -- 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: Browser selections
You're welcome! You helped me so often on the forum :) Op 10-4-2019 om 19:56 schreef J. Landman Gay via use-livecode: Thanks for the details. It doesn't do what I need but it could come in handy in the future. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On April 10, 2019 12:46:12 PM JJS via use-livecode wrote: Jacque, what i do is echo only a single line as a webpage. The php file is only called by the API, because i send it with the data to the api as a return address. There is no hilited text. Before this php file would contain the URL scheme and reopen the app to continue where it was, but now i do this: in the php file: header ("Location:mysuperdeluxeapp://"); */ ?> then in LC in widget script i do: *on*browserDocumentLoadComplete pUrl *local*tT *put*thehtmlTextofwidget"awesomebrowser"intotT *repeat* for5times *if* tT contains"return to mysuperdeluxeapp"*then* *set*theurlofwidget"awesomebrowser"toempty *go*tocard"letsgoon" *exit* *repeat* *end* *if* *end* *repeat* *end*browserDocumentLoadComplete Op 10-4-2019 om 08:44 schreef J. Landman Gay via use-livecode: I was replying to you, JJS. I might be confused about how your method works. How does returning a line from the server allow hiliting text in the widget? On 4/9/19 12:33 PM, JJS via use-livecode wrote: Who are you referring to Jacque? hh or me? If it's me, then: i echo only one line of text with the php file which is called after the api routine succeeded. this way i can just look for that one sentence, it goes so fast you can't see it and the app switches to another card Op 8-4-2019 om 20:52 schreef J. Landman Gay via use-livecode: Actually, I need to hilite a portion of the text in the browser rather than just get the whole content. Are you doing that? Eventually I may need to get the user's drag-selection too, but not yet. On 4/8/19 12:22 PM, JJS via use-livecode wrote: you can use this: *put*thehtmlTextofwidget"browser"intotT i use this now for an api which redirects to a php file which echoes a line of text (as normally it would use the URL scheme, but this does not work with the widget) this way i could use the browser widget and stay in the app(mobile) instead of using a external browser and retunring to the app afterwards which is an ugly thing and leaves the url open in an extenal browser. if the text in the browser is my text then it moves on(and i'm checking like 10 times) It works great! Op 7-4-2019 om 21:34 schreef J. Landman Gay via use-livecode: Is there a way to get/set selected text in a browser widget? I couldn't find anything. ___ 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: Browser selections
Thanks for the details. It doesn't do what I need but it could come in handy in the future. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On April 10, 2019 12:46:12 PM JJS via use-livecode wrote: Jacque, what i do is echo only a single line as a webpage. The php file is only called by the API, because i send it with the data to the api as a return address. There is no hilited text. Before this php file would contain the URL scheme and reopen the app to continue where it was, but now i do this: in the php file: header ("Location:mysuperdeluxeapp://"); */ ?> then in LC in widget script i do: *on*browserDocumentLoadComplete pUrl *local*tT *put*thehtmlTextofwidget"awesomebrowser"intotT *repeat* for5times *if* tT contains"return to mysuperdeluxeapp"*then* *set*theurlofwidget"awesomebrowser"toempty *go*tocard"letsgoon" *exit* *repeat* *end* *if* *end* *repeat* *end*browserDocumentLoadComplete Op 10-4-2019 om 08:44 schreef J. Landman Gay via use-livecode: I was replying to you, JJS. I might be confused about how your method works. How does returning a line from the server allow hiliting text in the widget? On 4/9/19 12:33 PM, JJS via use-livecode wrote: Who are you referring to Jacque? hh or me? If it's me, then: i echo only one line of text with the php file which is called after the api routine succeeded. this way i can just look for that one sentence, it goes so fast you can't see it and the app switches to another card Op 8-4-2019 om 20:52 schreef J. Landman Gay via use-livecode: Actually, I need to hilite a portion of the text in the browser rather than just get the whole content. Are you doing that? Eventually I may need to get the user's drag-selection too, but not yet. On 4/8/19 12:22 PM, JJS via use-livecode wrote: you can use this: *put*thehtmlTextofwidget"browser"intotT i use this now for an api which redirects to a php file which echoes a line of text (as normally it would use the URL scheme, but this does not work with the widget) this way i could use the browser widget and stay in the app(mobile) instead of using a external browser and retunring to the app afterwards which is an ugly thing and leaves the url open in an extenal browser. if the text in the browser is my text then it moves on(and i'm checking like 10 times) It works great! Op 7-4-2019 om 21:34 schreef J. Landman Gay via use-livecode: Is there a way to get/set selected text in a browser widget? I couldn't find anything. ___ 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: Browser selections
Jacque, what i do is echo only a single line as a webpage. The php file is only called by the API, because i send it with the data to the api as a return address. There is no hilited text. Before this php file would contain the URL scheme and reopen the app to continue where it was, but now i do this: in the php file: header ("Location:mysuperdeluxeapp://"); */ ?> then in LC in widget script i do: *on*browserDocumentLoadComplete pUrl *local*tT *put*thehtmlTextofwidget"awesomebrowser"intotT *repeat* for5times *if* tT contains"return to mysuperdeluxeapp"*then* *set*theurlofwidget"awesomebrowser"toempty *go*tocard"letsgoon" *exit* *repeat* *end* *if* *end* *repeat* *end*browserDocumentLoadComplete Op 10-4-2019 om 08:44 schreef J. Landman Gay via use-livecode: I was replying to you, JJS. I might be confused about how your method works. How does returning a line from the server allow hiliting text in the widget? On 4/9/19 12:33 PM, JJS via use-livecode wrote: Who are you referring to Jacque? hh or me? If it's me, then: i echo only one line of text with the php file which is called after the api routine succeeded. this way i can just look for that one sentence, it goes so fast you can't see it and the app switches to another card Op 8-4-2019 om 20:52 schreef J. Landman Gay via use-livecode: Actually, I need to hilite a portion of the text in the browser rather than just get the whole content. Are you doing that? Eventually I may need to get the user's drag-selection too, but not yet. On 4/8/19 12:22 PM, JJS via use-livecode wrote: you can use this: *put*thehtmlTextofwidget"browser"intotT i use this now for an api which redirects to a php file which echoes a line of text (as normally it would use the URL scheme, but this does not work with the widget) this way i could use the browser widget and stay in the app(mobile) instead of using a external browser and retunring to the app afterwards which is an ugly thing and leaves the url open in an extenal browser. if the text in the browser is my text then it moves on(and i'm checking like 10 times) It works great! Op 7-4-2019 om 21:34 schreef J. Landman Gay via use-livecode: Is there a way to get/set selected text in a browser widget? I couldn't find anything. ___ 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: Browser selections
I was replying to you, JJS. I might be confused about how your method works. How does returning a line from the server allow hiliting text in the widget? On 4/9/19 12:33 PM, JJS via use-livecode wrote: Who are you referring to Jacque? hh or me? If it's me, then: i echo only one line of text with the php file which is called after the api routine succeeded. this way i can just look for that one sentence, it goes so fast you can't see it and the app switches to another card Op 8-4-2019 om 20:52 schreef J. Landman Gay via use-livecode: Actually, I need to hilite a portion of the text in the browser rather than just get the whole content. Are you doing that? Eventually I may need to get the user's drag-selection too, but not yet. On 4/8/19 12:22 PM, JJS via use-livecode wrote: you can use this: *put*thehtmlTextofwidget"browser"intotT i use this now for an api which redirects to a php file which echoes a line of text (as normally it would use the URL scheme, but this does not work with the widget) this way i could use the browser widget and stay in the app(mobile) instead of using a external browser and retunring to the app afterwards which is an ugly thing and leaves the url open in an extenal browser. if the text in the browser is my text then it moves on(and i'm checking like 10 times) It works great! Op 7-4-2019 om 21:34 schreef J. Landman Gay via use-livecode: Is there a way to get/set selected text in a browser widget? I couldn't find anything. ___ 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 -- 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: Browser selections
Who are you referring to Jacque? hh or me? If it's me, then: i echo only one line of text with the php file which is called after the api routine succeeded. this way i can just look for that one sentence, it goes so fast you can't see it and the app switches to another card Op 8-4-2019 om 20:52 schreef J. Landman Gay via use-livecode: Actually, I need to hilite a portion of the text in the browser rather than just get the whole content. Are you doing that? Eventually I may need to get the user's drag-selection too, but not yet. On 4/8/19 12:22 PM, JJS via use-livecode wrote: you can use this: *put*thehtmlTextofwidget"browser"intotT i use this now for an api which redirects to a php file which echoes a line of text (as normally it would use the URL scheme, but this does not work with the widget) this way i could use the browser widget and stay in the app(mobile) instead of using a external browser and retunring to the app afterwards which is an ugly thing and leaves the url open in an extenal browser. if the text in the browser is my text then it moves on(and i'm checking like 10 times) It works great! Op 7-4-2019 om 21:34 schreef J. Landman Gay via use-livecode: Is there a way to get/set selected text in a browser widget? I couldn't find anything. ___ 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: Browser selections
Actually, I need to hilite a portion of the text in the browser rather than just get the whole content. Are you doing that? Eventually I may need to get the user's drag-selection too, but not yet. On 4/8/19 12:22 PM, JJS via use-livecode wrote: you can use this: *put*thehtmlTextofwidget"browser"intotT i use this now for an api which redirects to a php file which echoes a line of text (as normally it would use the URL scheme, but this does not work with the widget) this way i could use the browser widget and stay in the app(mobile) instead of using a external browser and retunring to the app afterwards which is an ugly thing and leaves the url open in an extenal browser. if the text in the browser is my text then it moves on(and i'm checking like 10 times) It works great! Op 7-4-2019 om 21:34 schreef J. Landman Gay via use-livecode: Is there a way to get/set selected text in a browser widget? I couldn't find anything. ___ 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 -- 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: Browser selections
Thanks. I don't know JavaScript so it's a little over my head, but I'll try it. On 4/8/19 6:22 AM, hh via use-livecode wrote: (Getting the selection of a browser widget: Aee my previous post). Setting the selection of a browser widget: Assume you have an element click me in your webpage. Then the following selects char 1 to 4 of the link text (= "clic"). on mouseUp put "var node = document.getElementById('jlg1').firstChild;" & \ "var range = document.createRange();" & \ "range.setStart(node, 0); range.setEnd(node, 3);" & \ "var selection = window.getSelection();" & \ "selection.removeAllRanges(); selection.addRange(range);" into js do js in widget "Browser" end mouseUp Note that setStart and setEnd are zero-based in counting chars. ___ 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 -- 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: Browser selections
you can use this: *put*thehtmlTextofwidget"browser"intotT i use this now for an api which redirects to a php file which echoes a line of text (as normally it would use the URL scheme, but this does not work with the widget) this way i could use the browser widget and stay in the app(mobile) instead of using a external browser and retunring to the app afterwards which is an ugly thing and leaves the url open in an extenal browser. if the text in the browser is my text then it moves on(and i'm checking like 10 times) It works great! Op 7-4-2019 om 21:34 schreef J. Landman Gay via use-livecode: Is there a way to get/set selected text in a browser widget? I couldn't find anything. ___ 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: Browser selections
(Getting the selection of a browser widget: Aee my previous post). Setting the selection of a browser widget: Assume you have an element click me in your webpage. Then the following selects char 1 to 4 of the link text (= "clic"). on mouseUp put "var node = document.getElementById('jlg1').firstChild;" & \ "var range = document.createRange();" & \ "range.setStart(node, 0); range.setEnd(node, 3);" & \ "var selection = window.getSelection();" & \ "selection.removeAllRanges(); selection.addRange(range);" into js do js in widget "Browser" end mouseUp Note that setStart and setEnd are zero-based in counting chars. ___ 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: Browser selections
> Is there a way to get/set selected text in a browser widget? > I couldn't find anything. Why is the LC Builder forum not among your search places? With LC Script: No. With JavaScript. Yes. http://forums.livecode.com/viewtopic.php?p=174936#p174936 ___ 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
Browser selections
Is there a way to get/set selected text in a browser widget? I couldn't find anything. -- 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