tags:

views:

75

answers:

2

Has anyone succeeded to do this?

A: 

Add a button to the control panel of WMD.
Search for the following string to find the place where buttons are being added: italicButton.XShift
In my version, the function is in class SpritedButtonRow and is called build.

Ignore the setup and textOp attributes. XShift is the position of the button image in the css sprite that comes with WMD, Instead of that, give the button a class and in the class specify the background image. Then Just add an onclick event to the button that will do what you need it to do.
But, I don't think an upload button should be inside a text editor, does not make sense.

Itay Moav
+1  A: 

I accomplished this by replacing Util.prompt with my own jquery.dialog method. The prompt function takes a parameter as a callback, making it easy to create a drop-in replacement.

if (isImage) {
    // OLD: util.prompt(imageDialogText, imageDefaultText, makeLinkMarkdown);
    // WMD_IMAGE_GALLERY_URL loaded from a global settings elsewhere
    util.imageGallery(WMD_IMAGE_GALLERY_URL, makeLinkMarkdown);
}
else {
    util.prompt(linkDialogText, linkDefaultText, makeLinkMarkdown);
}

If you're interested, I wrote a blog entry about it (with pictures!) which has some more sample code as well as some of the problems/solutions I encountered in implementing this.

T. Stone
can i get the code for it... :)
Junaid Saeed