|
Pasting into the Editor
One of the features that has generated a lot of debate and suggestions is the way we handle text, HTML and code in the forums. Copying and pasting code - especially web related code - into the message editor can cause problems due to the unintentional posting of HTML tags instead of HTML encoded content.
To help with this we had "When Pasting" options at the bottom of the message posting area that allow you to set defaults on what happens when you paste, but what you want to do changes depending on what you paste. The problem here is that you defaults don't always fit the situation at hand, so we need a way to allow you to change your mind easily.
From today we removed the paste options from below the message and instead show a popup dialog that intercepts the pasted content and tries to figure out what your options are with visual aids to help show what each option will do. The "When pasting" that apply to the paste text are shown in this dialog, and as you hover over each option the pasted text in the message text area is updated, as well as a small preview in the paste dialog to give you a quick peek into what it will look like. If you are pasting text that will look the same whether you're pasting as text or HTML (or mixed) then the options shown are reduced to the minimum set possible, and your default setting will be automatically checked and always shown.
On top of this, as you type, a preview of what your message will look like is now shown at the bottom of the page.
If, after pasting, you are happy with what's shown, or don't want to be bothered, keep typing. The dialog will fade away. This is not the popup dialog you are searching for...
The changes are designed not to simply show you what will happen, but also to give you an ida on how to encode your content to ensure it displays in the manner you intend. The changes are also meant to be as unobtrusive as possible, and text will be pasted initially as per your defaults. We're only adding a simple way to change your mind.
For those who never pick a default, and never touch the popup dialog, the default will always be "Best guess" meaning if it detects code in the pasted text it will wrap in PRE tags, otherwise it will paste and preserve HTML tags (no encoding on paste).
Encode button in the editor
We spared no expense in adding an "encode" button. Highlight some HTML, hit encode, and the text is HTML encoded.
Editor Live preview
As you type, your message is now displayed full formatted under the text area. We're using Ajax callbacks to do the formatting because reworking our content formatting system into Javascript is a luxury we don't have at the moment. Further, our colourisation code does far more than any of the current Javascript offerings in terms of handling nested languages (eg Javascript or C# inside a ASP.NET page). We'd rather have a half second delay in update and show it perfectly than have the frustration of it not being quite right.
Content caching
Hopefully you waon't even notice (unless it's in a good way) but more content is being pre-cached, speeding up some of our lesser-used pages.
Split Quick Answers / Discussions menus
As requested.
More admin options
We've armed ourselves with some bigger guns to deal with reported items. Don't worry, this won't hurt a bit.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Thanks a lot Chris...
The man who makes no mistakes does not usually make anything. ~Edward Phelps
Man's wisest mistake: Marriage. ~ Suresh Suthar
|
|
|
|
|
Chris Maunder wrote: We've armed ourselves with some bigger guns to deal with reported items. Don't worry, this won't hurt a bit.
Name anything after JSOP?
Martin Fowler wrote: Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
Chris Maunder wrote: More admin options
We've armed ourselves with some bigger guns to deal with reported items. Don't worry, this won't hurt a bit.
Does this mean that we no longer need to post spam accounts/trolls on the site sugs and bugs?
Signature construction in progress. Sorry for the inconvenience.
|
|
|
|
|
Publicising the names allows people to quickly hit the "report" button and nuke them.
What I think we need is a spammer forum, though.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Chris Maunder wrote: What I think we need is a spammer forum
I see it now. And I like it. Thanks Chris.
Signature construction in progress. Sorry for the inconvenience.
|
|
|
|