From 1b27a949ef2b1ffab6fb2ffb8168a2c1e8bd945d Mon Sep 17 00:00:00 2001 From: Remigijus Kiminas Date: Fri, 26 Apr 2024 05:43:31 -0400 Subject: [PATCH] fixes --- .../js_static/69dd0a45af3af232b46fb9ee986ca329.js | 2 +- .../69dd0a45af3af232b46fb9ee986ca329.js.map | 2 +- lhc_web/design/defaulttheme/js/lhc.botcommand.js | 15 --------------- .../tpl/lhgenericbot/form_command.tpl.php | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js b/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js index f9e0ac2033..d330d8e81c 100644 --- a/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js +++ b/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js @@ -1,2 +1,2 @@ -$(document).ready((function(){$('#add-field-row button[name="custom_field_add"]').click((function(){botCommandFields.push({name:document.getElementById("custom_field_name").value,placeholder:document.getElementById("custom_field_placeholder").value,type:document.getElementById("custom_field_type").value,rows:document.getElementById("custom_field_rows").value,required:document.getElementById("custom_field_required").value}),i()}));var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function t(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return e[t]}))}function i(){let e=document.getElementById("field-rows-container");e.innerHTML="",botCommandFields.forEach((i,d)=>{e.innerHTML+='
'+e.getAttribute("name-field")+" - "+t(i.name)+'
{args.arg_'+(d+1)+"} or {arg_"+(d+1)+"} in bot, in Rest API {{args.arg_"+(d+1)+'}}
'+e.getAttribute("placeholder-field")+" - "+t(i.placeholder)+'
'+e.getAttribute("type-field")+" - "+t(i.type)+'
'+e.getAttribute("rows-field")+" - "+t(i.rows?i.rows:1)+'
'+e.getAttribute("required-field")+" - "+t(i.required?i.required:"required")+'
'})}ee.addListener("delete_custom_command_field",(function(e){botCommandFields.splice(e,1),i()})),i()})),$(document).ready((function(){$('select[name="bot_id"]').change((function(){$.get(WWW_DIR_JAVASCRIPT+"genericbot/triggersbybot/"+$(this).val(),{},(function(e){$("#trigger-list-id").html(e)})).fail((function(){}))})),$.get(WWW_DIR_JAVASCRIPT+"genericbot/triggersbybot/"+$('select[name="bot_id"]').val()+"/trigger_id?>",{},(function(e){$("#trigger-list-id").html(e)})).fail((function(){}))})); +$(document).ready((function(){$('#add-field-row button[name="custom_field_add"]').click((function(){botCommandFields.push({name:document.getElementById("custom_field_name").value,placeholder:document.getElementById("custom_field_placeholder").value,type:document.getElementById("custom_field_type").value,rows:document.getElementById("custom_field_rows").value,required:document.getElementById("custom_field_required").value}),d()}));var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function t(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return e[t]}))}function d(){let e=document.getElementById("field-rows-container");e.innerHTML="",botCommandFields.forEach((d,i)=>{e.innerHTML+='
'+e.getAttribute("name-field")+" - "+t(d.name)+'
{args.arg_'+(i+1)+"} or {arg_"+(i+1)+"} in bot, in Rest API {{args.arg_"+(i+1)+'}}
'+e.getAttribute("placeholder-field")+" - "+t(d.placeholder)+'
'+e.getAttribute("type-field")+" - "+t(d.type)+'
'+e.getAttribute("rows-field")+" - "+t(d.rows?d.rows:1)+'
'+e.getAttribute("required-field")+" - "+t(d.required?d.required:"required")+'
'})}ee.addListener("delete_custom_command_field",(function(e){botCommandFields.splice(e,1),d()})),d()})); //# sourceMappingURL=69dd0a45af3af232b46fb9ee986ca329.js.map diff --git a/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js.map b/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js.map index de5f4dd82d..ff3eaa74d2 100644 --- a/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js.map +++ b/lhc_web/design/defaulttheme/js/js_static/69dd0a45af3af232b46fb9ee986ca329.js.map @@ -1 +1 @@ -{"version":3,"sources":["69dd0a45af3af232b46fb9ee986ca329.js"],"names":["$","document","ready","click","botCommandFields","push","name","getElementById","value","placeholder","type","rows","required","renderPeriods","entityMap","&","<",">","\"","'","/","`","=","escapeHtml","string","String","replace","s","periodList","innerHTML","forEach","item","index","getAttribute","ee","addListener","splice","change","get","WWW_DIR_JAVASCRIPT","this","val","data","html","fail"],"mappings":"AAAAA,EAAEC,UAAUC,OAAM,WAClBF,EAAE,kDAAkDG,OAAM,WAC1DC,iBAAiBC,KAAK,CACtBC,KAAQL,SAASM,eAAe,qBAAqBC,MACrDC,YAAeR,SAASM,eAAe,4BAA4BC,MACnEE,KAAQT,SAASM,eAAe,qBAAqBC,MACrDG,KAAQV,SAASM,eAAe,qBAAqBC,MACrDI,SAAYX,SAASM,eAAe,yBAAyBC,QAE7DK,OAEA,IAAIC,EAAY,CAChBC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,QACLC,IAAK,SACLC,IAAK,SACLC,IAAK,UAML,SAASC,EAAYC,GACrB,OAAOC,OAAOD,GAAQE,QAAQ,gBAAgB,SAAwBC,GACtE,OAAOb,EAAUa,MAGjB,SAASd,IACT,IAAIe,EAAa3B,SAASM,eAAe,wBACzCqB,EAAWC,UAAY,GACvBzB,iBAAiB0B,QAAQ,CAACC,EAAMC,KAChCJ,EAAWC,WAAa,+CAA+CD,EAAWK,aAAa,cAAc,UAAUV,EAAWQ,EAAKzB,MAAM,iDAAmD0B,EAAM,GAAI,cAAgBA,EAAM,GAAI,qCAAuCA,EAAM,GAAzP,wCACCJ,EAAWK,aAAa,qBAAqB,UAAUV,EAAWQ,EAAKtB,aADxE,+BAECmB,EAAWK,aAAa,cAAc,UAAUV,EAAWQ,EAAKrB,MAFjE,+BAGCkB,EAAWK,aAAa,cAAc,UAAUV,EAAWQ,EAAKpB,KAAOoB,EAAKpB,KAAO,GAHpF,+BAICiB,EAAWK,aAAa,kBAAkB,UAAUV,EAAWQ,EAAKnB,SAAWmB,EAAKnB,SAAW,YAJhG,6IAK+GoB,EAAM,OAAOJ,EAAWK,aAAa,iBALpJ,yEAMkCV,EAAWQ,EAAKzB,MANlD,mEAOyCiB,EAAWQ,EAAKtB,aAPzD,4DAQkCc,EAAWQ,EAAKrB,MARlD,4DASkCa,EAAWQ,EAAKpB,MATlD,sEAUsCY,EAAWQ,EAAKnB,SAAWmB,EAAKnB,SAAW,YAAY,aAvBrHsB,GAAGC,YAAY,+BAA8B,SAAUH,GACvD5B,iBAAiBgC,OAAOJ,EAAM,GAC9BnB,OAwBAA,OAEAb,EAAEC,UAAUC,OAAM,WAClBF,EAAE,yBAAyBqC,QAAO,WAClCrC,EAAEsC,IAAIC,mBAAqB,4BAA8BvC,EAAEwC,MAAMC,MAAO,IAAK,SAASC,GACtF1C,EAAE,oBAAoB2C,KAAKD,MACxBE,MAAK,kBAGR5C,EAAEsC,IAAIC,mBAAqB,4BAA8BvC,EAAE,yBAAyByC,MAAQ,kCAAoC,IAAK,SAASC,GAC9I1C,EAAE,oBAAoB2C,KAAKD,MACxBE,MAAK","file":"69dd0a45af3af232b46fb9ee986ca329.js","sourcesContent":["$(document).ready(function() {\n$('#add-field-row button[name=\"custom_field_add\"]').click(function(){\nbotCommandFields.push({\n'name': document.getElementById('custom_field_name').value,\n'placeholder': document.getElementById('custom_field_placeholder').value,\n'type': document.getElementById('custom_field_type').value,\n'rows': document.getElementById('custom_field_rows').value,\n'required': document.getElementById('custom_field_required').value,\n});\nrenderPeriods()\n});\nvar entityMap = {\n'&': '&',\n'<': '<',\n'>': '>',\n'\"': '"',\n\"'\": ''',\n'/': '/',\n'`': '`',\n'=': '='\n};\nee.addListener('delete_custom_command_field',function (index) {\nbotCommandFields.splice(index,1);\nrenderPeriods();\n});\nfunction escapeHtml (string) {\nreturn String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\nreturn entityMap[s];\n});\n}\nfunction renderPeriods(){\nlet periodList = document.getElementById('field-rows-container');\nperiodList.innerHTML = '';\nbotCommandFields.forEach((item, index) => {\nperiodList.innerHTML += '
'+periodList.getAttribute('name-field')+' - '+escapeHtml(item.name)+'
{args.arg_' + (index+1) +'} or {arg_' + (index+1) +'} in bot, in Rest API {{args.arg_' + (index+1) +'}}
'+\n'
'+periodList.getAttribute('placeholder-field')+' - '+escapeHtml(item.placeholder) + '
'+\n'
'+periodList.getAttribute('type-field')+' - '+escapeHtml(item.type) + '
'+\n'
'+periodList.getAttribute('rows-field')+' - '+escapeHtml(item.rows ? item.rows : 1) + '
'+\n'
'+periodList.getAttribute('required-field')+' - '+escapeHtml(item.required ? item.required : 'required') + '
'+\n'
'+\n'' +\n'' +\n'' +\n'
'+\n'';\n});\n}\nrenderPeriods();\n});\n$(document).ready(function() {\n$('select[name=\"bot_id\"]').change(function(){\n$.get(WWW_DIR_JAVASCRIPT + 'genericbot/triggersbybot/' + $(this).val(), { }, function(data) {\n$('#trigger-list-id').html(data);\n}).fail(function() {\n});\n});\n$.get(WWW_DIR_JAVASCRIPT + 'genericbot/triggersbybot/' + $('select[name=\"bot_id\"]').val() + '/trigger_id?>', { }, function(data) {\n$('#trigger-list-id').html(data);\n}).fail(function() {\n});\n});\n"]} \ No newline at end of file +{"version":3,"sources":["69dd0a45af3af232b46fb9ee986ca329.js"],"names":["$","document","ready","click","botCommandFields","push","name","getElementById","value","placeholder","type","rows","required","renderPeriods","entityMap","&","<",">","\"","'","/","`","=","escapeHtml","string","String","replace","s","periodList","innerHTML","forEach","item","index","getAttribute","ee","addListener","splice"],"mappings":"AAAAA,EAAEC,UAAUC,OAAM,WAClBF,EAAE,kDAAkDG,OAAM,WAC1DC,iBAAiBC,KAAK,CACtBC,KAAQL,SAASM,eAAe,qBAAqBC,MACrDC,YAAeR,SAASM,eAAe,4BAA4BC,MACnEE,KAAQT,SAASM,eAAe,qBAAqBC,MACrDG,KAAQV,SAASM,eAAe,qBAAqBC,MACrDI,SAAYX,SAASM,eAAe,yBAAyBC,QAE7DK,OAEA,IAAIC,EAAY,CAChBC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,QACLC,IAAK,SACLC,IAAK,SACLC,IAAK,UAML,SAASC,EAAYC,GACrB,OAAOC,OAAOD,GAAQE,QAAQ,gBAAgB,SAAwBC,GACtE,OAAOb,EAAUa,MAGjB,SAASd,IACT,IAAIe,EAAa3B,SAASM,eAAe,wBACzCqB,EAAWC,UAAY,GACvBzB,iBAAiB0B,QAAQ,CAACC,EAAMC,KAChCJ,EAAWC,WAAa,+CAA+CD,EAAWK,aAAa,cAAc,UAAUV,EAAWQ,EAAKzB,MAAM,iDAAmD0B,EAAM,GAAI,cAAgBA,EAAM,GAAI,qCAAuCA,EAAM,GAAzP,wCACCJ,EAAWK,aAAa,qBAAqB,UAAUV,EAAWQ,EAAKtB,aADxE,+BAECmB,EAAWK,aAAa,cAAc,UAAUV,EAAWQ,EAAKrB,MAFjE,+BAGCkB,EAAWK,aAAa,cAAc,UAAUV,EAAWQ,EAAKpB,KAAOoB,EAAKpB,KAAO,GAHpF,+BAICiB,EAAWK,aAAa,kBAAkB,UAAUV,EAAWQ,EAAKnB,SAAWmB,EAAKnB,SAAW,YAJhG,6IAK+GoB,EAAM,OAAOJ,EAAWK,aAAa,iBALpJ,yEAMkCV,EAAWQ,EAAKzB,MANlD,mEAOyCiB,EAAWQ,EAAKtB,aAPzD,4DAQkCc,EAAWQ,EAAKrB,MARlD,4DASkCa,EAAWQ,EAAKpB,MATlD,sEAUsCY,EAAWQ,EAAKnB,SAAWmB,EAAKnB,SAAW,YAAY,aAvBrHsB,GAAGC,YAAY,+BAA8B,SAAUH,GACvD5B,iBAAiBgC,OAAOJ,EAAM,GAC9BnB,OAwBAA","file":"69dd0a45af3af232b46fb9ee986ca329.js","sourcesContent":["$(document).ready(function() {\n$('#add-field-row button[name=\"custom_field_add\"]').click(function(){\nbotCommandFields.push({\n'name': document.getElementById('custom_field_name').value,\n'placeholder': document.getElementById('custom_field_placeholder').value,\n'type': document.getElementById('custom_field_type').value,\n'rows': document.getElementById('custom_field_rows').value,\n'required': document.getElementById('custom_field_required').value,\n});\nrenderPeriods()\n});\nvar entityMap = {\n'&': '&',\n'<': '<',\n'>': '>',\n'\"': '"',\n\"'\": ''',\n'/': '/',\n'`': '`',\n'=': '='\n};\nee.addListener('delete_custom_command_field',function (index) {\nbotCommandFields.splice(index,1);\nrenderPeriods();\n});\nfunction escapeHtml (string) {\nreturn String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\nreturn entityMap[s];\n});\n}\nfunction renderPeriods(){\nlet periodList = document.getElementById('field-rows-container');\nperiodList.innerHTML = '';\nbotCommandFields.forEach((item, index) => {\nperiodList.innerHTML += '
'+periodList.getAttribute('name-field')+' - '+escapeHtml(item.name)+'
{args.arg_' + (index+1) +'} or {arg_' + (index+1) +'} in bot, in Rest API {{args.arg_' + (index+1) +'}}
'+\n'
'+periodList.getAttribute('placeholder-field')+' - '+escapeHtml(item.placeholder) + '
'+\n'
'+periodList.getAttribute('type-field')+' - '+escapeHtml(item.type) + '
'+\n'
'+periodList.getAttribute('rows-field')+' - '+escapeHtml(item.rows ? item.rows : 1) + '
'+\n'
'+periodList.getAttribute('required-field')+' - '+escapeHtml(item.required ? item.required : 'required') + '
'+\n'
'+\n'' +\n'' +\n'' +\n'
'+\n'';\n});\n}\nrenderPeriods();\n});\n"]} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/lhc.botcommand.js b/lhc_web/design/defaulttheme/js/lhc.botcommand.js index a83e2b3d95..0a9c9f6d5c 100644 --- a/lhc_web/design/defaulttheme/js/lhc.botcommand.js +++ b/lhc_web/design/defaulttheme/js/lhc.botcommand.js @@ -50,19 +50,4 @@ $(document).ready(function() { }); } renderPeriods(); -}); - -$(document).ready(function() { - $('select[name="bot_id"]').change(function(){ - $.get(WWW_DIR_JAVASCRIPT + 'genericbot/triggersbybot/' + $(this).val(), { }, function(data) { - $('#trigger-list-id').html(data); - }).fail(function() { - - }); - }); - $.get(WWW_DIR_JAVASCRIPT + 'genericbot/triggersbybot/' + $('select[name="bot_id"]').val() + '/trigger_id?>', { }, function(data) { - $('#trigger-list-id').html(data); - }).fail(function() { - - }); }); \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/tpl/lhgenericbot/form_command.tpl.php b/lhc_web/design/defaulttheme/tpl/lhgenericbot/form_command.tpl.php index c17ef0102b..dc5cb411f7 100644 --- a/lhc_web/design/defaulttheme/tpl/lhgenericbot/form_command.tpl.php +++ b/lhc_web/design/defaulttheme/tpl/lhgenericbot/form_command.tpl.php @@ -123,6 +123,20 @@