Aloha editor: Inserting images/pictures

落爺英雄遲暮 提交于 2019-12-03 15:23:40
Michaël Perrin

A bit too late, but if you need I made a simple plugin for Aloha Editor to insert / upload an image. This plugin is part of my symfony 1.x plugin to easily integrate Aloha in a Symfony app.

This is the source of the Symfony plugin.

And here is my image insert / upload plugin.

It's really simple, and it could probably improved. It doesn't use a file repository on the server side as you expect, so this is only answering to your "any other ways of inserting images" of your question.

I wrote this for another editor to post in pictures. Far from perfect but it should work. You should only need to change the .te to your editors iframe

    $SQL = "SELECT * FROM PHOTO_GALLERY";
    $result = mysql_query( $SQL );
    while( $row = mysql_fetch_array( $result ) ) {
    $photo_id = $row["photo_id"];
    $photo = $row["photo"];
    $photo_name = $row["photo_name"];

 $picture = "<img alt='$photo_name' title='$photo_name' src='http://$domain/$photo'>";

echo '<span style="cursor:pointer" class="picture_'.$photo_id.'"><img title="Click to add image" alt="'.$photo_name.'" height="50" src="/'.$photo.'" width="50"/></span>


< script>
 $(document).ready(function(){
$(".picture_'.$photo_id.'").click(function() {
$(".te").contents().find("body").append("'.$picture.'");
});
});
< /script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!