2019-10-21 11:39:32 +02:00
|
|
|
$((jQuery,void $.widget("ui.d3extsearchias",{options:{sElementId:"IAS_box",sInputElementId:"IAS_input",sCloseElementId:"IAS_closebtn",iPosOffset:10,sLastSelection:"",iDelay:600,oClearWnd:null},_create:function(){let e=this,t=this.options;$("#"+t.sElementId).mouseup(function(e){e.stopPropagation()}),$("body").mouseup(function(t){e.checkIasWindow(t)}),$("#"+t.sCloseElementId).click(function(){e.clearIasWindow()})},showIasWindow:function(e){let t=this.options,n=$("#"+t.sElementId),o=$("#"+t.sInputElementId);if(n.length){let i=this.getSelection();i!==t.sLastSelection&&i.length>0&&(n.show().css({top:e.pageY+t.iPosOffset+"px",left:e.pageX+t.iPosOffset+"px"}),o.val(i),t.sLastSelection=i)}},checkIasWindow:function(e){this.getSelection()?this.showIasWindow(e):this.clearIasWindow()},clearIasWindow:function(){let e=this.options;$("#"+e.sElementId).hide(),e.sLastSelection=""},getSelection:function(){let e;return window.getSelection?e=window.getSelection():document.getSelection?e=document.getSelection():document.selection&&(e=document.selection.createRange().text),e.toString()}})));
|