[RFC] Javascript Preview

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
naim
Registered User
Posts: 50
Joined: Thu Oct 13, 2011 7:21 pm
Location: Isolation
Contact:

[RFC] Javascript Preview

Post by naim »

Hello to all,
I suggest to add to phpBB a Javascript enabled preview,
Instead of submitting the form to the server, just parse the bbcode with javascript and show the preview without waiting for the page to reload.
This will save both server load and time of the client.

At the same time, check content limitations (minimum length, maximum length, etc...)
User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Javascript Preview

Post by callumacrae »

-1, unless it used AJAX. It would involve implementing an entire BBCode engine client side, which probably wouldn't perform exactly the same.
Made by developers, for developers!
My blog
Senky
Extension Customisations
Extension Customisations
Posts: 315
Joined: Thu Jul 16, 2009 4:41 pm

Re: [RFC] Javascript Preview

Post by Senky »

+1

I have already been working on one preview parser parsing BBCodes (tribalwars ingame messages) and JavaScript is just enough to parse all available BBCodes. Also custom BBCodes created by user though ACP would not be problematic, I think.

I cannot see any problem with any BBCode. Maybe

Code: Select all

 could be quite problematic using parameter (ie. [code=php]) - this would force us to implement also JS-powered syntax highlighter (but there are [url=http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/]tons[/url] of them). However, I cannot see any other BBCode problematic...
User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Javascript Preview

Post by MichaelC »

-1. A rich text editor (WYSIWYG editor) is being developed for 3.2 and as such this would be made obsolete.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.
User avatar
naim
Registered User
Posts: 50
Joined: Thu Oct 13, 2011 7:21 pm
Location: Isolation
Contact:

Re: [RFC] Javascript Preview

Post by naim »

I didn't see progress in the WYSIWYG editor for over 3 months,
this wouldn't take long to develop. It would act exactly the same (without AJAX) if javascript is implemented correctly.
Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Javascript Preview

Post by Oleg »

This proposal would require reimplementing our bbcode parser in javascript, or am I missing something?
User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Javascript Preview

Post by imkingdavid »

Oleg wrote:This proposal would require reimplementing our bbcode parser in javascript, or am I missing something?
No, you're right, unless it's done by AJAX which would continually be sending requests to the PHP bbcode parser after each character is typed.

IMO, let's stick with the WYSIWYG. Someone is working on that right now.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.
User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Javascript Preview

Post by MichaelC »

1) Its a GSoC Project
2) Someone else from phpBB wants to do it if it isn't done for GSoC
3) https://github.com/phpbb/phpbb3/pull/649
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.
User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

Re: [RFC] Javascript Preview

Post by jsebean »

Yes agreed stick with the current preview system phpBB has, with WYSIWYG coming I don't think this is necessary, just bloat.
-Jonah
User avatar
JoshyPHP
Registered User
Posts: 376
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC] Javascript Preview

Post by JoshyPHP »

imkingdavid wrote:AJAX [...] would continually be sending requests to the PHP bbcode parser after each character is typed.
I think the first post refers to a normal (one-off) preview, not a "live" preview.

As for the rest, while I'm not certain it would be a good idea for phpBB to implement a client-side preview, a RTE will not completely replace the preview function as many BBCodes would be too complex/costly (in terms of effort) to implement inside of a RTE.
callumacrae wrote:an entire BBCode engine client side [...] probably wouldn't perform exactly the same.
That also applies to RTEs though. A board's style may use <span> tags for bold while browsers may use a <b> or <strong> tag inside of their editor and it takes a lot of effort to normalize their markup. Ironically, the only actual WYSIWYG markup is the one you get by clicking "Preview" :lol:
Post Reply