[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kupu-dev
Subject:    Re: [kupu-dev] Re: Create custom button in the toolbar
From:       Thanh_Hải,_Hà <thanhhai.ha () gmail ! com>
Date:       2005-11-10 9:10:46
Message-ID: 6b40932f0511100110k3a1e9d59j () mail ! gmail ! com
[Download RAW message or body]

Hello,
 I had found this article posted by Guido on codespeak which describe how to
add buttons in Lenya. Tried in for Plone but i got stuck in step 4. I was
unable to locate <kupu:fill-slot name="toolbar"> in wire.kupu under plone
distribution. Tell me if you can help. Thanks.
 Link to the article:
http://codespeak.net/pipermail/kupu-dev/2005-July/001379.html


 2005/11/7, Duncan Booth <duncan.booth@suttoncourtenay.org.uk>:
>
> =?UTF-8?Q?Thanh_H=E1=BA=A3i=2C_H=C3=A0?= wrote:
>
> > Hello,
> > Is it possible to create custom button in the Kupu's toolbar? If yes,
> > how
> > to do that? I am using Kupu 1.3.1 with Plone.
>
> Yes, it is possible, but it isn't trivial. Try looking at the changes
> checked in to the trunk revision 19321 (i.e. diff it from the previous
> revision). In summary, what you have to do is:
>
> Edit one or more .kupu files to generate the appropriate html for your
> button. In this case I edited drawers.kupu because I wanted to add a new
> drawer. The important changes are around line 28 (the button itself) and
> the html for the drawer added at the end of the file. wire.kupu was edited
> to include the new drawer code. Run 'make plonemacros' to build the
> kupu_wysiwyg_support template after any changes to a .kupu file.
>
> Next to need to make the appropriate css changes to associate an icon with
> the button. See the change to kupustyles.css. Then you get out your icon
> editor and create an icon.
>
> Next up, you should create a tool class to handle the button. See
> kupubasetools.js for examples. If you need to add a complex ui, e.g. a
> drawer or a dialog then you should separate the tool and the ui into 2
> separate classes. So in my case I created BookmarkTool at the end of
> kupubasetools, and BookmarkDrawer in kupudrawers.
>
> Finally you need to edit kupuploneinit.js to instantiate the new classes.
>
> Unless your button wants to go into the standard kupu you'll want to keep
> all your code in separate js files, but I'm afraid you will probably have
> to edit some of the existing files such as kupuploneinit.js, and the .kupu
> files.
>
> _______________________________________________
> kupu-dev mailing list
> kupu-dev@codespeak.net
> http://codespeak.net/mailman/listinfo/kupu-dev
>

[Attachment #3 (text/html)]

<div>Hello,</div>
<div>&nbsp;</div>
<div>I had found this article posted by Guido on codespeak which describe how to add \
buttons in Lenya. Tried in for Plone but i got stuck in step 4. I was unable to \
locate&nbsp; &lt;kupu:fill-slot name=&quot;toolbar&quot;&gt; in  wire.kupu under \
plone distribution.&nbsp;Tell me if you can help. Thanks.</div> <div>&nbsp;</div>
<div>Link to the article: <a \
href="http://codespeak.net/pipermail/kupu-dev/2005-July/001379.html">http://codespeak.net/pipermail/kupu-dev/2005-July/001379.html</a></div>
 <div><br><br>&nbsp;</div>
<div><span class="gmail_quote">2005/11/7, Duncan Booth &lt;<a \
href="mailto:duncan.booth@suttoncourtenay.org.uk">duncan.booth@suttoncourtenay.org.uk</a>&gt;:</span>
 <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; \
BORDER-LEFT: #ccc 1px solid">=?UTF-8?Q?Thanh_H=E1=BA=A3i=2C_H=C3=A0?= \
wrote:<br><br>&gt; Hello,<br>&gt;&nbsp;&nbsp;Is it possible to create custom button \
in the Kupu's toolbar? If yes, <br>&gt;&nbsp;&nbsp;how<br>&gt; to do that? I am using \
Kupu 1.3.1 with Plone.<br><br>Yes, it is possible, but it isn't trivial. Try looking \
at the changes<br>checked in to the trunk revision 19321 (i.e. diff it from the \
previous<br> revision). In summary, what you have to do is:<br><br>Edit one or more \
.kupu files to generate the appropriate html for your<br>button. In this case I \
edited drawers.kupu because I wanted to add a new<br>drawer. The important changes \
are around line 28 (the button itself) and <br>the html for the drawer added at the \
end of the file. wire.kupu was edited<br>to include the new drawer code. Run 'make \
plonemacros' to build the<br>kupu_wysiwyg_support template after any changes to a \
.kupu file.<br> <br>Next to need to make the appropriate css changes to associate an \
icon with<br>the button. See the change to kupustyles.css. Then you get out your \
icon<br>editor and create an icon.<br><br>Next up, you should create a tool class to \
handle the button. See <br>kupubasetools.js for examples. If you need to add a \
complex ui, e.g. a<br>drawer or a dialog then you should separate the tool and the ui \
into 2<br>separate classes. So in my case I created BookmarkTool at the end of<br> \
kupubasetools, and BookmarkDrawer in kupudrawers.<br><br>Finally you need to edit \
kupuploneinit.js to instantiate the new classes.<br><br>Unless your button wants to \
go into the standard kupu you'll want to keep<br>all your code in separate js files, \
but I'm afraid you will probably have <br>to edit some of the existing files such as \
kupuploneinit.js, and the \
.kupu<br>files.<br><br>_______________________________________________<br>kupu-dev \
mailing list<br><a href="mailto:kupu-dev@codespeak.net">kupu-dev@codespeak.net \
</a><br><a href="http://codespeak.net/mailman/listinfo/kupu-dev">http://codespeak.net/mailman/listinfo/kupu-dev</a><br></blockquote></div><br>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic