当用户点击Tridion 2013 XPM中的“取消编辑”按钮时,我想做点什么。下面是我的configuratin文件和JS文件。当我点击“取消编辑”按钮时,问题是JS没有被解雇。
祝贺文件
<?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>
以下是我的JS文件
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);
}