/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){CKEDITOR.on("dialogDefinition",function(a){var b;b=a.data.name;a=a.data.definition;"link"==b?(a.removeContents("target"),a.removeContents("upload"),a.removeContents("advanced"),b=a.getContents("info"),b.remove("emailSubject"),b.remove("emailBody")):"image"==b&&(a.removeContents("advanced"),b=a.getContents("Link"),b.remove("cmbTarget"),b=a.getContents("info"),b.remove("txtAlt"),b.remove("basic"))});var j={b:"strong",u:"u",i:"em",color:"span",size:"span",quote:"blockquote",code:"code",url:"a", email:"span",img:"span","*":"li",list:"ol"},v={strong:"b",b:"b",u:"u",em:"i",i:"i",code:"code",li:"*"},k={strong:"b",em:"i",u:"u",li:"*",ul:"list",ol:"list",code:"code",a:"link",img:"img",blockquote:"quote"},w={color:"color",size:"font-size"},x={url:"href",email:"mailhref",quote:"cite",list:"listType"},m=CKEDITOR.dtd,y=CKEDITOR.tools.extend({table:1},m.$block,m.$listItem,m.$tableContent,m.$list),A=/\s*(?:;\s*|$)/,o={smiley:":)",sad:":(",wink:";)",laugh:":D",cheeky:":P",blush:":*)",surprise:":-o", indecision:":|",angry:">:(",angel:"o:)",cool:"8-)",devil:">:-)",crying:";(",kiss:":-*"},z={},p=[],q;for(q in o)z[o[q]]=q,p.push(o[q].replace(/\(|\)|\:|\/|\*|\-|\|/g,function(a){return"\\"+a}));var p=RegExp(p.join("|"),"g"),B=function(){var a=[],b={nbsp:" ",shy:"­",gt:">",lt:"<"},c;for(c in b)a.push(c);a=RegExp("&("+a.join("|")+");","g");return function(c){return c.replace(a,function(e,a){return b[a]})}}();CKEDITOR.BBCodeParser=function(){this._={bbcPartsRegex:/(?:\[([^\/\]=]*?)(?:=([^\]]*?))?\])|(?:\[\/([a-z]{1,16})\])/ig}}; CKEDITOR.BBCodeParser.prototype={parse:function(a){for(var b,c,i=0;b=this._.bbcPartsRegex.exec(a);){c=b.index;if(c>i)this.onText(a.substring(i,c),1);i=this._.bbcPartsRegex.lastIndex;if((c=(b[1]||b[3]||"").toLowerCase())&&!j[c])this.onText(b[0]);else if(b[1]){var e=j[c],g={},h={};if(b=b[2])if("list"==c&&(isNaN(b)?/^[a-z]+$/.test(b)?b="lower-alpha":/^[A-Z]+$/.test(b)&&(b="upper-alpha"):b="decimal"),w[c]){"size"==c&&(b+="%");h[w[c]]=b;b=g;var f="",d=void 0;for(d in h)var r=(d+":"+h[d]).replace(A,";"), f=f+r;b.style=f}else x[c]&&(g[x[c]]=b);if("email"==c||"img"==c)g.bbcode=c;this.onTagOpen(e,g,CKEDITOR.dtd.$empty[e])}else if(b[3])this.onTagClose(j[c])}if(a.length>i)this.onText(a.substring(i,a.length),1)}};CKEDITOR.htmlParser.fragment.fromBBCode=function(a){function b(e){if(0