Skip to main content
Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes Started by emanuele · · Read 24485 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic - Topic derived from ElkArte 1.0 Release Candidate...

Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

We are almost at mid-march, but TBH I'm not sure the code is at RC level... :-(

At the moment there are still 2 "real" issues marked as blocker:
https://github.com/elkarte/Elkarte/issues/1400
https://github.com/elkarte/Elkarte/issues/1274
Of the other three one if fixed, one is a placeholder and the third is fixed (the German translation with fixes for the English text), but still open for reference.
1274 is easily "workaroundable" (flipping to the left).
1400 is a bit more tricky and TBH I'm not sure how to fix it. It looks like SCEditor "eats" tabs if they are present in the HTML of the textarea, and if the tabs are not into a code block they are replaced with spaces as well.

Then there are some bugs reported in bug reports that have to be fixed (i.e. almost all those reported by @scripple ).
So maybe end of march becomes a good date for RC instead of final... :(
Oh well, a couple of weeks more. :P
Bugs creator.
Features destroyer.
Template killer.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #1

No problem. I know how much work you people put on it.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #2

Sorry for pushing your schedule back, but bug hunting is part of what betas are for right?

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #3

On 1400, I notice that if I use the "insert quote" buttons on the posts below the editor box that it correctly preserves tabs inside of code boxes when calling the insert function on the sceditor.  Could you not insert the original preview code the same way the insert quote button works?  Render it the same way quotefast does and then insert it into the box the way onDocReceived does?

This does still shift tabs into spaces outside of code tags, but it's perhaps a start.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #4

Oddly enough if you have wysiwyg mode enabled and use quick reply with a code section with tabs they will go through to sceditor correctly.  And you can then push the show source button to go back and forth from source and wysiwyg mode and the tabs remain.   But calling setTextMode (or calling sceditor's sourceMode(true) at the time you do somehow causes the tabs to get lost.  Not sure if it's an sceditor bug or something to do with the elkarte plugins but it's definitely timing sensitive.

And the reason tabs live on in code blocks (when it works) and nowhere else is here in bbcode.js from sceditor

Code: [Select]
						if($node.parents('code').length === 0)
ret += node.wholeText.replace(/ +/g, " ");
else
ret += node.wholeText;

So if you really want tabs to live on everywhere you can deliver a modified version of bbcode.js that doesn't replace all whitespace with spaces.
Last Edit: March 15, 2014, 01:54:33 am by scripple

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #5

Well if anyone wants to pick this up I've traced the difference to bbcode.js    base.signalToSource = function(html, $body) when it calls $.sceditor.dom.removeWhiteSpace($body[0]) which sets off some recursive white space removal.

For some reason this recursion isn't the same depending on whether the wysiwyg to source conversion is done right at creation (like when wysiwyg is off by default in user settings) versus manually clicking the view source button after the page is 100% loaded.

Maybe this will help someone spot what's causing the difference.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #6

Quote from: scripple – Sorry for pushing your schedule back, but bug hunting is part of what betas are for right?
Better push it, than send out a broken script!
You are doing a great work of testing! :D
Bugs creator.
Features destroyer.
Template killer.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #7

Thanks on the testing.  Glad to help.

On the quick reply to sceditor eats tabs in code blocks.  It's caused by the style not being applied by the time the conversion from bbcode -> wysiwyg -> source is handled.  (Most importantly the part where it goes back to source.)  So the elkarte code {white-space: pre;} is not being honored.  I edited jquery.sceditor.js (I'm working with unminimized copies pulled from the sceditor github page) and added a style sheet directly in the header to set white-space pre on code and now the tabs are maintained whether I start in wysiwyg mode or source mode.

Is this helpful to you?  Or should I stop?

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #8

Ok, here's a proposed fix for quotes in code blocks not surviving clicking preview from quick reply when using the sceditor in text mode.

in themes/default/GenericControlsTemplate.php make the following change.

Code: (original) [Select]
        $(".sceditor-container").width("100%").height("100%");', $editor_context['rich_active'] ? '' : '
        $("#' . $editor_id . '").data("sceditor").setTextMode();', '

Code: (fix) [Select]
        $(".sceditor-container").width("100%").height("100%");', $editor_context['rich_active'] ? '' : '
        $("#' . $editor_id . '").data("sceditor").css(\'code {white-space: pre;}\');
        $("#' . $editor_id . '").data("sceditor").setTextMode();', '

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #9

Nice debugging and fix :D

Looks like that works very well.  We were exploring passing the original post data to setTextMode() so it would populate the editor box when you swap to the post screen from quick reply.  That also seems to work although its a few more edits.  So far I've only seen code blocks affected so your fix may be the best one to use.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #10

Inserting directly into source mode would work too.  I just got curious as to what the difference was.  Also if you want to save some space you can ditch your setTextMode function and just use the sourceMode(true) call built into sceditor.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #11

Thanks, and indeed we have some left over helper functions that have since been added to sceditor that we could make use of !


Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #13

TBH, I was wondering: go directly with an RC or release a beta3?
Recently, thanks to @scripple and @AaronB reports I realised there are still several buglets around that may or may not be annoying depending how the script is used.
I think that if we were to release Elkarte 1.0 today it may not really be up to a "stable" release and it wouldn't be nice.
On the other hand, we could try to use a "slightly" different release schedule for micro updates (i.e. 1.0.X versions), like monthly if we can setup an easy way (e.g. instead of a "patch", directly replace the files, that would also encourage further the use of hooks instead of code edits), but that's just some random thought while writing, so it may have several drawbacks... :-(
Bugs creator.
Features destroyer.
Template killer.

Re: Grumbling about bugs - Was: [WIP] ElkArte 1.0 Release Candidate 1 - release notes

Reply #14

Release often and push hard use of plugins