/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */
/* This file is part of version 0.96beta2 released Fri, 20 Mar 2009 11:01:14 +0100 */
Xinha.loadStyle("ListType.css","ListType");function ListType(f){this.editor=f;var g=f.config;var j=this;if(g.ListType.mode=="toolbar"){var k={};k[Xinha._lc("Decimal numbers","ListType")]="decimal";k[Xinha._lc("Lower roman numbers","ListType")]="lower-roman";k[Xinha._lc("Upper roman numbers","ListType")]="upper-roman";k[Xinha._lc("Lower latin letters","ListType")]="lower-alpha";k[Xinha._lc("Upper latin letters","ListType")]="upper-alpha";if(!Xinha.is_ie){k[Xinha._lc("Lower greek letters","ListType")]="lower-greek"}var e={id:"listtype",tooltip:Xinha._lc("Choose list style type (for ordered lists)","ListType"),options:k,action:function(i){j.onSelect(i,this)},refresh:function(i){j.updateValue(i,this)},context:"ol"};g.registerDropdown(e);g.addToolbarElement("listtype",["insertorderedlist","orderedlist"],1)}else{f._ListType=f.addPanel("right");Xinha.freeLater(f,"_ListType");Xinha.addClass(f._ListType,"ListType");Xinha.addClass(f._ListType.parentNode,"dialog");f.notifyOn("modechange",function(l,i){if(i.mode=="text"){f.hidePanel(f._ListType)}});var b=["disc","circle","square","none"];var c=["decimal","lower-alpha","upper-alpha","lower-roman","upper-roman","none"];var h=document.createElement("div");h.style.height="90px";var a=document.createElement("div");this.divUL=a;a.style.display="none";for(var d=0;d<b.length;d++){a.appendChild(this.createImage(b[d]))}h.appendChild(a);var a=document.createElement("div");this.divOL=a;a.style.display="none";for(var d=0;d<c.length;d++){a.appendChild(this.createImage(c[d]))}h.appendChild(a);f._ListType.appendChild(h);f.hidePanel(f._ListType)}}Xinha.Config.prototype.ListType={mode:"toolbar"};ListType._pluginInfo={name:"ListType",version:"2.1",developer:"Laurent Vilday",developer_url:"http://www.mokhet.com/",c_owner:"Xinha community",sponsor:"",sponsor_url:"",license:"Creative Commons Attribution-ShareAlike License"};ListType.prototype.onSelect=function(c,d){var a=c._toolbarObjects[d.id].element;var b=c.getParentElement();while(!/^ol$/i.test(b.tagName)){b=b.parentNode}b.style.listStyleType=a.value};ListType.prototype.updateValue=function(e,f){var a=e._toolbarObjects[f.id].element;var d=e.getParentElement();while(d&&!/^ol$/i.test(d.tagName)){d=d.parentNode}if(!d){a.selectedIndex=0;return}var c=d.style.listStyleType;if(!c){a.selectedIndex=0}else{for(var b=a.firstChild;b;b=b.nextSibling){b.selected=(c.indexOf(b.value)!=-1)}}};ListType.prototype.onUpdateToolbar=function(){if(this.editor.config.ListType.mode=="toolbar"){return}var a=this.editor.getParentElement();while(a&&!/^[o|u]l$/i.test(a.tagName)){a=a.parentNode}if(a&&/^[o|u]l$/i.test(a.tagName)){this.showPanel(a)}else{if(this.editor._ListType.style.display!="none"){this.editor.hidePanel(this.editor._ListType)}}};ListType.prototype.createImage=function(d){var c=this;var e=this.editor;var b=document.createElement("a");b.href="javascript:void(0)";Xinha._addClass(b,d);Xinha._addEvent(b,"click",function(){var a=e._ListType.currentListTypeParent;a.style.listStyleType=d;c.showActive(a);return false});return b};ListType.prototype.showActive=function(d){var c=(d.tagName.toLowerCase()=="ul")?this.divUL:this.divOL;this.divUL.style.display="none";this.divOL.style.display="none";c.style.display="block";var e=d.style.listStyleType;if(""==e){e=(d.tagName.toLowerCase()=="ul")?"disc":"decimal"}for(var b=0;b<c.childNodes.length;b++){var a=c.childNodes[b];if(Xinha._hasClass(a,e)){Xinha._addClass(a,"active")}else{Xinha._removeClass(a,"active")}}};ListType.prototype.showPanel=function(a){this.editor._ListType.currentListTypeParent=a;this.showActive(a);this.editor.showPanel(this.editor._ListType)};