My question is regarding the button on the ribbon and client object model code. I'm not sure how to do it: So i have a button here:
<CustomAction Id="NewButton" Location="CommandUI.Ribbon" RegistrationId="103" RegistrationType="List">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Share.Controls._children">
<Button
Id="Ribbon.Documents.Share.Controls.NewButton"
Sequence="5"
Command="ShowAlert"
Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-16" Image16by16Left="-88"
Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-448"
LabelText="$Resources:core,cui_ButEmailLink;"
ToolTipTitle="$Resources:core,cui_ButEmailLink;"
ToolTipDescription="$Resources:core,cui_STT_ButEmailLinkDocument;"
TemplateAlias="o1" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="ShowAlert" CommandAction="javascript:alert('Hello world!');" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
In this case it is just some simple java script: but i want to use more complex code, client side object model. How to arrange that?
And directly another question in the code how can i check what kind of element is selected? like is it just an item or a document or a folder?
Thanks in advance