From 87e42b7cc2817d91ad2e4cb02aed2fe44fdc748a Mon Sep 17 00:00:00 2001 From: ProjextSoft-STUDIONIONS Date: Sun, 1 Feb 2026 14:14:52 +0400 Subject: [PATCH 1/2] A localization fix has been added to the modxlink plugin for TinyMCE4. Added localization `modxlink/langs/ru.js` --- .../tinymce4/tinymce/plugins/modxlink/langs/ru.js | 3 +++ .../tinymce4/tinymce/plugins/modxlink/plugin.js | 2 ++ .../tinymce/plugins/modxlink/plugin.min.js | 14 +++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js diff --git a/assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js b/assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js new file mode 100644 index 0000000000..7eb5af680d --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js @@ -0,0 +1,3 @@ +tinymce.addI18n("ru", { + "Search in EVO": "Поиск в EVO" +}); \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.js b/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.js index e986e4876c..b1ef2d25f5 100644 --- a/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.js +++ b/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.js @@ -8,6 +8,7 @@ * Author: markwillis82 * Date: 7/7/15 * update 64j 8/11/17 + * update ProjectSoft 2026-02-01 */ // Handles selection from Modx-Ressource-Tree @@ -1081,6 +1082,7 @@ var autoComplt = (function() { return publicProps; }()); +tinymce.PluginManager.requireLangPack("modxlink","ru"); tinymce.PluginManager.add('modxlink', function(editor) { function createLinkList(callback) { diff --git a/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.min.js b/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.min.js index fc3ec01083..f214427e02 100644 --- a/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.min.js +++ b/assets/plugins/tinymce4/tinymce/plugins/modxlink/plugin.min.js @@ -1 +1,13 @@ -if(typeof parent.modx!=='undefined' && typeof parent.modx.tree!=='undefined')var modxOldRessourceId=parent.modx.tree.itemToChange,modxLinkTitle="",checkModxTreeUpdateInterval=void 0,checkModxTreeUpdate=function(){checkModxTreeUpdateInterval=setTimeout(checkModxTreeUpdate,100),parent.modx.tree.itemToChange!=modxOldRessourceId&&(modxOldRessourceId=parent.modx.tree.itemToChange,modxLinkTitle=parent.modx.tree.selectedObjectName,document.getElementById("link-href-inp").value="[~"+modxOldRessourceId+"~]",document.getElementById("text-to-display").value||(document.getElementById("text-to-display").value=modxLinkTitle))};var autoComplt=function(){"use strict";Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){if(void 0===this||null===this)throw new TypeError('"this" is null or not defined');var n=this.length>>>0;for(e=+e||0,Math.abs(e)===1/0&&(e=0),e<0&&(e+=n)<0&&(e=0);e=0?o.modeMobile:function(){var t=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent;null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e)&&(t=+RegExp.$1)}return-1===t?NaN:t}()<=9?o.modePC:n().windowWidth>o.modeMobileW?o.modePC:o.modeMobile},n=function(){return window.innerWidth?{windowWidth:window.innerWidth,windowHeight:window.innerHeight}:document.documentElement.offsetHeight?{windowWidth:document.documentElement.offsetWidth,windowHeight:document.documentElement.offsetHeight}:document.body.offsetHeight?{windowWidth:document.body.offsetWidth,windowHeight:document.body.offsetHeight}:document.documentElement.clientHeight?{windowWidth:document.documentElement.clientWidth,windowHeight:document.documentElement.clientHeight}:document.body.clientHeight?{windowWidth:document.body.clientWidth,windowHeight:document.body.clientHeight}:{windowWidth:-1,windowHeight:-1}},o=(o=t={},t.modePC="modePC",t.modeMobile="modeMobile",t.modeMobileW=768,t.autoCompltListClass="autoComplt-list",t.autoCompltHintClass="autoComplt-hint",t.autoCompltHintSelectedClass="autoComplt-hint-selected",t.maxHintNum=e()===o.modePC?10:5,t.autoCompltDelay=250,t.hiddenArg_close_list_n_make_final_selection="hiddenArg_close_list_n_make_final_selection",t.listStatus={attr:"data-listStatus",open:"open"},t.keyCode={up:38,down:40,esc:27,enter:13},t.defaultStyles={autoCompltList:{maxHeight:"none",border:"1px solid #aaa",padding:"0",margin:"0",zIndex:99999,overflowX:"hidden",overflowY:"auto",display:"none",position:"absolute",backgroundColor:"#fff"},autoCompltHint:{height:"1.5em",padding:e()===o.modePC?"2px 6px 2px 10px":"6px 6px 6px 10px",margin:"6px 0",overflow:"hidden",listStyleType:"none",color:"#000",backgroundColor:"#fff",cursor:"default",fontSize:"1em"},autoCompltHintSelected:{color:"#fff",backgroundColor:"#3399ff"}},t.adjStyleAttrs={autoCompltList:["border","maxHeight","backgroundColor"],autoCompltHint:["height","padding","margin","color","backgroundColor","fontSize"],autoCompltHintSelected:["color","backgroundColor"]},t.listenersSupported=["select"],o),i=function(t){return t||(t=window.event),t.target||(t.target=t.srcElement),t.stopBubble=function(){this.cancelBubble=!0,this.stopPropagation&&this.stopPropagation()},t.stopDefault=function(){return this.preventDefault&&this.preventDefault(),this.returnValue=!1,!1},t},l=function(t,e,n){t.addEventListener?t.addEventListener(e,n):t.attachEvent&&t.attachEvent("on"+e,n)},a=function(t,e,n){t.removeEventListener?t.removeEventListener(e,n):t.detachEvent&&t.detachEvent("on"+e,n)},s=function(t,e){var n=null;if(window.getComputedStyle)n=window.getComputedStyle(t)[e]||null;else if(t.currentStyle){n=t.currentStyle&&t.currentStyle[e];var o,i,l=t.style;null==n&&l&&l[e]&&(n=l[e]),o=l.left,(i=t.runtimeStyle&&t.runtimeStyle.left)&&(t.runtimeStyle.left=t.currentStyle.left),l.left="fontSize"===e?"1em":n,n=l.pixelLeft+"px",l.left=o,i&&(t.runtimeStyle.left=i)}return n},r={buildElem:function(t){var e=document.createElement("DIV");return e.innerHTML=t,e.firstChild.cloneNode(!0)},buildHint:function(t,e){return"string"==typeof t&&t?((t=this.buildElem('
  • '+t+"
  • ")).style.height=t.style.lineHeight=e.autoCompltHint.height,t.style.padding=e.autoCompltHint.padding,t.style.margin=e.autoCompltHint.margin,t.style.overflow=e.autoCompltHint.overflow,t.style.listStyleType=e.autoCompltHint.listStyleType,t.style.color=e.autoCompltHint.color,t.style.backgroundColor=e.autoCompltHint.backgroundColor,t.style.cursor=e.autoCompltHint.cursor,t.style.fontSize=e.autoCompltHint.fontSize,t):null},buildList:function(t){var e=this.buildElem('');return e.style.maxHeight=t.autoCompltList.maxHeight,e.style.border=t.autoCompltList.border,e.style.padding=t.autoCompltList.padding,e.style.margin=t.autoCompltList.margin,e.style.zIndex=t.autoCompltList.zIndex,e.style.overflowX=t.autoCompltList.overflowX,e.style.overflowY=t.autoCompltList.overflowY,e.style.display=t.autoCompltList.display,e.style.position=t.autoCompltList.position,e.style.backgroundColor=t.autoCompltList.backgroundColor,e}},u=function(t){this.uiElem=null,this.assocInput=t,this.mouseOnList=!1,this.onMouseSelectionListener=null,this.maxHintNum=o.maxHintNum,this.styles=JSON.parse(JSON.stringify(o.defaultStyles))};return u.prototype.genList=function(){if(!this.uiElem){var t=this;this.uiElem=r.buildList(this.styles),l(this.uiElem,"mouseover",function(e){e=i(e),t.isHint(e.target)&&(t.pick(e.target),t.autoScroll())}),l(this.uiElem,"mouseout",function(e){t.unpick()}),l(this.uiElem,"mousedown",function(e){t.mouseOnList=!0,setTimeout(function(){t.assocInput.focus()},50)}),l(this.uiElem,"mouseup",function(e){e=i(e),t.isHint(e.target)&&(t.pick(e.target),"function"==typeof t.onMouseSelectionListener&&t.onMouseSelectionListener())}),document.body.appendChild(this.uiElem)}},u.prototype.isHint=function(t){return!(!t||"object"!=typeof t||1!==t.nodeType)&&(" "+t.className+" ").indexOf(" "+o.autoCompltHintClass+" ")>=0},u.prototype.putHints=function(t){var e=0;if(t instanceof Array){var n,o,i=[];for(o=Math.min(t.length,this.maxHintNum),n=0;n0){var l=document.createDocumentFragment();for(n=0,e=i.length;n=0||-1===t)){var n=this.uiElem.querySelectorAll("."+o.autoCompltHintClass);n.length>0&&(e=n[e=-1===(e=+t)||e>n.length-1?n.length-1:e])}null!==e&&(this.unpick(),e.className+=" "+o.autoCompltHintSelectedClass,e.style.color=this.styles.autoCompltHintSelected.color,e.style.backgroundColor=this.styles.autoCompltHintSelected.backgroundColor)}},u.prototype.unpick=function(){if(this.uiElem){var t=this.getPicked();t&&(t.className=o.autoCompltHintClass,t.style.color=this.styles.autoCompltHint.color,t.style.backgroundColor=this.styles.autoCompltHint.backgroundColor)}},u.prototype.getPicked=function(){return this.uiElem&&this.uiElem.querySelector("."+o.autoCompltHintSelectedClass)||null},{enable:function(t,n){if(t&&"object"==typeof t&&"string"==typeof t.tagName&&"input"==t.tagName.toLowerCase()&&"text"==t.type&&1===t.nodeType&&!t.autoComplt){t.autoComplt={};var s=o.autoCompltDelay,r=!0,c="",d=null,m=null,p=new u(t),f=function(){if(t.value.length>0&&r&&"function"==typeof d&&c!==t.value){var e={that:t,compltTarget:c=t.value,compltTargetMatchCurrentTarget:function(){return e.compltTarget===c},call:function(){e.compltTargetMatchCurrentTarget()&&d.call(e.that,e.compltTarget,e.openHint)},openHint:function(t){e.compltTargetMatchCurrentTarget()&&(p.putHints(t)?p.open():e.that.autoComplt.close())}};setTimeout(e.call,s)}},h=function(){if(r){var e=p.getPicked();t.value=e?e.innerHTML:c}},g=function(e){p.mouseOnList?(t.focus(),p.mouseOnList=!1):p.isOpen()&&t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection)},y=function(n){if(e()!==o.modeMobile&&(n=i(n),r))if("keydown"!=n.type||!p.isOpen()||n.keyCode!==o.keyCode.up&&n.keyCode!==o.keyCode.down){if("keyup"==n.type){var l=!1;switch(n.keyCode){case o.keyCode.up:case o.keyCode.down:p.isOpen()||(l=!0);break;case o.keyCode.esc:p.isOpen()&&(t.value=c,t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection));break;case o.keyCode.enter:p.isOpen()&&(h(),t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection));break;default:l=!0}l&&(t.value.length>0?f():t.autoComplt.close())}}else{var a=p.getPicked();n.keyCode===o.keyCode.up?a?a.previousSibling?p.pick(a.previousSibling):p.unpick():p.pick(-1):n.keyCode===o.keyCode.down&&(a?a.nextSibling?p.pick(a.nextSibling):p.unpick():p.pick(0)),p.autoScroll(),h()}};return t.autoComplt.setHintsFetcher=function(t){return(null===t||"function"==typeof t)&&(d=t,!0)},t.autoComplt.setListener=function(t,e){return(null===e||"function"==typeof e)&&o.listenersSupported.indexOf(t)>=0&&(null==m&&(m={}),m[t]=e,!0)},t.autoComplt.setStyles=function(t,e){var n,i,l=!1;switch(t){case o.autoCompltListClass:n=p.styles.autoCompltList,i=o.adjStyleAttrs.autoCompltList;break;case o.autoCompltHintClass:n=p.styles.autoCompltHint,i=o.adjStyleAttrs.autoCompltHint;break;case o.autoCompltHintSelectedClass:n=p.styles.autoCompltHintSelected,i=o.adjStyleAttrs.autoCompltHintSelected}if(e instanceof Object&&n&&i)for(var a=0;a0&&(n||(n={}),s=n.delay=e),void 0!==t.maxHintNum&&(e=Math.floor(t.maxHintNum))>0&&(n||(n={}),p.maxHintNum=n.maxHintNum=e));return n},t.autoComplt.close=function(){var e;c="",p.close(),r&&""!==t.value&&arguments[0]===o.hiddenArg_close_list_n_make_final_selection&&(e="select",null!=m&&"function"==typeof m[e]&&m[e].call(t))},t.autoComplt.enable=function(){r=!0},t.autoComplt.disable=function(){r=!1,this.close()},t.autoComplt.destroy=function(){a(t,"blur",g),a(t,"keyup",y),a(t,"keydown",y),this.disable(),delete t.autoComplt},p.onMouseSelectionListener=function(){h(),t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection)},l(t,"blur",g),l(t,"keyup",y),l(t,"keydown",y),l(t,"input",function(n){e()!==o.modePC&&(t.value.length>0?f():t.autoComplt.close())}),n instanceof Object&&(t.autoComplt.config(n),t.autoComplt.setHintsFetcher(n.hintsFetcher)),t}return null}}}();tinymce.PluginManager.add("modxlink",function(t){function e(e){return function(){var n=t.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(t){e(tinymce.util.JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}}function n(t,e,n){return function t(n,o){return o=o||[],tinymce.each(n,function(n){var i={text:n.text||n.title};n.menu?i.menu=t(n.menu):(i.value=n.value,e&&e(i)),o.push(i)}),o}(t,n||[])}function o(e){parent.tree&&(parent.tree.ca="disabled",checkModxTreeUpdate.call(this));var o,i,l,a,s,r,u,c,d,m,p,f,h={},g=t.selection,y=t.dom;function C(t){var e=a.find("#text");(!e.value()||t.lastControl&&e.value()==t.lastControl.text())&&e.value(t.control.text()),a.find("#href").value(t.control.value())}function v(){!l&&0===h.text.length&&s&&this.parent().parent().find("#text")[0].value(this.value())}o=g.getNode(),i=y.getParent(o,"a[href]"),s=function(t){var e=g.getContent();if(/]+>[^<]+<\/a>$/.test(e)||-1==e.indexOf("href=")))return!1;if(t){var n,o=t.childNodes;if(0===o.length)return!1;for(n=o.length-1;n>=0;n--)if(3!=o[n].nodeType)return!1}return!0}(),h.text=l=i?i.innerText||i.textContent:g.getContent({format:"text"}),h.href=i?y.getAttrib(i,"href"):"",i?h.target=y.getAttrib(i,"target"):t.settings.default_link_target&&(h.target=t.settings.default_link_target),(f=y.getAttrib(i,"rel"))&&(h.rel=f),(f=y.getAttrib(i,"class"))&&(h.class=f),(f=y.getAttrib(i,"title"))&&(h.title=f),s&&(r={name:"text",type:"textbox",size:40,label:"Text to display",id:"text-to-display",onchange:function(){h.text=this.value()}}),e&&(u={type:"listbox",label:"Link list",values:n(e,function(e){e.value=t.convertURL(e.value||e.url,"href")},[{text:"None",value:""}]),onselect:C,value:t.convertURL(h.href,"href"),onPostRender:function(){u=this}}),!1!==t.settings.target_list&&(t.settings.target_list||(t.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),d={name:"target",type:"listbox",label:"Target",values:n(t.settings.target_list)}),t.settings.rel_list&&(c={name:"rel",type:"listbox",label:"Rel",values:n(t.settings.rel_list)}),t.settings.link_class_list&&(m={name:"class",type:"listbox",label:"Class",values:n(t.settings.link_class_list,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({inline:"a",classes:[e.value]})})})}),!1!==t.settings.link_title&&(p={name:"title",type:"textbox",label:"Title",value:h.title}),a=t.windowManager.open({title:"Insert link",data:h,body:[{name:"href",type:"FileImagePicker",filetype:"file",size:40,autofocus:!0,label:"Url",id:"link-href",onchange:function(e){var n=e.meta||{};u&&u.value(t.convertURL(this.value(),"href")),tinymce.each(e.meta,function(t,e){a.find("#"+e).value(t)}),n.text||v.call(this)},onkeyup:v},{name:"search",type:"textbox",label:"Search in EVO",id:"link-search"},r,p,function(e){var n=[];if(tinymce.each(t.dom.select("a:not([href])"),function(t){var o=t.name||t.id;o&&n.push({text:o,value:"#"+o,selected:-1!=e.indexOf("#"+o)})}),n.length)return n.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:n,onselect:C}}(h.href),u,c,d,m],onSubmit:function(e){var n;function o(e,n){var o=t.selection.getRng();window.setTimeout(function(){t.windowManager.confirm(e,function(e){t.selection.setRng(o),n(e)})},0)}function a(){parent.tree&&(parent.tree.ca="",clearTimeout(checkModxTreeUpdateInterval));var e={href:n,target:h.target?h.target:null,rel:h.rel?h.rel:null,class:h.class?h.class:null,title:h.title?h.title:null};i?(t.focus(),s&&h.text!=l&&("innerText"in i?i.innerText=h.text:i.textContent=h.text),y.setAttribs(i,e),g.select(i),t.undoManager.add()):s?t.insertContent(y.createHTML("a",e,y.encode(h.text))):t.execCommand("mceInsertLink",!1,e)}h=tinymce.extend(h,e.data),(n=h.href)?n.indexOf("@")>0&&-1==n.indexOf("//")&&-1==n.indexOf("mailto:")?o("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(n="mailto:"+n),a()}):t.settings.link_assume_external_targets&&!/^\w+:/i.test(n)||!t.settings.link_assume_external_targets&&/^\s*www\./i.test(n)?o("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(n="http://"+n),a()}):a():t.execCommand("unlink")},onClose:function(t){parent.tree&&(parent.tree.ca="",clearTimeout(checkModxTreeUpdateInterval))}});var x=document.querySelector("#link-search"),b={};autoComplt.enable(x,{hintsFetcher:function(t,e){b={};var n=new XMLHttpRequest,o=encodeURI(tinymce4_baseUrl+"tinymce/plugins/modxlink/search.php?q="+t);n.open("GET",o),n.onload=function(){if(200===n.status){for(var t=JSON.parse(n.responseText),i=[],l=0;l',e.classes.add("has-open"),'
    '+t+"
    "}}))}); +/** + * modxlink.js + * + * Based on link.js but with resource search added. + * + * By default both pagetitle and alias are searched. + * + * Author: markwillis82 + * Date: 7/7/15 + * update 64j 8/11/17 + * update ProjectSoft 2026-02-01 + */ +if(void 0!==parent.modx&&void 0!==parent.modx.tree)var modxOldRessourceId=parent.modx.tree.itemToChange,modxLinkTitle="",checkModxTreeUpdateInterval=void 0,checkModxTreeUpdate=function(){checkModxTreeUpdateInterval=setTimeout(checkModxTreeUpdate,100),parent.modx.tree.itemToChange!=modxOldRessourceId&&(modxOldRessourceId=parent.modx.tree.itemToChange,modxLinkTitle=parent.modx.tree.selectedObjectName,document.getElementById("link-href-inp").value="[~"+modxOldRessourceId+"~]",document.getElementById("text-to-display").value||(document.getElementById("text-to-display").value=modxLinkTitle))};var autoComplt=function(){"use strict";Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=this.length>>>0;for(e=+e||0,Math.abs(e)===1/0&&(e=0),e<0&&(e+=n)<0&&(e=0);e=0?o.modeMobile:function(){var t=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent;null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e)&&(t=+RegExp.$1)}return-1===t?NaN:t}()<=9?o.modePC:n().windowWidth>o.modeMobileW?o.modePC:o.modeMobile},n=function(){return window.innerWidth?{windowWidth:window.innerWidth,windowHeight:window.innerHeight}:document.documentElement.offsetHeight?{windowWidth:document.documentElement.offsetWidth,windowHeight:document.documentElement.offsetHeight}:document.body.offsetHeight?{windowWidth:document.body.offsetWidth,windowHeight:document.body.offsetHeight}:document.documentElement.clientHeight?{windowWidth:document.documentElement.clientWidth,windowHeight:document.documentElement.clientHeight}:document.body.clientHeight?{windowWidth:document.body.clientWidth,windowHeight:document.body.clientHeight}:{windowWidth:-1,windowHeight:-1}},o=(o=t={},t.modePC="modePC",t.modeMobile="modeMobile",t.modeMobileW=768,t.autoCompltListClass="autoComplt-list",t.autoCompltHintClass="autoComplt-hint",t.autoCompltHintSelectedClass="autoComplt-hint-selected",t.maxHintNum=e()===o.modePC?10:5,t.autoCompltDelay=250,t.hiddenArg_close_list_n_make_final_selection="hiddenArg_close_list_n_make_final_selection",t.listStatus={attr:"data-listStatus",open:"open"},t.keyCode={up:38,down:40,esc:27,enter:13},t.defaultStyles={autoCompltList:{maxHeight:"none",border:"1px solid #aaa",padding:"0",margin:"0",zIndex:99999,overflowX:"hidden",overflowY:"auto",display:"none",position:"absolute",backgroundColor:"#fff"},autoCompltHint:{height:"1.5em",padding:e()===o.modePC?"2px 6px 2px 10px":"6px 6px 6px 10px",margin:"6px 0",overflow:"hidden",listStyleType:"none",color:"#000",backgroundColor:"#fff",cursor:"default",fontSize:"1em"},autoCompltHintSelected:{color:"#fff",backgroundColor:"#3399ff"}},t.adjStyleAttrs={autoCompltList:["border","maxHeight","backgroundColor"],autoCompltHint:["height","padding","margin","color","backgroundColor","fontSize"],autoCompltHintSelected:["color","backgroundColor"]},t.listenersSupported=["select"],o),i=function(t){return t||(t=window.event),t.target||(t.target=t.srcElement),t.stopBubble=function(){this.cancelBubble=!0,this.stopPropagation&&this.stopPropagation()},t.stopDefault=function(){return this.preventDefault&&this.preventDefault(),this.returnValue=!1,!1},t},l=function(t,e,n){t.addEventListener?t.addEventListener(e,n):t.attachEvent&&t.attachEvent("on"+e,n)},a=function(t,e,n){t.removeEventListener?t.removeEventListener(e,n):t.detachEvent&&t.detachEvent("on"+e,n)},s=function(t,e){var n=null;if(window.getComputedStyle)n=window.getComputedStyle(t)[e]||null;else if(t.currentStyle){n=t.currentStyle&&t.currentStyle[e];var o,i,l=t.style;null==n&&l&&l[e]&&(n=l[e]),o=l.left,(i=t.runtimeStyle&&t.runtimeStyle.left)&&(t.runtimeStyle.left=t.currentStyle.left),l.left="fontSize"===e?"1em":n,n=l.pixelLeft+"px",l.left=o,i&&(t.runtimeStyle.left=i)}return n},r={buildElem:function(t){var e=document.createElement("DIV");return e.innerHTML=t,e.firstChild.cloneNode(!0)},buildHint:function(t,e){return"string"==typeof t&&t?((t=this.buildElem('
  • '+t+"
  • ")).style.height=t.style.lineHeight=e.autoCompltHint.height,t.style.padding=e.autoCompltHint.padding,t.style.margin=e.autoCompltHint.margin,t.style.overflow=e.autoCompltHint.overflow,t.style.listStyleType=e.autoCompltHint.listStyleType,t.style.color=e.autoCompltHint.color,t.style.backgroundColor=e.autoCompltHint.backgroundColor,t.style.cursor=e.autoCompltHint.cursor,t.style.fontSize=e.autoCompltHint.fontSize,t):null},buildList:function(t){var e=this.buildElem('
      ');return e.style.maxHeight=t.autoCompltList.maxHeight,e.style.border=t.autoCompltList.border,e.style.padding=t.autoCompltList.padding,e.style.margin=t.autoCompltList.margin,e.style.zIndex=t.autoCompltList.zIndex,e.style.overflowX=t.autoCompltList.overflowX,e.style.overflowY=t.autoCompltList.overflowY,e.style.display=t.autoCompltList.display,e.style.position=t.autoCompltList.position,e.style.backgroundColor=t.autoCompltList.backgroundColor,e}},u=function(t){this.uiElem=null,this.assocInput=t,this.mouseOnList=!1,this.onMouseSelectionListener=null,this.maxHintNum=o.maxHintNum,this.styles=JSON.parse(JSON.stringify(o.defaultStyles))};return u.prototype.genList=function(){if(!this.uiElem){var t=this;this.uiElem=r.buildList(this.styles),l(this.uiElem,"mouseover",function(e){e=i(e),t.isHint(e.target)&&(t.pick(e.target),t.autoScroll())}),l(this.uiElem,"mouseout",function(e){t.unpick()}),l(this.uiElem,"mousedown",function(e){t.mouseOnList=!0,setTimeout(function(){t.assocInput.focus()},50)}),l(this.uiElem,"mouseup",function(e){e=i(e),t.isHint(e.target)&&(t.pick(e.target),"function"==typeof t.onMouseSelectionListener&&t.onMouseSelectionListener())}),document.body.appendChild(this.uiElem)}},u.prototype.isHint=function(t){return!(!t||"object"!=typeof t||1!==t.nodeType)&&(" "+t.className+" ").indexOf(" "+o.autoCompltHintClass+" ")>=0},u.prototype.putHints=function(t){var e=0;if(t instanceof Array){var n,o,i=[];for(o=Math.min(t.length,this.maxHintNum),n=0;n0){var l=document.createDocumentFragment();for(n=0,e=i.length;n=0||-1===t)){var n=this.uiElem.querySelectorAll("."+o.autoCompltHintClass);n.length>0&&(e=n[e=-1===(e=+t)||e>n.length-1?n.length-1:e])}null!==e&&(this.unpick(),e.className+=" "+o.autoCompltHintSelectedClass,e.style.color=this.styles.autoCompltHintSelected.color,e.style.backgroundColor=this.styles.autoCompltHintSelected.backgroundColor)}},u.prototype.unpick=function(){if(this.uiElem){var t=this.getPicked();t&&(t.className=o.autoCompltHintClass,t.style.color=this.styles.autoCompltHint.color,t.style.backgroundColor=this.styles.autoCompltHint.backgroundColor)}},u.prototype.getPicked=function(){return this.uiElem&&this.uiElem.querySelector("."+o.autoCompltHintSelectedClass)||null},{enable:function(t,n){if(t&&"object"==typeof t&&"string"==typeof t.tagName&&"input"==t.tagName.toLowerCase()&&"text"==t.type&&1===t.nodeType&&!t.autoComplt){t.autoComplt={};var s=o.autoCompltDelay,r=!0,c="",d=null,m=null,p=new u(t),f=function(){if(t.value.length>0&&r&&"function"==typeof d&&c!==t.value){var e={that:t,compltTarget:c=t.value,compltTargetMatchCurrentTarget:function(){return e.compltTarget===c},call:function(){e.compltTargetMatchCurrentTarget()&&d.call(e.that,e.compltTarget,e.openHint)},openHint:function(t){e.compltTargetMatchCurrentTarget()&&(p.putHints(t)?p.open():e.that.autoComplt.close())}};setTimeout(e.call,s)}},h=function(){if(r){var e=p.getPicked();t.value=e?e.innerHTML:c}},g=function(e){p.mouseOnList?(t.focus(),p.mouseOnList=!1):p.isOpen()&&t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection)},y=function(n){if(e()!==o.modeMobile&&(n=i(n),r))if("keydown"!=n.type||!p.isOpen()||n.keyCode!==o.keyCode.up&&n.keyCode!==o.keyCode.down){if("keyup"==n.type){var l=!1;switch(n.keyCode){case o.keyCode.up:case o.keyCode.down:p.isOpen()||(l=!0);break;case o.keyCode.esc:p.isOpen()&&(t.value=c,t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection));break;case o.keyCode.enter:p.isOpen()&&(h(),t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection));break;default:l=!0}l&&(t.value.length>0?f():t.autoComplt.close())}}else{var a=p.getPicked();n.keyCode===o.keyCode.up?a?a.previousSibling?p.pick(a.previousSibling):p.unpick():p.pick(-1):n.keyCode===o.keyCode.down&&(a?a.nextSibling?p.pick(a.nextSibling):p.unpick():p.pick(0)),p.autoScroll(),h()}};return t.autoComplt.setHintsFetcher=function(t){return(null===t||"function"==typeof t)&&(d=t,!0)},t.autoComplt.setListener=function(t,e){return(null===e||"function"==typeof e)&&o.listenersSupported.indexOf(t)>=0&&(null==m&&(m={}),m[t]=e,!0)},t.autoComplt.setStyles=function(t,e){var n,i,l=!1;switch(t){case o.autoCompltListClass:n=p.styles.autoCompltList,i=o.adjStyleAttrs.autoCompltList;break;case o.autoCompltHintClass:n=p.styles.autoCompltHint,i=o.adjStyleAttrs.autoCompltHint;break;case o.autoCompltHintSelectedClass:n=p.styles.autoCompltHintSelected,i=o.adjStyleAttrs.autoCompltHintSelected}if(e instanceof Object&&n&&i)for(var a=0;a0&&(n||(n={}),s=n.delay=e),void 0!==t.maxHintNum&&(e=Math.floor(t.maxHintNum))>0&&(n||(n={}),p.maxHintNum=n.maxHintNum=e));return n},t.autoComplt.close=function(){var e;c="",p.close(),r&&""!==t.value&&arguments[0]===o.hiddenArg_close_list_n_make_final_selection&&(e="select",null!=m&&"function"==typeof m[e]&&m[e].call(t))},t.autoComplt.enable=function(){r=!0},t.autoComplt.disable=function(){r=!1,this.close()},t.autoComplt.destroy=function(){a(t,"blur",g),a(t,"keyup",y),a(t,"keydown",y),this.disable(),delete t.autoComplt},p.onMouseSelectionListener=function(){h(),t.autoComplt.close(o.hiddenArg_close_list_n_make_final_selection)},l(t,"blur",g),l(t,"keyup",y),l(t,"keydown",y),l(t,"input",function(n){e()!==o.modePC&&(t.value.length>0?f():t.autoComplt.close())}),n instanceof Object&&(t.autoComplt.config(n),t.autoComplt.setHintsFetcher(n.hintsFetcher)),t}return null}}}();tinymce.PluginManager.requireLangPack("modxlink","ru"),tinymce.PluginManager.add("modxlink",function(t){function e(e){return function(){var n=t.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(t){e(tinymce.util.JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}}function n(t,e,n){return function t(n,o){return o=o||[],tinymce.each(n,function(n){var i={text:n.text||n.title};n.menu?i.menu=t(n.menu):(i.value=n.value,e&&e(i)),o.push(i)}),o}(t,n||[])}function o(e){parent.tree&&(parent.tree.ca="disabled",checkModxTreeUpdate.call(this));var o,i,l,a,s,r,u,c,d,m,p,f,h={},g=t.selection,y=t.dom;function C(t){var e=a.find("#text");(!e.value()||t.lastControl&&e.value()==t.lastControl.text())&&e.value(t.control.text()),a.find("#href").value(t.control.value())}function v(){!l&&0===h.text.length&&s&&this.parent().parent().find("#text")[0].value(this.value())}o=g.getNode(),i=y.getParent(o,"a[href]"),s=function(t){var e=g.getContent();if(/]+>[^<]+<\/a>$/.test(e)||-1==e.indexOf("href=")))return!1;if(t){var n,o=t.childNodes;if(0===o.length)return!1;for(n=o.length-1;n>=0;n--)if(3!=o[n].nodeType)return!1}return!0}(),h.text=l=i?i.innerText||i.textContent:g.getContent({format:"text"}),h.href=i?y.getAttrib(i,"href"):"",i?h.target=y.getAttrib(i,"target"):t.settings.default_link_target&&(h.target=t.settings.default_link_target),(f=y.getAttrib(i,"rel"))&&(h.rel=f),(f=y.getAttrib(i,"class"))&&(h.class=f),(f=y.getAttrib(i,"title"))&&(h.title=f),s&&(r={name:"text",type:"textbox",size:40,label:"Text to display",id:"text-to-display",onchange:function(){h.text=this.value()}}),e&&(u={type:"listbox",label:"Link list",values:n(e,function(e){e.value=t.convertURL(e.value||e.url,"href")},[{text:"None",value:""}]),onselect:C,value:t.convertURL(h.href,"href"),onPostRender:function(){u=this}}),!1!==t.settings.target_list&&(t.settings.target_list||(t.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),d={name:"target",type:"listbox",label:"Target",values:n(t.settings.target_list)}),t.settings.rel_list&&(c={name:"rel",type:"listbox",label:"Rel",values:n(t.settings.rel_list)}),t.settings.link_class_list&&(m={name:"class",type:"listbox",label:"Class",values:n(t.settings.link_class_list,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({inline:"a",classes:[e.value]})})})}),!1!==t.settings.link_title&&(p={name:"title",type:"textbox",label:"Title",value:h.title}),a=t.windowManager.open({title:"Insert link",data:h,body:[{name:"href",type:"FileImagePicker",filetype:"file",size:40,autofocus:!0,label:"Url",id:"link-href",onchange:function(e){var n=e.meta||{};u&&u.value(t.convertURL(this.value(),"href")),tinymce.each(e.meta,function(t,e){a.find("#"+e).value(t)}),n.text||v.call(this)},onkeyup:v},{name:"search",type:"textbox",label:"Search in EVO",id:"link-search"},r,p,function(e){var n=[];if(tinymce.each(t.dom.select("a:not([href])"),function(t){var o=t.name||t.id;o&&n.push({text:o,value:"#"+o,selected:-1!=e.indexOf("#"+o)})}),n.length)return n.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:n,onselect:C}}(h.href),u,c,d,m],onSubmit:function(e){var n;function o(e,n){var o=t.selection.getRng();window.setTimeout(function(){t.windowManager.confirm(e,function(e){t.selection.setRng(o),n(e)})},0)}function a(){parent.tree&&(parent.tree.ca="",clearTimeout(checkModxTreeUpdateInterval));var e={href:n,target:h.target?h.target:null,rel:h.rel?h.rel:null,class:h.class?h.class:null,title:h.title?h.title:null};i?(t.focus(),s&&h.text!=l&&("innerText"in i?i.innerText=h.text:i.textContent=h.text),y.setAttribs(i,e),g.select(i),t.undoManager.add()):s?t.insertContent(y.createHTML("a",e,y.encode(h.text))):t.execCommand("mceInsertLink",!1,e)}h=tinymce.extend(h,e.data),(n=h.href)?n.indexOf("@")>0&&-1==n.indexOf("//")&&-1==n.indexOf("mailto:")?o("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(n="mailto:"+n),a()}):t.settings.link_assume_external_targets&&!/^\w+:/i.test(n)||!t.settings.link_assume_external_targets&&/^\s*www\./i.test(n)?o("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(n="http://"+n),a()}):a():t.execCommand("unlink")},onClose:function(t){parent.tree&&(parent.tree.ca="",clearTimeout(checkModxTreeUpdateInterval))}});var x=document.querySelector("#link-search"),b={};autoComplt.enable(x,{hintsFetcher:function(t,e){b={};var n=new XMLHttpRequest,o=encodeURI(tinymce4_baseUrl+"tinymce/plugins/modxlink/search.php?q="+t);n.open("GET",o),n.onload=function(){if(200===n.status){for(var t=JSON.parse(n.responseText),i=[],l=0;l',this.classes.add("has-open"),'
      '+t+"
      "}}))}); \ No newline at end of file From 7e09d3ae5d1e53d4ec8c390715661956f8f02233 Mon Sep 17 00:00:00 2001 From: ProjextSoft-STUDIONIONS Date: Sun, 1 Feb 2026 14:26:13 +0400 Subject: [PATCH 2/2] Minimized ru.js --- assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js b/assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js index 7eb5af680d..221111c6eb 100644 --- a/assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js +++ b/assets/plugins/tinymce4/tinymce/plugins/modxlink/langs/ru.js @@ -1,3 +1 @@ -tinymce.addI18n("ru", { - "Search in EVO": "Поиск в EVO" -}); \ No newline at end of file +tinymce.addI18n("ru",{"Search in EVO":"\u041f\u043e\u0438\u0441\u043a \u0432 EVO"}); \ No newline at end of file