Page 1 of 1

Importing and editing text in a field...

Posted: Fri Feb 20, 2015 3:31 am
by LndRvr
What is the easiest way to import some text to a field and then be able to edit font/size/color? The field would just be text for the user to read. No action is required. I have imported via Controls but I can't edit.

Also, can I import the HTML for the text so that colors and fonts are exactly like the webpage that I am getting the text? Basically, I am creating a mobile version of a website. Maybe there is an easy way to do this. Lastly, I assume that if a website is accessed via a mobile device, the mobile device can "chose" a mobile display of the HTML. Correct?

Any guidance on these issues is much appreciated. It seems that I remember reading about using a substack to save the text for display in the stack.

Thanks in advance for your help!

Re: Creating and Editing a Text card...

Posted: Fri Feb 20, 2015 4:11 am
by Simon
Hi LndRvr,
Check out HTMLText in the dictionary for the supported tags.

For simple pages go get this, it'll help a lot
http://forums.livecode.com/viewtopic.ph ... es#p100173

Code: Select all

on mouseUp
set the HTMLText of field "myField" to --pasted stuff
end mouseUp
Now with that you can use whatever HTML editor you like and just create the page, then copy the HTML (get rid of all the "<!DOCTYPE html PUBLIC ..." stuff) and paste it into that thing hit the button and Presto!

Oh, all that tool does is convert the quotes to work in liveCode you might not need it.
Bad <a href="http://mySite.com/index.html">
Good "<a href="&quote&"http://mySite.com/index.html"&quote&">"

OK Found Klaus's method:

Code: Select all

function q theString
  return QUOTE & theString & QUOTE
end q
That may fit your style better

Simon

Re: Importing and editing text in a field...

Posted: Fri Feb 20, 2015 4:13 am
by Simon
ooops, please don't double post :)
We can stick with this one
http://forums.livecode.com/viewtopic.php?f=4&t=23286

Simon

Re: Importing and editing text in a field...

Posted: Fri Feb 20, 2015 4:15 am
by LndRvr
yeah, I first posted in the "announcements" by accident. Sorry for the double post.

Re: Importing and editing text in a field...

Posted: Fri Feb 20, 2015 4:59 am
by FourthWorld
This is the better location - threads merged here.

Re: Importing and editing text in a field...

Posted: Fri Feb 20, 2015 5:56 pm
by jiml
Also, can I import the HTML for the text so that colors and fonts are exactly like the webpage that I am getting the text? Basically, I am creating a mobile version of a website. Maybe there is an easy way to do this.
Why not just use a mobile browser control? Then the webpage will be displayed just as a browser would display it.
Lastly, I assume that if a website is accessed via a mobile device, the mobile device can "chose" a mobile display of the HTML. Correct?
Yes, if the page is designed to be 'responsive'.

Jim Lambert

Re: Importing and editing text in a field...

Posted: Sat Feb 21, 2015 1:54 am
by LndRvr
Jim,

How would I know if a website is "responsive"?

Will (LndRvr)

Re: Importing and editing text in a field...

Posted: Sat Feb 21, 2015 6:00 pm
by jiml
Looking at a webpage on a desktop browser then on a mobile device is one way to check.
http://en.wikipedia.org/wiki/Responsive_web_design