var MENU_CONTENT_LEFT_CLASS_NAME="menu-content-left",MENU_CONTENT_RIGHT_CLASS_NAME="menu-content-right";function addWindowListItem(wid,title){var li=document.createElement("li"),a=(li.className="windowlist-li",li.id="windowlistitem"+wid,document.createElement("a"));function hideWindowList(){document.querySelector("#open_windows_list").className=""}a.id="windowlistitemlink"+wid,a.addEventListener("mouseover",function(e){e.ctrlKey&&client._window_set_focus(client.id_to_window[wid])}),a.addEventListener("click",function(e){$(e.target).hasClass(MENU_CONTENT_RIGHT_CLASS_NAME)||(client.id_to_window[wid].minimized?client.id_to_window[wid].toggle_minimized():client._window_set_focus(client.id_to_window[wid]),this.parentElement.parentElement.className="-hide")});var divLeft=document.createElement("div"),img=(divLeft.id="windowlistdivleft"+wid,divLeft.className="menu-divleft",new Image),img=(img.id="windowlistitemicon"+wid,img.src="favicon.png",img.className=MENU_CONTENT_LEFT_CLASS_NAME,divLeft.append(img),document.createElement("div")),title=(img.append(document.createTextNode(title)),img.id="windowlistitemtitle"+wid,img.className=MENU_CONTENT_LEFT_CLASS_NAME,divLeft.append(img),document.createElement("div")),img=(title.className="menu-divright",new Image),img3=(img.id="windowlistitemclose"+wid,img.src="icons/close.png",img.title="Close",img.className=MENU_CONTENT_RIGHT_CLASS_NAME,img.addEventListener("click",function(e){client._window_closed(client.id_to_window[wid]),e.stopPropagation(),hideWindowList()}),new Image),img4=(img3.id="windowlistitemmax"+wid,img3.src="icons/maximize.png",img3.title="Maximize",img3.addEventListener("click",function(e){client.id_to_window[wid].toggle_maximized(),e.stopPropagation(),hideWindowList()}),img3.className=MENU_CONTENT_RIGHT_CLASS_NAME,new Image);img4.id="windowlistitemmin"+wid,img4.src="icons/minimize.png",img4.title="Minimize",img4.addEventListener("click",function(e){client.id_to_window[wid].toggle_minimized(),e.stopPropagation(),hideWindowList()}),img4.className=MENU_CONTENT_RIGHT_CLASS_NAME,title.append(img),title.append(img3),title.append(img4),a.append(divLeft),a.append(title),li.append(a),document.querySelector("#open_windows_list").append(li)}function removeWindowListItem(itemId){itemId=document.querySelector("#windowlistitem"+itemId);itemId&&itemId.parentNode&&itemId.remove()}$(function(){var float_menu=$("#float_menu");float_menu.draggable({cancel:".noDrag",containment:"window",scroll:!1}),float_menu.on("dragstart",function(event_,ui){client.mouse_grabbed=!0}),float_menu.on("dragstop",function(event_,ui){client.mouse_grabbed=!1,client.toolbar_position="custom",client.reconfigure_all_trays()})});