text: var PurpleMine;(PurpleMine=PurpleMine||{}).HistoryTabs=function(){"use strict";var r,n={en:{all:"All",notes:"Notes",details:"Changes"},ro:{all:"Toate",notes:"Note",details:"Schimbări"},fr:{all:"Tout",notes:"Remarques",details:"Changements"},pl:{all:"Wszystko",notes:"Notatki",details:"Zmiany"},de:{all:"Alles",notes:"Kommentare",details:"Änderungen"},ja:{all:"すべて",notes:"注記",details:"変更"}};var s=function(){var e=$(this),t=e.attr("data-tab");r.$tabs.removeClass("selected"),e.addClass("selected"),r.$history.removeClass("hide-details").removeClass("hide-notes"),"notes"===t?r.$history.addClass("hide-details"):"details"===t&&r.$history.addClass("hide-notes")};return function(){if(r)return r;var e,t,i,a;(r=this).$tabsContainer=null,this.$tabs=null,this.$history=$("#history"),this.lang=document.documentElement.lang,void 0===n[this.lang]&&(this.lang="en"),this._=n[this.lang],0<this.$history.length&&(e="",a="</a></li>",e+='<div class="tabs"><ul>',e+=(t='<li><a href="javascript:;" class="')+"selected "+(i='history-tab" data-tab="')+'all">'+r._.all+a,e+=t+i+'notes">'+r._.notes+a,e+=t+i+'details">'+r._.details+a,e+="</ul></div>",r.$tabsContainer=$(e),$("#history > h3").after(r.$tabsContainer),r.$tabs=r.$tabsContainer.find(".history-tab"),r.$tabs.on("click",s),r.$history.find(".has-notes:first").addClass("first-of-notes"),r.$history.find(".has-details:first").addClass("first-of-details"))}}(),(PurpleMine=PurpleMine||{}).MenuCollapse=function(){"use strict";var n,t={en:{topMenuToggler:"Expand/collapse top menu"},ro:{topMenuToggler:"Deschide/închide meniul de sus"},fr:{topMenuToggler:"Développer/réduire le menu principal"},pl:{topMenuToggler:"Zwiń/rozwiń górne menu"},de:{topMenuToggler:"Ein-/Ausklappen Hauptmenu"},ja:{topMenuToggler:"トップメニューの展開/折りたたみ"}};function e(){if(n)return n;for(var e in(n=this).lang=document.documentElement.lang,void 0===t[this.lang]&&(this.lang="en"),this._=t[this.lang],this.menus={top:{$el:$("#top-menu")}},this.menus)this.menus.hasOwnProperty(e)&&0<this.menus[e].$el.length&&i(e)}function i(e){if("none"===n.menus[e].$el.css("maxHeight"))return!1;var t,i,a,r;n.menus[e].collapsed=!0,window.localStorage&&(n.menus[e].collapsed=null===localStorage.getItem(s(e))),i=(t=e)+"-menu-toggler",a=n._[t+"MenuToggler"],r='<a href="javascript:;" class="'+i+'" title="'+a+'"></a>',n.menus[t].$toggler=$(r),n.menus[t].$el.prepend(n.menus[t].$toggler),n.menus[t].$toggler.on("click",{menu:t},n.toggleMenu),!1===n.isCollapsed(e)&&n.expandMenu(e)}function s(e){return"PurpleMine:"+e+"MenuExpanded"}return e.prototype.toggleMenu=function(e){var t=e.data.menu||"";n.isCollapsed(t)?n.expandMenu(t):n.collapseMenu(t)},e.prototype.isCollapsed=function(e){return this.menus[e].collapsed},e.prototype.expandMenu=function(e){this.menus[e].$el.addClass("expanded"),this.menus[e].$toggler.addClass("expanded"),this.menus[e].collapsed=!1,window.localStorage&&localStorage.setItem(s(e),"x")},e.prototype.collapseMenu=function(e){this.menus[e].$el.removeClass("expanded"),this.menus[e].$toggler.removeClass("expanded"),this.menus[e].collapsed=!0,window.localStorage&&localStorage.removeItem(s(e))},e}(),(PurpleMine=PurpleMine||{}).RevisionGraph=function(e,t,i){"use strict";var a=t,r=$.map(a,function(e){return e}),n=r.length-1,s=$("table.changesets tr.changeset");null!==revisionGraph?revisionGraph.clear():revisionGraph=new Raphael(e);var o=revisionGraph.set(),l=s.first().find("td").first().position().left-$(e).position().left,d=$(e).position().top,u=l+20*(i+1),c=s.last().position().top+s.last().height()-d;revisionGraph.setSize(u,c);var p,g,h,m,b,f,v,y=["#e74c3c","#584492","#019851","#ed820c","#4183c4"];if(i>=y.length){Raphael.getColor.reset();for(var C=0;C<=i;C++)y.push(Raphael.getColor(.9))}$.each(r,function(e,i){i.hasOwnProperty("space")||(i.space=0),h=s.eq(n-i.rdmid).position().top-d+17,g=l+10+20*i.space,revisionGraph.circle(g,h,3.5).attr({fill:y[i.space],stroke:"none"}).toFront(),$.each(i.parent_scmids,function(e,t){p=a[t],(p?(p.hasOwnProperty("space")||(p.space=0),b=s.eq(n-p.rdmid).position().top-d+17,m=l+10+20*p.space,p.space===i.space?revisionGraph.path(["M",g,h,"V",b]):revisionGraph.path(["M",g,h,"C",g,h,g,h+(b-h)/2,g+(m-g)/2,h+(b-h)/2,"C",g+(m-g)/2,h+(b-h)/2,m,b-(b-h)/2,m,b])):revisionGraph.path(["M",g,h,"V",c])).attr({stroke:y[i.space],"stroke-width":1.5}).toBack()}),(v=revisionGraph.circle(g,h,10)).attr({fill:"#000",opacity:0,cursor:"pointer",href:i.href}),null!==i.refs&&0<i.refs.length&&((f=document.createElementNS(revisionGraph.canvas.namespaceURI,"title")).appendChild(document.createTextNode(i.refs)),v.node.appendChild(f)),o.push(v)}),o.toFront()},$(function(){"use strict";window.drawRevisionGraph&&(window.drawRevisionGraph=PurpleMine.RevisionGraph,$(window).resize())}),(PurpleMine=PurpleMine||{}).SidebarToggler=function(){"use strict";var i,e={en:{toggler:"Toggle sidebar"},ro:{toggler:"Deschide/închide bara laterală"},fr:{toggler:"Basculer la barre latérale"},pl:{toggler:"Pokaż/ukryj panel boczny"},ja:{toggler:"サイドバーの切り替え"}};function t(){if(i)return i;(i=this).sidebarVisible=!0,this.sidebarHiding=null,this.$toggler=null,this.$main=$("#main"),this.$sidebar=$("#sidebar"),this.lang=document.documentElement.lang,void 0===e[this.lang]&&(this.lang="en"),this._=e[this.lang],"relative"===this.$main.css("position")&&$(window).load(function(){$("#context-menu").appendTo("#wrapper3")}),function(){window.localStorage&&(i.sidebarVisible=null===localStorage.getItem("PurpleMine:sidebarHidden"));0<i.$sidebar.length&&!1===i.$main.hasClass("nosidebar")&&(e='<a href="javascript:;" class="sidebar-toggler" title="'+i._.toggler+'"></a>',i.$toggler=$(e),i.$main.append(i.$toggler),i.$toggler.on("click",i.toggleSidebar),t=document.getElementsByTagName("body")[0],!(window.onkeydown=function(e){t===e.target&&83===e.keyCode&&!1===e.ctrlKey&&!1===e.altKey&&!1===e.shiftKey&&i.toggleSidebar()})===i.sidebarVisible&&i.hideSidebar(!0));var t;var e}()}return t.prototype.toggleSidebar=function(){i.sidebarVisible?i.hideSidebar():i.showSidebar()},t.prototype.hideSidebar=function(e){!0===e?this.$sidebar.addClass("sidebar-hiding sidebar-hidden"):(this.$sidebar.addClass("sidebar-hiding"),this.sidebarHiding=setTimeout(function(){i.$sidebar.addClass("sidebar-hidden")},500)),this.$toggler.addClass("sidebar-hidden"),this.sidebarVisible=!1,window.localStorage&&localStorage.setItem("PurpleMine:sidebarHidden","x")},t.prototype.showSidebar=function(){clearTimeout(this.sidebarHiding),i.$sidebar.removeClass("sidebar-hidden"),setTimeout(function(){i.$sidebar.removeClass("sidebar-hiding")},50),this.$toggler.removeClass("sidebar-hidden"),this.sidebarVisible=!0,window.localStorage&&localStorage.removeItem("PurpleMine:sidebarHidden")},t}(),(PurpleMine=PurpleMine||{}).TableAsBoard=function(){"use strict";var a;function d(t){t.dataTransfer.dropEffect="move",document.querySelectorAll(".issue_drop").forEach(function(e){e.style.visibility="visible",t.target.style.backgroundColor="#"}),a.dragged=t.target}function u(t){document.querySelectorAll(".issue_drop").forEach(function(e){e.style.visibility="hidden",t.target.style.backgroundColor="#"}),a.dragged=null}function r(e){e.preventDefault(),e.target.style.backgroundColor="#";var i=e.target.getAttribute("data-group-name");$("#"+a.dragged.id).trigger("contextmenu"),function e(){var t=document.querySelector("#context-menu");t&&"none"!=t.style.display?(t.style.display="none",$('#context-menu > ul > li > ul > li > a:contains("'+i+'")').click()):setTimeout(function(){e()},100)}()}function n(e){e.preventDefault()}function s(e){e.target.style.backgroundColor="gray"}function o(e){e.target.style.backgroundColor="#"}function c(e,t,i){var a=document.createElement("tr");return a.setAttribute("data-group-name",i),a.classList.add("issue"),a.classList.add("issue_drop"),a.style.gridRow=e,a.style.gridColumn=t,a.style.visibility="hidden",a.ondrop=r,a.ondragover=n,a.ondragenter=s,a.ondragleave=o,a.appendChild(document.createTextNode("Drop Issue Here")),a}function e(){if(a)return a;(a=this).dragged=null,function(){if(document.querySelector("table.issues > tbody > tr.group")){if(document.querySelector("p.buttons")){var e=document.createElement("A");e.style.cursor="pointer",e.style.float="right",e.appendChild(document.createTextNode("View As Board")),e.onclick=a.showTableAsBoard,document.querySelector("p.buttons").appendChild(e)}else document.querySelector("div.mypage-box")&&document.querySelectorAll("div.mypage-box > h3").forEach(function(e){var t=document.createElement("A");t.style.cursor="pointer",t.style.float="right",t.appendChild(document.createTextNode("View As Board")),t.onclick=a.showTableAsBoard,e.appendChild(t)});if(JSON.parse(localStorage.getItem("redmine-issue-list-as-board"))){a.showTableAsBoard();var t=JSON.parse(localStorage.getItem("redmine-issue-list-as-board"));localStorage.setItem("redmine-issue-list-as-board",!t)}}}()}return e.prototype.showTableAsBoard=function(){var e=JSON.parse(localStorage.getItem("redmine-issue-list-as-board"));localStorage.setItem("redmine-issue-list-as-board",!e),document.querySelector("table.issues").classList.toggle("sprint-view");var t=document.querySelector("table.sprint-view > tbody");if(t){for(var i=0,a=1,r=[],n="",s=0;s<t.children.length;s++){var o=t.children[s];o.classList.contains("group")?(1!=a&&r.push(c(a,i,n)),n=o.querySelector("td > span.name").textContent,i+=a=1):(o.setAttribute("draggable","true"),o.ondragstart=d,o.ondragend=u),o.style.gridRow=a,o.style.gridColumn=i,a+=1}var l="auto";for(s=1;s<i;s++)l+=" auto";t.style.gridTemplateColumns=l,r.push(c(a,i,n)),r.forEach(function(e){t.appendChild(e)})}},e}(),$(function(){"use strict";new PurpleMine.SidebarToggler,new PurpleMine.HistoryTabs,new PurpleMine.MenuCollapse,new PurpleMine.TableAsBoard});