r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Web] Everything web development related

Geomol
28-May-2006
[1181x2]
I don't think, you can force a wrap at a certain place. It's in the 
nature of HTML, as it's not wysiwyg.
From http://www.w3.org/TR/REC-html32

A few user agents support the WIDTH attribute. It provides a hint 
to the user agent of the required width in characters. The user agent 
can use this to select an appropriate font size or to indent the 
content appropriately.

It's not the width of the line.
DideC
28-May-2006
[1183]
I have tried Width, but it only shrinks the box, not the text inside 
(almoast on FF).
Odd OMO.
Sunanda
28-May-2006
[1184]
<pre> literally means "as written" -- if there are no line breaks 
in the text, then there will be none on the page.
***

Some lines in <pre> tags can be accidently enormously long, and need 
to be wrapped by hand.

That's one reason REBOL.org offers you a user-setting for the point 
at which you want Mailing list messages to be forcibly wrapped:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/cpt-update-profile.r

(See Appearance and settings / Point at which Mailing List Archive 
messages will start to wrap.)
[unknown: 9]
28-May-2006
[1185x2]
Dideir, yeah we ran into this recently in allowing people to escape 
code inside our Wiki.  We allow Rebol, HTML, etc.

At first it seems counter intuitive. But this is the way of HTML.


Aside from the straight forward concept as Sunanda mentioned, if 
you are willing to process the code a little you can count the characters 
of the longest line, and scale the text to match the final output. 
 A couple of points dropped on a font stil are readable, and many 
sentences still fit.


Another is to encode the whole thing, in other words convert all 
the "<" for example to escape sequences.  Now HTML will wrap everything 
automatically.
Doh..."Didier" (I was tricked by looking at DideC).
Sunanda
28-May-2006
[1187]
Your other alternative is to use the CSS  overflow propery
eg 
pre {overflow: auto} or overflow:scroll
The problem there is the inconsistency between browsers......

Good ones will add scroll bars only when needed. Common and bad ones 
will add horizontal and vertical scroll bars at all times for every 
pre box.  It's ugly.
BrianH
28-May-2006
[1188]
You can specify overflow-y and overflow-x separately if you prefer.
Chris
29-May-2006
[1189]
Bad ones = Internet Explorer.  Even version 7 they haven't really 
figured out how most people use overflow: auto.  Oneliners become 
unreadable.
[unknown: 9]
29-May-2006
[1190]
Yup.
DideC
29-May-2006
[1191x2]
I have tried "Overflow: auto" (I just had a look to makedoc anywhere 
result to see how it handles that),
but fall on the I.E. inconsistency.
So in conclusion, there is nothing simply usable in the browser(s), 
I have to cut the line "myself".
F..k !!
[unknown: 9]
29-May-2006
[1193x2]
Yup.
In Qtask we autocut strings loner than X spaces so that webpages 
don't  get screwed up.  Slashdot does the same/
Alek_K
29-May-2006
[1195]
Well - there is property in CSS - 3 - but add this in style
pre {
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
}
http://myy.helia.fi/~karte/pre-wrap-css3-mozilla-opera-ie.html
Allen
29-May-2006
[1196]
Another option is to show in a textarea and set the rows & columns
DideC
29-May-2006
[1197]
Alek : I will try that this evening.
Pekr
19-Jul-2006
[1198x2]
one question re CSS. I have small template, where I put two images 
one under the other. You can look at http://www.xidys.com/hanka. 
But I will need to cut some images, and that fact destroys aspect 
ratio for me :-) I would like to ask, if, in CSS, I can define image 
the way that it would not be scaled? My definition looks like:

.photo img {
    width: 614px;
    height: 460px;
}

and in html:


<div class="photo"><!--[obrazek 1]--><img src="obrazky/IMG_1361.JPG"/></div>
I would like to have something like a face, where you insert image 
top-left corner, but it uses aspect effect, that once it reaches 
particular width or height, it is drawn to the face, but the other 
axis stays as-is, so the aspect radio is kept correct. With above 
definition, it simply scales image to defined width-height, and I 
have to properly cut image in xnview, counting pixel ratios .... 
and that is very boring job :-)
Anton
19-Jul-2006
[1200]
http://rjohara.net/server/css-figures-captions/
Pekr
19-Jul-2006
[1201]
how do I align text under the image? I mean - image itself has some 
white-border in it. The text looks far too left. I would like to 
align block of text following the image to the center, but not align 
center text itself .....
Anton
19-Jul-2006
[1202x2]
The third image down has centred text on Firefox.
(on my Firefox anyway)
Alek_K
20-Jul-2006
[1204]
Pekr: 

1. I don't know if i understand correctly, but if You give only one 
size (f.e. width), image will be scaled with aspect ratio to that 
size. You can set .photo size too of course (so it will not ruin 
Your layout)

