1 <fieldset class="{if isset($social_fieldset_class)}{$social_fieldset_class}{else}cssform{/if}" id="social">
2 <legend{if isset($social_fieldset_legend_class)} class="{$social_fieldset_legend_class}"{/if}>{_T string="Social networks"}</legend>
4 {foreach item=social from=$socials}
6 <label for="social_{$social->id}" class="bline">{$social->getSystemType($social->type)}</label>
8 <input type="text" name="social_{$social->id}" id="social_{$social->id}" value="{$social->url}" class="large"/>
9 <a href="#" class="fright tooltip delete delsocial">
10 <i class="fas fa-trash-alt"></i>
11 <span class="sr-only">{_T string="Remove %type" pattern="/%type/" replace=$social->getSystemType($social->type)}</span>
17 <span class="bline">{_T string="Add new social network"}</span>
19 <select name="social_new_type_1" id="social_new_type_1" class="nochosen socials_selector">
20 <option value="">{_T string="Choose or enter your own..."}</option>
21 {foreach item=social_type from=$osocials->getSystemTypes(false)}
22 <option value="{$social_type}">{$osocials->getSystemType($social_type)}</option>
25 <input type="text" name="social_new_value_1" id="social_new_value_1" value="" size="50"/>
26 <a href="#" class="fright tooltip action addsocial">
27 <i class="fas fa-plus-square"></i>
28 <span class="sr-only">{_T string="Add"}</span>
31 <script type="text/javascript">
32 var _selectize = function(selector) {
34 selector = '.socials_selector';
37 $(selector).selectize({
44 $('.addsocial').click(function(e){
46 $('.socials_selector').each(function(){ // do this for every select with the 'combobox' class
48 if (_this[0].selectize) { // requires [0] to select the proper object
49 var value = $(this).val(); // store the current value of the select/input
50 _this[0].selectize.destroy(); // destroys selectize()
51 _this.val(value); // set back the value of the select/input
55 var _newindex = $(this).parents('fieldset').find('p:last select').attr('id').replace('social_new_type_', '');
59 .insertAfter('#social p:last') // where
60 .find('select').attr('id', 'social_new_type_' + _newindex).attr('name', 'social_new_type_' + _newindex)
61 .parent().find('input').attr('id', 'social_new_value_' + _newindex).attr('name', 'social_new_value_' + _newindex)
62 .parent().find('.addsocial').remove()
68 var _rmFilter = function(elt) {
69 if ( typeof elt == 'undefined') {
72 elt.find('.delsocial').click(function(e){
75 _this.parents('p').remove();