Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/themify-.../js/editor/componen...
File: constructor.mjs
}
[5500] Fix | Delete
f.append(self._initControl(input, data), clear);
[5501] Fix | Delete
if (data.after !== undefined) {
[5502] Fix | Delete
f.appendChild(self.after(data));
[5503] Fix | Delete
}
[5504] Fix | Delete
if (data.description !== undefined) {
[5505] Fix | Delete
f.appendChild(self.description(data.description));
[5506] Fix | Delete
}
[5507] Fix | Delete
if (this._loaded === null) {
[5508] Fix | Delete
const init = () => {
[5509] Fix | Delete
topThemify.loadCss(Themify.url + 'themify-metabox/css/jquery-ui-timepicker.min');
[5510] Fix | Delete
topThemify.loadJs(Themify.includesURL + 'js/jquery/ui/datepicker.min', topWindow.jQuery.fn.datepicker !== undefined, themify_vars.wp).then(() => {
[5511] Fix | Delete
topThemify.loadJs(Themify.url + 'themify-metabox/js/jquery-ui-timepicker.min', topWindow.jQuery.fn.themifyDatetimepicker !== undefined || topWindow.jQuery.fn.datetimepicker !== undefined, '1.6.3').then(() => {
[5512] Fix | Delete
this._loaded = true;
[5513] Fix | Delete
setTimeout(callback, 10);
[5514] Fix | Delete
});
[5515] Fix | Delete
});
[5516] Fix | Delete
};
[5517] Fix | Delete
self.afterRun.push(init);
[5518] Fix | Delete
} else {
[5519] Fix | Delete
self.afterRun.push(callback);
[5520] Fix | Delete
}
[5521] Fix | Delete
return f;
[5522] Fix | Delete
}
[5523] Fix | Delete
},
[5524] Fix | Delete
gradient: {
[5525] Fix | Delete
_controlChange(self, gradient, input, clear, type, angle, circle, text, update) {
[5526] Fix | Delete
let angleV = self.getStyleVal(angle.id);
[5527] Fix | Delete
if (angleV === undefined || angleV === '') {
[5528] Fix | Delete
angleV = 180;
[5529] Fix | Delete
}
[5530] Fix | Delete
let is_removed = false,
[5531] Fix | Delete
$gradient = $(gradient),
[5532] Fix | Delete
id = input.id,
[5533] Fix | Delete
value = self.getStyleVal(id),
[5534] Fix | Delete
args = {
[5535] Fix | Delete
angle: angleV,
[5536] Fix | Delete
onChange(stringGradient, cssGradient) {
[5537] Fix | Delete
if (is_removed) {
[5538] Fix | Delete
stringGradient = cssGradient = '';
[5539] Fix | Delete
}
[5540] Fix | Delete
input.value = stringGradient;
[5541] Fix | Delete
if (api.isVisual) {
[5542] Fix | Delete
Themify.triggerEvent(input, 'themify_builder_gradient_change', {val: cssGradient});
[5543] Fix | Delete
}
[5544] Fix | Delete
}
[5545] Fix | Delete
};
[5546] Fix | Delete
if (value) {
[5547] Fix | Delete
args.gradient = value;
[5548] Fix | Delete
input.value = value;
[5549] Fix | Delete
}
[5550] Fix | Delete
angle.value = angleV;
[5551] Fix | Delete
[5552] Fix | Delete
let typeV = self.getStyleVal(type.id);
[5553] Fix | Delete
if (typeV === undefined || typeV === '') {
[5554] Fix | Delete
typeV = 'linear';
[5555] Fix | Delete
}
[5556] Fix | Delete
type.value = typeV;
[5557] Fix | Delete
args.type = typeV;
[5558] Fix | Delete
if (circle.checked) {
[5559] Fix | Delete
args.circle = true;
[5560] Fix | Delete
}
[5561] Fix | Delete
if (!update) {
[5562] Fix | Delete
$gradient.ThemifyGradient(args);
[5563] Fix | Delete
}
[5564] Fix | Delete
const instance = $gradient.data('themifyGradient'),
[5565] Fix | Delete
callback = val => {
[5566] Fix | Delete
let p = angle.parentNode;
[5567] Fix | Delete
if (!p.classList.contains('tb_angle_container')) {
[5568] Fix | Delete
p = angle;
[5569] Fix | Delete
}
[5570] Fix | Delete
[5571] Fix | Delete
text.style.display = p.style.display = val === 'radial' ? 'none' : '';
[5572] Fix | Delete
circle.parentNode.style.display = val === 'radial' ? '' : 'none';
[5573] Fix | Delete
};
[5574] Fix | Delete
if (update) {
[5575] Fix | Delete
instance.settings = {...instance.settings, ...args};
[5576] Fix | Delete
instance.settings.type = typeV;
[5577] Fix | Delete
instance.settings.circle = circle.checked;
[5578] Fix | Delete
instance.isInit = false;
[5579] Fix | Delete
instance.update();
[5580] Fix | Delete
instance.isInit = true;
[5581] Fix | Delete
} else {
[5582] Fix | Delete
clear.tfOn(_CLICK_, e => {
[5583] Fix | Delete
e.preventDefault();
[5584] Fix | Delete
e.stopImmediatePropagation();
[5585] Fix | Delete
is_removed = true;
[5586] Fix | Delete
instance.settings.gradient = $.ThemifyGradient.default;
[5587] Fix | Delete
instance.update();
[5588] Fix | Delete
is_removed = false;
[5589] Fix | Delete
});
[5590] Fix | Delete
[5591] Fix | Delete
type.tfOn('change', function () {
[5592] Fix | Delete
const v = this.value;
[5593] Fix | Delete
instance.setType(v);
[5594] Fix | Delete
callback(v);
[5595] Fix | Delete
}, {passive: true});
[5596] Fix | Delete
[5597] Fix | Delete
circle.tfOn('change', function () {
[5598] Fix | Delete
instance.setRadialCircle(this.checked);
[5599] Fix | Delete
}, {passive: true});
[5600] Fix | Delete
[5601] Fix | Delete
angle.tfOn('keyup', function () {
[5602] Fix | Delete
let val = parseInt(this.value);
[5603] Fix | Delete
if (isNaN(val)) {
[5604] Fix | Delete
val = 0;
[5605] Fix | Delete
}
[5606] Fix | Delete
instance.setAngle(val);
[5607] Fix | Delete
}, {passive: true});
[5608] Fix | Delete
[5609] Fix | Delete
gradient.appendChild(clear);
[5610] Fix | Delete
}
[5611] Fix | Delete
callback(self.getStyleVal(type.id));
[5612] Fix | Delete
},
[5613] Fix | Delete
update(id, v, self) {
[5614] Fix | Delete
const nid = id + '-gradient',
[5615] Fix | Delete
input = self.getEl(nid);
[5616] Fix | Delete
if (input !== null) {
[5617] Fix | Delete
const angle = self.getEl(nid + '-angle'),
[5618] Fix | Delete
type = self.getEl(nid + '-type'),
[5619] Fix | Delete
circle = self.getEl(id + '-circle-radial');
[5620] Fix | Delete
this._controlChange(self, input.previousElementSibling, input, null, type, angle, circle.tfClass('tb_checkbox')[0], circle.previousElementSibling, true);
[5621] Fix | Delete
}
[5622] Fix | Delete
},
[5623] Fix | Delete
render(data, self) {
[5624] Fix | Delete
const id=data.id,
[5625] Fix | Delete
wrap = createElement('','themify-gradient-field tf_w tf_rel'),
[5626] Fix | Delete
text = createElement('span','',i18n.rotation),
[5627] Fix | Delete
gradient = createElement('','tb_gradient_container tf_w'),
[5628] Fix | Delete
input = createElement('input',{type:'hidden',class:'themify-gradient tb_lb_option',id:id+ '-gradient','data-id':id}),
[5629] Fix | Delete
clear = createElement('button',{type:'button',class:'tb_clear_gradient tf_close'}),
[5630] Fix | Delete
select = self.select.render({
[5631] Fix | Delete
options: {
[5632] Fix | Delete
linear: 'linear',
[5633] Fix | Delete
radial: 'radial'
[5634] Fix | Delete
},
[5635] Fix | Delete
class: 'themify-gradient-type',
[5636] Fix | Delete
id: id + '-gradient-type',
[5637] Fix | Delete
control: false
[5638] Fix | Delete
}, self);
[5639] Fix | Delete
if (data.option_js !== undefined) {
[5640] Fix | Delete
wrap.className += ' tb_group_element_gradient';
[5641] Fix | Delete
}
[5642] Fix | Delete
clear.appendChild(createElement('span','themify_tooltip',i18n.clear_gradient));
[5643] Fix | Delete
[5644] Fix | Delete
const angleData = api.Helper.cloneObject(data);
[5645] Fix | Delete
angleData.id = id + '-gradient-angle';
[5646] Fix | Delete
const angleWarp = self.angle.render(angleData, self);
[5647] Fix | Delete
wrap.append(select, angleWarp, text, self.checkboxGenerate('checkbox',
[5648] Fix | Delete
{
[5649] Fix | Delete
id: id + '-circle-radial',
[5650] Fix | Delete
options: [{name: '1', value: 'circle_radial'}]
[5651] Fix | Delete
}
[5652] Fix | Delete
), gradient, input);
[5653] Fix | Delete
[5654] Fix | Delete
self._initControl(input, data);
[5655] Fix | Delete
self.afterRun.push(() => {
[5656] Fix | Delete
this._controlChange(self, gradient, input, clear, wrap.querySelector('.themify-gradient-type'), angleWarp.tfClass('tb_angle_input')[0], wrap.tfClass('tb_checkbox')[0], text);
[5657] Fix | Delete
});
[5658] Fix | Delete
return wrap;
[5659] Fix | Delete
}
[5660] Fix | Delete
},
[5661] Fix | Delete
fontColor: {
[5662] Fix | Delete
update(id, v, self) {
[5663] Fix | Delete
self.radio.update(id, self.getStyleVal(id), self);
[5664] Fix | Delete
},
[5665] Fix | Delete
render(data, self) {
[5666] Fix | Delete
data.isFontColor = true;
[5667] Fix | Delete
const roptions = {
[5668] Fix | Delete
id: data.id,
[5669] Fix | Delete
type: 'radio',
[5670] Fix | Delete
option_js: true,
[5671] Fix | Delete
isFontColor: true,
[5672] Fix | Delete
options: [
[5673] Fix | Delete
{value: data.s + '_solid', name: 'solid'},
[5674] Fix | Delete
{value: data.g + '_gradient', name: 'gradient'}
[5675] Fix | Delete
]
[5676] Fix | Delete
},
[5677] Fix | Delete
radioWrap = self.radioGenerate('radio', roptions),
[5678] Fix | Delete
radio = radioWrap.querySelector('.tb_lb_option'),
[5679] Fix | Delete
colorData = api.Helper.cloneObject(data);
[5680] Fix | Delete
colorData.label = '';
[5681] Fix | Delete
colorData.type = 'color';
[5682] Fix | Delete
colorData.id = data.s;
[5683] Fix | Delete
colorData.prop = 'color';
[5684] Fix | Delete
colorData.wrap_class = 'tb_group_element_' + data.s + '_solid';
[5685] Fix | Delete
[5686] Fix | Delete
const color = self.create([colorData]);
[5687] Fix | Delete
[5688] Fix | Delete
colorData.id = data.g;
[5689] Fix | Delete
colorData.wrap_class = 'tb_group_element_' + data.g + '_gradient';
[5690] Fix | Delete
colorData.type = 'gradient';
[5691] Fix | Delete
colorData.prop = 'background-image';
[5692] Fix | Delete
[5693] Fix | Delete
const gradient = self.create([colorData]);
[5694] Fix | Delete
self.afterRun.push(() => {
[5695] Fix | Delete
const field = radio.parentNode.closest('.tb_field');
[5696] Fix | Delete
field.parentNode.insertBefore(color, field.nextElementSibling);
[5697] Fix | Delete
field.parentNode.insertBefore(gradient, field.nextElementSibling);
[5698] Fix | Delete
});
[5699] Fix | Delete
data.label??= 'f_c';
[5700] Fix | Delete
return radioWrap;
[5701] Fix | Delete
}
[5702] Fix | Delete
},
[5703] Fix | Delete
imageGradient: {
[5704] Fix | Delete
update(id, v, self) {
[5705] Fix | Delete
self.radio.update(id + '-type', self.getStyleVal(id + '-type'), self);
[5706] Fix | Delete
self.mediaFile.update(id, v, self);
[5707] Fix | Delete
self.gradient.update(id, v, self);
[5708] Fix | Delete
const el = self.getEl(id);
[5709] Fix | Delete
if (el !== null) {
[5710] Fix | Delete
let p = el.closest('.tb_tab'),
[5711] Fix | Delete
imageOpt = p.tfClass('tb_image_options'),
[5712] Fix | Delete
eid = p.tfClass('tb_gradient_image_color')[0].tfClass('tfminicolors-input')[0].id;
[5713] Fix | Delete
self.color.update(eid, self.getStyleVal(eid), self);
[5714] Fix | Delete
for (let i = 0; i < imageOpt.length; ++i) {
[5715] Fix | Delete
eid = imageOpt[i].tfClass('tb_lb_option')[0].id;
[5716] Fix | Delete
self.select.update(eid, self.getStyleVal(eid), self);
[5717] Fix | Delete
}
[5718] Fix | Delete
}
[5719] Fix | Delete
},
[5720] Fix | Delete
render(data, self) {
[5721] Fix | Delete
const wrap = createElement('','tb_image_gradient_field'),
[5722] Fix | Delete
imageWrap = createElement('', 'tb_group_element_image tf_w tf_rel');
[5723] Fix | Delete
wrap.appendChild(self.radioGenerate('radio',
[5724] Fix | Delete
{ type: data.type,
[5725] Fix | Delete
id: data.id + '-type',
[5726] Fix | Delete
options: [
[5727] Fix | Delete
{name: 'image', value: 'image'},
[5728] Fix | Delete
{name: 'gradient', value: 'gradient'}
[5729] Fix | Delete
],
[5730] Fix | Delete
option_js: true
[5731] Fix | Delete
}
[5732] Fix | Delete
));
[5733] Fix | Delete
if (data.option_js === undefined) {
[5734] Fix | Delete
data.option_js = true;
[5735] Fix | Delete
}
[5736] Fix | Delete
if (data.binding === undefined) {
[5737] Fix | Delete
data.binding = {
[5738] Fix | Delete
empty: {
[5739] Fix | Delete
hide: 'tb_image_options'
[5740] Fix | Delete
},
[5741] Fix | Delete
not_empty: {
[5742] Fix | Delete
show: 'tb_image_options'
[5743] Fix | Delete
}
[5744] Fix | Delete
};
[5745] Fix | Delete
}
[5746] Fix | Delete
const extend = api.Helper.cloneObject(data);
[5747] Fix | Delete
extend.type = 'image';
[5748] Fix | Delete
//image
[5749] Fix | Delete
imageWrap.appendChild(self.mediaFile.render('image', api.Helper.cloneObject(extend), self));
[5750] Fix | Delete
wrap.appendChild(imageWrap);
[5751] Fix | Delete
//gradient
[5752] Fix | Delete
extend.type = 'gradient';
[5753] Fix | Delete
delete extend.class;
[5754] Fix | Delete
delete extend.binding;
[5755] Fix | Delete
wrap.appendChild(self.gradient.render(extend, self));
[5756] Fix | Delete
self.afterRun.push(() => {
[5757] Fix | Delete
const group = {
[5758] Fix | Delete
wrap_class: 'tb_group_element_image tf_w tf_rel',
[5759] Fix | Delete
type: 'group',
[5760] Fix | Delete
options: []
[5761] Fix | Delete
};
[5762] Fix | Delete
//color
[5763] Fix | Delete
extend.prop = 'background-color';
[5764] Fix | Delete
extend.wrap_class = 'tb_gradient_image_color';
[5765] Fix | Delete
extend.label = 'bg_c';
[5766] Fix | Delete
extend.type = 'color';
[5767] Fix | Delete
extend.id = extend.colorId;
[5768] Fix | Delete
group.options.push(api.Helper.cloneObject(extend));
[5769] Fix | Delete
[5770] Fix | Delete
//repeat
[5771] Fix | Delete
extend.prop = 'background-mode';
[5772] Fix | Delete
extend.wrap_class = 'tb_image_options';
[5773] Fix | Delete
extend.label = 'b_r';
[5774] Fix | Delete
extend.repeat = true;
[5775] Fix | Delete
extend.type = 'select';
[5776] Fix | Delete
extend.id = extend.repeatId;
[5777] Fix | Delete
group.options.push(api.Helper.cloneObject(extend));
[5778] Fix | Delete
[5779] Fix | Delete
//position
[5780] Fix | Delete
extend.prop = 'background-position';
[5781] Fix | Delete
extend.wrap_class = 'tb_image_options';
[5782] Fix | Delete
extend.label = 'b_p';
[5783] Fix | Delete
extend.position = true;
[5784] Fix | Delete
extend.type = 'position_box';
[5785] Fix | Delete
extend.id = extend.posId;
[5786] Fix | Delete
delete extend.repeat;
[5787] Fix | Delete
group.options.push(api.Helper.cloneObject(extend));
[5788] Fix | Delete
[5789] Fix | Delete
imageWrap.parentNode.closest('.tb_field').after(self.create([group]));
[5790] Fix | Delete
});
[5791] Fix | Delete
data.label??= 'bg';
[5792] Fix | Delete
return wrap;
[5793] Fix | Delete
}
[5794] Fix | Delete
},
[5795] Fix | Delete
layout: {
[5796] Fix | Delete
_controlChange(el) {
[5797] Fix | Delete
el.tfOn(_CLICK_, function (e) {
[5798] Fix | Delete
e.preventDefault();
[5799] Fix | Delete
e.stopPropagation();
[5800] Fix | Delete
if (e.target !== el) {
[5801] Fix | Delete
const selected = e.target.closest('a');
[5802] Fix | Delete
if (selected !== null) {
[5803] Fix | Delete
const items = this.tfClass('tfl-icon');
[5804] Fix | Delete
for (let i = items.length - 1; i > -1; --i) {
[5805] Fix | Delete
items[i].classList.remove('selected');
[5806] Fix | Delete
}
[5807] Fix | Delete
selected.classList.add('selected');
[5808] Fix | Delete
Themify.triggerEvent(this, 'change', {val: selected.id});
[5809] Fix | Delete
}
[5810] Fix | Delete
}
[5811] Fix | Delete
});
[5812] Fix | Delete
},
[5813] Fix | Delete
update(id, v, self) {
[5814] Fix | Delete
const input = self.getEl(id);
[5815] Fix | Delete
if (input !== null) {
[5816] Fix | Delete
const items = input.tfClass('tfl-icon');
[5817] Fix | Delete
for (let i = items.length - 1; i > -1; --i) {
[5818] Fix | Delete
items[i].classList.toggle('selected', v === items[i].id);
[5819] Fix | Delete
}
[5820] Fix | Delete
if (v === undefined) {
[5821] Fix | Delete
let def = input.dataset.default;
[5822] Fix | Delete
def = def === undefined ? items[0] : def.querySelector('#' + def);
[5823] Fix | Delete
def.classList.add('selected');
[5824] Fix | Delete
}
[5825] Fix | Delete
}
[5826] Fix | Delete
},
[5827] Fix | Delete
render(data, self) {
[5828] Fix | Delete
let p = createElement('','themify-layout-icon'),
[5829] Fix | Delete
options = self.getOptions(data),
[5830] Fix | Delete
v = self.getStyleVal(data.id);
[5831] Fix | Delete
[5832] Fix | Delete
if (data.color === true && data.transparent === true) {
[5833] Fix | Delete
options = [...options];
[5834] Fix | Delete
options.push({img: 'transparent', value: 'transparent', label: i18n.transparent});
[5835] Fix | Delete
}
[5836] Fix | Delete
if (self.is_repeat === true) {
[5837] Fix | Delete
p.className += self.is_sort === true ? ' tb_lb_sort_child' : ' tb_lb_option_child';
[5838] Fix | Delete
p.dataset.inputId = data.id;
[5839] Fix | Delete
} else {
[5840] Fix | Delete
p.className += ' tb_lb_option';
[5841] Fix | Delete
p.id = data.id;
[5842] Fix | Delete
}
[5843] Fix | Delete
if (data.class !== undefined) {
[5844] Fix | Delete
p.className += ' ' + data.class;
[5845] Fix | Delete
}
[5846] Fix | Delete
[5847] Fix | Delete
if (v === undefined) {
[5848] Fix | Delete
if(data.default!==undefined){
[5849] Fix | Delete
v=data.default;
[5850] Fix | Delete
}
[5851] Fix | Delete
else{
[5852] Fix | Delete
const def = api.activeModel.type === 'module' ? api.activeModel.getPreviewSettings() : null;
[5853] Fix | Delete
v = def?.[data.id] ?? (options[0].value || '');
[5854] Fix | Delete
}
[5855] Fix | Delete
self.settings[data.id] = v;
[5856] Fix | Delete
}
[5857] Fix | Delete
v = v.toString();
[5858] Fix | Delete
for (let i = 0; i < options.length; ++i) {
[5859] Fix | Delete
let {value:optV='',img,label} = options[i],
[5860] Fix | Delete
a = createElement('a',{href:'#',class:'tfl-icon',id:optV}),
[5861] Fix | Delete
tooltip = createElement('span','themify_tooltip',(i18n[label] || label)),
[5862] Fix | Delete
sprite;
[5863] Fix | Delete
if (v === optV.toString()) {
[5864] Fix | Delete
a.className += ' selected';
[5865] Fix | Delete
}
[5866] Fix | Delete
if (data.mode === 'sprite' && !img.includes('.png')) {
[5867] Fix | Delete
sprite = createElement('span','tb_sprite');
[5868] Fix | Delete
if (img.includes('http')) {
[5869] Fix | Delete
sprite.style.backgroundImage = 'url(' + img + ')';
[5870] Fix | Delete
} else {
[5871] Fix | Delete
sprite.className += ' tb_' + img;
[5872] Fix | Delete
}
[5873] Fix | Delete
}
[5874] Fix | Delete
else {
[5875] Fix | Delete
sprite = new Image();
[5876] Fix | Delete
sprite.alt = i18n[label] || label;
[5877] Fix | Delete
sprite.src = img.includes('http') ? img : Themify.builder_url + 'editor/img/' + img;
[5878] Fix | Delete
}
[5879] Fix | Delete
[5880] Fix | Delete
a.append(sprite, tooltip);
[5881] Fix | Delete
p.appendChild(a);
[5882] Fix | Delete
}
[5883] Fix | Delete
this._controlChange(p);
[5884] Fix | Delete
if (self.component === 'row' && (data.id === 'row_width' || data.id === 'row_height')) {
[5885] Fix | Delete
api.activeModel.options(p, data.type);
[5886] Fix | Delete
} else {
[5887] Fix | Delete
self._initControl(p, data);
[5888] Fix | Delete
}
[5889] Fix | Delete
return p;
[5890] Fix | Delete
}
[5891] Fix | Delete
},
[5892] Fix | Delete
layoutPart: {
[5893] Fix | Delete
data: [],
[5894] Fix | Delete
async get() {
[5895] Fix | Delete
if (this.data.length === 0) {
[5896] Fix | Delete
try {
[5897] Fix | Delete
api.Spinner.showLoader();
[5898] Fix | Delete
this.data = await api.LocalFetch({action: 'tb_get_library_items'});
[5899] Fix | Delete
api.Spinner.showLoader('done');
[5900] Fix | Delete
} catch (e) {
[5901] Fix | Delete
api.Spinner.showLoader('error');
[5902] Fix | Delete
throw e;
[5903] Fix | Delete
}
[5904] Fix | Delete
}
[5905] Fix | Delete
},
[5906] Fix | Delete
render(data, self) {
[5907] Fix | Delete
data.setOptions = false;
[5908] Fix | Delete
const s = self.values[data.id],
[5909] Fix | Delete
d = createDocumentFragment(),
[5910] Fix | Delete
selectWrap = self.select.render(data, self),
[5911] Fix | Delete
edit = createElement('a'),
[5912] Fix | Delete
add = createElement('a'),
[5913] Fix | Delete
select = selectWrap.querySelector('select');
[5914] Fix | Delete
[5915] Fix | Delete
this.get().then(() => {
[5916] Fix | Delete
const currentLayoutId = api.LayoutPart?.id ? api.LayoutPart.id.toString() : null,
[5917] Fix | Delete
arr=this.data;
[5918] Fix | Delete
select.appendChild(createElement('option'));
[5919] Fix | Delete
for (let i = 0; i < arr.length; ++i) {
[5920] Fix | Delete
if (currentLayoutId !== arr[i].id.toString()) {
[5921] Fix | Delete
let opt = createElement('option',{value:arr[i].post_name},arr[i].post_title);
[5922] Fix | Delete
if (s === arr[i].post_name) {
[5923] Fix | Delete
opt.selected = true;
[5924] Fix | Delete
}
[5925] Fix | Delete
select.appendChild(opt);
[5926] Fix | Delete
}
[5927] Fix | Delete
}
[5928] Fix | Delete
});
[5929] Fix | Delete
d.append(selectWrap, createElement('br'));
[5930] Fix | Delete
if (data.add_url) {
[5931] Fix | Delete
add.href = data.add_url;
[5932] Fix | Delete
add.className = 'add_new tf_plus_icon tb_icon_btn tf_rel';
[5933] Fix | Delete
add.textContent = i18n.nlayout;
[5934] Fix | Delete
d.appendChild(add);
[5935] Fix | Delete
}
[5936] Fix | Delete
if (data.edit_url) {
[5937] Fix | Delete
edit.target = add.target = '_blank';
[5938] Fix | Delete
edit.className = 'tb_icon_btn';
[5939] Fix | Delete
edit.href = data.edit_url;
[5940] Fix | Delete
edit.append(api.Helper.getIcon('ti-folder'), createTextNode(i18n.mlayout));
[5941] Fix | Delete
d.appendChild(edit);
[5942] Fix | Delete
}
[5943] Fix | Delete
return d;
[5944] Fix | Delete
}
[5945] Fix | Delete
},
[5946] Fix | Delete
separator: {
[5947] Fix | Delete
render(data, self) {
[5948] Fix | Delete
let seperator;
[5949] Fix | Delete
const label = data.label??'f',
[5950] Fix | Delete
txt = i18n[label]?? label;
[5951] Fix | Delete
if (txt) {
[5952] Fix | Delete
seperator = data.wrap_class !== undefined ? createElement() : createDocumentFragment();
[5953] Fix | Delete
seperator.append(createElement('hr'), createElement('h4','',txt));
[5954] Fix | Delete
if (data.wrap_class !== undefined) {
[5955] Fix | Delete
seperator.className = data.wrap_class;
[5956] Fix | Delete
}
[5957] Fix | Delete
} else if (data.html !== undefined) {
[5958] Fix | Delete
const tmp = createElement();
[5959] Fix | Delete
tmp.innerHTML = data.html;
[5960] Fix | Delete
seperator = tmp.firstChild;
[5961] Fix | Delete
if (data.wrap_class !== undefined) {
[5962] Fix | Delete
seperator.className = data.wrap_class;
[5963] Fix | Delete
}
[5964] Fix | Delete
} else {
[5965] Fix | Delete
seperator = createElement('hr');
[5966] Fix | Delete
if (data.wrap_class !== undefined) {
[5967] Fix | Delete
seperator.className = data.wrap_class;
[5968] Fix | Delete
}
[5969] Fix | Delete
}
[5970] Fix | Delete
return seperator;
[5971] Fix | Delete
}
[5972] Fix | Delete
},
[5973] Fix | Delete
template_fields: {
[5974] Fix | Delete
render(data, self) {
[5975] Fix | Delete
const div = createElement('','tb_template_fields'),
[5976] Fix | Delete
target=data.target;
[5977] Fix | Delete
div.appendChild(createElement('h4','',i18n[data.title] || data.title));
[5978] Fix | Delete
for (let i = 0; i < data.fields.length; i++) {
[5979] Fix | Delete
div.appendChild(createElement('span','',data.fields[ i ]));
[5980] Fix | Delete
}
[5981] Fix | Delete
if (data.extra) {
[5982] Fix | Delete
const temp = createElement();
[5983] Fix | Delete
temp.innerHTML = i18n[data.extra] || data.extra;
[5984] Fix | Delete
div.appendChild(temp.firstChild);
[5985] Fix | Delete
}
[5986] Fix | Delete
if (target) { /* element to recieve the text */
[5987] Fix | Delete
div.tfOn(_CLICK_, e => {
[5988] Fix | Delete
if (e.target.tagName === 'SPAN') {
[5989] Fix | Delete
const targetEl = self.getEl(target);
[5990] Fix | Delete
if (targetEl) {
[5991] Fix | Delete
const position = targetEl.selectionStart;
[5992] Fix | Delete
targetEl.value = targetEl.value.substring( 0, position ) + ' ' + e.target.textContent + targetEl.value.substring( position, targetEl.value.length );
[5993] Fix | Delete
Themify.triggerEvent(targetEl, 'keyup');
[5994] Fix | Delete
}
[5995] Fix | Delete
}
[5996] Fix | Delete
}, {passive: true});
[5997] Fix | Delete
}
[5998] Fix | Delete
return div;
[5999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function