I would like to do something when the user clicks "Cancel Editing" button in Tridion 2013 XPM. Below is my configuratin file and JS file. My Extension's Java Script file has been loaded in the page. But when i click the "Cancel" button looks like JS is not fired. I am having alert in all the sections (isavailable, isenabled and execute). Can anyone please point me out what i am doing wrong?
Is there any specific section in "system.config" file to add the SiteEdit related extension details? (VDIR and Extension location)
Congiguration File
<?xml version="1.0"?>
<Configuration xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge" xmlns:cfg="http://www.sdltridion.com/2009/GUI/Configuration" xmlns:ext="http://www.sdltridion.com/2009/GUI/extensions" xmlns:cmenu="http://www.sdltridion.com/2009/GUI/extensions/ContextMenu">
<resources cache="true">
<cfg:filters/>
<cfg:groups>
<cfg:group name="xpmextension.CommandSet">
<cfg:fileset>
<cfg:file type="script">/js/xpmextension.js</cfg:file>
<cfg:file type="reference">xpmextension.Interface</cfg:file>
</cfg:fileset>
<cfg:dependencies>
<cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
</cfg:dependencies>
</cfg:group>
</cfg:groups>
</resources>
<definitionfiles/>
<extensions>
<ext:editorextensions>
<ext:editorextension target="SiteEdit">
<ext:editurls />
<ext:listdefinitions/>
<ext:taskbars/>
<ext:commands/>
<ext:commandextensions>
<ext:commands>
<ext:command name="CancelEditing" extendingcommand="xpmextension"/>
</ext:commands>
<ext:dependencies>
<cfg:dependency>xpmextension.CommandSet</cfg:dependency>
</ext:dependencies>
</ext:commandextensions>
<ext:contextmenus/>
<ext:lists/>
<ext:tabpages/>
<ext:toolbars/>
<ext:ribbontoolbars/>
</ext:editorextension>
</ext:editorextensions>
<ext:dataextenders/>
</extensions>
<commands>
<cfg:commandset id="xpmextension.intereface">
<cfg:command name="xpmextension" implementation="Extensions.xpmextension"/>
<cfg:dependencies>
<cfg:dependency>xpmextension</cfg:dependency>
</cfg:dependencies>
</cfg:commandset>
</commands>
<contextmenus/>
<localization/>
<settings>
<defaultpage>/Views/Default.aspx</defaultpage>
<navigatorurl>/Views/Default.aspx</navigatorurl>
<editurls/>
<listdefinitions/>
<itemicons/>
<theme>
<path>css</path>
</theme>
<customconfiguration/>
</settings>
</Configuration>
Below is my JS file
Type.registerNamespace("Extensions");
Extensions.xpmextension = function Extensions$xpmextension()
{
Type.enableInterface(this, "Extensions.xpmextension");
this.addInterface("Tridion.Cme.Command", ["xpmextension"]);
};
Extensions.xpmextension.prototype.isAvailable = function xpmextension$isAvailable(selection) {
return true;
}
Extensions.xpmextension.prototype.isEnabled = function xpmextension$isEnabled(selection) {
return true;
}
Extensions.xpmextension.prototype._execute = function xpmextension$_execute(selection)
{
alert("You have clicked the button");
alert(window.location.href);
}
_execute
command which is not triggered?