I want to always have all the Targets unchecked on the Publish popup (Publish.aspx) disregarding the selected Targets from previous publish actions.
How can I achieved this? GUI Extension? Any example?
I'm not being able to find it.
UPDATE
PublishDialogSettings.js (TargetTypeList_frame_details is the name of the iFrame where the name of the targets are along with its checkboxes)
$evt.addEventHandler($display, "start", onDisplayStarted);
function onDisplayStarted() {
$evt.removeEventHandler($display, "start", onDisplayStarted);
$("#TargetTypeList_frame_details").contents().find("input:checkbox").prop('checked', false);
}
PublishDialogSettings.config
<?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:extensiongroups>
<cfg:extensiongroup name="PublishDialogSettings">
<cfg:extension target="Tridion.Web.UI.Editors.CME.Views.Popups.Publish">
<cfg:insertafter>MyCompany.Resources.PublishDialogSettings</cfg:insertafter>
</cfg:extension>
</cfg:extensiongroup>
</cfg:extensiongroups>
<cfg:groups>
<cfg:group name="MyCompany.Resources.PublishDialogSettings">
<cfg:fileset>
<cfg:file type="script">/Scripts/jquery-3.3.1.min.js</cfg:file>
<cfg:file type="script">/Scripts/PublishDialogSettings.js</cfg:file>
</cfg:fileset>
</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/>
<navigatorurl/>
<editurls/>
<listdefinitions/>
<itemicons/>
<theme>
<path />
</theme>
<resourceextensions>
<resourceextension>PublishDialogSettings</resourceextension>
</resourceextensions>
<customconfiguration/>
</settings>
</Configuration>
added in system.config
<editor name="PublishDialogSettings">
<installpath>E:\Tridion\web\WebUI\Editors\PublishDialogSettings\</installpath>
<configuration>Configuration\PublishDialogSettings.config</configuration>
<vdir/>
</editor>
UPDATE 2
I can now see the javascript file being used but the problem is that the iframe is not loaded yet when I try to use it (the TargetTypeList is inside an iframe).
I tried with this
$("#TargetTypeList_frame_details").load(function() {
var targetCheckboxes = document.getElementById('TargetTypeList_frame_details').contentWindow.document.body.querySelectorAll('input[type="checkbox"]');
for (var i = 0, len = targetCheckboxes.length; i < len; i++) {
targetCheckboxes[i].checked = false;
}
});
But I get: Uncaught TypeError: Cannot read property 'load' of undefined
Any ideas?