text: "use strict";define("taskbar",["benchpress"],function(t){var a={};a.init=function(){var i=this;t.parse("modules/taskbar",{},function(t){i.taskbar=$(t);i.tasklist=i.taskbar.find("ul");$(document.body).append(i.taskbar);i.taskbar.on("click","li",function(){var t=$(this);var i=t.attr("data-module");var s=t.attr("data-uuid");require([i],function(i){if(!t.hasClass("active")){e();i.load(s);a.toggleNew(s,false);app.alternatingTitle("");a.tasklist.removeClass("active");t.addClass("active")}else{i.minimize(s)}});return false})})};a.discard=function(t,e){var s=a.tasklist.find('[data-module="'+t+'"][data-uuid="'+e+'"]');s.remove();i()};a.push=function(t,i,e){var n=a.tasklist.find('li[data-uuid="'+i+'"]');var d={module:t,uuid:i,options:e,element:n};$(window).trigger("filter:taskbar.push",d);if(!n.length&&d.module){s(d)}};a.get=function(t){var a=$('[data-module="'+t+'"]').map(function(t,a){return $(a).data()});return a};a.minimize=function(t,i){var e=a.tasklist.find('[data-module="'+t+'"][data-uuid="'+i+'"]');e.toggleClass("active",false)};a.toggleNew=function(t,i,e){var s=a.tasklist.find('[data-uuid="'+t+'"]');s.toggleClass("new",i);if(!e){$(window).trigger("action:taskbar.toggleNew",t)}};a.updateActive=function(t){var i=a.tasklist.find("li");i.removeClass("active");i.filter('[data-uuid="'+t+'"]').addClass("active")};a.isActive=function(t){var i=a.tasklist.find('li[data-uuid="'+t+'"]');return i.hasClass("active")};function i(){var t=a.tasklist.find("li");if(t.length>0){a.taskbar.attr("data-active","1")}else{a.taskbar.removeAttr("data-active")}}function e(){a.tasklist.find(".active").removeClass("active")}function s(t){var s=$("<div></div>").text(t.options.title||"NodeBB Task").html();var n=$("<li />").addClass(t.options.className).html('<a href="#">'+(t.options.icon?'<i class="fa '+t.options.icon+'"></i> ':"")+(t.options.image?'<img src="'+t.options.image+'"/> ':"")+'<span component="taskbar/title">'+s+"</span>"+"</a>").attr({"data-module":t.module,"data-uuid":t.uuid}).addClass(t.options.state!==undefined?t.options.state:"active");if(!t.options.state||t.options.state==="active"){e()}a.tasklist.append(n);i();t.element=n;n.data(t);$(window).trigger("action:taskbar.pushed",t)}a.updateTitle=function(t,i,e){a.tasklist.find('[data-module="'+t+'"][data-uuid="'+i+'"] [component="taskbar/title"]').text(e)};return a});
  //# sourceMappingURL=public/src/modules/taskbar.js.map