I'm using Aloha editor for editing content on a website powered by PHP and MySQL. It's working fine, but I need to be able to insert images/pictures. I found an Aloha editor plugin for that. Here are some links:
- /
There is an example in the first link. However, I can't get the plugin running on the latest version of Aloha editor and jQuery. It fails to load and Chrome says:
image.js:30 Uncaught TypeError: Cannot read property 'fn' of undefined
I have no bloody clue what this means.
Ideally, the user should be able to select an image from a list of images that are on the server. These are located in a single directory and also have a MySQL table for them. I suspect this is where the repository es in, but I wasn't able to understand how to implement that.
Has anyone had any luck using this plugin in Aloha editor, or found any other ways of inserting images?
I'm using Aloha editor for editing content on a website powered by PHP and MySQL. It's working fine, but I need to be able to insert images/pictures. I found an Aloha editor plugin for that. Here are some links:
- http://labs.tapo-it./aloha-editor/image-plugin/
- http://aloha-editor/wiki/ImagePlugin
- https://github./alohaeditor/Aloha-Plugin-Image
There is an example in the first link. However, I can't get the plugin running on the latest version of Aloha editor and jQuery. It fails to load and Chrome says:
image.js:30 Uncaught TypeError: Cannot read property 'fn' of undefined
I have no bloody clue what this means.
Ideally, the user should be able to select an image from a list of images that are on the server. These are located in a single directory and also have a MySQL table for them. I suspect this is where the repository es in, but I wasn't able to understand how to implement that.
Has anyone had any luck using this plugin in Aloha editor, or found any other ways of inserting images?
Share Improve this question edited Oct 5, 2014 at 10:32 Zdeněk Gromnica asked May 31, 2011 at 15:56 Zdeněk GromnicaZdeněk Gromnica 8842 gold badges15 silver badges31 bronze badges 3- It says that the first plugin is only tested and built to work in firefox, so you might want to try the one from the second link. Ans you're right about the repository. You just have to implement the method GENTICS.Aloha.Repositories.<yourrepository>.query = function( p, callback) {vat that = this; ... fill data...callback.call(that, data); } You can find some more information on this wiki page: aloha-editor/wiki/Repository – csupnig Commented Jun 1, 2011 at 7:27
- Aloha, a good place for questions about Aloha Editor is github. There you'll get answers for technical questions .. github./alohaeditor/Aloha-Editor/issues – Klaus-M. Schremser Commented Jun 2, 2011 at 5:07
- 1 I did, I believe they're all the same plugin. As for the repository, would you have a working example? All I see on the wiki is a concept of what it should be and a huge list of attributes, which isn't really helping. – Zdeněk Gromnica Commented Jun 2, 2011 at 9:29
2 Answers
Reset to default 3A 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>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745252344a4618753.html
评论列表(0条)