Tool for "unformatting"

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
phg
Posts: 63
Joined: Tue Nov 24, 2009 5:58 pm
Location: Berlin
Contact:

Tool for "unformatting"

Post by phg » Thu Jan 28, 2010 9:24 am

Hi all,

yesterday in the evening I had a long discussion with my customer. (You have heard of him :o ) And I am shocked :shock: .Hios content.htm is about 800 kB.

Because he thinks, that he is an Expert in WORD he thougth, that FCKeditor should do things like WORD.
He didn't checked for what CSS can be used.
In the Stylesheet of his template is defined:
body,td,p {
font-family:Verdana,Arial,Helvetica,sans-serif;font-size:9pt;
}
But he wants to have font-size: 8pt;
And so, in each table cell and very often in the running text, you can find
<p><span style="font-size: small;"><span style="font-family: Verdana;">K&ouml;rperhaltung</span></span></p>

And now, its to late, to change the Stylesheet, because that will have effect only for the futere.

You can imagine: I am fully horrified.

First question: I think, it should be aesy with preg_replace to kill the two spans. But because I am always struggling with regular expressions (and most times I loose). Is there an Expert, who can give me the code?

Second question: I think, this will happen very often. Should it be a good idea, to write a tool for "unformatting" this formatting. Will it be simple and safe in using?

Third question: I dont know how, but I think, it will be nice, always to see, which font is active. Instead of the empty comboboxes. I am not sure, if it is poosible and if it is a goog idea.

Thanks for help

phg

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Tool for "unformatting"

Post by Tata » Thu Jan 28, 2010 9:46 am

Unformat (or better "Remove Word formating") is included in FCKEditor already. But I alsoo had a problem on the beginning using this function. It shall be used like this:
1. Copy from Word
2. Click the "W" icon and check Remove formating. Only the paragraphs remain kept.
Or there is also "T" icon for inserting whatever as a plain text. Then the formating shall be done with FCKEDitor's functions.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Tool for "unformatting"

Post by Holger » Thu Jan 28, 2010 10:02 am

Hi,
phg wrote:First question: I think, it should be aesy with preg_replace to kill the two spans.
Hmm, a simple search and replace should be fine too.
Tata wrote:Unformat (or better "Remove Word formating") is included in FCKEditor already.
Just as a hint: that's not working with every browser. Be sure to check if it's working with your browser.

I use PureText to remove formatting: no problems at all.
http://stevemiller.net/puretext/

Holger

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Tool for "unformatting"

Post by Tata » Thu Jan 28, 2010 10:47 am

Holger wrote:Just as a hint: that's not working with every browser. Be sure to check if it's working with your browser.
I use PureText to remove formatting: no problems at all. http://stevemiller.net/puretext/Holger
It works both in IE8 and in the latest FF. Not tested with Safari or Opera.
I also used puretext. But since there was this Unformat fnction available, I don't use it anymore. But it's also a way how to unformat.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

phg
Posts: 63
Joined: Tue Nov 24, 2009 5:58 pm
Location: Berlin
Contact:

Re: Tool for "unformatting"

Post by phg » Thu Jan 28, 2010 12:11 pm

Hi Tata, Hi Holger,

no, thats not the thing I want. My customer will not loose the complete formatting.
BTW: He copied most from Word-Files. But I told him, to save in Word as Text only and then copy and paste. It was functioning perfect. All other tools we tried had problems.

Now we will only remove the special formatting for font-size: small; and font-family:Verdana. Because that formatting will be done by the Stylesheet.

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Tool for "unformatting"

Post by Holger » Thu Jan 28, 2010 12:14 pm

Hmm, maybe Word should be the better CMS for your customer :mrgreen:

Holger

phg
Posts: 63
Joined: Tue Nov 24, 2009 5:58 pm
Location: Berlin
Contact:

Re: Tool for "unformatting"

Post by phg » Thu Jan 28, 2010 12:33 pm

Ok Holger,

I love your sarcasm, but you are not right. At all, my customer is enthusiastic about cmsimple.

If you like, look, what he has done:

http://www.drzeplin.de
http://www.fuehrungstipps.de
http://www.controlling4nachhaltigkeit.de

and as his playground/under construction

http://www.drzeplin.com/wastun

I do not stand always behind his content and the formatting, but I think: It is a lot since beginning of the year.
And he never uses html/css

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Tool for "unformatting"

Post by Tata » Thu Jan 28, 2010 12:47 pm

Well, this is but so special requirements from your customer, that it is not worth to change anything within CMSimple. CMSimple has its very own rules. And basically web editting has nothing to do with usin of Word written sources. This must understand simply each CMSimple (or any other CMS user).
It has to be considered by each user that:
* CMS has its own formating rules and tools
* Web editting is absolutely different from Office docs editting
* Internet is something absolutely different from any pritable document
And then the user has to decide what he would prefer - artificial documents or online accessible and dynamically changible information; beautiful styled documents or fast and in real time actualized information.
I also know directors, who would like to see tricksful presentations of their own firm. There it runs fst (and they simply can't understand that it is fast because of reading from cache). And they also do not accept that online it may take 10x longer, so the visitors will never return to such website.). They do - and don't want to - understand what is the source code and how much of everythig-wasting information is there only because of their dummy requirements. I decline to make websites for them...
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Tool for "unformatting"

Post by Holger » Thu Jan 28, 2010 2:24 pm

phg wrote:I love your sarcasm
Hey thx Horst! So I'll keep it ;) .

Holger

phg
Posts: 63
Joined: Tue Nov 24, 2009 5:58 pm
Location: Berlin
Contact:

Re: Tool for "unformatting"

Post by phg » Sat Jan 30, 2010 7:01 pm

Hello,

now I wrote a little php-program, which does the unformatting: I tell him, which HTML-Tags should be cleared like

clear('<span style="font-family: Verdana;">');
clear('<span style="font-size: small;">');

it deletes them and the corresponding </span>. (<spans> may be nested!)

Before the content.htm was 815 kB, now it is 631 kB

Because all your customers are very well trained and will not do such chaotic things as mine, you do not need this little program ;)
If suddenly such a customer arises :( : If you send me a mail, I will mail you that program. :lol:

phg

Post Reply