Setting hidden of lines very slow
Kaveh Bazargan
kaveh at rivervalleytechnologies.com
Sat Dec 1 05:21:56 EST 2018
Hi all
I have learned a lot here, especially the hint of using styledText. But
there might be a misunderstanding. In my case, it is not necessarily the
whole line that is styled, but a line might *contain* a chunk of text that
is styled, e.g. one word in the middle of the line has textcolor set. So I
am looking to hide any line that contains no textcolor anywhere.
Trevors code contains:
...
if tTextA[i]["runs"][1]["style"]["textcolor"] is not empty then
...
If I understand correctly the ['runs'][1] is looking at the first element
of that line. I need to check that no other elements in the line are styled
either. Before I write a loop that is slow again, any quick way of checking
for a line with no style anywhere?
Thanks all for the great contributions.
K
On Fri, 30 Nov 2018 at 20:17, Richard Gaskin via use-livecode <
use-livecode at lists.runrev.com> wrote:
> Kaveh wrote:
> > Now how many lines of JavaScript would that be? ;-)
>
> The equivalent of chunk expressions are ridiculously verbose in JS, but
> this one's not bad:
>
> getElementById("id").removeAttribute("style");
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> Ambassador at FourthWorld.com http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
More information about the use-livecode
mailing list