PageSourceSearch

https://www.amoderm.com/wp-content/plugins/emo-questalk-pro/assets/js/emqa-mention-user.js

js amoderm.com collected 2026-10-06 16:22:42 UTC 5,879 bytes, 1 lines download raw bytes

1!function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],e="undefined"!=typeof window,o=e&&null!=window.mozInnerScreenX;function n(n,i,r){if(!e)throw Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var s=r&&r.debug||!1;if(s){var a=document.querySelector("#input-textarea-caret-position-mirror-div");a&&a.parentNode.removeChild(a)}var h=document.createElement("div");h.id="input-textarea-caret-position-mirror-div",document.body.appendChild(h);var l=h.style,d=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,u="INPUT"===n.nodeName;l.whiteSpace="pre-wrap",u||(l.wordWrap="break-word"),l.position="absolute",s||(l.visibility="hidden"),t.forEach(function(t){u&&"lineHeight"===t?l.lineHeight=d.height:l[t]=d[t]}),o?n.scrollHeight>parseInt(d.height)&&(l.overflowY="scroll"):l.overflow="hidden",h.textContent=n.value.substring(0,i),u&&(h.textContent=h.textContent.replace(/\s/g,"\xa0"));var p=document.createElement("span");p.textContent=n.value.substring(i)||".",h.appendChild(p);var c={top:p.offsetTop+parseInt(d.borderTopWidth),left:p.offsetLeft+parseInt(d.borderLeftWidth),height:parseInt(d.lineHeight)};return s?p.style.backgroundColor="#aaa":document.body.removeChild(h),c}"undefined"!=typeof module&&void 0!==module.exports?module.exports=n:e&&(window.getCaretCoordinates=n)}(),jQuery(document).ready(function(t){t.widget("ui.triggeredAutocomplete",t.extend({},t.ui.autocomplete.prototype,{options:{trigger:"@",emMinlength:1},_create:function(){var e=this;this.id_map={},this.stopIndex=-1,this.stopLength=-1,this.contents="",this.cursorPos=0;var o=this.element.attr("id_map");o&&(this.id_map=jQuery.parseJSON(o)),this.ac=t.ui.autocomplete.prototype,this.ac._create.apply(this,arguments),this.updateHidden(),this.options.select=function(t,o){var n=e.contents,i=e.cursorPos,r=n.substring(i,n.length),s=n.substring(0,i);return s=s.substring(0,s.lastIndexOf(e.options.trigger)),this.value=s+e.options.trigger+o.item.label+" "+r,e.id_map[o.item.label]=o.item.value,e.updateHidden(),!1},this.options.focus=function(){return!1},this.menu.options.blur=function(t,e){return!1},this.options.position={my:"left top",at:"left bottom"},this.element.focus(function(){e.updateHidden()}),this.element.change(function(){e.updateHidden()})},search:function(t,e){var o=this.element.val(),n=this.getCursor();if(this.contents=o,this.cursorPos=n,o.indexOf(this.options.trigger)>=0&&o.length>this.options.dwMinlength){var i=o.substring(0,n);i=i.substring(0,i.lastIndexOf(this.options.trigger));var r=getCaretCoordinates(this.element[0],i.length);this.options.position={my:"left+"+r.left+" top+"+(r.top+30),at:"left top",of:this.element[0]};var s=(o=o.substring(0,n)).substring(o.lastIndexOf(this.options.trigger)+1,o.length);if(this.stopIndex==o.lastIndexOf(this.options.trigger)&&s.length>this.stopLength&&(s=""),s.length>0)return this._search(s);this.close()}},_initSource:function(){var e,o,n=this;"emSource"===this.options.source?this.source=function(e,o){n.xhr&&n.xhr.abort(),n.xhr=t.ajax({url:this.options.emDataAjax.url,data:{action:this.options.emDataAjax.action,nonce:this.options.emDataAjax.nonce,name:e.term},type:this.options.emDataAjax.type,dataType:this.options.emDataAjax.dataType,success:function(i){void 0!==i&&i.success&&null!=i.result&&i.result.length>0?(o(t.map(i.result,function(t){return{label:t.name,value:t.id}})),n.stopLength=-1,n.stopIndex=-1):(n.stopLength=e.term.length,n.stopIndex=n.contents.lastIndexOf(n.options.trigger),n.close())}})}:t.isArray(this.options.source)?(e=this.options.source,this.source=function(o,n){n(t.ui.autocomplete.filter(e,o.term))}):"string"==typeof this.options.source?(o=this.options.source,this.source=function(e,i){n.xhr&&n.xhr.abort(),n.xhr=t.ajax({url:o,data:e,dataType:"json",success:function(o){null!=o?(i(t.map(o,function(t){return{label:t.label,value:t.value}})),n.stopLength=-1,n.stopIndex=-1):(n.stopLength=e.term.length,n.stopIndex=n.contents.lastIndexOf(n.options.trigger),n.close())}})}):this.source=this.options.source},destroy:function(){t.Widget.prototype.destroy.call(this)},getCursor:function(){var t=this.element[0];if(t.selectionStart)return t.selectionStart;if(t.ownerDocument.selection){var e=t.ownerDocument.selection.createRange();if(!e)return 0;var o=t.createTextRange(),n=o.duplicate();return o.moveToBookmark(e.getBookmark()),n.setEndPoint("EndToStart",o),n.text.length}},updateHidden:function(){var e=this.options.trigger,o=this.element.val();for(var n in this.id_map){var i=e+n;regex=RegExp(i=i.replace(/[^a-zA-Z 0-9@]+/g,"\\$&"),"g"),o=o.replace(regex,e+"["+this.id_map[n]+"]")}t(this.options.hidden).val(o),t(this.options.hiddenHighlight).val(JSON.stringify(this.id_map))},_renderMenu:function(e,o){var n=this;t.each(o,function(t,o){n._renderItemData(e,o)}),t(e).addClass("emoqa-mention-ui")}})),t(".emoqa-content-ask-form textarea, .emoqa-comment-form textarea, .emoqa-answer-form textarea").length&&t(".emoqa-content-ask-form textarea, .emoqa-comment-form textarea, .emoqa-answer-form textarea, #emoqa-answer-content_ifr #tinymce").each(function(){var e=t(this).parent();t(this).triggeredAutocomplete({hidden:".emoqa-mention-comment",hiddenHighlight:".emoqa-mention-comment-highlight",source:"emSource",emMinlength:3,emDataAjax:{action:"emoqa_mention_user",nonce:emoqa_mention.emoqa_mention_nonce,url:emoqa_mention.emoqa_mention_ajax_url,type:"POST",dataType:"json"},trigger:"@",messages:{results:function(t){},noResults:function(t){}}
1,delay:1e3,appendTo:e})})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.