You are not logged in.
Hi all,
I'm a junior web developer, for now I'm working on an CMS project using Xinha as the text editor. Recently, we want to add a new button in the tool bar to embed video codes into articles, I think it can be implemented as a new plug-in. Even I've hacked the insert link and image plug-in before, I find it is difficult for me to write a new plug-in by myself.
I'd like the new pug-in works like this:
1.click the button, pop up a new window with a textarea for inputing and a frame for preview video
2.after click the OK button, the video codes will be inserted into the article
3.an image will be displayed instead of the video while editing the article
4.change the position of the video by moving the image in the article
5.add right click menu for the image, same as the click the icon in the tool bar
6.while viewing the article in some pages, it will show the real video
Are there any guidelines or references for me somewhere? For now, I'm blocked in adding this image. How can I add such image?
Thanks!
rain
Offline
As for swapping between image and video, you could make your plugin have inwardHtml() and outwardHtml() methods, inwardHtml() takes html and converts it to what xinha works with (take your video, convert to image), outwardHtml() takes html and converts it to what you wan tin the end (take the image, convert to video).
Both deal with a plain html string, so you would use regular expression.
myPlugin.prototype.inwardHtml = function(html)
{
// change html to replace the video with picture
return html;
}
myPlugin.prototype.outwardHtml = function(html)
{
// change html to replace the picture with video
return html;
}
James Sleeman
Offline
Hi gogo,
Thanks for your quick reply! I will try it.
rain
Offline