save
%STARTINCLUDE%
%TWISTY{
  mode="div"
  link="%BUTTON{"%TRANSLATE{"Install"}%" icon="application_add"}%%CLEAR%"
}%
<form id="topicinstaller" action="%SCRIPTURLPATH{"save"}%/" method="post">
<div class="foswikiFormSteps">
<h2 >%TEXT{default="%TRANSLATE{"Install %BASETOPIC%"}%"}%</h2>
<input type="hidden" name="onlynewtopic" value="on" />
<input type="hidden" name="TopicTitle" value="%FORMFIELD{"TopicTitle" topic="%SOURCE{default="%BASEWEB%.%BASETOPIC%"}%"}%" />
<input type="hidden" name="Summary" value="%FORMFIELD{"Summary" topic="%SOURCE{default="%BASEWEB%.%BASETOPIC%"}%"}%" />
<input type="hidden" name="topicparent" value="%PARENT{default="%HOMETOPIC%"}%" />
<input type="hidden" name="templatetopic" value="%TEMPLATE{default="Applications.TopicStubTemplate"}%" />
<input type="hidden" name="formtemplate" value="%FORM{default="Applications.TopicStub"}%" />
<input type="hidden" name="TopicType" value="%IF{"defined TYPE" then="TopicStub, %TYPE%"  else="TopicStub"}%" />
<input type="hidden" name="Target" value="%SOURCE{default="%BASEWEB%.%BASETOPIC%"}%" />
<input type="hidden" name="WikiApplication" value="%WIKIAPP{default="%FLEXWEBLIST{include="%BASEWEB%" format="$name"}%"}%" />
%EXTRA{default="<!-- -->"}%
<input type="hidden" name="topic" id="topic" value="%NAME{default="%BASETOPIC%"}%" />
<div class="foswikiFormStep">
  <h3>Target web:</h3>
  <select id="newweb" name="web" class="jqSelect2" data-width="30em"> 
    <option></option>
    %FLEXWEBLIST{
      format="<option value='$web'>$web</option>"
      webs="public,webtemplate" 
      separator=" " 
      exclude="Trash|Applications"
    }%
  </select>
  <div class="foswikiFormDescription">
    %TRANSLATE{"Select a web where to deploy this component."}%
  </div>
</div>
<div class="foswikiFormStep">
%BUTTON{"%TRANSLATE{"Submit"}%" icon="tick" type="save"}%
%CLEAR%
</div>
</div>
</form> 
%ENDTWISTY%
%JQREQUIRE{"select2"}%%ADDTOZONE{"script" id="TOPICINSTALLER" topic="%WEB%.%TOPIC%" section="init" requires="JQUERYPLUGIN"}%
%STOPINCLUDE%
%STARTSECTION{"init"}%<script>
jQuery(function($) {
  $('#topicinstaller').on('submit', function() {
    var $form = $("#topicinstaller"),
        $topic = $form.find('[name=topic]'),
        $web = $form.find('[name=web]');
    $topic.val($web.val()+'.'+$topic.val());
  });
});
</script>%ENDSECTION{"init"}%
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.