/* fore.st is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. fore.st is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with fore.st. If not, see < http://www.gnu.org/licenses/ >. (C) 2022- by rainbownapkin, */ //---Global Variables--- CURRENTFPANEL = null; //---Global Functions--- function closeFPanel(cb){//close and null out fpanel, cb function to call when panel is closed $("#fpaneldiv").hide("slide", 250,function(){ $("#fpcontdiv").empty(); $("#fptitle").html("null Panel"); $("#closefpanel").prop("title", "Close null panel."); CURRENTFPANEL = null; if(typeof cb === 'function'){ cb(); } }); } function sizeFPDiv(){//set inner div height to fix overflow $("#fpaneldiv").outerWidth($("#chatwrap").outerWidth() * 0.7); $("#fpcontdiv").outerHeight($("#fpaneldiv").height() - $("#fptitlediv").outerHeight()); } function panelbtn(panel){ if($("#fpaneldiv").is(":visible")){//if panel is visible difClose = CURRENTFPANEL != panel;//set difclose to if CURRENTPANEL is the same one attatched to the button we're clicking closeFPanel(function(){//closem panel if(difClose){//if panel.popMenu(panel.data);//pop da panel } }); }else{//else panel.popMenu(panel.data);//pop that bitch son } } //---base panel--- function fpmenu(title, elm, data, ocall){//fpmenu constructor this.title = title;//title of menu this.elm = elm;//elements to insert (good for simple menus) this.data = data;//menu data (not used for all menus) this.ocall = function ocall(){};//function to call upon menu opening (used for more advanced menus) } fpmenu.prototype.popMenu = function(idata){//POP goes the weasal! this.data = idata//set data $("#fpcontdiv").empty();//empty content div $("#fptitle").html(this.title + " Panel");//set panel tittle $("#closefpanel").prop("title", "Close " + this.title + " panel.");//set close button hover text $("#fpcontdiv").append(this.elm);//append element array this.ocall(this.data);//run open function CURRENTFPANEL = this; $("#fpaneldiv").show("slide", 250, function() {sizeFPDiv()});//show panel and correct size once open } //---fpanel poll--- var fpoll = new fpmenu("Poll");//create new panel fpoll fpoll.elm = [//fpoll element array $("

").prop("id","polltitle").html("Null Poll Title")//poll title ] fpoll.ocall = function(data){//fpoll open call function $("#polltitle").html("Poll: " + data.title);//set poll title if(hasPermission("pollctl")) {//if ur allowed to fuck wit da poll $("