ckeditor-ckfinder default attributes (width and height) to uploaded images

后端 未结 4 1523
名媛妹妹
名媛妹妹 2021-01-28 12:04

When I upload images using ckfinder in the ckeditor the image displays nicely using css width & height. I would like images to have default width and height attributes. How

4条回答
  •  伪装坚强ぢ
    2021-01-28 13:09

    In the image.js which is in plugins/image/dialogs folder of the CKEDITOR

    there are two lines:

    d&&d.setValue(b.$.width);
    e&&e.setValue(b.$.height);
    

    If you change b.$.width and b.$.height with numbers or null, you will have default values upon upload of any image size.

    For example:

    d&&d.setValue(600);
    e&&e.setValue(null);
    

    Will insert an image with 600px width and proportional height. Remember to duplicate your image.js before editing it.

提交回复
热议问题