I have a GUI Extension that loads an external javascript file and then integrates with the Tridion MessageCenter. My problem is that the MessageCenter message is shown 2 times. I believe my extension is enabled for 2 'views' and I need to somehow change the config to only load the JS files for the main dashboard view.
How could I do that?
Configuration:
<?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="MessageCenterSignalrGroup" >
<cfg:domainmodel name="MessageCenterSignalrDomain">
<cfg:fileset>
<cfg:file type="script" id="rcJq">/js/jquery-1.6.4.js</cfg:file>
<cfg:file type="script" id="rcSig">/js/jquery.signalR-1.1.1.js</cfg:file>
<cfg:file type="script" id="rcNot">/js/notification.js</cfg:file>
</cfg:fileset>
<cfg:services />
</cfg:domainmodel>
<cfg:dependencies>
<cfg:dependency/>
<!--
<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="CME">
<ext:editurls/>
<ext:listdefinitions/>
<ext:taskbars/>
<ext:commands/>
<ext:commandextensions/>
<ext:contextmenus />
<ext:lists/>
<ext:tabpages/>
<ext:toolbars/>
<ext:ribbontoolbars/>
</ext:editorextension>
</ext:editorextensions>
<ext:dataextenders/>
</extensions>
<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>
Javascript:
var connection = $j.connection('http://localhost/Signalr4TridionMC/messageCenter');
connection.received(function (data) {
$messages.registerNotification(data);
});
connection.start();