inherit
259821
0
Nov 12, 2019 3:34:21 GMT -8
truerevelation
2
November 2019
truerevelation
|
Post by truerevelation on Nov 10, 2019 12:11:23 GMT -8
Hey all,
Is there any way to remove the preview tab from a site? We have been having issues with the preview tab breaking a lot of code, especially when someone goes back to edit one of their posts. At the very least, it'd be nice to switch BBCode to the default view for everyone on our site, but removing it altogether would be best.
Thanks!
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Nov 10, 2019 12:53:06 GMT -8
Hey all, Is there any way to remove the preview tab from a site? We have been having issues with the preview tab breaking a lot of code, especially when someone goes back to edit one of their posts. At the very least, it'd be nice to switch BBCode to the default view for everyone on our site, but removing it altogether would be best. Thanks! Hi truerevelation Chris posted a script which can be placed in your Global Header. Disable the Preview Tab This will prevent all members of your forum from access to the Preview mode of the editor. The second comment in the script is both accurate and amusing. 🙂
|
|
inherit
259821
0
Nov 12, 2019 3:34:21 GMT -8
truerevelation
2
November 2019
truerevelation
|
Post by truerevelation on Nov 12, 2019 3:19:36 GMT -8
Thanks Retread!
That has worked pretty well for fixing this. And you're right, that comment fits way too well.
Follow-up question though: Adding that code has made it so that when going back to edit a post, actual line breaks are replaced with , which condenses the coding and makes it pretty cluttered. Is there any way to fix this as well?
Thanks again for the help!
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Nov 12, 2019 7:57:41 GMT -8
Adding that code has made it so that when going back to edit a post, actual line breaks are replaced with , which condenses the coding and makes it pretty cluttered. Is there any way to fix this as well? Later today, I'll put that code in the Global Header of my test forum and take a look but I don't have a tenth of the skill with js that Chris does, so we'll probably need to get him or some other heavy-hitter involved.
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,858
December 2005
horace
|
Post by Chris on Nov 12, 2019 9:49:43 GMT -8
Adding that code has made it so that when going back to edit a post, actual line breaks are replaced with , which condenses the coding and makes it pretty cluttered. Is there any way to fix this as well? The code does not manipulate content. If you remove the code you will see that it isn't the code that does that condensing but rather an idiosyncrasy of the current WYSIWYG editor that has had numerous threads created about the problem. A properly formatted table for example will become jumbled 1 upon subsequent visits when using the BBCode tab. It is because of this that the upcoming Proboards V6 has scrapped this current V5 editor for a more tried and true froala editor which does not exhibit such problems GooRoo , as a workaround for the specific problem you mentioned (tables), you could insert the following template on the Translate tab of the BBCode Factory Plugin to automatically pretty print tables on the BBCode tab of the editor: Tag Name Field: table|tbody|tr|td|th|tfoot|thead $[directive.reuse-for-all-endtags] $[directive.strict-space] $[directive.phase-set] $[directive.mode-bbcode] $[tag.comment. ******************************************** Format bbcode tables for easier editing ******************************************** ]
{if $[tag.name]=="td" || $[tag.name]=="th"} {if !$[tag.closed]}
{/if} $[tag.match] {else} {if $[tag.name]=="tr" || $[tag.name]=="thead" || $[tag.name]=="tfoot"} 
$[tag.match] {else} {if $[tag.name]=="table"} {if $[tag.closed] != "1"}

{/if}$[tag.match] {/if} {if $[tag.name]=="tbody"} {if $[tag.closed]}
{/if}$[tag.match] {/if} {/if} {/if} SSSHHHHH this code might not be LEGAL! <script type="text/javascript"> /* Disable Preview Tab on Proboards V5 (Global Header)*/ /* WARNING: Dictator MOD - not suitable for tree hugging freedom lovers */ (function(fn){ var W = fn.wysiwyg.prototype._create; fn.wysiwyg.prototype._create = function(){ //force bbcode editor upon WYSIWYG load this.options.defaultEditor = 'bbcode'; //call original from within hook W.apply(this, arguments); //hide the preview tab $('#menu-item-visual').hide(); //disable keyboard shortcuts to prevent switching using keyboard proboards.hotkeys.wysiwyg = $.noop; //a delegate handler also exists on document for the shortcut so step on that too $.each($(document).data('events').keydown, function( kdi, evh){ var f = evh.handler.toString(); if(/\#menu\-item\-bbcode\s+a/.test(f)){ evh.originalHandler = evh.handler; evh.handler = $.noop; return false; } }) } })(jQuery.ui); </script> For those who prefer to edit tables on the BBCode tab it can be daunting with table editing now geared towards table edits occurring exclusively on the preview tab with representations on the BBCode tab "mashed together" and made illegible. The BBCode Template aims to correct this and make tables once agin legible on the BBCode tab DISCLAIMER: this is a "beta" plugin and requires further testing by the community at large before being certified as prime time ready
|
|