Hello, there is a closed issue with no answer so i decided to ask you.

I dont have any idea how to do this...

I want to setup limit to 470 x 270px and i dont want to let user to choose dimensions...

Can someone help me? I really need this.

Thank you very much!!!

Comments

ufku’s picture

Assigned: WEBstar » Unassigned
Priority: Critical » Normal

Here is the default image dialog with width&height validation. Note that it's just a js validation and does not prevent user from changing the values after the html is inserted into the textarea.

js:
var form = [
 {name: 'src', title: 'Image URL', required: true, suffix: E.imce.button('attr_src')},
 {name: 'width', title: 'Width x Height', suffix: ' x ', getnext: true, attributes: {size: 3}},
 {name: 'height', attributes: {size: 3}},
 {name: 'alt', title: 'Alternative text', required: true}
];
E.tagDialog('img', form, {title: 'Insert/edit image', validate: function(tag, form){
  var els = form.elements;
  if (els.attr_width.value > 470 || els.attr_height.value > 270) {
    alert('Image size can not be greater than 470x270.');
    return false;
  }
  return true;
}});
WEBstar’s picture

Ok, thank you very much!

Is it possible now to add lightbox class to a image:

rel="lightbox" , not trough form, i want it to show without form, to be there after inserting image...

Thank you very much on this!!!

ufku’s picture

Status: Active » Fixed

You may find it by searching previous issues. It was answered before.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.