TopicTypeEditTemplate
Editor for TopicTypes

02 May 2019 - 09:27 | Version 1 |

%{
}%
%TMPL:INCLUDE{"Applications.ApplicationTopicEdit"}%
%{
}%

%{
}%
%TMPL:DEF{"editfields"}%TopicTitle, Summary%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"detailstab"}%%TMPL:PREV%%ADDTOZONE{
   "script" 
   id="TOPICTYPE::JS" 
   requires="JQUERYPLUGIN" 
   text="<script type='text/javascript' src='%PUBURLPATH%/Applications/TopicTypeEditTemplate/script.js'></script>"
}%%TMPL:END%
%{
}%

jQuery(function($) {
   var $modeElem = $("[name=TopicNamingMode]"),
       $set1 = $("[name=TopicNameTemplate]").parent(),
       $set2 = $("[name=TopicNameSource]").parent()
               .add($("[name=TopicNamePrefix]").parent())
               .add($("[name=TopicNameSuffix]").parent())
               .add($("[name=TopicNameTransliterate]").parents("div.foswikiFormStep:first"));

   function updateTopicNaming() {
      var val = $modeElem.filter(":checked").val();
      $set1.hide();
      $set2.hide();
      if (val === 'template') {
        $set1.fadeIn();
      } else if (val === 'derived') {
        $set2.fadeIn();
      } else {
         $modeElem.filter("[value=manual]").prop("checked", true);
      }
   }

   $modeElem.on("change", updateTopicNaming);
   updateTopicNaming();
});
This site is powered by FoswikiCopyright © 2002-2024 by contributors to Wasserstoff-Fahrer Forum ImpressumDatenschutz  Feedback
This website is using cookies. More info. That's Fine