MyBB Community Forums

Full Version: [1.8] How limit dimension of the images in WYSIWYG mode in Sceditor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ps. This only work with latest version of mybb 1.8 Beta 3 of Github
https://github.com/mybb/mybb/archive/feature.zip

Ps2. If need modification in final version of mybb 1.8 to this work, i will update this tutorial, donĀ“t worry.
Ps3. Plz, not request to me or send PM asking how to add buttons in the editor. I'll just ignore it. Please do not insist.

Image occupies space in the editor. If large image will occupy almost the whole area of the editor and complicating the visualization of that is writing.

To avoid this we can use CSS trick in the WYSIWYG mode.

1 - Edit root/jscripts/sceditor/jquery.sceditor.mybb.css

1.1 - Find

body {
	/* Needed for iOS scrolling bug fix */
	position: relative;
	overflow: auto;

	/* Needed so the cursor will be placed at the end of the content
	   when the there isn't enought content to fill the full viewport */
	min-height: 100%;

	word-wrap: break-word;

}

1.2 - Add after

img {
	max-height: 400px !important;
	max-width: 400px !important;
}

You can put another size instead of 400px.