Is it possible to have the WYSIWYG editor open, and expanded when a user edits a page, so that they don't have to click on the green icon, or inside the body to activate it?
We have a news item asset builder, and want the WYSIWYG expanded on page load.
There is no option, but I'm sure you could add some JS to do the click for you.
I've used some js to simulate a mouse click event on wysiwyg divs.
function autoclick(){
var me = document.getElementsByTagName("img");
for (var i in me) {
if (me[i].alt == "[Edit Contents]") {
me[i].onclick();
}
}
}Then I use addload to trigger it onload.
addLoadEvent(function() {
autoclick();
})
[quote]I've used some js to simulate a mouse click event on wysiwyg divs.
function autoclick(){
var me = document.getElementsByTagName("img");
for (var i in me) {
if (me[i].alt == "[Edit Contents]") {
me[i].onclick();
}
}
}Then I use addload to trigger it onload.
addLoadEvent(function() {
autoclick();
})[/quote]Hey Aleks, I must be missing something here, as I am not getting it to work. Where are you placing these js snippets?
inside the layout for edit contents
I guess this js won't work for us, as I am trying to expand a WYSIWYG in the asset builder, and the image that this script is looking for is actualy the background image inside a div, and it has no id, so it seemingly hard to target it.
Can you wrap it in another div?
I don't think so, this is embedded farther down in the WYSIWYG divs. How is yours different from ours?
We're not using a wysiwyg in our builders, can you paste a screenshot and the source code of the page?
Sure, I have attached a zipped html file of one of the pages that I am using the WYSIWYG. I have also included a screen shot.
[attachment=270:Picture_1.png] Picture_1.png (55.2 KB)
What you could do is modify autoclick to 'onclick' every DIV within <div class="description"> or in the form, it's a bit dodgy but should work.
Thanks! I will give this a go.