2. Text under the image - I can't identify the problem. Can You give 
a link to it?
Pekr
20-Jul-2006
[1205x4]
Alek - thanks, I am already done with the problem. As for 2, I just 
wanted to center text under the image. But whole text block, not 
centered text itself - http://www.xidys.com/hanka/T-XI.html
the text should be aligned to both sides, not centered. It is whole 
text block, which should be centered. http://www.xidys.com/hanka/F-VI-F-VII.html
Can't express myself :-)
|                                                                
               |
           |__________________________________|

                    |some text here some text here  so|
                    |me text here some text here some|
:-)
Gabriele
22-Jul-2006
[1209]
Petr: give the text container a fixed width, then set both left and 
right margins to "auto". this should center it.
Alek_K
24-Jul-2006
[1210]
Maybe You thinks about justify? Add to "text" style:
text-align: justify;
Josh
28-Jul-2006
[1211]
Not that it's incredibly important, but some the links on http://www.rebolforces.com/archive/index.html
are quite broken
Allen
30-Jul-2006
[1212]
yes. sadly lost a lot stuff when the previous host shut down in the 
same week as my hard-drive died. I had to retrieve what I could via 
the wayback machine, and too few CD backups.
Pekr
3-Aug-2006
[1213x2]
a question - I have Windows app in cp-1250 encoding. Then I generate 
some html, which is server from Linux. When I look in Mozilla at 
the page source (http://www.jablunkovsko.cz), the browser displays 
some czech chars encoded, e.g. &aacute. But when I save the page 
locally on my Windows machine, I get correct czech chars ...
could there be some code-page problems? Should I better "url-encode" 
special czech alphabet chars into some "universal" format?
Alek_K
3-Aug-2006
[1215]
I saved page locally, and have still &acute; I suppose it's fault 
 of WYSIWYG software made with english people in mind only (or not 
properly configured).

No need to encoding special chars this way if You have characters 
in declared encoding (that's what <meta http-equiv="Content-Type" 
for).
Pekr
3-Aug-2006
[1216]
thanks, Alek!
Sunanda
11-Sep-2006
[1217]
Anyone else getting their logon pages nibbled by botnets?

Here's some (failed) REBOL.org logons from yesterday. Format is attempted 
user-name (truncated to 12 characters) followed by IP address of 
the perp:
hvrkme6mailr 203.113.13.4
wjn4r55ebayc 203.113.13.4
jsyqbrvebayc 220.124.170.169
mnpwtrugmail 220.70.88.162
orf9a3aaltav 220.77.210.71
lcfu7h2searc 217.10.190.36
djspeememail 211.170.204.237
zdgnhb9hotma 211.48.29.27
aown600micro 59.6.92.19


It seems sad that the level of intelligence of malicious bot writers 
is so low. I blame TV.
Ladislav
11-Sep-2006
[1218x2]
what would you say if the perpetrators "got through"? - I don't think 
intelligence is what is this about
or, maybe it is about intelligence, but then it actually does not 
matter whether they succeed or not, their intelligence is of the 
same nature for me
Anton
12-Sep-2006
[1220]
There are lots of desperate people out there.
Louis
19-Sep-2006
[1221]
Due to a very slow Internet connection, I need to make the FTP module 
of my website builder script more efficient so I don't send files 
unnecessarily. What I have in mind is:


1. Delete all the files in the website directory on my harddrive 
to eliminate all unused files.
2. Build the website to the website directory on my harddrive.

3. Download a list of the file names and creation dates from the 
website (all are in one directory).

4. Read the list of file names and creation dates from the directory 
on my harddrive (all are in the one directory mentioned in 2 above).

5. If a file is on the hard drive but not on the server, send it 
to the server.

6. If a file is on the server but not on the harddrive, delete the 
file on the server.

7. If a file on the harddrive is newer than a file on the server, 
send it to the server.


Has anyone already done this? Am I forgetting anything? Any pointers 
on how to do this?
MikeL
19-Sep-2006
[1222x2]
Hi Louis,
Sorry about the CRLF ..... you don't want to be checking the timestamps 
on the server with a slow connection. Just hold the last updated 
value locally and if it changes then transfer the file.  Same for 
deleting ... else you spend all of your time checking on the server 
over a slow connection.    You could check the timestamps or hash 
the local value ... then if  the hash value of the source changes, 
transfer the updated version.     There's some code to do some of 
this in build-sie.r  http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=build-site.r
 but it's a rebol-ish task.
Louis
19-Sep-2006
[1224]
Thanks, Mike. I'm studying the build-site.r code now.
Henrik
19-Sep-2006
[1225]
if you are on an unreliable or slow connection, you might experience 
timeouts which will in turn cause network errors. I recently worked 
on a similar system and you have to basically wrap all code that 
access the internet in TRY and do a lot of error trapping and possibly 
some retrying to ensure that uploads and downloads of entire filesets 
are done correctly. The code in build-site.r will not do that, so 
you have to restart the upload if it fails.
Graham
19-Sep-2006
[1226x4]
http://www.compkarori.com/reb/ftp-dirupload.r
should do most of what you want ...
4 years old though.
No date checking on files .. only size checking.
Louis
19-Sep-2006
[1230]
Thanks, Henrik and Graham.