ckeditor.js 946 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750
  1. /*
  2. Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.md or http://ckeditor.com/license
  4. */
  5. (function() {
  6. if (!window.CKEDITOR || !window.CKEDITOR.dom) window.CKEDITOR || (window.CKEDITOR = function() {
  7. var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,
  8. e = {
  9. timestamp: "F0RF",
  10. version: "4.4.7 (Standard)",
  11. revision: "3a35b3d",
  12. rnd: Math.floor(900 * Math.random()) + 100,
  13. _: { pending: [], basePathSrcPattern: a },
  14. status: "unloaded",
  15. basePath: function() {
  16. var c = window.CKEDITOR_BASEPATH || "";
  17. if (!c)
  18. for (var d = document.getElementsByTagName("script"), b = 0; b < d.length; b++) { var f = d[b].src.match(a); if (f) { c = f[1]; break } } - 1 == c.indexOf(":/") &&
  19. "//" != c.slice(0, 2) && (c = 0 === c.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] + c : location.href.match(/^[^\?]*\/(?:)/)[0] + c);
  20. if (!c) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
  21. return c
  22. }(),
  23. getUrl: function(a) {
  24. -1 == a.indexOf(":/") && 0 !== a.indexOf("/") && (a = this.basePath + a);
  25. this.timestamp && ("/" != a.charAt(a.length - 1) && !/[&?]t=/.test(a)) && (a += (0 <= a.indexOf("?") ? "&" : "?") + "t=" + this.timestamp);
  26. return a
  27. },
  28. domReady: function() {
  29. function a() { try { document.addEventListener ? (document.removeEventListener("DOMContentLoaded", a, !1), d()) : document.attachEvent && "complete" === document.readyState && (document.detachEvent("onreadystatechange", a), d()) } catch (b) {} }
  30. function d() { for (var a; a = b.shift();) a() }
  31. var b = [];
  32. return function(d) {
  33. function g() {
  34. try { document.documentElement.doScroll("left") } catch (k) { setTimeout(g, 1); return }
  35. a()
  36. }
  37. b.push(d);
  38. "complete" === document.readyState && setTimeout(a, 1);
  39. if (1 == b.length)
  40. if (document.addEventListener) document.addEventListener("DOMContentLoaded",
  41. a, !1), window.addEventListener("load", a, !1);
  42. else if (document.attachEvent) {
  43. document.attachEvent("onreadystatechange", a);
  44. window.attachEvent("onload", a);
  45. d = !1;
  46. try { d = !window.frameElement } catch (e) {}
  47. document.documentElement.doScroll && d && g()
  48. }
  49. }
  50. }()
  51. },
  52. b = window.CKEDITOR_GETURL;
  53. if (b) {
  54. var g = e.getUrl;
  55. e.getUrl = function(a) { return b.call(e, a) || g.call(e, a) }
  56. }
  57. return e
  58. }()), CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(a) {
  59. var e = CKEDITOR.event.prototype,
  60. b;
  61. for (b in e) a[b] == null && (a[b] = e[b])
  62. },
  63. CKEDITOR.event.prototype = function() {
  64. function a(a) { var c = e(this); return c[a] || (c[a] = new b(a)) }
  65. var e = function(a) { a = a.getPrivate && a.getPrivate() || a._ || (a._ = {}); return a.events || (a.events = {}) },
  66. b = function(a) {
  67. this.name = a;
  68. this.listeners = []
  69. };
  70. b.prototype = {
  71. getListenerIndex: function(a) {
  72. for (var c = 0, d = this.listeners; c < d.length; c++)
  73. if (d[c].fn == a) return c;
  74. return -1
  75. }
  76. };
  77. return {
  78. define: function(b, c) {
  79. var d = a.call(this, b);
  80. CKEDITOR.tools.extend(d, c, true)
  81. },
  82. on: function(b, c, d, j, f) {
  83. function h(a, k, f, h) {
  84. a = {
  85. name: b,
  86. sender: this,
  87. editor: a,
  88. data: k,
  89. listenerData: j,
  90. stop: f,
  91. cancel: h,
  92. removeListener: e
  93. };
  94. return c.call(d, a) === false ? false : a.data
  95. }
  96. function e() { n.removeListener(b, c) }
  97. var k = a.call(this, b);
  98. if (k.getListenerIndex(c) < 0) {
  99. k = k.listeners;
  100. d || (d = this);
  101. isNaN(f) && (f = 10);
  102. var n = this;
  103. h.fn = c;
  104. h.priority = f;
  105. for (var o = k.length - 1; o >= 0; o--)
  106. if (k[o].priority <= f) { k.splice(o + 1, 0, h); return { removeListener: e } }
  107. k.unshift(h)
  108. }
  109. return { removeListener: e }
  110. },
  111. once: function() {
  112. var a = Array.prototype.slice.call(arguments),
  113. c = a[1];
  114. a[1] = function(a) {
  115. a.removeListener();
  116. return c.apply(this,
  117. arguments)
  118. };
  119. return this.on.apply(this, a)
  120. },
  121. capture: function() {
  122. CKEDITOR.event.useCapture = 1;
  123. var a = this.on.apply(this, arguments);
  124. CKEDITOR.event.useCapture = 0;
  125. return a
  126. },
  127. fire: function() {
  128. var a = 0,
  129. c = function() { a = 1 },
  130. d = 0,
  131. b = function() { d = 1 };
  132. return function(f, h, i) {
  133. var k = e(this)[f],
  134. f = a,
  135. n = d;
  136. a = d = 0;
  137. if (k) {
  138. var o = k.listeners;
  139. if (o.length)
  140. for (var o = o.slice(0), q, m = 0; m < o.length; m++) {
  141. if (k.errorProof) try { q = o[m].call(this, i, h, c, b) } catch (l) {} else q = o[m].call(this, i, h, c, b);
  142. q === false ? d = 1 : typeof q != "undefined" && (h = q);
  143. if (a || d) break
  144. }
  145. }
  146. h =
  147. d ? false : typeof h == "undefined" ? true : h;
  148. a = f;
  149. d = n;
  150. return h
  151. }
  152. }(),
  153. fireOnce: function(a, c, d) {
  154. c = this.fire(a, c, d);
  155. delete e(this)[a];
  156. return c
  157. },
  158. removeListener: function(a, c) {
  159. var d = e(this)[a];
  160. if (d) {
  161. var b = d.getListenerIndex(c);
  162. b >= 0 && d.listeners.splice(b, 1)
  163. }
  164. },
  165. removeAllListeners: function() {
  166. var a = e(this),
  167. c;
  168. for (c in a) delete a[c]
  169. },
  170. hasListeners: function(a) { return (a = e(this)[a]) && a.listeners.length > 0 }
  171. }
  172. }()), CKEDITOR.editor || (CKEDITOR.editor = function() {
  173. CKEDITOR._.pending.push([this, arguments]);
  174. CKEDITOR.event.call(this)
  175. }, CKEDITOR.editor.prototype.fire =
  176. function(a, e) { a in { instanceReady: 1, loaded: 1 } && (this[a] = true); return CKEDITOR.event.prototype.fire.call(this, a, e, this) }, CKEDITOR.editor.prototype.fireOnce = function(a, e) { a in { instanceReady: 1, loaded: 1 } && (this[a] = true); return CKEDITOR.event.prototype.fireOnce.call(this, a, e, this) }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)), CKEDITOR.env || (CKEDITOR.env = function() {
  177. var a = navigator.userAgent.toLowerCase(),
  178. e = {
  179. ie: a.indexOf("trident/") > -1,
  180. webkit: a.indexOf(" applewebkit/") > -1,
  181. air: a.indexOf(" adobeair/") >
  182. -1,
  183. mac: a.indexOf("macintosh") > -1,
  184. quirks: document.compatMode == "BackCompat" && (!document.documentMode || document.documentMode < 10),
  185. mobile: a.indexOf("mobile") > -1,
  186. iOS: /(ipad|iphone|ipod)/.test(a),
  187. isCustomDomain: function() {
  188. if (!this.ie) return false;
  189. var a = document.domain,
  190. d = window.location.hostname;
  191. return a != d && a != "[" + d + "]"
  192. },
  193. secure: location.protocol == "https:"
  194. };
  195. e.gecko = navigator.product == "Gecko" && !e.webkit && !e.ie;
  196. if (e.webkit) a.indexOf("chrome") > -1 ? e.chrome = true : e.safari = true;
  197. var b = 0;
  198. if (e.ie) {
  199. b = e.quirks || !document.documentMode ?
  200. parseFloat(a.match(/msie (\d+)/)[1]) : document.documentMode;
  201. e.ie9Compat = b == 9;
  202. e.ie8Compat = b == 8;
  203. e.ie7Compat = b == 7;
  204. e.ie6Compat = b < 7 || e.quirks
  205. }
  206. if (e.gecko) {
  207. var g = a.match(/rv:([\d\.]+)/);
  208. if (g) {
  209. g = g[1].split(".");
  210. b = g[0] * 1E4 + (g[1] || 0) * 100 + (g[2] || 0) * 1
  211. }
  212. }
  213. e.air && (b = parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
  214. e.webkit && (b = parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
  215. e.version = b;
  216. e.isCompatible = e.iOS && b >= 534 || !e.mobile && (e.ie && b > 6 || e.gecko && b >= 2E4 || e.air && b >= 1 || e.webkit && b >= 522 || false);
  217. e.hidpi = window.devicePixelRatio >=
  218. 2;
  219. e.needsBrFiller = e.gecko || e.webkit || e.ie && b > 10;
  220. e.needsNbspFiller = e.ie && b < 11;
  221. e.cssClass = "cke_browser_" + (e.ie ? "ie" : e.gecko ? "gecko" : e.webkit ? "webkit" : "unknown");
  222. if (e.quirks) e.cssClass = e.cssClass + " cke_browser_quirks";
  223. if (e.ie) e.cssClass = e.cssClass + (" cke_browser_ie" + (e.quirks ? "6 cke_browser_iequirks" : e.version));
  224. if (e.air) e.cssClass = e.cssClass + " cke_browser_air";
  225. if (e.iOS) e.cssClass = e.cssClass + " cke_browser_ios";
  226. if (e.hidpi) e.cssClass = e.cssClass + " cke_hidpi";
  227. return e
  228. }()), "unloaded" == CKEDITOR.status && function() {
  229. CKEDITOR.event.implementOn(CKEDITOR);
  230. CKEDITOR.loadFullCore = function() {
  231. if (CKEDITOR.status != "basic_ready") CKEDITOR.loadFullCore._load = 1;
  232. else {
  233. delete CKEDITOR.loadFullCore;
  234. var a = document.createElement("script");
  235. a.type = "text/javascript";
  236. a.src = CKEDITOR.basePath + "ckeditor.js";
  237. document.getElementsByTagName("head")[0].appendChild(a)
  238. }
  239. };
  240. CKEDITOR.loadFullCoreTimeout = 0;
  241. CKEDITOR.add = function(a) {
  242. (this._.pending || (this._.pending = [])).push(a)
  243. };
  244. (function() {
  245. CKEDITOR.domReady(function() {
  246. var a = CKEDITOR.loadFullCore,
  247. e = CKEDITOR.loadFullCoreTimeout;
  248. if (a) {
  249. CKEDITOR.status =
  250. "basic_ready";
  251. a && a._load ? a() : e && setTimeout(function() { CKEDITOR.loadFullCore && CKEDITOR.loadFullCore() }, e * 1E3)
  252. }
  253. })
  254. })();
  255. CKEDITOR.status = "basic_loaded"
  256. }(), CKEDITOR.dom = {},
  257. function() {
  258. var a = [],
  259. e = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "",
  260. b = /&/g,
  261. g = />/g,
  262. c = /</g,
  263. d = /"/g,
  264. j = /&amp;/g,
  265. f = /&gt;/g,
  266. h = /&lt;/g,
  267. i = /&quot;/g;
  268. CKEDITOR.on("reset", function() { a = [] });
  269. CKEDITOR.tools = {
  270. arrayCompare: function(a, c) {
  271. if (!a && !c) return true;
  272. if (!a || !c || a.length != c.length) return false;
  273. for (var d = 0; d <
  274. a.length; d++)
  275. if (a[d] != c[d]) return false;
  276. return true
  277. },
  278. clone: function(a) {
  279. var c;
  280. if (a && a instanceof Array) { c = []; for (var d = 0; d < a.length; d++) c[d] = CKEDITOR.tools.clone(a[d]); return c }
  281. if (a === null || typeof a != "object" || a instanceof String || a instanceof Number || a instanceof Boolean || a instanceof Date || a instanceof RegExp || a.nodeType || a.window === a) return a;
  282. c = new a.constructor;
  283. for (d in a) c[d] = CKEDITOR.tools.clone(a[d]);
  284. return c
  285. },
  286. capitalize: function(a, c) { return a.charAt(0).toUpperCase() + (c ? a.slice(1) : a.slice(1).toLowerCase()) },
  287. extend: function(a) {
  288. var c = arguments.length,
  289. d, b;
  290. if (typeof(d = arguments[c - 1]) == "boolean") c--;
  291. else if (typeof(d = arguments[c - 2]) == "boolean") {
  292. b = arguments[c - 1];
  293. c = c - 2
  294. }
  295. for (var f = 1; f < c; f++) {
  296. var g = arguments[f],
  297. j;
  298. for (j in g)
  299. if (d === true || a[j] == null)
  300. if (!b || j in b) a[j] = g[j]
  301. }
  302. return a
  303. },
  304. prototypedCopy: function(a) {
  305. var c = function() {};
  306. c.prototype = a;
  307. return new c
  308. },
  309. copy: function(a) {
  310. var c = {},
  311. d;
  312. for (d in a) c[d] = a[d];
  313. return c
  314. },
  315. isArray: function(a) { return Object.prototype.toString.call(a) == "[object Array]" },
  316. isEmpty: function(a) {
  317. for (var c in a)
  318. if (a.hasOwnProperty(c)) return false;
  319. return true
  320. },
  321. cssVendorPrefix: function(a, c, d) {
  322. if (d) return e + a + ":" + c + ";" + a + ":" + c;
  323. d = {};
  324. d[a] = c;
  325. d[e + a] = c;
  326. return d
  327. },
  328. cssStyleToDomStyle: function() {
  329. var a = document.createElement("div").style,
  330. c = typeof a.cssFloat != "undefined" ? "cssFloat" : typeof a.styleFloat != "undefined" ? "styleFloat" : "float";
  331. return function(a) { return a == "float" ? c : a.replace(/-./g, function(a) { return a.substr(1).toUpperCase() }) }
  332. }(),
  333. buildStyleHtml: function(a) {
  334. for (var a = [].concat(a), c, d = [], b = 0; b < a.length; b++)
  335. if (c = a[b]) /@import|[{}]/.test(c) ? d.push("<style>" +
  336. c + "</style>") : d.push('<link type="text/css" rel=stylesheet href="' + c + '">');
  337. return d.join("")
  338. },
  339. htmlEncode: function(a) { return ("" + a).replace(b, "&amp;").replace(g, "&gt;").replace(c, "&lt;") },
  340. htmlDecode: function(a) { return a.replace(j, "&").replace(f, ">").replace(h, "<") },
  341. htmlEncodeAttr: function(a) { return a.replace(d, "&quot;").replace(c, "&lt;").replace(g, "&gt;") },
  342. htmlDecodeAttr: function(a) { return a.replace(i, '"').replace(h, "<").replace(f, ">") },
  343. getNextNumber: function() { var a = 0; return function() { return ++a } }(),
  344. getNextId: function() { return "cke_" + this.getNextNumber() },
  345. override: function(a, c) {
  346. var d = c(a);
  347. d.prototype = a.prototype;
  348. return d
  349. },
  350. setTimeout: function(a, c, d, b, f) {
  351. f || (f = window);
  352. d || (d = f);
  353. return f.setTimeout(function() { b ? a.apply(d, [].concat(b)) : a.apply(d) }, c || 0)
  354. },
  355. trim: function() { var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g; return function(c) { return c.replace(a, "") } }(),
  356. ltrim: function() { var a = /^[ \t\n\r]+/g; return function(c) { return c.replace(a, "") } }(),
  357. rtrim: function() {
  358. var a = /[ \t\n\r]+$/g;
  359. return function(c) {
  360. return c.replace(a,
  361. "")
  362. }
  363. }(),
  364. indexOf: function(a, c) {
  365. if (typeof c == "function")
  366. for (var d = 0, b = a.length; d < b; d++) { if (c(a[d])) return d } else {
  367. if (a.indexOf) return a.indexOf(c);
  368. d = 0;
  369. for (b = a.length; d < b; d++)
  370. if (a[d] === c) return d
  371. }
  372. return -1
  373. },
  374. search: function(a, c) { var d = CKEDITOR.tools.indexOf(a, c); return d >= 0 ? a[d] : null },
  375. bind: function(a, c) { return function() { return a.apply(c, arguments) } },
  376. createClass: function(a) {
  377. var c = a.$,
  378. d = a.base,
  379. b = a.privates || a._,
  380. f = a.proto,
  381. a = a.statics;
  382. !c && (c = function() { d && this.base.apply(this, arguments) });
  383. if (b) var g = c,
  384. c = function() {
  385. var a =
  386. this._ || (this._ = {}),
  387. c;
  388. for (c in b) {
  389. var d = b[c];
  390. a[c] = typeof d == "function" ? CKEDITOR.tools.bind(d, this) : d
  391. }
  392. g.apply(this, arguments)
  393. };
  394. if (d) {
  395. c.prototype = this.prototypedCopy(d.prototype);
  396. c.prototype.constructor = c;
  397. c.base = d;
  398. c.baseProto = d.prototype;
  399. c.prototype.base = function() {
  400. this.base = d.prototype.base;
  401. d.apply(this, arguments);
  402. this.base = arguments.callee
  403. }
  404. }
  405. f && this.extend(c.prototype, f, true);
  406. a && this.extend(c, a, true);
  407. return c
  408. },
  409. addFunction: function(c, d) { return a.push(function() { return c.apply(d || this, arguments) }) - 1 },
  410. removeFunction: function(c) { a[c] = null },
  411. callFunction: function(c) { var d = a[c]; return d && d.apply(window, Array.prototype.slice.call(arguments, 1)) },
  412. cssLength: function() {
  413. var a = /^-?\d+\.?\d*px$/,
  414. c;
  415. return function(d) { c = CKEDITOR.tools.trim(d + "") + "px"; return a.test(c) ? c : d || "" }
  416. }(),
  417. convertToPx: function() {
  418. var a;
  419. return function(c) {
  420. if (!a) {
  421. a = CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>', CKEDITOR.document);
  422. CKEDITOR.document.getBody().append(a)
  423. }
  424. if (!/%$/.test(c)) {
  425. a.setStyle("width",
  426. c);
  427. return a.$.clientWidth
  428. }
  429. return c
  430. }
  431. }(),
  432. repeat: function(a, c) { return Array(c + 1).join(a) },
  433. tryThese: function() { for (var a, c = 0, d = arguments.length; c < d; c++) { var b = arguments[c]; try { a = b(); break } catch (f) {} } return a },
  434. genKey: function() { return Array.prototype.slice.call(arguments).join("-") },
  435. defer: function(a) {
  436. return function() {
  437. var c = arguments,
  438. d = this;
  439. window.setTimeout(function() { a.apply(d, c) }, 0)
  440. }
  441. },
  442. normalizeCssText: function(a, c) {
  443. var d = [],
  444. b, f = CKEDITOR.tools.parseCssText(a, true, c);
  445. for (b in f) d.push(b + ":" + f[b]);
  446. d.sort();
  447. return d.length ? d.join(";") + ";" : ""
  448. },
  449. convertRgbToHex: function(a) { return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function(a, c, d, b) { a = [c, d, b]; for (c = 0; c < 3; c++) a[c] = ("0" + parseInt(a[c], 10).toString(16)).slice(-2); return "#" + a.join("") }) },
  450. parseCssText: function(a, c, d) {
  451. var b = {};
  452. if (d) {
  453. d = new CKEDITOR.dom.element("span");
  454. d.setAttribute("style", a);
  455. a = CKEDITOR.tools.convertRgbToHex(d.getAttribute("style") || "")
  456. }
  457. if (!a || a == ";") return b;
  458. a.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
  459. function(a, d, f) {
  460. if (c) {
  461. d = d.toLowerCase();
  462. d == "font-family" && (f = f.toLowerCase().replace(/["']/g, "").replace(/\s*,\s*/g, ","));
  463. f = CKEDITOR.tools.trim(f)
  464. }
  465. b[d] = f
  466. });
  467. return b
  468. },
  469. writeCssText: function(a, c) {
  470. var d, b = [];
  471. for (d in a) b.push(d + ":" + a[d]);
  472. c && b.sort();
  473. return b.join("; ")
  474. },
  475. objectCompare: function(a, c, d) {
  476. var b;
  477. if (!a && !c) return true;
  478. if (!a || !c) return false;
  479. for (b in a)
  480. if (a[b] != c[b]) return false;
  481. if (!d)
  482. for (b in c)
  483. if (a[b] != c[b]) return false;
  484. return true
  485. },
  486. objectKeys: function(a) {
  487. var c = [],
  488. d;
  489. for (d in a) c.push(d);
  490. return c
  491. },
  492. convertArrayToObject: function(a, c) {
  493. var d = {};
  494. arguments.length == 1 && (c = true);
  495. for (var b = 0, f = a.length; b < f; ++b) d[a[b]] = c;
  496. return d
  497. },
  498. fixDomain: function() {
  499. for (var a;;) try { a = window.parent.document.domain; break } catch (c) {
  500. a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain;
  501. if (!a) break;
  502. document.domain = a
  503. }
  504. return !!a
  505. },
  506. eventsBuffer: function(a, c) {
  507. function d() {
  508. f = (new Date).getTime();
  509. b = false;
  510. c()
  511. }
  512. var b, f = 0;
  513. return {
  514. input: function() {
  515. if (!b) {
  516. var c = (new Date).getTime() - f;
  517. c < a ? b = setTimeout(d, a - c) : d()
  518. }
  519. },
  520. reset: function() {
  521. b && clearTimeout(b);
  522. b = f = 0
  523. }
  524. }
  525. },
  526. enableHtml5Elements: function(a, c) {
  527. for (var d = ["abbr", "article", "aside", "audio", "bdi", "canvas", "data", "datalist", "details", "figcaption", "figure", "footer", "header", "hgroup", "mark", "meter", "nav", "output", "progress", "section", "summary", "time", "video"], b = d.length, f; b--;) {
  528. f = a.createElement(d[b]);
  529. c && a.appendChild(f)
  530. }
  531. },
  532. checkIfAnyArrayItemMatches: function(a, c) {
  533. for (var d = 0, b = a.length; d < b; ++d)
  534. if (a[d].match(c)) return true;
  535. return false
  536. },
  537. checkIfAnyObjectPropertyMatches: function(a, c) {
  538. for (var d in a)
  539. if (d.match(c)) return true;
  540. return false
  541. },
  542. transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="
  543. }
  544. }(), CKEDITOR.dtd = function() {
  545. var a = CKEDITOR.tools.extend,
  546. e = function(a, c) {
  547. for (var d = CKEDITOR.tools.clone(a), b = 1; b < arguments.length; b++) {
  548. var c = arguments[b],
  549. f;
  550. for (f in c) delete d[f]
  551. }
  552. return d
  553. },
  554. b = {},
  555. g = {},
  556. c = {
  557. address: 1,
  558. article: 1,
  559. aside: 1,
  560. blockquote: 1,
  561. details: 1,
  562. div: 1,
  563. dl: 1,
  564. fieldset: 1,
  565. figure: 1,
  566. footer: 1,
  567. form: 1,
  568. h1: 1,
  569. h2: 1,
  570. h3: 1,
  571. h4: 1,
  572. h5: 1,
  573. h6: 1,
  574. header: 1,
  575. hgroup: 1,
  576. hr: 1,
  577. main: 1,
  578. menu: 1,
  579. nav: 1,
  580. ol: 1,
  581. p: 1,
  582. pre: 1,
  583. section: 1,
  584. table: 1,
  585. ul: 1
  586. },
  587. d = { command: 1, link: 1, meta: 1, noscript: 1, script: 1, style: 1 },
  588. j = {},
  589. f = { "#": 1 },
  590. h = { center: 1, dir: 1, noframes: 1 };
  591. a(b, { a: 1, abbr: 1, area: 1, audio: 1, b: 1, bdi: 1, bdo: 1, br: 1, button: 1, canvas: 1, cite: 1, code: 1, command: 1, datalist: 1, del: 1, dfn: 1, em: 1, embed: 1, i: 1, iframe: 1, img: 1, input: 1, ins: 1, kbd: 1, keygen: 1, label: 1, map: 1, mark: 1, meter: 1, noscript: 1, object: 1, output: 1, progress: 1, q: 1, ruby: 1, s: 1, samp: 1, script: 1, select: 1, small: 1, span: 1, strong: 1, sub: 1, sup: 1, textarea: 1, time: 1, u: 1, "var": 1, video: 1, wbr: 1 }, f, { acronym: 1, applet: 1, basefont: 1, big: 1, font: 1, isindex: 1, strike: 1, style: 1, tt: 1 });
  592. a(g, c, b, h);
  593. e = {
  594. a: e(b, { a: 1, button: 1 }),
  595. abbr: b,
  596. address: g,
  597. area: j,
  598. article: g,
  599. aside: g,
  600. audio: a({ source: 1, track: 1 }, g),
  601. b: b,
  602. base: j,
  603. bdi: b,
  604. bdo: b,
  605. blockquote: g,
  606. body: g,
  607. br: j,
  608. button: e(b, { a: 1, button: 1 }),
  609. canvas: b,
  610. caption: g,
  611. cite: b,
  612. code: b,
  613. col: j,
  614. colgroup: { col: 1 },
  615. command: j,
  616. datalist: a({ option: 1 }, b),
  617. dd: g,
  618. del: b,
  619. details: a({ summary: 1 }, g),
  620. dfn: b,
  621. div: g,
  622. dl: { dt: 1, dd: 1 },
  623. dt: g,
  624. em: b,
  625. embed: j,
  626. fieldset: a({ legend: 1 }, g),
  627. figcaption: g,
  628. figure: a({ figcaption: 1 }, g),
  629. footer: g,
  630. form: g,
  631. h1: b,
  632. h2: b,
  633. h3: b,
  634. h4: b,
  635. h5: b,
  636. h6: b,
  637. head: a({ title: 1, base: 1 }, d),
  638. header: g,
  639. hgroup: { h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1 },
  640. hr: j,
  641. html: a({ head: 1, body: 1 }, g, d),
  642. i: b,
  643. iframe: f,
  644. img: j,
  645. input: j,
  646. ins: b,
  647. kbd: b,
  648. keygen: j,
  649. label: b,
  650. legend: b,
  651. li: g,
  652. link: j,
  653. main: g,
  654. map: g,
  655. mark: b,
  656. menu: a({ li: 1 }, g),
  657. meta: j,
  658. meter: e(b, { meter: 1 }),
  659. nav: g,
  660. noscript: a({ link: 1, meta: 1, style: 1 }, b),
  661. object: a({ param: 1 }, b),
  662. ol: { li: 1 },
  663. optgroup: { option: 1 },
  664. option: f,
  665. output: b,
  666. p: b,
  667. param: j,
  668. pre: b,
  669. progress: e(b, { progress: 1 }),
  670. q: b,
  671. rp: b,
  672. rt: b,
  673. ruby: a({ rp: 1, rt: 1 }, b),
  674. s: b,
  675. samp: b,
  676. script: f,
  677. section: g,
  678. select: { optgroup: 1, option: 1 },
  679. small: b,
  680. source: j,
  681. span: b,
  682. strong: b,
  683. style: f,
  684. sub: b,
  685. summary: b,
  686. sup: b,
  687. table: { caption: 1, colgroup: 1, thead: 1, tfoot: 1, tbody: 1, tr: 1 },
  688. tbody: { tr: 1 },
  689. td: g,
  690. textarea: f,
  691. tfoot: { tr: 1 },
  692. th: g,
  693. thead: { tr: 1 },
  694. time: e(b, { time: 1 }),
  695. title: f,
  696. tr: { th: 1, td: 1 },
  697. track: j,
  698. u: b,
  699. ul: { li: 1 },
  700. "var": b,
  701. video: a({ source: 1, track: 1 }, g),
  702. wbr: j,
  703. acronym: b,
  704. applet: a({ param: 1 }, g),
  705. basefont: j,
  706. big: b,
  707. center: g,
  708. dialog: j,
  709. dir: { li: 1 },
  710. font: b,
  711. isindex: j,
  712. noframes: g,
  713. strike: b,
  714. tt: b
  715. };
  716. a(e, {
  717. $block: a({ audio: 1, dd: 1, dt: 1, figcaption: 1, li: 1, video: 1 },
  718. c, h),
  719. $blockLimit: { article: 1, aside: 1, audio: 1, body: 1, caption: 1, details: 1, dir: 1, div: 1, dl: 1, fieldset: 1, figcaption: 1, figure: 1, footer: 1, form: 1, header: 1, hgroup: 1, main: 1, menu: 1, nav: 1, ol: 1, section: 1, table: 1, td: 1, th: 1, tr: 1, ul: 1, video: 1 ,img:1},
  720. $cdata: { script: 1, style: 1 },
  721. $editable: { address: 1, article: 1, aside: 1, blockquote: 1, body: 1, details: 1, div: 1, fieldset: 1, figcaption: 1, footer: 1, form: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, header: 1, hgroup: 1, main: 1, nav: 1, p: 1, pre: 1, section: 1,img:1 },
  722. $empty: {
  723. area: 1,
  724. base: 1,
  725. basefont: 1,
  726. br: 1,
  727. col: 1,
  728. command: 1,
  729. dialog: 1,
  730. embed: 1,
  731. hr: 1,
  732. img: 1,
  733. input: 1,
  734. isindex: 1,
  735. keygen: 1,
  736. link: 1,
  737. meta: 1,
  738. param: 1,
  739. source: 1,
  740. track: 1,
  741. wbr: 1
  742. },
  743. $inline: b,
  744. $list: { dl: 1, ol: 1, ul: 1 },
  745. $listItem: { dd: 1, dt: 1, li: 1 },
  746. $nonBodyContent: a({ body: 1, head: 1, html: 1 }, e.head),
  747. $nonEditable: { applet: 1, audio: 1, button: 1, embed: 1, iframe: 1, map: 1, object: 1, option: 1, param: 1, script: 1, textarea: 1, video: 1 },
  748. $object: { applet: 1, audio: 1, button: 1, hr: 1, iframe: 1, img: 1, input: 1, object: 1, select: 1, table: 1, textarea: 1, video: 1 },
  749. $removeEmpty: {
  750. abbr: 1,
  751. acronym: 1,
  752. b: 1,
  753. bdi: 1,
  754. bdo: 1,
  755. big: 1,
  756. cite: 1,
  757. code: 1,
  758. del: 1,
  759. dfn: 1,
  760. em: 1,
  761. font: 1,
  762. i: 1,
  763. ins: 1,
  764. label: 1,
  765. kbd: 1,
  766. mark: 1,
  767. meter: 1,
  768. output: 1,
  769. q: 1,
  770. ruby: 1,
  771. s: 1,
  772. samp: 1,
  773. small: 1,
  774. span: 1,
  775. strike: 1,
  776. strong: 1,
  777. sub: 1,
  778. sup: 1,
  779. time: 1,
  780. tt: 1,
  781. u: 1,
  782. "var": 1
  783. },
  784. $tabIndex: { a: 1, area: 1, button: 1, input: 1, object: 1, select: 1, textarea: 1 },
  785. $tableContent: { caption: 1, col: 1, colgroup: 1, tbody: 1, td: 1, tfoot: 1, th: 1, thead: 1, tr: 1 },
  786. $transparent: { a: 1, audio: 1, canvas: 1, del: 1, ins: 1, map: 1, noscript: 1, object: 1, video: 1 },
  787. $intermediate: {
  788. caption: 1,
  789. colgroup: 1,
  790. dd: 1,
  791. dt: 1,
  792. figcaption: 1,
  793. legend: 1,
  794. li: 1,
  795. optgroup: 1,
  796. option: 1,
  797. rp: 1,
  798. rt: 1,
  799. summary: 1,
  800. tbody: 1,
  801. td: 1,
  802. tfoot: 1,
  803. th: 1,
  804. thead: 1,
  805. tr: 1
  806. }
  807. });
  808. return e
  809. }(), CKEDITOR.dom.event = function(a) { this.$ = a }, CKEDITOR.dom.event.prototype = {
  810. getKey: function() { return this.$.keyCode || this.$.which },
  811. getKeystroke: function() {
  812. var a = this.getKey();
  813. if (this.$.ctrlKey || this.$.metaKey) a = a + CKEDITOR.CTRL;
  814. this.$.shiftKey && (a = a + CKEDITOR.SHIFT);
  815. this.$.altKey && (a = a + CKEDITOR.ALT);
  816. return a
  817. },
  818. preventDefault: function(a) {
  819. var e = this.$;
  820. e.preventDefault ? e.preventDefault() : e.returnValue = false;
  821. a && this.stopPropagation()
  822. },
  823. stopPropagation: function() {
  824. var a =
  825. this.$;
  826. a.stopPropagation ? a.stopPropagation() : a.cancelBubble = true
  827. },
  828. getTarget: function() { var a = this.$.target || this.$.srcElement; return a ? new CKEDITOR.dom.node(a) : null },
  829. getPhase: function() { return this.$.eventPhase || 2 },
  830. getPageOffset: function() { var a = this.getTarget().getDocument().$; return { x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft), y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop) } }
  831. }, CKEDITOR.CTRL = 1114112, CKEDITOR.SHIFT = 2228224, CKEDITOR.ALT =
  832. 4456448, CKEDITOR.EVENT_PHASE_CAPTURING = 1, CKEDITOR.EVENT_PHASE_AT_TARGET = 2, CKEDITOR.EVENT_PHASE_BUBBLING = 3, CKEDITOR.dom.domObject = function(a) { if (a) this.$ = a }, CKEDITOR.dom.domObject.prototype = function() {
  833. var a = function(a, b) { return function(g) { typeof CKEDITOR != "undefined" && a.fire(b, new CKEDITOR.dom.event(g)) } };
  834. return {
  835. getPrivate: function() { var a; if (!(a = this.getCustomData("_"))) this.setCustomData("_", a = {}); return a },
  836. on: function(e) {
  837. var b = this.getCustomData("_cke_nativeListeners");
  838. if (!b) {
  839. b = {};
  840. this.setCustomData("_cke_nativeListeners",
  841. b)
  842. }
  843. if (!b[e]) {
  844. b = b[e] = a(this, e);
  845. this.$.addEventListener ? this.$.addEventListener(e, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" + e, b)
  846. }
  847. return CKEDITOR.event.prototype.on.apply(this, arguments)
  848. },
  849. removeListener: function(a) {
  850. CKEDITOR.event.prototype.removeListener.apply(this, arguments);
  851. if (!this.hasListeners(a)) {
  852. var b = this.getCustomData("_cke_nativeListeners"),
  853. g = b && b[a];
  854. if (g) {
  855. this.$.removeEventListener ? this.$.removeEventListener(a, g, false) : this.$.detachEvent && this.$.detachEvent("on" +
  856. a, g);
  857. delete b[a]
  858. }
  859. }
  860. },
  861. removeAllListeners: function() {
  862. var a = this.getCustomData("_cke_nativeListeners"),
  863. b;
  864. for (b in a) {
  865. var g = a[b];
  866. this.$.detachEvent ? this.$.detachEvent("on" + b, g) : this.$.removeEventListener && this.$.removeEventListener(b, g, false);
  867. delete a[b]
  868. }
  869. CKEDITOR.event.prototype.removeAllListeners.call(this)
  870. }
  871. }
  872. }(),
  873. function(a) {
  874. var e = {};
  875. CKEDITOR.on("reset", function() { e = {} });
  876. a.equals = function(a) { try { return a && a.$ === this.$ } catch (g) { return false } };
  877. a.setCustomData = function(a, g) {
  878. var c = this.getUniqueId();
  879. (e[c] ||
  880. (e[c] = {}))[a] = g;
  881. return this
  882. };
  883. a.getCustomData = function(a) { var g = this.$["data-cke-expando"]; return (g = g && e[g]) && a in g ? g[a] : null };
  884. a.removeCustomData = function(a) {
  885. var g = this.$["data-cke-expando"],
  886. g = g && e[g],
  887. c, d;
  888. if (g) {
  889. c = g[a];
  890. d = a in g;
  891. delete g[a]
  892. }
  893. return d ? c : null
  894. };
  895. a.clearCustomData = function() {
  896. this.removeAllListeners();
  897. var a = this.$["data-cke-expando"];
  898. a && delete e[a]
  899. };
  900. a.getUniqueId = function() { return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber()) };
  901. CKEDITOR.event.implementOn(a)
  902. }(CKEDITOR.dom.domObject.prototype),
  903. CKEDITOR.dom.node = function(a) { return a ? new CKEDITOR.dom[a.nodeType == CKEDITOR.NODE_DOCUMENT ? "document" : a.nodeType == CKEDITOR.NODE_ELEMENT ? "element" : a.nodeType == CKEDITOR.NODE_TEXT ? "text" : a.nodeType == CKEDITOR.NODE_COMMENT ? "comment" : a.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ? "documentFragment" : "domObject"](a) : this }, CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject, CKEDITOR.NODE_ELEMENT = 1, CKEDITOR.NODE_DOCUMENT = 9, CKEDITOR.NODE_TEXT = 3, CKEDITOR.NODE_COMMENT = 8, CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11, CKEDITOR.POSITION_IDENTICAL =
  904. 0, CKEDITOR.POSITION_DISCONNECTED = 1, CKEDITOR.POSITION_FOLLOWING = 2, CKEDITOR.POSITION_PRECEDING = 4, CKEDITOR.POSITION_IS_CONTAINED = 8, CKEDITOR.POSITION_CONTAINS = 16, CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, {
  905. appendTo: function(a, e) { a.append(this, e); return a },
  906. clone: function(a, e) {
  907. var b = this.$.cloneNode(a),
  908. g = function(c) {
  909. c["data-cke-expando"] && (c["data-cke-expando"] = false);
  910. if (c.nodeType == CKEDITOR.NODE_ELEMENT) {
  911. e || c.removeAttribute("id", false);
  912. if (a)
  913. for (var c = c.childNodes, d = 0; d < c.length; d++) g(c[d])
  914. }
  915. };
  916. g(b);
  917. return new CKEDITOR.dom.node(b)
  918. },
  919. hasPrevious: function() { return !!this.$.previousSibling },
  920. hasNext: function() { return !!this.$.nextSibling },
  921. insertAfter: function(a) { a.$.parentNode.insertBefore(this.$, a.$.nextSibling); return a },
  922. insertBefore: function(a) { a.$.parentNode.insertBefore(this.$, a.$); return a },
  923. insertBeforeMe: function(a) { this.$.parentNode.insertBefore(a.$, this.$); return a },
  924. getAddress: function(a) {
  925. for (var e = [], b = this.getDocument().$.documentElement, g = this.$; g && g != b;) {
  926. var c = g.parentNode;
  927. c && e.unshift(this.getIndex.call({ $: g },
  928. a));
  929. g = c
  930. }
  931. return e
  932. },
  933. getDocument: function() { return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument) },
  934. getIndex: function(a) {
  935. function e(a, c) { var b = c ? a.nextSibling : a.previousSibling; return !b || b.nodeType != CKEDITOR.NODE_TEXT ? null : b.nodeValue ? b : e(b, c) }
  936. var b = this.$,
  937. g = -1,
  938. c;
  939. if (!this.$.parentNode || a && b.nodeType == CKEDITOR.NODE_TEXT && !b.nodeValue && !e(b) && !e(b, true)) return -1;
  940. do
  941. if (!a || !(b != this.$ && b.nodeType == CKEDITOR.NODE_TEXT && (c || !b.nodeValue))) {
  942. g++;
  943. c = b.nodeType == CKEDITOR.NODE_TEXT
  944. }
  945. while (b =
  946. b.previousSibling);
  947. return g
  948. },
  949. getNextSourceNode: function(a, e, b) {
  950. if (b && !b.call) var g = b,
  951. b = function(a) { return !a.equals(g) };
  952. var a = !a && this.getFirst && this.getFirst(),
  953. c;
  954. if (!a) {
  955. if (this.type == CKEDITOR.NODE_ELEMENT && b && b(this, true) === false) return null;
  956. a = this.getNext()
  957. }
  958. for (; !a && (c = (c || this).getParent());) {
  959. if (b && b(c, true) === false) return null;
  960. a = c.getNext()
  961. }
  962. return !a || b && b(a) === false ? null : e && e != a.type ? a.getNextSourceNode(false, e, b) : a
  963. },
  964. getPreviousSourceNode: function(a, e, b) {
  965. if (b && !b.call) var g = b,
  966. b = function(a) { return !a.equals(g) };
  967. var a = !a && this.getLast && this.getLast(),
  968. c;
  969. if (!a) {
  970. if (this.type == CKEDITOR.NODE_ELEMENT && b && b(this, true) === false) return null;
  971. a = this.getPrevious()
  972. }
  973. for (; !a && (c = (c || this).getParent());) {
  974. if (b && b(c, true) === false) return null;
  975. a = c.getPrevious()
  976. }
  977. return !a || b && b(a) === false ? null : e && a.type != e ? a.getPreviousSourceNode(false, e, b) : a
  978. },
  979. getPrevious: function(a) {
  980. var e = this.$,
  981. b;
  982. do b = (e = e.previousSibling) && e.nodeType != 10 && new CKEDITOR.dom.node(e); while (b && a && !a(b));
  983. return b
  984. },
  985. getNext: function(a) {
  986. var e = this.$,
  987. b;
  988. do b = (e = e.nextSibling) &&
  989. new CKEDITOR.dom.node(e); while (b && a && !a(b));
  990. return b
  991. },
  992. getParent: function(a) { var e = this.$.parentNode; return e && (e.nodeType == CKEDITOR.NODE_ELEMENT || a && e.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ? new CKEDITOR.dom.node(e) : null },
  993. getParents: function(a) {
  994. var e = this,
  995. b = [];
  996. do b[a ? "push" : "unshift"](e); while (e = e.getParent());
  997. return b
  998. },
  999. getCommonAncestor: function(a) {
  1000. if (a.equals(this)) return this;
  1001. if (a.contains && a.contains(this)) return a;
  1002. var e = this.contains ? this : this.getParent();
  1003. do
  1004. if (e.contains(a)) return e;
  1005. while (e =
  1006. e.getParent());
  1007. return null
  1008. },
  1009. getPosition: function(a) {
  1010. var e = this.$,
  1011. b = a.$;
  1012. if (e.compareDocumentPosition) return e.compareDocumentPosition(b);
  1013. if (e == b) return CKEDITOR.POSITION_IDENTICAL;
  1014. if (this.type == CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) {
  1015. if (e.contains) { if (e.contains(b)) return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING; if (b.contains(e)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING }
  1016. if ("sourceIndex" in e) return e.sourceIndex < 0 || b.sourceIndex < 0 ? CKEDITOR.POSITION_DISCONNECTED :
  1017. e.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
  1018. }
  1019. for (var e = this.getAddress(), a = a.getAddress(), b = Math.min(e.length, a.length), g = 0; g <= b - 1; g++)
  1020. if (e[g] != a[g]) { if (g < b) return e[g] < a[g] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING; break }
  1021. return e.length < a.length ? CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1022. },
  1023. getAscendant: function(a, e) {
  1024. var b = this.$,
  1025. g, c;
  1026. if (!e) b = b.parentNode;
  1027. if (typeof a == "function") {
  1028. c =
  1029. true;
  1030. g = a
  1031. } else {
  1032. c = false;
  1033. g = function(c) { c = typeof c.nodeName == "string" ? c.nodeName.toLowerCase() : ""; return typeof a == "string" ? c == a : c in a }
  1034. }
  1035. for (; b;) { if (g(c ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b); try { b = b.parentNode } catch (d) { b = null } }
  1036. return null
  1037. },
  1038. hasAscendant: function(a, e) {
  1039. var b = this.$;
  1040. if (!e) b = b.parentNode;
  1041. for (; b;) {
  1042. if (b.nodeName && b.nodeName.toLowerCase() == a) return true;
  1043. b = b.parentNode
  1044. }
  1045. return false
  1046. },
  1047. move: function(a, e) { a.append(this.remove(), e) },
  1048. remove: function(a) {
  1049. var e = this.$,
  1050. b = e.parentNode;
  1051. if (b) {
  1052. if (a)
  1053. for (; a = e.firstChild;) b.insertBefore(e.removeChild(a), e);
  1054. b.removeChild(e)
  1055. }
  1056. return this
  1057. },
  1058. replace: function(a) {
  1059. this.insertBefore(a);
  1060. a.remove()
  1061. },
  1062. trim: function() {
  1063. this.ltrim();
  1064. this.rtrim()
  1065. },
  1066. ltrim: function() {
  1067. for (var a; this.getFirst && (a = this.getFirst());) {
  1068. if (a.type == CKEDITOR.NODE_TEXT) {
  1069. var e = CKEDITOR.tools.ltrim(a.getText()),
  1070. b = a.getLength();
  1071. if (e) {
  1072. if (e.length < b) {
  1073. a.split(b - e.length);
  1074. this.$.removeChild(this.$.firstChild)
  1075. }
  1076. } else { a.remove(); continue }
  1077. }
  1078. break
  1079. }
  1080. },
  1081. rtrim: function() {
  1082. for (var a; this.getLast && (a =
  1083. this.getLast());) {
  1084. if (a.type == CKEDITOR.NODE_TEXT) {
  1085. var e = CKEDITOR.tools.rtrim(a.getText()),
  1086. b = a.getLength();
  1087. if (e) {
  1088. if (e.length < b) {
  1089. a.split(e.length);
  1090. this.$.lastChild.parentNode.removeChild(this.$.lastChild)
  1091. }
  1092. } else { a.remove(); continue }
  1093. }
  1094. break
  1095. }
  1096. if (CKEDITOR.env.needsBrFiller)(a = this.$.lastChild) && (a.type == 1 && a.nodeName.toLowerCase() == "br") && a.parentNode.removeChild(a)
  1097. },
  1098. isReadOnly: function() {
  1099. var a = this;
  1100. this.type != CKEDITOR.NODE_ELEMENT && (a = this.getParent());
  1101. if (a && typeof a.$.isContentEditable != "undefined") return !(a.$.isContentEditable ||
  1102. a.data("cke-editable"));
  1103. for (; a;) {
  1104. if (a.data("cke-editable")) break;
  1105. if (a.getAttribute("contentEditable") == "false") return true;
  1106. if (a.getAttribute("contentEditable") == "true") break;
  1107. a = a.getParent()
  1108. }
  1109. return !a
  1110. }
  1111. }), CKEDITOR.dom.window = function(a) { CKEDITOR.dom.domObject.call(this, a) }, CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject, CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
  1112. focus: function() { this.$.focus() },
  1113. getViewPaneSize: function() {
  1114. var a = this.$.document,
  1115. e = a.compatMode == "CSS1Compat";
  1116. return {
  1117. width: (e ?
  1118. a.documentElement.clientWidth : a.body.clientWidth) || 0,
  1119. height: (e ? a.documentElement.clientHeight : a.body.clientHeight) || 0
  1120. }
  1121. },
  1122. getScrollPosition: function() {
  1123. var a = this.$;
  1124. if ("pageXOffset" in a) return { x: a.pageXOffset || 0, y: a.pageYOffset || 0 };
  1125. a = a.document;
  1126. return { x: a.documentElement.scrollLeft || a.body.scrollLeft || 0, y: a.documentElement.scrollTop || a.body.scrollTop || 0 }
  1127. },
  1128. getFrame: function() { var a = this.$.frameElement; return a ? new CKEDITOR.dom.element.get(a) : null }
  1129. }), CKEDITOR.dom.document = function(a) {
  1130. CKEDITOR.dom.domObject.call(this,
  1131. a)
  1132. }, CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject, CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
  1133. type: CKEDITOR.NODE_DOCUMENT,
  1134. appendStyleSheet: function(a) {
  1135. if (this.$.createStyleSheet) this.$.createStyleSheet(a);
  1136. else {
  1137. var e = new CKEDITOR.dom.element("link");
  1138. e.setAttributes({ rel: "stylesheet", type: "text/css", href: a });
  1139. this.getHead().append(e)
  1140. }
  1141. },
  1142. appendStyleText: function(a) {
  1143. if (this.$.createStyleSheet) {
  1144. var e = this.$.createStyleSheet("");
  1145. e.cssText = a
  1146. } else {
  1147. var b = new CKEDITOR.dom.element("style",
  1148. this);
  1149. b.append(new CKEDITOR.dom.text(a, this));
  1150. this.getHead().append(b)
  1151. }
  1152. return e || b.$.sheet
  1153. },
  1154. createElement: function(a, e) {
  1155. var b = new CKEDITOR.dom.element(a, this);
  1156. if (e) {
  1157. e.attributes && b.setAttributes(e.attributes);
  1158. e.styles && b.setStyles(e.styles)
  1159. }
  1160. return b
  1161. },
  1162. createText: function(a) { return new CKEDITOR.dom.text(a, this) },
  1163. focus: function() { this.getWindow().focus() },
  1164. getActive: function() { var a; try { a = this.$.activeElement } catch (e) { return null } return new CKEDITOR.dom.element(a) },
  1165. getById: function(a) {
  1166. return (a = this.$.getElementById(a)) ?
  1167. new CKEDITOR.dom.element(a) : null
  1168. },
  1169. getByAddress: function(a, e) {
  1170. for (var b = this.$.documentElement, g = 0; b && g < a.length; g++) {
  1171. var c = a[g];
  1172. if (e)
  1173. for (var d = -1, j = 0; j < b.childNodes.length; j++) { var f = b.childNodes[j]; if (!(e === true && f.nodeType == 3 && f.previousSibling && f.previousSibling.nodeType == 3)) { d++; if (d == c) { b = f; break } } } else b = b.childNodes[c]
  1174. }
  1175. return b ? new CKEDITOR.dom.node(b) : null
  1176. },
  1177. getElementsByTag: function(a, e) {!(CKEDITOR.env.ie && document.documentMode <= 8) && e && (a = e + ":" + a); return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a)) },
  1178. getHead: function() { var a = this.$.getElementsByTagName("head")[0]; return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), true) },
  1179. getBody: function() { return new CKEDITOR.dom.element(this.$.body) },
  1180. getDocumentElement: function() { return new CKEDITOR.dom.element(this.$.documentElement) },
  1181. getWindow: function() { return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView) },
  1182. write: function(a) {
  1183. this.$.open("text/html", "replace");
  1184. CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,
  1185. '$&\n<script data-cke-temp="1">(' + CKEDITOR.tools.fixDomain + ")();<\/script>"));
  1186. this.$.write(a);
  1187. this.$.close()
  1188. },
  1189. find: function(a) { return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a)) },
  1190. findOne: function(a) { return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null },
  1191. _getHtml5ShivFrag: function() {
  1192. var a = this.getCustomData("html5ShivFrag");
  1193. if (!a) {
  1194. a = this.$.createDocumentFragment();
  1195. CKEDITOR.tools.enableHtml5Elements(a, true);
  1196. this.setCustomData("html5ShivFrag", a)
  1197. }
  1198. return a
  1199. }
  1200. }), CKEDITOR.dom.nodeList =
  1201. function(a) { this.$ = a }, CKEDITOR.dom.nodeList.prototype = { count: function() { return this.$.length }, getItem: function(a) { if (a < 0 || a >= this.$.length) return null; return (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null } }, CKEDITOR.dom.element = function(a, e) {
  1202. typeof a == "string" && (a = (e ? e.$ : document).createElement(a));
  1203. CKEDITOR.dom.domObject.call(this, a)
  1204. }, CKEDITOR.dom.element.get = function(a) { return (a = typeof a == "string" ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a)) }, CKEDITOR.dom.element.prototype =
  1205. new CKEDITOR.dom.node, CKEDITOR.dom.element.createFromHtml = function(a, e) {
  1206. var b = new CKEDITOR.dom.element("div", e);
  1207. b.setHtml(a);
  1208. return b.getFirst().remove()
  1209. }, CKEDITOR.dom.element.setMarker = function(a, e, b, g) {
  1210. var c = e.getCustomData("list_marker_id") || e.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
  1211. d = e.getCustomData("list_marker_names") || e.setCustomData("list_marker_names", {}).getCustomData("list_marker_names");
  1212. a[c] = e;
  1213. d[b] = 1;
  1214. return e.setCustomData(b, g)
  1215. }, CKEDITOR.dom.element.clearAllMarkers =
  1216. function(a) { for (var e in a) CKEDITOR.dom.element.clearMarkers(a, a[e], 1) }, CKEDITOR.dom.element.clearMarkers = function(a, e, b) {
  1217. var g = e.getCustomData("list_marker_names"),
  1218. c = e.getCustomData("list_marker_id"),
  1219. d;
  1220. for (d in g) e.removeCustomData(d);
  1221. e.removeCustomData("list_marker_names");
  1222. if (b) {
  1223. e.removeCustomData("list_marker_id");
  1224. delete a[c]
  1225. }
  1226. },
  1227. function() {
  1228. function a(a) {
  1229. var d = true;
  1230. if (!a.$.id) {
  1231. a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber();
  1232. d = false
  1233. }
  1234. return function() { d || a.removeAttribute("id") }
  1235. }
  1236. function e(a, d) {
  1237. return "#" +
  1238. a.$.id + " " + d.split(/,\s*/).join(", #" + a.$.id + " ")
  1239. }
  1240. function b(a) { for (var d = 0, b = 0, f = g[a].length; b < f; b++) d = d + (parseInt(this.getComputedStyle(g[a][b]) || 0, 10) || 0); return d }
  1241. CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
  1242. type: CKEDITOR.NODE_ELEMENT,
  1243. addClass: function(a) {
  1244. var d = this.$.className;
  1245. d && (RegExp("(?:^|\\s)" + a + "(?:\\s|$)", "").test(d) || (d = d + (" " + a)));
  1246. this.$.className = d || a;
  1247. return this
  1248. },
  1249. removeClass: function(a) {
  1250. var d = this.getAttribute("class");
  1251. if (d) {
  1252. a = RegExp("(?:^|\\s+)" + a + "(?=\\s|$)", "i");
  1253. if (a.test(d))(d =
  1254. d.replace(a, "").replace(/^\s+/, "")) ? this.setAttribute("class", d) : this.removeAttribute("class")
  1255. }
  1256. return this
  1257. },
  1258. hasClass: function(a) { return RegExp("(?:^|\\s+)" + a + "(?=\\s|$)", "").test(this.getAttribute("class")) },
  1259. append: function(a, d) {
  1260. typeof a == "string" && (a = this.getDocument().createElement(a));
  1261. d ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$);
  1262. return a
  1263. },
  1264. appendHtml: function(a) {
  1265. if (this.$.childNodes.length) {
  1266. var d = new CKEDITOR.dom.element("div", this.getDocument());
  1267. d.setHtml(a);
  1268. d.moveChildren(this)
  1269. } else this.setHtml(a)
  1270. },
  1271. appendText: function(a) { this.$.text != null ? this.$.text = this.$.text + a : this.append(new CKEDITOR.dom.text(a)) },
  1272. appendBogus: function(a) {
  1273. if (a || CKEDITOR.env.needsBrFiller) {
  1274. for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) a = a.getPrevious();
  1275. if (!a || !a.is || !a.is("br")) {
  1276. a = this.getDocument().createElement("br");
  1277. CKEDITOR.env.gecko && a.setAttribute("type", "_moz");
  1278. this.append(a)
  1279. }
  1280. }
  1281. },
  1282. breakParent: function(a) {
  1283. var d = new CKEDITOR.dom.range(this.getDocument());
  1284. d.setStartAfter(this);
  1285. d.setEndAfter(a);
  1286. a = d.extractContents();
  1287. d.insertNode(this.remove());
  1288. a.insertAfterNode(this)
  1289. },
  1290. contains: CKEDITOR.env.ie || CKEDITOR.env.webkit ? function(a) { var d = this.$; return a.type != CKEDITOR.NODE_ELEMENT ? d.contains(a.getParent().$) : d != a.$ && d.contains(a.$) } : function(a) { return !!(this.$.compareDocumentPosition(a.$) & 16) },
  1291. focus: function() {
  1292. function a() { try { this.$.focus() } catch (c) {} }
  1293. return function(d) { d ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this) }
  1294. }(),
  1295. getHtml: function() {
  1296. var a = this.$.innerHTML;
  1297. return CKEDITOR.env.ie ?
  1298. a.replace(/<\?[^>]*>/g, "") : a
  1299. },
  1300. getOuterHtml: function() {
  1301. if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
  1302. var a = this.$.ownerDocument.createElement("div");
  1303. a.appendChild(this.$.cloneNode(true));
  1304. return a.innerHTML
  1305. },
  1306. getClientRect: function() { var a = CKEDITOR.tools.extend({}, this.$.getBoundingClientRect());!a.width && (a.width = a.right - a.left);!a.height && (a.height = a.bottom - a.top); return a },
  1307. setHtml: CKEDITOR.env.ie && CKEDITOR.env.version < 9 ? function(a) {
  1308. try {
  1309. var d = this.$;
  1310. if (this.getParent()) return d.innerHTML =
  1311. a;
  1312. var b = this.getDocument()._getHtml5ShivFrag();
  1313. b.appendChild(d);
  1314. d.innerHTML = a;
  1315. b.removeChild(d);
  1316. return a
  1317. } catch (f) {
  1318. this.$.innerHTML = "";
  1319. d = new CKEDITOR.dom.element("body", this.getDocument());
  1320. d.$.innerHTML = a;
  1321. for (d = d.getChildren(); d.count();) this.append(d.getItem(0));
  1322. return a
  1323. }
  1324. } : function(a) { return this.$.innerHTML = a },
  1325. setText: function() {
  1326. var a = document.createElement("p");
  1327. a.innerHTML = "x";
  1328. a = a.textContent;
  1329. return function(d) { this.$[a ? "textContent" : "innerText"] = d }
  1330. }(),
  1331. getAttribute: function() {
  1332. var a = function(a) {
  1333. return this.$.getAttribute(a,
  1334. 2)
  1335. };
  1336. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  1337. switch (a) {
  1338. case "class":
  1339. a = "className";
  1340. break;
  1341. case "http-equiv":
  1342. a = "httpEquiv";
  1343. break;
  1344. case "name":
  1345. return this.$.name;
  1346. case "tabindex":
  1347. a = this.$.getAttribute(a, 2);
  1348. a !== 0 && this.$.tabIndex === 0 && (a = null);
  1349. return a;
  1350. case "checked":
  1351. a = this.$.attributes.getNamedItem(a);
  1352. return (a.specified ? a.nodeValue : this.$.checked) ? "checked" : null;
  1353. case "hspace":
  1354. case "value":
  1355. return this.$[a];
  1356. case "style":
  1357. return this.$.style.cssText;
  1358. case "contenteditable":
  1359. case "contentEditable":
  1360. return this.$.attributes.getNamedItem("contentEditable").specified ?
  1361. this.$.getAttribute("contentEditable") : null
  1362. }
  1363. return this.$.getAttribute(a, 2)
  1364. } : a
  1365. }(),
  1366. getChildren: function() { return new CKEDITOR.dom.nodeList(this.$.childNodes) },
  1367. getComputedStyle: CKEDITOR.env.ie ? function(a) { return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)] } : function(a) { var d = this.getWindow().$.getComputedStyle(this.$, null); return d ? d.getPropertyValue(a) : "" },
  1368. getDtd: function() {
  1369. var a = CKEDITOR.dtd[this.getName()];
  1370. this.getDtd = function() { return a };
  1371. return a
  1372. },
  1373. getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag,
  1374. getTabIndex: CKEDITOR.env.ie ? function() {
  1375. var a = this.$.tabIndex;
  1376. a === 0 && (!CKEDITOR.dtd.$tabIndex[this.getName()] && parseInt(this.getAttribute("tabindex"), 10) !== 0) && (a = -1);
  1377. return a
  1378. } : CKEDITOR.env.webkit ? function() {
  1379. var a = this.$.tabIndex;
  1380. if (a === void 0) {
  1381. a = parseInt(this.getAttribute("tabindex"), 10);
  1382. isNaN(a) && (a = -1)
  1383. }
  1384. return a
  1385. } : function() { return this.$.tabIndex },
  1386. getText: function() { return this.$.textContent || this.$.innerText || "" },
  1387. getWindow: function() { return this.getDocument().getWindow() },
  1388. getId: function() {
  1389. return this.$.id ||
  1390. null
  1391. },
  1392. getNameAtt: function() { return this.$.name || null },
  1393. getName: function() {
  1394. var a = this.$.nodeName.toLowerCase();
  1395. if (CKEDITOR.env.ie && document.documentMode <= 8) {
  1396. var d = this.$.scopeName;
  1397. d != "HTML" && (a = d.toLowerCase() + ":" + a)
  1398. }
  1399. this.getName = function() { return a };
  1400. return this.getName()
  1401. },
  1402. getValue: function() { return this.$.value },
  1403. getFirst: function(a) {
  1404. var d = this.$.firstChild;
  1405. (d = d && new CKEDITOR.dom.node(d)) && (a && !a(d)) && (d = d.getNext(a));
  1406. return d
  1407. },
  1408. getLast: function(a) {
  1409. var d = this.$.lastChild;
  1410. (d = d && new CKEDITOR.dom.node(d)) &&
  1411. (a && !a(d)) && (d = d.getPrevious(a));
  1412. return d
  1413. },
  1414. getStyle: function(a) { return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] },
  1415. is: function() {
  1416. var a = this.getName();
  1417. if (typeof arguments[0] == "object") return !!arguments[0][a];
  1418. for (var d = 0; d < arguments.length; d++)
  1419. if (arguments[d] == a) return true;
  1420. return false
  1421. },
  1422. isEditable: function(a) {
  1423. var d = this.getName();
  1424. if (this.isReadOnly() || this.getComputedStyle("display") == "none" || this.getComputedStyle("visibility") == "hidden" || CKEDITOR.dtd.$nonEditable[d] || CKEDITOR.dtd.$empty[d] ||
  1425. this.is("a") && (this.data("cke-saved-name") || this.hasAttribute("name")) && !this.getChildCount()) return false;
  1426. if (a !== false) { a = CKEDITOR.dtd[d] || CKEDITOR.dtd.span; return !(!a || !a["#"]) }
  1427. return true
  1428. },
  1429. isIdentical: function(a) {
  1430. var d = this.clone(0, 1),
  1431. a = a.clone(0, 1);
  1432. d.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  1433. a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  1434. if (d.$.isEqualNode) {
  1435. d.$.style.cssText = CKEDITOR.tools.normalizeCssText(d.$.style.cssText);
  1436. a.$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText);
  1437. return d.$.isEqualNode(a.$)
  1438. }
  1439. d = d.getOuterHtml();
  1440. a = a.getOuterHtml();
  1441. if (CKEDITOR.env.ie && CKEDITOR.env.version < 9 && this.is("a")) {
  1442. var b = this.getParent();
  1443. if (b.type == CKEDITOR.NODE_ELEMENT) {
  1444. b = b.clone();
  1445. b.setHtml(d);
  1446. d = b.getHtml();
  1447. b.setHtml(a);
  1448. a = b.getHtml()
  1449. }
  1450. }
  1451. return d == a
  1452. },
  1453. isVisible: function() {
  1454. var a = (this.$.offsetHeight || this.$.offsetWidth) && this.getComputedStyle("visibility") != "hidden",
  1455. d, b;
  1456. if (a && CKEDITOR.env.webkit) {
  1457. d = this.getWindow();
  1458. if (!d.equals(CKEDITOR.document.getWindow()) &&
  1459. (b = d.$.frameElement)) a = (new CKEDITOR.dom.element(b)).isVisible()
  1460. }
  1461. return !!a
  1462. },
  1463. isEmptyInlineRemoveable: function() { if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return false; for (var a = this.getChildren(), d = 0, b = a.count(); d < b; d++) { var f = a.getItem(d); if (!(f.type == CKEDITOR.NODE_ELEMENT && f.data("cke-bookmark")) && (f.type == CKEDITOR.NODE_ELEMENT && !f.isEmptyInlineRemoveable() || f.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(f.getText()))) return false } return true },
  1464. hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat ||
  1465. CKEDITOR.env.quirks) ? function() {
  1466. for (var a = this.$.attributes, d = 0; d < a.length; d++) {
  1467. var b = a[d];
  1468. switch (b.nodeName) {
  1469. case "class":
  1470. if (this.getAttribute("class")) return true;
  1471. case "data-cke-expando":
  1472. continue;
  1473. default:
  1474. if (b.specified) return true
  1475. }
  1476. }
  1477. return false
  1478. } : function() {
  1479. var a = this.$.attributes,
  1480. d = a.length,
  1481. b = { "data-cke-expando": 1, _moz_dirty: 1 };
  1482. return d > 0 && (d > 2 || !b[a[0].nodeName] || d == 2 && !b[a[1].nodeName])
  1483. },
  1484. hasAttribute: function() {
  1485. function a(c) {
  1486. var b = this.$.attributes.getNamedItem(c);
  1487. if (this.getName() == "input") switch (c) {
  1488. case "class":
  1489. return this.$.className.length >
  1490. 0;
  1491. case "checked":
  1492. return !!this.$.checked;
  1493. case "value":
  1494. c = this.getAttribute("type");
  1495. return c == "checkbox" || c == "radio" ? this.$.value != "on" : !!this.$.value
  1496. }
  1497. return !b ? false : b.specified
  1498. }
  1499. return CKEDITOR.env.ie ? CKEDITOR.env.version < 8 ? function(d) { return d == "name" ? !!this.$.name : a.call(this, d) } : a : function(a) { return !!this.$.attributes.getNamedItem(a) }
  1500. }(),
  1501. hide: function() { this.setStyle("display", "none") },
  1502. moveChildren: function(a, d) {
  1503. var b = this.$,
  1504. a = a.$;
  1505. if (b != a) {
  1506. var f;
  1507. if (d)
  1508. for (; f = b.lastChild;) a.insertBefore(b.removeChild(f),
  1509. a.firstChild);
  1510. else
  1511. for (; f = b.firstChild;) a.appendChild(b.removeChild(f))
  1512. }
  1513. },
  1514. mergeSiblings: function() {
  1515. function a(c, b, f) {
  1516. if (b && b.type == CKEDITOR.NODE_ELEMENT) {
  1517. for (var g = []; b.data("cke-bookmark") || b.isEmptyInlineRemoveable();) {
  1518. g.push(b);
  1519. b = f ? b.getNext() : b.getPrevious();
  1520. if (!b || b.type != CKEDITOR.NODE_ELEMENT) return
  1521. }
  1522. if (c.isIdentical(b)) {
  1523. for (var e = f ? c.getLast() : c.getFirst(); g.length;) g.shift().move(c, !f);
  1524. b.moveChildren(c, !f);
  1525. b.remove();
  1526. e && e.type == CKEDITOR.NODE_ELEMENT && e.mergeSiblings()
  1527. }
  1528. }
  1529. }
  1530. return function(d) {
  1531. if (d ===
  1532. false || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) {
  1533. a(this, this.getNext(), true);
  1534. a(this, this.getPrevious())
  1535. }
  1536. }
  1537. }(),
  1538. show: function() { this.setStyles({ display: "", visibility: "" }) },
  1539. setAttribute: function() {
  1540. var a = function(a, c) { this.$.setAttribute(a, c); return this };
  1541. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(d, b) {
  1542. d == "class" ? this.$.className = b : d == "style" ? this.$.style.cssText = b : d == "tabindex" ? this.$.tabIndex = b : d == "checked" ? this.$.checked = b : d == "contenteditable" ? a.call(this,
  1543. "contentEditable", b) : a.apply(this, arguments);
  1544. return this
  1545. } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(b, g) { if (b == "src" && g.match(/^http:\/\//)) try { a.apply(this, arguments) } catch (f) {} else a.apply(this, arguments); return this } : a
  1546. }(),
  1547. setAttributes: function(a) { for (var b in a) this.setAttribute(b, a[b]); return this },
  1548. setValue: function(a) { this.$.value = a; return this },
  1549. removeAttribute: function() {
  1550. var a = function(a) { this.$.removeAttribute(a) };
  1551. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ?
  1552. function(a) {
  1553. a == "class" ? a = "className" : a == "tabindex" ? a = "tabIndex" : a == "contenteditable" && (a = "contentEditable");
  1554. this.$.removeAttribute(a)
  1555. } : a
  1556. }(),
  1557. removeAttributes: function(a) {
  1558. if (CKEDITOR.tools.isArray(a))
  1559. for (var b = 0; b < a.length; b++) this.removeAttribute(a[b]);
  1560. else
  1561. for (b in a) a.hasOwnProperty(b) && this.removeAttribute(b)
  1562. },
  1563. removeStyle: function(a) {
  1564. var b = this.$.style;
  1565. if (!b.removeProperty && (a == "border" || a == "margin" || a == "padding")) {
  1566. var g = ["top", "left", "right", "bottom"],
  1567. f;
  1568. a == "border" && (f = ["color", "style", "width"]);
  1569. for (var b = [], h = 0; h < g.length; h++)
  1570. if (f)
  1571. for (var e = 0; e < f.length; e++) b.push([a, g[h], f[e]].join("-"));
  1572. else b.push([a, g[h]].join("-"));
  1573. for (a = 0; a < b.length; a++) this.removeStyle(b[a])
  1574. } else {
  1575. b.removeProperty ? b.removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a));
  1576. this.$.style.cssText || this.removeAttribute("style")
  1577. }
  1578. },
  1579. setStyle: function(a, b) { this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b; return this },
  1580. setStyles: function(a) { for (var b in a) this.setStyle(b, a[b]); return this },
  1581. setOpacity: function(a) {
  1582. if (CKEDITOR.env.ie &&
  1583. CKEDITOR.env.version < 9) {
  1584. a = Math.round(a * 100);
  1585. this.setStyle("filter", a >= 100 ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity=" + a + ")")
  1586. } else this.setStyle("opacity", a)
  1587. },
  1588. unselectable: function() {
  1589. this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "none"));
  1590. if (CKEDITOR.env.ie) {
  1591. this.setAttribute("unselectable", "on");
  1592. for (var a, b = this.getElementsByTag("*"), g = 0, f = b.count(); g < f; g++) {
  1593. a = b.getItem(g);
  1594. a.setAttribute("unselectable", "on")
  1595. }
  1596. }
  1597. },
  1598. getPositionedAncestor: function() {
  1599. for (var a = this; a.getName() != "html";) {
  1600. if (a.getComputedStyle("position") !=
  1601. "static") return a;
  1602. a = a.getParent()
  1603. }
  1604. return null
  1605. },
  1606. getDocumentPosition: function(a) {
  1607. var b = 0,
  1608. g = 0,
  1609. f = this.getDocument(),
  1610. h = f.getBody(),
  1611. e = CKEDITOR.env.quirks;
  1612. if (document.documentElement.getBoundingClientRect) {
  1613. var k = this.$.getBoundingClientRect(),
  1614. n = f.$.documentElement,
  1615. o = n.clientTop || h.$.clientTop || 0,
  1616. q = n.clientLeft || h.$.clientLeft || 0,
  1617. m = true;
  1618. if (CKEDITOR.env.ie) {
  1619. m = f.getDocumentElement().contains(this);
  1620. f = f.getBody().contains(this);
  1621. m = e && f || !e && m
  1622. }
  1623. if (m) {
  1624. if (CKEDITOR.env.webkit) {
  1625. b = h.$.scrollLeft || n.scrollLeft;
  1626. g = h.$.scrollTop ||
  1627. n.scrollTop
  1628. } else {
  1629. g = e ? h.$ : n;
  1630. b = g.scrollLeft;
  1631. g = g.scrollTop
  1632. }
  1633. b = k.left + b - q;
  1634. g = k.top + g - o
  1635. }
  1636. } else {
  1637. o = this;
  1638. for (q = null; o && !(o.getName() == "body" || o.getName() == "html");) {
  1639. b = b + (o.$.offsetLeft - o.$.scrollLeft);
  1640. g = g + (o.$.offsetTop - o.$.scrollTop);
  1641. if (!o.equals(this)) {
  1642. b = b + (o.$.clientLeft || 0);
  1643. g = g + (o.$.clientTop || 0)
  1644. }
  1645. for (; q && !q.equals(o);) {
  1646. b = b - q.$.scrollLeft;
  1647. g = g - q.$.scrollTop;
  1648. q = q.getParent()
  1649. }
  1650. q = o;
  1651. o = (k = o.$.offsetParent) ? new CKEDITOR.dom.element(k) : null
  1652. }
  1653. }
  1654. if (a) {
  1655. k = this.getWindow();
  1656. o = a.getWindow();
  1657. if (!k.equals(o) && k.$.frameElement) {
  1658. a =
  1659. (new CKEDITOR.dom.element(k.$.frameElement)).getDocumentPosition(a);
  1660. b = b + a.x;
  1661. g = g + a.y
  1662. }
  1663. }
  1664. if (!document.documentElement.getBoundingClientRect && CKEDITOR.env.gecko && !e) {
  1665. b = b + (this.$.clientLeft ? 1 : 0);
  1666. g = g + (this.$.clientTop ? 1 : 0)
  1667. }
  1668. return { x: b, y: g }
  1669. },
  1670. scrollIntoView: function(a) {
  1671. var b = this.getParent();
  1672. if (b) {
  1673. do {
  1674. (b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1);
  1675. if (b.is("html")) {
  1676. var g = b.getWindow();
  1677. try {
  1678. var f = g.$.frameElement;
  1679. f && (b = new CKEDITOR.dom.element(f))
  1680. } catch (h) {}
  1681. }
  1682. } while (b = b.getParent())
  1683. }
  1684. },
  1685. scrollIntoParent: function(a, b, g) {
  1686. var f, h, e, k;
  1687. function n(b, d) {
  1688. if (/body|html/.test(a.getName())) a.getWindow().$.scrollBy(b, d);
  1689. else {
  1690. a.$.scrollLeft = a.$.scrollLeft + b;
  1691. a.$.scrollTop = a.$.scrollTop + d
  1692. }
  1693. }
  1694. function o(a, b) {
  1695. var c = { x: 0, y: 0 };
  1696. if (!a.is(m ? "body" : "html")) {
  1697. var d = a.$.getBoundingClientRect();
  1698. c.x = d.left;
  1699. c.y = d.top
  1700. }
  1701. d = a.getWindow();
  1702. if (!d.equals(b)) {
  1703. d = o(CKEDITOR.dom.element.get(d.$.frameElement), b);
  1704. c.x = c.x + d.x;
  1705. c.y = c.y + d.y
  1706. }
  1707. return c
  1708. }
  1709. function q(a,
  1710. b) { return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0 }!a && (a = this.getWindow());
  1711. e = a.getDocument();
  1712. var m = e.$.compatMode == "BackCompat";
  1713. a instanceof CKEDITOR.dom.window && (a = m ? e.getBody() : e.getDocumentElement());
  1714. e = a.getWindow();
  1715. h = o(this, e);
  1716. var l = o(a, e),
  1717. p = this.$.offsetHeight;
  1718. f = this.$.offsetWidth;
  1719. var t = a.$.clientHeight,
  1720. s = a.$.clientWidth;
  1721. e = h.x - q(this, "left") - l.x || 0;
  1722. k = h.y - q(this, "top") - l.y || 0;
  1723. f = h.x + f + q(this, "right") - (l.x + s) || 0;
  1724. h = h.y + p + q(this, "bottom") - (l.y + t) || 0;
  1725. if (k < 0 || h > 0) n(0, b === true ? k : b === false ?
  1726. h : k < 0 ? k : h);
  1727. if (g && (e < 0 || f > 0)) n(e < 0 ? e : f, 0)
  1728. },
  1729. setState: function(a, b, g) {
  1730. b = b || "cke";
  1731. switch (a) {
  1732. case CKEDITOR.TRISTATE_ON:
  1733. this.addClass(b + "_on");
  1734. this.removeClass(b + "_off");
  1735. this.removeClass(b + "_disabled");
  1736. g && this.setAttribute("aria-pressed", true);
  1737. g && this.removeAttribute("aria-disabled");
  1738. break;
  1739. case CKEDITOR.TRISTATE_DISABLED:
  1740. this.addClass(b + "_disabled");
  1741. this.removeClass(b + "_off");
  1742. this.removeClass(b + "_on");
  1743. g && this.setAttribute("aria-disabled", true);
  1744. g && this.removeAttribute("aria-pressed");
  1745. break;
  1746. default:
  1747. this.addClass(b +
  1748. "_off");
  1749. this.removeClass(b + "_on");
  1750. this.removeClass(b + "_disabled");
  1751. g && this.removeAttribute("aria-pressed");
  1752. g && this.removeAttribute("aria-disabled")
  1753. }
  1754. },
  1755. getFrameDocument: function() { var a = this.$; try { a.contentWindow.document } catch (b) { a.src = a.src } return a && new CKEDITOR.dom.document(a.contentWindow.document) },
  1756. copyAttributes: function(a, b) {
  1757. for (var g = this.$.attributes, b = b || {}, f = 0; f < g.length; f++) {
  1758. var h = g[f],
  1759. e = h.nodeName.toLowerCase(),
  1760. k;
  1761. if (!(e in b))
  1762. if (e == "checked" && (k = this.getAttribute(e))) a.setAttribute(e, k);
  1763. else if (!CKEDITOR.env.ie || this.hasAttribute(e)) {
  1764. k = this.getAttribute(e);
  1765. if (k === null) k = h.nodeValue;
  1766. a.setAttribute(e, k)
  1767. }
  1768. }
  1769. if (this.$.style.cssText !== "") a.$.style.cssText = this.$.style.cssText
  1770. },
  1771. renameNode: function(a) {
  1772. if (this.getName() != a) {
  1773. var b = this.getDocument(),
  1774. a = new CKEDITOR.dom.element(a, b);
  1775. this.copyAttributes(a);
  1776. this.moveChildren(a);
  1777. this.getParent() && this.$.parentNode.replaceChild(a.$, this.$);
  1778. a.$["data-cke-expando"] = this.$["data-cke-expando"];
  1779. this.$ = a.$;
  1780. delete this.getName
  1781. }
  1782. },
  1783. getChild: function() {
  1784. function a(b,
  1785. c) { var f = b.childNodes; if (c >= 0 && c < f.length) return f[c] }
  1786. return function(b) {
  1787. var g = this.$;
  1788. if (b.slice)
  1789. for (; b.length > 0 && g;) g = a(g, b.shift());
  1790. else g = a(g, b);
  1791. return g ? new CKEDITOR.dom.node(g) : null
  1792. }
  1793. }(),
  1794. getChildCount: function() { return this.$.childNodes.length },
  1795. disableContextMenu: function() { this.on("contextmenu", function(a) { a.data.getTarget().hasClass("cke_enable_context_menu") || a.data.preventDefault() }) },
  1796. getDirection: function(a) {
  1797. return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() &&
  1798. this.getParent().getDirection(1) || this.getDocument().$.dir || "ltr" : this.getStyle("direction") || this.getAttribute("dir")
  1799. },
  1800. data: function(a, b) {
  1801. a = "data-" + a;
  1802. if (b === void 0) return this.getAttribute(a);
  1803. b === false ? this.removeAttribute(a) : this.setAttribute(a, b);
  1804. return null
  1805. },
  1806. getEditor: function() {
  1807. var a = CKEDITOR.instances,
  1808. b, g;
  1809. for (b in a) { g = a[b]; if (g.element.equals(this) && g.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) return g }
  1810. return null
  1811. },
  1812. find: function(b) {
  1813. var d = a(this),
  1814. b = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e(this,
  1815. b)));
  1816. d();
  1817. return b
  1818. },
  1819. findOne: function(b) {
  1820. var d = a(this),
  1821. b = this.$.querySelector(e(this, b));
  1822. d();
  1823. return b ? new CKEDITOR.dom.element(b) : null
  1824. },
  1825. forEach: function(a, b, g) {
  1826. if (!g && (!b || this.type == b)) var f = a(this);
  1827. if (f !== false)
  1828. for (var g = this.getChildren(), h = 0; h < g.count(); h++) {
  1829. f = g.getItem(h);
  1830. f.type == CKEDITOR.NODE_ELEMENT ? f.forEach(a, b) : (!b || f.type == b) && a(f)
  1831. }
  1832. }
  1833. });
  1834. var g = { width: ["border-left-width", "border-right-width", "padding-left", "padding-right"], height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"] };
  1835. CKEDITOR.dom.element.prototype.setSize = function(a, d, g) {
  1836. if (typeof d == "number") {
  1837. if (g && (!CKEDITOR.env.ie || !CKEDITOR.env.quirks)) d = d - b.call(this, a);
  1838. this.setStyle(a, d + "px")
  1839. }
  1840. };
  1841. CKEDITOR.dom.element.prototype.getSize = function(a, d) {
  1842. var g = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0;
  1843. d && (g = g - b.call(this, a));
  1844. return g
  1845. }
  1846. }(), CKEDITOR.dom.documentFragment = function(a) {
  1847. a = a || CKEDITOR.document;
  1848. this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() :
  1849. a
  1850. }, CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, {
  1851. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  1852. insertAfterNode: function(a) {
  1853. a = a.$;
  1854. a.parentNode.insertBefore(this.$, a.nextSibling)
  1855. }
  1856. }, !0, { append: 1, appendBogus: 1, getFirst: 1, getLast: 1, getParent: 1, getNext: 1, getPrevious: 1, appendTo: 1, moveChildren: 1, insertBefore: 1, insertAfterNode: 1, replace: 1, trim: 1, type: 1, ltrim: 1, rtrim: 1, getDocument: 1, getChildCount: 1, getChild: 1, getChildren: 1 }),
  1857. function() {
  1858. function a(a, b) {
  1859. var c = this.range;
  1860. if (this._.end) return null;
  1861. if (!this._.start) {
  1862. this._.start = 1;
  1863. if (c.collapsed) { this.end(); return null }
  1864. c.optimize()
  1865. }
  1866. var d, f = c.startContainer;
  1867. d = c.endContainer;
  1868. var g = c.startOffset,
  1869. k = c.endOffset,
  1870. h, e = this.guard,
  1871. j = this.type,
  1872. i = a ? "getPreviousSourceNode" : "getNextSourceNode";
  1873. if (!a && !this._.guardLTR) {
  1874. var v = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(),
  1875. r = d.type == CKEDITOR.NODE_ELEMENT ? d.getChild(k) : d.getNext();
  1876. this._.guardLTR = function(a, b) {
  1877. return (!b || !v.equals(a)) && (!r || !a.equals(r)) && (a.type != CKEDITOR.NODE_ELEMENT ||
  1878. !b || !a.equals(c.root))
  1879. }
  1880. }
  1881. if (a && !this._.guardRTL) {
  1882. var y = f.type == CKEDITOR.NODE_ELEMENT ? f : f.getParent(),
  1883. z = f.type == CKEDITOR.NODE_ELEMENT ? g ? f.getChild(g - 1) : null : f.getPrevious();
  1884. this._.guardRTL = function(a, b) { return (!b || !y.equals(a)) && (!z || !a.equals(z)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root)) }
  1885. }
  1886. var B = a ? this._.guardRTL : this._.guardLTR;
  1887. h = e ? function(a, b) { return B(a, b) === false ? false : e(a, b) } : B;
  1888. if (this.current) d = this.current[i](false, j, h);
  1889. else {
  1890. if (a) d.type == CKEDITOR.NODE_ELEMENT && (d = k > 0 ? d.getChild(k -
  1891. 1) : h(d, true) === false ? null : d.getPreviousSourceNode(true, j, h));
  1892. else { d = f; if (d.type == CKEDITOR.NODE_ELEMENT && !(d = d.getChild(g))) d = h(f, true) === false ? null : f.getNextSourceNode(true, j, h) }
  1893. d && h(d) === false && (d = null)
  1894. }
  1895. for (; d && !this._.end;) {
  1896. this.current = d;
  1897. if (!this.evaluator || this.evaluator(d) !== false) { if (!b) return d } else if (b && this.evaluator) return false;
  1898. d = d[i](false, j, h)
  1899. }
  1900. this.end();
  1901. return this.current = null
  1902. }
  1903. function e(b) { for (var c, d = null; c = a.call(this, b);) d = c; return d }
  1904. function b(a) {
  1905. if (i(a)) return false;
  1906. if (a.type ==
  1907. CKEDITOR.NODE_TEXT) return true;
  1908. if (a.type == CKEDITOR.NODE_ELEMENT) {
  1909. if (a.is(CKEDITOR.dtd.$inline) || a.is("hr") || a.getAttribute("contenteditable") == "false") return true;
  1910. var b;
  1911. if (b = !CKEDITOR.env.needsBrFiller)
  1912. if (b = a.is(k)) a: {
  1913. b = 0;
  1914. for (var c = a.getChildCount(); b < c; ++b)
  1915. if (!i(a.getChild(b))) { b = false; break a }
  1916. b = true
  1917. }
  1918. if (b) return true
  1919. }
  1920. return false
  1921. }
  1922. CKEDITOR.dom.walker = CKEDITOR.tools.createClass({
  1923. $: function(a) {
  1924. this.range = a;
  1925. this._ = {}
  1926. },
  1927. proto: {
  1928. end: function() { this._.end = 1 },
  1929. next: function() { return a.call(this) },
  1930. previous: function() {
  1931. return a.call(this,
  1932. 1)
  1933. },
  1934. checkForward: function() { return a.call(this, 0, 1) !== false },
  1935. checkBackward: function() { return a.call(this, 1, 1) !== false },
  1936. lastForward: function() { return e.call(this) },
  1937. lastBackward: function() { return e.call(this, 1) },
  1938. reset: function() {
  1939. delete this.current;
  1940. this._ = {}
  1941. }
  1942. }
  1943. });
  1944. var g = { block: 1, "list-item": 1, table: 1, "table-row-group": 1, "table-header-group": 1, "table-footer-group": 1, "table-row": 1, "table-column-group": 1, "table-column": 1, "table-cell": 1, "table-caption": 1 },
  1945. c = { absolute: 1, fixed: 1 };
  1946. CKEDITOR.dom.element.prototype.isBlockBoundary =
  1947. function(a) { return this.getComputedStyle("float") == "none" && !(this.getComputedStyle("position") in c) && g[this.getComputedStyle("display")] ? true : !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) };
  1948. CKEDITOR.dom.walker.blockBoundary = function(a) { return function(b) { return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a)) } };
  1949. CKEDITOR.dom.walker.listItemBoundary = function() { return this.blockBoundary({ br: 1 }) };
  1950. CKEDITOR.dom.walker.bookmark = function(a, b) {
  1951. function c(a) {
  1952. return a && a.getName && a.getName() == "span" &&
  1953. a.data("cke-bookmark")
  1954. }
  1955. return function(d) {
  1956. var f, g;
  1957. f = d && d.type != CKEDITOR.NODE_ELEMENT && (g = d.getParent()) && c(g);
  1958. f = a ? f : f || c(d);
  1959. return !!(b ^ f)
  1960. }
  1961. };
  1962. CKEDITOR.dom.walker.whitespaces = function(a) {
  1963. return function(b) {
  1964. var c;
  1965. b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == "​");
  1966. return !!(a ^ c)
  1967. }
  1968. };
  1969. CKEDITOR.dom.walker.invisible = function(a) {
  1970. var b = CKEDITOR.dom.walker.whitespaces(),
  1971. c = CKEDITOR.env.webkit ? 1 : 0;
  1972. return function(d) {
  1973. if (b(d)) d = 1;
  1974. else {
  1975. d.type == CKEDITOR.NODE_TEXT &&
  1976. (d = d.getParent());
  1977. d = d.$.offsetWidth <= c
  1978. }
  1979. return !!(a ^ d)
  1980. }
  1981. };
  1982. CKEDITOR.dom.walker.nodeType = function(a, b) { return function(c) { return !!(b ^ c.type == a) } };
  1983. CKEDITOR.dom.walker.bogus = function(a) {
  1984. function b(a) { return !j(a) && !f(a) }
  1985. return function(c) {
  1986. var f = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && d.test(c.getText());
  1987. if (f) {
  1988. f = c.getParent();
  1989. c = c.getNext(b);
  1990. f = f.isBlockBoundary() && (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary())
  1991. }
  1992. return !!(a ^ f)
  1993. }
  1994. };
  1995. CKEDITOR.dom.walker.temp = function(a) {
  1996. return function(b) {
  1997. b.type !=
  1998. CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  1999. b = b && b.hasAttribute("data-cke-temp");
  2000. return !!(a ^ b)
  2001. }
  2002. };
  2003. var d = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  2004. j = CKEDITOR.dom.walker.whitespaces(),
  2005. f = CKEDITOR.dom.walker.bookmark(),
  2006. h = CKEDITOR.dom.walker.temp();
  2007. CKEDITOR.dom.walker.ignored = function(a) { return function(b) { b = j(b) || f(b) || h(b); return !!(a ^ b) } };
  2008. var i = CKEDITOR.dom.walker.ignored(),
  2009. k = function(a) {
  2010. var b = {},
  2011. c;
  2012. for (c in a) CKEDITOR.dtd[c]["#"] && (b[c] = 1);
  2013. return b
  2014. }(CKEDITOR.dtd.$block);
  2015. CKEDITOR.dom.walker.editable = function(a) {
  2016. return function(c) {
  2017. return !!(a ^
  2018. b(c))
  2019. }
  2020. };
  2021. CKEDITOR.dom.element.prototype.getBogus = function() {
  2022. var a = this;
  2023. do a = a.getPreviousSourceNode(); while (f(a) || j(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty));
  2024. return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && d.test(a.getText())) ? a : false
  2025. }
  2026. }(), CKEDITOR.dom.range = function(a) {
  2027. this.endOffset = this.endContainer = this.startOffset = this.startContainer = null;
  2028. this.collapsed = true;
  2029. var e = a instanceof CKEDITOR.dom.document;
  2030. this.document = e ? a : a.getDocument();
  2031. this.root = e ? a.getBody() : a
  2032. },
  2033. function() {
  2034. function a() {
  2035. var a = false,
  2036. b = CKEDITOR.dom.walker.whitespaces(),
  2037. c = CKEDITOR.dom.walker.bookmark(true),
  2038. f = CKEDITOR.dom.walker.bogus();
  2039. return function(g) { if (c(g) || b(g)) return true; if (f(g) && !a) return a = true; return g.type == CKEDITOR.NODE_TEXT && (g.hasAscendant("pre") || CKEDITOR.tools.trim(g.getText()).length) || g.type == CKEDITOR.NODE_ELEMENT && !g.is(d) ? false : true }
  2040. }
  2041. function e(a) {
  2042. var b = CKEDITOR.dom.walker.whitespaces(),
  2043. c = CKEDITOR.dom.walker.bookmark(1);
  2044. return function(d) {
  2045. return c(d) ||
  2046. b(d) ? true : !a && j(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty)
  2047. }
  2048. }
  2049. function b(a) { return function() { var b; return this[a ? "getPreviousNode" : "getNextNode"](function(a) {!b && i(a) && (b = a); return h(a) && !(j(a) && a.equals(b)) }) } }
  2050. var g = function(a) { a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset },
  2051. c = function(a, b, c, d) {
  2052. a.optimizeBookmark();
  2053. var f = a.startContainer,
  2054. g = a.endContainer,
  2055. h = a.startOffset,
  2056. e = a.endOffset,
  2057. j, i;
  2058. if (g.type == CKEDITOR.NODE_TEXT) g =
  2059. g.split(e);
  2060. else if (g.getChildCount() > 0)
  2061. if (e >= g.getChildCount()) {
  2062. g = g.append(a.document.createText(""));
  2063. i = true
  2064. } else g = g.getChild(e);
  2065. if (f.type == CKEDITOR.NODE_TEXT) {
  2066. f.split(h);
  2067. f.equals(g) && (g = f.getNext())
  2068. } else if (h)
  2069. if (h >= f.getChildCount()) {
  2070. f = f.append(a.document.createText(""));
  2071. j = true
  2072. } else f = f.getChild(h).getPrevious();
  2073. else {
  2074. f = f.append(a.document.createText(""), 1);
  2075. j = true
  2076. }
  2077. var h = f.getParents(),
  2078. e = g.getParents(),
  2079. w, x, v;
  2080. for (w = 0; w < h.length; w++) {
  2081. x = h[w];
  2082. v = e[w];
  2083. if (!x.equals(v)) break
  2084. }
  2085. for (var r = c, y, z, B, A = w; A < h.length; A++) {
  2086. y =
  2087. h[A];
  2088. r && !y.equals(f) && (z = r.append(y.clone()));
  2089. for (y = y.getNext(); y;) {
  2090. if (y.equals(e[A]) || y.equals(g)) break;
  2091. B = y.getNext();
  2092. if (b == 2) r.append(y.clone(true));
  2093. else {
  2094. y.remove();
  2095. b == 1 && r.append(y)
  2096. }
  2097. y = B
  2098. }
  2099. r && (r = z)
  2100. }
  2101. r = c;
  2102. for (c = w; c < e.length; c++) {
  2103. y = e[c];
  2104. b > 0 && !y.equals(g) && (z = r.append(y.clone()));
  2105. if (!h[c] || y.$.parentNode != h[c].$.parentNode)
  2106. for (y = y.getPrevious(); y;) {
  2107. if (y.equals(h[c]) || y.equals(f)) break;
  2108. B = y.getPrevious();
  2109. if (b == 2) r.$.insertBefore(y.$.cloneNode(true), r.$.firstChild);
  2110. else {
  2111. y.remove();
  2112. b == 1 && r.$.insertBefore(y.$,
  2113. r.$.firstChild)
  2114. }
  2115. y = B
  2116. }
  2117. r && (r = z)
  2118. }
  2119. if (b == 2) {
  2120. x = a.startContainer;
  2121. if (x.type == CKEDITOR.NODE_TEXT) {
  2122. x.$.data = x.$.data + x.$.nextSibling.data;
  2123. x.$.parentNode.removeChild(x.$.nextSibling)
  2124. }
  2125. a = a.endContainer;
  2126. if (a.type == CKEDITOR.NODE_TEXT && a.$.nextSibling) {
  2127. a.$.data = a.$.data + a.$.nextSibling.data;
  2128. a.$.parentNode.removeChild(a.$.nextSibling)
  2129. }
  2130. } else {
  2131. if (x && v && (f.$.parentNode != x.$.parentNode || g.$.parentNode != v.$.parentNode)) {
  2132. b = v.getIndex();
  2133. j && v.$.parentNode == f.$.parentNode && b--;
  2134. if (d && x.type == CKEDITOR.NODE_ELEMENT) {
  2135. d = CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',
  2136. a.document);
  2137. d.insertAfter(x);
  2138. x.mergeSiblings(false);
  2139. a.moveToBookmark({ startNode: d })
  2140. } else a.setStart(v.getParent(), b)
  2141. }
  2142. a.collapse(true)
  2143. }
  2144. j && f.remove();
  2145. i && g.$.parentNode && g.remove()
  2146. },
  2147. d = { abbr: 1, acronym: 1, b: 1, bdo: 1, big: 1, cite: 1, code: 1, del: 1, dfn: 1, em: 1, font: 1, i: 1, ins: 1, label: 1, kbd: 1, q: 1, samp: 1, small: 1, span: 1, strike: 1, strong: 1, sub: 1, sup: 1, tt: 1, u: 1, "var": 1 },
  2148. j = CKEDITOR.dom.walker.bogus(),
  2149. f = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  2150. h = CKEDITOR.dom.walker.editable(),
  2151. i = CKEDITOR.dom.walker.ignored(true);
  2152. CKEDITOR.dom.range.prototype = {
  2153. clone: function() {
  2154. var a = new CKEDITOR.dom.range(this.root);
  2155. a._setStartContainer(this.startContainer);
  2156. a.startOffset = this.startOffset;
  2157. a._setEndContainer(this.endContainer);
  2158. a.endOffset = this.endOffset;
  2159. a.collapsed = this.collapsed;
  2160. return a
  2161. },
  2162. collapse: function(a) {
  2163. if (a) {
  2164. this._setEndContainer(this.startContainer);
  2165. this.endOffset = this.startOffset
  2166. } else {
  2167. this._setStartContainer(this.endContainer);
  2168. this.startOffset = this.endOffset
  2169. }
  2170. this.collapsed = true
  2171. },
  2172. cloneContents: function() {
  2173. var a = new CKEDITOR.dom.documentFragment(this.document);
  2174. this.collapsed || c(this, 2, a);
  2175. return a
  2176. },
  2177. deleteContents: function(a) { this.collapsed || c(this, 0, null, a) },
  2178. extractContents: function(a) {
  2179. var b = new CKEDITOR.dom.documentFragment(this.document);
  2180. this.collapsed || c(this, 1, b, a);
  2181. return b
  2182. },
  2183. createBookmark: function(a) {
  2184. var b, c, d, f, g = this.collapsed;
  2185. b = this.document.createElement("span");
  2186. b.data("cke-bookmark", 1);
  2187. b.setStyle("display", "none");
  2188. b.setHtml("&nbsp;");
  2189. if (a) {
  2190. d = "cke_bm_" + CKEDITOR.tools.getNextNumber();
  2191. b.setAttribute("id", d + (g ? "C" : "S"))
  2192. }
  2193. if (!g) {
  2194. c = b.clone();
  2195. c.setHtml("&nbsp;");
  2196. a && c.setAttribute("id", d + "E");
  2197. f = this.clone();
  2198. f.collapse();
  2199. f.insertNode(c)
  2200. }
  2201. f = this.clone();
  2202. f.collapse(true);
  2203. f.insertNode(b);
  2204. if (c) {
  2205. this.setStartAfter(b);
  2206. this.setEndBefore(c)
  2207. } else this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END);
  2208. return { startNode: a ? d + (g ? "C" : "S") : b, endNode: a ? d + "E" : c, serializable: a, collapsed: g }
  2209. },
  2210. createBookmark2: function() {
  2211. function a(c) {
  2212. var d = c.container,
  2213. f = c.offset,
  2214. g;
  2215. g = d;
  2216. var h = f;
  2217. g = g.type != CKEDITOR.NODE_ELEMENT || h === 0 || h == g.getChildCount() ? 0 : g.getChild(h - 1).type == CKEDITOR.NODE_TEXT && g.getChild(h).type ==
  2218. CKEDITOR.NODE_TEXT;
  2219. if (g) {
  2220. d = d.getChild(f - 1);
  2221. f = d.getLength()
  2222. }
  2223. d.type == CKEDITOR.NODE_ELEMENT && f > 1 && (f = d.getChild(f - 1).getIndex(true) + 1);
  2224. if (d.type == CKEDITOR.NODE_TEXT) {
  2225. g = d;
  2226. for (h = 0;
  2227. (g = g.getPrevious()) && g.type == CKEDITOR.NODE_TEXT;) h = h + g.getLength();
  2228. g = h;
  2229. if (d.getText()) f = f + g;
  2230. else {
  2231. h = d.getPrevious(b);
  2232. if (g) {
  2233. f = g;
  2234. d = h ? h.getNext() : d.getParent().getFirst()
  2235. } else {
  2236. d = d.getParent();
  2237. f = h ? h.getIndex(true) + 1 : 0
  2238. }
  2239. }
  2240. }
  2241. c.container = d;
  2242. c.offset = f
  2243. }
  2244. var b = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, true);
  2245. return function(b) {
  2246. var c = this.collapsed,
  2247. d = { container: this.startContainer, offset: this.startOffset },
  2248. f = { container: this.endContainer, offset: this.endOffset };
  2249. if (b) {
  2250. a(d);
  2251. c || a(f)
  2252. }
  2253. return { start: d.container.getAddress(b), end: c ? null : f.container.getAddress(b), startOffset: d.offset, endOffset: f.offset, normalized: b, collapsed: c, is2: true }
  2254. }
  2255. }(),
  2256. moveToBookmark: function(a) {
  2257. if (a.is2) {
  2258. var b = this.document.getByAddress(a.start, a.normalized),
  2259. c = a.startOffset,
  2260. d = a.end && this.document.getByAddress(a.end, a.normalized),
  2261. a = a.endOffset;
  2262. this.setStart(b, c);
  2263. d ? this.setEnd(d, a) :
  2264. this.collapse(true)
  2265. } else {
  2266. b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode;
  2267. a = c ? this.document.getById(a.endNode) : a.endNode;
  2268. this.setStartBefore(b);
  2269. b.remove();
  2270. if (a) {
  2271. this.setEndBefore(a);
  2272. a.remove()
  2273. } else this.collapse(true)
  2274. }
  2275. },
  2276. getBoundaryNodes: function() {
  2277. var a = this.startContainer,
  2278. b = this.endContainer,
  2279. c = this.startOffset,
  2280. d = this.endOffset,
  2281. f;
  2282. if (a.type == CKEDITOR.NODE_ELEMENT) {
  2283. f = a.getChildCount();
  2284. if (f > c) a = a.getChild(c);
  2285. else if (f < 1) a = a.getPreviousSourceNode();
  2286. else {
  2287. for (a = a.$; a.lastChild;) a = a.lastChild;
  2288. a = new CKEDITOR.dom.node(a);
  2289. a = a.getNextSourceNode() || a
  2290. }
  2291. }
  2292. if (b.type == CKEDITOR.NODE_ELEMENT) {
  2293. f = b.getChildCount();
  2294. if (f > d) b = b.getChild(d).getPreviousSourceNode(true);
  2295. else if (f < 1) b = b.getPreviousSourceNode();
  2296. else {
  2297. for (b = b.$; b.lastChild;) b = b.lastChild;
  2298. b = new CKEDITOR.dom.node(b)
  2299. }
  2300. }
  2301. a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b);
  2302. return { startNode: a, endNode: b }
  2303. },
  2304. getCommonAncestor: function(a, b) {
  2305. var c = this.startContainer,
  2306. d = this.endContainer,
  2307. c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset -
  2308. 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d);
  2309. return b && !c.is ? c.getParent() : c
  2310. },
  2311. optimize: function() {
  2312. var a = this.startContainer,
  2313. b = this.startOffset;
  2314. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a));
  2315. a = this.endContainer;
  2316. b = this.endOffset;
  2317. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a))
  2318. },
  2319. optimizeBookmark: function() {
  2320. var a = this.startContainer,
  2321. b = this.endContainer;
  2322. a.is && (a.is("span") && a.data("cke-bookmark")) &&
  2323. this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
  2324. b && (b.is && b.is("span") && b.data("cke-bookmark")) && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
  2325. },
  2326. trim: function(a, b) {
  2327. var c = this.startContainer,
  2328. d = this.startOffset,
  2329. f = this.collapsed;
  2330. if ((!a || f) && c && c.type == CKEDITOR.NODE_TEXT) {
  2331. if (d)
  2332. if (d >= c.getLength()) {
  2333. d = c.getIndex() + 1;
  2334. c = c.getParent()
  2335. } else {
  2336. var g = c.split(d),
  2337. d = c.getIndex() + 1,
  2338. c = c.getParent();
  2339. if (this.startContainer.equals(this.endContainer)) this.setEnd(g, this.endOffset - this.startOffset);
  2340. else if (c.equals(this.endContainer)) this.endOffset =
  2341. this.endOffset + 1
  2342. }
  2343. else {
  2344. d = c.getIndex();
  2345. c = c.getParent()
  2346. }
  2347. this.setStart(c, d);
  2348. if (f) { this.collapse(true); return }
  2349. }
  2350. c = this.endContainer;
  2351. d = this.endOffset;
  2352. if (!b && !f && c && c.type == CKEDITOR.NODE_TEXT) {
  2353. if (d) {
  2354. d >= c.getLength() || c.split(d);
  2355. d = c.getIndex() + 1
  2356. } else d = c.getIndex();
  2357. c = c.getParent();
  2358. this.setEnd(c, d)
  2359. }
  2360. },
  2361. enlarge: function(a, b) {
  2362. function c(a) { return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a }
  2363. var d = RegExp(/[^\s\ufeff]/);
  2364. switch (a) {
  2365. case CKEDITOR.ENLARGE_INLINE:
  2366. var f = 1;
  2367. case CKEDITOR.ENLARGE_ELEMENT:
  2368. if (this.collapsed) break;
  2369. var g = this.getCommonAncestor(),
  2370. h = this.root,
  2371. e, j, i, w, x, v = false,
  2372. r, y;
  2373. r = this.startContainer;
  2374. var z = this.startOffset;
  2375. if (r.type == CKEDITOR.NODE_TEXT) {
  2376. if (z) {
  2377. r = !CKEDITOR.tools.trim(r.substring(0, z)).length && r;
  2378. v = !!r
  2379. }
  2380. if (r && !(w = r.getPrevious())) i = r.getParent()
  2381. } else {
  2382. z && (w = r.getChild(z - 1) || r.getLast());
  2383. w || (i = r)
  2384. }
  2385. for (i = c(i); i || w;) {
  2386. if (i && !w) {
  2387. !x && i.equals(g) && (x = true);
  2388. if (f ? i.isBlockBoundary() : !h.contains(i)) break;
  2389. if (!v || i.getComputedStyle("display") != "inline") {
  2390. v = false;
  2391. x ? e = i : this.setStartBefore(i)
  2392. }
  2393. w = i.getPrevious()
  2394. }
  2395. for (; w;) {
  2396. r =
  2397. false;
  2398. if (w.type == CKEDITOR.NODE_COMMENT) w = w.getPrevious();
  2399. else {
  2400. if (w.type == CKEDITOR.NODE_TEXT) {
  2401. y = w.getText();
  2402. d.test(y) && (w = null);
  2403. r = /[\s\ufeff]$/.test(y)
  2404. } else if ((w.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && w.is("br")) && !w.data("cke-bookmark"))
  2405. if (v && CKEDITOR.dtd.$removeEmpty[w.getName()]) {
  2406. y = w.getText();
  2407. if (d.test(y)) w = null;
  2408. else
  2409. for (var z = w.$.getElementsByTagName("*"), B = 0, A; A = z[B++];)
  2410. if (!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]) { w = null; break }
  2411. w && (r = !!y.length)
  2412. } else w = null;
  2413. r && (v ? x ? e = i : i && this.setStartBefore(i) :
  2414. v = true);
  2415. if (w) {
  2416. r = w.getPrevious();
  2417. if (!i && !r) {
  2418. i = w;
  2419. w = null;
  2420. break
  2421. }
  2422. w = r
  2423. } else i = null
  2424. }
  2425. }
  2426. i && (i = c(i.getParent()))
  2427. }
  2428. r = this.endContainer;
  2429. z = this.endOffset;
  2430. i = w = null;
  2431. x = v = false;
  2432. var G = function(a, b) {
  2433. var c = new CKEDITOR.dom.range(h);
  2434. c.setStart(a, b);
  2435. c.setEndAt(h, CKEDITOR.POSITION_BEFORE_END);
  2436. var c = new CKEDITOR.dom.walker(c),
  2437. f;
  2438. for (c.guard = function(a) { return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary()) }; f = c.next();) {
  2439. if (f.type != CKEDITOR.NODE_TEXT) return false;
  2440. y = f != a ? f.getText() : f.substring(b);
  2441. if (d.test(y)) return false
  2442. }
  2443. return true
  2444. };
  2445. if (r.type == CKEDITOR.NODE_TEXT)
  2446. if (CKEDITOR.tools.trim(r.substring(z)).length) v = true;
  2447. else { v = !r.getLength(); if (z == r.getLength()) { if (!(w = r.getNext())) i = r.getParent() } else G(r, z) && (i = r.getParent()) }
  2448. else(w = r.getChild(z)) || (i = r);
  2449. for (; i || w;) {
  2450. if (i && !w) {
  2451. !x && i.equals(g) && (x = true);
  2452. if (f ? i.isBlockBoundary() : !h.contains(i)) break;
  2453. if (!v || i.getComputedStyle("display") != "inline") {
  2454. v = false;
  2455. x ? j = i : i && this.setEndAfter(i)
  2456. }
  2457. w = i.getNext()
  2458. }
  2459. for (; w;) {
  2460. r = false;
  2461. if (w.type == CKEDITOR.NODE_TEXT) {
  2462. y = w.getText();
  2463. G(w, 0) || (w = null);
  2464. r = /^[\s\ufeff]/.test(y)
  2465. } else if (w.type ==
  2466. CKEDITOR.NODE_ELEMENT) {
  2467. if ((w.$.offsetWidth > 0 || b && w.is("br")) && !w.data("cke-bookmark"))
  2468. if (v && CKEDITOR.dtd.$removeEmpty[w.getName()]) {
  2469. y = w.getText();
  2470. if (d.test(y)) w = null;
  2471. else {
  2472. z = w.$.getElementsByTagName("*");
  2473. for (B = 0; A = z[B++];)
  2474. if (!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]) { w = null; break }
  2475. }
  2476. w && (r = !!y.length)
  2477. } else w = null
  2478. } else r = 1;
  2479. r && v && (x ? j = i : this.setEndAfter(i));
  2480. if (w) {
  2481. r = w.getNext();
  2482. if (!i && !r) {
  2483. i = w;
  2484. w = null;
  2485. break
  2486. }
  2487. w = r
  2488. } else i = null
  2489. }
  2490. i && (i = c(i.getParent()))
  2491. }
  2492. if (e && j) {
  2493. g = e.contains(j) ? j : e;
  2494. this.setStartBefore(g);
  2495. this.setEndAfter(g)
  2496. }
  2497. break;
  2498. case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
  2499. case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
  2500. i = new CKEDITOR.dom.range(this.root);
  2501. h = this.root;
  2502. i.setStartAt(h, CKEDITOR.POSITION_AFTER_START);
  2503. i.setEnd(this.startContainer, this.startOffset);
  2504. i = new CKEDITOR.dom.walker(i);
  2505. var D, J, C = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? { br: 1 } : null),
  2506. F = null,
  2507. E = function(a) {
  2508. if (a.type == CKEDITOR.NODE_ELEMENT && a.getAttribute("contenteditable") == "false")
  2509. if (F) { if (F.equals(a)) { F = null; return } } else F =
  2510. a;
  2511. else if (F) return;
  2512. var b = C(a);
  2513. b || (D = a);
  2514. return b
  2515. },
  2516. f = function(a) { var b = E(a);!b && (a.is && a.is("br")) && (J = a); return b };
  2517. i.guard = E;
  2518. i = i.lastBackward();
  2519. D = D || h;
  2520. this.setStartAt(D, !D.is("br") && (!i && this.checkStartOfBlock() || i && D.contains(i)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
  2521. if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
  2522. i = this.clone();
  2523. i = new CKEDITOR.dom.walker(i);
  2524. var I = CKEDITOR.dom.walker.whitespaces(),
  2525. L = CKEDITOR.dom.walker.bookmark();
  2526. i.evaluator = function(a) { return !I(a) && !L(a) };
  2527. if ((i = i.previous()) &&
  2528. i.type == CKEDITOR.NODE_ELEMENT && i.is("br")) break
  2529. }
  2530. i = this.clone();
  2531. i.collapse();
  2532. i.setEndAt(h, CKEDITOR.POSITION_BEFORE_END);
  2533. i = new CKEDITOR.dom.walker(i);
  2534. i.guard = a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? f : E;
  2535. D = F = J = null;
  2536. i = i.lastForward();
  2537. D = D || h;
  2538. this.setEndAt(D, !i && this.checkEndOfBlock() || i && D.contains(i) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START);
  2539. J && this.setEndAfter(J)
  2540. }
  2541. },
  2542. shrink: function(a, b, c) {
  2543. if (!this.collapsed) {
  2544. var a = a || CKEDITOR.SHRINK_TEXT,
  2545. d = this.clone(),
  2546. f = this.startContainer,
  2547. g = this.endContainer,
  2548. h = this.startOffset,
  2549. e = this.endOffset,
  2550. i = 1,
  2551. j = 1;
  2552. if (f && f.type == CKEDITOR.NODE_TEXT)
  2553. if (h)
  2554. if (h >= f.getLength()) d.setStartAfter(f);
  2555. else {
  2556. d.setStartBefore(f);
  2557. i = 0
  2558. }
  2559. else d.setStartBefore(f);
  2560. if (g && g.type == CKEDITOR.NODE_TEXT)
  2561. if (e)
  2562. if (e >= g.getLength()) d.setEndAfter(g);
  2563. else {
  2564. d.setEndAfter(g);
  2565. j = 0
  2566. }
  2567. else d.setEndBefore(g);
  2568. var d = new CKEDITOR.dom.walker(d),
  2569. w = CKEDITOR.dom.walker.bookmark();
  2570. d.evaluator = function(b) { return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT) };
  2571. var x;
  2572. d.guard = function(b, d) {
  2573. if (w(b)) return true;
  2574. if (a == CKEDITOR.SHRINK_ELEMENT && b.type == CKEDITOR.NODE_TEXT || d && b.equals(x) || c === false && b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute("contenteditable")) return false;
  2575. !d && b.type == CKEDITOR.NODE_ELEMENT && (x = b);
  2576. return true
  2577. };
  2578. if (i)(f = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(f, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
  2579. if (j) {
  2580. d.reset();
  2581. (d = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(d,
  2582. b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END)
  2583. }
  2584. return !(!i && !j)
  2585. }
  2586. },
  2587. insertNode: function(a) {
  2588. this.optimizeBookmark();
  2589. this.trim(false, true);
  2590. var b = this.startContainer,
  2591. c = b.getChild(this.startOffset);
  2592. c ? a.insertBefore(c) : b.append(a);
  2593. a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
  2594. this.setStartBefore(a)
  2595. },
  2596. moveToPosition: function(a, b) {
  2597. this.setStartAt(a, b);
  2598. this.collapse(true)
  2599. },
  2600. moveToRange: function(a) {
  2601. this.setStart(a.startContainer, a.startOffset);
  2602. this.setEnd(a.endContainer,
  2603. a.endOffset)
  2604. },
  2605. selectNodeContents: function(a) {
  2606. this.setStart(a, 0);
  2607. this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
  2608. },
  2609. setStart: function(a, b) {
  2610. if (a.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[a.getName()]) {
  2611. b = a.getIndex();
  2612. a = a.getParent()
  2613. }
  2614. this._setStartContainer(a);
  2615. this.startOffset = b;
  2616. if (!this.endContainer) {
  2617. this._setEndContainer(a);
  2618. this.endOffset = b
  2619. }
  2620. g(this)
  2621. },
  2622. setEnd: function(a, b) {
  2623. if (a.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[a.getName()]) {
  2624. b = a.getIndex() + 1;
  2625. a = a.getParent()
  2626. }
  2627. this._setEndContainer(a);
  2628. this.endOffset = b;
  2629. if (!this.startContainer) {
  2630. this._setStartContainer(a);
  2631. this.startOffset = b
  2632. }
  2633. g(this)
  2634. },
  2635. setStartAfter: function(a) { this.setStart(a.getParent(), a.getIndex() + 1) },
  2636. setStartBefore: function(a) { this.setStart(a.getParent(), a.getIndex()) },
  2637. setEndAfter: function(a) { this.setEnd(a.getParent(), a.getIndex() + 1) },
  2638. setEndBefore: function(a) { this.setEnd(a.getParent(), a.getIndex()) },
  2639. setStartAt: function(a, b) {
  2640. switch (b) {
  2641. case CKEDITOR.POSITION_AFTER_START:
  2642. this.setStart(a, 0);
  2643. break;
  2644. case CKEDITOR.POSITION_BEFORE_END:
  2645. a.type ==
  2646. CKEDITOR.NODE_TEXT ? this.setStart(a, a.getLength()) : this.setStart(a, a.getChildCount());
  2647. break;
  2648. case CKEDITOR.POSITION_BEFORE_START:
  2649. this.setStartBefore(a);
  2650. break;
  2651. case CKEDITOR.POSITION_AFTER_END:
  2652. this.setStartAfter(a)
  2653. }
  2654. g(this)
  2655. },
  2656. setEndAt: function(a, b) {
  2657. switch (b) {
  2658. case CKEDITOR.POSITION_AFTER_START:
  2659. this.setEnd(a, 0);
  2660. break;
  2661. case CKEDITOR.POSITION_BEFORE_END:
  2662. a.type == CKEDITOR.NODE_TEXT ? this.setEnd(a, a.getLength()) : this.setEnd(a, a.getChildCount());
  2663. break;
  2664. case CKEDITOR.POSITION_BEFORE_START:
  2665. this.setEndBefore(a);
  2666. break;
  2667. case CKEDITOR.POSITION_AFTER_END:
  2668. this.setEndAfter(a)
  2669. }
  2670. g(this)
  2671. },
  2672. fixBlock: function(a, b) {
  2673. var c = this.createBookmark(),
  2674. d = this.document.createElement(b);
  2675. this.collapse(a);
  2676. this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  2677. this.extractContents().appendTo(d);
  2678. d.trim();
  2679. d.appendBogus();
  2680. this.insertNode(d);
  2681. this.moveToBookmark(c);
  2682. return d
  2683. },
  2684. splitBlock: function(a) {
  2685. var b = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
  2686. c = new CKEDITOR.dom.elementPath(this.endContainer, this.root),
  2687. d = b.block,
  2688. f = c.block,
  2689. g = null;
  2690. if (!b.blockLimit.equals(c.blockLimit)) return null;
  2691. if (a != "br") {
  2692. if (!d) {
  2693. d = this.fixBlock(true, a);
  2694. f = (new CKEDITOR.dom.elementPath(this.endContainer, this.root)).block
  2695. }
  2696. f || (f = this.fixBlock(false, a))
  2697. }
  2698. a = d && this.checkStartOfBlock();
  2699. b = f && this.checkEndOfBlock();
  2700. this.deleteContents();
  2701. if (d && d.equals(f))
  2702. if (b) {
  2703. g = new CKEDITOR.dom.elementPath(this.startContainer, this.root);
  2704. this.moveToPosition(f, CKEDITOR.POSITION_AFTER_END);
  2705. f = null
  2706. } else if (a) {
  2707. g = new CKEDITOR.dom.elementPath(this.startContainer, this.root);
  2708. this.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START);
  2709. d = null
  2710. } else {
  2711. f =
  2712. this.splitElement(d);
  2713. d.is("ul", "ol") || d.appendBogus()
  2714. }
  2715. return { previousBlock: d, nextBlock: f, wasStartOfBlock: a, wasEndOfBlock: b, elementPath: g }
  2716. },
  2717. splitElement: function(a) {
  2718. if (!this.collapsed) return null;
  2719. this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
  2720. var b = this.extractContents(),
  2721. c = a.clone(false);
  2722. b.appendTo(c);
  2723. c.insertAfter(a);
  2724. this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  2725. return c
  2726. },
  2727. removeEmptyBlocksAtEnd: function() {
  2728. function a(d) {
  2729. return function(a) {
  2730. return b(a) || (c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable()) ||
  2731. d.is("table") && a.is("caption") ? false : true
  2732. }
  2733. }
  2734. var b = CKEDITOR.dom.walker.whitespaces(),
  2735. c = CKEDITOR.dom.walker.bookmark(false);
  2736. return function(b) {
  2737. for (var c = this.createBookmark(), d = this[b ? "endPath" : "startPath"](), f = d.block || d.blockLimit, g; f && !f.equals(d.root) && !f.getFirst(a(f));) {
  2738. g = f.getParent();
  2739. this[b ? "setEndAt" : "setStartAt"](f, CKEDITOR.POSITION_AFTER_END);
  2740. f.remove(1);
  2741. f = g
  2742. }
  2743. this.moveToBookmark(c)
  2744. }
  2745. }(),
  2746. startPath: function() { return new CKEDITOR.dom.elementPath(this.startContainer, this.root) },
  2747. endPath: function() {
  2748. return new CKEDITOR.dom.elementPath(this.endContainer,
  2749. this.root)
  2750. },
  2751. checkBoundaryOfElement: function(a, b) {
  2752. var c = b == CKEDITOR.START,
  2753. d = this.clone();
  2754. d.collapse(c);
  2755. d[c ? "setStartAt" : "setEndAt"](a, c ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
  2756. d = new CKEDITOR.dom.walker(d);
  2757. d.evaluator = e(c);
  2758. return d[c ? "checkBackward" : "checkForward"]()
  2759. },
  2760. checkStartOfBlock: function() {
  2761. var b = this.startContainer,
  2762. c = this.startOffset;
  2763. if (CKEDITOR.env.ie && c && b.type == CKEDITOR.NODE_TEXT) {
  2764. b = CKEDITOR.tools.ltrim(b.substring(0, c));
  2765. f.test(b) && this.trim(0, 1)
  2766. }
  2767. this.trim();
  2768. b = new CKEDITOR.dom.elementPath(this.startContainer,
  2769. this.root);
  2770. c = this.clone();
  2771. c.collapse(true);
  2772. c.setStartAt(b.block || b.blockLimit, CKEDITOR.POSITION_AFTER_START);
  2773. b = new CKEDITOR.dom.walker(c);
  2774. b.evaluator = a();
  2775. return b.checkBackward()
  2776. },
  2777. checkEndOfBlock: function() {
  2778. var b = this.endContainer,
  2779. c = this.endOffset;
  2780. if (CKEDITOR.env.ie && b.type == CKEDITOR.NODE_TEXT) {
  2781. b = CKEDITOR.tools.rtrim(b.substring(c));
  2782. f.test(b) && this.trim(1, 0)
  2783. }
  2784. this.trim();
  2785. b = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
  2786. c = this.clone();
  2787. c.collapse(false);
  2788. c.setEndAt(b.block || b.blockLimit, CKEDITOR.POSITION_BEFORE_END);
  2789. b = new CKEDITOR.dom.walker(c);
  2790. b.evaluator = a();
  2791. return b.checkForward()
  2792. },
  2793. getPreviousNode: function(a, b, c) {
  2794. var d = this.clone();
  2795. d.collapse(1);
  2796. d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START);
  2797. c = new CKEDITOR.dom.walker(d);
  2798. c.evaluator = a;
  2799. c.guard = b;
  2800. return c.previous()
  2801. },
  2802. getNextNode: function(a, b, c) {
  2803. var d = this.clone();
  2804. d.collapse();
  2805. d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
  2806. c = new CKEDITOR.dom.walker(d);
  2807. c.evaluator = a;
  2808. c.guard = b;
  2809. return c.next()
  2810. },
  2811. checkReadOnly: function() {
  2812. function a(b, c) {
  2813. for (; b;) {
  2814. if (b.type ==
  2815. CKEDITOR.NODE_ELEMENT) { if (b.getAttribute("contentEditable") == "false" && !b.data("cke-editable")) return 0; if (b.is("html") || b.getAttribute("contentEditable") == "true" && (b.contains(c) || b.equals(c))) break }
  2816. b = b.getParent()
  2817. }
  2818. return 1
  2819. }
  2820. return function() {
  2821. var b = this.startContainer,
  2822. c = this.endContainer;
  2823. return !(a(b, c) && a(c, b))
  2824. }
  2825. }(),
  2826. moveToElementEditablePosition: function(a, b) {
  2827. if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(false)) { this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START); return true }
  2828. for (var c =
  2829. 0; a;) {
  2830. if (a.type == CKEDITOR.NODE_TEXT) {
  2831. b && this.endContainer && this.checkEndOfBlock() && f.test(a.getText()) ? this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START) : this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START);
  2832. c = 1;
  2833. break
  2834. }
  2835. if (a.type == CKEDITOR.NODE_ELEMENT)
  2836. if (a.isEditable()) {
  2837. this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START);
  2838. c = 1
  2839. } else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START);
  2840. else if (a.getAttribute("contenteditable") == "false" && a.is(CKEDITOR.dtd.$block)) {
  2841. this.setStartBefore(a);
  2842. this.setEndAfter(a);
  2843. return true
  2844. }
  2845. var d = a,
  2846. g = c,
  2847. h = void 0;
  2848. d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(false) && (h = d[b ? "getLast" : "getFirst"](i));
  2849. !g && !h && (h = d[b ? "getPrevious" : "getNext"](i));
  2850. a = h
  2851. }
  2852. return !!c
  2853. },
  2854. moveToClosestEditablePosition: function(a, b) {
  2855. var c = new CKEDITOR.dom.range(this.root),
  2856. d = 0,
  2857. f, g = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
  2858. c.moveToPosition(a, g[b ? 0 : 1]);
  2859. if (a.is(CKEDITOR.dtd.$block)) {
  2860. if (f =
  2861. c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) {
  2862. d = 1;
  2863. if (f.type == CKEDITOR.NODE_ELEMENT && f.is(CKEDITOR.dtd.$block) && f.getAttribute("contenteditable") == "false") {
  2864. c.setStartAt(f, CKEDITOR.POSITION_BEFORE_START);
  2865. c.setEndAt(f, CKEDITOR.POSITION_AFTER_END)
  2866. } else c.moveToPosition(f, g[b ? 1 : 0])
  2867. }
  2868. } else d = 1;
  2869. d && this.moveToRange(c);
  2870. return !!d
  2871. },
  2872. moveToElementEditStart: function(a) { return this.moveToElementEditablePosition(a) },
  2873. moveToElementEditEnd: function(a) { return this.moveToElementEditablePosition(a, true) },
  2874. getEnclosedNode: function() {
  2875. var a =
  2876. this.clone();
  2877. a.optimize();
  2878. if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null;
  2879. var a = new CKEDITOR.dom.walker(a),
  2880. b = CKEDITOR.dom.walker.bookmark(false, true),
  2881. c = CKEDITOR.dom.walker.whitespaces(true);
  2882. a.evaluator = function(a) { return c(a) && b(a) };
  2883. var d = a.next();
  2884. a.reset();
  2885. return d && d.equals(a.previous()) ? d : null
  2886. },
  2887. getTouchedStartNode: function() { var a = this.startContainer; return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a },
  2888. getTouchedEndNode: function() {
  2889. var a =
  2890. this.endContainer;
  2891. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
  2892. },
  2893. getNextEditableNode: b(),
  2894. getPreviousEditableNode: b(1),
  2895. scrollIntoView: function() {
  2896. var a = new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", this.document),
  2897. b, c, d, f = this.clone();
  2898. f.optimize();
  2899. if (d = f.startContainer.type == CKEDITOR.NODE_TEXT) {
  2900. c = f.startContainer.getText();
  2901. b = f.startContainer.split(f.startOffset);
  2902. a.insertAfter(f.startContainer)
  2903. } else f.insertNode(a);
  2904. a.scrollIntoView();
  2905. if (d) {
  2906. f.startContainer.setText(c);
  2907. b.remove()
  2908. }
  2909. a.remove()
  2910. },
  2911. _setStartContainer: function(a) { this.startContainer = a },
  2912. _setEndContainer: function(a) { this.endContainer = a }
  2913. }
  2914. }(), CKEDITOR.POSITION_AFTER_START = 1, CKEDITOR.POSITION_BEFORE_END = 2, CKEDITOR.POSITION_BEFORE_START = 3, CKEDITOR.POSITION_AFTER_END = 4, CKEDITOR.ENLARGE_ELEMENT = 1, CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2, CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3, CKEDITOR.ENLARGE_INLINE = 4, CKEDITOR.START = 1, CKEDITOR.END = 2, CKEDITOR.SHRINK_ELEMENT = 1, CKEDITOR.SHRINK_TEXT = 2, "use strict",
  2915. function() {
  2916. function a(a) {
  2917. if (!(arguments.length <
  2918. 1)) {
  2919. this.range = a;
  2920. this.forceBrBreak = 0;
  2921. this.enlargeBr = 1;
  2922. this.enforceRealBlocks = 0;
  2923. this._ || (this._ = {})
  2924. }
  2925. }
  2926. function e(a) {
  2927. var b = [];
  2928. a.forEach(function(a) { if (a.getAttribute("contenteditable") == "true") { b.push(a); return false } }, CKEDITOR.NODE_ELEMENT, true);
  2929. return b
  2930. }
  2931. function b(a, c, d, f) {
  2932. a: {
  2933. f == null && (f = e(d));
  2934. for (var g; g = f.shift();)
  2935. if (g.getDtd().p) { f = { element: g, remaining: f }; break a }
  2936. f = null
  2937. }
  2938. if (!f) return 0;
  2939. if ((g = CKEDITOR.filter.instances[f.element.data("cke-filter")]) && !g.check(c)) return b(a, c, d, f.remaining);c = new CKEDITOR.dom.range(f.element);
  2940. c.selectNodeContents(f.element);c = c.createIterator();c.enlargeBr = a.enlargeBr;c.enforceRealBlocks = a.enforceRealBlocks;c.activeFilter = c.filter = g;a._.nestedEditable = { element: f.element, container: d, remaining: f.remaining, iterator: c };
  2941. return 1
  2942. }
  2943. function g(a, b, c) {
  2944. if (!b) return false;
  2945. a = a.clone();
  2946. a.collapse(!c);
  2947. return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END)
  2948. }
  2949. var c = /^[\r\n\t ]+$/,
  2950. d = CKEDITOR.dom.walker.bookmark(false, true),
  2951. j = CKEDITOR.dom.walker.whitespaces(true),
  2952. f = function(a) { return d(a) && j(a) },
  2953. h = { dd: 1, dt: 1, li: 1 };
  2954. a.prototype = {
  2955. getNextParagraph: function(a) {
  2956. var e, j, o, q, m, a = a || "p";
  2957. if (this._.nestedEditable) {
  2958. if (e = this._.nestedEditable.iterator.getNextParagraph(a)) { this.activeFilter = this._.nestedEditable.iterator.activeFilter; return e }
  2959. this.activeFilter = this.filter;
  2960. if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) { this.activeFilter = this._.nestedEditable.iterator.activeFilter; return this._.nestedEditable.iterator.getNextParagraph(a) }
  2961. this._.nestedEditable = null
  2962. }
  2963. if (!this.range.root.getDtd()[a]) return null;
  2964. if (!this._.started) {
  2965. var l = this.range.clone();
  2966. j = l.startPath();
  2967. var p = l.endPath(),
  2968. t = !l.collapsed && g(l, j.block),
  2969. s = !l.collapsed && g(l, p.block, 1);
  2970. l.shrink(CKEDITOR.SHRINK_ELEMENT, true);
  2971. t && l.setStartAt(j.block, CKEDITOR.POSITION_BEFORE_END);
  2972. s && l.setEndAt(p.block, CKEDITOR.POSITION_AFTER_START);
  2973. j = l.endContainer.hasAscendant("pre", true) || l.startContainer.hasAscendant("pre", true);
  2974. l.enlarge(this.forceBrBreak && !j || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  2975. if (!l.collapsed) {
  2976. j =
  2977. new CKEDITOR.dom.walker(l.clone());
  2978. p = CKEDITOR.dom.walker.bookmark(true, true);
  2979. j.evaluator = p;
  2980. this._.nextNode = j.next();
  2981. j = new CKEDITOR.dom.walker(l.clone());
  2982. j.evaluator = p;
  2983. j = j.previous();
  2984. this._.lastNode = j.getNextSourceNode(true, null, l.root);
  2985. if (this._.lastNode && this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary()) {
  2986. p = this.range.clone();
  2987. p.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END);
  2988. if (p.checkEndOfBlock()) {
  2989. p =
  2990. new CKEDITOR.dom.elementPath(p.endContainer, p.root);
  2991. this._.lastNode = (p.block || p.blockLimit).getNextSourceNode(true)
  2992. }
  2993. }
  2994. if (!this._.lastNode || !l.root.contains(this._.lastNode)) {
  2995. this._.lastNode = this._.docEndMarker = l.document.createText("");
  2996. this._.lastNode.insertAfter(j)
  2997. }
  2998. l = null
  2999. }
  3000. this._.started = 1;
  3001. j = l
  3002. }
  3003. p = this._.nextNode;
  3004. l = this._.lastNode;
  3005. for (this._.nextNode = null; p;) {
  3006. var t = 0,
  3007. s = p.hasAscendant("pre"),
  3008. u = p.type != CKEDITOR.NODE_ELEMENT,
  3009. w = 0;
  3010. if (u) p.type == CKEDITOR.NODE_TEXT && c.test(p.getText()) && (u = 0);
  3011. else {
  3012. var x = p.getName();
  3013. if (CKEDITOR.dtd.$block[x] && p.getAttribute("contenteditable") == "false") {
  3014. e = p;
  3015. b(this, a, e);
  3016. break
  3017. } else if (p.isBlockBoundary(this.forceBrBreak && !s && { br: 1 })) {
  3018. if (x == "br") u = 1;
  3019. else if (!j && !p.getChildCount() && x != "hr") {
  3020. e = p;
  3021. o = p.equals(l);
  3022. break
  3023. }
  3024. if (j) { j.setEndAt(p, CKEDITOR.POSITION_BEFORE_START); if (x != "br") this._.nextNode = p }
  3025. t = 1
  3026. } else {
  3027. if (p.getFirst()) {
  3028. if (!j) {
  3029. j = this.range.clone();
  3030. j.setStartAt(p, CKEDITOR.POSITION_BEFORE_START)
  3031. }
  3032. p = p.getFirst();
  3033. continue
  3034. }
  3035. u = 1
  3036. }
  3037. }
  3038. if (u && !j) {
  3039. j = this.range.clone();
  3040. j.setStartAt(p, CKEDITOR.POSITION_BEFORE_START)
  3041. }
  3042. o =
  3043. (!t || u) && p.equals(l);
  3044. if (j && !t)
  3045. for (; !p.getNext(f) && !o;) {
  3046. x = p.getParent();
  3047. if (x.isBlockBoundary(this.forceBrBreak && !s && { br: 1 })) {
  3048. t = 1;
  3049. u = 0;
  3050. o || x.equals(l);
  3051. j.setEndAt(x, CKEDITOR.POSITION_BEFORE_END);
  3052. break
  3053. }
  3054. p = x;
  3055. u = 1;
  3056. o = p.equals(l);
  3057. w = 1
  3058. }
  3059. u && j.setEndAt(p, CKEDITOR.POSITION_AFTER_END);
  3060. p = this._getNextSourceNode(p, w, l);
  3061. if ((o = !p) || t && j) break
  3062. }
  3063. if (!e) {
  3064. if (!j) { this._.docEndMarker && this._.docEndMarker.remove(); return this._.nextNode = null }
  3065. e = new CKEDITOR.dom.elementPath(j.startContainer, j.root);
  3066. p = e.blockLimit;
  3067. t = { div: 1, th: 1, td: 1 };
  3068. e = e.block;
  3069. if (!e && p && !this.enforceRealBlocks && t[p.getName()] && j.checkStartOfBlock() && j.checkEndOfBlock() && !p.equals(j.root)) e = p;
  3070. else if (!e || this.enforceRealBlocks && e.is(h)) {
  3071. e = this.range.document.createElement(a);
  3072. j.extractContents().appendTo(e);
  3073. e.trim();
  3074. j.insertNode(e);
  3075. q = m = true
  3076. } else if (e.getName() != "li") {
  3077. if (!j.checkStartOfBlock() || !j.checkEndOfBlock()) {
  3078. e = e.clone(false);
  3079. j.extractContents().appendTo(e);
  3080. e.trim();
  3081. m = j.splitBlock();
  3082. q = !m.wasStartOfBlock;
  3083. m = !m.wasEndOfBlock;
  3084. j.insertNode(e)
  3085. }
  3086. } else if (!o) this._.nextNode =
  3087. e.equals(l) ? null : this._getNextSourceNode(j.getBoundaryNodes().endNode, 1, l)
  3088. }
  3089. if (q)(q = e.getPrevious()) && q.type == CKEDITOR.NODE_ELEMENT && (q.getName() == "br" ? q.remove() : q.getLast() && q.getLast().$.nodeName.toLowerCase() == "br" && q.getLast().remove());
  3090. if (m)(q = e.getLast()) && q.type == CKEDITOR.NODE_ELEMENT && q.getName() == "br" && (!CKEDITOR.env.needsBrFiller || q.getPrevious(d) || q.getNext(d)) && q.remove();
  3091. if (!this._.nextNode) this._.nextNode = o || e.equals(l) || !l ? null : this._getNextSourceNode(e, 1, l);
  3092. return e
  3093. },
  3094. _getNextSourceNode: function(a,
  3095. b, c) {
  3096. function f(a) { return !(a.equals(c) || a.equals(g)) }
  3097. for (var g = this.range.root, a = a.getNextSourceNode(b, null, f); !d(a);) a = a.getNextSourceNode(b, null, f);
  3098. return a
  3099. }
  3100. };
  3101. CKEDITOR.dom.range.prototype.createIterator = function() { return new a(this) }
  3102. }(), CKEDITOR.command = function(a, e) {
  3103. this.uiItems = [];
  3104. this.exec = function(b) {
  3105. if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return false;
  3106. this.editorFocus && a.focus();
  3107. return this.fire("exec") === false ? true : e.exec.call(this, a, b) !== false
  3108. };
  3109. this.refresh = function(a,
  3110. b) {
  3111. if (!this.readOnly && a.readOnly) return true;
  3112. if (this.context && !b.isContextFor(this.context)) { this.disable(); return true }
  3113. if (!this.checkAllowed(true)) { this.disable(); return true }
  3114. this.startDisabled || this.enable();
  3115. this.modes && !this.modes[a.mode] && this.disable();
  3116. return this.fire("refresh", { editor: a, path: b }) === false ? true : e.refresh && e.refresh.apply(this, arguments) !== false
  3117. };
  3118. var b;
  3119. this.checkAllowed = function(g) { return !g && typeof b == "boolean" ? b : b = a.activeFilter.checkFeature(this) };
  3120. CKEDITOR.tools.extend(this,
  3121. e, { modes: { wysiwyg: 1 }, editorFocus: 1, contextSensitive: !!e.context, state: CKEDITOR.TRISTATE_DISABLED });
  3122. CKEDITOR.event.call(this)
  3123. }, CKEDITOR.command.prototype = {
  3124. enable: function() { this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(!this.preserveState || typeof this.previousState == "undefined" ? CKEDITOR.TRISTATE_OFF : this.previousState) },
  3125. disable: function() { this.setState(CKEDITOR.TRISTATE_DISABLED) },
  3126. setState: function(a) {
  3127. if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return false;
  3128. this.previousState = this.state;
  3129. this.state = a;
  3130. this.fire("state");
  3131. return true
  3132. },
  3133. toggleState: function() { this.state == CKEDITOR.TRISTATE_OFF ? this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF) }
  3134. }, CKEDITOR.event.implementOn(CKEDITOR.command.prototype), CKEDITOR.ENTER_P = 1, CKEDITOR.ENTER_BR = 2, CKEDITOR.ENTER_DIV = 3, CKEDITOR.config = {
  3135. customConfig: "config.js",
  3136. autoUpdateElement: !0,
  3137. language: "",
  3138. defaultLanguage: "en",
  3139. contentsLangDirection: "",
  3140. enterMode: CKEDITOR.ENTER_P,
  3141. forceEnterMode: !1,
  3142. shiftEnterMode: CKEDITOR.ENTER_BR,
  3143. docType: "<!DOCTYPE html>",
  3144. bodyId: "",
  3145. bodyClass: "",
  3146. fullPage: !1,
  3147. height: 150,
  3148. extraPlugins: "",
  3149. removePlugins: "",
  3150. protectedSource: [],
  3151. tabIndex: 0,
  3152. width: "",
  3153. baseFloatZIndex: 1E4,
  3154. blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85]
  3155. },
  3156. function() {
  3157. function a(a, b, c, d, f) {
  3158. var g, h, a = [];
  3159. for (g in b) {
  3160. h = b[g];
  3161. h = typeof h == "boolean" ? {} : typeof h == "function" ? { match: h } : G(h);
  3162. if (g.charAt(0) != "$") h.elements = g;
  3163. if (c) h.featureName = c.toLowerCase();
  3164. var e = h;
  3165. e.elements = j(e.elements,
  3166. /\s+/) || null;
  3167. e.propertiesOnly = e.propertiesOnly || e.elements === true;
  3168. var i = /\s*,\s*/,
  3169. p = void 0;
  3170. for (p in F) {
  3171. e[p] = j(e[p], i) || null;
  3172. var m = e,
  3173. k = E[p],
  3174. x = j(e[E[p]], i),
  3175. s = e[p],
  3176. w = [],
  3177. l = true,
  3178. C = void 0;
  3179. x ? l = false : x = {};
  3180. for (C in s)
  3181. if (C.charAt(0) == "!") {
  3182. C = C.slice(1);
  3183. w.push(C);
  3184. x[C] = true;
  3185. l = false
  3186. }
  3187. for (; C = w.pop();) {
  3188. s[C] = s["!" + C];
  3189. delete s["!" + C]
  3190. }
  3191. m[k] = (l ? false : x) || null
  3192. }
  3193. e.match = e.match || null;
  3194. d.push(h);
  3195. a.push(h)
  3196. }
  3197. for (var b = f.elements, f = f.generic, n, c = 0, d = a.length; c < d; ++c) {
  3198. g = G(a[c]);
  3199. h = g.classes === true || g.styles === true || g.attributes ===
  3200. true;
  3201. e = g;
  3202. p = k = i = void 0;
  3203. for (i in F) e[i] = t(e[i]);
  3204. m = true;
  3205. for (p in E) {
  3206. i = E[p];
  3207. k = e[i];
  3208. x = [];
  3209. s = void 0;
  3210. for (s in k) s.indexOf("*") > -1 ? x.push(RegExp("^" + s.replace(/\*/g, ".*") + "$")) : x.push(s);
  3211. k = x;
  3212. if (k.length) {
  3213. e[i] = k;
  3214. m = false
  3215. }
  3216. }
  3217. e.nothingRequired = m;
  3218. e.noProperties = !(e.attributes || e.classes || e.styles);
  3219. if (g.elements === true || g.elements === null) f[h ? "unshift" : "push"](g);
  3220. else {
  3221. e = g.elements;
  3222. delete g.elements;
  3223. for (n in e)
  3224. if (b[n]) b[n][h ? "unshift" : "push"](g);
  3225. else b[n] = [g]
  3226. }
  3227. }
  3228. }
  3229. function e(a, c, d, g) {
  3230. if (!a.match || a.match(c))
  3231. if (g || f(a,
  3232. c)) {
  3233. if (!a.propertiesOnly) d.valid = true;
  3234. if (!d.allAttributes) d.allAttributes = b(a.attributes, c.attributes, d.validAttributes);
  3235. if (!d.allStyles) d.allStyles = b(a.styles, c.styles, d.validStyles);
  3236. if (!d.allClasses) {
  3237. a = a.classes;
  3238. c = c.classes;
  3239. g = d.validClasses;
  3240. if (a)
  3241. if (a === true) a = true;
  3242. else {
  3243. for (var h = 0, e = c.length, j; h < e; ++h) {
  3244. j = c[h];
  3245. g[j] || (g[j] = a(j))
  3246. }
  3247. a = false
  3248. }
  3249. else a = false;
  3250. d.allClasses = a
  3251. }
  3252. }
  3253. }
  3254. function b(a, b, c) { if (!a) return false; if (a === true) return true; for (var d in b) c[d] || (c[d] = a(d)); return false }
  3255. function g(a, b, d) {
  3256. if (!a.match ||
  3257. a.match(b)) {
  3258. if (a.noProperties) return false;
  3259. d.hadInvalidAttribute = c(a.attributes, b.attributes) || d.hadInvalidAttribute;
  3260. d.hadInvalidStyle = c(a.styles, b.styles) || d.hadInvalidStyle;
  3261. a = a.classes;
  3262. b = b.classes;
  3263. if (a) {
  3264. for (var f = false, g = a === true, h = b.length; h--;)
  3265. if (g || a(b[h])) {
  3266. b.splice(h, 1);
  3267. f = true
  3268. }
  3269. a = f
  3270. } else a = false;
  3271. d.hadInvalidClass = a || d.hadInvalidClass
  3272. }
  3273. }
  3274. function c(a, b) {
  3275. if (!a) return false;
  3276. var c = false,
  3277. d = a === true,
  3278. f;
  3279. for (f in b)
  3280. if (d || a(f)) {
  3281. delete b[f];
  3282. c = true
  3283. }
  3284. return c
  3285. }
  3286. function d(a, b, c) {
  3287. if (a.disabled || a.customConfig &&
  3288. !c || !b) return false;
  3289. a._.cachedChecks = {};
  3290. return true
  3291. }
  3292. function j(a, b) {
  3293. if (!a) return false;
  3294. if (a === true) return a;
  3295. if (typeof a == "string") { a = D(a); return a == "*" ? true : CKEDITOR.tools.convertArrayToObject(a.split(b)) }
  3296. if (CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : false;
  3297. var c = {},
  3298. d = 0,
  3299. f;
  3300. for (f in a) {
  3301. c[f] = a[f];
  3302. d++
  3303. }
  3304. return d ? c : false
  3305. }
  3306. function f(a, b) {
  3307. if (a.nothingRequired) return true;
  3308. var c, d, f, g;
  3309. if (f = a.requiredClasses) {
  3310. g = b.classes;
  3311. for (c = 0; c < f.length; ++c) {
  3312. d = f[c];
  3313. if (typeof d == "string") {
  3314. if (CKEDITOR.tools.indexOf(g,
  3315. d) == -1) return false
  3316. } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(g, d)) return false
  3317. }
  3318. }
  3319. return h(b.styles, a.requiredStyles) && h(b.attributes, a.requiredAttributes)
  3320. }
  3321. function h(a, b) { if (!b) return true; for (var c = 0, d; c < b.length; ++c) { d = b[c]; if (typeof d == "string") { if (!(d in a)) return false } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) return false } return true }
  3322. function i(a) { if (!a) return {}; for (var a = a.split(/\s*,\s*/).sort(), b = {}; a.length;) b[a.shift()] = J; return b }
  3323. function k(a) {
  3324. for (var b, c, d,
  3325. f, g = {}, h = 1, a = D(a); b = a.match(I);) {
  3326. if (c = b[2]) {
  3327. d = n(c, "styles");
  3328. f = n(c, "attrs");
  3329. c = n(c, "classes")
  3330. } else d = f = c = null;
  3331. g["$" + h++] = { elements: b[1], classes: c, styles: d, attributes: f };
  3332. a = a.slice(b[0].length)
  3333. }
  3334. return g
  3335. }
  3336. function n(a, b) { var c = a.match(L[b]); return c ? D(c[1]) : null }
  3337. function o(a) {
  3338. var b = a.styleBackup = a.attributes.style,
  3339. c = a.classBackup = a.attributes["class"];
  3340. if (!a.styles) a.styles = CKEDITOR.tools.parseCssText(b || "", 1);
  3341. if (!a.classes) a.classes = c ? c.split(/\s+/) : []
  3342. }
  3343. function q(a, b, c, d) {
  3344. var f = 0,
  3345. h;
  3346. if (d.toHtml) b.name = b.name.replace(H,
  3347. "$1");
  3348. if (d.doCallbacks && a.elementCallbacks) {
  3349. a: for (var j = a.elementCallbacks, i = 0, m = j.length, t; i < m; ++i)
  3350. if (t = j[i](b)) { h = t; break a }if (h) return h
  3351. }
  3352. if (d.doTransform)
  3353. if (h = a._.transformations[b.name]) {
  3354. o(b);
  3355. for (j = 0; j < h.length; ++j) x(a, b, h[j]);
  3356. l(b)
  3357. }
  3358. if (d.doFilter) {
  3359. a: {
  3360. j = b.name;i = a._;a = i.allowedRules.elements[j];h = i.allowedRules.generic;j = i.disallowedRules.elements[j];i = i.disallowedRules.generic;m = d.skipRequired;t = {
  3361. valid: false,
  3362. validAttributes: {},
  3363. validClasses: {},
  3364. validStyles: {},
  3365. allAttributes: false,
  3366. allClasses: false,
  3367. allStyles: false,
  3368. hadInvalidAttribute: false,
  3369. hadInvalidClass: false,
  3370. hadInvalidStyle: false
  3371. };
  3372. var k, s;
  3373. if (!a && !h) a = null;
  3374. else {
  3375. o(b);
  3376. if (j) {
  3377. k = 0;
  3378. for (s = j.length; k < s; ++k)
  3379. if (g(j[k], b, t) === false) { a = null; break a }
  3380. }
  3381. if (i) { k = 0; for (s = i.length; k < s; ++k) g(i[k], b, t) }
  3382. if (a) { k = 0; for (s = a.length; k < s; ++k) e(a[k], b, t, m) }
  3383. if (h) { k = 0; for (s = h.length; k < s; ++k) e(h[k], b, t, m) }
  3384. a = t
  3385. }
  3386. }
  3387. if (!a) { c.push(b); return A }
  3388. if (!a.valid) { c.push(b); return A }
  3389. s = a.validAttributes;
  3390. var w = a.validStyles;h = a.validClasses;
  3391. var j = b.attributes,
  3392. C = b.styles,
  3393. i = b.classes,
  3394. m = b.classBackup,
  3395. n = b.styleBackup,
  3396. v, F, r = [];t = [];
  3397. var u = /^data-cke-/;k = false;delete j.style;delete j["class"];delete b.classBackup;delete b.styleBackup;
  3398. if (!a.allAttributes)
  3399. for (v in j)
  3400. if (!s[v])
  3401. if (u.test(v)) {
  3402. if (v != (F = v.replace(/^data-cke-saved-/, "")) && !s[F]) {
  3403. delete j[v];
  3404. k = true
  3405. }
  3406. } else {
  3407. delete j[v];
  3408. k = true
  3409. }
  3410. if (!a.allStyles || a.hadInvalidStyle) { for (v in C) a.allStyles || w[v] ? r.push(v + ":" + C[v]) : k = true; if (r.length) j.style = r.sort().join("; ") } else if (n) j.style = n;
  3411. if (!a.allClasses || a.hadInvalidClass) {
  3412. for (v = 0; v < i.length; ++v)(a.allClasses ||
  3413. h[i[v]]) && t.push(i[v]);
  3414. t.length && (j["class"] = t.sort().join(" "));
  3415. m && t.length < m.split(/\s+/).length && (k = true)
  3416. } else m && (j["class"] = m);k && (f = A);
  3417. if (!d.skipFinalValidation && !p(b)) { c.push(b); return A }
  3418. }
  3419. if (d.toHtml) b.name = b.name.replace(Q, "cke:$1");
  3420. return f
  3421. }
  3422. function m(a) {
  3423. var b = [],
  3424. c;
  3425. for (c in a) c.indexOf("*") > -1 && b.push(c.replace(/\*/g, ".*"));
  3426. return b.length ? RegExp("^(?:" + b.join("|") + ")$") : null
  3427. }
  3428. function l(a) {
  3429. var b = a.attributes,
  3430. c;
  3431. delete b.style;
  3432. delete b["class"];
  3433. if (c = CKEDITOR.tools.writeCssText(a.styles, true)) b.style =
  3434. c;
  3435. a.classes.length && (b["class"] = a.classes.sort().join(" "))
  3436. }
  3437. function p(a) {
  3438. switch (a.name) {
  3439. case "a":
  3440. if (!a.children.length && !a.attributes.name) return false;
  3441. break;
  3442. case "img":
  3443. if (!a.attributes.src) return false
  3444. }
  3445. return true
  3446. }
  3447. function t(a) { if (!a) return false; if (a === true) return true; var b = m(a); return function(c) { return c in a || b && c.match(b) } }
  3448. function s() { return new CKEDITOR.htmlParser.element("br") }
  3449. function u(a) { return a.type == CKEDITOR.NODE_ELEMENT && (a.name == "br" || B.$block[a.name]) }
  3450. function w(a, b, c) {
  3451. var d = a.name;
  3452. if (B.$empty[d] || !a.children.length)
  3453. if (d == "hr" && b == "br") a.replaceWith(s());
  3454. else {
  3455. a.parent && c.push({ check: "it", el: a.parent });
  3456. a.remove()
  3457. }
  3458. else if (B.$block[d] || d == "tr")
  3459. if (b == "br") {
  3460. if (a.previous && !u(a.previous)) {
  3461. b = s();
  3462. b.insertBefore(a)
  3463. }
  3464. if (a.next && !u(a.next)) {
  3465. b = s();
  3466. b.insertAfter(a)
  3467. }
  3468. a.replaceWithChildren()
  3469. } else {
  3470. var d = a.children,
  3471. f;
  3472. b: {
  3473. f = B[b];
  3474. for (var g = 0, h = d.length, e; g < h; ++g) { e = d[g]; if (e.type == CKEDITOR.NODE_ELEMENT && !f[e.name]) { f = false; break b } }
  3475. f = true
  3476. }
  3477. if (f) {
  3478. a.name = b;
  3479. a.attributes = {};
  3480. c.push({
  3481. check: "parent-down",
  3482. el: a
  3483. })
  3484. } else {
  3485. f = a.parent;
  3486. for (var g = f.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || f.name == "body", j, i, h = d.length; h > 0;) {
  3487. e = d[--h];
  3488. if (g && (e.type == CKEDITOR.NODE_TEXT || e.type == CKEDITOR.NODE_ELEMENT && B.$inline[e.name])) {
  3489. if (!j) {
  3490. j = new CKEDITOR.htmlParser.element(b);
  3491. j.insertAfter(a);
  3492. c.push({ check: "parent-down", el: j })
  3493. }
  3494. j.add(e, 0)
  3495. } else {
  3496. j = null;
  3497. i = B[f.name] || B.span;
  3498. e.insertAfter(a);
  3499. f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && (e.type == CKEDITOR.NODE_ELEMENT && !i[e.name]) && c.push({ check: "el-up", el: e })
  3500. }
  3501. }
  3502. a.remove()
  3503. }
  3504. }
  3505. else if (d == "style") a.remove();
  3506. else {
  3507. a.parent && c.push({ check: "it", el: a.parent });
  3508. a.replaceWithChildren()
  3509. }
  3510. }
  3511. function x(a, b, c) { var d, f; for (d = 0; d < c.length; ++d) { f = c[d]; if ((!f.check || a.check(f.check, false)) && (!f.left || f.left(b))) { f.right(b, O); break } } }
  3512. function v(a, b) {
  3513. var c = b.getDefinition(),
  3514. d = c.attributes,
  3515. f = c.styles,
  3516. g, h, e, j;
  3517. if (a.name != c.element) return false;
  3518. for (g in d)
  3519. if (g == "class") {
  3520. c = d[g].split(/\s+/);
  3521. for (e = a.classes.join("|"); j = c.pop();)
  3522. if (e.indexOf(j) == -1) return false
  3523. } else if (a.attributes[g] != d[g]) return false;
  3524. for (h in f)
  3525. if (a.styles[h] !=
  3526. f[h]) return false;
  3527. return true
  3528. }
  3529. function r(a, b) {
  3530. var c, d;
  3531. if (typeof a == "string") c = a;
  3532. else if (a instanceof CKEDITOR.style) d = a;
  3533. else {
  3534. c = a[0];
  3535. d = a[1]
  3536. }
  3537. return [{ element: c, left: d, right: function(a, c) { c.transform(a, b) } }]
  3538. }
  3539. function y(a) { return function(b) { return v(b, a) } }
  3540. function z(a) { return function(b, c) { c[a](b) } }
  3541. var B = CKEDITOR.dtd,
  3542. A = 1,
  3543. G = CKEDITOR.tools.copy,
  3544. D = CKEDITOR.tools.trim,
  3545. J = "cke-test",
  3546. C = ["", "p", "br", "div"];
  3547. CKEDITOR.FILTER_SKIP_TREE = 2;
  3548. CKEDITOR.filter = function(a) {
  3549. this.allowedContent = [];
  3550. this.disallowedContent = [];
  3551. this.elementCallbacks = null;
  3552. this.disabled = false;
  3553. this.editor = null;
  3554. this.id = CKEDITOR.tools.getNextNumber();
  3555. this._ = { allowedRules: { elements: {}, generic: [] }, disallowedRules: { elements: {}, generic: [] }, transformations: {}, cachedTests: {} };
  3556. CKEDITOR.filter.instances[this.id] = this;
  3557. if (a instanceof CKEDITOR.editor) {
  3558. a = this.editor = a;
  3559. this.customConfig = true;
  3560. var b = a.config.allowedContent;
  3561. if (b === true) this.disabled = true;
  3562. else {
  3563. if (!b) this.customConfig = false;
  3564. this.allow(b, "config", 1);
  3565. this.allow(a.config.extraAllowedContent, "extra",
  3566. 1);
  3567. this.allow(C[a.enterMode] + " " + C[a.shiftEnterMode], "default", 1);
  3568. this.disallow(a.config.disallowedContent)
  3569. }
  3570. } else {
  3571. this.customConfig = false;
  3572. this.allow(a, "default", 1)
  3573. }
  3574. };
  3575. CKEDITOR.filter.instances = {};
  3576. CKEDITOR.filter.prototype = {
  3577. allow: function(b, c, f) {
  3578. if (!d(this, b, f)) return false;
  3579. var g, h;
  3580. if (typeof b == "string") b = k(b);
  3581. else if (b instanceof CKEDITOR.style) {
  3582. if (b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, f);
  3583. g = b.getDefinition();
  3584. b = {};
  3585. f = g.attributes;
  3586. b[g.element] = g = {
  3587. styles: g.styles,
  3588. requiredStyles: g.styles && CKEDITOR.tools.objectKeys(g.styles)
  3589. };
  3590. if (f) {
  3591. f = G(f);
  3592. g.classes = f["class"] ? f["class"].split(/\s+/) : null;
  3593. g.requiredClasses = g.classes;
  3594. delete f["class"];
  3595. g.attributes = f;
  3596. g.requiredAttributes = f && CKEDITOR.tools.objectKeys(f)
  3597. }
  3598. } else if (CKEDITOR.tools.isArray(b)) { for (g = 0; g < b.length; ++g) h = this.allow(b[g], c, f); return h }
  3599. a(this, b, c, this.allowedContent, this._.allowedRules);
  3600. return true
  3601. },
  3602. applyTo: function(a, b, c, d) {
  3603. if (this.disabled) return false;
  3604. var f = this,
  3605. g = [],
  3606. h = this.editor && this.editor.config.protectedSource,
  3607. e, j = false,
  3608. i = { doFilter: !c, doTransform: true, doCallbacks: true, toHtml: b };
  3609. a.forEach(function(a) {
  3610. if (a.type == CKEDITOR.NODE_ELEMENT) {
  3611. if (a.attributes["data-cke-filter"] == "off") return false;
  3612. if (!b || !(a.name == "span" && ~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))) {
  3613. e = q(f, a, g, i);
  3614. if (e & A) j = true;
  3615. else if (e & 2) return false
  3616. }
  3617. } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
  3618. var c;
  3619. a: {
  3620. var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));c = [];
  3621. var p,
  3622. m, t;
  3623. if (h)
  3624. for (m = 0; m < h.length; ++m)
  3625. if ((t = d.match(h[m])) && t[0].length == d.length) { c = true; break a }
  3626. d = CKEDITOR.htmlParser.fragment.fromHtml(d);d.children.length == 1 && (p = d.children[0]).type == CKEDITOR.NODE_ELEMENT && q(f, p, c, i);c = !c.length
  3627. }
  3628. c || g.push(a)
  3629. }
  3630. }, null, true);
  3631. g.length && (j = true);
  3632. for (var m, a = [], d = C[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)], t; c = g.pop();) c.type == CKEDITOR.NODE_ELEMENT ? w(c, d, a) : c.remove();
  3633. for (; m = a.pop();) {
  3634. c = m.el;
  3635. if (c.parent) {
  3636. t = B[c.parent.name] || B.span;
  3637. switch (m.check) {
  3638. case "it":
  3639. B.$removeEmpty[c.name] &&
  3640. !c.children.length ? w(c, d, a) : p(c) || w(c, d, a);
  3641. break;
  3642. case "el-up":
  3643. c.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && !t[c.name] && w(c, d, a);
  3644. break;
  3645. case "parent-down":
  3646. c.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && !t[c.name] && w(c.parent, d, a)
  3647. }
  3648. }
  3649. }
  3650. return j
  3651. },
  3652. checkFeature: function(a) {
  3653. if (this.disabled || !a) return true;
  3654. a.toFeature && (a = a.toFeature(this.editor));
  3655. return !a.requiredContent || this.check(a.requiredContent)
  3656. },
  3657. disable: function() { this.disabled = true },
  3658. disallow: function(b) {
  3659. if (!d(this, b, true)) return false;
  3660. typeof b ==
  3661. "string" && (b = k(b));
  3662. a(this, b, null, this.disallowedContent, this._.disallowedRules);
  3663. return true
  3664. },
  3665. addContentForms: function(a) {
  3666. if (!this.disabled && a) {
  3667. var b, c, d = [],
  3668. f;
  3669. for (b = 0; b < a.length && !f; ++b) { c = a[b]; if ((typeof c == "string" || c instanceof CKEDITOR.style) && this.check(c)) f = c }
  3670. if (f) {
  3671. for (b = 0; b < a.length; ++b) d.push(r(a[b], f));
  3672. this.addTransformations(d)
  3673. }
  3674. }
  3675. },
  3676. addElementCallback: function(a) {
  3677. if (!this.elementCallbacks) this.elementCallbacks = [];
  3678. this.elementCallbacks.push(a)
  3679. },
  3680. addFeature: function(a) {
  3681. if (this.disabled || !a) return true;
  3682. a.toFeature && (a = a.toFeature(this.editor));
  3683. this.allow(a.allowedContent, a.name);
  3684. this.addTransformations(a.contentTransformations);
  3685. this.addContentForms(a.contentForms);
  3686. return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : true
  3687. },
  3688. addTransformations: function(a) {
  3689. var b, c;
  3690. if (!this.disabled && a) {
  3691. var d = this._.transformations,
  3692. f;
  3693. for (f = 0; f < a.length; ++f) {
  3694. b = a[f];
  3695. var g = void 0,
  3696. h = void 0,
  3697. e = void 0,
  3698. j = void 0,
  3699. i = void 0,
  3700. p = void 0;
  3701. c = [];
  3702. for (h = 0; h < b.length; ++h) {
  3703. e = b[h];
  3704. if (typeof e ==
  3705. "string") {
  3706. e = e.split(/\s*:\s*/);
  3707. j = e[0];
  3708. i = null;
  3709. p = e[1]
  3710. } else {
  3711. j = e.check;
  3712. i = e.left;
  3713. p = e.right
  3714. }
  3715. if (!g) {
  3716. g = e;
  3717. g = g.element ? g.element : j ? j.match(/^([a-z0-9]+)/i)[0] : g.left.getDefinition().element
  3718. }
  3719. i instanceof CKEDITOR.style && (i = y(i));
  3720. c.push({ check: j == g ? null : j, left: i, right: typeof p == "string" ? z(p) : p })
  3721. }
  3722. b = g;
  3723. d[b] || (d[b] = []);
  3724. d[b].push(c)
  3725. }
  3726. }
  3727. },
  3728. check: function(a, b, c) {
  3729. if (this.disabled) return true;
  3730. if (CKEDITOR.tools.isArray(a)) {
  3731. for (var d = a.length; d--;)
  3732. if (this.check(a[d], b, c)) return true;
  3733. return false
  3734. }
  3735. var f, g;
  3736. if (typeof a == "string") {
  3737. g =
  3738. a + "<" + (b === false ? "0" : "1") + (c ? "1" : "0") + ">";
  3739. if (g in this._.cachedChecks) return this._.cachedChecks[g];
  3740. d = k(a).$1;
  3741. f = d.styles;
  3742. var h = d.classes;
  3743. d.name = d.elements;
  3744. d.classes = h = h ? h.split(/\s*,\s*/) : [];
  3745. d.styles = i(f);
  3746. d.attributes = i(d.attributes);
  3747. d.children = [];
  3748. h.length && (d.attributes["class"] = h.join(" "));
  3749. if (f) d.attributes.style = CKEDITOR.tools.writeCssText(d.styles);
  3750. f = d
  3751. } else {
  3752. d = a.getDefinition();
  3753. f = d.styles;
  3754. h = d.attributes || {};
  3755. if (f) {
  3756. f = G(f);
  3757. h.style = CKEDITOR.tools.writeCssText(f, true)
  3758. } else f = {};
  3759. f = {
  3760. name: d.element,
  3761. attributes: h,
  3762. classes: h["class"] ? h["class"].split(/\s+/) : [],
  3763. styles: f,
  3764. children: []
  3765. }
  3766. }
  3767. var h = CKEDITOR.tools.clone(f),
  3768. e = [],
  3769. j;
  3770. if (b !== false && (j = this._.transformations[f.name])) {
  3771. for (d = 0; d < j.length; ++d) x(this, f, j[d]);
  3772. l(f)
  3773. }
  3774. q(this, h, e, { doFilter: true, doTransform: b !== false, skipRequired: !c, skipFinalValidation: !c });
  3775. b = e.length > 0 ? false : CKEDITOR.tools.objectCompare(f.attributes, h.attributes, true) ? true : false;
  3776. typeof a == "string" && (this._.cachedChecks[g] = b);
  3777. return b
  3778. },
  3779. getAllowedEnterMode: function() {
  3780. var a = ["p", "div", "br"],
  3781. b = {
  3782. p: CKEDITOR.ENTER_P,
  3783. div: CKEDITOR.ENTER_DIV,
  3784. br: CKEDITOR.ENTER_BR
  3785. };
  3786. return function(c, d) {
  3787. var f = a.slice(),
  3788. g;
  3789. if (this.check(C[c])) return c;
  3790. for (d || (f = f.reverse()); g = f.pop();)
  3791. if (this.check(g)) return b[g];
  3792. return CKEDITOR.ENTER_BR
  3793. }
  3794. }(),
  3795. destroy: function() {
  3796. delete CKEDITOR.filter.instances[this.id];
  3797. delete this._;
  3798. delete this.allowedContent;
  3799. delete this.disallowedContent
  3800. }
  3801. };
  3802. var F = { styles: 1, attributes: 1, classes: 1 },
  3803. E = { styles: "requiredStyles", attributes: "requiredAttributes", classes: "requiredClasses" },
  3804. I = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
  3805. L = { styles: /{([^}]+)}/, attrs: /\[([^\]]+)\]/, classes: /\(([^\)]+)\)/ },
  3806. H = /^cke:(object|embed|param)$/,
  3807. Q = /^(object|embed|param)$/,
  3808. O = CKEDITOR.filter.transformationsTools = {
  3809. sizeToStyle: function(a) {
  3810. this.lengthToStyle(a, "width");
  3811. this.lengthToStyle(a, "height")
  3812. },
  3813. sizeToAttribute: function(a) {
  3814. this.lengthToAttribute(a, "width");
  3815. this.lengthToAttribute(a, "height")
  3816. },
  3817. lengthToStyle: function(a, b, c) {
  3818. c = c || b;
  3819. if (!(c in a.styles)) {
  3820. var d = a.attributes[b];
  3821. if (d) {
  3822. /^\d+$/.test(d) && (d = d + "px");
  3823. a.styles[c] = d
  3824. }
  3825. }
  3826. delete a.attributes[b]
  3827. },
  3828. lengthToAttribute: function(a, b, c) {
  3829. c = c || b;
  3830. if (!(c in a.attributes)) {
  3831. var d = a.styles[b],
  3832. f = d && d.match(/^(\d+)(?:\.\d*)?px$/);
  3833. f ? a.attributes[c] = f[1] : d == J && (a.attributes[c] = J)
  3834. }
  3835. delete a.styles[b]
  3836. },
  3837. alignmentToStyle: function(a) {
  3838. if (!("float" in a.styles)) { var b = a.attributes.align; if (b == "left" || b == "right") a.styles["float"] = b }
  3839. delete a.attributes.align
  3840. },
  3841. alignmentToAttribute: function(a) {
  3842. if (!("align" in a.attributes)) { var b = a.styles["float"]; if (b == "left" || b == "right") a.attributes.align = b }
  3843. delete a.styles["float"]
  3844. },
  3845. matchesStyle: v,
  3846. transform: function(a, b) {
  3847. if (typeof b == "string") a.name = b;
  3848. else {
  3849. var c = b.getDefinition(),
  3850. d = c.styles,
  3851. f = c.attributes,
  3852. g, h, e, j;
  3853. a.name = c.element;
  3854. for (g in f)
  3855. if (g == "class") { c = a.classes.join("|"); for (e = f[g].split(/\s+/); j = e.pop();) c.indexOf(j) == -1 && a.classes.push(j) } else a.attributes[g] = f[g];
  3856. for (h in d) a.styles[h] = d[h]
  3857. }
  3858. }
  3859. }
  3860. }(),
  3861. function() {
  3862. CKEDITOR.focusManager = function(a) {
  3863. if (a.focusManager) return a.focusManager;
  3864. this.hasFocus = false;
  3865. this.currentActive = null;
  3866. this._ = { editor: a };
  3867. return this
  3868. };
  3869. CKEDITOR.focusManager._ = { blurDelay: 200 };
  3870. CKEDITOR.focusManager.prototype = {
  3871. focus: function(a) {
  3872. this._.timer && clearTimeout(this._.timer);
  3873. if (a) this.currentActive = a;
  3874. if (!this.hasFocus && !this._.locked) {
  3875. (a = CKEDITOR.currentInstance) && a.focusManager.blur(1);
  3876. this.hasFocus = true;
  3877. (a = this._.editor.container) && a.addClass("cke_focus");
  3878. this._.editor.fire("focus")
  3879. }
  3880. },
  3881. lock: function() { this._.locked = 1 },
  3882. unlock: function() { delete this._.locked },
  3883. blur: function(a) {
  3884. function e() {
  3885. if (this.hasFocus) {
  3886. this.hasFocus = false;
  3887. var a = this._.editor.container;
  3888. a && a.removeClass("cke_focus");
  3889. this._.editor.fire("blur")
  3890. }
  3891. }
  3892. if (!this._.locked) {
  3893. this._.timer && clearTimeout(this._.timer);
  3894. var b = CKEDITOR.focusManager._.blurDelay;
  3895. a || !b ? e.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function() {
  3896. delete this._.timer;
  3897. e.call(this)
  3898. }, b, this)
  3899. }
  3900. },
  3901. add: function(a, e) {
  3902. var b = a.getCustomData("focusmanager");
  3903. if (!b || b != this) {
  3904. b && b.remove(a);
  3905. var b = "focus",
  3906. g = "blur";
  3907. if (e)
  3908. if (CKEDITOR.env.ie) {
  3909. b = "focusin";
  3910. g = "focusout"
  3911. } else CKEDITOR.event.useCapture = 1;
  3912. var c = { blur: function() { a.equals(this.currentActive) && this.blur() }, focus: function() { this.focus(a) } };
  3913. a.on(b, c.focus, this);
  3914. a.on(g, c.blur, this);
  3915. if (e) CKEDITOR.event.useCapture = 0;
  3916. a.setCustomData("focusmanager", this);
  3917. a.setCustomData("focusmanager_handlers", c)
  3918. }
  3919. },
  3920. remove: function(a) {
  3921. a.removeCustomData("focusmanager");
  3922. var e = a.removeCustomData("focusmanager_handlers");
  3923. a.removeListener("blur", e.blur);
  3924. a.removeListener("focus", e.focus)
  3925. }
  3926. }
  3927. }(), CKEDITOR.keystrokeHandler = function(a) {
  3928. if (a.keystrokeHandler) return a.keystrokeHandler;
  3929. this.keystrokes = {};
  3930. this.blockedKeystrokes = {};
  3931. this._ = { editor: a };
  3932. return this
  3933. },
  3934. function() {
  3935. var a,
  3936. e = function(b) {
  3937. var b = b.data,
  3938. c = b.getKeystroke(),
  3939. d = this.keystrokes[c],
  3940. e = this._.editor;
  3941. a = e.fire("key", { keyCode: c, domEvent: b }) === false;
  3942. if (!a) {
  3943. d && (a = e.execCommand(d, { from: "keystrokeHandler" }) !== false);
  3944. a || (a = !!this.blockedKeystrokes[c])
  3945. }
  3946. a && b.preventDefault(true);
  3947. return !a
  3948. },
  3949. b = function(b) {
  3950. if (a) {
  3951. a = false;
  3952. b.data.preventDefault(true)
  3953. }
  3954. };
  3955. CKEDITOR.keystrokeHandler.prototype = { attach: function(a) { a.on("keydown", e, this); if (CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this) } }
  3956. }(),
  3957. function() {
  3958. CKEDITOR.lang = {
  3959. languages: {
  3960. af: 1,
  3961. ar: 1,
  3962. bg: 1,
  3963. bn: 1,
  3964. bs: 1,
  3965. ca: 1,
  3966. cs: 1,
  3967. cy: 1,
  3968. da: 1,
  3969. de: 1,
  3970. el: 1,
  3971. "en-au": 1,
  3972. "en-ca": 1,
  3973. "en-gb": 1,
  3974. en: 1,
  3975. eo: 1,
  3976. es: 1,
  3977. et: 1,
  3978. eu: 1,
  3979. fa: 1,
  3980. fi: 1,
  3981. fo: 1,
  3982. "fr-ca": 1,
  3983. fr: 1,
  3984. gl: 1,
  3985. gu: 1,
  3986. he: 1,
  3987. hi: 1,
  3988. hr: 1,
  3989. hu: 1,
  3990. id: 1,
  3991. is: 1,
  3992. it: 1,
  3993. ja: 1,
  3994. ka: 1,
  3995. km: 1,
  3996. ko: 1,
  3997. ku: 1,
  3998. lt: 1,
  3999. lv: 1,
  4000. mk: 1,
  4001. mn: 1,
  4002. ms: 1,
  4003. nb: 1,
  4004. nl: 1,
  4005. no: 1,
  4006. pl: 1,
  4007. "pt-br": 1,
  4008. pt: 1,
  4009. ro: 1,
  4010. ru: 1,
  4011. si: 1,
  4012. sk: 1,
  4013. sl: 1,
  4014. sq: 1,
  4015. "sr-latn": 1,
  4016. sr: 1,
  4017. sv: 1,
  4018. th: 1,
  4019. tr: 1,
  4020. tt: 1,
  4021. ug: 1,
  4022. uk: 1,
  4023. vi: 1,
  4024. "zh-cn": 1,
  4025. zh: 1
  4026. },
  4027. rtl: { ar: 1, fa: 1, he: 1, ku: 1, ug: 1 },
  4028. load: function(a, e, b) {
  4029. if (!a || !CKEDITOR.lang.languages[a]) a = this.detect(e, a);
  4030. var g = this,
  4031. e = function() {
  4032. g[a].dir =
  4033. g.rtl[a] ? "rtl" : "ltr";
  4034. b(a, g[a])
  4035. };
  4036. this[a] ? e() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), e, this)
  4037. },
  4038. detect: function(a, e) {
  4039. var b = this.languages,
  4040. e = e || navigator.userLanguage || navigator.language || a,
  4041. g = e.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
  4042. c = g[1],
  4043. g = g[2];
  4044. b[c + "-" + g] ? c = c + "-" + g : b[c] || (c = null);
  4045. CKEDITOR.lang.detect = c ? function() { return c } : function(a) { return a };
  4046. return c || a
  4047. }
  4048. }
  4049. }(), CKEDITOR.scriptLoader = function() {
  4050. var a = {},
  4051. e = {};
  4052. return {
  4053. load: function(b, g, c, d) {
  4054. var j = typeof b == "string";
  4055. j && (b = [b]);
  4056. c || (c = CKEDITOR);
  4057. var f = b.length,
  4058. h = [],
  4059. i = [],
  4060. k = function(a) { g && (j ? g.call(c, a) : g.call(c, h, i)) };
  4061. if (f === 0) k(true);
  4062. else {
  4063. var n = function(a, b) {
  4064. (b ? h : i).push(a);
  4065. if (--f <= 0) {
  4066. d && CKEDITOR.document.getDocumentElement().removeStyle("cursor");
  4067. k(b)
  4068. }
  4069. },
  4070. o = function(b, c) {
  4071. a[b] = 1;
  4072. var d = e[b];
  4073. delete e[b];
  4074. for (var f = 0; f < d.length; f++) d[f](b, c)
  4075. },
  4076. q = function(b) {
  4077. if (a[b]) n(b, true);
  4078. else {
  4079. var c = e[b] || (e[b] = []);
  4080. c.push(n);
  4081. if (!(c.length > 1)) {
  4082. var d = new CKEDITOR.dom.element("script");
  4083. d.setAttributes({ type: "text/javascript", src: b });
  4084. if (g)
  4085. if (CKEDITOR.env.ie &&
  4086. CKEDITOR.env.version < 11) d.$.onreadystatechange = function() {
  4087. if (d.$.readyState == "loaded" || d.$.readyState == "complete") {
  4088. d.$.onreadystatechange = null;
  4089. o(b, true)
  4090. }
  4091. };
  4092. else {
  4093. d.$.onload = function() { setTimeout(function() { o(b, true) }, 0) };
  4094. d.$.onerror = function() { o(b, false) }
  4095. }
  4096. d.appendTo(CKEDITOR.document.getHead())
  4097. }
  4098. }
  4099. };
  4100. d && CKEDITOR.document.getDocumentElement().setStyle("cursor", "wait");
  4101. for (var m = 0; m < f; m++) q(b[m])
  4102. }
  4103. },
  4104. queue: function() {
  4105. function a() {
  4106. var b;
  4107. (b = g[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0)
  4108. }
  4109. var g = [];
  4110. return function(c,
  4111. d) {
  4112. var e = this;
  4113. g.push({
  4114. scriptUrl: c,
  4115. callback: function() {
  4116. d && d.apply(this, arguments);
  4117. g.shift();
  4118. a.call(e)
  4119. }
  4120. });
  4121. g.length == 1 && a.call(this)
  4122. }
  4123. }()
  4124. }
  4125. }(), CKEDITOR.resourceManager = function(a, e) {
  4126. this.basePath = a;
  4127. this.fileName = e;
  4128. this.registered = {};
  4129. this.loaded = {};
  4130. this.externals = {};
  4131. this._ = { waitingList: {} }
  4132. }, CKEDITOR.resourceManager.prototype = {
  4133. add: function(a, e) {
  4134. if (this.registered[a]) throw '[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.';
  4135. var b = this.registered[a] = e || {};
  4136. b.name = a;
  4137. b.path = this.getPath(a);
  4138. CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b);
  4139. return this.get(a)
  4140. },
  4141. get: function(a) { return this.registered[a] || null },
  4142. getPath: function(a) { var e = this.externals[a]; return CKEDITOR.getUrl(e && e.dir || this.basePath + a + "/") },
  4143. getFilePath: function(a) { var e = this.externals[a]; return CKEDITOR.getUrl(this.getPath(a) + (e ? e.file : this.fileName + ".js")) },
  4144. addExternal: function(a, e, b) {
  4145. for (var a = a.split(","), g = 0; g < a.length; g++) {
  4146. var c = a[g];
  4147. b || (e = e.replace(/[^\/]+$/, function(a) { b = a; return "" }));
  4148. this.externals[c] = { dir: e, file: b || this.fileName + ".js" }
  4149. }
  4150. },
  4151. load: function(a, e, b) {
  4152. CKEDITOR.tools.isArray(a) || (a = a ? [a] : []);
  4153. for (var g = this.loaded, c = this.registered, d = [], j = {}, f = {}, h = 0; h < a.length; h++) {
  4154. var i = a[h];
  4155. if (i)
  4156. if (!g[i] && !c[i]) {
  4157. var k = this.getFilePath(i);
  4158. d.push(k);
  4159. k in j || (j[k] = []);
  4160. j[k].push(i)
  4161. } else f[i] = this.get(i)
  4162. }
  4163. CKEDITOR.scriptLoader.load(d, function(a, c) {
  4164. if (c.length) throw '[CKEDITOR.resourceManager.load] Resource name "' + j[c[0]].join(",") + '" was not found at "' + c[0] + '".';
  4165. for (var d = 0; d < a.length; d++)
  4166. for (var h = j[a[d]],
  4167. i = 0; i < h.length; i++) {
  4168. var p = h[i];
  4169. f[p] = this.get(p);
  4170. g[p] = 1
  4171. }
  4172. e.call(b, f)
  4173. }, this)
  4174. }
  4175. }, CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin"), CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(a) {
  4176. var e = {};
  4177. return function(b, g, c) {
  4178. var d = {},
  4179. j = function(b) {
  4180. a.call(this, b, function(a) {
  4181. CKEDITOR.tools.extend(d, a);
  4182. var b = [],
  4183. f;
  4184. for (f in a) {
  4185. var n = a[f],
  4186. o = n && n.requires;
  4187. if (!e[f]) {
  4188. if (n.icons)
  4189. for (var q = n.icons.split(","), m = q.length; m--;) CKEDITOR.skin.addIcon(q[m], n.path + "icons/" + (CKEDITOR.env.hidpi &&
  4190. n.hidpi ? "hidpi/" : "") + q[m] + ".png");
  4191. e[f] = 1
  4192. }
  4193. if (o) { o.split && (o = o.split(",")); for (n = 0; n < o.length; n++) d[o[n]] || b.push(o[n]) }
  4194. }
  4195. if (b.length) j.call(this, b);
  4196. else {
  4197. for (f in d) {
  4198. n = d[f];
  4199. if (n.onLoad && !n.onLoad._called) {
  4200. n.onLoad() === false && delete d[f];
  4201. n.onLoad._called = 1
  4202. }
  4203. }
  4204. g && g.call(c || window, d)
  4205. }
  4206. }, this)
  4207. };
  4208. j.call(this, b)
  4209. }
  4210. }), CKEDITOR.plugins.setLang = function(a, e, b) {
  4211. var g = this.get(a),
  4212. a = g.langEntries || (g.langEntries = {}),
  4213. g = g.lang || (g.lang = []);
  4214. g.split && (g = g.split(","));
  4215. CKEDITOR.tools.indexOf(g, e) == -1 && g.push(e);
  4216. a[e] = b
  4217. }, CKEDITOR.ui =
  4218. function(a) {
  4219. if (a.ui) return a.ui;
  4220. this.items = {};
  4221. this.instances = {};
  4222. this.editor = a;
  4223. this._ = { handlers: {} };
  4224. return this
  4225. }, CKEDITOR.ui.prototype = {
  4226. add: function(a, e, b) {
  4227. b.name = a.toLowerCase();
  4228. var g = this.items[a] = { type: e, command: b.command || null, args: Array.prototype.slice.call(arguments, 2) };
  4229. CKEDITOR.tools.extend(g, b)
  4230. },
  4231. get: function(a) { return this.instances[a] },
  4232. create: function(a) {
  4233. var e = this.items[a],
  4234. b = e && this._.handlers[e.type],
  4235. g = e && e.command && this.editor.getCommand(e.command),
  4236. b = b && b.create.apply(this, e.args);
  4237. this.instances[a] =
  4238. b;
  4239. g && g.uiItems.push(b);
  4240. if (b && !b.type) b.type = e.type;
  4241. return b
  4242. },
  4243. addHandler: function(a, e) { this._.handlers[a] = e },
  4244. space: function(a) { return CKEDITOR.document.getById(this.spaceId(a)) },
  4245. spaceId: function(a) { return this.editor.id + "_" + a }
  4246. }, CKEDITOR.event.implementOn(CKEDITOR.ui),
  4247. function() {
  4248. function a(a, d, f) {
  4249. CKEDITOR.event.call(this);
  4250. a = a && CKEDITOR.tools.clone(a);
  4251. if (d !== void 0) {
  4252. if (d instanceof CKEDITOR.dom.element) { if (!f) throw Error("One of the element modes must be specified."); } else throw Error("Expect element of type CKEDITOR.dom.element.");
  4253. if (CKEDITOR.env.ie && CKEDITOR.env.quirks && f == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks.");
  4254. if (!(f == CKEDITOR.ELEMENT_MODE_INLINE ? d.is(CKEDITOR.dtd.$editable) || d.is("textarea") : f == CKEDITOR.ELEMENT_MODE_REPLACE ? !d.is(CKEDITOR.dtd.$nonBodyContent) : 1)) throw Error('The specified element mode is not supported on element: "' + d.getName() + '".');
  4255. this.element = d;
  4256. this.elementMode = f;
  4257. this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (d.getId() || d.getNameAtt())
  4258. } else this.elementMode =
  4259. CKEDITOR.ELEMENT_MODE_NONE;
  4260. this._ = {};
  4261. this.commands = {};
  4262. this.templates = {};
  4263. this.name = this.name || e();
  4264. this.id = CKEDITOR.tools.getNextId();
  4265. this.status = "unloaded";
  4266. this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
  4267. this.ui = new CKEDITOR.ui(this);
  4268. this.focusManager = new CKEDITOR.focusManager(this);
  4269. this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
  4270. this.on("readOnly", b);
  4271. this.on("selectionChange", function(a) { c(this, a.data.path) });
  4272. this.on("activeFilterChange", function() { c(this, this.elementPath(), true) });
  4273. this.on("mode", b);
  4274. this.on("instanceReady", function() { this.config.startupFocus && this.focus() });
  4275. CKEDITOR.fire("instanceCreated", null, this);
  4276. CKEDITOR.add(this);
  4277. CKEDITOR.tools.setTimeout(function() { j(this, a) }, 0, this)
  4278. }
  4279. function e() { do var a = "editor" + ++o; while (CKEDITOR.instances[a]); return a }
  4280. function b() {
  4281. var a = this.commands,
  4282. b;
  4283. for (b in a) g(this, a[b])
  4284. }
  4285. function g(a, b) { b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" : b.modes[a.mode] ? "enable" : "disable"]() }
  4286. function c(a, b, c) {
  4287. if (b) {
  4288. var d, f, g = a.commands;
  4289. for (f in g) {
  4290. d = g[f];
  4291. (c || d.contextSensitive) && d.refresh(a, b)
  4292. }
  4293. }
  4294. }
  4295. function d(a) {
  4296. var b = a.config.customConfig;
  4297. if (!b) return false;
  4298. var b = CKEDITOR.getUrl(b),
  4299. c = q[b] || (q[b] = {});
  4300. if (c.fn) {
  4301. c.fn.call(a, a.config);
  4302. (CKEDITOR.getUrl(a.config.customConfig) == b || !d(a)) && a.fireOnce("customConfigLoaded")
  4303. } else CKEDITOR.scriptLoader.queue(b, function() {
  4304. c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function() {};
  4305. d(a)
  4306. });
  4307. return true
  4308. }
  4309. function j(a, b) {
  4310. a.on("customConfigLoaded", function() {
  4311. if (b) {
  4312. if (b.on)
  4313. for (var c in b.on) a.on(c, b.on[c]);
  4314. CKEDITOR.tools.extend(a.config, b, true);
  4315. delete a.config.on
  4316. }
  4317. c = a.config;
  4318. a.readOnly = !(!c.readOnly && !(a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is("textarea") ? a.element.hasAttribute("disabled") : a.element.isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && a.element.hasAttribute("disabled")));
  4319. a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) : false;
  4320. a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") ||
  4321. 0;
  4322. a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
  4323. a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
  4324. if (c.skin) CKEDITOR.skinName = c.skin;
  4325. a.fireOnce("configLoaded");
  4326. a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
  4327. a.filter = a.activeFilter = new CKEDITOR.filter(a);
  4328. f(a)
  4329. });
  4330. if (b && b.customConfig != null) a.config.customConfig = b.customConfig;
  4331. d(a) || a.fireOnce("customConfigLoaded")
  4332. }
  4333. function f(a) { CKEDITOR.skin.loadPart("editor", function() { h(a) }) }
  4334. function h(a) {
  4335. CKEDITOR.lang.load(a.config.language,
  4336. a.config.defaultLanguage,
  4337. function(b, c) {
  4338. var d = a.config.title;
  4339. a.langCode = b;
  4340. a.lang = CKEDITOR.tools.prototypedCopy(c);
  4341. a.title = typeof d == "string" || d === false ? d : [a.lang.editor, a.name].join(", ");
  4342. if (!a.config.contentsLangDirection) a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir;
  4343. a.fire("langLoaded");
  4344. i(a)
  4345. })
  4346. }
  4347. function i(a) {
  4348. a.getStylesSet(function(b) {
  4349. a.once("loaded", function() { a.fire("stylesSet", { styles: b }) }, null, null, 1);
  4350. k(a)
  4351. })
  4352. }
  4353. function k(a) {
  4354. var b =
  4355. a.config,
  4356. c = b.plugins,
  4357. d = b.extraPlugins,
  4358. f = b.removePlugins;
  4359. if (d) var g = RegExp("(?:^|,)(?:" + d.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
  4360. c = c.replace(g, ""),
  4361. c = c + ("," + d);
  4362. if (f) var h = RegExp("(?:^|,)(?:" + f.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
  4363. c = c.replace(h, "");
  4364. CKEDITOR.env.air && (c = c + ",adobeair");
  4365. CKEDITOR.plugins.load(c.split(","), function(c) {
  4366. var d = [],
  4367. f = [],
  4368. g = [];
  4369. a.plugins = c;
  4370. for (var e in c) {
  4371. var j = c[e],
  4372. i = j.lang,
  4373. p = null,
  4374. t = j.requires,
  4375. k;
  4376. CKEDITOR.tools.isArray(t) && (t = t.join(","));
  4377. if (t && (k = t.match(h)))
  4378. for (; t = k.pop();) CKEDITOR.tools.setTimeout(function(a,
  4379. b) { throw Error('Plugin "' + a.replace(",", "") + '" cannot be removed from the plugins list, because it\'s required by "' + b + '" plugin.'); }, 0, null, [t, e]);
  4380. if (i && !a.lang[e]) {
  4381. i.split && (i = i.split(","));
  4382. if (CKEDITOR.tools.indexOf(i, a.langCode) >= 0) p = a.langCode;
  4383. else {
  4384. p = a.langCode.replace(/-.*/, "");
  4385. p = p != a.langCode && CKEDITOR.tools.indexOf(i, p) >= 0 ? p : CKEDITOR.tools.indexOf(i, "en") >= 0 ? "en" : i[0]
  4386. }
  4387. if (!j.langEntries || !j.langEntries[p]) g.push(CKEDITOR.getUrl(j.path + "lang/" + p + ".js"));
  4388. else {
  4389. a.lang[e] = j.langEntries[p];
  4390. p = null
  4391. }
  4392. }
  4393. f.push(p);
  4394. d.push(j)
  4395. }
  4396. CKEDITOR.scriptLoader.load(g, function() {
  4397. for (var c = ["beforeInit", "init", "afterInit"], g = 0; g < c.length; g++)
  4398. for (var h = 0; h < d.length; h++) {
  4399. var e = d[h];
  4400. g === 0 && (f[h] && e.lang && e.langEntries) && (a.lang[e.name] = e.langEntries[f[h]]);
  4401. if (e[c[g]]) e[c[g]](a)
  4402. }
  4403. a.fireOnce("pluginsLoaded");
  4404. b.keystrokes && a.setKeystroke(a.config.keystrokes);
  4405. for (h = 0; h < a.config.blockedKeystrokes.length; h++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[h]] = 1;
  4406. a.status = "loaded";
  4407. a.fireOnce("loaded");
  4408. CKEDITOR.fire("instanceLoaded",
  4409. null, a)
  4410. })
  4411. })
  4412. }
  4413. function n() {
  4414. var a = this.element;
  4415. if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
  4416. var b = this.getData();
  4417. this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
  4418. a.is("textarea") ? a.setValue(b) : a.setHtml(b);
  4419. return true
  4420. }
  4421. return false
  4422. }
  4423. a.prototype = CKEDITOR.editor.prototype;
  4424. CKEDITOR.editor = a;
  4425. var o = 0,
  4426. q = {};
  4427. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  4428. addCommand: function(a, b) {
  4429. b.name = a.toLowerCase();
  4430. var c = new CKEDITOR.command(this, b);
  4431. this.mode && g(this, c);
  4432. return this.commands[a] = c
  4433. },
  4434. _attachToForm: function() {
  4435. function a(d) {
  4436. b.updateElement();
  4437. b._.required && (!c.getValue() && b.fire("required") === false) && d.data.preventDefault()
  4438. }
  4439. var b = this,
  4440. c = b.element,
  4441. d = new CKEDITOR.dom.element(c.$.form);
  4442. if (c.is("textarea") && d) {
  4443. d.on("submit", a);
  4444. if (d.$.submit && d.$.submit.call && d.$.submit.apply) d.$.submit = CKEDITOR.tools.override(d.$.submit, function(b) {
  4445. return function() {
  4446. a();
  4447. b.apply ? b.apply(this) : b()
  4448. }
  4449. });
  4450. b.on("destroy", function() { d.removeListener("submit", a) })
  4451. }
  4452. },
  4453. destroy: function(a) {
  4454. this.fire("beforeDestroy");
  4455. !a && n.call(this);
  4456. this.editable(null);
  4457. this.filter.destroy();
  4458. delete this.filter;
  4459. delete this.activeFilter;
  4460. this.status = "destroyed";
  4461. this.fire("destroy");
  4462. this.removeAllListeners();
  4463. CKEDITOR.remove(this);
  4464. CKEDITOR.fire("instanceDestroyed", null, this)
  4465. },
  4466. elementPath: function(a) {
  4467. if (!a) {
  4468. a = this.getSelection();
  4469. if (!a) return null;
  4470. a = a.getStartElement()
  4471. }
  4472. return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
  4473. },
  4474. createRange: function() { var a = this.editable(); return a ? new CKEDITOR.dom.range(a) : null },
  4475. execCommand: function(a,
  4476. b) {
  4477. var c = this.getCommand(a),
  4478. d = { name: a, commandData: b, command: c };
  4479. if (c && c.state != CKEDITOR.TRISTATE_DISABLED && this.fire("beforeCommandExec", d) !== false) { d.returnValue = c.exec(d.commandData); if (!c.async && this.fire("afterCommandExec", d) !== false) return d.returnValue }
  4480. return false
  4481. },
  4482. getCommand: function(a) { return this.commands[a] },
  4483. getData: function(a) {
  4484. !a && this.fire("beforeGetData");
  4485. var b = this._.data;
  4486. if (typeof b != "string") b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ? b.getValue() :
  4487. b.getHtml() : "";
  4488. b = { dataValue: b };
  4489. !a && this.fire("getData", b);
  4490. return b.dataValue
  4491. },
  4492. getSnapshot: function() {
  4493. var a = this.fire("getSnapshot");
  4494. if (typeof a != "string") {
  4495. var b = this.element;
  4496. b && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a = b.is("textarea") ? b.getValue() : b.getHtml())
  4497. }
  4498. return a
  4499. },
  4500. loadSnapshot: function(a) { this.fire("loadSnapshot", a) },
  4501. setData: function(a, b, c) {
  4502. var d = true,
  4503. f = b;
  4504. if (b && typeof b == "object") {
  4505. c = b.internal;
  4506. f = b.callback;
  4507. d = !b.noSnapshot
  4508. }!c && d && this.fire("saveSnapshot");
  4509. if (f || !c) this.once("dataReady",
  4510. function(a) {
  4511. !c && d && this.fire("saveSnapshot");
  4512. f && f.call(a.editor)
  4513. });
  4514. a = { dataValue: a };
  4515. !c && this.fire("setData", a);
  4516. this._.data = a.dataValue;
  4517. !c && this.fire("afterSetData", a)
  4518. },
  4519. setReadOnly: function(a) {
  4520. a = a == null || a;
  4521. if (this.readOnly != a) {
  4522. this.readOnly = a;
  4523. this.keystrokeHandler.blockedKeystrokes[8] = +a;
  4524. this.editable().setReadOnly(a);
  4525. this.fire("readOnly")
  4526. }
  4527. },
  4528. insertHtml: function(a, b) { this.fire("insertHtml", { dataValue: a, mode: b }) },
  4529. insertText: function(a) { this.fire("insertText", a) },
  4530. insertElement: function(a) {
  4531. this.fire("insertElement",
  4532. a)
  4533. },
  4534. focus: function() { this.fire("beforeFocus") },
  4535. checkDirty: function() { return this.status == "ready" && this._.previousValue !== this.getSnapshot() },
  4536. resetDirty: function() { this._.previousValue = this.getSnapshot() },
  4537. updateElement: function() { return n.call(this) },
  4538. setKeystroke: function() {
  4539. for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [
  4540. [].slice.call(arguments, 0)
  4541. ], c, d, f = b.length; f--;) {
  4542. c = b[f];
  4543. d = 0;
  4544. if (CKEDITOR.tools.isArray(c)) {
  4545. d = c[1];
  4546. c = c[0]
  4547. }
  4548. d ? a[c] = d : delete a[c]
  4549. }
  4550. },
  4551. addFeature: function(a) { return this.filter.addFeature(a) },
  4552. setActiveFilter: function(a) {
  4553. if (!a) a = this.filter;
  4554. if (this.activeFilter !== a) {
  4555. this.activeFilter = a;
  4556. this.fire("activeFilterChange");
  4557. a === this.filter ? this.setActiveEnterMode(null, null) : this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode), a.getAllowedEnterMode(this.shiftEnterMode, true))
  4558. }
  4559. },
  4560. setActiveEnterMode: function(a, b) {
  4561. a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
  4562. b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
  4563. if (this.activeEnterMode != a || this.activeShiftEnterMode != b) {
  4564. this.activeEnterMode =
  4565. a;
  4566. this.activeShiftEnterMode = b;
  4567. this.fire("activeEnterModeChange")
  4568. }
  4569. }
  4570. })
  4571. }(), CKEDITOR.ELEMENT_MODE_NONE = 0, CKEDITOR.ELEMENT_MODE_REPLACE = 1, CKEDITOR.ELEMENT_MODE_APPENDTO = 2, CKEDITOR.ELEMENT_MODE_INLINE = 3, CKEDITOR.htmlParser = function() { this._ = { htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g } },
  4572. function() {
  4573. var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
  4574. e = {
  4575. checked: 1,
  4576. compact: 1,
  4577. declare: 1,
  4578. defer: 1,
  4579. disabled: 1,
  4580. ismap: 1,
  4581. multiple: 1,
  4582. nohref: 1,
  4583. noresize: 1,
  4584. noshade: 1,
  4585. nowrap: 1,
  4586. readonly: 1,
  4587. selected: 1
  4588. };
  4589. CKEDITOR.htmlParser.prototype = {
  4590. onTagOpen: function() {},
  4591. onTagClose: function() {},
  4592. onText: function() {},
  4593. onCDATA: function() {},
  4594. onComment: function() {},
  4595. parse: function(b) {
  4596. for (var g, c, d = 0, j; g = this._.htmlPartsRegex.exec(b);) {
  4597. c = g.index;
  4598. if (c > d) {
  4599. d = b.substring(d, c);
  4600. if (j) j.push(d);
  4601. else this.onText(d)
  4602. }
  4603. d = this._.htmlPartsRegex.lastIndex;
  4604. if (c = g[1]) {
  4605. c = c.toLowerCase();
  4606. if (j && CKEDITOR.dtd.$cdata[c]) {
  4607. this.onCDATA(j.join(""));
  4608. j = null
  4609. }
  4610. if (!j) { this.onTagClose(c); continue }
  4611. }
  4612. if (j) j.push(g[0]);
  4613. else if (c = g[3]) {
  4614. c = c.toLowerCase();
  4615. if (!/="/.test(c)) {
  4616. var f = {},
  4617. h, i = g[4];
  4618. g = !!g[5];
  4619. if (i)
  4620. for (; h = a.exec(i);) {
  4621. var k = h[1].toLowerCase();
  4622. h = h[2] || h[3] || h[4] || "";
  4623. f[k] = !h && e[k] ? k : CKEDITOR.tools.htmlDecodeAttr(h)
  4624. }
  4625. this.onTagOpen(c, f, g);
  4626. !j && CKEDITOR.dtd.$cdata[c] && (j = [])
  4627. }
  4628. } else if (c = g[2]) this.onComment(c)
  4629. }
  4630. if (b.length > d) this.onText(b.substring(d, b.length))
  4631. }
  4632. }
  4633. }(), CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
  4634. $: function() { this._ = { output: [] } },
  4635. proto: {
  4636. openTag: function(a) { this._.output.push("<", a) },
  4637. openTagClose: function(a, e) { e ? this._.output.push(" />") : this._.output.push(">") },
  4638. attribute: function(a, e) {
  4639. typeof e == "string" && (e = CKEDITOR.tools.htmlEncodeAttr(e));
  4640. this._.output.push(" ", a, '="', e, '"')
  4641. },
  4642. closeTag: function(a) { this._.output.push("</", a, ">") },
  4643. text: function(a) { this._.output.push(a) },
  4644. comment: function(a) { this._.output.push("<\!--", a, "--\>") },
  4645. write: function(a) { this._.output.push(a) },
  4646. reset: function() {
  4647. this._.output = [];
  4648. this._.indent = false
  4649. },
  4650. getHtml: function(a) {
  4651. var e =
  4652. this._.output.join("");
  4653. a && this.reset();
  4654. return e
  4655. }
  4656. }
  4657. }), "use strict",
  4658. function() {
  4659. CKEDITOR.htmlParser.node = function() {};
  4660. CKEDITOR.htmlParser.node.prototype = {
  4661. remove: function() {
  4662. var a = this.parent.children,
  4663. e = CKEDITOR.tools.indexOf(a, this),
  4664. b = this.previous,
  4665. g = this.next;
  4666. b && (b.next = g);
  4667. g && (g.previous = b);
  4668. a.splice(e, 1);
  4669. this.parent = null
  4670. },
  4671. replaceWith: function(a) {
  4672. var e = this.parent.children,
  4673. b = CKEDITOR.tools.indexOf(e, this),
  4674. g = a.previous = this.previous,
  4675. c = a.next = this.next;
  4676. g && (g.next = a);
  4677. c && (c.previous = a);
  4678. e[b] = a;
  4679. a.parent = this.parent;
  4680. this.parent = null
  4681. },
  4682. insertAfter: function(a) {
  4683. var e = a.parent.children,
  4684. b = CKEDITOR.tools.indexOf(e, a),
  4685. g = a.next;
  4686. e.splice(b + 1, 0, this);
  4687. this.next = a.next;
  4688. this.previous = a;
  4689. a.next = this;
  4690. g && (g.previous = this);
  4691. this.parent = a.parent
  4692. },
  4693. insertBefore: function(a) {
  4694. var e = a.parent.children,
  4695. b = CKEDITOR.tools.indexOf(e, a);
  4696. e.splice(b, 0, this);
  4697. this.next = a;
  4698. (this.previous = a.previous) && (a.previous.next = this);
  4699. a.previous = this;
  4700. this.parent = a.parent
  4701. },
  4702. getAscendant: function(a) {
  4703. var e = typeof a == "function" ? a : typeof a == "string" ? function(b) {
  4704. return b.name ==
  4705. a
  4706. } : function(b) { return b.name in a },
  4707. b = this.parent;
  4708. for (; b && b.type == CKEDITOR.NODE_ELEMENT;) {
  4709. if (e(b)) return b;
  4710. b = b.parent
  4711. }
  4712. return null
  4713. },
  4714. wrapWith: function(a) {
  4715. this.replaceWith(a);
  4716. a.add(this);
  4717. return a
  4718. },
  4719. getIndex: function() { return CKEDITOR.tools.indexOf(this.parent.children, this) },
  4720. getFilterContext: function(a) { return a || {} }
  4721. }
  4722. }(), "use strict", CKEDITOR.htmlParser.comment = function(a) {
  4723. this.value = a;
  4724. this._ = { isBlockLike: false }
  4725. }, CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  4726. type: CKEDITOR.NODE_COMMENT,
  4727. filter: function(a, e) {
  4728. var b = this.value;
  4729. if (!(b = a.onComment(e, b, this))) { this.remove(); return false }
  4730. if (typeof b != "string") { this.replaceWith(b); return false }
  4731. this.value = b;
  4732. return true
  4733. },
  4734. writeHtml: function(a, e) {
  4735. e && this.filter(e);
  4736. a.comment(this.value)
  4737. }
  4738. }), "use strict",
  4739. function() {
  4740. CKEDITOR.htmlParser.text = function(a) {
  4741. this.value = a;
  4742. this._ = { isBlockLike: false }
  4743. };
  4744. CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  4745. type: CKEDITOR.NODE_TEXT,
  4746. filter: function(a,
  4747. e) { if (!(this.value = a.onText(e, this.value, this))) { this.remove(); return false } },
  4748. writeHtml: function(a, e) {
  4749. e && this.filter(e);
  4750. a.text(this.value)
  4751. }
  4752. })
  4753. }(), "use strict",
  4754. function() {
  4755. CKEDITOR.htmlParser.cdata = function(a) { this.value = a };
  4756. CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, { type: CKEDITOR.NODE_TEXT, filter: function() {}, writeHtml: function(a) { a.write(this.value) } })
  4757. }(), "use strict", CKEDITOR.htmlParser.fragment = function() {
  4758. this.children = [];
  4759. this.parent = null;
  4760. this._ = {
  4761. isBlockLike: true,
  4762. hasInlineStarted: false
  4763. }
  4764. },
  4765. function() {
  4766. function a(a) { return a.attributes["data-cke-survive"] ? false : a.name == "a" && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name] }
  4767. var e = CKEDITOR.tools.extend({ table: 1, ul: 1, ol: 1, dl: 1 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl),
  4768. b = { ol: 1, ul: 1 },
  4769. g = CKEDITOR.tools.extend({}, { html: 1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style: 1, script: 1 }),
  4770. c = { ul: "li", ol: "li", dl: "dd", table: "tbody", tbody: "tr", thead: "tr", tfoot: "tr", tr: "td" };
  4771. CKEDITOR.htmlParser.fragment.fromHtml =
  4772. function(d, j, f) {
  4773. function h(a) {
  4774. var b;
  4775. if (p.length > 0)
  4776. for (var c = 0; c < p.length; c++) {
  4777. var d = p[c],
  4778. f = d.name,
  4779. g = CKEDITOR.dtd[f],
  4780. h = s.name && CKEDITOR.dtd[s.name];
  4781. if ((!h || h[f]) && (!a || !g || g[a] || !CKEDITOR.dtd[a])) {
  4782. if (!b) {
  4783. i();
  4784. b = 1
  4785. }
  4786. d = d.clone();
  4787. d.parent = s;
  4788. s = d;
  4789. p.splice(c, 1);
  4790. c--
  4791. } else if (f == s.name) {
  4792. n(s, s.parent, 1);
  4793. c--
  4794. }
  4795. }
  4796. }
  4797. function i() { for (; t.length;) n(t.shift(), s) }
  4798. function k(a) {
  4799. if (a._.isBlockLike && a.name != "pre" && a.name != "textarea") {
  4800. var b = a.children.length,
  4801. c = a.children[b - 1],
  4802. d;
  4803. if (c && c.type == CKEDITOR.NODE_TEXT)(d = CKEDITOR.tools.rtrim(c.value)) ?
  4804. c.value = d : a.children.length = b - 1
  4805. }
  4806. }
  4807. function n(b, c, d) {
  4808. var c = c || s || l,
  4809. g = s;
  4810. if (b.previous === void 0) {
  4811. if (o(c, b)) {
  4812. s = c;
  4813. m.onTagOpen(f, {});
  4814. b.returnPoint = c = s
  4815. }
  4816. k(b);
  4817. (!a(b) || b.children.length) && c.add(b);
  4818. b.name == "pre" && (w = false);
  4819. b.name == "textarea" && (u = false)
  4820. }
  4821. if (b.returnPoint) {
  4822. s = b.returnPoint;
  4823. delete b.returnPoint
  4824. } else s = d ? c : g
  4825. }
  4826. function o(a, b) {
  4827. if ((a == l || a.name == "body") && f && (!a.name || CKEDITOR.dtd[a.name][f])) {
  4828. var c, d;
  4829. return (c = b.attributes && (d = b.attributes["data-cke-real-element-type"]) ? d : b.name) && c in CKEDITOR.dtd.$inline &&
  4830. !(c in CKEDITOR.dtd.head) && !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
  4831. }
  4832. }
  4833. function q(a, b) { return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || a == "dt" && b == "dd" || a == "dd" && b == "dt" : false }
  4834. var m = new CKEDITOR.htmlParser,
  4835. l = j instanceof CKEDITOR.htmlParser.element ? j : typeof j == "string" ? new CKEDITOR.htmlParser.element(j) : new CKEDITOR.htmlParser.fragment,
  4836. p = [],
  4837. t = [],
  4838. s = l,
  4839. u = l.name == "textarea",
  4840. w = l.name == "pre";
  4841. m.onTagOpen = function(c, d, f, j) {
  4842. d = new CKEDITOR.htmlParser.element(c, d);
  4843. if (d.isUnknown && f) d.isEmpty =
  4844. true;
  4845. d.isOptionalClose = j;
  4846. if (a(d)) p.push(d);
  4847. else {
  4848. if (c == "pre") w = true;
  4849. else {
  4850. if (c == "br" && w) { s.add(new CKEDITOR.htmlParser.text("\n")); return }
  4851. c == "textarea" && (u = true)
  4852. }
  4853. if (c == "br") t.push(d);
  4854. else {
  4855. for (;;) {
  4856. j = (f = s.name) ? CKEDITOR.dtd[f] || (s._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : g;
  4857. if (!d.isUnknown && !s.isUnknown && !j[c])
  4858. if (s.isOptionalClose) m.onTagClose(f);
  4859. else if (c in b && f in b) {
  4860. f = s.children;
  4861. (f = f[f.length - 1]) && f.name == "li" || n(f = new CKEDITOR.htmlParser.element("li"), s);
  4862. !d.returnPoint && (d.returnPoint = s);
  4863. s = f
  4864. } else if (c in CKEDITOR.dtd.$listItem && !q(c, f)) m.onTagOpen(c == "li" ? "ul" : "dl", {}, 0, 1);
  4865. else if (f in e && !q(c, f)) {
  4866. !d.returnPoint && (d.returnPoint = s);
  4867. s = s.parent
  4868. } else {
  4869. f in CKEDITOR.dtd.$inline && p.unshift(s);
  4870. if (s.parent) n(s, s.parent, 1);
  4871. else { d.isOrphan = 1; break }
  4872. } else break
  4873. }
  4874. h(c);
  4875. i();
  4876. d.parent = s;
  4877. d.isEmpty ? n(d) : s = d
  4878. }
  4879. }
  4880. };
  4881. m.onTagClose = function(a) {
  4882. for (var b = p.length - 1; b >= 0; b--)
  4883. if (a == p[b].name) { p.splice(b, 1); return }
  4884. for (var c = [], d = [], g = s; g != l && g.name != a;) {
  4885. g._.isBlockLike || d.unshift(g);
  4886. c.push(g);
  4887. g = g.returnPoint || g.parent
  4888. }
  4889. if (g !=
  4890. l) {
  4891. for (b = 0; b < c.length; b++) {
  4892. var h = c[b];
  4893. n(h, h.parent)
  4894. }
  4895. s = g;
  4896. g._.isBlockLike && i();
  4897. n(g, g.parent);
  4898. if (g == s) s = s.parent;
  4899. p = p.concat(d)
  4900. }
  4901. a == "body" && (f = false)
  4902. };
  4903. m.onText = function(a) {
  4904. if ((!s._.hasInlineStarted || t.length) && !w && !u) { a = CKEDITOR.tools.ltrim(a); if (a.length === 0) return }
  4905. var b = s.name,
  4906. d = b ? CKEDITOR.dtd[b] || (s._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : g;
  4907. if (!u && !d["#"] && b in e) {
  4908. m.onTagOpen(c[b] || "");
  4909. m.onText(a)
  4910. } else {
  4911. i();
  4912. h();
  4913. !w && !u && (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
  4914. a = new CKEDITOR.htmlParser.text(a);
  4915. if (o(s, a)) this.onTagOpen(f, {}, 0, 1);
  4916. s.add(a)
  4917. }
  4918. };
  4919. m.onCDATA = function(a) { s.add(new CKEDITOR.htmlParser.cdata(a)) };
  4920. m.onComment = function(a) {
  4921. i();
  4922. h();
  4923. s.add(new CKEDITOR.htmlParser.comment(a))
  4924. };
  4925. m.parse(d);
  4926. for (i(); s != l;) n(s, s.parent, 1);
  4927. k(l);
  4928. return l
  4929. };
  4930. CKEDITOR.htmlParser.fragment.prototype = {
  4931. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  4932. add: function(a, b) {
  4933. isNaN(b) && (b = this.children.length);
  4934. var c = b > 0 ? this.children[b - 1] : null;
  4935. if (c) {
  4936. if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT) {
  4937. c.value = CKEDITOR.tools.rtrim(c.value);
  4938. if (c.value.length ===
  4939. 0) {
  4940. this.children.pop();
  4941. this.add(a);
  4942. return
  4943. }
  4944. }
  4945. c.next = a
  4946. }
  4947. a.previous = c;
  4948. a.parent = this;
  4949. this.children.splice(b, 0, a);
  4950. if (!this._.hasInlineStarted) this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike
  4951. },
  4952. filter: function(a, b) {
  4953. b = this.getFilterContext(b);
  4954. a.onRoot(b, this);
  4955. this.filterChildren(a, false, b)
  4956. },
  4957. filterChildren: function(a, b, c) {
  4958. if (this.childrenFilteredBy != a.id) {
  4959. c = this.getFilterContext(c);
  4960. if (b && !this.parent) a.onRoot(c, this);
  4961. this.childrenFilteredBy = a.id;
  4962. for (b = 0; b < this.children.length; b++) this.children[b].filter(a,
  4963. c) === false && b--
  4964. }
  4965. },
  4966. writeHtml: function(a, b) {
  4967. b && this.filter(b);
  4968. this.writeChildrenHtml(a)
  4969. },
  4970. writeChildrenHtml: function(a, b, c) {
  4971. var g = this.getFilterContext();
  4972. if (c && !this.parent && b) b.onRoot(g, this);
  4973. b && this.filterChildren(b, false, g);
  4974. b = 0;
  4975. c = this.children;
  4976. for (g = c.length; b < g; b++) c[b].writeHtml(a)
  4977. },
  4978. forEach: function(a, b, c) {
  4979. if (!c && (!b || this.type == b)) var g = a(this);
  4980. if (g !== false)
  4981. for (var c = this.children, e = 0; e < c.length; e++) {
  4982. g = c[e];
  4983. g.type == CKEDITOR.NODE_ELEMENT ? g.forEach(a, b) : (!b || g.type == b) && a(g)
  4984. }
  4985. },
  4986. getFilterContext: function(a) {
  4987. return a || {}
  4988. }
  4989. }
  4990. }(), "use strict",
  4991. function() {
  4992. function a() { this.rules = [] }
  4993. function e(b, g, c, d) {
  4994. var e, f;
  4995. for (e in g) {
  4996. (f = b[e]) || (f = b[e] = new a);
  4997. f.add(g[e], c, d)
  4998. }
  4999. }
  5000. CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({
  5001. $: function(b) {
  5002. this.id = CKEDITOR.tools.getNextNumber();
  5003. this.elementNameRules = new a;
  5004. this.attributeNameRules = new a;
  5005. this.elementsRules = {};
  5006. this.attributesRules = {};
  5007. this.textRules = new a;
  5008. this.commentRules = new a;
  5009. this.rootRules = new a;
  5010. b && this.addRules(b, 10)
  5011. },
  5012. proto: {
  5013. addRules: function(a, g) {
  5014. var c;
  5015. if (typeof g == "number") c =
  5016. g;
  5017. else if (g && "priority" in g) c = g.priority;
  5018. typeof c != "number" && (c = 10);
  5019. typeof g != "object" && (g = {});
  5020. a.elementNames && this.elementNameRules.addMany(a.elementNames, c, g);
  5021. a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, c, g);
  5022. a.elements && e(this.elementsRules, a.elements, c, g);
  5023. a.attributes && e(this.attributesRules, a.attributes, c, g);
  5024. a.text && this.textRules.add(a.text, c, g);
  5025. a.comment && this.commentRules.add(a.comment, c, g);
  5026. a.root && this.rootRules.add(a.root, c, g)
  5027. },
  5028. applyTo: function(a) { a.filter(this) },
  5029. onElementName: function(a,
  5030. g) { return this.elementNameRules.execOnName(a, g) },
  5031. onAttributeName: function(a, g) { return this.attributeNameRules.execOnName(a, g) },
  5032. onText: function(a, g, c) { return this.textRules.exec(a, g, c) },
  5033. onComment: function(a, g, c) { return this.commentRules.exec(a, g, c) },
  5034. onRoot: function(a, g) { return this.rootRules.exec(a, g) },
  5035. onElement: function(a, g) {
  5036. for (var c = [this.elementsRules["^"], this.elementsRules[g.name], this.elementsRules.$], d, e = 0; e < 3; e++)
  5037. if (d = c[e]) {
  5038. d = d.exec(a, g, this);
  5039. if (d === false) return null;
  5040. if (d && d != g) return this.onNode(a,
  5041. d);
  5042. if (g.parent && !g.name) break
  5043. }
  5044. return g
  5045. },
  5046. onNode: function(a, g) { var c = g.type; return c == CKEDITOR.NODE_ELEMENT ? this.onElement(a, g) : c == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(a, g.value)) : c == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(a, g.value)) : null },
  5047. onAttribute: function(a, g, c, d) { return (c = this.attributesRules[c]) ? c.exec(a, d, g, this) : d }
  5048. }
  5049. });
  5050. CKEDITOR.htmlParser.filterRulesGroup = a;
  5051. a.prototype = {
  5052. add: function(a, g, c) {
  5053. this.rules.splice(this.findIndex(g), 0, {
  5054. value: a,
  5055. priority: g,
  5056. options: c
  5057. })
  5058. },
  5059. addMany: function(a, g, c) {
  5060. for (var d = [this.findIndex(g), 0], e = 0, f = a.length; e < f; e++) d.push({ value: a[e], priority: g, options: c });
  5061. this.rules.splice.apply(this.rules, d)
  5062. },
  5063. findIndex: function(a) { for (var g = this.rules, c = g.length - 1; c >= 0 && a < g[c].priority;) c--; return c + 1 },
  5064. exec: function(a, g) {
  5065. var c = g instanceof CKEDITOR.htmlParser.node || g instanceof CKEDITOR.htmlParser.fragment,
  5066. d = Array.prototype.slice.call(arguments, 1),
  5067. e = this.rules,
  5068. f = e.length,
  5069. h, i, k, n;
  5070. for (n = 0; n < f; n++) {
  5071. if (c) {
  5072. h = g.type;
  5073. i = g.name
  5074. }
  5075. k = e[n];
  5076. if (!(a.nonEditable &&
  5077. !k.options.applyToAll || a.nestedEditable && k.options.excludeNestedEditable)) {
  5078. k = k.value.apply(null, d);
  5079. if (k === false || c && k && (k.name != i || k.type != h)) return k;
  5080. k != null && (d[0] = g = k)
  5081. }
  5082. }
  5083. return g
  5084. },
  5085. execOnName: function(a, g) { for (var c = 0, d = this.rules, e = d.length, f; g && c < e; c++) { f = d[c];!(a.nonEditable && !f.options.applyToAll || a.nestedEditable && f.options.excludeNestedEditable) && (g = g.replace(f.value[0], f.value[1])) } return g }
  5086. }
  5087. }(),
  5088. function() {
  5089. function a(a, f) {
  5090. function h(a) {
  5091. return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") :
  5092. new CKEDITOR.htmlParser.element("br", { "data-cke-bogus": 1 })
  5093. }
  5094. function e(a, c) {
  5095. return function(f) {
  5096. if (f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  5097. var e = [],
  5098. j = b(f),
  5099. p, k;
  5100. if (j)
  5101. for (i(j, 1) && e.push(j); j;) {
  5102. if (d(j) && (p = g(j)) && i(p))
  5103. if ((k = g(p)) && !d(k)) e.push(p);
  5104. else {
  5105. h(t).insertAfter(p);
  5106. p.remove()
  5107. }
  5108. j = j.previous
  5109. }
  5110. for (j = 0; j < e.length; j++) e[j].remove();
  5111. if (e = !a || (typeof c == "function" ? c(f) : c) !== false)
  5112. if (!t && !CKEDITOR.env.needsBrFiller && f.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) e = false;
  5113. else if (!t && !CKEDITOR.env.needsBrFiller && (document.documentMode >
  5114. 7 || f.name in CKEDITOR.dtd.tr || f.name in CKEDITOR.dtd.$listItem)) e = false;
  5115. else {
  5116. e = b(f);
  5117. e = !e || f.name == "form" && e.name == "input"
  5118. }
  5119. e && f.add(h(a))
  5120. }
  5121. }
  5122. }
  5123. function i(a, b) {
  5124. if ((!t || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && a.name == "br" && !a.attributes["data-cke-eol"]) return true;
  5125. var c;
  5126. if (a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(p))) {
  5127. if (c.index) {
  5128. (new CKEDITOR.htmlParser.text(a.value.substring(0, c.index))).insertBefore(a);
  5129. a.value = c[0]
  5130. }
  5131. if (!CKEDITOR.env.needsBrFiller && t && (!b || a.parent.name in x)) return true;
  5132. if (!t)
  5133. if ((c = a.previous) && c.name == "br" || !c || d(c)) return true
  5134. }
  5135. return false
  5136. }
  5137. var k = { elements: {} },
  5138. t = f == "html",
  5139. x = CKEDITOR.tools.extend({}, w),
  5140. C;
  5141. for (C in x) "#" in s[C] || delete x[C];
  5142. for (C in x) k.elements[C] = e(t, a.config.fillEmptyBlocks);
  5143. k.root = e(t, false);
  5144. k.elements.br = function(a) {
  5145. return function(b) {
  5146. if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  5147. var f = b.attributes;
  5148. if ("data-cke-bogus" in f || "data-cke-eol" in f) delete f["data-cke-bogus"];
  5149. else {
  5150. for (f = b.next; f && c(f);) f = f.next;
  5151. var e = g(b);
  5152. !f && d(b.parent) ? j(b.parent,
  5153. h(a)) : d(f) && (e && !d(e)) && h(a).insertBefore(f)
  5154. }
  5155. }
  5156. }
  5157. }(t);
  5158. return k
  5159. }
  5160. function e(a, b) { return a != CKEDITOR.ENTER_BR && b !== false ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : false }
  5161. function b(a) { for (a = a.children[a.children.length - 1]; a && c(a);) a = a.previous; return a }
  5162. function g(a) { for (a = a.previous; a && c(a);) a = a.previous; return a }
  5163. function c(a) { return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"] }
  5164. function d(a) {
  5165. return a && (a.type == CKEDITOR.NODE_ELEMENT && a.name in
  5166. w || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  5167. }
  5168. function j(a, b) {
  5169. var c = a.children[a.children.length - 1];
  5170. a.children.push(b);
  5171. b.parent = a;
  5172. if (c) {
  5173. c.next = b;
  5174. b.previous = c
  5175. }
  5176. }
  5177. function f(a) {
  5178. a = a.attributes;
  5179. a.contenteditable != "false" && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
  5180. a.contenteditable = "false"
  5181. }
  5182. function h(a) {
  5183. a = a.attributes;
  5184. switch (a["data-cke-editable"]) {
  5185. case "true":
  5186. a.contenteditable = "true";
  5187. break;
  5188. case "1":
  5189. delete a.contenteditable
  5190. }
  5191. }
  5192. function i(a) {
  5193. return a.replace(z, function(a, b, c) {
  5194. return "<" + b + c.replace(B,
  5195. function(a, b) { return A.test(b) && c.indexOf("data-cke-saved-" + b) == -1 ? " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a : a }) + ">"
  5196. })
  5197. }
  5198. function k(a, b) { return a.replace(b, function(a, b, c) { a.indexOf("<textarea") === 0 && (a = b + q(c).replace(/</g, "&lt;").replace(/>/g, "&gt;") + "</textarea>"); return "<cke:encoded>" + encodeURIComponent(a) + "</cke:encoded>" }) }
  5199. function n(a) { return a.replace(J, function(a, b) { return decodeURIComponent(b) }) }
  5200. function o(a) {
  5201. return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g, function(a) {
  5202. return "<\!--" +
  5203. t + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\>"
  5204. })
  5205. }
  5206. function q(a) { return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g, function(a, b) { return decodeURIComponent(b) }) }
  5207. function m(a, b) { var c = b._.dataStore; return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g, function(a, b) { return decodeURIComponent(b) }).replace(/\{cke_protected_(\d+)\}/g, function(a, b) { return c && c[b] || "" }) }
  5208. function l(a, b) {
  5209. for (var c = [], d = b.config.protectedSource, f = b._.dataStore || (b._.dataStore = { id: 1 }), g = /<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,
  5210. d = [/<script[\s\S]*?<\/script>/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(d), a = a.replace(/<\!--[\s\S]*?--\>/g, function(a) { return "<\!--{cke_tempcomment}" + (c.push(a) - 1) + "--\>" }), h = 0; h < d.length; h++) a = a.replace(d[h], function(a) { a = a.replace(g, function(a, b, d) { return c[d] }); return /cke_temp(comment)?/.test(a) ? a : "<\!--{cke_temp}" + (c.push(a) - 1) + "--\>" });
  5211. a = a.replace(g, function(a, b, d) { return "<\!--" + t + (b ? "{C}" : "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "--\>" });
  5212. a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=>]+))+\s*>/g,
  5213. function(a) { return a.replace(/<\!--\{cke_protected\}([^>]*)--\>/g, function(a, b) { f[f.id] = decodeURIComponent(b); return "{cke_protected_" + f.id++ + "}" }) });
  5214. return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function(a, c, d, f) { return "<" + c + d + ">" + m(q(f), b) + "</" + c + ">" })
  5215. }
  5216. CKEDITOR.htmlDataProcessor = function(b) {
  5217. var c, d, f = this;
  5218. this.editor = b;
  5219. this.dataFilter = c = new CKEDITOR.htmlParser.filter;
  5220. this.htmlFilter = d = new CKEDITOR.htmlParser.filter;
  5221. this.writer = new CKEDITOR.htmlParser.basicWriter;
  5222. c.addRules(x);
  5223. c.addRules(v, { applyToAll: true });
  5224. c.addRules(a(b, "data"), { applyToAll: true });
  5225. d.addRules(r);
  5226. d.addRules(y, { applyToAll: true });
  5227. d.addRules(a(b, "html"), { applyToAll: true });
  5228. b.on("toHtml", function(a) {
  5229. var a = a.data,
  5230. c = a.dataValue,
  5231. d, c = l(c, b),
  5232. c = k(c, D),
  5233. c = i(c),
  5234. c = k(c, G),
  5235. c = c.replace(C, "$1cke:$2"),
  5236. c = c.replace(E, "<cke:$1$2></cke:$1>"),
  5237. c = c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"),
  5238. c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + CKEDITOR.rnd + "-$2");
  5239. d = a.context || b.editable().getName();
  5240. var f;
  5241. if (CKEDITOR.env.ie &&
  5242. CKEDITOR.env.version < 9 && d == "pre") {
  5243. d = "div";
  5244. c = "<pre>" + c + "</pre>";
  5245. f = 1
  5246. }
  5247. d = b.document.createElement(d);
  5248. d.setHtml("a" + c);
  5249. c = d.getHtml().substr(1);
  5250. c = c.replace(RegExp("data-cke-" + CKEDITOR.rnd + "-", "ig"), "");
  5251. f && (c = c.replace(/^<pre>|<\/pre>$/gi, ""));
  5252. c = c.replace(F, "$1$2");
  5253. c = n(c);
  5254. c = q(c);
  5255. d = a.fixForBody === false ? false : e(a.enterMode, b.config.autoParagraph);
  5256. c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, d);
  5257. if (d) {
  5258. f = c;
  5259. if (!f.children.length && CKEDITOR.dtd[f.name][d]) {
  5260. d = new CKEDITOR.htmlParser.element(d);
  5261. f.add(d)
  5262. }
  5263. }
  5264. a.dataValue =
  5265. c
  5266. }, null, null, 5);
  5267. b.on("toHtml", function(a) { a.data.filter.applyTo(a.data.dataValue, true, a.data.dontFilter, a.data.enterMode) && b.fire("dataFiltered") }, null, null, 6);
  5268. b.on("toHtml", function(a) { a.data.dataValue.filterChildren(f.dataFilter, true) }, null, null, 10);
  5269. b.on("toHtml", function(a) {
  5270. var a = a.data,
  5271. b = a.dataValue,
  5272. c = new CKEDITOR.htmlParser.basicWriter;
  5273. b.writeChildrenHtml(c);
  5274. b = c.getHtml(true);
  5275. a.dataValue = o(b)
  5276. }, null, null, 15);
  5277. b.on("toDataFormat", function(a) {
  5278. var c = a.data.dataValue;
  5279. a.data.enterMode != CKEDITOR.ENTER_BR &&
  5280. (c = c.replace(/^<br *\/?>/i, ""));
  5281. a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, e(a.data.enterMode, b.config.autoParagraph))
  5282. }, null, null, 5);
  5283. b.on("toDataFormat", function(a) { a.data.dataValue.filterChildren(f.htmlFilter, true) }, null, null, 10);
  5284. b.on("toDataFormat", function(a) { a.data.filter.applyTo(a.data.dataValue, false, true) }, null, null, 11);
  5285. b.on("toDataFormat", function(a) {
  5286. var c = a.data.dataValue,
  5287. d = f.writer;
  5288. d.reset();
  5289. c.writeChildrenHtml(d);
  5290. c = d.getHtml(true);
  5291. c = q(c);
  5292. c = m(c, b);
  5293. a.data.dataValue =
  5294. c
  5295. }, null, null, 15)
  5296. };
  5297. CKEDITOR.htmlDataProcessor.prototype = {
  5298. toHtml: function(a, b, c, d) {
  5299. var f = this.editor,
  5300. g, h, e;
  5301. if (b && typeof b == "object") {
  5302. g = b.context;
  5303. c = b.fixForBody;
  5304. d = b.dontFilter;
  5305. h = b.filter;
  5306. e = b.enterMode
  5307. } else g = b;
  5308. !g && g !== null && (g = f.editable().getName());
  5309. return f.fire("toHtml", { dataValue: a, context: g, fixForBody: c, dontFilter: d, filter: h || f.filter, enterMode: e || f.enterMode }).dataValue
  5310. },
  5311. toDataFormat: function(a, b) {
  5312. var c, d, f;
  5313. if (b) {
  5314. c = b.context;
  5315. d = b.filter;
  5316. f = b.enterMode
  5317. }!c && c !== null && (c = this.editor.editable().getName());
  5318. return this.editor.fire("toDataFormat", { dataValue: a, filter: d || this.editor.filter, context: c, enterMode: f || this.editor.enterMode }).dataValue
  5319. }
  5320. };
  5321. var p = /(?:&nbsp;|\xa0)$/,
  5322. t = "{cke_protected}",
  5323. s = CKEDITOR.dtd,
  5324. u = ["caption", "colgroup", "col", "thead", "tfoot", "tbody"],
  5325. w = CKEDITOR.tools.extend({}, s.$blockLimit, s.$block),
  5326. x = { elements: { input: f, textarea: f } },
  5327. v = {
  5328. attributeNames: [
  5329. [/^on/, "data-cke-pa-on"],
  5330. [/^data-cke-expando$/, ""]
  5331. ]
  5332. },
  5333. r = {
  5334. elements: {
  5335. embed: function(a) {
  5336. var b = a.parent;
  5337. if (b && b.name == "object") {
  5338. var c = b.attributes.width,
  5339. b = b.attributes.height;
  5340. if (c) a.attributes.width = c;
  5341. if (b) a.attributes.height = b
  5342. }
  5343. },
  5344. a: function(a) { if (!a.children.length && !a.attributes.name && !a.attributes["data-cke-saved-name"]) return false }
  5345. }
  5346. },
  5347. y = {
  5348. elementNames: [
  5349. [/^cke:/, ""],
  5350. [/^\?xml:namespace$/, ""]
  5351. ],
  5352. attributeNames: [
  5353. [/^data-cke-(saved|pa)-/, ""],
  5354. [/^data-cke-.*/, ""],
  5355. ["hidefocus", ""]
  5356. ],
  5357. elements: {
  5358. $: function(a) {
  5359. var b = a.attributes;
  5360. if (b) {
  5361. if (b["data-cke-temp"]) return false;
  5362. for (var c = ["name", "href", "src"], d, f = 0; f < c.length; f++) {
  5363. d = "data-cke-saved-" + c[f];
  5364. d in b && delete b[c[f]]
  5365. }
  5366. }
  5367. return a
  5368. },
  5369. table: function(a) {
  5370. a.children.slice(0).sort(function(a, b) {
  5371. var c, d;
  5372. if (a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type) {
  5373. c = CKEDITOR.tools.indexOf(u, a.name);
  5374. d = CKEDITOR.tools.indexOf(u, b.name)
  5375. }
  5376. if (!(c > -1 && d > -1 && c != d)) {
  5377. c = a.parent ? a.getIndex() : -1;
  5378. d = b.parent ? b.getIndex() : -1
  5379. }
  5380. return c > d ? 1 : -1
  5381. })
  5382. },
  5383. param: function(a) {
  5384. a.children = [];
  5385. a.isEmpty = true;
  5386. return a
  5387. },
  5388. span: function(a) { a.attributes["class"] == "Apple-style-span" && delete a.name },
  5389. html: function(a) {
  5390. delete a.attributes.contenteditable;
  5391. delete a.attributes["class"]
  5392. },
  5393. body: function(a) {
  5394. delete a.attributes.spellcheck;
  5395. delete a.attributes.contenteditable
  5396. },
  5397. style: function(a) { var b = a.children[0]; if (b && b.value) b.value = CKEDITOR.tools.trim(b.value); if (!a.attributes.type) a.attributes.type = "text/css" },
  5398. title: function(a) {
  5399. var b = a.children[0];
  5400. !b && j(a, b = new CKEDITOR.htmlParser.text);
  5401. b.value = a.attributes["data-cke-title"] || ""
  5402. },
  5403. input: h,
  5404. textarea: h
  5405. },
  5406. attributes: { "class": function(a) { return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || false } }
  5407. };
  5408. if (CKEDITOR.env.ie) y.attributes.style = function(a) {
  5409. return a.replace(/(^|;)([^\:]+)/g,
  5410. function(a) { return a.toLowerCase() })
  5411. };
  5412. var z = /<(a|area|img|input|source)\b([^>]*)>/gi,
  5413. B = /([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
  5414. A = /^(href|src|name)$/i,
  5415. G = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
  5416. D = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
  5417. J = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
  5418. C = /(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,
  5419. F = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,
  5420. E = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi
  5421. }(),
  5422. "use strict", CKEDITOR.htmlParser.element = function(a, e) {
  5423. this.name = a;
  5424. this.attributes = e || {};
  5425. this.children = [];
  5426. var b = a || "",
  5427. g = b.match(/^cke:(.*)/);
  5428. g && (b = g[1]);
  5429. b = !(!CKEDITOR.dtd.$nonBodyContent[b] && !CKEDITOR.dtd.$block[b] && !CKEDITOR.dtd.$listItem[b] && !CKEDITOR.dtd.$tableContent[b] && !(CKEDITOR.dtd.$nonEditable[b] || b == "br"));
  5430. this.isEmpty = !!CKEDITOR.dtd.$empty[a];
  5431. this.isUnknown = !CKEDITOR.dtd[a];
  5432. this._ = { isBlockLike: b, hasInlineStarted: this.isEmpty || !b }
  5433. }, CKEDITOR.htmlParser.cssStyle = function(a) {
  5434. var e = {};
  5435. ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || "").replace(/&quot;/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, g, c) {
  5436. g == "font-family" && (c = c.replace(/["']/g, ""));
  5437. e[g.toLowerCase()] = c
  5438. });
  5439. return {
  5440. rules: e,
  5441. populate: function(a) { var g = this.toString(); if (g) a instanceof CKEDITOR.dom.element ? a.setAttribute("style", g) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = g : a.style = g },
  5442. toString: function() {
  5443. var a = [],
  5444. g;
  5445. for (g in e) e[g] && a.push(g, ":", e[g], ";");
  5446. return a.join("")
  5447. }
  5448. }
  5449. },
  5450. function() {
  5451. function a(a) {
  5452. return function(b) {
  5453. return b.type ==
  5454. CKEDITOR.NODE_ELEMENT && (typeof a == "string" ? b.name == a : b.name in a)
  5455. }
  5456. }
  5457. var e = function(a, b) {
  5458. a = a[0];
  5459. b = b[0];
  5460. return a < b ? -1 : a > b ? 1 : 0
  5461. },
  5462. b = CKEDITOR.htmlParser.fragment.prototype;
  5463. CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5464. type: CKEDITOR.NODE_ELEMENT,
  5465. add: b.add,
  5466. clone: function() { return new CKEDITOR.htmlParser.element(this.name, this.attributes) },
  5467. filter: function(a, b) {
  5468. var d = this,
  5469. e, f, b = d.getFilterContext(b);
  5470. if (b.off) return true;
  5471. if (!d.parent) a.onRoot(b, d);
  5472. for (;;) {
  5473. e = d.name;
  5474. if (!(f = a.onElementName(b, e))) { this.remove(); return false }
  5475. d.name = f;
  5476. if (!(d = a.onElement(b, d))) { this.remove(); return false }
  5477. if (d !== this) { this.replaceWith(d); return false }
  5478. if (d.name == e) break;
  5479. if (d.type != CKEDITOR.NODE_ELEMENT) { this.replaceWith(d); return false }
  5480. if (!d.name) { this.replaceWithChildren(); return false }
  5481. }
  5482. e = d.attributes;
  5483. var h, i;
  5484. for (h in e) {
  5485. i = h;
  5486. for (f = e[h];;)
  5487. if (i = a.onAttributeName(b, h))
  5488. if (i != h) {
  5489. delete e[h];
  5490. h = i
  5491. } else break;
  5492. else { delete e[h]; break }
  5493. i && ((f = a.onAttribute(b, d, i, f)) === false ? delete e[i] : e[i] = f)
  5494. }
  5495. d.isEmpty ||
  5496. this.filterChildren(a, false, b);
  5497. return true
  5498. },
  5499. filterChildren: b.filterChildren,
  5500. writeHtml: function(a, b) {
  5501. b && this.filter(b);
  5502. var d = this.name,
  5503. j = [],
  5504. f = this.attributes,
  5505. h, i;
  5506. a.openTag(d, f);
  5507. for (h in f) j.push([h, f[h]]);
  5508. a.sortAttributes && j.sort(e);
  5509. h = 0;
  5510. for (i = j.length; h < i; h++) {
  5511. f = j[h];
  5512. a.attribute(f[0], f[1])
  5513. }
  5514. a.openTagClose(d, this.isEmpty);
  5515. this.writeChildrenHtml(a);
  5516. this.isEmpty || a.closeTag(d)
  5517. },
  5518. writeChildrenHtml: b.writeChildrenHtml,
  5519. replaceWithChildren: function() {
  5520. for (var a = this.children, b = a.length; b;) a[--b].insertAfter(this);
  5521. this.remove()
  5522. },
  5523. forEach: b.forEach,
  5524. getFirst: function(b) {
  5525. if (!b) return this.children.length ? this.children[0] : null;
  5526. typeof b != "function" && (b = a(b));
  5527. for (var c = 0, d = this.children.length; c < d; ++c)
  5528. if (b(this.children[c])) return this.children[c];
  5529. return null
  5530. },
  5531. getHtml: function() {
  5532. var a = new CKEDITOR.htmlParser.basicWriter;
  5533. this.writeChildrenHtml(a);
  5534. return a.getHtml()
  5535. },
  5536. setHtml: function(a) { for (var a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children, b = 0, d = a.length; b < d; ++b) a[b].parent = this },
  5537. getOuterHtml: function() {
  5538. var a =
  5539. new CKEDITOR.htmlParser.basicWriter;
  5540. this.writeHtml(a);
  5541. return a.getHtml()
  5542. },
  5543. split: function(a) {
  5544. for (var b = this.children.splice(a, this.children.length - a), d = this.clone(), e = 0; e < b.length; ++e) b[e].parent = d;
  5545. d.children = b;
  5546. if (b[0]) b[0].previous = null;
  5547. if (a > 0) this.children[a - 1].next = null;
  5548. this.parent.add(d, this.getIndex() + 1);
  5549. return d
  5550. },
  5551. addClass: function(a) {
  5552. if (!this.hasClass(a)) {
  5553. var b = this.attributes["class"] || "";
  5554. this.attributes["class"] = b + (b ? " " : "") + a
  5555. }
  5556. },
  5557. removeClass: function(a) {
  5558. var b = this.attributes["class"];
  5559. if (b)(b =
  5560. CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)" + a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"]
  5561. },
  5562. hasClass: function(a) { var b = this.attributes["class"]; return !b ? false : RegExp("(?:^|\\s)" + a + "(?=\\s|$)").test(b) },
  5563. getFilterContext: function(a) {
  5564. var b = [];
  5565. a || (a = { off: false, nonEditable: false, nestedEditable: false });
  5566. !a.off && this.attributes["data-cke-processor"] == "off" && b.push("off", true);
  5567. !a.nonEditable && this.attributes.contenteditable == "false" ? b.push("nonEditable", true) : a.nonEditable &&
  5568. (!a.nestedEditable && this.attributes.contenteditable == "true") && b.push("nestedEditable", true);
  5569. if (b.length)
  5570. for (var a = CKEDITOR.tools.copy(a), d = 0; d < b.length; d = d + 2) a[b[d]] = b[d + 1];
  5571. return a
  5572. }
  5573. }, true)
  5574. }(),
  5575. function() {
  5576. var a = {},
  5577. e = /{([^}]+)}/g,
  5578. b = /([\\'])/g,
  5579. g = /\n/g,
  5580. c = /\r/g;
  5581. CKEDITOR.template = function(d) {
  5582. if (a[d]) this.output = a[d];
  5583. else {
  5584. var j = d.replace(b, "\\$1").replace(g, "\\n").replace(c, "\\r").replace(e, function(a, b) { return "',data['" + b + "']==undefined?'{" + b + "}':data['" + b + "'],'" });
  5585. this.output = a[d] = Function("data", "buffer",
  5586. "return buffer?buffer.push('" + j + "'):['" + j + "'].join('');")
  5587. }
  5588. }
  5589. }(), delete CKEDITOR.loadFullCore, CKEDITOR.instances = {}, CKEDITOR.document = new CKEDITOR.dom.document(document), CKEDITOR.add = function(a) {
  5590. CKEDITOR.instances[a.name] = a;
  5591. a.on("focus", function() {
  5592. if (CKEDITOR.currentInstance != a) {
  5593. CKEDITOR.currentInstance = a;
  5594. CKEDITOR.fire("currentInstance")
  5595. }
  5596. });
  5597. a.on("blur", function() {
  5598. if (CKEDITOR.currentInstance == a) {
  5599. CKEDITOR.currentInstance = null;
  5600. CKEDITOR.fire("currentInstance")
  5601. }
  5602. });
  5603. CKEDITOR.fire("instance", null, a)
  5604. }, CKEDITOR.remove =
  5605. function(a) { delete CKEDITOR.instances[a.name] },
  5606. function() {
  5607. var a = {};
  5608. CKEDITOR.addTemplate = function(e, b) {
  5609. var g = a[e];
  5610. if (g) return g;
  5611. g = { name: e, source: b };
  5612. CKEDITOR.fire("template", g);
  5613. return a[e] = new CKEDITOR.template(g.source)
  5614. };
  5615. CKEDITOR.getTemplate = function(e) { return a[e] }
  5616. }(),
  5617. function() {
  5618. var a = [];
  5619. CKEDITOR.addCss = function(e) { a.push(e) };
  5620. CKEDITOR.getCss = function() { return a.join("\n") }
  5621. }(), CKEDITOR.on("instanceDestroyed", function() { CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset") }), CKEDITOR.TRISTATE_ON =
  5622. 1, CKEDITOR.TRISTATE_OFF = 2, CKEDITOR.TRISTATE_DISABLED = 0,
  5623. function() {
  5624. CKEDITOR.inline = function(a, e) {
  5625. if (!CKEDITOR.env.isCompatible) return null;
  5626. a = CKEDITOR.dom.element.get(a);
  5627. if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  5628. var b = new CKEDITOR.editor(e, a, CKEDITOR.ELEMENT_MODE_INLINE),
  5629. g = a.is("textarea") ? a : null;
  5630. if (g) {
  5631. b.setData(g.getValue(), null, true);
  5632. a = CKEDITOR.dom.element.createFromHtml('<div contenteditable="' + !!b.readOnly + '" class="cke_textarea_inline">' +
  5633. g.getValue() + "</div>", CKEDITOR.document);
  5634. a.insertAfter(g);
  5635. g.hide();
  5636. g.$.form && b._attachToForm()
  5637. } else b.setData(a.getHtml(), null, true);
  5638. b.on("loaded", function() {
  5639. b.fire("uiReady");
  5640. b.editable(a);
  5641. b.container = a;
  5642. b.setData(b.getData(1));
  5643. b.resetDirty();
  5644. b.fire("contentDom");
  5645. b.mode = "wysiwyg";
  5646. b.fire("mode");
  5647. b.status = "ready";
  5648. b.fireOnce("instanceReady");
  5649. CKEDITOR.fire("instanceReady", null, b)
  5650. }, null, null, 1E4);
  5651. b.on("destroy", function() {
  5652. if (g) {
  5653. b.container.clearCustomData();
  5654. b.container.remove();
  5655. g.show()
  5656. }
  5657. b.element.clearCustomData();
  5658. delete b.element
  5659. });
  5660. return b
  5661. };
  5662. CKEDITOR.inlineAll = function() {
  5663. var a, e, b;
  5664. for (b in CKEDITOR.dtd.$editable)
  5665. for (var g = CKEDITOR.document.getElementsByTag(b), c = 0, d = g.count(); c < d; c++) {
  5666. a = g.getItem(c);
  5667. if (a.getAttribute("contenteditable") == "true") {
  5668. e = { element: a, config: {} };
  5669. CKEDITOR.fire("inline", e) !== false && CKEDITOR.inline(a, e.config)
  5670. }
  5671. }
  5672. };
  5673. CKEDITOR.domReady(function() {!CKEDITOR.disableAutoInline && CKEDITOR.inlineAll() })
  5674. }(), CKEDITOR.replaceClass = "ckeditor",
  5675. function() {
  5676. function a(a, c, d, j) {
  5677. if (!CKEDITOR.env.isCompatible) return null;
  5678. a = CKEDITOR.dom.element.get(a);
  5679. if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  5680. var f = new CKEDITOR.editor(c, a, j);
  5681. if (j == CKEDITOR.ELEMENT_MODE_REPLACE) {
  5682. a.setStyle("visibility", "hidden");
  5683. f._.required = a.hasAttribute("required");
  5684. a.removeAttribute("required")
  5685. }
  5686. d && f.setData(d, null, true);
  5687. f.on("loaded", function() {
  5688. b(f);
  5689. j == CKEDITOR.ELEMENT_MODE_REPLACE && (f.config.autoUpdateElement && a.$.form) && f._attachToForm();
  5690. f.setMode(f.config.startupMode, function() {
  5691. f.resetDirty();
  5692. f.status = "ready";
  5693. f.fireOnce("instanceReady");
  5694. CKEDITOR.fire("instanceReady", null, f)
  5695. })
  5696. });
  5697. f.on("destroy", e);
  5698. return f
  5699. }
  5700. function e() {
  5701. var a = this.container,
  5702. b = this.element;
  5703. if (a) {
  5704. a.clearCustomData();
  5705. a.remove()
  5706. }
  5707. if (b) {
  5708. b.clearCustomData();
  5709. if (this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE) {
  5710. b.show();
  5711. this._.required && b.setAttribute("required", "required")
  5712. }
  5713. delete this.element
  5714. }
  5715. }
  5716. function b(a) {
  5717. var b = a.name,
  5718. d = a.element,
  5719. e = a.elementMode,
  5720. f = a.fire("uiSpace", { space: "top", html: "" }).html,
  5721. h = a.fire("uiSpace", { space: "bottom", html: "" }).html,
  5722. i = new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir="{langDir}" lang="{langCode}" role="application"' + (a.title ? ' aria-labelledby="cke_{name}_arialbl"' : "") + ">" + (a.title ? '<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>' : "") + '<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'),
  5723. b = CKEDITOR.dom.element.createFromHtml(i.output({ id: a.id, name: b, langDir: a.lang.dir, langCode: a.langCode, voiceLabel: a.title, topHtml: f ? '<span id="' + a.ui.spaceId("top") + '" class="cke_top cke_reset_all" role="presentation" style="height:auto">' + f + "</span>" : "", contentId: a.ui.spaceId("contents"), bottomHtml: h ? '<span id="' + a.ui.spaceId("bottom") + '" class="cke_bottom cke_reset_all" role="presentation">' + h + "</span>" : "", outerEl: CKEDITOR.env.ie ? "span" : "div" }));
  5724. if (e == CKEDITOR.ELEMENT_MODE_REPLACE) {
  5725. d.hide();
  5726. b.insertAfter(d)
  5727. } else d.append(b);
  5728. a.container = b;
  5729. f && a.ui.space("top").unselectable();
  5730. h && a.ui.space("bottom").unselectable();
  5731. d = a.config.width;
  5732. e = a.config.height;
  5733. d && b.setStyle("width", CKEDITOR.tools.cssLength(d));
  5734. e && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(e));
  5735. b.disableContextMenu();
  5736. CKEDITOR.env.webkit && b.on("focus", function() { a.focus() });
  5737. a.fireOnce("uiReady")
  5738. }
  5739. CKEDITOR.replace = function(b, c) { return a(b, c, null, CKEDITOR.ELEMENT_MODE_REPLACE) };
  5740. CKEDITOR.appendTo = function(b, c, d) { return a(b, c, d, CKEDITOR.ELEMENT_MODE_APPENDTO) };
  5741. CKEDITOR.replaceAll = function() {
  5742. for (var a = document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) {
  5743. var d = null,
  5744. e = a[b];
  5745. if (e.name || e.id) {
  5746. if (typeof arguments[0] == "string") { if (!RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)").test(e.className)) continue } else if (typeof arguments[0] == "function") { d = {}; if (arguments[0](e, d) === false) continue }
  5747. this.replace(e, d)
  5748. }
  5749. }
  5750. };
  5751. CKEDITOR.editor.prototype.addMode = function(a, b) {
  5752. (this._.modes || (this._.modes = {}))[a] = b
  5753. };
  5754. CKEDITOR.editor.prototype.setMode = function(a, b) {
  5755. var d = this,
  5756. e =
  5757. this._.modes;
  5758. if (!(a == d.mode || !e || !e[a])) {
  5759. d.fire("beforeSetMode", a);
  5760. if (d.mode) {
  5761. var f = d.checkDirty(),
  5762. e = d._.previousModeData,
  5763. h, i = 0;
  5764. d.fire("beforeModeUnload");
  5765. d.editable(0);
  5766. d._.previousMode = d.mode;
  5767. d._.previousModeData = h = d.getData(1);
  5768. if (d.mode == "source" && e == h) {
  5769. d.fire("lockSnapshot", { forceUpdate: true });
  5770. i = 1
  5771. }
  5772. d.ui.space("contents").setHtml("");
  5773. d.mode = ""
  5774. } else d._.previousModeData = d.getData(1);
  5775. this._.modes[a](function() {
  5776. d.mode = a;
  5777. f !== void 0 && !f && d.resetDirty();
  5778. i ? d.fire("unlockSnapshot") : a == "wysiwyg" && d.fire("saveSnapshot");
  5779. setTimeout(function() {
  5780. d.fire("mode");
  5781. b && b.call(d)
  5782. }, 0)
  5783. })
  5784. }
  5785. };
  5786. CKEDITOR.editor.prototype.resize = function(a, b, d, e) {
  5787. var f = this.container,
  5788. h = this.ui.space("contents"),
  5789. i = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement,
  5790. e = e ? this.container.getFirst(function(a) { return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner") }) : f;
  5791. e.setSize("width", a, true);
  5792. i && (i.style.width = "1%");
  5793. h.setStyle("height", Math.max(b - (d ? 0 : (e.$.offsetHeight || 0) - (h.$.clientHeight || 0)), 0) + "px");
  5794. i && (i.style.width =
  5795. "100%");
  5796. this.fire("resize")
  5797. };
  5798. CKEDITOR.editor.prototype.getResizable = function(a) { return a ? this.ui.space("contents") : this.container };
  5799. CKEDITOR.domReady(function() { CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass) })
  5800. }(), CKEDITOR.config.startupMode = "wysiwyg",
  5801. function() {
  5802. function a(a) {
  5803. var b = a.editor,
  5804. c = a.data.path,
  5805. d = c.blockLimit,
  5806. f = a.data.selection,
  5807. h = f.getRanges()[0],
  5808. i;
  5809. if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller)
  5810. if (f = e(f, c)) {
  5811. f.appendBogus();
  5812. i = CKEDITOR.env.ie
  5813. }
  5814. if (j(b, c.block,
  5815. d) && h.collapsed && !h.getCommonAncestor().isReadOnly()) {
  5816. c = h.clone();
  5817. c.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  5818. d = new CKEDITOR.dom.walker(c);
  5819. d.guard = function(a) { return !g(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly() };
  5820. if (!d.checkForward() || c.checkStartOfBlock() && c.checkEndOfBlock()) {
  5821. b = h.fixBlock(true, b.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p");
  5822. if (!CKEDITOR.env.needsBrFiller)(b = b.getFirst(g)) && (b.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/)) && b.remove();
  5823. i = 1;
  5824. a.cancel()
  5825. }
  5826. }
  5827. i && h.select()
  5828. }
  5829. function e(a, b) {
  5830. if (a.isFake) return 0;
  5831. var c = b.block || b.blockLimit,
  5832. d = c && c.getLast(g);
  5833. if (c && c.isBlockBoundary() && (!d || !(d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary())) && !c.is("pre") && !c.getBogus()) return c
  5834. }
  5835. function b(a) {
  5836. var b = a.data.getTarget();
  5837. if (b.is("input")) {
  5838. b = b.getAttribute("type");
  5839. (b == "submit" || b == "reset") && a.data.preventDefault()
  5840. }
  5841. }
  5842. function g(a) { return o(a) && q(a) }
  5843. function c(a, b) {
  5844. return function(c) {
  5845. var d = CKEDITOR.dom.element.get(c.data.$.toElement || c.data.$.fromElement ||
  5846. c.data.$.relatedTarget);
  5847. (!d || !b.equals(d) && !b.contains(d)) && a.call(this, c)
  5848. }
  5849. }
  5850. function d(a) {
  5851. function b(a) { return function(b, d) { d && (b.type == CKEDITOR.NODE_ELEMENT && b.is(f)) && (c = b); if (!d && g(b) && (!a || !k(b))) return false } }
  5852. var c, d = a.getRanges()[0],
  5853. a = a.root,
  5854. f = { table: 1, ul: 1, ol: 1, dl: 1 };
  5855. if (d.startPath().contains(f)) {
  5856. var e = d.clone();
  5857. e.collapse(1);
  5858. e.setStartAt(a, CKEDITOR.POSITION_AFTER_START);
  5859. a = new CKEDITOR.dom.walker(e);
  5860. a.guard = b();
  5861. a.checkBackward();
  5862. if (c) {
  5863. e = d.clone();
  5864. e.collapse();
  5865. e.setEndAt(c, CKEDITOR.POSITION_AFTER_END);
  5866. a = new CKEDITOR.dom.walker(e);
  5867. a.guard = b(true);
  5868. c = false;
  5869. a.checkForward();
  5870. return c
  5871. }
  5872. }
  5873. return null
  5874. }
  5875. function j(a, b, c) { return a.config.autoParagraph !== false && a.activeEnterMode != CKEDITOR.ENTER_BR && a.editable().equals(c) && !b || b && b.getAttribute("contenteditable") == "true" }
  5876. function f(a) {
  5877. a.editor.focus();
  5878. a.editor.fire("saveSnapshot")
  5879. }
  5880. function h(a) {
  5881. var b = a.editor;
  5882. b.getSelection().scrollIntoView();
  5883. setTimeout(function() { b.fire("saveSnapshot") }, 0)
  5884. }
  5885. function i(a, b, c) {
  5886. for (var d = a.getCommonAncestor(b), b = a = c ? b : a;
  5887. (a = a.getParent()) &&
  5888. !d.equals(a) && a.getChildCount() == 1;) b = a;
  5889. b.remove()
  5890. }
  5891. CKEDITOR.editable = CKEDITOR.tools.createClass({
  5892. base: CKEDITOR.dom.element,
  5893. $: function(a, b) {
  5894. this.base(b.$ || b);
  5895. this.editor = a;
  5896. this.status = "unloaded";
  5897. this.hasFocus = false;
  5898. this.setup()
  5899. },
  5900. proto: {
  5901. focus: function() {
  5902. var a;
  5903. if (CKEDITOR.env.webkit && !this.hasFocus) { a = this.editor._.previousActive || this.getDocument().getActive(); if (this.contains(a)) { a.focus(); return } }
  5904. try { this.$[CKEDITOR.env.ie && this.getDocument().equals(CKEDITOR.document) ? "setActive" : "focus"]() } catch (b) {
  5905. if (!CKEDITOR.env.ie) throw b;
  5906. }
  5907. if (CKEDITOR.env.safari && !this.isInline()) {
  5908. a = CKEDITOR.document.getActive();
  5909. a.equals(this.getWindow().getFrame()) || this.getWindow().focus()
  5910. }
  5911. },
  5912. on: function(a, b) {
  5913. var d = Array.prototype.slice.call(arguments, 0);
  5914. if (CKEDITOR.env.ie && /^focus|blur$/.exec(a)) {
  5915. a = a == "focus" ? "focusin" : "focusout";
  5916. b = c(b, this);
  5917. d[0] = a;
  5918. d[1] = b
  5919. }
  5920. return CKEDITOR.dom.element.prototype.on.apply(this, d)
  5921. },
  5922. attachListener: function(a) {
  5923. !this._.listeners && (this._.listeners = []);
  5924. var b = Array.prototype.slice.call(arguments, 1),
  5925. b = a.on.apply(a, b);
  5926. this._.listeners.push(b);
  5927. return b
  5928. },
  5929. clearListeners: function() { var a = this._.listeners; try { for (; a.length;) a.pop().removeListener() } catch (b) {} },
  5930. restoreAttrs: function() {
  5931. var a = this._.attrChanges,
  5932. b, c;
  5933. for (c in a)
  5934. if (a.hasOwnProperty(c)) {
  5935. b = a[c];
  5936. b !== null ? this.setAttribute(c, b) : this.removeAttribute(c)
  5937. }
  5938. },
  5939. attachClass: function(a) {
  5940. var b = this.getCustomData("classes");
  5941. if (!this.hasClass(a)) {
  5942. !b && (b = []);
  5943. b.push(a);
  5944. this.setCustomData("classes", b);
  5945. this.addClass(a)
  5946. }
  5947. },
  5948. changeAttr: function(a, b) {
  5949. var c = this.getAttribute(a);
  5950. if (b !== c) {
  5951. !this._.attrChanges &&
  5952. (this._.attrChanges = {});
  5953. a in this._.attrChanges || (this._.attrChanges[a] = c);
  5954. this.setAttribute(a, b)
  5955. }
  5956. },
  5957. insertHtml: function(a, b) {
  5958. f(this);
  5959. m(this, b || "html", a)
  5960. },
  5961. insertText: function(a) {
  5962. f(this);
  5963. var b = this.editor,
  5964. c = b.getSelection().getStartElement().hasAscendant("pre", true) ? CKEDITOR.ENTER_BR : b.activeEnterMode,
  5965. b = c == CKEDITOR.ENTER_BR,
  5966. d = CKEDITOR.tools,
  5967. a = d.htmlEncode(a.replace(/\r\n/g, "\n")),
  5968. a = a.replace(/\t/g, "&nbsp;&nbsp; &nbsp;"),
  5969. c = c == CKEDITOR.ENTER_P ? "p" : "div";
  5970. if (!b) {
  5971. var g = /\n{2}/g;
  5972. if (g.test(a)) var e = "<" + c +
  5973. ">",
  5974. h = "</" + c + ">",
  5975. a = e + a.replace(g, function() { return h + e }) + h
  5976. }
  5977. a = a.replace(/\n/g, "<br>");
  5978. b || (a = a.replace(RegExp("<br>(?=</" + c + ">)"), function(a) { return d.repeat(a, 2) }));
  5979. a = a.replace(/^ | $/g, "&nbsp;");
  5980. a = a.replace(/(>|\s) /g, function(a, b) { return b + "&nbsp;" }).replace(/ (?=<)/g, "&nbsp;");
  5981. m(this, "text", a)
  5982. },
  5983. insertElement: function(a, b) { b ? this.insertElementIntoRange(a, b) : this.insertElementIntoSelection(a) },
  5984. insertElementIntoRange: function(a, b) {
  5985. var c = this.editor,
  5986. d = c.config.enterMode,
  5987. f = a.getName(),
  5988. g = CKEDITOR.dtd.$block[f];
  5989. if (b.checkReadOnly()) return false;
  5990. b.deleteContents(1);
  5991. b.startContainer.type == CKEDITOR.NODE_ELEMENT && b.startContainer.is({ tr: 1, table: 1, tbody: 1, thead: 1, tfoot: 1 }) && l(b);
  5992. var e, h;
  5993. if (g)
  5994. for (;
  5995. (e = b.getCommonAncestor(0, 1)) && (h = CKEDITOR.dtd[e.getName()]) && (!h || !h[f]);)
  5996. if (e.getName() in CKEDITOR.dtd.span) b.splitElement(e);
  5997. else if (b.checkStartOfBlock() && b.checkEndOfBlock()) {
  5998. b.setStartBefore(e);
  5999. b.collapse(true);
  6000. e.remove()
  6001. } else b.splitBlock(d == CKEDITOR.ENTER_DIV ? "div" : "p", c.editable());
  6002. b.insertNode(a);
  6003. return true
  6004. },
  6005. insertElementIntoSelection: function(a) {
  6006. f(this);
  6007. var b = this.editor,
  6008. c = b.activeEnterMode,
  6009. b = b.getSelection(),
  6010. d = b.getRanges()[0],
  6011. e = a.getName(),
  6012. e = CKEDITOR.dtd.$block[e];
  6013. if (this.insertElementIntoRange(a, d)) {
  6014. d.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  6015. if (e)
  6016. if ((e = a.getNext(function(a) { return g(a) && !k(a) })) && e.type == CKEDITOR.NODE_ELEMENT && e.is(CKEDITOR.dtd.$block)) e.getDtd()["#"] ? d.moveToElementEditStart(e) : d.moveToElementEditEnd(a);
  6017. else if (!e && c != CKEDITOR.ENTER_BR) {
  6018. e = d.fixBlock(true, c == CKEDITOR.ENTER_DIV ?
  6019. "div" : "p");
  6020. d.moveToElementEditStart(e)
  6021. }
  6022. }
  6023. b.selectRanges([d]);
  6024. h(this)
  6025. },
  6026. setData: function(a, b) {
  6027. b || (a = this.editor.dataProcessor.toHtml(a));
  6028. this.setHtml(a);
  6029. this.fixInitialSelection();
  6030. if (this.status == "unloaded") this.status = "ready";
  6031. this.editor.fire("dataReady")
  6032. },
  6033. getData: function(a) {
  6034. var b = this.getHtml();
  6035. a || (b = this.editor.dataProcessor.toDataFormat(b));
  6036. return b
  6037. },
  6038. setReadOnly: function(a) { this.setAttribute("contenteditable", !a) },
  6039. detach: function() {
  6040. this.removeClass("cke_editable");
  6041. this.status = "detached";
  6042. var a = this.editor;
  6043. this._.detach();
  6044. delete a.document;
  6045. delete a.window
  6046. },
  6047. isInline: function() { return this.getDocument().equals(CKEDITOR.document) },
  6048. fixInitialSelection: function() {
  6049. function a() {
  6050. var b = c.getDocument().$,
  6051. d = b.getSelection(),
  6052. f;
  6053. if (d.anchorNode && d.anchorNode == c.$) f = true;
  6054. else if (CKEDITOR.env.webkit) {
  6055. var g = c.getDocument().getActive();
  6056. g && (g.equals(c) && !d.anchorNode) && (f = true)
  6057. }
  6058. if (f) {
  6059. f = new CKEDITOR.dom.range(c);
  6060. f.moveToElementEditStart(c);
  6061. b = b.createRange();
  6062. b.setStart(f.startContainer.$, f.startOffset);
  6063. b.collapse(true);
  6064. d.removeAllRanges();
  6065. d.addRange(b)
  6066. }
  6067. }
  6068. function b() {
  6069. var a = c.getDocument().$,
  6070. d = a.selection,
  6071. f = c.getDocument().getActive();
  6072. if (d.type == "None" && f.equals(c)) {
  6073. d = new CKEDITOR.dom.range(c);
  6074. a = a.body.createTextRange();
  6075. d.moveToElementEditStart(c);
  6076. d = d.startContainer;
  6077. d.type != CKEDITOR.NODE_ELEMENT && (d = d.getParent());
  6078. a.moveToElementText(d.$);
  6079. a.collapse(true);
  6080. a.select()
  6081. }
  6082. }
  6083. var c = this;
  6084. if (CKEDITOR.env.ie && (CKEDITOR.env.version < 9 || CKEDITOR.env.quirks)) {
  6085. if (this.hasFocus) {
  6086. this.focus();
  6087. b()
  6088. }
  6089. } else if (this.hasFocus) {
  6090. this.focus();
  6091. a()
  6092. } else this.once("focus", function() { a() }, null, null, -999)
  6093. },
  6094. setup: function() {
  6095. var a = this.editor;
  6096. this.attachListener(a, "beforeGetData", function() {
  6097. var b = this.getData();
  6098. this.is("textarea") || a.config.ignoreEmptyParagraph !== false && (b = b.replace(n, function(a, b) { return b }));
  6099. a.setData(b, null, 1)
  6100. }, this);
  6101. this.attachListener(a, "getSnapshot", function(a) { a.data = this.getData(1) }, this);
  6102. this.attachListener(a, "afterSetData", function() { this.setData(a.getData(1)) }, this);
  6103. this.attachListener(a, "loadSnapshot", function(a) {
  6104. this.setData(a.data,
  6105. 1)
  6106. }, this);
  6107. this.attachListener(a, "beforeFocus", function() {
  6108. var b = a.getSelection();
  6109. (b = b && b.getNative()) && b.type == "Control" || this.focus()
  6110. }, this);
  6111. this.attachListener(a, "insertHtml", function(a) { this.insertHtml(a.data.dataValue, a.data.mode) }, this);
  6112. this.attachListener(a, "insertElement", function(a) { this.insertElement(a.data) }, this);
  6113. this.attachListener(a, "insertText", function(a) { this.insertText(a.data) }, this);
  6114. this.setReadOnly(a.readOnly);
  6115. this.attachClass("cke_editable");
  6116. this.attachClass(a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ?
  6117. "cke_editable_inline" : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE || a.elementMode == CKEDITOR.ELEMENT_MODE_APPENDTO ? "cke_editable_themed" : "");
  6118. this.attachClass("cke_contents_" + a.config.contentsLangDirection);
  6119. a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly;
  6120. a.keystrokeHandler.attach(this);
  6121. this.on("blur", function() { this.hasFocus = false }, null, null, -1);
  6122. this.on("focus", function() { this.hasFocus = true }, null, null, -1);
  6123. a.focusManager.add(this);
  6124. if (this.equals(CKEDITOR.document.getActive())) {
  6125. this.hasFocus = true;
  6126. a.once("contentDom", function() { a.focusManager.focus(this) }, this)
  6127. }
  6128. this.isInline() && this.changeAttr("tabindex", a.tabIndex);
  6129. if (!this.is("textarea")) {
  6130. a.document = this.getDocument();
  6131. a.window = this.getWindow();
  6132. var c = a.document;
  6133. this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker);
  6134. var f = a.config.contentsLangDirection;
  6135. this.getDirection(1) != f && this.changeAttr("dir", f);
  6136. var e = CKEDITOR.getCss();
  6137. if (e) {
  6138. f = c.getHead();
  6139. if (!f.getCustomData("stylesheet")) {
  6140. e = c.appendStyleText(e);
  6141. e = new CKEDITOR.dom.element(e.ownerNode ||
  6142. e.owningElement);
  6143. f.setCustomData("stylesheet", e);
  6144. e.data("cke-temp", 1)
  6145. }
  6146. }
  6147. f = c.getCustomData("stylesheet_ref") || 0;
  6148. c.setCustomData("stylesheet_ref", f + 1);
  6149. this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling);
  6150. this.attachListener(this, "click", function(a) {
  6151. var a = a.data,
  6152. b = (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a");
  6153. b && (a.$.button != 2 && b.isReadOnly()) && a.preventDefault()
  6154. });
  6155. var h = { 8: 1, 46: 1 };
  6156. this.attachListener(a, "key", function(b) {
  6157. if (a.readOnly) return true;
  6158. var c = b.data.domEvent.getKey(),
  6159. f;
  6160. if (c in h) {
  6161. var b = a.getSelection(),
  6162. e, g = b.getRanges()[0],
  6163. i = g.startPath(),
  6164. j, k, t, c = c == 8;
  6165. if (CKEDITOR.env.ie && CKEDITOR.env.version < 11 && (e = b.getSelectedElement()) || (e = d(b))) {
  6166. a.fire("saveSnapshot");
  6167. g.moveToPosition(e, CKEDITOR.POSITION_BEFORE_START);
  6168. e.remove();
  6169. g.select();
  6170. a.fire("saveSnapshot");
  6171. f = 1
  6172. } else if (g.collapsed)
  6173. if ((j = i.block) && (t = j[c ? "getPrevious" : "getNext"](o)) && t.type == CKEDITOR.NODE_ELEMENT && t.is("table") && g[c ? "checkStartOfBlock" : "checkEndOfBlock"]()) {
  6174. a.fire("saveSnapshot");
  6175. g[c ? "checkEndOfBlock" :
  6176. "checkStartOfBlock"]() && j.remove();
  6177. g["moveToElementEdit" + (c ? "End" : "Start")](t);
  6178. g.select();
  6179. a.fire("saveSnapshot");
  6180. f = 1
  6181. } else if (i.blockLimit && i.blockLimit.is("td") && (k = i.blockLimit.getAscendant("table")) && g.checkBoundaryOfElement(k, c ? CKEDITOR.START : CKEDITOR.END) && (t = k[c ? "getPrevious" : "getNext"](o))) {
  6182. a.fire("saveSnapshot");
  6183. g["moveToElementEdit" + (c ? "End" : "Start")](t);
  6184. g.checkStartOfBlock() && g.checkEndOfBlock() ? t.remove() : g.select();
  6185. a.fire("saveSnapshot");
  6186. f = 1
  6187. } else if ((k = i.contains(["td", "th", "caption"])) &&
  6188. g.checkBoundaryOfElement(k, c ? CKEDITOR.START : CKEDITOR.END)) f = 1
  6189. }
  6190. return !f
  6191. });
  6192. a.blockless && (CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller) && this.attachListener(this, "keyup", function(b) {
  6193. if (b.data.getKeystroke() in h && !this.getFirst(g)) {
  6194. this.appendBogus();
  6195. b = a.createRange();
  6196. b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START);
  6197. b.select()
  6198. }
  6199. });
  6200. this.attachListener(this, "dblclick", function(b) {
  6201. if (a.readOnly) return false;
  6202. b = { element: b.data.getTarget() };
  6203. a.fire("doubleclick", b)
  6204. });
  6205. CKEDITOR.env.ie && this.attachListener(this,
  6206. "click", b);
  6207. CKEDITOR.env.ie || this.attachListener(this, "mousedown", function(b) {
  6208. var c = b.data.getTarget();
  6209. if (c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly()) {
  6210. a.getSelection().selectElement(c);
  6211. c.is("input", "textarea", "select") && b.data.preventDefault()
  6212. }
  6213. });
  6214. CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(b) {
  6215. if (b.data.$.button == 2) {
  6216. b = b.data.getTarget();
  6217. if (!b.getOuterHtml().replace(n, "")) {
  6218. var c = a.createRange();
  6219. c.moveToElementEditStart(b);
  6220. c.select(true)
  6221. }
  6222. }
  6223. });
  6224. if (CKEDITOR.env.webkit) {
  6225. this.attachListener(this,
  6226. "click",
  6227. function(a) { a.data.getTarget().is("input", "select") && a.data.preventDefault() });
  6228. this.attachListener(this, "mouseup", function(a) { a.data.getTarget().is("input", "textarea") && a.data.preventDefault() })
  6229. }
  6230. CKEDITOR.env.webkit && this.attachListener(a, "key", function(b) {
  6231. b = b.data.domEvent.getKey();
  6232. if (b in h) {
  6233. var c = b == 8,
  6234. d = a.getSelection().getRanges()[0],
  6235. b = d.startPath();
  6236. if (d.collapsed) {
  6237. var f;
  6238. a: {
  6239. var g = b.block;
  6240. if (g)
  6241. if (d[c ? "checkStartOfBlock" : "checkEndOfBlock"]())
  6242. if (!d.moveToClosestEditablePosition(g, !c) || !d.collapsed) f =
  6243. false;
  6244. else {
  6245. if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) {
  6246. var e = d.startContainer.getChild(d.startOffset - (c ? 1 : 0));
  6247. if (e && e.type == CKEDITOR.NODE_ELEMENT && e.is("hr")) {
  6248. a.fire("saveSnapshot");
  6249. e.remove();
  6250. f = true;
  6251. break a
  6252. }
  6253. }
  6254. if ((d = d.startPath().block) && (!d || !d.contains(g))) {
  6255. a.fire("saveSnapshot");
  6256. var j;
  6257. (j = (c ? d : g).getBogus()) && j.remove();
  6258. f = a.getSelection();
  6259. j = f.createBookmarks();
  6260. (c ? g : d).moveChildren(c ? d : g, false);
  6261. b.lastElement.mergeSiblings();
  6262. i(g, d, !c);
  6263. f.selectBookmarks(j);
  6264. f = true
  6265. }
  6266. }
  6267. else f = false;
  6268. else f = false
  6269. }
  6270. if (!f) return
  6271. } else {
  6272. c =
  6273. d;
  6274. f = b.block;
  6275. j = c.endPath().block;
  6276. if (!f || !j || f.equals(j)) b = false;
  6277. else {
  6278. a.fire("saveSnapshot");
  6279. (g = f.getBogus()) && g.remove();
  6280. c.deleteContents();
  6281. if (j.getParent()) {
  6282. j.moveChildren(f, false);
  6283. b.lastElement.mergeSiblings();
  6284. i(f, j, true)
  6285. }
  6286. c = a.getSelection().getRanges()[0];
  6287. c.collapse(1);
  6288. c.select();
  6289. b = true
  6290. }
  6291. if (!b) return
  6292. }
  6293. a.getSelection().scrollIntoView();
  6294. a.fire("saveSnapshot");
  6295. return false
  6296. }
  6297. }, this, null, 100)
  6298. }
  6299. }
  6300. },
  6301. _: {
  6302. detach: function() {
  6303. this.editor.setData(this.editor.getData(), 0, 1);
  6304. this.clearListeners();
  6305. this.restoreAttrs();
  6306. var a;
  6307. if (a = this.removeCustomData("classes"))
  6308. for (; a.length;) this.removeClass(a.pop());
  6309. if (!this.is("textarea")) {
  6310. a = this.getDocument();
  6311. var b = a.getHead();
  6312. if (b.getCustomData("stylesheet")) {
  6313. var c = a.getCustomData("stylesheet_ref");
  6314. if (--c) a.setCustomData("stylesheet_ref", c);
  6315. else {
  6316. a.removeCustomData("stylesheet_ref");
  6317. b.removeCustomData("stylesheet").remove()
  6318. }
  6319. }
  6320. }
  6321. this.editor.fire("contentDomUnload");
  6322. delete this.editor
  6323. }
  6324. }
  6325. });
  6326. CKEDITOR.editor.prototype.editable = function(a) {
  6327. var b = this._.editable;
  6328. if (b && a) return 0;
  6329. if (arguments.length) b =
  6330. this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null);
  6331. return b
  6332. };
  6333. var k = CKEDITOR.dom.walker.bogus(),
  6334. n = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,
  6335. o = CKEDITOR.dom.walker.whitespaces(true),
  6336. q = CKEDITOR.dom.walker.bookmark(false, true);
  6337. CKEDITOR.on("instanceLoaded", function(b) {
  6338. var c = b.editor;
  6339. c.on("insertElement", function(a) {
  6340. a = a.data;
  6341. if (a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") ||
  6342. a.is("textarea"))) {
  6343. a.getAttribute("contentEditable") != "false" && a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1");
  6344. a.setAttribute("contentEditable", false)
  6345. }
  6346. });
  6347. c.on("selectionChange", function(b) {
  6348. if (!c.readOnly) {
  6349. var d = c.getSelection();
  6350. if (d && !d.isLocked) {
  6351. d = c.checkDirty();
  6352. c.fire("lockSnapshot");
  6353. a(b);
  6354. c.fire("unlockSnapshot");
  6355. !d && c.resetDirty()
  6356. }
  6357. }
  6358. })
  6359. });
  6360. CKEDITOR.on("instanceCreated", function(a) {
  6361. var b = a.editor;
  6362. b.on("mode", function() {
  6363. var a = b.editable();
  6364. if (a && a.isInline()) {
  6365. var c = b.title;
  6366. a.changeAttr("role",
  6367. "textbox");
  6368. a.changeAttr("aria-label", c);
  6369. c && a.changeAttr("title", c);
  6370. var d = b.fire("ariaEditorHelpLabel", {}).label;
  6371. if (d)
  6372. if (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents")) {
  6373. var f = CKEDITOR.tools.getNextId(),
  6374. d = CKEDITOR.dom.element.createFromHtml('<span id="' + f + '" class="cke_voice_label">' + d + "</span>");
  6375. c.append(d);
  6376. a.changeAttr("aria-describedby", f)
  6377. }
  6378. }
  6379. })
  6380. });
  6381. CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
  6382. var m = function() {
  6383. function a(b) { return b.type == CKEDITOR.NODE_ELEMENT }
  6384. function b(c, d) {
  6385. var f, g, e, h, j = [],
  6386. k = d.range.startContainer;
  6387. f = d.range.startPath();
  6388. for (var k = i[k.getName()], m = 0, n = c.getChildren(), w = n.count(), s = -1, x = -1, l = 0, r = f.contains(i.$list); m < w; ++m) {
  6389. f = n.getItem(m);
  6390. if (a(f)) {
  6391. e = f.getName();
  6392. if (r && e in CKEDITOR.dtd.$list) j = j.concat(b(f, d));
  6393. else {
  6394. h = !!k[e];
  6395. if (e == "br" && f.data("cke-eol") && (!m || m == w - 1)) {
  6396. l = (g = m ? j[m - 1].node : n.getItem(m + 1)) && (!a(g) || !g.is("br"));
  6397. g = g && a(g) && i.$block[g.getName()]
  6398. }
  6399. s == -1 && !h && (s =
  6400. m);
  6401. h || (x = m);
  6402. j.push({ isElement: 1, isLineBreak: l, isBlock: f.isBlockBoundary(), hasBlockSibling: g, node: f, name: e, allowed: h });
  6403. g = l = 0
  6404. }
  6405. } else j.push({ isElement: 0, node: f, allowed: 1 })
  6406. }
  6407. if (s > -1) j[s].firstNotAllowed = 1;
  6408. if (x > -1) j[x].lastNotAllowed = 1;
  6409. return j
  6410. }
  6411. function c(b, d) {
  6412. var f = [],
  6413. g = b.getChildren(),
  6414. e = g.count(),
  6415. h, j = 0,
  6416. k = i[d],
  6417. m = !b.is(i.$inline) || b.is("br");
  6418. for (m && f.push(" "); j < e; j++) {
  6419. h = g.getItem(j);
  6420. a(h) && !h.is(k) ? f = f.concat(c(h, d)) : f.push(h)
  6421. }
  6422. m && f.push(" ");
  6423. return f
  6424. }
  6425. function d(b) {
  6426. return b && a(b) && (b.is(i.$removeEmpty) ||
  6427. b.is("a") && !b.isBlockBoundary())
  6428. }
  6429. function f(b, c, d, g) {
  6430. var e = b.clone(),
  6431. h, j;
  6432. e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  6433. if ((h = (new CKEDITOR.dom.walker(e)).next()) && a(h) && k[h.getName()] && (j = h.getPrevious()) && a(j) && !j.getParent().equals(b.startContainer) && d.contains(j) && g.contains(h) && h.isIdentical(j)) {
  6434. h.moveChildren(j);
  6435. h.remove();
  6436. f(b, c, d, g)
  6437. }
  6438. }
  6439. function e(b, c) {
  6440. function d(b, c) { if (c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) { b.remove(); return 1 } }
  6441. var f = c.endContainer.getChild(c.endOffset),
  6442. g = c.endContainer.getChild(c.endOffset -
  6443. 1);
  6444. f && d(f, b[b.length - 1]);
  6445. if (g && d(g, b[0])) {
  6446. c.setEnd(c.endContainer, c.endOffset - 1);
  6447. c.collapse()
  6448. }
  6449. }
  6450. var i = CKEDITOR.dtd,
  6451. k = { p: 1, div: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, ul: 1, ol: 1, li: 1, pre: 1, dl: 1, blockquote: 1 },
  6452. m = { p: 1, div: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1 },
  6453. n = CKEDITOR.tools.extend({}, i.$inline);
  6454. delete n.br;
  6455. return function(k, l, r) {
  6456. var q = k.editor,
  6457. o = q.getSelection().getRanges()[0],
  6458. C = false;
  6459. if (l == "unfiltered_html") {
  6460. l = "html";
  6461. C = true
  6462. }
  6463. if (!o.checkReadOnly()) {
  6464. var F = (new CKEDITOR.dom.elementPath(o.startContainer, o.root)).blockLimit ||
  6465. o.root,
  6466. l = { type: l, dontFilter: C, editable: k, editor: q, range: o, blockLimit: F, mergeCandidates: [], zombies: [] },
  6467. q = l.range,
  6468. C = l.mergeCandidates,
  6469. E, I, L, H;
  6470. if (l.type == "text" && q.shrink(CKEDITOR.SHRINK_ELEMENT, true, false)) {
  6471. E = CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", q.document);
  6472. q.insertNode(E);
  6473. q.setStartAfter(E)
  6474. }
  6475. I = new CKEDITOR.dom.elementPath(q.startContainer);
  6476. l.endPath = L = new CKEDITOR.dom.elementPath(q.endContainer);
  6477. if (!q.collapsed) {
  6478. var F = L.block || L.blockLimit,
  6479. Q = q.getCommonAncestor();
  6480. F && (!F.equals(Q) &&
  6481. !F.contains(Q) && q.checkEndOfBlock()) && l.zombies.push(F);
  6482. q.deleteContents()
  6483. }
  6484. for (;
  6485. (H = a(q.startContainer) && q.startContainer.getChild(q.startOffset - 1)) && a(H) && H.isBlockBoundary() && I.contains(H);) q.moveToPosition(H, CKEDITOR.POSITION_BEFORE_END);
  6486. f(q, l.blockLimit, I, L);
  6487. if (E) {
  6488. q.setEndBefore(E);
  6489. q.collapse();
  6490. E.remove()
  6491. }
  6492. E = q.startPath();
  6493. if (F = E.contains(d, false, 1)) {
  6494. q.splitElement(F);
  6495. l.inlineStylesRoot = F;
  6496. l.inlineStylesPeak = E.lastElement
  6497. }
  6498. E = q.createBookmark();
  6499. (F = E.startNode.getPrevious(g)) && a(F) && d(F) && C.push(F);
  6500. (F = E.startNode.getNext(g)) && a(F) && d(F) && C.push(F);
  6501. for (F = E.startNode;
  6502. (F = F.getParent()) && d(F);) C.push(F);
  6503. q.moveToBookmark(E);
  6504. if (E = r) {
  6505. E = l.range;
  6506. if (l.type == "text" && l.inlineStylesRoot) {
  6507. H = l.inlineStylesPeak;
  6508. q = H.getDocument().createText("{cke-peak}");
  6509. for (C = l.inlineStylesRoot.getParent(); !H.equals(C);) {
  6510. q = q.appendTo(H.clone());
  6511. H = H.getParent()
  6512. }
  6513. r = q.getOuterHtml().split("{cke-peak}").join(r)
  6514. }
  6515. H = l.blockLimit.getName();
  6516. if (/^\s+|\s+$/.test(r) && "span" in CKEDITOR.dtd[H]) var O = '<span data-cke-marker="1">&nbsp;</span>',
  6517. r = O + r + O;
  6518. r = l.editor.dataProcessor.toHtml(r, { context: null, fixForBody: false, dontFilter: l.dontFilter, filter: l.editor.activeFilter, enterMode: l.editor.activeEnterMode });
  6519. H = E.document.createElement("body");
  6520. H.setHtml(r);
  6521. if (O) {
  6522. H.getFirst().remove();
  6523. H.getLast().remove()
  6524. }
  6525. if ((O = E.startPath().block) && !(O.getChildCount() == 1 && O.getBogus())) a: {
  6526. var M;
  6527. if (H.getChildCount() == 1 && a(M = H.getFirst()) && M.is(m)) {
  6528. O = M.getElementsByTag("*");
  6529. E = 0;
  6530. for (C = O.count(); E < C; E++) { q = O.getItem(E); if (!q.is(n)) break a }
  6531. M.moveChildren(M.getParent(1));
  6532. M.remove()
  6533. }
  6534. }
  6535. l.dataWrapper = H;
  6536. E = r
  6537. }
  6538. if (E) {
  6539. M = l.range;
  6540. var O = M.document,
  6541. K, r = l.blockLimit;
  6542. E = 0;
  6543. var R;
  6544. H = [];
  6545. var N, T, C = q = 0,
  6546. P, V;
  6547. I = M.startContainer;
  6548. var F = l.endPath.elements[0],
  6549. W;
  6550. L = F.getPosition(I);
  6551. Q = !!F.getCommonAncestor(I) && L != CKEDITOR.POSITION_IDENTICAL && !(L & CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED);
  6552. I = b(l.dataWrapper, l);
  6553. for (e(I, M); E < I.length; E++) {
  6554. L = I[E];
  6555. if (K = L.isLineBreak) {
  6556. K = M;
  6557. P = r;
  6558. var S = void 0,
  6559. Y = void 0;
  6560. if (L.hasBlockSibling) K = 1;
  6561. else {
  6562. S = K.startContainer.getAscendant(i.$block, 1);
  6563. if (!S || !S.is({
  6564. div: 1,
  6565. p: 1
  6566. })) K = 0;
  6567. else {
  6568. Y = S.getPosition(P);
  6569. if (Y == CKEDITOR.POSITION_IDENTICAL || Y == CKEDITOR.POSITION_CONTAINS) K = 0;
  6570. else {
  6571. P = K.splitElement(S);
  6572. K.moveToPosition(P, CKEDITOR.POSITION_AFTER_START);
  6573. K = 1
  6574. }
  6575. }
  6576. }
  6577. }
  6578. if (K) C = E > 0;
  6579. else {
  6580. K = M.startPath();
  6581. if (!L.isBlock && j(l.editor, K.block, K.blockLimit) && (T = l.editor.activeEnterMode != CKEDITOR.ENTER_BR && l.editor.config.autoParagraph !== false ? l.editor.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : false)) {
  6582. T = O.createElement(T);
  6583. T.appendBogus();
  6584. M.insertNode(T);
  6585. CKEDITOR.env.needsBrFiller && (R = T.getBogus()) &&
  6586. R.remove();
  6587. M.moveToPosition(T, CKEDITOR.POSITION_BEFORE_END)
  6588. }
  6589. if ((K = M.startPath().block) && !K.equals(N)) {
  6590. if (R = K.getBogus()) {
  6591. R.remove();
  6592. H.push(K)
  6593. }
  6594. N = K
  6595. }
  6596. L.firstNotAllowed && (q = 1);
  6597. if (q && L.isElement) {
  6598. K = M.startContainer;
  6599. for (P = null; K && !i[K.getName()][L.name];) {
  6600. if (K.equals(r)) { K = null; break }
  6601. P = K;
  6602. K = K.getParent()
  6603. }
  6604. if (K) {
  6605. if (P) {
  6606. V = M.splitElement(P);
  6607. l.zombies.push(V);
  6608. l.zombies.push(P)
  6609. }
  6610. } else {
  6611. P = r.getName();
  6612. W = !E;
  6613. K = E == I.length - 1;
  6614. P = c(L.node, P);
  6615. for (var S = [], Y = P.length, Z = 0, ba = void 0, X = 0, aa = -1; Z < Y; Z++) {
  6616. ba = P[Z];
  6617. if (ba == " ") {
  6618. if (!X &&
  6619. (!W || Z)) {
  6620. S.push(new CKEDITOR.dom.text(" "));
  6621. aa = S.length
  6622. }
  6623. X = 1
  6624. } else {
  6625. S.push(ba);
  6626. X = 0
  6627. }
  6628. }
  6629. K && aa == S.length && S.pop();
  6630. W = S
  6631. }
  6632. }
  6633. if (W) {
  6634. for (; K = W.pop();) M.insertNode(K);
  6635. W = 0
  6636. } else M.insertNode(L.node);
  6637. if (L.lastNotAllowed && E < I.length - 1) {
  6638. (V = Q ? F : V) && M.setEndAt(V, CKEDITOR.POSITION_AFTER_START);
  6639. q = 0
  6640. }
  6641. M.collapse()
  6642. }
  6643. }
  6644. l.dontMoveCaret = C;
  6645. l.bogusNeededBlocks = H
  6646. }
  6647. R = l.range;
  6648. var U;
  6649. V = l.bogusNeededBlocks;
  6650. for (W = R.createBookmark(); N = l.zombies.pop();)
  6651. if (N.getParent()) {
  6652. T = R.clone();
  6653. T.moveToElementEditStart(N);
  6654. T.removeEmptyBlocksAtEnd()
  6655. }
  6656. if (V)
  6657. for (; N =
  6658. V.pop();) CKEDITOR.env.needsBrFiller ? N.appendBogus() : N.append(R.document.createText(" "));
  6659. for (; N = l.mergeCandidates.pop();) N.mergeSiblings();
  6660. R.moveToBookmark(W);
  6661. if (!l.dontMoveCaret) {
  6662. for (N = a(R.startContainer) && R.startContainer.getChild(R.startOffset - 1); N && a(N) && !N.is(i.$empty);) {
  6663. if (N.isBlockBoundary()) R.moveToPosition(N, CKEDITOR.POSITION_BEFORE_END);
  6664. else {
  6665. if (d(N) && N.getHtml().match(/(\s|&nbsp;)$/g)) { U = null; break }
  6666. U = R.clone();
  6667. U.moveToPosition(N, CKEDITOR.POSITION_BEFORE_END)
  6668. }
  6669. N = N.getLast(g)
  6670. }
  6671. U && R.moveToRange(U)
  6672. }
  6673. o.select();
  6674. h(k)
  6675. }
  6676. }
  6677. }(),
  6678. l = function() {
  6679. function a(b) {
  6680. b = new CKEDITOR.dom.walker(b);
  6681. b.guard = function(a, b) { if (b) return false; if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent) };
  6682. b.evaluator = function(a) { return a.type == CKEDITOR.NODE_ELEMENT };
  6683. return b
  6684. }
  6685. function b(a, c, d) {
  6686. c = a.getDocument().createElement(c);
  6687. a.append(c, d);
  6688. return c
  6689. }
  6690. function c(a) {
  6691. var b = a.count(),
  6692. d;
  6693. for (b; b-- > 0;) {
  6694. d = a.getItem(b);
  6695. if (!CKEDITOR.tools.trim(d.getHtml())) {
  6696. d.appendBogus();
  6697. CKEDITOR.env.ie && (CKEDITOR.env.version < 9 && d.getChildCount()) &&
  6698. d.getFirst().remove()
  6699. }
  6700. }
  6701. }
  6702. return function(d) {
  6703. var f = d.startContainer,
  6704. g = f.getAscendant("table", 1),
  6705. e = false;
  6706. c(g.getElementsByTag("td"));
  6707. c(g.getElementsByTag("th"));
  6708. g = d.clone();
  6709. g.setStart(f, 0);
  6710. g = a(g).lastBackward();
  6711. if (!g) {
  6712. g = d.clone();
  6713. g.setEndAt(f, CKEDITOR.POSITION_BEFORE_END);
  6714. g = a(g).lastForward();
  6715. e = true
  6716. }
  6717. g || (g = f);
  6718. if (g.is("table")) {
  6719. d.setStartAt(g, CKEDITOR.POSITION_BEFORE_START);
  6720. d.collapse(true);
  6721. g.remove()
  6722. } else {
  6723. g.is({ tbody: 1, thead: 1, tfoot: 1 }) && (g = b(g, "tr", e));
  6724. g.is("tr") && (g = b(g, g.getParent().is("thead") ? "th" :
  6725. "td", e));
  6726. (f = g.getBogus()) && f.remove();
  6727. d.moveToPosition(g, e ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END)
  6728. }
  6729. }
  6730. }()
  6731. }(),
  6732. function() {
  6733. function a() {
  6734. var a = this._.fakeSelection,
  6735. b;
  6736. if (a) {
  6737. b = this.getSelection(1);
  6738. if (!b || !b.isHidden()) {
  6739. a.reset();
  6740. a = 0
  6741. }
  6742. }
  6743. if (!a) { a = b || this.getSelection(1); if (!a || a.getType() == CKEDITOR.SELECTION_NONE) return }
  6744. this.fire("selectionCheck", a);
  6745. b = this.elementPath();
  6746. if (!b.compare(this._.selectionPreviousPath)) {
  6747. if (CKEDITOR.env.webkit) this._.previousActive = this.document.getActive();
  6748. this._.selectionPreviousPath =
  6749. b;
  6750. this.fire("selectionChange", { selection: a, path: b })
  6751. }
  6752. }
  6753. function e() {
  6754. m = true;
  6755. if (!q) {
  6756. b.call(this);
  6757. q = CKEDITOR.tools.setTimeout(b, 200, this)
  6758. }
  6759. }
  6760. function b() {
  6761. q = null;
  6762. if (m) {
  6763. CKEDITOR.tools.setTimeout(a, 0, this);
  6764. m = false
  6765. }
  6766. }
  6767. function g(a) { return l(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? true : false }
  6768. function c(a) {
  6769. function b(c, d) { return !c || c.type == CKEDITOR.NODE_TEXT ? false : a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c) }
  6770. if (!(a.root instanceof CKEDITOR.editable)) return false;
  6771. var c = a.startContainer,
  6772. d = a.getPreviousNode(g, null, c),
  6773. f = a.getNextNode(g, null, c);
  6774. return b(d) || b(f, 1) || !d && !f && !(c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c.getBogus()) ? true : false
  6775. }
  6776. function d(a) { return a.getCustomData("cke-fillingChar") }
  6777. function j(a, b) {
  6778. var c = a && a.removeCustomData("cke-fillingChar");
  6779. if (c) {
  6780. if (b !== false) {
  6781. var d, g = a.getDocument().getSelection().getNative(),
  6782. e = g && g.type != "None" && g.getRangeAt(0);
  6783. if (c.getLength() > 1 && e && e.intersectsNode(c.$)) {
  6784. d = h(g);
  6785. e = g.focusNode == c.$ && g.focusOffset > 0;
  6786. g.anchorNode == c.$ && g.anchorOffset >
  6787. 0 && d[0].offset--;
  6788. e && d[1].offset--
  6789. }
  6790. }
  6791. c.setText(f(c.getText()));
  6792. d && i(a.getDocument().$, d)
  6793. }
  6794. }
  6795. function f(a) { return a.replace(/\u200B( )?/g, function(a) { return a[1] ? " " : "" }) }
  6796. function h(a) { return [{ node: a.anchorNode, offset: a.anchorOffset }, { node: a.focusNode, offset: a.focusOffset }] }
  6797. function i(a, b) {
  6798. var c = a.getSelection(),
  6799. d = a.createRange();
  6800. d.setStart(b[0].node, b[0].offset);
  6801. d.collapse(true);
  6802. c.removeAllRanges();
  6803. c.addRange(d);
  6804. c.extend(b[1].node, b[1].offset)
  6805. }
  6806. function k(a) {
  6807. var b = CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="' +
  6808. (CKEDITOR.env.ie ? "display:none" : "position:fixed;top:0;left:-1000px") + '">&nbsp;</div>', a.document);
  6809. a.fire("lockSnapshot");
  6810. a.editable().append(b);
  6811. var c = a.getSelection(1),
  6812. d = a.createRange(),
  6813. f = c.root.on("selectionchange", function(a) { a.cancel() }, null, null, 0);
  6814. d.setStartAt(b, CKEDITOR.POSITION_AFTER_START);
  6815. d.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
  6816. c.selectRanges([d]);
  6817. f.removeListener();
  6818. a.fire("unlockSnapshot");
  6819. a._.hiddenSelectionContainer = b
  6820. }
  6821. function n(a) {
  6822. var b = { 37: 1, 39: 1, 8: 1, 46: 1 };
  6823. return function(c) {
  6824. var d =
  6825. c.data.getKeystroke();
  6826. if (b[d]) {
  6827. var f = a.getSelection().getRanges(),
  6828. g = f[0];
  6829. if (f.length == 1 && g.collapsed)
  6830. if ((d = g[d < 38 ? "getPreviousEditableNode" : "getNextEditableNode"]()) && d.type == CKEDITOR.NODE_ELEMENT && d.getAttribute("contenteditable") == "false") {
  6831. a.getSelection().fake(d);
  6832. c.data.preventDefault();
  6833. c.cancel()
  6834. }
  6835. }
  6836. }
  6837. }
  6838. function o(a) {
  6839. for (var b = 0; b < a.length; b++) {
  6840. var c = a[b];
  6841. c.getCommonAncestor().isReadOnly() && a.splice(b, 1);
  6842. if (!c.collapsed) {
  6843. if (c.startContainer.isReadOnly())
  6844. for (var d = c.startContainer, f; d;) {
  6845. if ((f = d.type ==
  6846. CKEDITOR.NODE_ELEMENT) && d.is("body") || !d.isReadOnly()) break;
  6847. f && d.getAttribute("contentEditable") == "false" && c.setStartAfter(d);
  6848. d = d.getParent()
  6849. }
  6850. d = c.startContainer;
  6851. f = c.endContainer;
  6852. var g = c.startOffset,
  6853. e = c.endOffset,
  6854. h = c.clone();
  6855. d && d.type == CKEDITOR.NODE_TEXT && (g >= d.getLength() ? h.setStartAfter(d) : h.setStartBefore(d));
  6856. f && f.type == CKEDITOR.NODE_TEXT && (e ? h.setEndAfter(f) : h.setEndBefore(f));
  6857. d = new CKEDITOR.dom.walker(h);
  6858. d.evaluator = function(d) {
  6859. if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) {
  6860. var f = c.clone();
  6861. c.setEndBefore(d);
  6862. c.collapsed && a.splice(b--, 1);
  6863. if (!(d.getPosition(h.endContainer) & CKEDITOR.POSITION_CONTAINS)) {
  6864. f.setStartAfter(d);
  6865. f.collapsed || a.splice(b + 1, 0, f)
  6866. }
  6867. return true
  6868. }
  6869. return false
  6870. };
  6871. d.next()
  6872. }
  6873. }
  6874. return a
  6875. }
  6876. var q, m, l = CKEDITOR.dom.walker.invisible(1),
  6877. p = function() {
  6878. function a(b) {
  6879. return function(a) {
  6880. var c = a.editor.createRange();
  6881. c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
  6882. return false
  6883. }
  6884. }
  6885. function b(a) {
  6886. return function(b) {
  6887. var c = b.editor,
  6888. d = c.createRange(),
  6889. f;
  6890. if (!(f =
  6891. d.moveToClosestEditablePosition(b.selected, a))) f = d.moveToClosestEditablePosition(b.selected, !a);
  6892. f && c.getSelection().selectRanges([d]);
  6893. c.fire("saveSnapshot");
  6894. b.selected.remove();
  6895. if (!f) {
  6896. d.moveToElementEditablePosition(c.editable());
  6897. c.getSelection().selectRanges([d])
  6898. }
  6899. c.fire("saveSnapshot");
  6900. return false
  6901. }
  6902. }
  6903. var c = a(),
  6904. d = a(1);
  6905. return { 37: c, 38: c, 39: d, 40: d, 8: b(), 46: b(1) }
  6906. }();
  6907. CKEDITOR.on("instanceCreated", function(b) {
  6908. function c() {
  6909. var a = d.getSelection();
  6910. a && a.removeAllRanges()
  6911. }
  6912. var d = b.editor;
  6913. d.on("contentDom", function() {
  6914. function b() {
  6915. p =
  6916. new CKEDITOR.dom.selection(d.getSelection());
  6917. p.lock()
  6918. }
  6919. function c() {
  6920. g.removeListener("mouseup", c);
  6921. k.removeListener("mouseup", c);
  6922. var a = CKEDITOR.document.$.selection,
  6923. b = a.createRange();
  6924. a.type != "None" && b.parentElement().ownerDocument == f.$ && b.select()
  6925. }
  6926. var f = d.document,
  6927. g = CKEDITOR.document,
  6928. h = d.editable(),
  6929. i = f.getBody(),
  6930. k = f.getDocumentElement(),
  6931. m = h.isInline(),
  6932. C, p;
  6933. CKEDITOR.env.gecko && h.attachListener(h, "focus", function(a) {
  6934. a.removeListener();
  6935. if (C !== 0)
  6936. if ((a = d.getSelection().getNative()) && a.isCollapsed && a.anchorNode ==
  6937. h.$) {
  6938. a = d.createRange();
  6939. a.moveToElementEditStart(h);
  6940. a.select()
  6941. }
  6942. }, null, null, -2);
  6943. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  6944. C && CKEDITOR.env.webkit && (C = d._.previousActive && d._.previousActive.equals(f.getActive()));
  6945. d.unlockSelection(C);
  6946. C = 0
  6947. }, null, null, -1);
  6948. h.attachListener(h, "mousedown", function() { C = 0 });
  6949. if (CKEDITOR.env.ie || m) {
  6950. t ? h.attachListener(h, "beforedeactivate", b, null, null, -1) : h.attachListener(d, "selectionCheck", b, null, null, -1);
  6951. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusOut" :
  6952. "blur",
  6953. function() {
  6954. d.lockSelection(p);
  6955. C = 1
  6956. }, null, null, -1);
  6957. h.attachListener(h, "mousedown", function() { C = 0 })
  6958. }
  6959. if (CKEDITOR.env.ie && !m) {
  6960. var s;
  6961. h.attachListener(h, "mousedown", function(a) { if (a.data.$.button == 2) { a = d.document.getSelection(); if (!a || a.getType() == CKEDITOR.SELECTION_NONE) s = d.window.getScrollPosition() } });
  6962. h.attachListener(h, "mouseup", function(a) {
  6963. if (a.data.$.button == 2 && s) {
  6964. d.document.$.documentElement.scrollLeft = s.x;
  6965. d.document.$.documentElement.scrollTop = s.y
  6966. }
  6967. s = null
  6968. });
  6969. if (f.$.compatMode != "BackCompat") {
  6970. if (CKEDITOR.env.ie7Compat ||
  6971. CKEDITOR.env.ie6Compat) k.on("mousedown", function(a) {
  6972. function b(a) {
  6973. a = a.data.$;
  6974. if (d) {
  6975. var c = i.$.createTextRange();
  6976. try { c.moveToPoint(a.clientX, a.clientY) } catch (f) {}
  6977. d.setEndPoint(e.compareEndPoints("StartToStart", c) < 0 ? "EndToEnd" : "StartToStart", c);
  6978. d.select()
  6979. }
  6980. }
  6981. function c() {
  6982. k.removeListener("mousemove", b);
  6983. g.removeListener("mouseup", c);
  6984. k.removeListener("mouseup", c);
  6985. d.select()
  6986. }
  6987. a = a.data;
  6988. if (a.getTarget().is("html") && a.$.y < k.$.clientHeight && a.$.x < k.$.clientWidth) {
  6989. var d = i.$.createTextRange();
  6990. try {
  6991. d.moveToPoint(a.$.clientX,
  6992. a.$.clientY)
  6993. } catch (f) {}
  6994. var e = d.duplicate();
  6995. k.on("mousemove", b);
  6996. g.on("mouseup", c);
  6997. k.on("mouseup", c)
  6998. }
  6999. });
  7000. if (CKEDITOR.env.version > 7 && CKEDITOR.env.version < 11) k.on("mousedown", function(a) {
  7001. if (a.data.getTarget().is("html")) {
  7002. g.on("mouseup", c);
  7003. k.on("mouseup", c)
  7004. }
  7005. })
  7006. }
  7007. }
  7008. h.attachListener(h, "selectionchange", a, d);
  7009. h.attachListener(h, "keyup", e, d);
  7010. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  7011. d.forceNextSelectionCheck();
  7012. d.selectionChange(1)
  7013. });
  7014. if (m && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
  7015. var l;
  7016. h.attachListener(h, "mousedown", function() { l = 1 });
  7017. h.attachListener(f.getDocumentElement(), "mouseup", function() {
  7018. l && e.call(d);
  7019. l = 0
  7020. })
  7021. } else h.attachListener(CKEDITOR.env.ie ? h : f.getDocumentElement(), "mouseup", e, d);
  7022. CKEDITOR.env.webkit && h.attachListener(f, "keydown", function(a) {
  7023. switch (a.data.getKey()) {
  7024. case 13:
  7025. case 33:
  7026. case 34:
  7027. case 35:
  7028. case 36:
  7029. case 37:
  7030. case 39:
  7031. case 8:
  7032. case 45:
  7033. case 46:
  7034. j(h)
  7035. }
  7036. }, null, null, -1);
  7037. h.attachListener(h, "keydown", n(d), null, null, -1)
  7038. });
  7039. d.on("setData", function() {
  7040. d.unlockSelection();
  7041. CKEDITOR.env.webkit &&
  7042. c()
  7043. });
  7044. d.on("contentDomUnload", function() { d.unlockSelection() });
  7045. if (CKEDITOR.env.ie9Compat) d.on("beforeDestroy", c, null, null, 9);
  7046. d.on("dataReady", function() {
  7047. delete d._.fakeSelection;
  7048. delete d._.hiddenSelectionContainer;
  7049. d.selectionChange(1)
  7050. });
  7051. d.on("loadSnapshot", function() {
  7052. var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),
  7053. b = d.editable().getLast(a);
  7054. if (b && b.hasAttribute("data-cke-hidden-sel")) {
  7055. b.remove();
  7056. if (CKEDITOR.env.gecko)(a = d.editable().getFirst(a)) && (a.is("br") && a.getAttribute("_moz_editor_bogus_node")) &&
  7057. a.remove()
  7058. }
  7059. }, null, null, 100);
  7060. d.on("key", function(a) { if (d.mode == "wysiwyg") { var b = d.getSelection(); if (b.isFake) { var c = p[a.data.keyCode]; if (c) return c({ editor: d, selected: b.getSelectedElement(), selection: b, keyEvent: a }) } } })
  7061. });
  7062. CKEDITOR.on("instanceReady", function(a) {
  7063. function b() {
  7064. var a = g.editable();
  7065. if (a)
  7066. if (a = d(a)) {
  7067. var c = g.document.$.getSelection();
  7068. if (c.type != "None" && (c.anchorNode == a.$ || c.focusNode == a.$)) k = h(c);
  7069. e = a.getText();
  7070. a.setText(f(e))
  7071. }
  7072. }
  7073. function c() {
  7074. var a = g.editable();
  7075. if (a)
  7076. if (a = d(a)) {
  7077. a.setText(e);
  7078. if (k) {
  7079. i(g.document.$,
  7080. k);
  7081. k = null
  7082. }
  7083. }
  7084. }
  7085. var g = a.editor,
  7086. e, k;
  7087. if (CKEDITOR.env.webkit) {
  7088. g.on("selectionChange", function() {
  7089. var a = g.editable(),
  7090. b = d(a);
  7091. b && (b.getCustomData("ready") ? j(a) : b.setCustomData("ready", 1))
  7092. }, null, null, -1);
  7093. g.on("beforeSetMode", function() { j(g.editable()) }, null, null, -1);
  7094. g.on("beforeUndoImage", b);
  7095. g.on("afterUndoImage", c);
  7096. g.on("beforeGetData", b, null, null, 0);
  7097. g.on("getData", c)
  7098. }
  7099. });
  7100. CKEDITOR.editor.prototype.selectionChange = function(b) {
  7101. (b ? a : e).call(this)
  7102. };
  7103. CKEDITOR.editor.prototype.getSelection = function(a) {
  7104. if ((this._.savedSelection ||
  7105. this._.fakeSelection) && !a) return this._.savedSelection || this._.fakeSelection;
  7106. return (a = this.editable()) && this.mode == "wysiwyg" ? new CKEDITOR.dom.selection(a) : null
  7107. };
  7108. CKEDITOR.editor.prototype.lockSelection = function(a) {
  7109. a = a || this.getSelection(1);
  7110. if (a.getType() != CKEDITOR.SELECTION_NONE) {
  7111. !a.isLocked && a.lock();
  7112. this._.savedSelection = a;
  7113. return true
  7114. }
  7115. return false
  7116. };
  7117. CKEDITOR.editor.prototype.unlockSelection = function(a) {
  7118. var b = this._.savedSelection;
  7119. if (b) {
  7120. b.unlock(a);
  7121. delete this._.savedSelection;
  7122. return true
  7123. }
  7124. return false
  7125. };
  7126. CKEDITOR.editor.prototype.forceNextSelectionCheck = function() { delete this._.selectionPreviousPath };
  7127. CKEDITOR.dom.document.prototype.getSelection = function() { return new CKEDITOR.dom.selection(this) };
  7128. CKEDITOR.dom.range.prototype.select = function() {
  7129. var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom.selection(this.root);
  7130. a.selectRanges([this]);
  7131. return a
  7132. };
  7133. CKEDITOR.SELECTION_NONE = 1;
  7134. CKEDITOR.SELECTION_TEXT = 2;
  7135. CKEDITOR.SELECTION_ELEMENT = 3;
  7136. var t = typeof window.getSelection !=
  7137. "function",
  7138. s = 1;
  7139. CKEDITOR.dom.selection = function(a) {
  7140. if (a instanceof CKEDITOR.dom.selection) var b = a,
  7141. a = a.root;
  7142. var c = a instanceof CKEDITOR.dom.element;
  7143. this.rev = b ? b.rev : s++;
  7144. this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
  7145. this.root = c ? a : this.document.getBody();
  7146. this.isLocked = 0;
  7147. this._ = { cache: {} };
  7148. if (b) {
  7149. CKEDITOR.tools.extend(this._.cache, b._.cache);
  7150. this.isFake = b.isFake;
  7151. this.isLocked = b.isLocked;
  7152. return this
  7153. }
  7154. var a = this.getNative(),
  7155. d, f;
  7156. if (a)
  7157. if (a.getRangeAt) d = (f = a.rangeCount && a.getRangeAt(0)) &&
  7158. new CKEDITOR.dom.node(f.commonAncestorContainer);
  7159. else {
  7160. try { f = a.createRange() } catch (g) {}
  7161. d = f && CKEDITOR.dom.element.get(f.item && f.item(0) || f.parentElement())
  7162. }
  7163. if (!d || !(d.type == CKEDITOR.NODE_ELEMENT || d.type == CKEDITOR.NODE_TEXT) || !this.root.equals(d) && !this.root.contains(d)) {
  7164. this._.cache.type = CKEDITOR.SELECTION_NONE;
  7165. this._.cache.startElement = null;
  7166. this._.cache.selectedElement = null;
  7167. this._.cache.selectedText = "";
  7168. this._.cache.ranges = new CKEDITOR.dom.rangeList
  7169. }
  7170. return this
  7171. };
  7172. var u = {
  7173. img: 1,
  7174. hr: 1,
  7175. li: 1,
  7176. table: 1,
  7177. tr: 1,
  7178. td: 1,
  7179. th: 1,
  7180. embed: 1,
  7181. object: 1,
  7182. ol: 1,
  7183. ul: 1,
  7184. a: 1,
  7185. input: 1,
  7186. form: 1,
  7187. select: 1,
  7188. textarea: 1,
  7189. button: 1,
  7190. fieldset: 1,
  7191. thead: 1,
  7192. tfoot: 1
  7193. };
  7194. CKEDITOR.dom.selection.prototype = {
  7195. getNative: function() { return this._.cache.nativeSel !== void 0 ? this._.cache.nativeSel : this._.cache.nativeSel = t ? this.document.$.selection : this.document.getWindow().$.getSelection() },
  7196. getType: t ? function() {
  7197. var a = this._.cache;
  7198. if (a.type) return a.type;
  7199. var b = CKEDITOR.SELECTION_NONE;
  7200. try {
  7201. var c = this.getNative(),
  7202. d = c.type;
  7203. if (d == "Text") b = CKEDITOR.SELECTION_TEXT;
  7204. if (d == "Control") b =
  7205. CKEDITOR.SELECTION_ELEMENT;
  7206. if (c.createRange().parentElement()) b = CKEDITOR.SELECTION_TEXT
  7207. } catch (f) {}
  7208. return a.type = b
  7209. } : function() {
  7210. var a = this._.cache;
  7211. if (a.type) return a.type;
  7212. var b = CKEDITOR.SELECTION_TEXT,
  7213. c = this.getNative();
  7214. if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
  7215. else if (c.rangeCount == 1) {
  7216. var c = c.getRangeAt(0),
  7217. d = c.startContainer;
  7218. if (d == c.endContainer && d.nodeType == 1 && c.endOffset - c.startOffset == 1 && u[d.childNodes[c.startOffset].nodeName.toLowerCase()]) b = CKEDITOR.SELECTION_ELEMENT
  7219. }
  7220. return a.type = b
  7221. },
  7222. getRanges: function() {
  7223. var a =
  7224. t ? function() {
  7225. function a(b) { return (new CKEDITOR.dom.node(b)).getIndex() }
  7226. var b = function(b, c) {
  7227. b = b.duplicate();
  7228. b.collapse(c);
  7229. var d = b.parentElement();
  7230. if (!d.hasChildNodes()) return { container: d, offset: 0 };
  7231. for (var f = d.children, g, e, h = b.duplicate(), j = 0, i = f.length - 1, k = -1, m, p; j <= i;) {
  7232. k = Math.floor((j + i) / 2);
  7233. g = f[k];
  7234. h.moveToElementText(g);
  7235. m = h.compareEndPoints("StartToStart", b);
  7236. if (m > 0) i = k - 1;
  7237. else if (m < 0) j = k + 1;
  7238. else return { container: d, offset: a(g) }
  7239. }
  7240. if (k == -1 || k == f.length - 1 && m < 0) {
  7241. h.moveToElementText(d);
  7242. h.setEndPoint("StartToStart",
  7243. b);
  7244. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  7245. f = d.childNodes;
  7246. if (!h) { g = f[f.length - 1]; return g.nodeType != CKEDITOR.NODE_TEXT ? { container: d, offset: f.length } : { container: g, offset: g.nodeValue.length } }
  7247. for (d = f.length; h > 0 && d > 0;) {
  7248. e = f[--d];
  7249. if (e.nodeType == CKEDITOR.NODE_TEXT) {
  7250. p = e;
  7251. h = h - e.nodeValue.length
  7252. }
  7253. }
  7254. return { container: p, offset: -h }
  7255. }
  7256. h.collapse(m > 0 ? true : false);
  7257. h.setEndPoint(m > 0 ? "StartToStart" : "EndToStart", b);
  7258. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  7259. if (!h) return { container: d, offset: a(g) + (m > 0 ? 0 : 1) };
  7260. for (; h > 0;) try {
  7261. e =
  7262. g[m > 0 ? "previousSibling" : "nextSibling"];
  7263. if (e.nodeType == CKEDITOR.NODE_TEXT) {
  7264. h = h - e.nodeValue.length;
  7265. p = e
  7266. }
  7267. g = e
  7268. } catch (t) { return { container: d, offset: a(g) } }
  7269. return { container: p, offset: m > 0 ? -h : p.nodeValue.length + h }
  7270. };
  7271. return function() {
  7272. var a = this.getNative(),
  7273. c = a && a.createRange(),
  7274. d = this.getType();
  7275. if (!a) return [];
  7276. if (d == CKEDITOR.SELECTION_TEXT) {
  7277. a = new CKEDITOR.dom.range(this.root);
  7278. d = b(c, true);
  7279. a.setStart(new CKEDITOR.dom.node(d.container), d.offset);
  7280. d = b(c);
  7281. a.setEnd(new CKEDITOR.dom.node(d.container), d.offset);
  7282. a.endContainer.getPosition(a.startContainer) &
  7283. CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer.getIndex() && a.collapse();
  7284. return [a]
  7285. }
  7286. if (d == CKEDITOR.SELECTION_ELEMENT) {
  7287. for (var d = [], f = 0; f < c.length; f++) {
  7288. for (var g = c.item(f), e = g.parentNode, h = 0, a = new CKEDITOR.dom.range(this.root); h < e.childNodes.length && e.childNodes[h] != g; h++);
  7289. a.setStart(new CKEDITOR.dom.node(e), h);
  7290. a.setEnd(new CKEDITOR.dom.node(e), h + 1);
  7291. d.push(a)
  7292. }
  7293. return d
  7294. }
  7295. return []
  7296. }
  7297. }() : function() {
  7298. var a = [],
  7299. b, c = this.getNative();
  7300. if (!c) return a;
  7301. for (var d = 0; d < c.rangeCount; d++) {
  7302. var f = c.getRangeAt(d);
  7303. b = new CKEDITOR.dom.range(this.root);
  7304. b.setStart(new CKEDITOR.dom.node(f.startContainer), f.startOffset);
  7305. b.setEnd(new CKEDITOR.dom.node(f.endContainer), f.endOffset);
  7306. a.push(b)
  7307. }
  7308. return a
  7309. };
  7310. return function(b) {
  7311. var c = this._.cache,
  7312. d = c.ranges;
  7313. if (!d) c.ranges = d = new CKEDITOR.dom.rangeList(a.call(this));
  7314. return !b ? d : o(new CKEDITOR.dom.rangeList(d.slice()))
  7315. }
  7316. }(),
  7317. getStartElement: function() {
  7318. var a = this._.cache;
  7319. if (a.startElement !== void 0) return a.startElement;
  7320. var b;
  7321. switch (this.getType()) {
  7322. case CKEDITOR.SELECTION_ELEMENT:
  7323. return this.getSelectedElement();
  7324. case CKEDITOR.SELECTION_TEXT:
  7325. var c = this.getRanges()[0];
  7326. if (c) {
  7327. if (c.collapsed) {
  7328. b = c.startContainer;
  7329. b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent())
  7330. } else {
  7331. for (c.optimize();;) {
  7332. b = c.startContainer;
  7333. if (c.startOffset == (b.getChildCount ? b.getChildCount() : b.getLength()) && !b.isBlockBoundary()) c.setStartAfter(b);
  7334. else break
  7335. }
  7336. b = c.startContainer;
  7337. if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
  7338. b = b.getChild(c.startOffset);
  7339. if (!b || b.type != CKEDITOR.NODE_ELEMENT) b = c.startContainer;
  7340. else
  7341. for (c = b.getFirst(); c && c.type ==
  7342. CKEDITOR.NODE_ELEMENT;) {
  7343. b = c;
  7344. c = c.getFirst()
  7345. }
  7346. }
  7347. b = b.$
  7348. }
  7349. }
  7350. return a.startElement = b ? new CKEDITOR.dom.element(b) : null
  7351. },
  7352. getSelectedElement: function() {
  7353. var a = this._.cache;
  7354. if (a.selectedElement !== void 0) return a.selectedElement;
  7355. var b = this,
  7356. c = CKEDITOR.tools.tryThese(function() { return b.getNative().createRange().item(0) }, function() { for (var a = b.getRanges()[0].clone(), c, d, f = 2; f && (!(c = a.getEnclosedNode()) || !(c.type == CKEDITOR.NODE_ELEMENT && u[c.getName()] && (d = c))); f--) a.shrink(CKEDITOR.SHRINK_ELEMENT); return d && d.$ });
  7357. return a.selectedElement =
  7358. c ? new CKEDITOR.dom.element(c) : null
  7359. },
  7360. getSelectedText: function() {
  7361. var a = this._.cache;
  7362. if (a.selectedText !== void 0) return a.selectedText;
  7363. var b = this.getNative(),
  7364. b = t ? b.type == "Control" ? "" : b.createRange().text : b.toString();
  7365. return a.selectedText = b
  7366. },
  7367. lock: function() {
  7368. this.getRanges();
  7369. this.getStartElement();
  7370. this.getSelectedElement();
  7371. this.getSelectedText();
  7372. this._.cache.nativeSel = null;
  7373. this.isLocked = 1
  7374. },
  7375. unlock: function(a) {
  7376. if (this.isLocked) {
  7377. if (a) var b = this.getSelectedElement(),
  7378. c = !b && this.getRanges(),
  7379. d = this.isFake;
  7380. this.isLocked =
  7381. 0;
  7382. this.reset();
  7383. if (a)(a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 1) && (d ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c))
  7384. }
  7385. },
  7386. reset: function() {
  7387. this._.cache = {};
  7388. this.isFake = 0;
  7389. var a = this.root.editor;
  7390. if (a && a._.fakeSelection && this.rev == a._.fakeSelection.rev) {
  7391. delete a._.fakeSelection;
  7392. var b = a._.hiddenSelectionContainer;
  7393. if (b) {
  7394. var c = a.checkDirty();
  7395. a.fire("lockSnapshot");
  7396. b.remove();
  7397. a.fire("unlockSnapshot");
  7398. !c && a.resetDirty()
  7399. }
  7400. delete a._.hiddenSelectionContainer
  7401. }
  7402. this.rev = s++
  7403. },
  7404. selectElement: function(a) {
  7405. var b =
  7406. new CKEDITOR.dom.range(this.root);
  7407. b.setStartBefore(a);
  7408. b.setEndAfter(a);
  7409. this.selectRanges([b])
  7410. },
  7411. selectRanges: function(a) {
  7412. var b = this.root.editor,
  7413. b = b && b._.hiddenSelectionContainer;
  7414. this.reset();
  7415. if (b)
  7416. for (var b = this.root, d, f = 0; f < a.length; ++f) { d = a[f]; if (d.endContainer.equals(b)) d.endOffset = Math.min(d.endOffset, b.getChildCount()) }
  7417. if (a.length)
  7418. if (this.isLocked) {
  7419. var g = CKEDITOR.document.getActive();
  7420. this.unlock();
  7421. this.selectRanges(a);
  7422. this.lock();
  7423. g && !g.equals(this.root) && g.focus()
  7424. } else {
  7425. var e;
  7426. a: {
  7427. var h, i;
  7428. if (a.length ==
  7429. 1 && !(i = a[0]).collapsed && (e = i.getEnclosedNode()) && e.type == CKEDITOR.NODE_ELEMENT) {
  7430. i = i.clone();
  7431. i.shrink(CKEDITOR.SHRINK_ELEMENT, true);
  7432. if ((h = i.getEnclosedNode()) && h.type == CKEDITOR.NODE_ELEMENT) e = h;
  7433. if (e.getAttribute("contenteditable") == "false") break a
  7434. }
  7435. e = void 0
  7436. }
  7437. if (e) this.fake(e);
  7438. else {
  7439. if (t) {
  7440. i = CKEDITOR.dom.walker.whitespaces(true);
  7441. h = /\ufeff|\u00a0/;
  7442. b = { table: 1, tbody: 1, tr: 1 };
  7443. if (a.length > 1) {
  7444. e = a[a.length - 1];
  7445. a[0].setEnd(e.endContainer, e.endOffset)
  7446. }
  7447. e = a[0];
  7448. var a = e.collapsed,
  7449. k, m, p;
  7450. if ((d = e.getEnclosedNode()) && d.type ==
  7451. CKEDITOR.NODE_ELEMENT && d.getName() in u && (!d.is("a") || !d.getText())) try {
  7452. p = d.$.createControlRange();
  7453. p.addElement(d.$);
  7454. p.select();
  7455. return
  7456. } catch (C) {}
  7457. if (e.startContainer.type == CKEDITOR.NODE_ELEMENT && e.startContainer.getName() in b || e.endContainer.type == CKEDITOR.NODE_ELEMENT && e.endContainer.getName() in b) {
  7458. e.shrink(CKEDITOR.NODE_ELEMENT, true);
  7459. a = e.collapsed
  7460. }
  7461. p = e.createBookmark();
  7462. b = p.startNode;
  7463. if (!a) g = p.endNode;
  7464. p = e.document.$.body.createTextRange();
  7465. p.moveToElementText(b.$);
  7466. p.moveStart("character", 1);
  7467. if (g) {
  7468. h =
  7469. e.document.$.body.createTextRange();
  7470. h.moveToElementText(g.$);
  7471. p.setEndPoint("EndToEnd", h);
  7472. p.moveEnd("character", -1)
  7473. } else {
  7474. k = b.getNext(i);
  7475. m = b.hasAscendant("pre");
  7476. k = !(k && k.getText && k.getText().match(h)) && (m || !b.hasPrevious() || b.getPrevious().is && b.getPrevious().is("br"));
  7477. m = e.document.createElement("span");
  7478. m.setHtml("&#65279;");
  7479. m.insertBefore(b);
  7480. k && e.document.createText("").insertBefore(b)
  7481. }
  7482. e.setStartBefore(b);
  7483. b.remove();
  7484. if (a) {
  7485. if (k) {
  7486. p.moveStart("character", -1);
  7487. p.select();
  7488. e.document.$.selection.clear()
  7489. } else p.select();
  7490. e.moveToPosition(m, CKEDITOR.POSITION_BEFORE_START);
  7491. m.remove()
  7492. } else {
  7493. e.setEndBefore(g);
  7494. g.remove();
  7495. p.select()
  7496. }
  7497. } else {
  7498. g = this.getNative();
  7499. if (!g) return;
  7500. this.removeAllRanges();
  7501. for (p = 0; p < a.length; p++) {
  7502. if (p < a.length - 1) {
  7503. k = a[p];
  7504. m = a[p + 1];
  7505. h = k.clone();
  7506. h.setStart(k.endContainer, k.endOffset);
  7507. h.setEnd(m.startContainer, m.startOffset);
  7508. if (!h.collapsed) {
  7509. h.shrink(CKEDITOR.NODE_ELEMENT, true);
  7510. e = h.getCommonAncestor();
  7511. h = h.getEnclosedNode();
  7512. if (e.isReadOnly() || h && h.isReadOnly()) {
  7513. m.setStart(k.startContainer, k.startOffset);
  7514. a.splice(p--,
  7515. 1);
  7516. continue
  7517. }
  7518. }
  7519. }
  7520. e = a[p];
  7521. m = this.document.$.createRange();
  7522. if (e.collapsed && CKEDITOR.env.webkit && c(e)) {
  7523. k = this.root;
  7524. j(k, false);
  7525. h = k.getDocument().createText("​");
  7526. k.setCustomData("cke-fillingChar", h);
  7527. e.insertNode(h);
  7528. if ((k = h.getNext()) && !h.getPrevious() && k.type == CKEDITOR.NODE_ELEMENT && k.getName() == "br") {
  7529. j(this.root);
  7530. e.moveToPosition(k, CKEDITOR.POSITION_BEFORE_START)
  7531. } else e.moveToPosition(h, CKEDITOR.POSITION_AFTER_END)
  7532. }
  7533. m.setStart(e.startContainer.$, e.startOffset);
  7534. try { m.setEnd(e.endContainer.$, e.endOffset) } catch (n) {
  7535. if (n.toString().indexOf("NS_ERROR_ILLEGAL_VALUE") >=
  7536. 0) {
  7537. e.collapse(1);
  7538. m.setEnd(e.endContainer.$, e.endOffset)
  7539. } else throw n;
  7540. }
  7541. g.addRange(m)
  7542. }
  7543. }
  7544. this.reset();
  7545. this.root.fire("selectionchange")
  7546. }
  7547. }
  7548. },
  7549. fake: function(a) {
  7550. var b = this.root.editor;
  7551. this.reset();
  7552. k(b);
  7553. var c = this._.cache,
  7554. d = new CKEDITOR.dom.range(this.root);
  7555. d.setStartBefore(a);
  7556. d.setEndAfter(a);
  7557. c.ranges = new CKEDITOR.dom.rangeList(d);
  7558. c.selectedElement = c.startElement = a;
  7559. c.type = CKEDITOR.SELECTION_ELEMENT;
  7560. c.selectedText = c.nativeSel = null;
  7561. this.isFake = 1;
  7562. this.rev = s++;
  7563. b._.fakeSelection = this;
  7564. this.root.fire("selectionchange")
  7565. },
  7566. isHidden: function() {
  7567. var a = this.getCommonAncestor();
  7568. a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
  7569. return !(!a || !a.data("cke-hidden-sel"))
  7570. },
  7571. createBookmarks: function(a) {
  7572. a = this.getRanges().createBookmarks(a);
  7573. this.isFake && (a.isFake = 1);
  7574. return a
  7575. },
  7576. createBookmarks2: function(a) {
  7577. a = this.getRanges().createBookmarks2(a);
  7578. this.isFake && (a.isFake = 1);
  7579. return a
  7580. },
  7581. selectBookmarks: function(a) {
  7582. for (var b = [], c = 0; c < a.length; c++) {
  7583. var d = new CKEDITOR.dom.range(this.root);
  7584. d.moveToBookmark(a[c]);
  7585. b.push(d)
  7586. }
  7587. a.isFake ? this.fake(b[0].getEnclosedNode()) :
  7588. this.selectRanges(b);
  7589. return this
  7590. },
  7591. getCommonAncestor: function() { var a = this.getRanges(); return !a.length ? null : a[0].startContainer.getCommonAncestor(a[a.length - 1].endContainer) },
  7592. scrollIntoView: function() { this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView() },
  7593. removeAllRanges: function() {
  7594. if (this.getType() != CKEDITOR.SELECTION_NONE) {
  7595. var a = this.getNative();
  7596. try { a && a[t ? "empty" : "removeAllRanges"]() } catch (b) {}
  7597. this.reset()
  7598. }
  7599. }
  7600. }
  7601. }(), "use strict", CKEDITOR.STYLE_BLOCK = 1, CKEDITOR.STYLE_INLINE = 2, CKEDITOR.STYLE_OBJECT =
  7602. 3,
  7603. function() {
  7604. function a(a, b) {
  7605. for (var c, d; a = a.getParent();) {
  7606. if (a.equals(b)) break;
  7607. if (a.getAttribute("data-nostyle")) c = a;
  7608. else if (!d) {
  7609. var f = a.getAttribute("contentEditable");
  7610. f == "false" ? c = a : f == "true" && (d = 1)
  7611. }
  7612. }
  7613. return c
  7614. }
  7615. function e(b) {
  7616. var c = b.document;
  7617. if (b.collapsed) {
  7618. c = p(this, c);
  7619. b.insertNode(c);
  7620. b.moveToPosition(c, CKEDITOR.POSITION_BEFORE_END)
  7621. } else {
  7622. var d = this.element,
  7623. f = this._.definition,
  7624. h, i = f.ignoreReadonly,
  7625. j = i || f.includeReadonly;
  7626. j == null && (j = b.root.getCustomData("cke_includeReadonly"));
  7627. var k = CKEDITOR.dtd[d];
  7628. if (!k) {
  7629. h = true;
  7630. k = CKEDITOR.dtd.span
  7631. }
  7632. b.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  7633. b.trim();
  7634. var m = b.createBookmark(),
  7635. t = m.startNode,
  7636. n = m.endNode,
  7637. s = t,
  7638. l;
  7639. if (!i) {
  7640. var o = b.getCommonAncestor(),
  7641. i = a(t, o),
  7642. o = a(n, o);
  7643. i && (s = i.getNextSourceNode(true));
  7644. o && (n = o)
  7645. }
  7646. for (s.getPosition(n) == CKEDITOR.POSITION_FOLLOWING && (s = 0); s;) {
  7647. i = false;
  7648. if (s.equals(n)) {
  7649. s = null;
  7650. i = true
  7651. } else {
  7652. var u = s.type == CKEDITOR.NODE_ELEMENT ? s.getName() : null,
  7653. o = u && s.getAttribute("contentEditable") == "false",
  7654. w = u && s.getAttribute("data-nostyle");
  7655. if (u && s.data("cke-bookmark")) {
  7656. s =
  7657. s.getNextSourceNode(true);
  7658. continue
  7659. }
  7660. if (o && j && CKEDITOR.dtd.$block[u])
  7661. for (var x = s, r = g(x), v = void 0, z = r.length, y = 0, x = z && new CKEDITOR.dom.range(x.getDocument()); y < z; ++y) {
  7662. var v = r[y],
  7663. A = CKEDITOR.filter.instances[v.data("cke-filter")];
  7664. if (A ? A.check(this) : 1) {
  7665. x.selectNodeContents(v);
  7666. e.call(this, x)
  7667. }
  7668. }
  7669. r = u ? !k[u] || w ? 0 : o && !j ? 0 : (s.getPosition(n) | G) == G && (!f.childRule || f.childRule(s)) : 1;
  7670. if (r)
  7671. if ((r = s.getParent()) && ((r.getDtd() || CKEDITOR.dtd.span)[d] || h) && (!f.parentRule || f.parentRule(r))) {
  7672. if (!l && (!u || !CKEDITOR.dtd.$removeEmpty[u] ||
  7673. (s.getPosition(n) | G) == G)) {
  7674. l = b.clone();
  7675. l.setStartBefore(s)
  7676. }
  7677. u = s.type;
  7678. if (u == CKEDITOR.NODE_TEXT || o || u == CKEDITOR.NODE_ELEMENT && !s.getChildCount()) {
  7679. for (var u = s, aa;
  7680. (i = !u.getNext(B)) && (aa = u.getParent(), k[aa.getName()]) && (aa.getPosition(t) | D) == D && (!f.childRule || f.childRule(aa));) u = aa;
  7681. l.setEndAfter(u)
  7682. }
  7683. } else i = true;
  7684. else i = true;
  7685. s = s.getNextSourceNode(w || o)
  7686. }
  7687. if (i && l && !l.collapsed) {
  7688. for (var i = p(this, c), o = i.hasAttributes(), w = l.getCommonAncestor(), u = {}, r = {}, v = {}, z = {}, U, $, ca; i && w;) {
  7689. if (w.getName() == d) {
  7690. for (U in f.attributes)
  7691. if (!z[U] &&
  7692. (ca = w.getAttribute($))) i.getAttribute(U) == ca ? r[U] = 1 : z[U] = 1;
  7693. for ($ in f.styles)
  7694. if (!v[$] && (ca = w.getStyle($))) i.getStyle($) == ca ? u[$] = 1 : v[$] = 1
  7695. }
  7696. w = w.getParent()
  7697. }
  7698. for (U in r) i.removeAttribute(U);
  7699. for ($ in u) i.removeStyle($);
  7700. o && !i.hasAttributes() && (i = null);
  7701. if (i) {
  7702. l.extractContents().appendTo(i);
  7703. l.insertNode(i);
  7704. q.call(this, i);
  7705. i.mergeSiblings();
  7706. CKEDITOR.env.ie || i.$.normalize()
  7707. } else {
  7708. i = new CKEDITOR.dom.element("span");
  7709. l.extractContents().appendTo(i);
  7710. l.insertNode(i);
  7711. q.call(this, i);
  7712. i.remove(true)
  7713. }
  7714. l = null
  7715. }
  7716. }
  7717. b.moveToBookmark(m);
  7718. b.shrink(CKEDITOR.SHRINK_TEXT);
  7719. b.shrink(CKEDITOR.NODE_ELEMENT, true)
  7720. }
  7721. }
  7722. function b(a) {
  7723. function b() {
  7724. for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(j.getParent()), f = null, g = null, e = 0; e < a.elements.length; e++) {
  7725. var h = a.elements[e];
  7726. if (h == a.block || h == a.blockLimit) break;
  7727. k.checkElementRemovable(h, true) && (f = h)
  7728. }
  7729. for (e = 0; e < c.elements.length; e++) {
  7730. h = c.elements[e];
  7731. if (h == c.block || h == c.blockLimit) break;
  7732. k.checkElementRemovable(h, true) && (g = h)
  7733. }
  7734. g && j.breakParent(g);
  7735. f && d.breakParent(f)
  7736. }
  7737. a.enlarge(CKEDITOR.ENLARGE_INLINE,
  7738. 1);
  7739. var c = a.createBookmark(),
  7740. d = c.startNode;
  7741. if (a.collapsed) {
  7742. for (var f = new CKEDITOR.dom.elementPath(d.getParent(), a.root), g, e = 0, h; e < f.elements.length && (h = f.elements[e]); e++) {
  7743. if (h == f.block || h == f.blockLimit) break;
  7744. if (this.checkElementRemovable(h)) {
  7745. var i;
  7746. if (a.collapsed && (a.checkBoundaryOfElement(h, CKEDITOR.END) || (i = a.checkBoundaryOfElement(h, CKEDITOR.START)))) {
  7747. g = h;
  7748. g.match = i ? "start" : "end"
  7749. } else {
  7750. h.mergeSiblings();
  7751. h.is(this.element) ? o.call(this, h) : m(h, u(this)[h.getName()])
  7752. }
  7753. }
  7754. }
  7755. if (g) {
  7756. h = d;
  7757. for (e = 0;; e++) {
  7758. i = f.elements[e];
  7759. if (i.equals(g)) break;
  7760. else if (i.match) continue;
  7761. else i = i.clone();
  7762. i.append(h);
  7763. h = i
  7764. }
  7765. h[g.match == "start" ? "insertBefore" : "insertAfter"](g)
  7766. }
  7767. } else {
  7768. var j = c.endNode,
  7769. k = this;
  7770. b();
  7771. for (f = d; !f.equals(j);) {
  7772. g = f.getNextSourceNode();
  7773. if (f.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(f)) {
  7774. f.getName() == this.element ? o.call(this, f) : m(f, u(this)[f.getName()]);
  7775. if (g.type == CKEDITOR.NODE_ELEMENT && g.contains(d)) {
  7776. b();
  7777. g = d.getNext()
  7778. }
  7779. }
  7780. f = g
  7781. }
  7782. }
  7783. a.moveToBookmark(c);
  7784. a.shrink(CKEDITOR.NODE_ELEMENT, true)
  7785. }
  7786. function g(a) {
  7787. var b = [];
  7788. a.forEach(function(a) {
  7789. if (a.getAttribute("contenteditable") ==
  7790. "true") { b.push(a); return false }
  7791. }, CKEDITOR.NODE_ELEMENT, true);
  7792. return b
  7793. }
  7794. function c(a) {
  7795. var b = a.getEnclosedNode() || a.getCommonAncestor(false, true);
  7796. (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && t(a, this)
  7797. }
  7798. function d(a) {
  7799. var b = a.getCommonAncestor(true, true);
  7800. if (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) {
  7801. var b = this._.definition,
  7802. c = b.attributes;
  7803. if (c)
  7804. for (var d in c) a.removeAttribute(d, c[d]);
  7805. if (b.styles)
  7806. for (var f in b.styles) b.styles.hasOwnProperty(f) &&
  7807. a.removeStyle(f)
  7808. }
  7809. }
  7810. function j(a) {
  7811. var b = a.createBookmark(true),
  7812. c = a.createIterator();
  7813. c.enforceRealBlocks = true;
  7814. if (this._.enterMode) c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  7815. for (var d, f = a.document, g; d = c.getNextParagraph();)
  7816. if (!d.isReadOnly() && (c.activeFilter ? c.activeFilter.check(this) : 1)) {
  7817. g = p(this, f, d);
  7818. h(d, g)
  7819. }
  7820. a.moveToBookmark(b)
  7821. }
  7822. function f(a) {
  7823. var b = a.createBookmark(1),
  7824. c = a.createIterator();
  7825. c.enforceRealBlocks = true;
  7826. c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  7827. for (var d, f; d = c.getNextParagraph();)
  7828. if (this.checkElementRemovable(d))
  7829. if (d.is("pre")) {
  7830. (f =
  7831. this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div")) && d.copyAttributes(f);
  7832. h(d, f)
  7833. } else o.call(this, d);
  7834. a.moveToBookmark(b)
  7835. }
  7836. function h(a, b) {
  7837. var c = !b;
  7838. if (c) {
  7839. b = a.getDocument().createElement("div");
  7840. a.copyAttributes(b)
  7841. }
  7842. var d = b && b.is("pre"),
  7843. f = a.is("pre"),
  7844. g = !d && f;
  7845. if (d && !f) {
  7846. f = b;
  7847. (g = a.getBogus()) && g.remove();
  7848. g = a.getHtml();
  7849. g = k(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
  7850. g = g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
  7851. g = g.replace(/([ \t\n\r]+|&nbsp;)/g,
  7852. " ");
  7853. g = g.replace(/<br\b[^>]*>/gi, "\n");
  7854. if (CKEDITOR.env.ie) {
  7855. var e = a.getDocument().createElement("div");
  7856. e.append(f);
  7857. f.$.outerHTML = "<pre>" + g + "</pre>";
  7858. f.copyAttributes(e.getFirst());
  7859. f = e.getFirst().remove()
  7860. } else f.setHtml(g);
  7861. b = f
  7862. } else g ? b = n(c ? [a.getHtml()] : i(a), b) : a.moveChildren(b);
  7863. b.replace(a);
  7864. if (d) {
  7865. var c = b,
  7866. h;
  7867. if ((h = c.getPrevious(A)) && h.type == CKEDITOR.NODE_ELEMENT && h.is("pre")) {
  7868. d = k(h.getHtml(), /\n$/, "") + "\n\n" + k(c.getHtml(), /^\n/, "");
  7869. CKEDITOR.env.ie ? c.$.outerHTML = "<pre>" + d + "</pre>" : c.setHtml(d);
  7870. h.remove()
  7871. }
  7872. } else c &&
  7873. l(b)
  7874. }
  7875. function i(a) {
  7876. var b = [];
  7877. k(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) { return b + "</pre>" + c + "<pre>" }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function(a, c) { b.push(c) });
  7878. return b
  7879. }
  7880. function k(a, b, c) {
  7881. var d = "",
  7882. f = "",
  7883. a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function(a, b, c) {
  7884. b && (d = b);
  7885. c && (f = c);
  7886. return ""
  7887. });
  7888. return d + a.replace(b, c) + f
  7889. }
  7890. function n(a, b) {
  7891. var c;
  7892. a.length > 1 && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
  7893. for (var d = 0; d < a.length; d++) {
  7894. var f = a[d],
  7895. f = f.replace(/(\r\n|\r)/g, "\n"),
  7896. f = k(f, /^[ \t]*\n/, ""),
  7897. f = k(f, /\n$/, ""),
  7898. f = k(f, /^[ \t]+|[ \t]+$/g, function(a, b) { return a.length == 1 ? "&nbsp;" : b ? " " + CKEDITOR.tools.repeat("&nbsp;", a.length - 1) : CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " " }),
  7899. f = f.replace(/\n/g, "<br>"),
  7900. f = f.replace(/[ \t]{2,}/g, function(a) { return CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " " });
  7901. if (c) {
  7902. var g = b.clone();
  7903. g.setHtml(f);
  7904. c.append(g)
  7905. } else b.setHtml(f)
  7906. }
  7907. return c || b
  7908. }
  7909. function o(a, b) {
  7910. var c = this._.definition,
  7911. d = c.attributes,
  7912. c = c.styles,
  7913. f = u(this)[a.getName()],
  7914. g = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c),
  7915. e;
  7916. for (e in d)
  7917. if (!((e == "class" || this._.definition.fullMatch) && a.getAttribute(e) != w(e, d[e])) && !(b && e.slice(0, 5) == "data-")) {
  7918. g = a.hasAttribute(e);
  7919. a.removeAttribute(e)
  7920. }
  7921. for (var h in c)
  7922. if (!(this._.definition.fullMatch && a.getStyle(h) != w(h, c[h], true))) {
  7923. g = g || !!a.getStyle(h);
  7924. a.removeStyle(h)
  7925. }
  7926. m(a, f, v[a.getName()]);
  7927. g && (this._.definition.alwaysRemoveElement ? l(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode ==
  7928. CKEDITOR.ENTER_BR && !a.hasAttributes() ? l(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div"))
  7929. }
  7930. function q(a) {
  7931. for (var b = u(this), c = a.getElementsByTag(this.element), d, f = c.count(); --f >= 0;) {
  7932. d = c.getItem(f);
  7933. d.isReadOnly() || o.call(this, d, true)
  7934. }
  7935. for (var g in b)
  7936. if (g != this.element) {
  7937. c = a.getElementsByTag(g);
  7938. for (f = c.count() - 1; f >= 0; f--) {
  7939. d = c.getItem(f);
  7940. d.isReadOnly() || m(d, b[g])
  7941. }
  7942. }
  7943. }
  7944. function m(a, b, c) {
  7945. if (b = b && b.attributes)
  7946. for (var d = 0; d < b.length; d++) {
  7947. var f = b[d][0],
  7948. g;
  7949. if (g = a.getAttribute(f)) {
  7950. var e = b[d][1];
  7951. (e === null ||
  7952. e.test && e.test(g) || typeof e == "string" && g == e) && a.removeAttribute(f)
  7953. }
  7954. }
  7955. c || l(a)
  7956. }
  7957. function l(a, b) {
  7958. if (!a.hasAttributes() || b)
  7959. if (CKEDITOR.dtd.$block[a.getName()]) {
  7960. var c = a.getPrevious(A),
  7961. d = a.getNext(A);
  7962. c && (c.type == CKEDITOR.NODE_TEXT || !c.isBlockBoundary({ br: 1 })) && a.append("br", 1);
  7963. d && (d.type == CKEDITOR.NODE_TEXT || !d.isBlockBoundary({ br: 1 })) && a.append("br");
  7964. a.remove(true)
  7965. } else {
  7966. c = a.getFirst();
  7967. d = a.getLast();
  7968. a.remove(true);
  7969. if (c) {
  7970. c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings();
  7971. d && (!c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT) &&
  7972. d.mergeSiblings()
  7973. }
  7974. }
  7975. }
  7976. function p(a, b, c) {
  7977. var d;
  7978. d = a.element;
  7979. d == "*" && (d = "span");
  7980. d = new CKEDITOR.dom.element(d, b);
  7981. c && c.copyAttributes(d);
  7982. d = t(d, a);
  7983. b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style", 1);
  7984. return d
  7985. }
  7986. function t(a, b) {
  7987. var c = b._.definition,
  7988. d = c.attributes,
  7989. c = CKEDITOR.style.getStyleText(c);
  7990. if (d)
  7991. for (var f in d) a.setAttribute(f, d[f]);
  7992. c && a.setAttribute("style", c);
  7993. return a
  7994. }
  7995. function s(a, b) {
  7996. for (var c in a) a[c] = a[c].replace(z, function(a,
  7997. c) { return b[c] })
  7998. }
  7999. function u(a) {
  8000. if (a._.overrides) return a._.overrides;
  8001. var b = a._.overrides = {},
  8002. c = a._.definition.overrides;
  8003. if (c) {
  8004. CKEDITOR.tools.isArray(c) || (c = [c]);
  8005. for (var d = 0; d < c.length; d++) {
  8006. var f = c[d],
  8007. g, e;
  8008. if (typeof f == "string") g = f.toLowerCase();
  8009. else {
  8010. g = f.element ? f.element.toLowerCase() : a.element;
  8011. e = f.attributes
  8012. }
  8013. f = b[g] || (b[g] = {});
  8014. if (e) {
  8015. var f = f.attributes = f.attributes || [],
  8016. h;
  8017. for (h in e) f.push([h.toLowerCase(), e[h]])
  8018. }
  8019. }
  8020. }
  8021. return b
  8022. }
  8023. function w(a, b, c) {
  8024. var d = new CKEDITOR.dom.element("span");
  8025. d[c ? "setStyle" : "setAttribute"](a,
  8026. b);
  8027. return d[c ? "getStyle" : "getAttribute"](a)
  8028. }
  8029. function x(a, b, c) {
  8030. for (var d = a.document, f = a.getRanges(), b = b ? this.removeFromRange : this.applyToRange, g, e = f.createIterator(); g = e.getNextRange();) b.call(this, g, c);
  8031. a.selectRanges(f);
  8032. d.removeCustomData("doc_processing_style")
  8033. }
  8034. var v = { address: 1, div: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, p: 1, pre: 1, section: 1, header: 1, footer: 1, nav: 1, article: 1, aside: 1, figure: 1, dialog: 1, hgroup: 1, time: 1, meter: 1, menu: 1, command: 1, keygen: 1, output: 1, progress: 1, details: 1, datagrid: 1, datalist: 1 },
  8035. r = { a: 1, blockquote: 1, embed: 1, hr: 1, img: 1, li: 1, object: 1, ol: 1, table: 1, td: 1, tr: 1, th: 1, ul: 1, dl: 1, dt: 1, dd: 1, form: 1, audio: 1, video: 1 },
  8036. y = /\s*(?:;\s*|$)/,
  8037. z = /#\((.+?)\)/g,
  8038. B = CKEDITOR.dom.walker.bookmark(0, 1),
  8039. A = CKEDITOR.dom.walker.whitespaces(1);
  8040. CKEDITOR.style = function(a, b) {
  8041. if (typeof a.type == "string") return new CKEDITOR.style.customHandlers[a.type](a);
  8042. var c = a.attributes;
  8043. if (c && c.style) {
  8044. a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style));
  8045. delete c.style
  8046. }
  8047. if (b) {
  8048. a = CKEDITOR.tools.clone(a);
  8049. s(a.attributes,
  8050. b);
  8051. s(a.styles, b)
  8052. }
  8053. c = this.element = a.element ? typeof a.element == "string" ? a.element.toLowerCase() : a.element : "*";
  8054. this.type = a.type || (v[c] ? CKEDITOR.STYLE_BLOCK : r[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
  8055. if (typeof this.element == "object") this.type = CKEDITOR.STYLE_OBJECT;
  8056. this._ = { definition: a }
  8057. };
  8058. CKEDITOR.style.prototype = {
  8059. apply: function(a) {
  8060. if (a instanceof CKEDITOR.dom.document) return x.call(this, a.getSelection());
  8061. if (this.checkApplicable(a.elementPath(), a)) {
  8062. var b = this._.enterMode;
  8063. if (!b) this._.enterMode = a.activeEnterMode;
  8064. x.call(this, a.getSelection(), 0, a);
  8065. this._.enterMode = b
  8066. }
  8067. },
  8068. remove: function(a) {
  8069. if (a instanceof CKEDITOR.dom.document) return x.call(this, a.getSelection(), 1);
  8070. if (this.checkApplicable(a.elementPath(), a)) {
  8071. var b = this._.enterMode;
  8072. if (!b) this._.enterMode = a.activeEnterMode;
  8073. x.call(this, a.getSelection(), 1, a);
  8074. this._.enterMode = b
  8075. }
  8076. },
  8077. applyToRange: function(a) { this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? e : this.type == CKEDITOR.STYLE_BLOCK ? j : this.type == CKEDITOR.STYLE_OBJECT ? c : null; return this.applyToRange(a) },
  8078. removeFromRange: function(a) {
  8079. this.removeFromRange =
  8080. this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? f : this.type == CKEDITOR.STYLE_OBJECT ? d : null;
  8081. return this.removeFromRange(a)
  8082. },
  8083. applyToObject: function(a) { t(a, this) },
  8084. checkActive: function(a, b) {
  8085. switch (this.type) {
  8086. case CKEDITOR.STYLE_BLOCK:
  8087. return this.checkElementRemovable(a.block || a.blockLimit, true, b);
  8088. case CKEDITOR.STYLE_OBJECT:
  8089. case CKEDITOR.STYLE_INLINE:
  8090. for (var c = a.elements, d = 0, f; d < c.length; d++) {
  8091. f = c[d];
  8092. if (!(this.type == CKEDITOR.STYLE_INLINE && (f == a.block || f == a.blockLimit))) {
  8093. if (this.type ==
  8094. CKEDITOR.STYLE_OBJECT) { var g = f.getName(); if (!(typeof this.element == "string" ? g == this.element : g in this.element)) continue }
  8095. if (this.checkElementRemovable(f, true, b)) return true
  8096. }
  8097. }
  8098. }
  8099. return false
  8100. },
  8101. checkApplicable: function(a, b, c) {
  8102. b && b instanceof CKEDITOR.filter && (c = b);
  8103. if (c && !c.check(this)) return false;
  8104. switch (this.type) {
  8105. case CKEDITOR.STYLE_OBJECT:
  8106. return !!a.contains(this.element);
  8107. case CKEDITOR.STYLE_BLOCK:
  8108. return !!a.blockLimit.getDtd()[this.element]
  8109. }
  8110. return true
  8111. },
  8112. checkElementMatch: function(a, b) {
  8113. var c = this._.definition;
  8114. if (!a || !c.ignoreReadonly && a.isReadOnly()) return false;
  8115. var d = a.getName();
  8116. if (typeof this.element == "string" ? d == this.element : d in this.element) {
  8117. if (!b && !a.hasAttributes()) return true;
  8118. if (d = c._AC) c = d;
  8119. else {
  8120. var d = {},
  8121. f = 0,
  8122. g = c.attributes;
  8123. if (g)
  8124. for (var e in g) {
  8125. f++;
  8126. d[e] = g[e]
  8127. }
  8128. if (e = CKEDITOR.style.getStyleText(c)) {
  8129. d.style || f++;
  8130. d.style = e
  8131. }
  8132. d._length = f;
  8133. c = c._AC = d
  8134. }
  8135. if (c._length) {
  8136. for (var h in c)
  8137. if (h != "_length") {
  8138. f = a.getAttribute(h) || "";
  8139. if (h == "style") a: {
  8140. d = c[h];typeof d == "string" && (d = CKEDITOR.tools.parseCssText(d));typeof f ==
  8141. "string" && (f = CKEDITOR.tools.parseCssText(f, true));e = void 0;
  8142. for (e in d)
  8143. if (!(e in f && (f[e] == d[e] || d[e] == "inherit" || f[e] == "inherit"))) { d = false; break a }
  8144. d = true
  8145. }
  8146. else d = c[h] == f;
  8147. if (d) { if (!b) return true } else if (b) return false
  8148. }
  8149. if (b) return true
  8150. } else return true
  8151. }
  8152. return false
  8153. },
  8154. checkElementRemovable: function(a, b, c) {
  8155. if (this.checkElementMatch(a, b, c)) return true;
  8156. if (b = u(this)[a.getName()]) {
  8157. var d;
  8158. if (!(b = b.attributes)) return true;
  8159. for (c = 0; c < b.length; c++) {
  8160. d = b[c][0];
  8161. if (d = a.getAttribute(d)) {
  8162. var f = b[c][1];
  8163. if (f === null) return true;
  8164. if (typeof f == "string") { if (d == f) return true } else if (f.test(d)) return true
  8165. }
  8166. }
  8167. }
  8168. return false
  8169. },
  8170. buildPreview: function(a) {
  8171. var b = this._.definition,
  8172. c = [],
  8173. d = b.element;
  8174. d == "bdo" && (d = "span");
  8175. var c = ["<", d],
  8176. f = b.attributes;
  8177. if (f)
  8178. for (var g in f) c.push(" ", g, '="', f[g], '"');
  8179. (f = CKEDITOR.style.getStyleText(b)) && c.push(' style="', f, '"');
  8180. c.push(">", a || b.name, "</", d, ">");
  8181. return c.join("")
  8182. },
  8183. getDefinition: function() { return this._.definition }
  8184. };
  8185. CKEDITOR.style.getStyleText = function(a) {
  8186. var b = a._ST;
  8187. if (b) return b;
  8188. var b = a.styles,
  8189. c =
  8190. a.attributes && a.attributes.style || "",
  8191. d = "";
  8192. c.length && (c = c.replace(y, ";"));
  8193. for (var f in b) {
  8194. var g = b[f],
  8195. e = (f + ":" + g).replace(y, ";");
  8196. g == "inherit" ? d = d + e : c = c + e
  8197. }
  8198. c.length && (c = CKEDITOR.tools.normalizeCssText(c, true));
  8199. return a._ST = c + d
  8200. };
  8201. CKEDITOR.style.customHandlers = {};
  8202. CKEDITOR.style.addCustomHandler = function(a) {
  8203. var b = function(a) {
  8204. this._ = { definition: a };
  8205. this.setup && this.setup(a)
  8206. };
  8207. b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), { assignedTo: CKEDITOR.STYLE_OBJECT }, a, true);
  8208. return this.customHandlers[a.type] = b
  8209. };
  8210. var G = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
  8211. D = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
  8212. }(), CKEDITOR.styleCommand = function(a, e) {
  8213. this.requiredContent = this.allowedContent = this.style = a;
  8214. CKEDITOR.tools.extend(this, e, true)
  8215. }, CKEDITOR.styleCommand.prototype.exec = function(a) {
  8216. a.focus();
  8217. this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON &&
  8218. a.removeStyle(this.style)
  8219. }, CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet"), CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet), CKEDITOR.loadStylesSet = function(a, e, b) {
  8220. CKEDITOR.stylesSet.addExternal(a, e, "");
  8221. CKEDITOR.stylesSet.load(a, b)
  8222. }, CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  8223. attachStyleStateChange: function(a, e) {
  8224. var b = this._.styleStateChangeCallbacks;
  8225. if (!b) {
  8226. b = this._.styleStateChangeCallbacks = [];
  8227. this.on("selectionChange", function(a) {
  8228. for (var c =
  8229. 0; c < b.length; c++) {
  8230. var d = b[c],
  8231. e = d.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
  8232. d.fn.call(this, e)
  8233. }
  8234. })
  8235. }
  8236. b.push({ style: a, fn: e })
  8237. },
  8238. applyStyle: function(a) { a.apply(this) },
  8239. removeStyle: function(a) { a.remove(this) },
  8240. getStylesSet: function(a) {
  8241. if (this._.stylesDefinitions) a(this._.stylesDefinitions);
  8242. else {
  8243. var e = this,
  8244. b = e.config.stylesCombo_stylesSet || e.config.stylesSet;
  8245. if (b === false) a(null);
  8246. else if (b instanceof Array) {
  8247. e._.stylesDefinitions = b;
  8248. a(b)
  8249. } else {
  8250. b || (b = "default");
  8251. var b = b.split(":"),
  8252. g = b[0];
  8253. CKEDITOR.stylesSet.addExternal(g, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
  8254. CKEDITOR.stylesSet.load(g, function(b) {
  8255. e._.stylesDefinitions = b[g];
  8256. a(e._.stylesDefinitions)
  8257. })
  8258. }
  8259. }
  8260. }
  8261. }), CKEDITOR.dom.comment = function(a, e) {
  8262. typeof a == "string" && (a = (e ? e.$ : document).createComment(a));
  8263. CKEDITOR.dom.domObject.call(this, a)
  8264. }, CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node, CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
  8265. type: CKEDITOR.NODE_COMMENT,
  8266. getOuterHtml: function() {
  8267. return "<\!--" + this.$.nodeValue +
  8268. "--\>"
  8269. }
  8270. }), "use strict",
  8271. function() {
  8272. var a = {},
  8273. e = {},
  8274. b;
  8275. for (b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1);
  8276. for (b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (e[b] = 1);
  8277. CKEDITOR.dom.elementPath = function(b, c) {
  8278. var d = null,
  8279. j = null,
  8280. f = [],
  8281. h = b,
  8282. i, c = c || b.getDocument().getBody();
  8283. do
  8284. if (h.type == CKEDITOR.NODE_ELEMENT) {
  8285. f.push(h);
  8286. if (!this.lastElement) { this.lastElement = h; if (h.is(CKEDITOR.dtd.$object) || h.getAttribute("contenteditable") == "false") continue }
  8287. if (h.equals(c)) break;
  8288. if (!j) {
  8289. i = h.getName();
  8290. h.getAttribute("contenteditable") == "true" ? j = h : !d && e[i] && (d = h);
  8291. if (a[i]) {
  8292. var k;
  8293. if (k = !d) {
  8294. if (i = i == "div") {
  8295. a: {
  8296. i = h.getChildren();k = 0;
  8297. for (var n = i.count(); k < n; k++) { var o = i.getItem(k); if (o.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[o.getName()]) { i = true; break a } }
  8298. i = false
  8299. }
  8300. i = !i
  8301. }
  8302. k = i
  8303. }
  8304. k ? d = h : j = h
  8305. }
  8306. }
  8307. }
  8308. while (h = h.getParent());
  8309. j || (j = c);
  8310. this.block = d;
  8311. this.blockLimit = j;
  8312. this.root = c;
  8313. this.elements = f
  8314. }
  8315. }(), CKEDITOR.dom.elementPath.prototype = {
  8316. compare: function(a) {
  8317. var e = this.elements,
  8318. a = a && a.elements;
  8319. if (!a ||
  8320. e.length != a.length) return false;
  8321. for (var b = 0; b < e.length; b++)
  8322. if (!e[b].equals(a[b])) return false;
  8323. return true
  8324. },
  8325. contains: function(a, e, b) {
  8326. var g;
  8327. typeof a == "string" && (g = function(b) { return b.getName() == a });
  8328. a instanceof CKEDITOR.dom.element ? g = function(b) { return b.equals(a) } : CKEDITOR.tools.isArray(a) ? g = function(b) { return CKEDITOR.tools.indexOf(a, b.getName()) > -1 } : typeof a == "function" ? g = a : typeof a == "object" && (g = function(b) { return b.getName() in a });
  8329. var c = this.elements,
  8330. d = c.length;
  8331. e && d--;
  8332. if (b) {
  8333. c = Array.prototype.slice.call(c,
  8334. 0);
  8335. c.reverse()
  8336. }
  8337. for (e = 0; e < d; e++)
  8338. if (g(c[e])) return c[e];
  8339. return null
  8340. },
  8341. isContextFor: function(a) { var e; if (a in CKEDITOR.dtd.$block) { e = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this.block) && this.block || this.blockLimit; return !!e.getDtd()[a] } return true },
  8342. direction: function() { return (this.block || this.blockLimit || this.root).getDirection(1) }
  8343. }, CKEDITOR.dom.text = function(a, e) {
  8344. typeof a == "string" && (a = (e ? e.$ : document).createTextNode(a));
  8345. this.$ = a
  8346. }, CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node,
  8347. CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
  8348. type: CKEDITOR.NODE_TEXT,
  8349. getLength: function() { return this.$.nodeValue.length },
  8350. getText: function() { return this.$.nodeValue },
  8351. setText: function(a) { this.$.nodeValue = a },
  8352. split: function(a) {
  8353. var e = this.$.parentNode,
  8354. b = e.childNodes.length,
  8355. g = this.getLength(),
  8356. c = this.getDocument(),
  8357. d = new CKEDITOR.dom.text(this.$.splitText(a), c);
  8358. if (e.childNodes.length == b)
  8359. if (a >= g) {
  8360. d = c.createText("");
  8361. d.insertAfter(this)
  8362. } else {
  8363. a = c.createText("");
  8364. a.insertAfter(d);
  8365. a.remove()
  8366. }
  8367. return d
  8368. },
  8369. substring: function(a,
  8370. e) { return typeof e != "number" ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, e) }
  8371. }),
  8372. function() {
  8373. function a(a, g, c) {
  8374. var d = a.serializable,
  8375. e = g[c ? "endContainer" : "startContainer"],
  8376. f = c ? "endOffset" : "startOffset",
  8377. h = d ? g.document.getById(a.startNode) : a.startNode,
  8378. a = d ? g.document.getById(a.endNode) : a.endNode;
  8379. if (e.equals(h.getPrevious())) {
  8380. g.startOffset = g.startOffset - e.getLength() - a.getPrevious().getLength();
  8381. e = a.getNext()
  8382. } else if (e.equals(a.getPrevious())) {
  8383. g.startOffset = g.startOffset - e.getLength();
  8384. e = a.getNext()
  8385. }
  8386. e.equals(h.getParent()) &&
  8387. g[f]++;
  8388. e.equals(a.getParent()) && g[f]++;
  8389. g[c ? "endContainer" : "startContainer"] = e;
  8390. return g
  8391. }
  8392. CKEDITOR.dom.rangeList = function(a) {
  8393. if (a instanceof CKEDITOR.dom.rangeList) return a;
  8394. a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = [];
  8395. return CKEDITOR.tools.extend(a, e)
  8396. };
  8397. var e = {
  8398. createIterator: function() {
  8399. var a = this,
  8400. g = CKEDITOR.dom.walker.bookmark(),
  8401. c = [],
  8402. d;
  8403. return {
  8404. getNextRange: function(e) {
  8405. d = d === void 0 ? 0 : d + 1;
  8406. var f = a[d];
  8407. if (f && a.length > 1) {
  8408. if (!d)
  8409. for (var h = a.length - 1; h >= 0; h--) c.unshift(a[h].createBookmark(true));
  8410. if (e)
  8411. for (var i =
  8412. 0; a[d + i + 1];) {
  8413. for (var k = f.document, e = 0, h = k.getById(c[i].endNode), k = k.getById(c[i + 1].startNode);;) {
  8414. h = h.getNextSourceNode(false);
  8415. if (k.equals(h)) e = 1;
  8416. else if (g(h) || h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) continue;
  8417. break
  8418. }
  8419. if (!e) break;
  8420. i++
  8421. }
  8422. for (f.moveToBookmark(c.shift()); i--;) {
  8423. h = a[++d];
  8424. h.moveToBookmark(c.shift());
  8425. f.setEnd(h.endContainer, h.endOffset)
  8426. }
  8427. }
  8428. return f
  8429. }
  8430. }
  8431. },
  8432. createBookmarks: function(b) {
  8433. for (var g = [], c, d = 0; d < this.length; d++) {
  8434. g.push(c = this[d].createBookmark(b, true));
  8435. for (var e = d + 1; e < this.length; e++) {
  8436. this[e] =
  8437. a(c, this[e]);
  8438. this[e] = a(c, this[e], true)
  8439. }
  8440. }
  8441. return g
  8442. },
  8443. createBookmarks2: function(a) { for (var g = [], c = 0; c < this.length; c++) g.push(this[c].createBookmark2(a)); return g },
  8444. moveToBookmarks: function(a) { for (var g = 0; g < this.length; g++) this[g].moveToBookmark(a[g]) }
  8445. }
  8446. }(),
  8447. function() {
  8448. function a() { return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/") }
  8449. function e(b) {
  8450. var c = CKEDITOR.skin["ua_" + b],
  8451. d = CKEDITOR.env;
  8452. if (c)
  8453. for (var c = c.split(",").sort(function(a, b) { return a > b ? -1 : 1 }), f =
  8454. 0, g; f < c.length; f++) { g = c[f]; if (d.ie && (g.replace(/^ie/, "") == d.version || d.quirks && g == "iequirks")) g = "ie"; if (d[g]) { b = b + ("_" + c[f]); break } }
  8455. return CKEDITOR.getUrl(a() + b + ".css")
  8456. }
  8457. function b(a, b) {
  8458. if (!d[a]) {
  8459. CKEDITOR.document.appendStyleSheet(e(a));
  8460. d[a] = 1
  8461. }
  8462. b && b()
  8463. }
  8464. function g(a) {
  8465. var b = a.getById(j);
  8466. if (!b) {
  8467. b = a.getHead().append("style");
  8468. b.setAttribute("id", j);
  8469. b.setAttribute("type", "text/css")
  8470. }
  8471. return b
  8472. }
  8473. function c(a, b, c) {
  8474. var d, f, g;
  8475. if (CKEDITOR.env.webkit) { b = b.split("}").slice(0, -1); for (f = 0; f < b.length; f++) b[f] = b[f].split("{") }
  8476. for (var e =
  8477. 0; e < a.length; e++)
  8478. if (CKEDITOR.env.webkit)
  8479. for (f = 0; f < b.length; f++) {
  8480. g = b[f][1];
  8481. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  8482. a[e].$.sheet.addRule(b[f][0], g)
  8483. } else {
  8484. g = b;
  8485. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  8486. CKEDITOR.env.ie && CKEDITOR.env.version < 11 ? a[e].$.styleSheet.cssText = a[e].$.styleSheet.cssText + g : a[e].$.innerHTML = a[e].$.innerHTML + g
  8487. }
  8488. }
  8489. var d = {};
  8490. CKEDITOR.skin = {
  8491. path: a,
  8492. loadPart: function(c, d) {
  8493. CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() +
  8494. "skin.js"), function() { b(c, d) }) : b(c, d)
  8495. },
  8496. getPath: function(a) { return CKEDITOR.getUrl(e(a)) },
  8497. icons: {},
  8498. addIcon: function(a, b, c, d) {
  8499. a = a.toLowerCase();
  8500. this.icons[a] || (this.icons[a] = { path: b, offset: c || 0, bgsize: d || "16px" })
  8501. },
  8502. getIconStyle: function(a, b, c, d, f) {
  8503. var g;
  8504. if (a) {
  8505. a = a.toLowerCase();
  8506. b && (g = this.icons[a + "-rtl"]);
  8507. g || (g = this.icons[a])
  8508. }
  8509. a = c || g && g.path || "";
  8510. d = d || g && g.offset;
  8511. f = f || g && g.bgsize || "16px";
  8512. return a && "background-image:url(" + CKEDITOR.getUrl(a) + ");background-position:0 " + d + "px;background-size:" + f + ";"
  8513. }
  8514. };
  8515. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  8516. getUiColor: function() { return this.uiColor },
  8517. setUiColor: function(a) {
  8518. var b = g(CKEDITOR.document);
  8519. return (this.setUiColor = function(a) {
  8520. this.uiColor = a;
  8521. var d = CKEDITOR.skin.chameleon,
  8522. g = "",
  8523. e = "";
  8524. if (typeof d == "function") {
  8525. g = d(this, "editor");
  8526. e = d(this, "panel")
  8527. }
  8528. a = [
  8529. [h, a]
  8530. ];
  8531. c([b], g, a);
  8532. c(f, e, a)
  8533. }).call(this, a)
  8534. }
  8535. });
  8536. var j = "cke_ui_color",
  8537. f = [],
  8538. h = /\$color/g;
  8539. CKEDITOR.on("instanceLoaded", function(a) {
  8540. if (!CKEDITOR.env.ie || !CKEDITOR.env.quirks) {
  8541. var b = a.editor,
  8542. a = function(a) {
  8543. a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
  8544. if (!a.getById("cke_ui_color")) {
  8545. a = g(a);
  8546. f.push(a);
  8547. var d = b.getUiColor();
  8548. d && c([a], CKEDITOR.skin.chameleon(b, "panel"), [
  8549. [h, d]
  8550. ])
  8551. }
  8552. };
  8553. b.on("panelShow", a);
  8554. b.on("menuShow", a);
  8555. b.config.uiColor && b.setUiColor(b.config.uiColor)
  8556. }
  8557. })
  8558. }(),
  8559. function() {
  8560. if (CKEDITOR.env.webkit) CKEDITOR.env.hc = false;
  8561. else {
  8562. var a = CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>', CKEDITOR.document);
  8563. a.appendTo(CKEDITOR.document.getHead());
  8564. try {
  8565. var e = a.getComputedStyle("border-top-color"),
  8566. b = a.getComputedStyle("border-right-color");
  8567. CKEDITOR.env.hc = !!(e && e == b)
  8568. } catch (g) { CKEDITOR.env.hc = false }
  8569. a.remove()
  8570. }
  8571. if (CKEDITOR.env.hc) CKEDITOR.env.cssClass = CKEDITOR.env.cssClass + " cke_hc";
  8572. CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
  8573. CKEDITOR.status = "loaded";
  8574. CKEDITOR.fireOnce("loaded");
  8575. if (a = CKEDITOR._.pending) {
  8576. delete CKEDITOR._.pending;
  8577. for (e = 0; e < a.length; e++) {
  8578. CKEDITOR.editor.prototype.constructor.apply(a[e][0], a[e][1]);
  8579. CKEDITOR.add(a[e][0])
  8580. }
  8581. }
  8582. }(), CKEDITOR.skin.name = "moono", CKEDITOR.skin.ua_editor =
  8583. "ie,iequirks,ie7,ie8,gecko", CKEDITOR.skin.ua_dialog = "ie,iequirks,ie7,ie8", CKEDITOR.skin.chameleon = function() {
  8584. var a = function() {
  8585. return function(a, b) {
  8586. for (var d = a.match(/[^#]./g), e = 0; e < 3; e++) {
  8587. var f = d,
  8588. h = e,
  8589. i;
  8590. i = parseInt(d[e], 16);
  8591. i = ("0" + (b < 0 ? 0 | i * (1 + b) : 0 | i + (255 - i) * b).toString(16)).slice(-2);
  8592. f[h] = i
  8593. }
  8594. return "#" + d.join("")
  8595. }
  8596. }(),
  8597. e = function() {
  8598. var a = new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");
  8599. return function(b, d) { return a.output({ from: b, to: d }) }
  8600. }(),
  8601. b = {
  8602. editor: new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
  8603. panel: new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")
  8604. };
  8605. return function(g, c) {
  8606. var d = g.uiColor,
  8607. d = { id: "." + g.id, defaultBorder: a(d, -0.1), defaultGradient: e(a(d, 0.9), d), lightGradient: e(a(d, 1), a(d, 0.7)), mediumGradient: e(a(d, 0.8), a(d, 0.5)), ckeButtonOn: e(a(d, 0.6), a(d, 0.7)), ckeResizer: a(d, -0.4), ckeToolbarSeparator: a(d, 0.5), ckeColorauto: a(d, 0.8), dialogBody: a(d, 0.7), dialogTabSelected: e("#FFFFFF", "#FFFFFF"), dialogTabSelectedBorder: "#FFF", elementsPathColor: a(d, -0.6), elementsPathBg: d, menubuttonIcon: a(d, 0.5), menubuttonIconHover: a(d, 0.3) };
  8608. return b[c].output(d).replace(/\[/g,
  8609. "{").replace(/\]/g, "}")
  8610. }
  8611. }(), CKEDITOR.plugins.add("dialogui", {
  8612. onLoad: function() {
  8613. var a = function(a) {
  8614. this._ || (this._ = {});
  8615. this._["default"] = this._.initValue = a["default"] || "";
  8616. this._.required = a.required || false;
  8617. for (var b = [this._], c = 1; c < arguments.length; c++) b.push(arguments[c]);
  8618. b.push(true);
  8619. CKEDITOR.tools.extend.apply(CKEDITOR.tools, b);
  8620. return this._
  8621. },
  8622. e = { build: function(a, b, c) { return new CKEDITOR.ui.dialog.textInput(a, b, c) } },
  8623. b = { build: function(a, b, c) { return new CKEDITOR.ui.dialog[b.type](a, b, c) } },
  8624. g = {
  8625. isChanged: function() {
  8626. return this.getValue() !=
  8627. this.getInitValue()
  8628. },
  8629. reset: function(a) { this.setValue(this.getInitValue(), a) },
  8630. setInitValue: function() { this._.initValue = this.getValue() },
  8631. resetInitValue: function() { this._.initValue = this._["default"] },
  8632. getInitValue: function() { return this._.initValue }
  8633. },
  8634. c = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  8635. onChange: function(a, b) {
  8636. if (!this._.domOnChangeRegistered) {
  8637. a.on("load", function() {
  8638. this.getInputElement().on("change", function() {
  8639. a.parts.dialog.isVisible() && this.fire("change", { value: this.getValue() })
  8640. }, this)
  8641. }, this);
  8642. this._.domOnChangeRegistered = true
  8643. }
  8644. this.on("change", b)
  8645. }
  8646. }, true),
  8647. d = /^on([A-Z]\w+)/,
  8648. j = function(a) { for (var b in a)(d.test(b) || b == "title" || b == "type") && delete a[b]; return a };
  8649. CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
  8650. labeledElement: function(b, c, d, g) {
  8651. if (!(arguments.length < 4)) {
  8652. var e = a.call(this, c);
  8653. e.labelId = CKEDITOR.tools.getNextId() + "_label";
  8654. this._.children = [];
  8655. var j = { role: c.role || "presentation" };
  8656. if (c.includeLabel) j["aria-labelledby"] = e.labelId;
  8657. CKEDITOR.ui.dialog.uiElement.call(this,
  8658. b, c, d, "div", null, j,
  8659. function() {
  8660. var a = [],
  8661. d = c.required ? " cke_required" : "";
  8662. if (c.labelLayout != "horizontal") a.push('<label class="cke_dialog_ui_labeled_label' + d + '" ', ' id="' + e.labelId + '"', e.inputId ? ' for="' + e.inputId + '"' : "", (c.labelStyle ? ' style="' + c.labelStyle + '"' : "") + ">", c.label, "</label>", '<div class="cke_dialog_ui_labeled_content"', c.controlStyle ? ' style="' + c.controlStyle + '"' : "", ' role="presentation">', g.call(this, b, c), "</div>");
  8663. else {
  8664. d = {
  8665. type: "hbox",
  8666. widths: c.widths,
  8667. padding: 0,
  8668. children: [{
  8669. type: "html",
  8670. html: '<label class="cke_dialog_ui_labeled_label' +
  8671. d + '" id="' + e.labelId + '" for="' + e.inputId + '"' + (c.labelStyle ? ' style="' + c.labelStyle + '"' : "") + ">" + CKEDITOR.tools.htmlEncode(c.label) + "</span>"
  8672. }, { type: "html", html: '<span class="cke_dialog_ui_labeled_content"' + (c.controlStyle ? ' style="' + c.controlStyle + '"' : "") + ">" + g.call(this, b, c) + "</span>" }]
  8673. };
  8674. CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, d, a)
  8675. }
  8676. return a.join("")
  8677. })
  8678. }
  8679. },
  8680. textInput: function(b, c, d) {
  8681. if (!(arguments.length < 3)) {
  8682. a.call(this, c);
  8683. var g = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
  8684. e = {
  8685. "class": "cke_dialog_ui_input_" +
  8686. c.type,
  8687. id: g,
  8688. type: c.type
  8689. };
  8690. if (c.validate) this.validate = c.validate;
  8691. if (c.maxLength) e.maxlength = c.maxLength;
  8692. if (c.size) e.size = c.size;
  8693. if (c.inputStyle) e.style = c.inputStyle;
  8694. var j = this,
  8695. q = false;
  8696. b.on("load", function() {
  8697. j.getInputElement().on("keydown", function(a) { a.data.getKeystroke() == 13 && (q = true) });
  8698. j.getInputElement().on("keyup", function(a) {
  8699. if (a.data.getKeystroke() == 13 && q) {
  8700. b.getButton("ok") && setTimeout(function() { b.getButton("ok").click() }, 0);
  8701. q = false
  8702. }
  8703. }, null, null, 1E3)
  8704. });
  8705. CKEDITOR.ui.dialog.labeledElement.call(this,
  8706. b, c, d,
  8707. function() {
  8708. var a = ['<div class="cke_dialog_ui_input_', c.type, '" role="presentation"'];
  8709. c.width && a.push('style="width:' + c.width + '" ');
  8710. a.push("><input ");
  8711. e["aria-labelledby"] = this._.labelId;
  8712. this._.required && (e["aria-required"] = this._.required);
  8713. for (var b in e) a.push(b + '="' + e[b] + '" ');
  8714. a.push(" /></div>");
  8715. return a.join("")
  8716. })
  8717. }
  8718. },
  8719. textarea: function(b, c, d) {
  8720. if (!(arguments.length < 3)) {
  8721. a.call(this, c);
  8722. var g = this,
  8723. e = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea",
  8724. j = {};
  8725. if (c.validate) this.validate = c.validate;
  8726. j.rows = c.rows || 5;
  8727. j.cols = c.cols || 20;
  8728. j["class"] = "cke_dialog_ui_input_textarea " + (c["class"] || "");
  8729. if (typeof c.inputStyle != "undefined") j.style = c.inputStyle;
  8730. if (c.dir) j.dir = c.dir;
  8731. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  8732. j["aria-labelledby"] = this._.labelId;
  8733. this._.required && (j["aria-required"] = this._.required);
  8734. var a = ['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="', e, '" '],
  8735. b;
  8736. for (b in j) a.push(b + '="' + CKEDITOR.tools.htmlEncode(j[b]) + '" ');
  8737. a.push(">", CKEDITOR.tools.htmlEncode(g._["default"]),
  8738. "</textarea></div>");
  8739. return a.join("")
  8740. })
  8741. }
  8742. },
  8743. checkbox: function(b, c, d) {
  8744. if (!(arguments.length < 3)) {
  8745. var g = a.call(this, c, { "default": !!c["default"] });
  8746. if (c.validate) this.validate = c.validate;
  8747. CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "span", null, null, function() {
  8748. var a = CKEDITOR.tools.extend({}, c, { id: c.id ? c.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox" }, true),
  8749. d = [],
  8750. e = CKEDITOR.tools.getNextId() + "_label",
  8751. i = { "class": "cke_dialog_ui_checkbox_input", type: "checkbox", "aria-labelledby": e };
  8752. j(a);
  8753. if (c["default"]) i.checked =
  8754. "checked";
  8755. if (typeof a.inputStyle != "undefined") a.style = a.inputStyle;
  8756. g.checkbox = new CKEDITOR.ui.dialog.uiElement(b, a, d, "input", null, i);
  8757. d.push(' <label id="', e, '" for="', i.id, '"' + (c.labelStyle ? ' style="' + c.labelStyle + '"' : "") + ">", CKEDITOR.tools.htmlEncode(c.label), "</label>");
  8758. return d.join("")
  8759. })
  8760. }
  8761. },
  8762. radio: function(b, c, d) {
  8763. if (!(arguments.length < 3)) {
  8764. a.call(this, c);
  8765. if (!this._["default"]) this._["default"] = this._.initValue = c.items[0][1];
  8766. if (c.validate) this.validate = c.valdiate;
  8767. var g = [],
  8768. e = this;
  8769. c.role = "radiogroup";
  8770. c.includeLabel = true;
  8771. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  8772. for (var a = [], d = [], i = (c.id ? c.id : CKEDITOR.tools.getNextId()) + "_radio", l = 0; l < c.items.length; l++) {
  8773. var p = c.items[l],
  8774. t = p[2] !== void 0 ? p[2] : p[0],
  8775. s = p[1] !== void 0 ? p[1] : p[0],
  8776. u = CKEDITOR.tools.getNextId() + "_radio_input",
  8777. w = u + "_label",
  8778. u = CKEDITOR.tools.extend({}, c, { id: u, title: null, type: null }, true),
  8779. t = CKEDITOR.tools.extend({}, u, { title: t }, true),
  8780. x = { type: "radio", "class": "cke_dialog_ui_radio_input", name: i, value: s, "aria-labelledby": w },
  8781. v = [];
  8782. if (e._["default"] == s) x.checked = "checked";
  8783. j(u);
  8784. j(t);
  8785. if (typeof u.inputStyle != "undefined") u.style = u.inputStyle;
  8786. u.keyboardFocusable = true;
  8787. g.push(new CKEDITOR.ui.dialog.uiElement(b, u, v, "input", null, x));
  8788. v.push(" ");
  8789. new CKEDITOR.ui.dialog.uiElement(b, t, v, "label", null, { id: w, "for": x.id }, p[0]);
  8790. a.push(v.join(""))
  8791. }
  8792. new CKEDITOR.ui.dialog.hbox(b, g, a, d);
  8793. return d.join("")
  8794. });
  8795. this._.children = g
  8796. }
  8797. },
  8798. button: function(b, c, d) {
  8799. if (arguments.length) {
  8800. typeof c == "function" && (c = c(b.getParentEditor()));
  8801. a.call(this, c, {
  8802. disabled: c.disabled ||
  8803. false
  8804. });
  8805. CKEDITOR.event.implementOn(this);
  8806. var g = this;
  8807. b.on("load", function() {
  8808. var a = this.getElement();
  8809. (function() {
  8810. a.on("click", function(a) {
  8811. g.click();
  8812. a.data.preventDefault()
  8813. });
  8814. a.on("keydown", function(a) {
  8815. if (a.data.getKeystroke() in { 32: 1 }) {
  8816. g.click();
  8817. a.data.preventDefault()
  8818. }
  8819. })
  8820. })();
  8821. a.unselectable()
  8822. }, this);
  8823. var e = CKEDITOR.tools.extend({}, c);
  8824. delete e.style;
  8825. var j = CKEDITOR.tools.getNextId() + "_label";
  8826. CKEDITOR.ui.dialog.uiElement.call(this, b, e, d, "a", null, {
  8827. style: c.style,
  8828. href: "javascript:void(0)",
  8829. title: c.label,
  8830. hidefocus: "true",
  8831. "class": c["class"],
  8832. role: "button",
  8833. "aria-labelledby": j
  8834. }, '<span id="' + j + '" class="cke_dialog_ui_button">' + CKEDITOR.tools.htmlEncode(c.label) + "</span>")
  8835. }
  8836. },
  8837. select: function(b, c, d) {
  8838. if (!(arguments.length < 3)) {
  8839. var g = a.call(this, c);
  8840. if (c.validate) this.validate = c.validate;
  8841. g.inputId = CKEDITOR.tools.getNextId() + "_select";
  8842. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  8843. var a = CKEDITOR.tools.extend({}, c, { id: c.id ? c.id + "_select" : CKEDITOR.tools.getNextId() + "_select" }, true),
  8844. d = [],
  8845. e = [],
  8846. i = {
  8847. id: g.inputId,
  8848. "class": "cke_dialog_ui_input_select",
  8849. "aria-labelledby": this._.labelId
  8850. };
  8851. d.push('<div class="cke_dialog_ui_input_', c.type, '" role="presentation"');
  8852. c.width && d.push('style="width:' + c.width + '" ');
  8853. d.push(">");
  8854. if (c.size !== void 0) i.size = c.size;
  8855. if (c.multiple !== void 0) i.multiple = c.multiple;
  8856. j(a);
  8857. for (var l = 0, p; l < c.items.length && (p = c.items[l]); l++) e.push('<option value="', CKEDITOR.tools.htmlEncode(p[1] !== void 0 ? p[1] : p[0]).replace(/"/g, "&quot;"), '" /> ', CKEDITOR.tools.htmlEncode(p[0]));
  8858. if (typeof a.inputStyle != "undefined") a.style = a.inputStyle;
  8859. g.select =
  8860. new CKEDITOR.ui.dialog.uiElement(b, a, d, "select", null, i, e.join(""));
  8861. d.push("</div>");
  8862. return d.join("")
  8863. })
  8864. }
  8865. },
  8866. file: function(b, c, d) {
  8867. if (!(arguments.length < 3)) {
  8868. c["default"] === void 0 && (c["default"] = "");
  8869. var g = CKEDITOR.tools.extend(a.call(this, c), { definition: c, buttons: [] });
  8870. if (c.validate) this.validate = c.validate;
  8871. b.on("load", function() { CKEDITOR.document.getById(g.frameId).getParent().addClass("cke_dialog_ui_input_file") });
  8872. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  8873. g.frameId = CKEDITOR.tools.getNextId() +
  8874. "_fileInput";
  8875. var a = ['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="', g.frameId, '" title="', c.label, '" src="javascript:void('];
  8876. a.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
  8877. a.push(')"></iframe>');
  8878. return a.join("")
  8879. })
  8880. }
  8881. },
  8882. fileButton: function(b, c, d) {
  8883. var g = this;
  8884. if (!(arguments.length < 3)) {
  8885. a.call(this, c);
  8886. if (c.validate) this.validate = c.validate;
  8887. var e = CKEDITOR.tools.extend({},
  8888. c),
  8889. j = e.onClick;
  8890. e.className = (e.className ? e.className + " " : "") + "cke_dialog_ui_button";
  8891. e.onClick = function(a) {
  8892. var d = c["for"];
  8893. if (!j || j.call(this, a) !== false) {
  8894. b.getContentElement(d[0], d[1]).submit();
  8895. this.disable()
  8896. }
  8897. };
  8898. b.on("load", function() { b.getContentElement(c["for"][0], c["for"][1])._.buttons.push(g) });
  8899. CKEDITOR.ui.dialog.button.call(this, b, e, d)
  8900. }
  8901. },
  8902. html: function() {
  8903. var a = /^\s*<[\w:]+\s+([^>]*)?>/,
  8904. b = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
  8905. c = /\/$/;
  8906. return function(d, g, e) {
  8907. if (!(arguments.length < 3)) {
  8908. var j = [],
  8909. m = g.html;
  8910. m.charAt(0) != "<" && (m = "<span>" + m + "</span>");
  8911. var l = g.focus;
  8912. if (l) {
  8913. var p = this.focus;
  8914. this.focus = function() {
  8915. (typeof l == "function" ? l : p).call(this);
  8916. this.fire("focus")
  8917. };
  8918. if (g.isFocusable) this.isFocusable = this.isFocusable;
  8919. this.keyboardFocusable = true
  8920. }
  8921. CKEDITOR.ui.dialog.uiElement.call(this, d, g, j, "span", null, null, "");
  8922. j = j.join("").match(a);
  8923. m = m.match(b) || ["", "", ""];
  8924. if (c.test(m[1])) {
  8925. m[1] = m[1].slice(0, -1);
  8926. m[2] = "/" + m[2]
  8927. }
  8928. e.push([m[1], " ", j[1] || "", m[2]].join(""))
  8929. }
  8930. }
  8931. }(),
  8932. fieldset: function(a, b, c, d, g) {
  8933. var e = g.label;
  8934. this._ = { children: b };
  8935. CKEDITOR.ui.dialog.uiElement.call(this, a, g, d, "fieldset", null, null, function() {
  8936. var a = [];
  8937. e && a.push("<legend" + (g.labelStyle ? ' style="' + g.labelStyle + '"' : "") + ">" + e + "</legend>");
  8938. for (var b = 0; b < c.length; b++) a.push(c[b]);
  8939. return a.join("")
  8940. })
  8941. }
  8942. }, true);
  8943. CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
  8944. CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  8945. setLabel: function(a) {
  8946. var b = CKEDITOR.document.getById(this._.labelId);
  8947. b.getChildCount() <
  8948. 1 ? (new CKEDITOR.dom.text(a, CKEDITOR.document)).appendTo(b) : b.getChild(0).$.nodeValue = a;
  8949. return this
  8950. },
  8951. getLabel: function() { var a = CKEDITOR.document.getById(this._.labelId); return !a || a.getChildCount() < 1 ? "" : a.getChild(0).getText() },
  8952. eventProcessors: c
  8953. }, true);
  8954. CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  8955. click: function() { return !this._.disabled ? this.fire("click", { dialog: this._.dialog }) : false },
  8956. enable: function() {
  8957. this._.disabled = false;
  8958. var a = this.getElement();
  8959. a && a.removeClass("cke_disabled")
  8960. },
  8961. disable: function() {
  8962. this._.disabled = true;
  8963. this.getElement().addClass("cke_disabled")
  8964. },
  8965. isVisible: function() { return this.getElement().getFirst().isVisible() },
  8966. isEnabled: function() { return !this._.disabled },
  8967. eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, { onClick: function(a, b) { this.on("click", function() { b.apply(this, arguments) }) } }, true),
  8968. accessKeyUp: function() { this.click() },
  8969. accessKeyDown: function() { this.focus() },
  8970. keyboardFocusable: true
  8971. }, true);
  8972. CKEDITOR.ui.dialog.textInput.prototype =
  8973. CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  8974. getInputElement: function() { return CKEDITOR.document.getById(this._.inputId) },
  8975. focus: function() {
  8976. var a = this.selectParentTab();
  8977. setTimeout(function() {
  8978. var b = a.getInputElement();
  8979. b && b.$.focus()
  8980. }, 0)
  8981. },
  8982. select: function() {
  8983. var a = this.selectParentTab();
  8984. setTimeout(function() {
  8985. var b = a.getInputElement();
  8986. if (b) {
  8987. b.$.focus();
  8988. b.$.select()
  8989. }
  8990. }, 0)
  8991. },
  8992. accessKeyUp: function() { this.select() },
  8993. setValue: function(a) {
  8994. !a && (a = "");
  8995. return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,
  8996. arguments)
  8997. },
  8998. keyboardFocusable: true
  8999. }, g, true);
  9000. CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput;
  9001. CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  9002. getInputElement: function() { return this._.select.getElement() },
  9003. add: function(a, b, c) {
  9004. var d = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
  9005. g = this.getInputElement().$;
  9006. d.$.text = a;
  9007. d.$.value = b === void 0 || b === null ? a : b;
  9008. c === void 0 || c === null ? CKEDITOR.env.ie ? g.add(d.$) : g.add(d.$,
  9009. null) : g.add(d.$, c);
  9010. return this
  9011. },
  9012. remove: function(a) { this.getInputElement().$.remove(a); return this },
  9013. clear: function() { for (var a = this.getInputElement().$; a.length > 0;) a.remove(0); return this },
  9014. keyboardFocusable: true
  9015. }, g, true);
  9016. CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  9017. getInputElement: function() { return this._.checkbox.getElement() },
  9018. setValue: function(a, b) { this.getInputElement().$.checked = a;!b && this.fire("change", { value: a }) },
  9019. getValue: function() { return this.getInputElement().$.checked },
  9020. accessKeyUp: function() { this.setValue(!this.getValue()) },
  9021. eventProcessors: {
  9022. onChange: function(a, b) {
  9023. if (!CKEDITOR.env.ie || CKEDITOR.env.version > 8) return c.onChange.apply(this, arguments);
  9024. a.on("load", function() {
  9025. var a = this._.checkbox.getElement();
  9026. a.on("propertychange", function(b) {
  9027. b = b.data.$;
  9028. b.propertyName == "checked" && this.fire("change", { value: a.$.checked })
  9029. }, this)
  9030. }, this);
  9031. this.on("change", b);
  9032. return null
  9033. }
  9034. },
  9035. keyboardFocusable: true
  9036. }, g, true);
  9037. CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  9038. setValue: function(a, b) { for (var c = this._.children, d, g = 0; g < c.length && (d = c[g]); g++) d.getElement().$.checked = d.getValue() == a;!b && this.fire("change", { value: a }) },
  9039. getValue: function() {
  9040. for (var a = this._.children, b = 0; b < a.length; b++)
  9041. if (a[b].getElement().$.checked) return a[b].getValue();
  9042. return null
  9043. },
  9044. accessKeyUp: function() {
  9045. var a = this._.children,
  9046. b;
  9047. for (b = 0; b < a.length; b++)
  9048. if (a[b].getElement().$.checked) { a[b].getElement().focus(); return }
  9049. a[0].getElement().focus()
  9050. },
  9051. eventProcessors: {
  9052. onChange: function(a, b) {
  9053. if (CKEDITOR.env.ie) {
  9054. a.on("load",
  9055. function() {
  9056. for (var a = this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function(a) {
  9057. a = a.data.$;
  9058. a.propertyName == "checked" && this.$.checked && b.fire("change", { value: this.getAttribute("value") })
  9059. })
  9060. }, this);
  9061. this.on("change", b)
  9062. } else return c.onChange.apply(this, arguments);
  9063. return null
  9064. }
  9065. }
  9066. }, g, true);
  9067. CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, g, {
  9068. getInputElement: function() {
  9069. var a = CKEDITOR.document.getById(this._.frameId).getFrameDocument();
  9070. return a.$.forms.length > 0 ? new CKEDITOR.dom.element(a.$.forms[0].elements[0]) : this.getElement()
  9071. },
  9072. submit: function() { this.getInputElement().getParent().$.submit(); return this },
  9073. getAction: function() { return this.getInputElement().getParent().$.action },
  9074. registerEvents: function(a) {
  9075. var b = /^on([A-Z]\w+)/,
  9076. c, d = function(a, b, c, d) { a.on("formLoaded", function() { a.getInputElement().on(c, d, a) }) },
  9077. g;
  9078. for (g in a)
  9079. if (c = g.match(b)) this.eventProcessors[g] ? this.eventProcessors[g].call(this, this._.dialog, a[g]) : d(this, this._.dialog,
  9080. c[1].toLowerCase(), a[g]);
  9081. return this
  9082. },
  9083. reset: function() {
  9084. function a() {
  9085. c.$.open();
  9086. var f = "";
  9087. d.size && (f = d.size - (CKEDITOR.env.ie ? 7 : 0));
  9088. var t = b.frameId + "_input";
  9089. c.$.write(['<html dir="' + m + '" lang="' + l + '"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">', '<form enctype="multipart/form-data" method="POST" dir="' + m + '" lang="' + l + '" action="', CKEDITOR.tools.htmlEncode(d.action), '"><label id="', b.labelId, '" for="', t, '" style="display:none">', CKEDITOR.tools.htmlEncode(d.label),
  9090. '</label><input style="width:100%" id="', t, '" aria-labelledby="', b.labelId, '" type="file" name="', CKEDITOR.tools.htmlEncode(d.id || "cke_upload"), '" size="', CKEDITOR.tools.htmlEncode(f > 0 ? f : ""), '" /></form></body></html><script>', CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "", "window.parent.CKEDITOR.tools.callFunction(" + e + ");", "window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction(" + j + ")}", "<\/script>"
  9091. ].join(""));
  9092. c.$.close();
  9093. for (f = 0; f < g.length; f++) g[f].enable()
  9094. }
  9095. var b =
  9096. this._,
  9097. c = CKEDITOR.document.getById(b.frameId).getFrameDocument(),
  9098. d = b.definition,
  9099. g = b.buttons,
  9100. e = this.formLoadedNumber,
  9101. j = this.formUnloadNumber,
  9102. m = b.dialog._.editor.lang.dir,
  9103. l = b.dialog._.editor.langCode;
  9104. if (!e) {
  9105. e = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() { this.fire("formLoaded") }, this);
  9106. j = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() { this.getInputElement().clearCustomData() }, this);
  9107. this.getDialog()._.editor.on("destroy", function() {
  9108. CKEDITOR.tools.removeFunction(e);
  9109. CKEDITOR.tools.removeFunction(j)
  9110. })
  9111. }
  9112. CKEDITOR.env.gecko ?
  9113. setTimeout(a, 500) : a()
  9114. },
  9115. getValue: function() { return this.getInputElement().$.value || "" },
  9116. setInitValue: function() { this._.initValue = "" },
  9117. eventProcessors: {
  9118. onChange: function(a, b) {
  9119. if (!this._.domOnChangeRegistered) {
  9120. this.on("formLoaded", function() { this.getInputElement().on("change", function() { this.fire("change", { value: this.getValue() }) }, this) }, this);
  9121. this._.domOnChangeRegistered = true
  9122. }
  9123. this.on("change", b)
  9124. }
  9125. },
  9126. keyboardFocusable: true
  9127. }, true);
  9128. CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
  9129. CKEDITOR.ui.dialog.fieldset.prototype =
  9130. CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
  9131. CKEDITOR.dialog.addUIElement("text", e);
  9132. CKEDITOR.dialog.addUIElement("password", e);
  9133. CKEDITOR.dialog.addUIElement("textarea", b);
  9134. CKEDITOR.dialog.addUIElement("checkbox", b);
  9135. CKEDITOR.dialog.addUIElement("radio", b);
  9136. CKEDITOR.dialog.addUIElement("button", b);
  9137. CKEDITOR.dialog.addUIElement("select", b);
  9138. CKEDITOR.dialog.addUIElement("file", b);
  9139. CKEDITOR.dialog.addUIElement("fileButton", b);
  9140. CKEDITOR.dialog.addUIElement("html", b);
  9141. CKEDITOR.dialog.addUIElement("fieldset", {
  9142. build: function(a, b, c) {
  9143. for (var d = b.children, g, e = [], j = [], m = 0; m < d.length && (g = d[m]); m++) {
  9144. var l = [];
  9145. e.push(l);
  9146. j.push(CKEDITOR.dialog._.uiElementBuilders[g.type].build(a, g, l))
  9147. }
  9148. return new CKEDITOR.ui.dialog[b.type](a, j, e, c, b)
  9149. }
  9150. })
  9151. }
  9152. }), CKEDITOR.DIALOG_RESIZE_NONE = 0, CKEDITOR.DIALOG_RESIZE_WIDTH = 1, CKEDITOR.DIALOG_RESIZE_HEIGHT = 2, CKEDITOR.DIALOG_RESIZE_BOTH = 3,
  9153. function() {
  9154. function a() {
  9155. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--)
  9156. if (this._.tabs[this._.tabIdList[c %
  9157. a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  9158. return null
  9159. }
  9160. function e() {
  9161. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++)
  9162. if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  9163. return null
  9164. }
  9165. function b(a, b) {
  9166. for (var c = a.$.getElementsByTagName("input"), d = 0, f = c.length; d < f; d++) {
  9167. var g = new CKEDITOR.dom.element(c[d]);
  9168. if (g.getAttribute("type").toLowerCase() == "text")
  9169. if (b) {
  9170. g.setAttribute("value", g.getCustomData("fake_value") ||
  9171. "");
  9172. g.removeCustomData("fake_value")
  9173. } else {
  9174. g.setCustomData("fake_value", g.getAttribute("value"));
  9175. g.setAttribute("value", "")
  9176. }
  9177. }
  9178. }
  9179. function g(a, b) {
  9180. var c = this.getInputElement();
  9181. c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", true));
  9182. a || (this.select ? this.select() : this.focus());
  9183. b && alert(b);
  9184. this.fire("validated", { valid: a, msg: b })
  9185. }
  9186. function c() {
  9187. var a = this.getInputElement();
  9188. a && a.removeAttribute("aria-invalid")
  9189. }
  9190. function d(a) {
  9191. var a = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",
  9192. l).output({ id: CKEDITOR.tools.getNextNumber(), editorId: a.id, langDir: a.lang.dir, langCode: a.langCode, editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog", closeTitle: a.lang.common.close, hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : "" })),
  9193. b = a.getChild([0, 0, 0, 0, 0]),
  9194. c = b.getChild(0),
  9195. d = b.getChild(1);
  9196. if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  9197. var f = "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())";
  9198. CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="' +
  9199. f + '" tabIndex="-1"></iframe>').appendTo(b.getParent())
  9200. }
  9201. c.unselectable();
  9202. d.unselectable();
  9203. return { element: a, parts: { dialog: a.getChild(0), title: c, close: d, tabs: b.getChild(2), contents: b.getChild([3, 0, 0, 0]), footer: b.getChild([3, 0, 1, 0]) } }
  9204. }
  9205. function j(a, b, c) {
  9206. this.element = b;
  9207. this.focusIndex = c;
  9208. this.tabIndex = 0;
  9209. this.isFocusable = function() { return !b.getAttribute("disabled") && b.isVisible() };
  9210. this.focus = function() {
  9211. a._.currentFocusIndex = this.focusIndex;
  9212. this.element.focus()
  9213. };
  9214. b.on("keydown", function(a) {
  9215. a.data.getKeystroke() in { 32: 1, 13: 1 } && this.fire("click")
  9216. });
  9217. b.on("focus", function() { this.fire("mouseover") });
  9218. b.on("blur", function() { this.fire("mouseout") })
  9219. }
  9220. function f(a) {
  9221. function b() { a.layout() }
  9222. var c = CKEDITOR.document.getWindow();
  9223. c.on("resize", b);
  9224. a.on("hide", function() { c.removeListener("resize", b) })
  9225. }
  9226. function h(a, b) {
  9227. this._ = { dialog: a };
  9228. CKEDITOR.tools.extend(this, b)
  9229. }
  9230. function i(a) {
  9231. function b(c) {
  9232. var j = a.getSize(),
  9233. i = CKEDITOR.document.getWindow().getViewPaneSize(),
  9234. k = c.data.$.screenX,
  9235. p = c.data.$.screenY,
  9236. s = k - d.x,
  9237. t = p - d.y;
  9238. d = { x: k, y: p };
  9239. f.x = f.x + s;
  9240. f.y = f.y + t;
  9241. a.move(f.x + h[3] < e ? -h[3] : f.x - h[1] > i.width - j.width - e ? i.width - j.width + (g.lang.dir == "rtl" ? 0 : h[1]) : f.x, f.y + h[0] < e ? -h[0] : f.y - h[2] > i.height - j.height - e ? i.height - j.height + h[2] : f.y, 1);
  9242. c.data.preventDefault()
  9243. }
  9244. function c() {
  9245. CKEDITOR.document.removeListener("mousemove", b);
  9246. CKEDITOR.document.removeListener("mouseup", c);
  9247. if (CKEDITOR.env.ie6Compat) {
  9248. var a = r.getChild(0).getFrameDocument();
  9249. a.removeListener("mousemove", b);
  9250. a.removeListener("mouseup", c)
  9251. }
  9252. }
  9253. var d = null,
  9254. f = null,
  9255. g = a.getParentEditor(),
  9256. e = g.config.dialog_magnetDistance,
  9257. h = CKEDITOR.skin.margins || [0, 0, 0, 0];
  9258. typeof e == "undefined" && (e = 20);
  9259. a.parts.title.on("mousedown", function(g) {
  9260. d = { x: g.data.$.screenX, y: g.data.$.screenY };
  9261. CKEDITOR.document.on("mousemove", b);
  9262. CKEDITOR.document.on("mouseup", c);
  9263. f = a.getPosition();
  9264. if (CKEDITOR.env.ie6Compat) {
  9265. var e = r.getChild(0).getFrameDocument();
  9266. e.on("mousemove", b);
  9267. e.on("mouseup", c)
  9268. }
  9269. g.data.preventDefault()
  9270. }, a)
  9271. }
  9272. function k(a) {
  9273. var b, c;
  9274. function d(f) {
  9275. var s = h.lang.dir == "rtl",
  9276. t = p.width,
  9277. m = p.height,
  9278. l = t + (f.data.$.screenX - b) * (s ? -1 : 1) * (a._.moved ? 1 : 2),
  9279. n =
  9280. m + (f.data.$.screenY - c) * (a._.moved ? 1 : 2),
  9281. u = a._.element.getFirst(),
  9282. u = s && u.getComputedStyle("right"),
  9283. q = a.getPosition();
  9284. q.y + n > k.height && (n = k.height - q.y);
  9285. if ((s ? u : q.x) + l > k.width) l = k.width - (s ? u : q.x);
  9286. if (e == CKEDITOR.DIALOG_RESIZE_WIDTH || e == CKEDITOR.DIALOG_RESIZE_BOTH) t = Math.max(g.minWidth || 0, l - j);
  9287. if (e == CKEDITOR.DIALOG_RESIZE_HEIGHT || e == CKEDITOR.DIALOG_RESIZE_BOTH) m = Math.max(g.minHeight || 0, n - i);
  9288. a.resize(t, m);
  9289. a._.moved || a.layout();
  9290. f.data.preventDefault()
  9291. }
  9292. function f() {
  9293. CKEDITOR.document.removeListener("mouseup",
  9294. f);
  9295. CKEDITOR.document.removeListener("mousemove", d);
  9296. if (s) {
  9297. s.remove();
  9298. s = null
  9299. }
  9300. if (CKEDITOR.env.ie6Compat) {
  9301. var a = r.getChild(0).getFrameDocument();
  9302. a.removeListener("mouseup", f);
  9303. a.removeListener("mousemove", d)
  9304. }
  9305. }
  9306. var g = a.definition,
  9307. e = g.resizable;
  9308. if (e != CKEDITOR.DIALOG_RESIZE_NONE) {
  9309. var h = a.getParentEditor(),
  9310. j, i, k, p, s, t = CKEDITOR.tools.addFunction(function(g) {
  9311. p = a.getSize();
  9312. var e = a.parts.contents;
  9313. if (e.$.getElementsByTagName("iframe").length) {
  9314. s = CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>');
  9315. e.append(s)
  9316. }
  9317. i = p.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks));
  9318. j = p.width - a.parts.contents.getSize("width", 1);
  9319. b = g.screenX;
  9320. c = g.screenY;
  9321. k = CKEDITOR.document.getWindow().getViewPaneSize();
  9322. CKEDITOR.document.on("mousemove", d);
  9323. CKEDITOR.document.on("mouseup", f);
  9324. if (CKEDITOR.env.ie6Compat) {
  9325. e = r.getChild(0).getFrameDocument();
  9326. e.on("mousemove", d);
  9327. e.on("mouseup", f)
  9328. }
  9329. g.preventDefault && g.preventDefault()
  9330. });
  9331. a.on("load", function() {
  9332. var b = "";
  9333. e == CKEDITOR.DIALOG_RESIZE_WIDTH ?
  9334. b = " cke_resizer_horizontal" : e == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical");
  9335. b = CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer' + b + " cke_resizer_" + h.lang.dir + '" title="' + CKEDITOR.tools.htmlEncode(h.lang.common.resize) + '" onmousedown="CKEDITOR.tools.callFunction(' + t + ', event )">' + (h.lang.dir == "ltr" ? "◢" : "◣") + "</div>");
  9336. a.parts.footer.append(b, 1)
  9337. });
  9338. h.on("destroy", function() { CKEDITOR.tools.removeFunction(t) })
  9339. }
  9340. }
  9341. function n(a) { a.data.preventDefault(1) }
  9342. function o(a) {
  9343. var b = CKEDITOR.document.getWindow(),
  9344. c = a.config,
  9345. d = c.dialog_backgroundCoverColor || "white",
  9346. f = c.dialog_backgroundCoverOpacity,
  9347. g = c.baseFloatZIndex,
  9348. c = CKEDITOR.tools.genKey(d, f, g),
  9349. e = v[c];
  9350. if (e) e.show();
  9351. else {
  9352. g = ['<div tabIndex="-1" style="position: ', CKEDITOR.env.ie6Compat ? "absolute" : "fixed", "; z-index: ", g, "; top: 0px; left: 0px; ", !CKEDITOR.env.ie6Compat ? "background-color: " + d : "", '" class="cke_dialog_background_cover">'];
  9353. if (CKEDITOR.env.ie6Compat) {
  9354. d = "<html><body style=\\'background-color:" + d + ";\\'></body></html>";
  9355. g.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');
  9356. g.push("void((function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.write( '" + d + "' );document.close();") + "})())");
  9357. g.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')
  9358. }
  9359. g.push("</div>");
  9360. e = CKEDITOR.dom.element.createFromHtml(g.join(""));
  9361. e.setOpacity(f !== void 0 ? f : 0.5);
  9362. e.on("keydown", n);
  9363. e.on("keypress", n);
  9364. e.on("keyup", n);
  9365. e.appendTo(CKEDITOR.document.getBody());
  9366. v[c] = e
  9367. }
  9368. a.focusManager.add(e);
  9369. r = e;
  9370. var a = function() {
  9371. var a = b.getViewPaneSize();
  9372. e.setStyles({ width: a.width + "px", height: a.height + "px" })
  9373. },
  9374. h = function() {
  9375. var a = b.getScrollPosition(),
  9376. c = CKEDITOR.dialog._.currentTop;
  9377. e.setStyles({ left: a.x + "px", top: a.y + "px" });
  9378. if (c) {
  9379. do {
  9380. a = c.getPosition();
  9381. c.move(a.x, a.y)
  9382. } while (c = c._.parentDialog)
  9383. }
  9384. };
  9385. x = a;
  9386. b.on("resize", a);
  9387. a();
  9388. (!CKEDITOR.env.mac || !CKEDITOR.env.webkit) && e.focus();
  9389. if (CKEDITOR.env.ie6Compat) {
  9390. var j = function() {
  9391. h();
  9392. arguments.callee.prevScrollHandler.apply(this, arguments)
  9393. };
  9394. b.$.setTimeout(function() {
  9395. j.prevScrollHandler =
  9396. window.onscroll || function() {};
  9397. window.onscroll = j
  9398. }, 0);
  9399. h()
  9400. }
  9401. }
  9402. function q(a) {
  9403. if (r) {
  9404. a.focusManager.remove(r);
  9405. a = CKEDITOR.document.getWindow();
  9406. r.hide();
  9407. a.removeListener("resize", x);
  9408. CKEDITOR.env.ie6Compat && a.$.setTimeout(function() { window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null }, 0);
  9409. x = null
  9410. }
  9411. }
  9412. var m = CKEDITOR.tools.cssLength,
  9413. l = '<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog ' +
  9414. CKEDITOR.env.cssClass + ' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';
  9415. CKEDITOR.dialog = function(b, f) {
  9416. function h() {
  9417. var a = v._.focusList;
  9418. a.sort(function(a, b) { return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex });
  9419. for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
  9420. }
  9421. function j(a) {
  9422. var b = v._.focusList,
  9423. a = a || 0;
  9424. if (!(b.length < 1)) {
  9425. var c = v._.currentFocusIndex;
  9426. try { b[c].getInputElement().$.blur() } catch (d) {}
  9427. for (var f = c = (c + a + b.length) % b.length; a && !b[f].isFocusable();) { f = (f + a + b.length) % b.length; if (f == c) break }
  9428. b[f].focus();
  9429. b[f].type == "text" && b[f].select()
  9430. }
  9431. }
  9432. function s(c) {
  9433. if (v ==
  9434. CKEDITOR.dialog._.currentTop) {
  9435. var d = c.data.getKeystroke(),
  9436. f = b.lang.dir == "rtl";
  9437. o = x = 0;
  9438. if (d == 9 || d == CKEDITOR.SHIFT + 9) {
  9439. d = d == CKEDITOR.SHIFT + 9;
  9440. if (v._.tabBarMode) {
  9441. d = d ? a.call(v) : e.call(v);
  9442. v.selectPage(d);
  9443. v._.tabs[d][0].focus()
  9444. } else j(d ? -1 : 1);
  9445. o = 1
  9446. } else if (d == CKEDITOR.ALT + 121 && !v._.tabBarMode && v.getPageCount() > 1) {
  9447. v._.tabBarMode = true;
  9448. v._.tabs[v._.currentTabId][0].focus();
  9449. o = 1
  9450. } else if ((d == 37 || d == 39) && v._.tabBarMode) {
  9451. d = d == (f ? 39 : 37) ? a.call(v) : e.call(v);
  9452. v.selectPage(d);
  9453. v._.tabs[d][0].focus();
  9454. o = 1
  9455. } else if ((d == 13 || d ==
  9456. 32) && v._.tabBarMode) {
  9457. this.selectPage(this._.currentTabId);
  9458. this._.tabBarMode = false;
  9459. this._.currentFocusIndex = -1;
  9460. j(1);
  9461. o = 1
  9462. } else if (d == 13) {
  9463. d = c.data.getTarget();
  9464. if (!d.is("a", "button", "select", "textarea") && (!d.is("input") || d.$.type != "button")) {
  9465. (d = this.getButton("ok")) && CKEDITOR.tools.setTimeout(d.click, 0, d);
  9466. o = 1
  9467. }
  9468. x = 1
  9469. } else if (d == 27) {
  9470. (d = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(d.click, 0, d): this.fire("cancel", { hide: true }).hide !== false && this.hide();
  9471. x = 1
  9472. } else return;
  9473. t(c)
  9474. }
  9475. }
  9476. function t(a) {
  9477. o ? a.data.preventDefault(1) :
  9478. x && a.data.stopPropagation()
  9479. }
  9480. var m = CKEDITOR.dialog._.dialogDefinitions[f],
  9481. l = CKEDITOR.tools.clone(p),
  9482. n = b.config.dialog_buttonsOrder || "OS",
  9483. u = b.lang.dir,
  9484. q = {},
  9485. o, x;
  9486. (n == "OS" && CKEDITOR.env.mac || n == "rtl" && u == "ltr" || n == "ltr" && u == "rtl") && l.buttons.reverse();
  9487. m = CKEDITOR.tools.extend(m(b), l);
  9488. m = CKEDITOR.tools.clone(m);
  9489. m = new w(this, m);
  9490. l = d(b);
  9491. this._ = {
  9492. editor: b,
  9493. element: l.element,
  9494. name: f,
  9495. contentSize: { width: 0, height: 0 },
  9496. size: { width: 0, height: 0 },
  9497. contents: {},
  9498. buttons: {},
  9499. accessKeyMap: {},
  9500. tabs: {},
  9501. tabIdList: [],
  9502. currentTabId: null,
  9503. currentTabIndex: null,
  9504. pageCount: 0,
  9505. lastTab: null,
  9506. tabBarMode: false,
  9507. focusList: [],
  9508. currentFocusIndex: 0,
  9509. hasFocus: false
  9510. };
  9511. this.parts = l.parts;
  9512. CKEDITOR.tools.setTimeout(function() { b.fire("ariaWidget", this.parts.contents) }, 0, this);
  9513. l = { position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed", top: 0, visibility: "hidden" };
  9514. l[u == "rtl" ? "right" : "left"] = 0;
  9515. this.parts.dialog.setStyles(l);
  9516. CKEDITOR.event.call(this);
  9517. this.definition = m = CKEDITOR.fire("dialogDefinition", { name: f, definition: m }, b).definition;
  9518. if (!("removeDialogTabs" in b._) &&
  9519. b.config.removeDialogTabs) {
  9520. l = b.config.removeDialogTabs.split(";");
  9521. for (u = 0; u < l.length; u++) {
  9522. n = l[u].split(":");
  9523. if (n.length == 2) {
  9524. var r = n[0];
  9525. q[r] || (q[r] = []);
  9526. q[r].push(n[1])
  9527. }
  9528. }
  9529. b._.removeDialogTabs = q
  9530. }
  9531. if (b._.removeDialogTabs && (q = b._.removeDialogTabs[f]))
  9532. for (u = 0; u < q.length; u++) m.removeContents(q[u]);
  9533. if (m.onLoad) this.on("load", m.onLoad);
  9534. if (m.onShow) this.on("show", m.onShow);
  9535. if (m.onHide) this.on("hide", m.onHide);
  9536. if (m.onOk) this.on("ok", function(a) {
  9537. b.fire("saveSnapshot");
  9538. setTimeout(function() { b.fire("saveSnapshot") },
  9539. 0);
  9540. if (m.onOk.call(this, a) === false) a.data.hide = false
  9541. });
  9542. if (m.onCancel) this.on("cancel", function(a) { if (m.onCancel.call(this, a) === false) a.data.hide = false });
  9543. var v = this,
  9544. z = function(a) {
  9545. var b = v._.contents,
  9546. c = false,
  9547. d;
  9548. for (d in b)
  9549. for (var f in b[d])
  9550. if (c = a.call(this, b[d][f])) return
  9551. };
  9552. this.on("ok", function(a) {
  9553. z(function(b) {
  9554. if (b.validate) {
  9555. var c = b.validate(this),
  9556. d = typeof c == "string" || c === false;
  9557. if (d) {
  9558. a.data.hide = false;
  9559. a.stop()
  9560. }
  9561. g.call(b, !d, typeof c == "string" ? c : void 0);
  9562. return d
  9563. }
  9564. })
  9565. }, this, null, 0);
  9566. this.on("cancel", function(a) {
  9567. z(function(c) {
  9568. if (c.isChanged()) {
  9569. if (!b.config.dialog_noConfirmCancel &&
  9570. !confirm(b.lang.common.confirmCancel)) a.data.hide = false;
  9571. return true
  9572. }
  9573. })
  9574. }, this, null, 0);
  9575. this.parts.close.on("click", function(a) {
  9576. this.fire("cancel", { hide: true }).hide !== false && this.hide();
  9577. a.data.preventDefault()
  9578. }, this);
  9579. this.changeFocus = j;
  9580. var y = this._.element;
  9581. b.focusManager.add(y, 1);
  9582. this.on("show", function() { y.on("keydown", s, this); if (CKEDITOR.env.gecko) y.on("keypress", t, this) });
  9583. this.on("hide", function() {
  9584. y.removeListener("keydown", s);
  9585. CKEDITOR.env.gecko && y.removeListener("keypress", t);
  9586. z(function(a) { c.apply(a) })
  9587. });
  9588. this.on("iframeAdded", function(a) {
  9589. (new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", s, this, null, 0)
  9590. });
  9591. this.on("show", function() {
  9592. h();
  9593. if (b.config.dialog_startupFocusTab && v._.pageCount > 1) {
  9594. v._.tabBarMode = true;
  9595. v._.tabs[v._.currentTabId][0].focus()
  9596. } else if (!this._.hasFocus) {
  9597. this._.currentFocusIndex = -1;
  9598. if (m.onFocus) {
  9599. var a = m.onFocus.call(this);
  9600. a && a.focus()
  9601. } else j(1)
  9602. }
  9603. }, this, null, 4294967295);
  9604. if (CKEDITOR.env.ie6Compat) this.on("load", function() {
  9605. var a = this.getElement(),
  9606. b = a.getFirst();
  9607. b.remove();
  9608. b.appendTo(a)
  9609. }, this);
  9610. i(this);
  9611. k(this);
  9612. (new CKEDITOR.dom.text(m.title, CKEDITOR.document)).appendTo(this.parts.title);
  9613. for (u = 0; u < m.contents.length; u++)(q = m.contents[u]) && this.addPage(q);
  9614. this.parts.tabs.on("click", function(a) {
  9615. var b = a.data.getTarget();
  9616. if (b.hasClass("cke_dialog_tab")) {
  9617. b = b.$.id;
  9618. this.selectPage(b.substring(4, b.lastIndexOf("_")));
  9619. if (this._.tabBarMode) {
  9620. this._.tabBarMode = false;
  9621. this._.currentFocusIndex = -1;
  9622. j(1)
  9623. }
  9624. a.data.preventDefault()
  9625. }
  9626. }, this);
  9627. u = [];
  9628. q = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, { type: "hbox", className: "cke_dialog_footer_buttons", widths: [], children: m.buttons }, u).getChild();
  9629. this.parts.footer.setHtml(u.join(""));
  9630. for (u = 0; u < q.length; u++) this._.buttons[q[u].id] = q[u]
  9631. };
  9632. CKEDITOR.dialog.prototype = {
  9633. destroy: function() {
  9634. this.hide();
  9635. this._.element.remove()
  9636. },
  9637. resize: function() {
  9638. return function(a, b) {
  9639. if (!this._.contentSize || !(this._.contentSize.width == a && this._.contentSize.height == b)) {
  9640. CKEDITOR.dialog.fire("resize", { dialog: this, width: a, height: b }, this._.editor);
  9641. this.fire("resize", { width: a, height: b },
  9642. this._.editor);
  9643. this.parts.contents.setStyles({ width: a + "px", height: b + "px" });
  9644. if (this._.editor.lang.dir == "rtl" && this._.position) this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle("right"), 10);
  9645. this._.contentSize = { width: a, height: b }
  9646. }
  9647. }
  9648. }(),
  9649. getSize: function() { var a = this._.element.getFirst(); return { width: a.$.offsetWidth || 0, height: a.$.offsetHeight || 0 } },
  9650. move: function(a, b, c) {
  9651. var d = this._.element.getFirst(),
  9652. f = this._.editor.lang.dir ==
  9653. "rtl",
  9654. g = d.getComputedStyle("position") == "fixed";
  9655. CKEDITOR.env.ie && d.setStyle("zoom", "100%");
  9656. if (!g || !this._.position || !(this._.position.x == a && this._.position.y == b)) {
  9657. this._.position = { x: a, y: b };
  9658. if (!g) {
  9659. g = CKEDITOR.document.getWindow().getScrollPosition();
  9660. a = a + g.x;
  9661. b = b + g.y
  9662. }
  9663. if (f) {
  9664. g = this.getSize();
  9665. a = CKEDITOR.document.getWindow().getViewPaneSize().width - g.width - a
  9666. }
  9667. b = { top: (b > 0 ? b : 0) + "px" };
  9668. b[f ? "right" : "left"] = (a > 0 ? a : 0) + "px";
  9669. d.setStyles(b);
  9670. c && (this._.moved = 1)
  9671. }
  9672. },
  9673. getPosition: function() {
  9674. return CKEDITOR.tools.extend({},
  9675. this._.position)
  9676. },
  9677. show: function() {
  9678. var a = this._.element,
  9679. b = this.definition;
  9680. !a.getParent() || !a.getParent().equals(CKEDITOR.document.getBody()) ? a.appendTo(CKEDITOR.document.getBody()) : a.setStyle("display", "block");
  9681. this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight);
  9682. this.reset();
  9683. this.selectPage(this.definition.contents[0].id);
  9684. if (CKEDITOR.dialog._.currentZIndex === null) CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
  9685. this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex = CKEDITOR.dialog._.currentZIndex + 10);
  9686. if (CKEDITOR.dialog._.currentTop === null) {
  9687. CKEDITOR.dialog._.currentTop = this;
  9688. this._.parentDialog = null;
  9689. o(this._.editor)
  9690. } else {
  9691. this._.parentDialog = CKEDITOR.dialog._.currentTop;
  9692. this._.parentDialog.getElement().getFirst().$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex / 2);
  9693. CKEDITOR.dialog._.currentTop = this
  9694. }
  9695. a.on("keydown", z);
  9696. a.on("keyup", B);
  9697. this._.hasFocus = false;
  9698. for (var c in b.contents)
  9699. if (b.contents[c]) {
  9700. var a =
  9701. b.contents[c],
  9702. d = this._.tabs[a.id],
  9703. g = a.requiredContent,
  9704. e = 0;
  9705. if (d) {
  9706. for (var h in this._.contents[a.id]) {
  9707. var j = this._.contents[a.id][h];
  9708. if (!(j.type == "hbox" || j.type == "vbox" || !j.getInputElement()))
  9709. if (j.requiredContent && !this._.editor.activeFilter.check(j.requiredContent)) j.disable();
  9710. else {
  9711. j.enable();
  9712. e++
  9713. }
  9714. }!e || g && !this._.editor.activeFilter.check(g) ? d[0].addClass("cke_dialog_tab_disabled") : d[0].removeClass("cke_dialog_tab_disabled")
  9715. }
  9716. }
  9717. CKEDITOR.tools.setTimeout(function() {
  9718. this.layout();
  9719. f(this);
  9720. this.parts.dialog.setStyle("visibility",
  9721. "");
  9722. this.fireOnce("load", {});
  9723. CKEDITOR.ui.fire("ready", this);
  9724. this.fire("show", {});
  9725. this._.editor.fire("dialogShow", this);
  9726. this._.parentDialog || this._.editor.focusManager.lock();
  9727. this.foreach(function(a) { a.setInitValue && a.setInitValue() })
  9728. }, 100, this)
  9729. },
  9730. layout: function() {
  9731. var a = this.parts.dialog,
  9732. b = this.getSize(),
  9733. c = CKEDITOR.document.getWindow().getViewPaneSize(),
  9734. d = (c.width - b.width) / 2,
  9735. f = (c.height - b.height) / 2;
  9736. CKEDITOR.env.ie6Compat || (b.height + (f > 0 ? f : 0) > c.height || b.width + (d > 0 ? d : 0) > c.width ? a.setStyle("position",
  9737. "absolute") : a.setStyle("position", "fixed"));
  9738. this.move(this._.moved ? this._.position.x : d, this._.moved ? this._.position.y : f)
  9739. },
  9740. foreach: function(a) {
  9741. for (var b in this._.contents)
  9742. for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
  9743. return this
  9744. },
  9745. reset: function() { var a = function(a) { a.reset && a.reset(1) }; return function() { this.foreach(a); return this } }(),
  9746. setupContent: function() {
  9747. var a = arguments;
  9748. this.foreach(function(b) { b.setup && b.setup.apply(b, a) })
  9749. },
  9750. commitContent: function() {
  9751. var a = arguments;
  9752. this.foreach(function(b) {
  9753. CKEDITOR.env.ie &&
  9754. this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
  9755. b.commit && b.commit.apply(b, a)
  9756. })
  9757. },
  9758. hide: function() {
  9759. if (this.parts.dialog.isVisible()) {
  9760. this.fire("hide", {});
  9761. this._.editor.fire("dialogHide", this);
  9762. this.selectPage(this._.tabIdList[0]);
  9763. var a = this._.element;
  9764. a.setStyle("display", "none");
  9765. this.parts.dialog.setStyle("visibility", "hidden");
  9766. for (G(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
  9767. if (this._.parentDialog) {
  9768. var b = this._.parentDialog.getElement().getFirst();
  9769. b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2))
  9770. } else q(this._.editor);
  9771. if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex = CKEDITOR.dialog._.currentZIndex - 10;
  9772. else {
  9773. CKEDITOR.dialog._.currentZIndex = null;
  9774. a.removeListener("keydown", z);
  9775. a.removeListener("keyup", B);
  9776. var c = this._.editor;
  9777. c.focus();
  9778. setTimeout(function() {
  9779. c.focusManager.unlock();
  9780. CKEDITOR.env.iOS && c.window.focus()
  9781. }, 0)
  9782. }
  9783. delete this._.parentDialog;
  9784. this.foreach(function(a) {
  9785. a.resetInitValue &&
  9786. a.resetInitValue()
  9787. })
  9788. }
  9789. },
  9790. addPage: function(a) {
  9791. if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
  9792. for (var b = [], c = a.label ? ' title="' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", d = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, { type: "vbox", className: "cke_dialog_page_contents", children: a.elements, expand: !!a.expand, padding: a.padding, style: a.style || "width: 100%;" }, b), f = this._.contents[a.id] = {}, g = d.getChild(), e = 0; d = g.shift();) {
  9793. !d.notAllowed && (d.type != "hbox" && d.type != "vbox") && e++;
  9794. f[d.id] =
  9795. d;
  9796. typeof d.getChild == "function" && g.push.apply(g, d.getChild())
  9797. }
  9798. if (!e) a.hidden = true;
  9799. b = CKEDITOR.dom.element.createFromHtml(b.join(""));
  9800. b.setAttribute("role", "tabpanel");
  9801. d = CKEDITOR.env;
  9802. f = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
  9803. c = CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"', this._.pageCount > 0 ? " cke_last" : "cke_first", c, a.hidden ? ' style="display:none"' : "", ' id="', f, '"', d.gecko && !d.hc ? "" : ' href="javascript:void(0)"', ' tabIndex="-1" hidefocus="true" role="tab">', a.label, "</a>"].join(""));
  9804. b.setAttribute("aria-labelledby", f);
  9805. this._.tabs[a.id] = [c, b];
  9806. this._.tabIdList.push(a.id);
  9807. !a.hidden && this._.pageCount++;
  9808. this._.lastTab = c;
  9809. this.updateStyle();
  9810. b.setAttribute("name", a.id);
  9811. b.appendTo(this.parts.contents);
  9812. c.unselectable();
  9813. this.parts.tabs.append(c);
  9814. if (a.accessKey) {
  9815. A(this, this, "CTRL+" + a.accessKey, J, D);
  9816. this._.accessKeyMap["CTRL+" + a.accessKey] = a.id
  9817. }
  9818. }
  9819. },
  9820. selectPage: function(a) {
  9821. if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && this.fire("selectPage", { page: a, currentPage: this._.currentTabId }) !==
  9822. false) {
  9823. for (var c in this._.tabs) {
  9824. var d = this._.tabs[c][0],
  9825. f = this._.tabs[c][1];
  9826. if (c != a) {
  9827. d.removeClass("cke_dialog_tab_selected");
  9828. f.hide()
  9829. }
  9830. f.setAttribute("aria-hidden", c != a)
  9831. }
  9832. var g = this._.tabs[a];
  9833. g[0].addClass("cke_dialog_tab_selected");
  9834. if (CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat) {
  9835. b(g[1]);
  9836. g[1].show();
  9837. setTimeout(function() { b(g[1], 1) }, 0)
  9838. } else g[1].show();
  9839. this._.currentTabId = a;
  9840. this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
  9841. }
  9842. },
  9843. updateStyle: function() {
  9844. this.parts.dialog[(this._.pageCount ===
  9845. 1 ? "add" : "remove") + "Class"]("cke_single_page")
  9846. },
  9847. hidePage: function(b) {
  9848. var c = this._.tabs[b] && this._.tabs[b][0];
  9849. if (c && this._.pageCount != 1 && c.isVisible()) {
  9850. b == this._.currentTabId && this.selectPage(a.call(this));
  9851. c.hide();
  9852. this._.pageCount--;
  9853. this.updateStyle()
  9854. }
  9855. },
  9856. showPage: function(a) {
  9857. if (a = this._.tabs[a] && this._.tabs[a][0]) {
  9858. a.show();
  9859. this._.pageCount++;
  9860. this.updateStyle()
  9861. }
  9862. },
  9863. getElement: function() { return this._.element },
  9864. getName: function() { return this._.name },
  9865. getContentElement: function(a, b) {
  9866. var c = this._.contents[a];
  9867. return c && c[b]
  9868. },
  9869. getValueOf: function(a, b) { return this.getContentElement(a, b).getValue() },
  9870. setValueOf: function(a, b, c) { return this.getContentElement(a, b).setValue(c) },
  9871. getButton: function(a) { return this._.buttons[a] },
  9872. click: function(a) { return this._.buttons[a].click() },
  9873. disableButton: function(a) { return this._.buttons[a].disable() },
  9874. enableButton: function(a) { return this._.buttons[a].enable() },
  9875. getPageCount: function() { return this._.pageCount },
  9876. getParentEditor: function() { return this._.editor },
  9877. getSelectedElement: function() { return this.getParentEditor().getSelection().getSelectedElement() },
  9878. addFocusable: function(a, b) {
  9879. if (typeof b == "undefined") {
  9880. b = this._.focusList.length;
  9881. this._.focusList.push(new j(this, a, b))
  9882. } else { this._.focusList.splice(b, 0, new j(this, a, b)); for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++ }
  9883. }
  9884. };
  9885. CKEDITOR.tools.extend(CKEDITOR.dialog, {
  9886. add: function(a, b) { if (!this._.dialogDefinitions[a] || typeof b == "function") this._.dialogDefinitions[a] = b },
  9887. exists: function(a) { return !!this._.dialogDefinitions[a] },
  9888. getCurrent: function() { return CKEDITOR.dialog._.currentTop },
  9889. isTabEnabled: function(a, b, c) { a = a.config.removeDialogTabs; return !(a && a.match(RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)", "i"))) },
  9890. okButton: function() {
  9891. var a = function(a, b) {
  9892. b = b || {};
  9893. return CKEDITOR.tools.extend({
  9894. id: "ok",
  9895. type: "button",
  9896. label: a.lang.common.ok,
  9897. "class": "cke_dialog_ui_button_ok",
  9898. onClick: function(a) {
  9899. a = a.data.dialog;
  9900. a.fire("ok", { hide: true }).hide !== false && a.hide()
  9901. }
  9902. }, b, true)
  9903. };
  9904. a.type = "button";
  9905. a.override = function(b) { return CKEDITOR.tools.extend(function(c) { return a(c, b) }, { type: "button" }, true) };
  9906. return a
  9907. }(),
  9908. cancelButton: function() {
  9909. var a = function(a, b) {
  9910. b = b || {};
  9911. return CKEDITOR.tools.extend({
  9912. id: "cancel",
  9913. type: "button",
  9914. label: a.lang.common.cancel,
  9915. "class": "cke_dialog_ui_button_cancel",
  9916. onClick: function(a) {
  9917. a = a.data.dialog;
  9918. a.fire("cancel", { hide: true }).hide !== false && a.hide()
  9919. }
  9920. }, b, true)
  9921. };
  9922. a.type = "button";
  9923. a.override = function(b) { return CKEDITOR.tools.extend(function(c) { return a(c, b) }, { type: "button" }, true) };
  9924. return a
  9925. }(),
  9926. addUIElement: function(a, b) { this._.uiElementBuilders[a] = b }
  9927. });
  9928. CKEDITOR.dialog._ = {
  9929. uiElementBuilders: {},
  9930. dialogDefinitions: {},
  9931. currentTop: null,
  9932. currentZIndex: null
  9933. };
  9934. CKEDITOR.event.implementOn(CKEDITOR.dialog);
  9935. CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
  9936. var p = { resizable: CKEDITOR.DIALOG_RESIZE_BOTH, minWidth: 600, minHeight: 400, buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton] },
  9937. t = function(a, b, c) {
  9938. for (var d = 0, f; f = a[d]; d++) {
  9939. if (f.id == b) return f;
  9940. if (c && f[c])
  9941. if (f = t(f[c], b, c)) return f
  9942. }
  9943. return null
  9944. },
  9945. s = function(a, b, c, d, f) {
  9946. if (c) {
  9947. for (var g = 0, e; e = a[g]; g++) {
  9948. if (e.id == c) { a.splice(g, 0, b); return b }
  9949. if (d &&
  9950. e[d])
  9951. if (e = s(e[d], b, c, d, true)) return e
  9952. }
  9953. if (f) return null
  9954. }
  9955. a.push(b);
  9956. return b
  9957. },
  9958. u = function(a, b, c) {
  9959. for (var d = 0, f; f = a[d]; d++) {
  9960. if (f.id == b) return a.splice(d, 1);
  9961. if (c && f[c])
  9962. if (f = u(f[c], b, c)) return f
  9963. }
  9964. return null
  9965. },
  9966. w = function(a, b) {
  9967. this.dialog = a;
  9968. for (var c = b.contents, d = 0, f; f = c[d]; d++) c[d] = f && new h(a, f);
  9969. CKEDITOR.tools.extend(this, b)
  9970. };
  9971. w.prototype = {
  9972. getContents: function(a) { return t(this.contents, a) },
  9973. getButton: function(a) { return t(this.buttons, a) },
  9974. addContents: function(a, b) { return s(this.contents, a, b) },
  9975. addButton: function(a,
  9976. b) { return s(this.buttons, a, b) },
  9977. removeContents: function(a) { u(this.contents, a) },
  9978. removeButton: function(a) { u(this.buttons, a) }
  9979. };
  9980. h.prototype = { get: function(a) { return t(this.elements, a, "children") }, add: function(a, b) { return s(this.elements, a, b, "children") }, remove: function(a) { u(this.elements, a, "children") } };
  9981. var x, v = {},
  9982. r, y = {},
  9983. z = function(a) {
  9984. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  9985. c = a.data.$.altKey,
  9986. d = a.data.$.shiftKey,
  9987. f = String.fromCharCode(a.data.$.keyCode);
  9988. if ((b = y[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") +
  9989. f]) && b.length) {
  9990. b = b[b.length - 1];
  9991. b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key);
  9992. a.data.preventDefault()
  9993. }
  9994. },
  9995. B = function(a) {
  9996. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  9997. c = a.data.$.altKey,
  9998. d = a.data.$.shiftKey,
  9999. f = String.fromCharCode(a.data.$.keyCode);
  10000. if ((b = y[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + f]) && b.length) {
  10001. b = b[b.length - 1];
  10002. if (b.keyup) {
  10003. b.keyup.call(b.uiElement, b.dialog, b.key);
  10004. a.data.preventDefault()
  10005. }
  10006. }
  10007. },
  10008. A = function(a, b, c, d, f) {
  10009. (y[c] || (y[c] = [])).push({
  10010. uiElement: a,
  10011. dialog: b,
  10012. key: c,
  10013. keyup: f || a.accessKeyUp,
  10014. keydown: d || a.accessKeyDown
  10015. })
  10016. },
  10017. G = function(a) {
  10018. for (var b in y) {
  10019. for (var c = y[b], d = c.length - 1; d >= 0; d--)(c[d].dialog == a || c[d].uiElement == a) && c.splice(d, 1);
  10020. c.length === 0 && delete y[b]
  10021. }
  10022. },
  10023. D = function(a, b) { a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b]) },
  10024. J = function() {};
  10025. (function() {
  10026. CKEDITOR.ui.dialog = {
  10027. uiElement: function(a, b, c, d, f, g, e) {
  10028. if (!(arguments.length < 4)) {
  10029. var h = (d.call ? d(b) : d) || "div",
  10030. j = ["<", h, " "],
  10031. i = (f && f.call ? f(b) : f) || {},
  10032. k = (g && g.call ? g(b) : g) || {},
  10033. p = (e && e.call ? e.call(this, a, b) : e) || "",
  10034. s = this.domId = k.id ||
  10035. CKEDITOR.tools.getNextId() + "_uiElement";
  10036. if (b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent)) {
  10037. i.display = "none";
  10038. this.notAllowed = true
  10039. }
  10040. k.id = s;
  10041. var m = {};
  10042. b.type && (m["cke_dialog_ui_" + b.type] = 1);
  10043. b.className && (m[b.className] = 1);
  10044. if (b.disabled) m.cke_disabled = 1;
  10045. for (var t = k["class"] && k["class"].split ? k["class"].split(" ") : [], s = 0; s < t.length; s++) t[s] && (m[t[s]] = 1);
  10046. t = [];
  10047. for (s in m) t.push(s);
  10048. k["class"] = t.join(" ");
  10049. if (b.title) k.title = b.title;
  10050. m = (b.style || "").split(";");
  10051. if (b.align) {
  10052. t = b.align;
  10053. i["margin-left"] =
  10054. t == "left" ? 0 : "auto";
  10055. i["margin-right"] = t == "right" ? 0 : "auto"
  10056. }
  10057. for (s in i) m.push(s + ":" + i[s]);
  10058. b.hidden && m.push("display:none");
  10059. for (s = m.length - 1; s >= 0; s--) m[s] === "" && m.splice(s, 1);
  10060. if (m.length > 0) k.style = (k.style ? k.style + "; " : "") + m.join("; ");
  10061. for (s in k) j.push(s + '="' + CKEDITOR.tools.htmlEncode(k[s]) + '" ');
  10062. j.push(">", p, "</", h, ">");
  10063. c.push(j.join(""));
  10064. (this._ || (this._ = {})).dialog = a;
  10065. if (typeof b.isChanged == "boolean") this.isChanged = function() { return b.isChanged };
  10066. if (typeof b.isChanged == "function") this.isChanged = b.isChanged;
  10067. if (typeof b.setValue == "function") this.setValue = CKEDITOR.tools.override(this.setValue, function(a) { return function(c) { a.call(this, b.setValue.call(this, c)) } });
  10068. if (typeof b.getValue == "function") this.getValue = CKEDITOR.tools.override(this.getValue, function(a) { return function() { return b.getValue.call(this, a.call(this)) } });
  10069. CKEDITOR.event.implementOn(this);
  10070. this.registerEvents(b);
  10071. this.accessKeyUp && (this.accessKeyDown && b.accessKey) && A(this, a, "CTRL+" + b.accessKey);
  10072. var l = this;
  10073. a.on("load", function() {
  10074. var b = l.getInputElement();
  10075. if (b) {
  10076. var c = l.type in { checkbox: 1, ratio: 1 } && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? "cke_dialog_ui_focused" : "";
  10077. b.on("focus", function() {
  10078. a._.tabBarMode = false;
  10079. a._.hasFocus = true;
  10080. l.fire("focus");
  10081. c && this.addClass(c)
  10082. });
  10083. b.on("blur", function() {
  10084. l.fire("blur");
  10085. c && this.removeClass(c)
  10086. })
  10087. }
  10088. });
  10089. CKEDITOR.tools.extend(this, b);
  10090. if (this.keyboardFocusable) {
  10091. this.tabIndex = b.tabIndex || 0;
  10092. this.focusIndex = a._.focusList.push(this) - 1;
  10093. this.on("focus", function() { a._.currentFocusIndex = l.focusIndex })
  10094. }
  10095. }
  10096. },
  10097. hbox: function(a, b, c, d, f) {
  10098. if (!(arguments.length <
  10099. 4)) {
  10100. this._ || (this._ = {});
  10101. var g = this._.children = b,
  10102. e = f && f.widths || null,
  10103. h = f && f.height || null,
  10104. j, i = { role: "presentation" };
  10105. f && f.align && (i.align = f.align);
  10106. CKEDITOR.ui.dialog.uiElement.call(this, a, f || { type: "hbox" }, d, "table", {}, i, function() {
  10107. var a = ['<tbody><tr class="cke_dialog_ui_hbox">'];
  10108. for (j = 0; j < c.length; j++) {
  10109. var b = "cke_dialog_ui_hbox_child",
  10110. d = [];
  10111. j === 0 && (b = "cke_dialog_ui_hbox_first");
  10112. j == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
  10113. a.push('<td class="', b, '" role="presentation" ');
  10114. e ? e[j] && d.push("width:" + m(e[j])) :
  10115. d.push("width:" + Math.floor(100 / c.length) + "%");
  10116. h && d.push("height:" + m(h));
  10117. f && f.padding !== void 0 && d.push("padding:" + m(f.padding));
  10118. CKEDITOR.env.ie && (CKEDITOR.env.quirks && g[j].align) && d.push("text-align:" + g[j].align);
  10119. d.length > 0 && a.push('style="' + d.join("; ") + '" ');
  10120. a.push(">", c[j], "</td>")
  10121. }
  10122. a.push("</tr></tbody>");
  10123. return a.join("")
  10124. })
  10125. }
  10126. },
  10127. vbox: function(a, b, c, d, f) {
  10128. if (!(arguments.length < 3)) {
  10129. this._ || (this._ = {});
  10130. var g = this._.children = b,
  10131. e = f && f.width || null,
  10132. h = f && f.heights || null;
  10133. CKEDITOR.ui.dialog.uiElement.call(this,
  10134. a, f || { type: "vbox" }, d, "div", null, { role: "presentation" },
  10135. function() {
  10136. var b = ['<table role="presentation" cellspacing="0" border="0" '];
  10137. b.push('style="');
  10138. f && f.expand && b.push("height:100%;");
  10139. b.push("width:" + m(e || "100%"), ";");
  10140. CKEDITOR.env.webkit && b.push("float:none;");
  10141. b.push('"');
  10142. b.push('align="', CKEDITOR.tools.htmlEncode(f && f.align || (a.getParentEditor().lang.dir == "ltr" ? "left" : "right")), '" ');
  10143. b.push("><tbody>");
  10144. for (var d = 0; d < c.length; d++) {
  10145. var j = [];
  10146. b.push('<tr><td role="presentation" ');
  10147. e && j.push("width:" +
  10148. m(e || "100%"));
  10149. h ? j.push("height:" + m(h[d])) : f && f.expand && j.push("height:" + Math.floor(100 / c.length) + "%");
  10150. f && f.padding !== void 0 && j.push("padding:" + m(f.padding));
  10151. CKEDITOR.env.ie && (CKEDITOR.env.quirks && g[d].align) && j.push("text-align:" + g[d].align);
  10152. j.length > 0 && b.push('style="', j.join("; "), '" ');
  10153. b.push(' class="cke_dialog_ui_vbox_child">', c[d], "</td></tr>")
  10154. }
  10155. b.push("</tbody></table>");
  10156. return b.join("")
  10157. })
  10158. }
  10159. }
  10160. }
  10161. })();
  10162. CKEDITOR.ui.dialog.uiElement.prototype = {
  10163. getElement: function() { return CKEDITOR.document.getById(this.domId) },
  10164. getInputElement: function() { return this.getElement() },
  10165. getDialog: function() { return this._.dialog },
  10166. setValue: function(a, b) { this.getInputElement().setValue(a);!b && this.fire("change", { value: a }); return this },
  10167. getValue: function() { return this.getInputElement().getValue() },
  10168. isChanged: function() { return false },
  10169. selectParentTab: function() {
  10170. for (var a = this.getInputElement();
  10171. (a = a.getParent()) && a.$.className.search("cke_dialog_page_contents") == -1;);
  10172. if (!a) return this;
  10173. a = a.getAttribute("name");
  10174. this._.dialog._.currentTabId !=
  10175. a && this._.dialog.selectPage(a);
  10176. return this
  10177. },
  10178. focus: function() { this.selectParentTab().getInputElement().focus(); return this },
  10179. registerEvents: function(a) {
  10180. var b = /^on([A-Z]\w+)/,
  10181. c, d = function(a, b, c, d) { b.on("load", function() { a.getInputElement().on(c, d, a) }) },
  10182. f;
  10183. for (f in a)
  10184. if (c = f.match(b)) this.eventProcessors[f] ? this.eventProcessors[f].call(this, this._.dialog, a[f]) : d(this, this._.dialog, c[1].toLowerCase(), a[f]);
  10185. return this
  10186. },
  10187. eventProcessors: {
  10188. onLoad: function(a, b) { a.on("load", b, this) },
  10189. onShow: function(a, b) {
  10190. a.on("show",
  10191. b, this)
  10192. },
  10193. onHide: function(a, b) { a.on("hide", b, this) }
  10194. },
  10195. accessKeyDown: function() { this.focus() },
  10196. accessKeyUp: function() {},
  10197. disable: function() {
  10198. var a = this.getElement();
  10199. this.getInputElement().setAttribute("disabled", "true");
  10200. a.addClass("cke_disabled")
  10201. },
  10202. enable: function() {
  10203. var a = this.getElement();
  10204. this.getInputElement().removeAttribute("disabled");
  10205. a.removeClass("cke_disabled")
  10206. },
  10207. isEnabled: function() { return !this.getElement().hasClass("cke_disabled") },
  10208. isVisible: function() { return this.getInputElement().isVisible() },
  10209. isFocusable: function() { return !this.isEnabled() || !this.isVisible() ? false : true }
  10210. };
  10211. CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  10212. getChild: function(a) {
  10213. if (arguments.length < 1) return this._.children.concat();
  10214. a.splice || (a = [a]);
  10215. return a.length < 2 ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null
  10216. }
  10217. }, true);
  10218. CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
  10219. (function() {
  10220. var a = {
  10221. build: function(a, b, c) {
  10222. for (var d = b.children, f, g = [], e = [], h = 0; h < d.length && (f = d[h]); h++) {
  10223. var j = [];
  10224. g.push(j);
  10225. e.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, j))
  10226. }
  10227. return new CKEDITOR.ui.dialog[b.type](a, e, g, c, b)
  10228. }
  10229. };
  10230. CKEDITOR.dialog.addUIElement("hbox", a);
  10231. CKEDITOR.dialog.addUIElement("vbox", a)
  10232. })();
  10233. CKEDITOR.dialogCommand = function(a, b) {
  10234. this.dialogName = a;
  10235. CKEDITOR.tools.extend(this, b, true)
  10236. };
  10237. CKEDITOR.dialogCommand.prototype = { exec: function(a) { a.openDialog(this.dialogName) }, canUndo: false, editorFocus: 1 };
  10238. (function() {
  10239. var a = /^([a]|[^a])+$/,
  10240. b = /^\d*$/,
  10241. c = /^\d*(?:\.\d+)?$/,
  10242. d = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
  10243. f = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
  10244. g = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;
  10245. CKEDITOR.VALIDATE_OR = 1;
  10246. CKEDITOR.VALIDATE_AND = 2;
  10247. CKEDITOR.dialog.validate = {
  10248. functions: function() {
  10249. var a = arguments;
  10250. return function() {
  10251. var b = this && this.getValue ? this.getValue() : a[0],
  10252. c, d = CKEDITOR.VALIDATE_AND,
  10253. f = [],
  10254. g;
  10255. for (g = 0; g < a.length; g++)
  10256. if (typeof a[g] == "function") f.push(a[g]);
  10257. else break;
  10258. if (g < a.length && typeof a[g] ==
  10259. "string") {
  10260. c = a[g];
  10261. g++
  10262. }
  10263. g < a.length && typeof a[g] == "number" && (d = a[g]);
  10264. var e = d == CKEDITOR.VALIDATE_AND ? true : false;
  10265. for (g = 0; g < f.length; g++) e = d == CKEDITOR.VALIDATE_AND ? e && f[g](b) : e || f[g](b);
  10266. return !e ? c : true
  10267. }
  10268. },
  10269. regex: function(a, b) { return function(c) { c = this && this.getValue ? this.getValue() : c; return !a.test(c) ? b : true } },
  10270. notEmpty: function(b) { return this.regex(a, b) },
  10271. integer: function(a) { return this.regex(b, a) },
  10272. number: function(a) { return this.regex(c, a) },
  10273. cssLength: function(a) {
  10274. return this.functions(function(a) { return f.test(CKEDITOR.tools.trim(a)) },
  10275. a)
  10276. },
  10277. htmlLength: function(a) { return this.functions(function(a) { return d.test(CKEDITOR.tools.trim(a)) }, a) },
  10278. inlineStyle: function(a) { return this.functions(function(a) { return g.test(CKEDITOR.tools.trim(a)) }, a) },
  10279. equals: function(a, b) { return this.functions(function(b) { return b == a }, b) },
  10280. notEqual: function(a, b) { return this.functions(function(b) { return b != a }, b) }
  10281. };
  10282. CKEDITOR.on("instanceDestroyed", function(a) {
  10283. if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
  10284. for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
  10285. for (var c in v) v[c].remove();
  10286. v = {}
  10287. }
  10288. var a = a.editor._.storedDialogs,
  10289. d;
  10290. for (d in a) a[d].destroy()
  10291. })
  10292. })();
  10293. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  10294. openDialog: function(a, b) {
  10295. var c = null,
  10296. d = CKEDITOR.dialog._.dialogDefinitions[a];
  10297. CKEDITOR.dialog._.currentTop === null && o(this);
  10298. if (typeof d == "function") {
  10299. c = this._.storedDialogs || (this._.storedDialogs = {});
  10300. c = c[a] || (c[a] = new CKEDITOR.dialog(this, a));
  10301. b && b.call(c, c);
  10302. c.show()
  10303. } else {
  10304. if (d == "failed") {
  10305. q(this);
  10306. throw Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.');
  10307. }
  10308. typeof d == "string" && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d), function() {
  10309. typeof CKEDITOR.dialog._.dialogDefinitions[a] != "function" && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed");
  10310. this.openDialog(a, b)
  10311. }, this, 0, 1)
  10312. }
  10313. CKEDITOR.skin.loadPart("dialog");
  10314. return c
  10315. }
  10316. })
  10317. }(), CKEDITOR.plugins.add("dialog", { requires: "dialogui", init: function(a) { a.on("doubleclick", function(e) { e.data.dialog && a.openDialog(e.data.dialog) }, null, null, 999) } }),
  10318. function() {
  10319. CKEDITOR.plugins.add("a11yhelp", {
  10320. requires: "dialog",
  10321. availableLangs: {
  10322. af: 1,
  10323. ar: 1,
  10324. bg: 1,
  10325. ca: 1,
  10326. cs: 1,
  10327. cy: 1,
  10328. da: 1,
  10329. de: 1,
  10330. el: 1,
  10331. en: 1,
  10332. "en-gb": 1,
  10333. eo: 1,
  10334. es: 1,
  10335. et: 1,
  10336. fa: 1,
  10337. fi: 1,
  10338. fr: 1,
  10339. "fr-ca": 1,
  10340. gl: 1,
  10341. gu: 1,
  10342. he: 1,
  10343. hi: 1,
  10344. hr: 1,
  10345. hu: 1,
  10346. id: 1,
  10347. it: 1,
  10348. ja: 1,
  10349. km: 1,
  10350. ko: 1,
  10351. ku: 1,
  10352. lt: 1,
  10353. lv: 1,
  10354. mk: 1,
  10355. mn: 1,
  10356. nb: 1,
  10357. nl: 1,
  10358. no: 1,
  10359. pl: 1,
  10360. pt: 1,
  10361. "pt-br": 1,
  10362. ro: 1,
  10363. ru: 1,
  10364. si: 1,
  10365. sk: 1,
  10366. sl: 1,
  10367. sq: 1,
  10368. sr: 1,
  10369. "sr-latn": 1,
  10370. sv: 1,
  10371. th: 1,
  10372. tr: 1,
  10373. tt: 1,
  10374. ug: 1,
  10375. uk: 1,
  10376. vi: 1,
  10377. zh: 1,
  10378. "zh-cn": 1
  10379. },
  10380. init: function(a) {
  10381. var e = this;
  10382. a.addCommand("a11yHelp", {
  10383. exec: function() {
  10384. var b = a.langCode,
  10385. b = e.availableLangs[b] ? b : e.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  10386. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e.path +
  10387. "dialogs/lang/" + b + ".js"), function() {
  10388. a.lang.a11yhelp = e.langEntries[b];
  10389. a.openDialog("a11yHelp")
  10390. })
  10391. },
  10392. modes: { wysiwyg: 1, source: 1 },
  10393. readOnly: 1,
  10394. canUndo: false
  10395. });
  10396. a.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp");
  10397. CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js");
  10398. a.on("ariaEditorHelpLabel", function(b) { b.data.label = a.lang.common.editorHelp })
  10399. }
  10400. })
  10401. }(), CKEDITOR.plugins.add("about", {
  10402. requires: "dialog",
  10403. init: function(a) {
  10404. var e = a.addCommand("about", new CKEDITOR.dialogCommand("about"));
  10405. e.modes = { wysiwyg: 1, source: 1 };
  10406. e.canUndo = false;
  10407. e.readOnly = 1;
  10408. a.ui.addButton && a.ui.addButton("About", { label: a.lang.about.title, command: "about", toolbar: "about" });
  10409. CKEDITOR.dialog.add("about", this.path + "dialogs/about.js")
  10410. }
  10411. }), CKEDITOR.plugins.add("basicstyles", {
  10412. init: function(a) {
  10413. var e = 0,
  10414. b = function(b, c, d, i) {
  10415. if (i) {
  10416. var i = new CKEDITOR.style(i),
  10417. k = g[d];
  10418. k.unshift(i);
  10419. a.attachStyleStateChange(i, function(b) {!a.readOnly && a.getCommand(d).setState(b) });
  10420. a.addCommand(d, new CKEDITOR.styleCommand(i, { contentForms: k }));
  10421. a.ui.addButton && a.ui.addButton(b, { label: c, command: d, toolbar: "basicstyles," + (e = e + 10) })
  10422. }
  10423. },
  10424. g = { bold: ["strong", "b", ["span", function(a) { a = a.styles["font-weight"]; return a == "bold" || +a >= 700 }]], italic: ["em", "i", ["span", function(a) { return a.styles["font-style"] == "italic" }]], underline: ["u", ["span", function(a) { return a.styles["text-decoration"] == "underline" }]], strike: ["s", "strike", ["span", function(a) { return a.styles["text-decoration"] == "line-through" }]], subscript: ["sub"], superscript: ["sup"] },
  10425. c = a.config,
  10426. d = a.lang.basicstyles;
  10427. b("Bold", d.bold, "bold",
  10428. c.coreStyles_bold);
  10429. b("Italic", d.italic, "italic", c.coreStyles_italic);
  10430. b("Underline", d.underline, "underline", c.coreStyles_underline);
  10431. b("Strike", d.strike, "strike", c.coreStyles_strike);
  10432. b("Subscript", d.subscript, "subscript", c.coreStyles_subscript);
  10433. b("Superscript", d.superscript, "superscript", c.coreStyles_superscript);
  10434. a.setKeystroke([
  10435. [CKEDITOR.CTRL + 66, "bold"],
  10436. [CKEDITOR.CTRL + 73, "italic"],
  10437. [CKEDITOR.CTRL + 85, "underline"]
  10438. ])
  10439. }
  10440. }), CKEDITOR.config.coreStyles_bold = { element: "strong", overrides: "b" }, CKEDITOR.config.coreStyles_italic = { element: "em", overrides: "i" }, CKEDITOR.config.coreStyles_underline = { element: "u" }, CKEDITOR.config.coreStyles_strike = { element: "s", overrides: "strike" }, CKEDITOR.config.coreStyles_subscript = { element: "sub" }, CKEDITOR.config.coreStyles_superscript = { element: "sup" },
  10441. function() {
  10442. var a = {
  10443. exec: function(a) {
  10444. var b = a.getCommand("blockquote").state,
  10445. g = a.getSelection(),
  10446. c = g && g.getRanges()[0];
  10447. if (c) {
  10448. var d = g.createBookmarks();
  10449. if (CKEDITOR.env.ie) {
  10450. var j = d[0].startNode,
  10451. f = d[0].endNode,
  10452. h;
  10453. if (j && j.getParent().getName() == "blockquote")
  10454. for (h =
  10455. j; h = h.getNext();)
  10456. if (h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) { j.move(h, true); break }
  10457. if (f && f.getParent().getName() == "blockquote")
  10458. for (h = f; h = h.getPrevious();)
  10459. if (h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) { f.move(h); break }
  10460. }
  10461. var i = c.createIterator();
  10462. i.enlargeBr = a.config.enterMode != CKEDITOR.ENTER_BR;
  10463. if (b == CKEDITOR.TRISTATE_OFF) {
  10464. for (j = []; b = i.getNextParagraph();) j.push(b);
  10465. if (j.length < 1) {
  10466. b = a.document.createElement(a.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div");
  10467. f = d.shift();
  10468. c.insertNode(b);
  10469. b.append(new CKEDITOR.dom.text("", a.document));
  10470. c.moveToBookmark(f);
  10471. c.selectNodeContents(b);
  10472. c.collapse(true);
  10473. f = c.createBookmark();
  10474. j.push(b);
  10475. d.unshift(f)
  10476. }
  10477. h = j[0].getParent();
  10478. c = [];
  10479. for (f = 0; f < j.length; f++) {
  10480. b = j[f];
  10481. h = h.getCommonAncestor(b.getParent())
  10482. }
  10483. for (b = { table: 1, tbody: 1, tr: 1, ol: 1, ul: 1 }; b[h.getName()];) h = h.getParent();
  10484. for (f = null; j.length > 0;) {
  10485. for (b = j.shift(); !b.getParent().equals(h);) b = b.getParent();
  10486. b.equals(f) || c.push(b);
  10487. f = b
  10488. }
  10489. for (; c.length > 0;) {
  10490. b = c.shift();
  10491. if (b.getName() == "blockquote") {
  10492. for (f = new CKEDITOR.dom.documentFragment(a.document); b.getFirst();) {
  10493. f.append(b.getFirst().remove());
  10494. j.push(f.getLast())
  10495. }
  10496. f.replace(b)
  10497. } else j.push(b)
  10498. }
  10499. c = a.document.createElement("blockquote");
  10500. for (c.insertBefore(j[0]); j.length > 0;) {
  10501. b = j.shift();
  10502. c.append(b)
  10503. }
  10504. } else if (b == CKEDITOR.TRISTATE_ON) {
  10505. f = [];
  10506. for (h = {}; b = i.getNextParagraph();) {
  10507. for (j = c = null; b.getParent();) {
  10508. if (b.getParent().getName() == "blockquote") {
  10509. c = b.getParent();
  10510. j = b;
  10511. break
  10512. }
  10513. b = b.getParent()
  10514. }
  10515. if (c && j && !j.getCustomData("blockquote_moveout")) {
  10516. f.push(j);
  10517. CKEDITOR.dom.element.setMarker(h, j, "blockquote_moveout", true)
  10518. }
  10519. }
  10520. CKEDITOR.dom.element.clearAllMarkers(h);
  10521. b = [];
  10522. j = [];
  10523. for (h = {}; f.length > 0;) {
  10524. i = f.shift();
  10525. c = i.getParent();
  10526. if (i.getPrevious())
  10527. if (i.getNext()) {
  10528. i.breakParent(i.getParent());
  10529. j.push(i.getNext())
  10530. } else i.remove().insertAfter(c);
  10531. else i.remove().insertBefore(c);
  10532. if (!c.getCustomData("blockquote_processed")) {
  10533. j.push(c);
  10534. CKEDITOR.dom.element.setMarker(h, c, "blockquote_processed", true)
  10535. }
  10536. b.push(i)
  10537. }
  10538. CKEDITOR.dom.element.clearAllMarkers(h);
  10539. for (f = j.length - 1; f >= 0; f--) {
  10540. c = j[f];
  10541. a: {
  10542. h = c;
  10543. for (var i = 0, k = h.getChildCount(), n = void 0; i < k && (n = h.getChild(i)); i++)
  10544. if (n.type == CKEDITOR.NODE_ELEMENT &&
  10545. n.isBlockBoundary()) { h = false; break a }
  10546. h = true
  10547. }
  10548. h && c.remove()
  10549. }
  10550. if (a.config.enterMode == CKEDITOR.ENTER_BR)
  10551. for (c = true; b.length;) {
  10552. i = b.shift();
  10553. if (i.getName() == "div") {
  10554. f = new CKEDITOR.dom.documentFragment(a.document);
  10555. c && (i.getPrevious() && !(i.getPrevious().type == CKEDITOR.NODE_ELEMENT && i.getPrevious().isBlockBoundary())) && f.append(a.document.createElement("br"));
  10556. for (c = i.getNext() && !(i.getNext().type == CKEDITOR.NODE_ELEMENT && i.getNext().isBlockBoundary()); i.getFirst();) i.getFirst().remove().appendTo(f);
  10557. c && f.append(a.document.createElement("br"));
  10558. f.replace(i);
  10559. c = false
  10560. }
  10561. }
  10562. }
  10563. g.selectBookmarks(d);
  10564. a.focus()
  10565. }
  10566. },
  10567. refresh: function(a, b) { this.setState(a.elementPath(b.block || b.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) },
  10568. context: "blockquote",
  10569. allowedContent: "blockquote",
  10570. requiredContent: "blockquote"
  10571. };
  10572. CKEDITOR.plugins.add("blockquote", {
  10573. init: function(e) {
  10574. if (!e.blockless) {
  10575. e.addCommand("blockquote", a);
  10576. e.ui.addButton && e.ui.addButton("Blockquote", { label: e.lang.blockquote.toolbar, command: "blockquote", toolbar: "blocks,10" })
  10577. }
  10578. }
  10579. })
  10580. }(),
  10581. "use strict",
  10582. function() {
  10583. function a(a) {
  10584. function b() {
  10585. var c = a.editable();
  10586. c.on(y, function(a) {
  10587. (!CKEDITOR.env.ie || !x) && s(a)
  10588. });
  10589. CKEDITOR.env.ie && c.on("paste", function(b) {
  10590. if (!v) {
  10591. g();
  10592. b.data.preventDefault();
  10593. s(b);
  10594. o("paste") || a.openDialog("paste")
  10595. }
  10596. });
  10597. if (CKEDITOR.env.ie) {
  10598. c.on("contextmenu", e, null, null, 0);
  10599. c.on("beforepaste", function(a) { a.data && (!a.data.$.ctrlKey && !a.data.$.shiftKey) && e() }, null, null, 0)
  10600. }
  10601. c.on("beforecut", function() {!x && m(a) });
  10602. var d;
  10603. c.attachListener(CKEDITOR.env.ie ? c : a.document.getDocumentElement(),
  10604. "mouseup",
  10605. function() { d = setTimeout(function() { u() }, 0) });
  10606. a.on("destroy", function() { clearTimeout(d) });
  10607. c.on("keyup", u)
  10608. }
  10609. function c(b) {
  10610. return {
  10611. type: b,
  10612. canUndo: b == "cut",
  10613. startDisabled: true,
  10614. exec: function() {
  10615. this.type == "cut" && m();
  10616. var b;
  10617. var c = this.type;
  10618. if (CKEDITOR.env.ie) b = o(c);
  10619. else try { b = a.document.$.execCommand(c, false, null) } catch (d) { b = false }
  10620. b || alert(a.lang.clipboard[this.type + "Error"]);
  10621. return b
  10622. }
  10623. }
  10624. }
  10625. function d() {
  10626. return {
  10627. canUndo: false,
  10628. async: true,
  10629. exec: function(a, b) {
  10630. var c = function(b, c) {
  10631. b && q(b.type, b.dataValue, !!c);
  10632. a.fire("afterCommandExec", { name: "paste", command: d, returnValue: !!b })
  10633. },
  10634. d = this;
  10635. typeof b == "string" ? c({ type: "auto", dataValue: b }, 1) : a.getClipboardData(c)
  10636. }
  10637. }
  10638. }
  10639. function g() {
  10640. v = 1;
  10641. setTimeout(function() { v = 0 }, 100)
  10642. }
  10643. function e() {
  10644. x = 1;
  10645. setTimeout(function() { x = 0 }, 10)
  10646. }
  10647. function o(b) {
  10648. var c = a.document,
  10649. d = c.getBody(),
  10650. f = false,
  10651. g = function() { f = true };
  10652. d.on(b, g);
  10653. (CKEDITOR.env.version > 7 ? c.$ : c.$.selection.createRange()).execCommand(b);
  10654. d.removeListener(b, g);
  10655. return f
  10656. }
  10657. function q(b, c, d) {
  10658. b = { type: b };
  10659. if (d && a.fire("beforePaste", b) === false ||
  10660. !c) return false;
  10661. b.dataValue = c;
  10662. return a.fire("paste", b)
  10663. }
  10664. function m() {
  10665. if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  10666. var b = a.getSelection(),
  10667. c, d, f;
  10668. if (b.getType() == CKEDITOR.SELECTION_ELEMENT && (c = b.getSelectedElement())) {
  10669. d = b.getRanges()[0];
  10670. f = a.document.createText("");
  10671. f.insertBefore(c);
  10672. d.setStartBefore(f);
  10673. d.setEndAfter(c);
  10674. b.selectRanges([d]);
  10675. setTimeout(function() {
  10676. if (c.getParent()) {
  10677. f.remove();
  10678. b.selectElement(c)
  10679. }
  10680. }, 0)
  10681. }
  10682. }
  10683. }
  10684. function l(b, c) {
  10685. var d = a.document,
  10686. f = a.editable(),
  10687. g = function(a) { a.cancel() },
  10688. e;
  10689. if (!d.getById("cke_pastebin")) {
  10690. var h =
  10691. a.getSelection(),
  10692. i = h.createBookmarks();
  10693. CKEDITOR.env.ie && h.root.fire("selectionchange");
  10694. var k = new CKEDITOR.dom.element((CKEDITOR.env.webkit || f.is("body")) && !CKEDITOR.env.ie ? "body" : "div", d);
  10695. k.setAttributes({ id: "cke_pastebin", "data-cke-temp": "1" });
  10696. var s = 0,
  10697. d = d.getWindow();
  10698. if (CKEDITOR.env.webkit) {
  10699. f.append(k);
  10700. k.addClass("cke_editable");
  10701. if (!f.is("body")) {
  10702. s = f.getComputedStyle("position") != "static" ? f : CKEDITOR.dom.element.get(f.$.offsetParent);
  10703. s = s.getDocumentPosition().y
  10704. }
  10705. } else f.getAscendant(CKEDITOR.env.ie ?
  10706. "body" : "html", 1).append(k);
  10707. k.setStyles({ position: "absolute", top: d.getScrollPosition().y - s + 10 + "px", width: "1px", height: Math.max(1, d.getViewPaneSize().height - 20) + "px", overflow: "hidden", margin: 0, padding: 0 });
  10708. CKEDITOR.env.safari && k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text"));
  10709. if (s = k.getParent().isReadOnly()) {
  10710. k.setOpacity(0);
  10711. k.setAttribute("contenteditable", true)
  10712. } else k.setStyle(a.config.contentsLangDirection == "ltr" ? "left" : "right", "-1000px");
  10713. a.on("selectionChange", g, null, null, 0);
  10714. if (CKEDITOR.env.webkit ||
  10715. CKEDITOR.env.gecko) e = f.once("blur", g, null, null, -100);
  10716. s && k.focus();
  10717. s = new CKEDITOR.dom.range(k);
  10718. s.selectNodeContents(k);
  10719. var p = s.select();
  10720. CKEDITOR.env.ie && (e = f.once("blur", function() { a.lockSelection(p) }));
  10721. var m = CKEDITOR.document.getWindow().getScrollPosition().y;
  10722. setTimeout(function() {
  10723. if (CKEDITOR.env.webkit) CKEDITOR.document.getBody().$.scrollTop = m;
  10724. e && e.removeListener();
  10725. CKEDITOR.env.ie && f.focus();
  10726. h.selectBookmarks(i);
  10727. k.remove();
  10728. var b;
  10729. if (CKEDITOR.env.webkit && (b = k.getFirst()) && b.is && b.hasClass("Apple-style-span")) k =
  10730. b;
  10731. a.removeListener("selectionChange", g);
  10732. c(k.getHtml())
  10733. }, 0)
  10734. }
  10735. }
  10736. function p() {
  10737. if (CKEDITOR.env.ie) {
  10738. a.focus();
  10739. g();
  10740. var b = a.focusManager;
  10741. b.lock();
  10742. if (a.editable().fire(y) && !o("paste")) { b.unlock(); return false }
  10743. b.unlock()
  10744. } else try { if (a.editable().fire(y) && !a.document.$.execCommand("Paste", false, null)) throw 0; } catch (c) { return false }
  10745. return true
  10746. }
  10747. function t(b) {
  10748. if (a.mode == "wysiwyg") switch (b.data.keyCode) {
  10749. case CKEDITOR.CTRL + 86:
  10750. case CKEDITOR.SHIFT + 45:
  10751. b = a.editable();
  10752. g();
  10753. !CKEDITOR.env.ie && b.fire("beforepaste");
  10754. break;
  10755. case CKEDITOR.CTRL + 88:
  10756. case CKEDITOR.SHIFT + 46:
  10757. a.fire("saveSnapshot");
  10758. setTimeout(function() { a.fire("saveSnapshot") }, 50)
  10759. }
  10760. }
  10761. function s(b) {
  10762. var c = { type: "auto" },
  10763. d = a.fire("beforePaste", c);
  10764. l(b, function(a) {
  10765. a = a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig, "");
  10766. d && q(c.type, a, 0, 1)
  10767. })
  10768. }
  10769. function u() {
  10770. if (a.mode == "wysiwyg") {
  10771. var b = w("paste");
  10772. a.getCommand("cut").setState(w("cut"));
  10773. a.getCommand("copy").setState(w("copy"));
  10774. a.getCommand("paste").setState(b);
  10775. a.fire("pasteState", b)
  10776. }
  10777. }
  10778. function w(b) {
  10779. if (r && b in {
  10780. paste: 1,
  10781. cut: 1
  10782. }) return CKEDITOR.TRISTATE_DISABLED;
  10783. if (b == "paste") return CKEDITOR.TRISTATE_OFF;
  10784. var b = a.getSelection(),
  10785. c = b.getRanges();
  10786. return b.getType() == CKEDITOR.SELECTION_NONE || c.length == 1 && c[0].collapsed ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF
  10787. }
  10788. var x = 0,
  10789. v = 0,
  10790. r = 0,
  10791. y = CKEDITOR.env.ie ? "beforepaste" : "paste";
  10792. (function() {
  10793. a.on("key", t);
  10794. a.on("contentDom", b);
  10795. a.on("selectionChange", function(a) {
  10796. r = a.data.selection.getRanges()[0].checkReadOnly();
  10797. u()
  10798. });
  10799. a.contextMenu && a.contextMenu.addListener(function(a, b) {
  10800. r = b.getRanges()[0].checkReadOnly();
  10801. return { cut: w("cut"), copy: w("copy"), paste: w("paste") }
  10802. })
  10803. })();
  10804. (function() {
  10805. function b(c, d, f, g, e) {
  10806. var h = a.lang.clipboard[d];
  10807. a.addCommand(d, f);
  10808. a.ui.addButton && a.ui.addButton(c, { label: h, command: d, toolbar: "clipboard," + g });
  10809. a.addMenuItems && a.addMenuItem(d, { label: h, command: d, group: "clipboard", order: e })
  10810. }
  10811. b("Cut", "cut", c("cut"), 10, 1);
  10812. b("Copy", "copy", c("copy"), 20, 4);
  10813. b("Paste", "paste", d(), 30, 8)
  10814. })();
  10815. a.getClipboardData = function(b, c) {
  10816. function d(a) {
  10817. a.removeListener();
  10818. a.cancel();
  10819. c(a.data)
  10820. }
  10821. function f(a) {
  10822. a.removeListener();
  10823. a.cancel();
  10824. i = true;
  10825. c({ type: h, dataValue: a.data })
  10826. }
  10827. function g() { this.customTitle = b && b.title }
  10828. var e = false,
  10829. h = "auto",
  10830. i = false;
  10831. if (!c) {
  10832. c = b;
  10833. b = null
  10834. }
  10835. a.on("paste", d, null, null, 0);
  10836. a.on("beforePaste", function(a) {
  10837. a.removeListener();
  10838. e = true;
  10839. h = a.data.type
  10840. }, null, null, 1E3);
  10841. if (p() === false) {
  10842. a.removeListener("paste", d);
  10843. if (e && a.fire("pasteDialog", g)) {
  10844. a.on("pasteDialogCommit", f);
  10845. a.on("dialogHide", function(a) {
  10846. a.removeListener();
  10847. a.data.removeListener("pasteDialogCommit", f);
  10848. setTimeout(function() { i || c(null) }, 10)
  10849. })
  10850. } else c(null)
  10851. }
  10852. }
  10853. }
  10854. function e(a) { if (CKEDITOR.env.webkit) { if (!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html" } else if (CKEDITOR.env.ie) { if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi) && !a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html" } else if (CKEDITOR.env.gecko) { if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html" } else return "html"; return "htmlifiedtext" }
  10855. function b(a, b) {
  10856. function c(a) { return CKEDITOR.tools.repeat("</p><p>", ~~(a / 2)) + (a % 2 == 1 ? "<br>" : "") }
  10857. b = b.replace(/\s+/g,
  10858. " ").replace(/> +</g, "><").replace(/<br ?\/>/gi, "<br>");
  10859. b = b.replace(/<\/?[A-Z]+>/g, function(a) { return a.toLowerCase() });
  10860. if (b.match(/^[^<]$/)) return b;
  10861. if (CKEDITOR.env.webkit && b.indexOf("<div>") > -1) {
  10862. b = b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g, "<div></div>");
  10863. b.match(/<div>(<br>|)<\/div>/) && (b = "<p>" + b.replace(/(<div>(<br>|)<\/div>)+/g, function(a) { return c(a.split("</div><div>").length + 1) }) + "</p>");
  10864. b = b.replace(/<\/div><div>/g, "<br>");
  10865. b = b.replace(/<\/?div>/g, "")
  10866. }
  10867. if (CKEDITOR.env.gecko && a.enterMode != CKEDITOR.ENTER_BR) {
  10868. CKEDITOR.env.gecko && (b = b.replace(/^<br><br>$/, "<br>"));
  10869. b.indexOf("<br><br>") > -1 && (b = "<p>" + b.replace(/(<br>){2,}/g, function(a) { return c(a.length / 4) }) + "</p>")
  10870. }
  10871. return d(a, b)
  10872. }
  10873. function g() {
  10874. var a = new CKEDITOR.htmlParser.filter,
  10875. b = { blockquote: 1, dl: 1, fieldset: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, ol: 1, p: 1, table: 1, ul: 1 },
  10876. c = CKEDITOR.tools.extend({ br: 0 }, CKEDITOR.dtd.$inline),
  10877. d = { p: 1, br: 1, "cke:br": 1 },
  10878. g = CKEDITOR.dtd,
  10879. e = CKEDITOR.tools.extend({
  10880. area: 1,
  10881. basefont: 1,
  10882. embed: 1,
  10883. iframe: 1,
  10884. map: 1,
  10885. object: 1,
  10886. param: 1
  10887. }, CKEDITOR.dtd.$nonBodyContent, CKEDITOR.dtd.$cdata),
  10888. o = function(a) {
  10889. delete a.name;
  10890. a.add(new CKEDITOR.htmlParser.text(" "))
  10891. },
  10892. q = function(a) {
  10893. for (var b = a, c;
  10894. (b = b.next) && b.name && b.name.match(/^h\d$/);) {
  10895. c = new CKEDITOR.htmlParser.element("cke:br");
  10896. c.isEmpty = true;
  10897. for (a.add(c); c = b.children.shift();) a.add(c)
  10898. }
  10899. };
  10900. a.addRules({
  10901. elements: {
  10902. h1: q,
  10903. h2: q,
  10904. h3: q,
  10905. h4: q,
  10906. h5: q,
  10907. h6: q,
  10908. img: function(a) {
  10909. var a = CKEDITOR.tools.trim(a.attributes.alt || ""),
  10910. b = " ";
  10911. a && !a.match(/(^http|\.(jpe?g|gif|png))/i) &&
  10912. (b = " [" + a + "] ");
  10913. return new CKEDITOR.htmlParser.text(b)
  10914. },
  10915. td: o,
  10916. th: o,
  10917. $: function(a) {
  10918. var j = a.name,
  10919. p;
  10920. if (e[j]) return false;
  10921. a.attributes = {};
  10922. if (j == "br") return a;
  10923. if (b[j]) a.name = "p";
  10924. else if (c[j]) delete a.name;
  10925. else if (g[j]) {
  10926. p = new CKEDITOR.htmlParser.element("cke:br");
  10927. p.isEmpty = true;
  10928. if (CKEDITOR.dtd.$empty[j]) return p;
  10929. a.add(p, 0);
  10930. p = p.clone();
  10931. p.isEmpty = true;
  10932. a.add(p);
  10933. delete a.name
  10934. }
  10935. d[a.name] || delete a.name;
  10936. return a
  10937. }
  10938. }
  10939. }, { applyToAll: true });
  10940. return a
  10941. }
  10942. function c(a, b, c) {
  10943. var b = new CKEDITOR.htmlParser.fragment.fromHtml(b),
  10944. g = new CKEDITOR.htmlParser.basicWriter;
  10945. b.writeHtml(g, c);
  10946. var b = g.getHtml(),
  10947. b = b.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g, "$1").replace(/(<cke:br \/>){2,}/g, "<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g, "$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g, "$1").replace(/<(cke:)?br( \/)?>/g, "<br>").replace(/<p><\/p>/g, ""),
  10948. e = 0,
  10949. b = b.replace(/<\/?p>/g, function(a) { if (a == "<p>") { if (++e > 1) return "</p><p>" } else if (--e > 0) return "</p><p>"; return a }).replace(/<p><\/p>/g, "");
  10950. return d(a, b)
  10951. }
  10952. function d(a, b) {
  10953. a.enterMode ==
  10954. CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function(a) { return CKEDITOR.tools.repeat("<br>", a.length / 7 * 2) }).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, "<$1div>"));
  10955. return b
  10956. }
  10957. CKEDITOR.plugins.add("clipboard", {
  10958. requires: "dialog",
  10959. init: function(d) {
  10960. var f;
  10961. a(d);
  10962. CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path + "dialogs/paste.js"));
  10963. d.on("paste", function(a) {
  10964. var b = a.data.dataValue,
  10965. c = CKEDITOR.dtd.$block;
  10966. if (b.indexOf("Apple-") > -1) {
  10967. b = b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi,
  10968. " ");
  10969. a.data.type != "html" && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) { return b.replace(/\t/g, "&nbsp;&nbsp; &nbsp;") }));
  10970. if (b.indexOf('<br class="Apple-interchange-newline">') > -1) {
  10971. a.data.startsWithEOL = 1;
  10972. a.data.preSniffing = "html";
  10973. b = b.replace(/<br class="Apple-interchange-newline">/, "")
  10974. }
  10975. b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi, "$1")
  10976. }
  10977. if (b.match(/^<[^<]+cke_(editable|contents)/i)) {
  10978. var d, f, g = new CKEDITOR.dom.element("div");
  10979. for (g.setHtml(b); g.getChildCount() == 1 && (d =
  10980. g.getFirst()) && d.type == CKEDITOR.NODE_ELEMENT && (d.hasClass("cke_editable") || d.hasClass("cke_contents"));) g = f = d;
  10981. f && (b = f.getHtml().replace(/<br>$/i, ""))
  10982. }
  10983. CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function(b, d) { if (d.toLowerCase() in c) { a.data.preSniffing = "html"; return "<" + d } return b }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, d) { if (d in c) { a.data.endsWithEOL = 1; return "</" + d + ">" } return b }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
  10984. a.data.dataValue = b
  10985. }, null,
  10986. null, 3);
  10987. d.on("paste", function(a) {
  10988. var a = a.data,
  10989. i = a.type,
  10990. k = a.dataValue,
  10991. n, o = d.config.clipboard_defaultContentType || "html";
  10992. n = i == "html" || a.preSniffing == "html" ? "html" : e(k);
  10993. n == "htmlifiedtext" ? k = b(d.config, k) : i == "text" && n == "html" && (k = c(d.config, k, f || (f = g(d))));
  10994. a.startsWithEOL && (k = '<br data-cke-eol="1">' + k);
  10995. a.endsWithEOL && (k = k + '<br data-cke-eol="1">');
  10996. i == "auto" && (i = n == "html" || o == "html" ? "html" : "text");
  10997. a.type = i;
  10998. a.dataValue = k;
  10999. delete a.preSniffing;
  11000. delete a.startsWithEOL;
  11001. delete a.endsWithEOL
  11002. }, null, null, 6);
  11003. d.on("paste",
  11004. function(a) {
  11005. a = a.data;
  11006. d.insertHtml(a.dataValue, a.type);
  11007. setTimeout(function() { d.fire("afterPaste") }, 0)
  11008. }, null, null, 1E3);
  11009. d.on("pasteDialog", function(a) { setTimeout(function() { d.openDialog("paste", a.data) }, 0) })
  11010. }
  11011. })
  11012. }(),
  11013. function() {
  11014. CKEDITOR.plugins.add("panel", { beforeInit: function(a) { a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler) } });
  11015. CKEDITOR.UI_PANEL = "panel";
  11016. CKEDITOR.ui.panel = function(a, b) {
  11017. b && CKEDITOR.tools.extend(this, b);
  11018. CKEDITOR.tools.extend(this, { className: "", css: [] });
  11019. this.id = CKEDITOR.tools.getNextId();
  11020. this.document = a;
  11021. this.isFramed = this.forceIFrame || this.css.length;
  11022. this._ = { blocks: {} }
  11023. };
  11024. CKEDITOR.ui.panel.handler = { create: function(a) { return new CKEDITOR.ui.panel(a) } };
  11025. var a = CKEDITOR.addTemplate("panel", '<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),
  11026. e = CKEDITOR.addTemplate("panel-frame", '<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),
  11027. b = CKEDITOR.addTemplate("panel-frame-inner", '<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');
  11028. CKEDITOR.ui.panel.prototype = {
  11029. render: function(g, c) {
  11030. this.getHolderElement = function() {
  11031. var a = this._.holder;
  11032. if (!a) {
  11033. if (this.isFramed) {
  11034. var a = this.document.getById(this.id + "_frame"),
  11035. c = a.getParent(),
  11036. a = a.getFrameDocument();
  11037. CKEDITOR.env.iOS && c.setStyles({ overflow: "scroll", "-webkit-overflow-scrolling": "touch" });
  11038. c = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() { this.isLoaded = true; if (this.onLoad) this.onLoad() }, this));
  11039. a.write(b.output(CKEDITOR.tools.extend({ css: CKEDITOR.tools.buildStyleHtml(this.css), onload: "window.parent.CKEDITOR.tools.callFunction(" + c + ");" }, d)));
  11040. a.getWindow().$.CKEDITOR = CKEDITOR;
  11041. a.on("keydown", function(a) {
  11042. var b = a.data.getKeystroke(),
  11043. c = this.document.getById(this.id).getAttribute("dir");
  11044. this._.onKeyDown && this._.onKeyDown(b) === false ? a.data.preventDefault() : (b == 27 || b == (c == "rtl" ? 39 :
  11045. 37)) && this.onEscape && this.onEscape(b) === false && a.data.preventDefault()
  11046. }, this);
  11047. a = a.getBody();
  11048. a.unselectable();
  11049. CKEDITOR.env.air && CKEDITOR.tools.callFunction(c)
  11050. } else a = this.document.getById(this.id);
  11051. this._.holder = a
  11052. }
  11053. return a
  11054. };
  11055. var d = { editorId: g.id, id: this.id, langCode: g.langCode, dir: g.lang.dir, cls: this.className, frame: "", env: CKEDITOR.env.cssClass, "z-index": g.config.baseFloatZIndex + 1 };
  11056. if (this.isFramed) {
  11057. var j = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent("document.open();(" +
  11058. CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : "";
  11059. d.frame = e.output({ id: this.id + "_frame", src: j })
  11060. }
  11061. j = a.output(d);
  11062. c && c.push(j);
  11063. return j
  11064. },
  11065. addBlock: function(a, b) {
  11066. b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(), b);
  11067. this._.currentBlock || this.showBlock(a);
  11068. return b
  11069. },
  11070. getBlock: function(a) { return this._.blocks[a] },
  11071. showBlock: function(a) {
  11072. var a = this._.blocks[a],
  11073. b = this._.currentBlock,
  11074. d = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id +
  11075. "_frame");
  11076. b && b.hide();
  11077. this._.currentBlock = a;
  11078. CKEDITOR.fire("ariaWidget", d);
  11079. a._.focusIndex = -1;
  11080. this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
  11081. a.show();
  11082. return a
  11083. },
  11084. destroy: function() { this.element && this.element.remove() }
  11085. };
  11086. CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass({
  11087. $: function(a, b) {
  11088. this.element = a.append(a.getDocument().createElement("div", { attributes: { tabindex: -1, "class": "cke_panel_block" }, styles: { display: "none" } }));
  11089. b && CKEDITOR.tools.extend(this, b);
  11090. this.element.setAttributes({
  11091. role: this.attributes.role ||
  11092. "presentation",
  11093. "aria-label": this.attributes["aria-label"],
  11094. title: this.attributes.title || this.attributes["aria-label"]
  11095. });
  11096. this.keys = {};
  11097. this._.focusIndex = -1;
  11098. this.element.disableContextMenu()
  11099. },
  11100. _: {
  11101. markItem: function(a) {
  11102. if (a != -1) {
  11103. a = this.element.getElementsByTag("a").getItem(this._.focusIndex = a);
  11104. CKEDITOR.env.webkit && a.getDocument().getWindow().focus();
  11105. a.focus();
  11106. this.onMark && this.onMark(a)
  11107. }
  11108. }
  11109. },
  11110. proto: {
  11111. show: function() { this.element.setStyle("display", "") },
  11112. hide: function() {
  11113. (!this.onHide || this.onHide.call(this) !==
  11114. true) && this.element.setStyle("display", "none")
  11115. },
  11116. onKeyDown: function(a, b) {
  11117. var d = this.keys[a];
  11118. switch (d) {
  11119. case "next":
  11120. for (var e = this._.focusIndex, d = this.element.getElementsByTag("a"), f; f = d.getItem(++e);)
  11121. if (f.getAttribute("_cke_focus") && f.$.offsetWidth) {
  11122. this._.focusIndex = e;
  11123. f.focus();
  11124. break
  11125. }
  11126. if (!f && !b) { this._.focusIndex = -1; return this.onKeyDown(a, 1) }
  11127. return false;
  11128. case "prev":
  11129. e = this._.focusIndex;
  11130. for (d = this.element.getElementsByTag("a"); e > 0 && (f = d.getItem(--e));) {
  11131. if (f.getAttribute("_cke_focus") && f.$.offsetWidth) {
  11132. this._.focusIndex =
  11133. e;
  11134. f.focus();
  11135. break
  11136. }
  11137. f = null
  11138. }
  11139. if (!f && !b) { this._.focusIndex = d.count(); return this.onKeyDown(a, 1) }
  11140. return false;
  11141. case "click":
  11142. case "mouseup":
  11143. e = this._.focusIndex;
  11144. (f = e >= 0 && this.element.getElementsByTag("a").getItem(e)) && (f.$[d] ? f.$[d]() : f.$["on" + d]());
  11145. return false
  11146. }
  11147. return true
  11148. }
  11149. }
  11150. })
  11151. }(), CKEDITOR.plugins.add("floatpanel", { requires: "panel" }),
  11152. function() {
  11153. function a(a, g, c, d, j) {
  11154. var j = CKEDITOR.tools.genKey(g.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || "", d.css || "", j || ""),
  11155. f = e[j];
  11156. if (!f) {
  11157. f = e[j] = new CKEDITOR.ui.panel(g,
  11158. d);
  11159. f.element = c.append(CKEDITOR.dom.element.createFromHtml(f.render(a), g));
  11160. f.element.setStyles({ display: "none", position: "absolute" })
  11161. }
  11162. return f
  11163. }
  11164. var e = {};
  11165. CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
  11166. $: function(b, g, c, d) {
  11167. function e() { k.hide() }
  11168. c.forceIFrame = 1;
  11169. c.toolbarRelated && b.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (g = CKEDITOR.document.getById("cke_" + b.name));
  11170. var f = g.getDocument(),
  11171. d = a(b, f, g, c, d || 0),
  11172. h = d.element,
  11173. i = h.getFirst(),
  11174. k = this;
  11175. h.disableContextMenu();
  11176. this.element = h;
  11177. this._ = {
  11178. editor: b,
  11179. panel: d,
  11180. parentElement: g,
  11181. definition: c,
  11182. document: f,
  11183. iframe: i,
  11184. children: [],
  11185. dir: b.lang.dir
  11186. };
  11187. b.on("mode", e);
  11188. b.on("resize", e);
  11189. if (!CKEDITOR.env.iOS) f.getWindow().on("resize", e)
  11190. },
  11191. proto: {
  11192. addBlock: function(a, g) { return this._.panel.addBlock(a, g) },
  11193. addListBlock: function(a, g) { return this._.panel.addListBlock(a, g) },
  11194. getBlock: function(a) { return this._.panel.getBlock(a) },
  11195. showBlock: function(a, g, c, d, e, f) {
  11196. var h = this._.panel,
  11197. i = h.showBlock(a);
  11198. this.allowBlur(false);
  11199. a = this._.editor.editable();
  11200. this._.returnFocus = a.hasFocus ? a : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
  11201. this._.hideTimeout = 0;
  11202. var k = this.element,
  11203. a = this._.iframe,
  11204. a = CKEDITOR.env.ie ? a : new CKEDITOR.dom.window(a.$.contentWindow),
  11205. n = k.getDocument(),
  11206. o = this._.parentElement.getPositionedAncestor(),
  11207. q = g.getDocumentPosition(n),
  11208. n = o ? o.getDocumentPosition(n) : { x: 0, y: 0 },
  11209. m = this._.dir == "rtl",
  11210. l = q.x + (d || 0) - n.x,
  11211. p = q.y + (e || 0) - n.y;
  11212. if (m && (c == 1 || c == 4)) l = l + g.$.offsetWidth;
  11213. else if (!m && (c == 2 || c == 3)) l = l + (g.$.offsetWidth - 1);
  11214. if (c == 3 || c == 4) p = p + (g.$.offsetHeight - 1);
  11215. this._.panel._.offsetParentId = g.getId();
  11216. k.setStyles({
  11217. top: p + "px",
  11218. left: 0,
  11219. display: ""
  11220. });
  11221. k.setOpacity(0);
  11222. k.getFirst().removeStyle("width");
  11223. this._.editor.focusManager.add(a);
  11224. if (!this._.blurSet) {
  11225. CKEDITOR.event.useCapture = true;
  11226. a.on("blur", function(a) {
  11227. function b() {
  11228. delete this._.returnFocus;
  11229. this.hide()
  11230. }
  11231. if (this.allowBlur() && a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !this._.activeChild)
  11232. if (CKEDITOR.env.iOS) { if (!this._.hideTimeout) this._.hideTimeout = CKEDITOR.tools.setTimeout(b, 0, this) } else b.call(this)
  11233. }, this);
  11234. a.on("focus", function() {
  11235. this._.focused = true;
  11236. this.hideChild();
  11237. this.allowBlur(true)
  11238. }, this);
  11239. if (CKEDITOR.env.iOS) {
  11240. a.on("touchstart", function() { clearTimeout(this._.hideTimeout) }, this);
  11241. a.on("touchend", function() {
  11242. this._.hideTimeout = 0;
  11243. this.focus()
  11244. }, this)
  11245. }
  11246. CKEDITOR.event.useCapture = false;
  11247. this._.blurSet = 1
  11248. }
  11249. h.onEscape = CKEDITOR.tools.bind(function(a) { if (this.onEscape && this.onEscape(a) === false) return false }, this);
  11250. CKEDITOR.tools.setTimeout(function() {
  11251. var a = CKEDITOR.tools.bind(function() {
  11252. k.removeStyle("width");
  11253. if (i.autoSize) {
  11254. var a = i.element.getDocument(),
  11255. a = (CKEDITOR.env.webkit ?
  11256. i.element : a.getBody()).$.scrollWidth;
  11257. CKEDITOR.env.ie && (CKEDITOR.env.quirks && a > 0) && (a = a + ((k.$.offsetWidth || 0) - (k.$.clientWidth || 0) + 3));
  11258. k.setStyle("width", a + 10 + "px");
  11259. a = i.element.$.scrollHeight;
  11260. CKEDITOR.env.ie && (CKEDITOR.env.quirks && a > 0) && (a = a + ((k.$.offsetHeight || 0) - (k.$.clientHeight || 0) + 3));
  11261. k.setStyle("height", a + "px");
  11262. h._.currentBlock.element.setStyle("display", "none").removeStyle("display")
  11263. } else k.removeStyle("height");
  11264. m && (l = l - k.$.offsetWidth);
  11265. k.setStyle("left", l + "px");
  11266. var b = h.element.getWindow(),
  11267. a = k.$.getBoundingClientRect(),
  11268. b = b.getViewPaneSize(),
  11269. c = a.width || a.right - a.left,
  11270. d = a.height || a.bottom - a.top,
  11271. g = m ? a.right : b.width - a.left,
  11272. e = m ? b.width - a.right : a.left;
  11273. m ? g < c && (l = e > c ? l + c : b.width > c ? l - a.left : l - a.right + b.width) : g < c && (l = e > c ? l - c : b.width > c ? l - a.right + b.width : l - a.left);
  11274. c = a.top;
  11275. b.height - a.top < d && (p = c > d ? p - d : b.height > d ? p - a.bottom + b.height : p - a.top);
  11276. if (CKEDITOR.env.ie) {
  11277. b = a = new CKEDITOR.dom.element(k.$.offsetParent);
  11278. b.getName() == "html" && (b = b.getDocument().getBody());
  11279. b.getComputedStyle("direction") == "rtl" &&
  11280. (l = CKEDITOR.env.ie8Compat ? l - k.getDocument().getDocumentElement().$.scrollLeft * 2 : l - (a.$.scrollWidth - a.$.clientWidth))
  11281. }
  11282. var a = k.getFirst(),
  11283. j;
  11284. (j = a.getCustomData("activePanel")) && j.onHide && j.onHide.call(this, 1);
  11285. a.setCustomData("activePanel", this);
  11286. k.setStyles({ top: p + "px", left: l + "px" });
  11287. k.setOpacity(1);
  11288. f && f()
  11289. }, this);
  11290. h.isLoaded ? a() : h.onLoad = a;
  11291. CKEDITOR.tools.setTimeout(function() {
  11292. var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
  11293. this.focus();
  11294. i.element.focus();
  11295. if (CKEDITOR.env.webkit) CKEDITOR.document.getBody().$.scrollTop =
  11296. a;
  11297. this.allowBlur(true);
  11298. this._.editor.fire("panelShow", this)
  11299. }, 0, this)
  11300. }, CKEDITOR.env.air ? 200 : 0, this);
  11301. this.visible = 1;
  11302. this.onShow && this.onShow.call(this)
  11303. },
  11304. focus: function() {
  11305. if (CKEDITOR.env.webkit) {
  11306. var a = CKEDITOR.document.getActive();
  11307. a && !a.equals(this._.iframe) && a.$.blur()
  11308. }(this._.lastFocused || this._.iframe.getFrameDocument().getWindow()).focus()
  11309. },
  11310. blur: function() {
  11311. var a = this._.iframe.getFrameDocument().getActive();
  11312. a && a.is("a") && (this._.lastFocused = a)
  11313. },
  11314. hide: function(a) {
  11315. if (this.visible && (!this.onHide || this.onHide.call(this) !==
  11316. true)) {
  11317. this.hideChild();
  11318. CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
  11319. this.element.setStyle("display", "none");
  11320. this.visible = 0;
  11321. this.element.getFirst().removeCustomData("activePanel");
  11322. if (a = a && this._.returnFocus) {
  11323. CKEDITOR.env.webkit && a.type && a.getWindow().$.focus();
  11324. a.focus()
  11325. }
  11326. delete this._.lastFocused;
  11327. this._.editor.fire("panelHide", this)
  11328. }
  11329. },
  11330. allowBlur: function(a) { var g = this._.panel; if (a !== void 0) g.allowBlur = a; return g.allowBlur },
  11331. showAsChild: function(a, g, c, d, e, f) {
  11332. if (!(this._.activeChild ==
  11333. a && a._.panel._.offsetParentId == c.getId())) {
  11334. this.hideChild();
  11335. a.onHide = CKEDITOR.tools.bind(function() { CKEDITOR.tools.setTimeout(function() { this._.focused || this.hide() }, 0, this) }, this);
  11336. this._.activeChild = a;
  11337. this._.focused = false;
  11338. a.showBlock(g, c, d, e, f);
  11339. this.blur();
  11340. (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() { a.element.getChild(0).$.style.cssText += "" }, 100)
  11341. }
  11342. },
  11343. hideChild: function(a) {
  11344. var g = this._.activeChild;
  11345. if (g) {
  11346. delete g.onHide;
  11347. delete this._.activeChild;
  11348. g.hide();
  11349. a && this.focus()
  11350. }
  11351. }
  11352. }
  11353. });
  11354. CKEDITOR.on("instanceDestroyed", function() {
  11355. var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances),
  11356. g;
  11357. for (g in e) {
  11358. var c = e[g];
  11359. a ? c.destroy() : c.element.hide()
  11360. }
  11361. a && (e = {})
  11362. })
  11363. }(), CKEDITOR.plugins.add("menu", {
  11364. requires: "floatpanel",
  11365. beforeInit: function(a) {
  11366. for (var e = a.config.menu_groups.split(","), b = a._.menuGroups = {}, g = a._.menuItems = {}, c = 0; c < e.length; c++) b[e[c]] = c + 1;
  11367. a.addMenuGroup = function(a, c) { b[a] = c || 100 };
  11368. a.addMenuItem = function(a, c) { b[c.group] && (g[a] = new CKEDITOR.menuItem(this, a, c)) };
  11369. a.addMenuItems = function(a) {
  11370. for (var b in a) this.addMenuItem(b,
  11371. a[b])
  11372. };
  11373. a.getMenuItem = function(a) { return g[a] };
  11374. a.removeMenuItem = function(a) { delete g[a] }
  11375. }
  11376. }),
  11377. function() {
  11378. function a(a) { a.sort(function(a, b) { return a.group < b.group ? -1 : a.group > b.group ? 1 : a.order < b.order ? -1 : a.order > b.order ? 1 : 0 }) }
  11379. var e = '<span class="cke_menuitem"><a id="{id}" class="cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href="{href}" title="{title}" tabindex="-1"_cke_focus=1 hidefocus="true" role="{role}" aria-haspopup="{hasPopup}" aria-disabled="{disabled}" {ariaChecked}';
  11380. CKEDITOR.env.gecko &&
  11381. CKEDITOR.env.mac && (e = e + ' onkeypress="return false;"');
  11382. CKEDITOR.env.gecko && (e = e + ' onblur="this.style.cssText = this.style.cssText;"');
  11383. var e = e + (' onmouseover="CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout="CKEDITOR.tools.callFunction({moveOutFn},{index});" ' + (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},{index}); return false;">'),
  11384. b = CKEDITOR.addTemplate("menuItem", e + '<span class="cke_menubutton_inner"><span class="cke_menubutton_icon"><span class="cke_button_icon cke_button__{iconName}_icon" style="{iconStyle}"></span></span><span class="cke_menubutton_label">{label}</span>{arrowHtml}</span></a></span>'),
  11385. g = CKEDITOR.addTemplate("menuArrow", '<span class="cke_menuarrow"><span>{label}</span></span>');
  11386. CKEDITOR.menu = CKEDITOR.tools.createClass({
  11387. $: function(a, b) {
  11388. b = this._.definition = b || {};
  11389. this.id = CKEDITOR.tools.getNextId();
  11390. this.editor = a;
  11391. this.items = [];
  11392. this._.listeners = [];
  11393. this._.level = b.level || 1;
  11394. var g = CKEDITOR.tools.extend({}, b.panel, { css: [CKEDITOR.skin.getPath("editor")], level: this._.level - 1, block: {} }),
  11395. f = g.block.attributes = g.attributes || {};
  11396. !f.role && (f.role = "menu");
  11397. this._.panelDefinition = g
  11398. },
  11399. _: {
  11400. onShow: function() {
  11401. var a =
  11402. this.editor.getSelection(),
  11403. b = a && a.getStartElement(),
  11404. g = this.editor.elementPath(),
  11405. f = this._.listeners;
  11406. this.removeAll();
  11407. for (var e = 0; e < f.length; e++) {
  11408. var i = f[e](b, a, g);
  11409. if (i)
  11410. for (var k in i) {
  11411. var n = this.editor.getMenuItem(k);
  11412. if (n && (!n.command || this.editor.getCommand(n.command).state)) {
  11413. n.state = i[k];
  11414. this.add(n)
  11415. }
  11416. }
  11417. }
  11418. },
  11419. onClick: function(a) {
  11420. this.hide();
  11421. if (a.onClick) a.onClick();
  11422. else a.command && this.editor.execCommand(a.command)
  11423. },
  11424. onEscape: function(a) {
  11425. var b = this.parent;
  11426. b ? b._.panel.hideChild(1) : a == 27 && this.hide(1);
  11427. return false
  11428. },
  11429. onHide: function() { this.onHide && this.onHide() },
  11430. showSubMenu: function(a) {
  11431. var b = this._.subMenu,
  11432. g = this.items[a];
  11433. if (g = g.getItems && g.getItems()) {
  11434. if (b) b.removeAll();
  11435. else {
  11436. b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, { level: this._.level + 1 }, true));
  11437. b.parent = this;
  11438. b._.onClick = CKEDITOR.tools.bind(this._.onClick, this)
  11439. }
  11440. for (var f in g) {
  11441. var e = this.editor.getMenuItem(f);
  11442. if (e) {
  11443. e.state = g[f];
  11444. b.add(e)
  11445. }
  11446. }
  11447. var i = this._.panel.getBlock(this.id).element.getDocument().getById(this.id +
  11448. ("" + a));
  11449. setTimeout(function() { b.show(i, 2) }, 0)
  11450. } else this._.panel.hideChild(1)
  11451. }
  11452. },
  11453. proto: {
  11454. add: function(a) {
  11455. if (!a.order) a.order = this.items.length;
  11456. this.items.push(a)
  11457. },
  11458. removeAll: function() { this.items = [] },
  11459. show: function(b, d, g, f) {
  11460. if (!this.parent) { this._.onShow(); if (!this.items.length) return }
  11461. var d = d || (this.editor.lang.dir == "rtl" ? 2 : 1),
  11462. e = this.items,
  11463. i = this.editor,
  11464. k = this._.panel,
  11465. n = this._.element;
  11466. if (!k) {
  11467. k = this._.panel = new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level);
  11468. k.onEscape = CKEDITOR.tools.bind(function(a) { if (this._.onEscape(a) === false) return false }, this);
  11469. k.onShow = function() { k._.panel.getHolderElement().getParent().addClass("cke cke_reset_all") };
  11470. k.onHide = CKEDITOR.tools.bind(function() { this._.onHide && this._.onHide() }, this);
  11471. n = k.addBlock(this.id, this._.panelDefinition.block);
  11472. n.autoSize = true;
  11473. var o = n.keys;
  11474. o[40] = "next";
  11475. o[9] = "next";
  11476. o[38] = "prev";
  11477. o[CKEDITOR.SHIFT + 9] = "prev";
  11478. o[i.lang.dir == "rtl" ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click";
  11479. o[32] = CKEDITOR.env.ie ? "mouseup" :
  11480. "click";
  11481. CKEDITOR.env.ie && (o[13] = "mouseup");
  11482. n = this._.element = n.element;
  11483. o = n.getDocument();
  11484. o.getBody().setStyle("overflow", "hidden");
  11485. o.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden");
  11486. this._.itemOverFn = CKEDITOR.tools.addFunction(function(a) {
  11487. clearTimeout(this._.showSubTimeout);
  11488. this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, i.config.menu_subMenuDelay || 400, this, [a])
  11489. }, this);
  11490. this._.itemOutFn = CKEDITOR.tools.addFunction(function() { clearTimeout(this._.showSubTimeout) }, this);
  11491. this._.itemClickFn = CKEDITOR.tools.addFunction(function(a) {
  11492. var b = this.items[a];
  11493. if (b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1);
  11494. else if (b.getItems) this._.showSubMenu(a);
  11495. else this._.onClick(b)
  11496. }, this)
  11497. }
  11498. a(e);
  11499. for (var o = i.elementPath(), o = ['<div class="cke_menu' + (o && o.direction() != i.lang.dir ? " cke_mixed_dir_content" : "") + '" role="presentation">'], q = e.length, m = q && e[0].group, l = 0; l < q; l++) {
  11500. var p = e[l];
  11501. if (m != p.group) {
  11502. o.push('<div class="cke_menuseparator" role="separator"></div>');
  11503. m = p.group
  11504. }
  11505. p.render(this, l, o)
  11506. }
  11507. o.push("</div>");
  11508. n.setHtml(o.join(""));
  11509. CKEDITOR.ui.fire("ready", this);
  11510. this.parent ? this.parent._.panel.showAsChild(k, this.id, b, d, g, f) : k.showBlock(this.id, b, d, g, f);
  11511. i.fire("menuShow", [k])
  11512. },
  11513. addListener: function(a) { this._.listeners.push(a) },
  11514. hide: function(a) {
  11515. this._.onHide && this._.onHide();
  11516. this._.panel && this._.panel.hide(a)
  11517. }
  11518. }
  11519. });
  11520. CKEDITOR.menuItem = CKEDITOR.tools.createClass({
  11521. $: function(a, b, g) {
  11522. CKEDITOR.tools.extend(this, g, { order: 0, className: "cke_menubutton__" + b });
  11523. this.group = a._.menuGroups[this.group];
  11524. this.editor = a;
  11525. this.name =
  11526. b
  11527. },
  11528. proto: {
  11529. render: function(a, d, e) {
  11530. var f = a.id + ("" + d),
  11531. h = typeof this.state == "undefined" ? CKEDITOR.TRISTATE_OFF : this.state,
  11532. i = "",
  11533. k = h == CKEDITOR.TRISTATE_ON ? "on" : h == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off";
  11534. this.role in { menuitemcheckbox: 1, menuitemradio: 1 } && (i = ' aria-checked="' + (h == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"');
  11535. var n = this.getItems,
  11536. o = "&#" + (this.editor.lang.dir == "rtl" ? "9668" : "9658") + ";",
  11537. q = this.name;
  11538. if (this.icon && !/\./.test(this.icon)) q = this.icon;
  11539. a = {
  11540. id: f,
  11541. name: this.name,
  11542. iconName: q,
  11543. label: this.label,
  11544. cls: this.className || "",
  11545. state: k,
  11546. hasPopup: n ? "true" : "false",
  11547. disabled: h == CKEDITOR.TRISTATE_DISABLED,
  11548. title: this.label,
  11549. href: "javascript:void('" + (this.label || "").replace("'") + "')",
  11550. hoverFn: a._.itemOverFn,
  11551. moveOutFn: a._.itemOutFn,
  11552. clickFn: a._.itemClickFn,
  11553. index: d,
  11554. iconStyle: CKEDITOR.skin.getIconStyle(q, this.editor.lang.dir == "rtl", q == this.icon ? null : this.icon, this.iconOffset),
  11555. arrowHtml: n ? g.output({ label: o }) : "",
  11556. role: this.role ? this.role : "menuitem",
  11557. ariaChecked: i
  11558. };
  11559. b.output(a, e)
  11560. }
  11561. }
  11562. })
  11563. }(), CKEDITOR.config.menu_groups = "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div",
  11564. CKEDITOR.plugins.add("contextmenu", {
  11565. requires: "menu",
  11566. onLoad: function() {
  11567. CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({
  11568. base: CKEDITOR.menu,
  11569. $: function(a) { this.base.call(this, a, { panel: { className: "cke_menu_panel", attributes: { "aria-label": a.lang.contextmenu.options } } }) },
  11570. proto: {
  11571. addTarget: function(a, e) {
  11572. a.on("contextmenu", function(a) {
  11573. var a = a.data,
  11574. d = CKEDITOR.env.webkit ? b : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey;
  11575. if (!e || !d) {
  11576. a.preventDefault();
  11577. if (CKEDITOR.env.mac && CKEDITOR.env.webkit) {
  11578. var d = this.editor,
  11579. g = (new CKEDITOR.dom.elementPath(a.getTarget(), d.editable())).contains(function(a) { return a.hasAttribute("contenteditable") }, true);
  11580. g && g.getAttribute("contenteditable") == "false" && d.getSelection().fake(g)
  11581. }
  11582. var g = a.getTarget().getDocument(),
  11583. f = a.getTarget().getDocument().getDocumentElement(),
  11584. d = !g.equals(CKEDITOR.document),
  11585. g = g.getWindow().getScrollPosition(),
  11586. h = d ? a.$.clientX : a.$.pageX || g.x + a.$.clientX,
  11587. i = d ? a.$.clientY : a.$.pageY || g.y + a.$.clientY;
  11588. CKEDITOR.tools.setTimeout(function() { this.open(f, null, h, i) }, CKEDITOR.env.ie ?
  11589. 200 : 0, this)
  11590. }
  11591. }, this);
  11592. if (CKEDITOR.env.webkit) {
  11593. var b, g = function() { b = 0 };
  11594. a.on("keydown", function(a) { b = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey });
  11595. a.on("keyup", g);
  11596. a.on("contextmenu", g)
  11597. }
  11598. },
  11599. open: function(a, e, b, g) {
  11600. this.editor.focus();
  11601. a = a || CKEDITOR.document.getDocumentElement();
  11602. this.editor.selectionChange(1);
  11603. this.show(a, e, b, g)
  11604. }
  11605. }
  11606. })
  11607. },
  11608. beforeInit: function(a) {
  11609. var e = a.contextMenu = new CKEDITOR.plugins.contextMenu(a);
  11610. a.on("contentDom", function() {
  11611. e.addTarget(a.editable(), a.config.browserContextMenuOnCtrl !==
  11612. false)
  11613. });
  11614. a.addCommand("contextMenu", { exec: function() { a.contextMenu.open(a.document.getBody()) } });
  11615. a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu");
  11616. a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu")
  11617. }
  11618. }),
  11619. function() {
  11620. var a;
  11621. function e(d, g) {
  11622. function f(a) {
  11623. a = n.list[a];
  11624. if (a.equals(d.editable()) || a.getAttribute("contenteditable") == "true") {
  11625. var b = d.createRange();
  11626. b.selectNodeContents(a);
  11627. b.select()
  11628. } else d.getSelection().selectElement(a);
  11629. d.focus()
  11630. }
  11631. function e() {
  11632. k && k.setHtml(b);
  11633. delete n.list
  11634. }
  11635. var i = d.ui.spaceId("path"),
  11636. k, n = d._.elementsPath,
  11637. o = n.idBase;
  11638. g.html = g.html + ('<span id="' + i + '_label" class="cke_voice_label">' + d.lang.elementspath.eleLabel + '</span><span id="' + i + '" class="cke_path" role="group" aria-labelledby="' + i + '_label">' + b + "</span>");
  11639. d.on("uiReady", function() {
  11640. var a = d.ui.space("path");
  11641. a && d.focusManager.add(a, 1)
  11642. });
  11643. n.onClick = f;
  11644. var q = CKEDITOR.tools.addFunction(f),
  11645. m = CKEDITOR.tools.addFunction(function(a, b) {
  11646. var c = n.idBase,
  11647. g, b = new CKEDITOR.dom.event(b);
  11648. g = d.lang.dir == "rtl";
  11649. switch (b.getKeystroke()) {
  11650. case g ? 39:
  11651. 37:
  11652. case 9:
  11653. (g =
  11654. CKEDITOR.document.getById(c + (a + 1))) || (g = CKEDITOR.document.getById(c + "0"));
  11655. g.focus();
  11656. return false;
  11657. case g ? 37:
  11658. 39:
  11659. case CKEDITOR.SHIFT + 9:
  11660. (g = CKEDITOR.document.getById(c + (a - 1))) || (g = CKEDITOR.document.getById(c + (n.list.length - 1)));
  11661. g.focus();
  11662. return false;
  11663. case 27:
  11664. d.focus();
  11665. return false;
  11666. case 13:
  11667. case 32:
  11668. f(a);
  11669. return false
  11670. }
  11671. return true
  11672. });
  11673. d.on("selectionChange", function() {
  11674. for (var a = [], f = n.list = [], g = [], e = n.filters, h = true, j = d.elementPath().elements, x, v = j.length; v--;) {
  11675. var r = j[v],
  11676. y = 0;
  11677. x = r.data("cke-display-name") ? r.data("cke-display-name") :
  11678. r.data("cke-real-element-type") ? r.data("cke-real-element-type") : r.getName();
  11679. h = r.hasAttribute("contenteditable") ? r.getAttribute("contenteditable") == "true" : h;
  11680. !h && !r.hasAttribute("contenteditable") && (y = 1);
  11681. for (var z = 0; z < e.length; z++) {
  11682. var B = e[z](r, x);
  11683. if (B === false) { y = 1; break }
  11684. x = B || x
  11685. }
  11686. if (!y) {
  11687. f.unshift(r);
  11688. g.unshift(x)
  11689. }
  11690. }
  11691. f = f.length;
  11692. for (e = 0; e < f; e++) {
  11693. x = g[e];
  11694. h = d.lang.elementspath.eleTitle.replace(/%1/, x);
  11695. x = c.output({ id: o + e, label: h, text: x, jsTitle: "javascript:void('" + x + "')", index: e, keyDownFn: m, clickFn: q });
  11696. a.unshift(x)
  11697. }
  11698. k ||
  11699. (k = CKEDITOR.document.getById(i));
  11700. g = k;
  11701. g.setHtml(a.join("") + b);
  11702. d.fire("elementsPathUpdate", { space: g })
  11703. });
  11704. d.on("readOnly", e);
  11705. d.on("contentDomUnload", e);
  11706. d.addCommand("elementsPathFocus", a);
  11707. d.setKeystroke(CKEDITOR.ALT + 122, "elementsPathFocus")
  11708. }
  11709. a = {
  11710. editorFocus: false,
  11711. readOnly: 1,
  11712. exec: function(a) {
  11713. (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air)
  11714. }
  11715. };
  11716. var b = '<span class="cke_path_empty">&nbsp;</span>',
  11717. g = "";
  11718. CKEDITOR.env.gecko && CKEDITOR.env.mac && (g = g + ' onkeypress="return false;"');
  11719. CKEDITOR.env.gecko && (g = g + ' onblur="this.style.cssText = this.style.cssText;"');
  11720. var c = CKEDITOR.addTemplate("pathItem", '<a id="{id}" href="{jsTitle}" tabindex="-1" class="cke_path_item" title="{label}"' + g + ' hidefocus="true" onkeydown="return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick="CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role="button" aria-label=""></a>');
  11721. CKEDITOR.plugins.add("elementspath", {
  11722. init: function(a) {
  11723. a._.elementsPath = {
  11724. idBase: "cke_elementspath_" +
  11725. CKEDITOR.tools.getNextNumber() + "_",
  11726. filters: []
  11727. };
  11728. a.on("uiSpace", function(b) { b.data.space == "bottom" && e(a, b.data) })
  11729. }
  11730. })
  11731. }(),
  11732. function() {
  11733. function a(a, c) {
  11734. var d, j;
  11735. c.on("refresh", function(a) {
  11736. var c = [e],
  11737. d;
  11738. for (d in a.data.states) c.push(a.data.states[d]);
  11739. this.setState(CKEDITOR.tools.search(c, b) ? b : e)
  11740. }, c, null, 100);
  11741. c.on("exec", function(b) {
  11742. d = a.getSelection();
  11743. j = d.createBookmarks(1);
  11744. if (!b.data) b.data = {};
  11745. b.data.done = false
  11746. }, c, null, 0);
  11747. c.on("exec", function() {
  11748. a.forceNextSelectionCheck();
  11749. d.selectBookmarks(j)
  11750. }, c, null, 100)
  11751. }
  11752. var e =
  11753. CKEDITOR.TRISTATE_DISABLED,
  11754. b = CKEDITOR.TRISTATE_OFF;
  11755. CKEDITOR.plugins.add("indent", {
  11756. init: function(b) {
  11757. var c = CKEDITOR.plugins.indent.genericDefinition;
  11758. a(b, b.addCommand("indent", new c(true)));
  11759. a(b, b.addCommand("outdent", new c));
  11760. if (b.ui.addButton) {
  11761. b.ui.addButton("Indent", { label: b.lang.indent.indent, command: "indent", directional: true, toolbar: "indent,20" });
  11762. b.ui.addButton("Outdent", { label: b.lang.indent.outdent, command: "outdent", directional: true, toolbar: "indent,10" })
  11763. }
  11764. b.on("dirChanged", function(a) {
  11765. var c = b.createRange(),
  11766. f = a.data.node;
  11767. c.setStartBefore(f);
  11768. c.setEndAfter(f);
  11769. for (var e = new CKEDITOR.dom.walker(c), i; i = e.next();)
  11770. if (i.type == CKEDITOR.NODE_ELEMENT)
  11771. if (!i.equals(f) && i.getDirection()) {
  11772. c.setStartAfter(i);
  11773. e = new CKEDITOR.dom.walker(c)
  11774. } else {
  11775. var k = b.config.indentClasses;
  11776. if (k)
  11777. for (var n = a.data.dir == "ltr" ? ["_rtl", ""] : ["", "_rtl"], o = 0; o < k.length; o++)
  11778. if (i.hasClass(k[o] + n[0])) {
  11779. i.removeClass(k[o] + n[0]);
  11780. i.addClass(k[o] + n[1])
  11781. }
  11782. k = i.getStyle("margin-right");
  11783. n = i.getStyle("margin-left");
  11784. k ? i.setStyle("margin-left", k) : i.removeStyle("margin-left");
  11785. n ? i.setStyle("margin-right", n) : i.removeStyle("margin-right")
  11786. }
  11787. })
  11788. }
  11789. });
  11790. CKEDITOR.plugins.indent = {
  11791. genericDefinition: function(a) {
  11792. this.isIndent = !!a;
  11793. this.startDisabled = !this.isIndent
  11794. },
  11795. specificDefinition: function(a, b, d) {
  11796. this.name = b;
  11797. this.editor = a;
  11798. this.jobs = {};
  11799. this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
  11800. this.isIndent = !!d;
  11801. this.relatedGlobal = d ? "indent" : "outdent";
  11802. this.indentKey = d ? 9 : CKEDITOR.SHIFT + 9;
  11803. this.database = {}
  11804. },
  11805. registerCommands: function(a, b) {
  11806. a.on("pluginsLoaded", function() {
  11807. for (var a in b)(function(a,
  11808. b) {
  11809. var c = a.getCommand(b.relatedGlobal),
  11810. d;
  11811. for (d in b.jobs) {
  11812. c.on("exec", function(c) {
  11813. if (!c.data.done) {
  11814. a.fire("lockSnapshot");
  11815. if (b.execJob(a, d)) c.data.done = true;
  11816. a.fire("unlockSnapshot");
  11817. CKEDITOR.dom.element.clearAllMarkers(b.database)
  11818. }
  11819. }, this, null, d);
  11820. c.on("refresh", function(c) {
  11821. if (!c.data.states) c.data.states = {};
  11822. c.data.states[b.name + "@" + d] = b.refreshJob(a, d, c.data.path)
  11823. }, this, null, d)
  11824. }
  11825. a.addFeature(b)
  11826. })(this, b[a])
  11827. })
  11828. }
  11829. };
  11830. CKEDITOR.plugins.indent.genericDefinition.prototype = { context: "p", exec: function() {} };
  11831. CKEDITOR.plugins.indent.specificDefinition.prototype = {
  11832. execJob: function(a, b) { var d = this.jobs[b]; if (d.state != e) return d.exec.call(this, a) },
  11833. refreshJob: function(a, b, d) {
  11834. b = this.jobs[b];
  11835. b.state = a.activeFilter.checkFeature(this) ? b.refresh.call(this, a, d) : e;
  11836. return b.state
  11837. },
  11838. getContext: function(a) { return a.contains(this.context) }
  11839. }
  11840. }(),
  11841. function() {
  11842. function a(a) {
  11843. function c(e) {
  11844. for (var h = q.startContainer, m = q.endContainer; h && !h.getParent().equals(e);) h = h.getParent();
  11845. for (; m && !m.getParent().equals(e);) m = m.getParent();
  11846. if (!h || !m) return false;
  11847. for (var l = h, h = [], o = false; !o;) {
  11848. l.equals(m) &&
  11849. (o = true);
  11850. h.push(l);
  11851. l = l.getNext()
  11852. }
  11853. if (h.length < 1) return false;
  11854. l = e.getParents(true);
  11855. for (m = 0; m < l.length; m++)
  11856. if (l[m].getName && j[l[m].getName()]) { e = l[m]; break }
  11857. for (var l = d.isIndent ? 1 : -1, m = h[0], h = h[h.length - 1], o = CKEDITOR.plugins.list.listToArray(e, g), x = o[h.getCustomData("listarray_index")].indent, m = m.getCustomData("listarray_index"); m <= h.getCustomData("listarray_index"); m++) {
  11858. o[m].indent = o[m].indent + l;
  11859. if (l > 0) {
  11860. var v = o[m].parent;
  11861. o[m].parent = new CKEDITOR.dom.element(v.getName(), v.getDocument())
  11862. }
  11863. }
  11864. for (m = h.getCustomData("listarray_index") +
  11865. 1; m < o.length && o[m].indent > x; m++) o[m].indent = o[m].indent + l;
  11866. h = CKEDITOR.plugins.list.arrayToList(o, g, null, a.config.enterMode, e.getDirection());
  11867. if (!d.isIndent) {
  11868. var r;
  11869. if ((r = e.getParent()) && r.is("li"))
  11870. for (var l = h.listNode.getChildren(), y = [], z, m = l.count() - 1; m >= 0; m--)(z = l.getItem(m)) && (z.is && z.is("li")) && y.push(z)
  11871. }
  11872. h && h.listNode.replace(e);
  11873. if (y && y.length)
  11874. for (m = 0; m < y.length; m++) {
  11875. for (z = e = y[m];
  11876. (z = z.getNext()) && z.is && z.getName() in j;) {
  11877. CKEDITOR.env.needsNbspFiller && !e.getFirst(b) && e.append(q.document.createText(" "));
  11878. e.append(z)
  11879. }
  11880. e.insertAfter(r)
  11881. }
  11882. h && a.fire("contentDomInvalidated");
  11883. return true
  11884. }
  11885. for (var d = this, g = this.database, j = this.context, o = a.getSelection(), o = (o && o.getRanges()).createIterator(), q; q = o.getNextRange();) {
  11886. for (var m = q.getCommonAncestor(); m && !(m.type == CKEDITOR.NODE_ELEMENT && j[m.getName()]);) m = m.getParent();
  11887. m || (m = q.startPath().contains(j)) && q.setEndAt(m, CKEDITOR.POSITION_BEFORE_END);
  11888. if (!m) {
  11889. var l = q.getEnclosedNode();
  11890. if (l && l.type == CKEDITOR.NODE_ELEMENT && l.getName() in j) {
  11891. q.setStartAt(l, CKEDITOR.POSITION_AFTER_START);
  11892. q.setEndAt(l, CKEDITOR.POSITION_BEFORE_END);
  11893. m = l
  11894. }
  11895. }
  11896. if (m && q.startContainer.type == CKEDITOR.NODE_ELEMENT && q.startContainer.getName() in j) {
  11897. l = new CKEDITOR.dom.walker(q);
  11898. l.evaluator = e;
  11899. q.startContainer = l.next()
  11900. }
  11901. if (m && q.endContainer.type == CKEDITOR.NODE_ELEMENT && q.endContainer.getName() in j) {
  11902. l = new CKEDITOR.dom.walker(q);
  11903. l.evaluator = e;
  11904. q.endContainer = l.previous()
  11905. }
  11906. if (m) return c(m)
  11907. }
  11908. return 0
  11909. }
  11910. function e(a) { return a.type == CKEDITOR.NODE_ELEMENT && a.is("li") }
  11911. function b(a) { return g(a) && c(a) }
  11912. var g = CKEDITOR.dom.walker.whitespaces(true),
  11913. c = CKEDITOR.dom.walker.bookmark(false, true),
  11914. d = CKEDITOR.TRISTATE_DISABLED,
  11915. j = CKEDITOR.TRISTATE_OFF;
  11916. CKEDITOR.plugins.add("indentlist", {
  11917. requires: "indent",
  11918. init: function(b) {
  11919. function c(b) {
  11920. e.specificDefinition.apply(this, arguments);
  11921. this.requiredContent = ["ul", "ol"];
  11922. b.on("key", function(a) {
  11923. if (b.mode == "wysiwyg" && a.data.keyCode == this.indentKey) {
  11924. var c = this.getContext(b.elementPath());
  11925. if (c && (!this.isIndent || !CKEDITOR.plugins.indentList.firstItemInPath(this.context, b.elementPath(), c))) {
  11926. b.execCommand(this.relatedGlobal);
  11927. a.cancel()
  11928. }
  11929. }
  11930. }, this);
  11931. this.jobs[this.isIndent ? 10 : 30] = {
  11932. refresh: this.isIndent ? function(a, b) {
  11933. var c = this.getContext(b),
  11934. f = CKEDITOR.plugins.indentList.firstItemInPath(this.context, b, c);
  11935. return !c || !this.isIndent || f ? d : j
  11936. } : function(a, b) { return !this.getContext(b) || this.isIndent ? d : j },
  11937. exec: CKEDITOR.tools.bind(a, this)
  11938. }
  11939. }
  11940. var e = CKEDITOR.plugins.indent;
  11941. e.registerCommands(b, { indentlist: new c(b, "indentlist", true), outdentlist: new c(b, "outdentlist") });
  11942. CKEDITOR.tools.extend(c.prototype, e.specificDefinition.prototype, {
  11943. context: {
  11944. ol: 1,
  11945. ul: 1
  11946. }
  11947. })
  11948. }
  11949. });
  11950. CKEDITOR.plugins.indentList = {};
  11951. CKEDITOR.plugins.indentList.firstItemInPath = function(a, b, c) {
  11952. var d = b.contains(e);
  11953. c || (c = b.contains(a));
  11954. return c && d && d.equals(c.getFirst(e))
  11955. }
  11956. }(),
  11957. function() {
  11958. function a(a, b, c) {
  11959. function d(c) { if ((j = i[c ? "getFirst" : "getLast"]()) && (!j.is || !j.isBlockBoundary()) && (k = b.root[c ? "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(true))) && (!k.is || !k.isBlockBoundary({ br: 1 }))) a.document.createElement("br")[c ? "insertBefore" : "insertAfter"](j) }
  11960. for (var f = CKEDITOR.plugins.list.listToArray(b.root,
  11961. c), e = [], g = 0; g < b.contents.length; g++) {
  11962. var h = b.contents[g];
  11963. if ((h = h.getAscendant("li", true)) && !h.getCustomData("list_item_processed")) {
  11964. e.push(h);
  11965. CKEDITOR.dom.element.setMarker(c, h, "list_item_processed", true)
  11966. }
  11967. }
  11968. h = null;
  11969. for (g = 0; g < e.length; g++) {
  11970. h = e[g].getCustomData("listarray_index");
  11971. f[h].indent = -1
  11972. }
  11973. for (g = h + 1; g < f.length; g++)
  11974. if (f[g].indent > f[g - 1].indent + 1) {
  11975. e = f[g - 1].indent + 1 - f[g].indent;
  11976. for (h = f[g].indent; f[g] && f[g].indent >= h;) {
  11977. f[g].indent = f[g].indent + e;
  11978. g++
  11979. }
  11980. g--
  11981. }
  11982. var i = CKEDITOR.plugins.list.arrayToList(f, c, null,
  11983. a.config.enterMode, b.root.getAttribute("dir")).listNode,
  11984. j, k;
  11985. d(true);
  11986. d();
  11987. i.replace(b.root);
  11988. a.fire("contentDomInvalidated")
  11989. }
  11990. function e(a, b) {
  11991. this.name = a;
  11992. this.context = this.type = b;
  11993. this.allowedContent = b + " li";
  11994. this.requiredContent = b
  11995. }
  11996. function b(a, b, c, d) {
  11997. for (var f, g; f = a[d ? "getLast" : "getFirst"](q);) {
  11998. (g = f.getDirection(1)) !== b.getDirection(1) && f.setAttribute("dir", g);
  11999. f.remove();
  12000. c ? f[d ? "insertBefore" : "insertAfter"](c) : b.append(f, d)
  12001. }
  12002. }
  12003. function g(a) {
  12004. function c(d) {
  12005. var f = a[d ? "getPrevious" : "getNext"](k);
  12006. if (f && f.type ==
  12007. CKEDITOR.NODE_ELEMENT && f.is(a.getName())) {
  12008. b(a, f, null, !d);
  12009. a.remove();
  12010. a = f
  12011. }
  12012. }
  12013. c();
  12014. c(1)
  12015. }
  12016. function c(a) { return a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in CKEDITOR.dtd.$block || a.getName() in CKEDITOR.dtd.$listItem) && CKEDITOR.dtd[a.getName()]["#"] }
  12017. function d(a, c, d) {
  12018. a.fire("saveSnapshot");
  12019. d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
  12020. var f = d.extractContents();
  12021. c.trim(false, true);
  12022. var e = c.createBookmark(),
  12023. h = new CKEDITOR.dom.elementPath(c.startContainer),
  12024. i = h.block,
  12025. h = h.lastElement.getAscendant("li", 1) || i,
  12026. q = new CKEDITOR.dom.elementPath(d.startContainer),
  12027. o = q.contains(CKEDITOR.dtd.$listItem),
  12028. q = q.contains(CKEDITOR.dtd.$list);
  12029. if (i)(i = i.getBogus()) && i.remove();
  12030. else if (q)(i = q.getPrevious(k)) && n(i) && i.remove();
  12031. (i = f.getLast()) && (i.type == CKEDITOR.NODE_ELEMENT && i.is("br")) && i.remove();
  12032. (i = c.startContainer.getChild(c.startOffset)) ? f.insertBefore(i): c.startContainer.append(f);
  12033. if (o)
  12034. if (f = j(o))
  12035. if (h.contains(o)) {
  12036. b(f, o.getParent(), o);
  12037. f.remove()
  12038. } else h.append(f);
  12039. for (; d.checkStartOfBlock() && d.checkEndOfBlock();) {
  12040. q = d.startPath();
  12041. f = q.block;
  12042. if (!f) break;
  12043. if (f.is("li")) {
  12044. h =
  12045. f.getParent();
  12046. f.equals(h.getLast(k)) && f.equals(h.getFirst(k)) && (f = h)
  12047. }
  12048. d.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START);
  12049. f.remove()
  12050. }
  12051. d = d.clone();
  12052. f = a.editable();
  12053. d.setEndAt(f, CKEDITOR.POSITION_BEFORE_END);
  12054. d = new CKEDITOR.dom.walker(d);
  12055. d.evaluator = function(a) { return k(a) && !n(a) };
  12056. (d = d.next()) && (d.type == CKEDITOR.NODE_ELEMENT && d.getName() in CKEDITOR.dtd.$list) && g(d);
  12057. c.moveToBookmark(e);
  12058. c.select();
  12059. a.fire("saveSnapshot")
  12060. }
  12061. function j(a) {
  12062. return (a = a.getLast(k)) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in f ? a :
  12063. null
  12064. }
  12065. var f = { ol: 1, ul: 1 },
  12066. h = CKEDITOR.dom.walker.whitespaces(),
  12067. i = CKEDITOR.dom.walker.bookmark(),
  12068. k = function(a) { return !(h(a) || i(a)) },
  12069. n = CKEDITOR.dom.walker.bogus();
  12070. CKEDITOR.plugins.list = {
  12071. listToArray: function(a, b, c, d, g) {
  12072. if (!f[a.getName()]) return [];
  12073. d || (d = 0);
  12074. c || (c = []);
  12075. for (var e = 0, h = a.getChildCount(); e < h; e++) {
  12076. var i = a.getChild(e);
  12077. i.type == CKEDITOR.NODE_ELEMENT && i.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(i, b, c, d + 1);
  12078. if (i.$.nodeName.toLowerCase() == "li") {
  12079. var j = {
  12080. parent: a,
  12081. indent: d,
  12082. element: i,
  12083. contents: []
  12084. };
  12085. if (g) j.grandparent = g;
  12086. else { j.grandparent = a.getParent(); if (j.grandparent && j.grandparent.$.nodeName.toLowerCase() == "li") j.grandparent = j.grandparent.getParent() }
  12087. b && CKEDITOR.dom.element.setMarker(b, i, "listarray_index", c.length);
  12088. c.push(j);
  12089. for (var k = 0, n = i.getChildCount(), q; k < n; k++) {
  12090. q = i.getChild(k);
  12091. q.type == CKEDITOR.NODE_ELEMENT && f[q.getName()] ? CKEDITOR.plugins.list.listToArray(q, b, c, d + 1, j.grandparent) : j.contents.push(q)
  12092. }
  12093. }
  12094. }
  12095. return c
  12096. },
  12097. arrayToList: function(a, b, c, d, g) {
  12098. c || (c = 0);
  12099. if (!a || a.length < c + 1) return null;
  12100. for (var e, h = a[c].parent.getDocument(), j = new CKEDITOR.dom.documentFragment(h), n = null, q = c, o = Math.max(a[c].indent, 0), z = null, B, A, G = d == CKEDITOR.ENTER_P ? "p" : "div";;) {
  12101. var D = a[q];
  12102. e = D.grandparent;
  12103. B = D.element.getDirection(1);
  12104. if (D.indent == o) {
  12105. if (!n || a[q].parent.getName() != n.getName()) {
  12106. n = a[q].parent.clone(false, 1);
  12107. g && n.setAttribute("dir", g);
  12108. j.append(n)
  12109. }
  12110. z = n.append(D.element.clone(0, 1));
  12111. B != n.getDirection(1) && z.setAttribute("dir", B);
  12112. for (e = 0; e < D.contents.length; e++) z.append(D.contents[e].clone(1, 1));
  12113. q++
  12114. } else if (D.indent ==
  12115. Math.max(o, 0) + 1) {
  12116. D = a[q - 1].element.getDirection(1);
  12117. q = CKEDITOR.plugins.list.arrayToList(a, null, q, d, D != B ? B : null);
  12118. !z.getChildCount() && (CKEDITOR.env.needsNbspFiller && h.$.documentMode <= 7) && z.append(h.createText(" "));
  12119. z.append(q.listNode);
  12120. q = q.nextIndex
  12121. } else if (D.indent == -1 && !c && e) {
  12122. if (f[e.getName()]) {
  12123. z = D.element.clone(false, true);
  12124. B != e.getDirection(1) && z.setAttribute("dir", B)
  12125. } else z = new CKEDITOR.dom.documentFragment(h);
  12126. var n = e.getDirection(1) != B,
  12127. J = D.element,
  12128. C = J.getAttribute("class"),
  12129. F = J.getAttribute("style"),
  12130. E = z.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (d != CKEDITOR.ENTER_BR || n || F || C),
  12131. I, L = D.contents.length,
  12132. H;
  12133. for (e = 0; e < L; e++) {
  12134. I = D.contents[e];
  12135. if (i(I) && L > 1) E ? H = I.clone(1, 1) : z.append(I.clone(1, 1));
  12136. else if (I.type == CKEDITOR.NODE_ELEMENT && I.isBlockBoundary()) {
  12137. n && !I.getDirection() && I.setAttribute("dir", B);
  12138. A = I;
  12139. var Q = J.getAttribute("style");
  12140. Q && A.setAttribute("style", Q.replace(/([^;])$/, "$1;") + (A.getAttribute("style") || ""));
  12141. C && I.addClass(C);
  12142. A = null;
  12143. if (H) {
  12144. z.append(H);
  12145. H = null
  12146. }
  12147. z.append(I.clone(1, 1))
  12148. } else if (E) {
  12149. if (!A) {
  12150. A =
  12151. h.createElement(G);
  12152. z.append(A);
  12153. n && A.setAttribute("dir", B)
  12154. }
  12155. F && A.setAttribute("style", F);
  12156. C && A.setAttribute("class", C);
  12157. if (H) {
  12158. A.append(H);
  12159. H = null
  12160. }
  12161. A.append(I.clone(1, 1))
  12162. } else z.append(I.clone(1, 1))
  12163. }
  12164. if (H) {
  12165. (A || z).append(H);
  12166. H = null
  12167. }
  12168. if (z.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && q != a.length - 1) {
  12169. if (CKEDITOR.env.needsBrFiller)(B = z.getLast()) && (B.type == CKEDITOR.NODE_ELEMENT && B.is("br")) && B.remove();
  12170. B = z.getLast(k);
  12171. (!B || !(B.type == CKEDITOR.NODE_ELEMENT && B.is(CKEDITOR.dtd.$block))) && z.append(h.createElement("br"))
  12172. }
  12173. B = z.$.nodeName.toLowerCase();
  12174. (B == "div" || B == "p") && z.appendBogus();
  12175. j.append(z);
  12176. n = null;
  12177. q++
  12178. } else return null;
  12179. A = null;
  12180. if (a.length <= q || Math.max(a[q].indent, 0) < o) break
  12181. }
  12182. if (b)
  12183. for (a = j.getFirst(); a;) {
  12184. if (a.type == CKEDITOR.NODE_ELEMENT) {
  12185. CKEDITOR.dom.element.clearMarkers(b, a);
  12186. if (a.getName() in CKEDITOR.dtd.$listItem) {
  12187. c = a;
  12188. h = g = d = void 0;
  12189. if (d = c.getDirection()) {
  12190. for (g = c.getParent(); g && !(h = g.getDirection());) g = g.getParent();
  12191. d == h && c.removeAttribute("dir")
  12192. }
  12193. }
  12194. }
  12195. a = a.getNextSourceNode()
  12196. }
  12197. return { listNode: j, nextIndex: q }
  12198. }
  12199. };
  12200. var o = /^h[1-6]$/,
  12201. q = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
  12202. e.prototype = {
  12203. exec: function(b) {
  12204. this.refresh(b, b.elementPath());
  12205. var c = b.config,
  12206. d = b.getSelection(),
  12207. e = d && d.getRanges();
  12208. if (this.state == CKEDITOR.TRISTATE_OFF) {
  12209. var h = b.editable();
  12210. if (h.getFirst(k)) {
  12211. var i = e.length == 1 && e[0];
  12212. (c = i && i.getEnclosedNode()) && (c.is && this.type == c.getName()) && this.setState(CKEDITOR.TRISTATE_ON)
  12213. } else {
  12214. c.enterMode == CKEDITOR.ENTER_BR ? h.appendBogus() : e[0].fixBlock(1, c.enterMode == CKEDITOR.ENTER_P ? "p" : "div");
  12215. d.selectRanges(e)
  12216. }
  12217. }
  12218. for (var c = d.createBookmarks(true), h = [], j = {}, e = e.createIterator(),
  12219. n = 0;
  12220. (i = e.getNextRange()) && ++n;) {
  12221. var q = i.getBoundaryNodes(),
  12222. r = q.startNode,
  12223. y = q.endNode;
  12224. r.type == CKEDITOR.NODE_ELEMENT && r.getName() == "td" && i.setStartAt(q.startNode, CKEDITOR.POSITION_AFTER_START);
  12225. y.type == CKEDITOR.NODE_ELEMENT && y.getName() == "td" && i.setEndAt(q.endNode, CKEDITOR.POSITION_BEFORE_END);
  12226. i = i.createIterator();
  12227. for (i.forceBrBreak = this.state == CKEDITOR.TRISTATE_OFF; q = i.getNextParagraph();)
  12228. if (!q.getCustomData("list_block")) {
  12229. CKEDITOR.dom.element.setMarker(j, q, "list_block", 1);
  12230. for (var z = b.elementPath(q),
  12231. r = z.elements, y = 0, z = z.blockLimit, B, A = r.length - 1; A >= 0 && (B = r[A]); A--)
  12232. if (f[B.getName()] && z.contains(B)) {
  12233. z.removeCustomData("list_group_object_" + n);
  12234. if (r = B.getCustomData("list_group_object")) r.contents.push(q);
  12235. else {
  12236. r = { root: B, contents: [q] };
  12237. h.push(r);
  12238. CKEDITOR.dom.element.setMarker(j, B, "list_group_object", r)
  12239. }
  12240. y = 1;
  12241. break
  12242. }
  12243. if (!y) {
  12244. y = z;
  12245. if (y.getCustomData("list_group_object_" + n)) y.getCustomData("list_group_object_" + n).contents.push(q);
  12246. else {
  12247. r = { root: y, contents: [q] };
  12248. CKEDITOR.dom.element.setMarker(j, y, "list_group_object_" +
  12249. n, r);
  12250. h.push(r)
  12251. }
  12252. }
  12253. }
  12254. }
  12255. for (B = []; h.length > 0;) {
  12256. r = h.shift();
  12257. if (this.state == CKEDITOR.TRISTATE_OFF)
  12258. if (f[r.root.getName()]) {
  12259. e = b;
  12260. n = r;
  12261. r = j;
  12262. i = B;
  12263. y = CKEDITOR.plugins.list.listToArray(n.root, r);
  12264. z = [];
  12265. for (q = 0; q < n.contents.length; q++) {
  12266. A = n.contents[q];
  12267. if ((A = A.getAscendant("li", true)) && !A.getCustomData("list_item_processed")) {
  12268. z.push(A);
  12269. CKEDITOR.dom.element.setMarker(r, A, "list_item_processed", true)
  12270. }
  12271. }
  12272. for (var A = n.root.getDocument(), G = void 0, D = void 0, q = 0; q < z.length; q++) {
  12273. var J = z[q].getCustomData("listarray_index"),
  12274. G = y[J].parent;
  12275. if (!G.is(this.type)) {
  12276. D = A.createElement(this.type);
  12277. G.copyAttributes(D, { start: 1, type: 1 });
  12278. D.removeStyle("list-style-type");
  12279. y[J].parent = D
  12280. }
  12281. }
  12282. r = CKEDITOR.plugins.list.arrayToList(y, r, null, e.config.enterMode);
  12283. y = void 0;
  12284. z = r.listNode.getChildCount();
  12285. for (q = 0; q < z && (y = r.listNode.getChild(q)); q++) y.getName() == this.type && i.push(y);
  12286. r.listNode.replace(n.root);
  12287. e.fire("contentDomInvalidated")
  12288. } else {
  12289. y = b;
  12290. q = r;
  12291. i = B;
  12292. z = q.contents;
  12293. e = q.root.getDocument();
  12294. n = [];
  12295. if (z.length == 1 && z[0].equals(q.root)) {
  12296. r = e.createElement("div");
  12297. z[0].moveChildren &&
  12298. z[0].moveChildren(r);
  12299. z[0].append(r);
  12300. z[0] = r
  12301. }
  12302. q = q.contents[0].getParent();
  12303. for (A = 0; A < z.length; A++) q = q.getCommonAncestor(z[A].getParent());
  12304. G = y.config.useComputedState;
  12305. y = r = void 0;
  12306. G = G === void 0 || G;
  12307. for (A = 0; A < z.length; A++)
  12308. for (D = z[A]; J = D.getParent();) {
  12309. if (J.equals(q)) {
  12310. n.push(D);
  12311. !y && D.getDirection() && (y = 1);
  12312. D = D.getDirection(G);
  12313. r !== null && (r = r && r != D ? null : D);
  12314. break
  12315. }
  12316. D = J
  12317. }
  12318. if (!(n.length < 1)) {
  12319. z = n[n.length - 1].getNext();
  12320. A = e.createElement(this.type);
  12321. i.push(A);
  12322. for (G = i = void 0; n.length;) {
  12323. i = n.shift();
  12324. G = e.createElement("li");
  12325. if (i.is("pre") ||
  12326. o.test(i.getName()) || i.getAttribute("contenteditable") == "false") i.appendTo(G);
  12327. else {
  12328. i.copyAttributes(G);
  12329. if (r && i.getDirection()) {
  12330. G.removeStyle("direction");
  12331. G.removeAttribute("dir")
  12332. }
  12333. i.moveChildren(G);
  12334. i.remove()
  12335. }
  12336. G.appendTo(A)
  12337. }
  12338. r && y && A.setAttribute("dir", r);
  12339. z ? A.insertBefore(z) : A.appendTo(q)
  12340. }
  12341. }
  12342. else this.state == CKEDITOR.TRISTATE_ON && f[r.root.getName()] && a.call(this, b, r, j)
  12343. }
  12344. for (A = 0; A < B.length; A++) g(B[A]);
  12345. CKEDITOR.dom.element.clearAllMarkers(j);
  12346. d.selectBookmarks(c);
  12347. b.focus()
  12348. },
  12349. refresh: function(a, b) {
  12350. var c = b.contains(f,
  12351. 1),
  12352. d = b.blockLimit || b.root;
  12353. c && d.contains(c) ? this.setState(c.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF)
  12354. }
  12355. };
  12356. CKEDITOR.plugins.add("list", {
  12357. requires: "indentlist",
  12358. init: function(a) {
  12359. if (!a.blockless) {
  12360. a.addCommand("numberedlist", new e("numberedlist", "ol"));
  12361. a.addCommand("bulletedlist", new e("bulletedlist", "ul"));
  12362. if (a.ui.addButton) {
  12363. a.ui.addButton("NumberedList", { label: a.lang.list.numberedlist, command: "numberedlist", directional: true, toolbar: "list,10" });
  12364. a.ui.addButton("BulletedList", { label: a.lang.list.bulletedlist, command: "bulletedlist", directional: true, toolbar: "list,20" })
  12365. }
  12366. a.on("key", function(b) {
  12367. var e = b.data.domEvent.getKey(),
  12368. g;
  12369. if (a.mode == "wysiwyg" && e in { 8: 1, 46: 1 }) {
  12370. var h = a.getSelection().getRanges()[0],
  12371. i = h && h.startPath();
  12372. if (h && h.collapsed) {
  12373. var q = e == 8,
  12374. o = a.editable(),
  12375. v = new CKEDITOR.dom.walker(h.clone());
  12376. v.evaluator = function(a) { return k(a) && !n(a) };
  12377. v.guard = function(a, b) { return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table")) };
  12378. e = h.clone();
  12379. if (q) {
  12380. var r;
  12381. if ((r = i.contains(f)) && h.checkBoundaryOfElement(r,
  12382. CKEDITOR.START) && (r = r.getParent()) && r.is("li") && (r = j(r))) {
  12383. g = r;
  12384. r = r.getPrevious(k);
  12385. e.moveToPosition(r && n(r) ? r : g, CKEDITOR.POSITION_BEFORE_START)
  12386. } else {
  12387. v.range.setStartAt(o, CKEDITOR.POSITION_AFTER_START);
  12388. v.range.setEnd(h.startContainer, h.startOffset);
  12389. if ((r = v.previous()) && r.type == CKEDITOR.NODE_ELEMENT && (r.getName() in f || r.is("li"))) {
  12390. if (!r.is("li")) {
  12391. v.range.selectNodeContents(r);
  12392. v.reset();
  12393. v.evaluator = c;
  12394. r = v.previous()
  12395. }
  12396. g = r;
  12397. e.moveToElementEditEnd(g)
  12398. }
  12399. }
  12400. if (g) {
  12401. d(a, e, h);
  12402. b.cancel()
  12403. } else if ((e = i.contains(f)) && h.checkBoundaryOfElement(e,
  12404. CKEDITOR.START)) {
  12405. g = e.getFirst(k);
  12406. if (h.checkBoundaryOfElement(g, CKEDITOR.START)) {
  12407. r = e.getPrevious(k);
  12408. if (j(g)) {
  12409. if (r) {
  12410. h.moveToElementEditEnd(r);
  12411. h.select()
  12412. }
  12413. } else a.execCommand("outdent");
  12414. b.cancel()
  12415. }
  12416. }
  12417. } else if (g = i.contains("li")) {
  12418. v.range.setEndAt(o, CKEDITOR.POSITION_BEFORE_END);
  12419. g = (i = g.getLast(k)) && c(i) ? i : g;
  12420. o = 0;
  12421. if ((r = v.next()) && r.type == CKEDITOR.NODE_ELEMENT && r.getName() in f && r.equals(i)) {
  12422. o = 1;
  12423. r = v.next()
  12424. } else h.checkBoundaryOfElement(g, CKEDITOR.END) && (o = 1);
  12425. if (o && r) {
  12426. h = h.clone();
  12427. h.moveToElementEditStart(r);
  12428. d(a,
  12429. e, h);
  12430. b.cancel()
  12431. }
  12432. } else {
  12433. v.range.setEndAt(o, CKEDITOR.POSITION_BEFORE_END);
  12434. if ((r = v.next()) && r.type == CKEDITOR.NODE_ELEMENT && r.is(f)) {
  12435. r = r.getFirst(k);
  12436. if (i.block && h.checkStartOfBlock() && h.checkEndOfBlock()) {
  12437. i.block.remove();
  12438. h.moveToElementEditStart(r);
  12439. h.select()
  12440. } else if (j(r)) {
  12441. h.moveToElementEditStart(r);
  12442. h.select()
  12443. } else {
  12444. h = h.clone();
  12445. h.moveToElementEditStart(r);
  12446. d(a, e, h)
  12447. }
  12448. b.cancel()
  12449. }
  12450. }
  12451. setTimeout(function() { a.selectionChange(1) })
  12452. }
  12453. }
  12454. })
  12455. }
  12456. }
  12457. })
  12458. }(),
  12459. function() {
  12460. function a(a, b, c) {
  12461. c = a.config.forceEnterMode || c;
  12462. if (a.mode == "wysiwyg") {
  12463. if (!b) b =
  12464. a.activeEnterMode;
  12465. if (!a.elementPath().isContextFor("p")) {
  12466. b = CKEDITOR.ENTER_BR;
  12467. c = 1
  12468. }
  12469. a.fire("saveSnapshot");
  12470. b == CKEDITOR.ENTER_BR ? j(a, b, null, c) : f(a, b, null, c);
  12471. a.fire("saveSnapshot")
  12472. }
  12473. }
  12474. function e(a) { for (var a = a.getSelection().getRanges(true), b = a.length - 1; b > 0; b--) a[b].deleteContents(); return a[0] }
  12475. function b(a) {
  12476. var b = a.startContainer.getAscendant(function(a) { return a.type == CKEDITOR.NODE_ELEMENT && a.getAttribute("contenteditable") == "true" }, true);
  12477. if (a.root.equals(b)) return a;
  12478. b = new CKEDITOR.dom.range(b);
  12479. b.moveToRange(a);
  12480. return b
  12481. }
  12482. CKEDITOR.plugins.add("enterkey", {
  12483. init: function(b) {
  12484. b.addCommand("enter", { modes: { wysiwyg: 1 }, editorFocus: false, exec: function(b) { a(b) } });
  12485. b.addCommand("shiftEnter", { modes: { wysiwyg: 1 }, editorFocus: false, exec: function(b) { a(b, b.activeShiftEnterMode, 1) } });
  12486. b.setKeystroke([
  12487. [13, "enter"],
  12488. [CKEDITOR.SHIFT + 13, "shiftEnter"]
  12489. ])
  12490. }
  12491. });
  12492. var g = CKEDITOR.dom.walker.whitespaces(),
  12493. c = CKEDITOR.dom.walker.bookmark();
  12494. CKEDITOR.plugins.enterkey = {
  12495. enterBlock: function(a, d, f, o) {
  12496. if (f = f || e(a)) {
  12497. var f = b(f),
  12498. q = f.document,
  12499. m = f.checkStartOfBlock(),
  12500. l = f.checkEndOfBlock(),
  12501. p = a.elementPath(f.startContainer),
  12502. t = p.block,
  12503. s = d == CKEDITOR.ENTER_DIV ? "div" : "p",
  12504. u;
  12505. if (m && l) {
  12506. if (t && (t.is("li") || t.getParent().is("li"))) {
  12507. t.is("li") || (t = t.getParent());
  12508. f = t.getParent();
  12509. u = f.getParent();
  12510. var o = !t.hasPrevious(),
  12511. w = !t.hasNext(),
  12512. s = a.getSelection(),
  12513. x = s.createBookmarks(),
  12514. m = t.getDirection(1),
  12515. l = t.getAttribute("class"),
  12516. v = t.getAttribute("style"),
  12517. r = u.getDirection(1) != m,
  12518. a = a.enterMode != CKEDITOR.ENTER_BR || r || v || l;
  12519. if (u.is("li"))
  12520. if (o || w) t[o ? "insertBefore" : "insertAfter"](u);
  12521. else t.breakParent(u);
  12522. else {
  12523. if (a) {
  12524. if (p.block.is("li")) {
  12525. u = q.createElement(d == CKEDITOR.ENTER_P ? "p" : "div");
  12526. r && u.setAttribute("dir", m);
  12527. v && u.setAttribute("style", v);
  12528. l && u.setAttribute("class", l);
  12529. t.moveChildren(u)
  12530. } else u = p.block;
  12531. if (o || w) u[o ? "insertBefore" : "insertAfter"](f);
  12532. else {
  12533. t.breakParent(f);
  12534. u.insertAfter(f)
  12535. }
  12536. } else {
  12537. t.appendBogus(true);
  12538. if (o || w)
  12539. for (; q = t[o ? "getFirst" : "getLast"]();) q[o ? "insertBefore" : "insertAfter"](f);
  12540. else
  12541. for (t.breakParent(f); q = t.getLast();) q.insertAfter(f)
  12542. }
  12543. t.remove()
  12544. }
  12545. s.selectBookmarks(x);
  12546. return
  12547. }
  12548. if (t && t.getParent().is("blockquote")) {
  12549. t.breakParent(t.getParent());
  12550. t.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || t.getPrevious().remove();
  12551. t.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || t.getNext().remove();
  12552. f.moveToElementEditStart(t);
  12553. f.select();
  12554. return
  12555. }
  12556. } else if (t && t.is("pre") && !l) { j(a, d, f, o); return }
  12557. if (m = f.splitBlock(s)) {
  12558. d = m.previousBlock;
  12559. t = m.nextBlock;
  12560. p = m.wasStartOfBlock;
  12561. a = m.wasEndOfBlock;
  12562. if (t) {
  12563. x = t.getParent();
  12564. if (x.is("li")) {
  12565. t.breakParent(x);
  12566. t.move(t.getNext(), 1)
  12567. }
  12568. } else if (d && (x = d.getParent()) && x.is("li")) {
  12569. d.breakParent(x);
  12570. x = d.getNext();
  12571. f.moveToElementEditStart(x);
  12572. d.move(d.getPrevious())
  12573. }
  12574. if (!p && !a) {
  12575. if (t.is("li")) {
  12576. u = f.clone();
  12577. u.selectNodeContents(t);
  12578. u = new CKEDITOR.dom.walker(u);
  12579. u.evaluator = function(a) { return !(c(a) || g(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in CKEDITOR.dtd.$empty)) };
  12580. (x = u.next()) && (x.type == CKEDITOR.NODE_ELEMENT && x.is("ul", "ol")) && (CKEDITOR.env.needsBrFiller ? q.createElement("br") : q.createText(" ")).insertBefore(x)
  12581. }
  12582. t && f.moveToElementEditStart(t)
  12583. } else {
  12584. if (d) {
  12585. if (d.is("li") || !h.test(d.getName()) && !d.is("pre")) u =
  12586. d.clone()
  12587. } else t && (u = t.clone());
  12588. if (u) o && !u.is("li") && u.renameNode(s);
  12589. else if (x && x.is("li")) u = x;
  12590. else {
  12591. u = q.createElement(s);
  12592. d && (w = d.getDirection()) && u.setAttribute("dir", w)
  12593. }
  12594. if (q = m.elementPath) {
  12595. o = 0;
  12596. for (s = q.elements.length; o < s; o++) {
  12597. x = q.elements[o];
  12598. if (x.equals(q.block) || x.equals(q.blockLimit)) break;
  12599. if (CKEDITOR.dtd.$removeEmpty[x.getName()]) {
  12600. x = x.clone();
  12601. u.moveChildren(x);
  12602. u.append(x)
  12603. }
  12604. }
  12605. }
  12606. u.appendBogus();
  12607. u.getParent() || f.insertNode(u);
  12608. u.is("li") && u.removeAttribute("value");
  12609. if (CKEDITOR.env.ie && p && (!a || !d.getChildCount())) {
  12610. f.moveToElementEditStart(a ?
  12611. d : u);
  12612. f.select()
  12613. }
  12614. f.moveToElementEditStart(p && !a ? t : u)
  12615. }
  12616. f.select();
  12617. f.scrollIntoView()
  12618. }
  12619. }
  12620. },
  12621. enterBr: function(a, b, c, d) {
  12622. if (c = c || e(a)) {
  12623. var g = c.document,
  12624. j = c.checkEndOfBlock(),
  12625. l = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),
  12626. p = l.block,
  12627. t = p && l.block.getName();
  12628. if (!d && t == "li") f(a, b, c, d);
  12629. else {
  12630. if (!d && j && h.test(t))
  12631. if (j = p.getDirection()) {
  12632. g = g.createElement("div");
  12633. g.setAttribute("dir", j);
  12634. g.insertAfter(p);
  12635. c.setStart(g, 0)
  12636. } else {
  12637. g.createElement("br").insertAfter(p);
  12638. CKEDITOR.env.gecko && g.createText("").insertAfter(p);
  12639. c.setStartAt(p.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)
  12640. }
  12641. else {
  12642. a = t == "pre" && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? g.createText("\r") : g.createElement("br");
  12643. c.deleteContents();
  12644. c.insertNode(a);
  12645. if (CKEDITOR.env.needsBrFiller) {
  12646. g.createText("").insertAfter(a);
  12647. j && (p || l.blockLimit).appendBogus();
  12648. a.getNext().$.nodeValue = "";
  12649. c.setStartAt(a.getNext(), CKEDITOR.POSITION_AFTER_START)
  12650. } else c.setStartAt(a, CKEDITOR.POSITION_AFTER_END)
  12651. }
  12652. c.collapse(true);
  12653. c.select();
  12654. c.scrollIntoView()
  12655. }
  12656. }
  12657. }
  12658. };
  12659. var d = CKEDITOR.plugins.enterkey,
  12660. j = d.enterBr,
  12661. f = d.enterBlock,
  12662. h = /^h[1-6]$/
  12663. }(),
  12664. function() {
  12665. function a(a, b) {
  12666. var g = {},
  12667. c = [],
  12668. d = { nbsp: " ", shy: "­", gt: ">", lt: "<", amp: "&", apos: "'", quot: '"' },
  12669. a = a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function(a, f) {
  12670. var e = b ? "&" + f + ";" : d[f];
  12671. g[e] = b ? d[f] : "&" + f + ";";
  12672. c.push(e);
  12673. return ""
  12674. });
  12675. if (!b && a) {
  12676. var a = a.split(","),
  12677. j = document.createElement("div"),
  12678. f;
  12679. j.innerHTML = "&" + a.join(";&") + ";";
  12680. f = j.innerHTML;
  12681. j = null;
  12682. for (j = 0; j < f.length; j++) {
  12683. var h = f.charAt(j);
  12684. g[h] = "&" + a[j] + ";";
  12685. c.push(h)
  12686. }
  12687. }
  12688. g.regex =
  12689. c.join(b ? "|" : "");
  12690. return g
  12691. }
  12692. CKEDITOR.plugins.add("entities", {
  12693. afterInit: function(e) {
  12694. function b(a) { return h[a] }
  12695. function g(a) { return c.entities_processNumerical == "force" || !j[a] ? "&#" + a.charCodeAt(0) + ";" : j[a] }
  12696. var c = e.config;
  12697. if (e = (e = e.dataProcessor) && e.htmlFilter) {
  12698. var d = [];
  12699. c.basicEntities !== false && d.push("nbsp,gt,lt,amp");
  12700. if (c.entities) {
  12701. d.length && d.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro");
  12702. c.entities_latin && d.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml");
  12703. c.entities_greek && d.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv");
  12704. c.entities_additional && d.push(c.entities_additional)
  12705. }
  12706. var j = a(d.join(",")),
  12707. f = j.regex ? "[" + j.regex + "]" : "a^";
  12708. delete j.regex;
  12709. c.entities && c.entities_processNumerical && (f = "[^ -~]|" + f);
  12710. var f = RegExp(f, "g"),
  12711. h = a("nbsp,gt,lt,amp,shy", true),
  12712. i = RegExp(h.regex, "g");
  12713. e.addRules({ text: function(a) { return a.replace(i, b).replace(f, g) } }, { applyToAll: true, excludeNestedEditable: true })
  12714. }
  12715. }
  12716. })
  12717. }(), CKEDITOR.config.basicEntities = !0, CKEDITOR.config.entities = !0, CKEDITOR.config.entities_latin = !0, CKEDITOR.config.entities_greek = !0, CKEDITOR.config.entities_additional =
  12718. "#39", CKEDITOR.plugins.add("popup"), CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  12719. popup: function(a, e, b, g) {
  12720. e = e || "80%";
  12721. b = b || "70%";
  12722. typeof e == "string" && (e.length > 1 && e.substr(e.length - 1, 1) == "%") && (e = parseInt(window.screen.width * parseInt(e, 10) / 100, 10));
  12723. typeof b == "string" && (b.length > 1 && b.substr(b.length - 1, 1) == "%") && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10));
  12724. e < 640 && (e = 640);
  12725. b < 420 && (b = 420);
  12726. var c = parseInt((window.screen.height - b) / 2, 10),
  12727. d = parseInt((window.screen.width - e) / 2, 10),
  12728. g = (g || "location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes") +
  12729. ",width=" + e + ",height=" + b + ",top=" + c + ",left=" + d,
  12730. j = window.open("", null, g, true);
  12731. if (!j) return false;
  12732. try {
  12733. if (navigator.userAgent.toLowerCase().indexOf(" chrome/") == -1) {
  12734. j.moveTo(d, c);
  12735. j.resizeTo(e, b)
  12736. }
  12737. j.focus();
  12738. j.location.href = a
  12739. } catch (f) { window.open(a, null, g, true) }
  12740. return true
  12741. }
  12742. }),
  12743. function() {
  12744. function a(a, b) {
  12745. var c = [];
  12746. if (b)
  12747. for (var d in b) c.push(d + "=" + encodeURIComponent(b[d]));
  12748. else return a;
  12749. return a + (a.indexOf("?") != -1 ? "&" : "?") + c.join("&")
  12750. }
  12751. function e(a) { a = a + ""; return a.charAt(0).toUpperCase() + a.substr(1) }
  12752. function b() {
  12753. var b =
  12754. this.getDialog(),
  12755. c = b.getParentEditor();
  12756. c._.filebrowserSe = this;
  12757. var d = c.config["filebrowser" + e(b.getName()) + "WindowWidth"] || c.config.filebrowserWindowWidth || "80%",
  12758. b = c.config["filebrowser" + e(b.getName()) + "WindowHeight"] || c.config.filebrowserWindowHeight || "70%",
  12759. f = this.filebrowser.params || {};
  12760. f.CKEditor = c.name;
  12761. f.CKEditorFuncNum = c._.filebrowserFn;
  12762. if (!f.langCode) f.langCode = c.langCode;
  12763. f = a(this.filebrowser.url, f);
  12764. c.popup(f, d, b, c.config.filebrowserWindowFeatures || c.config.fileBrowserWindowFeatures)
  12765. }
  12766. function g() {
  12767. var a =
  12768. this.getDialog();
  12769. a.getParentEditor()._.filebrowserSe = this;
  12770. return !a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value || !a.getContentElement(this["for"][0], this["for"][1]).getAction() ? false : true
  12771. }
  12772. function c(b, c, d) {
  12773. var f = d.params || {};
  12774. f.CKEditor = b.name;
  12775. f.CKEditorFuncNum = b._.filebrowserFn;
  12776. if (!f.langCode) f.langCode = b.langCode;
  12777. c.action = a(d.url, f);
  12778. c.filebrowser = d
  12779. }
  12780. function d(a, f, j, n) {
  12781. if (n && n.length)
  12782. for (var o, q = n.length; q--;) {
  12783. o = n[q];
  12784. (o.type == "hbox" || o.type == "vbox" || o.type == "fieldset") &&
  12785. d(a, f, j, o.children);
  12786. if (o.filebrowser) {
  12787. if (typeof o.filebrowser == "string") o.filebrowser = { action: o.type == "fileButton" ? "QuickUpload" : "Browse", target: o.filebrowser };
  12788. if (o.filebrowser.action == "Browse") {
  12789. var m = o.filebrowser.url;
  12790. if (m === void 0) { m = a.config["filebrowser" + e(f) + "BrowseUrl"]; if (m === void 0) m = a.config.filebrowserBrowseUrl }
  12791. if (m) {
  12792. o.onClick = b;
  12793. o.filebrowser.url = m;
  12794. o.hidden = false
  12795. }
  12796. } else if (o.filebrowser.action == "QuickUpload" && o["for"]) {
  12797. m = o.filebrowser.url;
  12798. if (m === void 0) {
  12799. m = a.config["filebrowser" + e(f) + "UploadUrl"];
  12800. if (m === void 0) m = a.config.filebrowserUploadUrl
  12801. }
  12802. if (m) {
  12803. var l = o.onClick;
  12804. o.onClick = function(a) { var b = a.sender; return l && l.call(b, a) === false ? false : g.call(b, a) };
  12805. o.filebrowser.url = m;
  12806. o.hidden = false;
  12807. c(a, j.getContents(o["for"][0]).get(o["for"][1]), o.filebrowser)
  12808. }
  12809. }
  12810. }
  12811. }
  12812. }
  12813. function j(a, b, c) {
  12814. if (c.indexOf(";") !== -1) {
  12815. for (var c = c.split(";"), d = 0; d < c.length; d++)
  12816. if (j(a, b, c[d])) return true;
  12817. return false
  12818. }
  12819. return (a = a.getContents(b).get(c).filebrowser) && a.url
  12820. }
  12821. function f(a, b) {
  12822. var c = this._.filebrowserSe.getDialog(),
  12823. d = this._.filebrowserSe["for"],
  12824. f = this._.filebrowserSe.filebrowser.onSelect;
  12825. d && c.getContentElement(d[0], d[1]).reset();
  12826. if (!(typeof b == "function" && b.call(this._.filebrowserSe) === false) && !(f && f.call(this._.filebrowserSe, a, b) === false)) {
  12827. typeof b == "string" && b && alert(b);
  12828. if (a) {
  12829. d = this._.filebrowserSe;
  12830. c = d.getDialog();
  12831. if (d = d.filebrowser.target || null) {
  12832. d = d.split(":");
  12833. if (f = c.getContentElement(d[0], d[1])) {
  12834. f.setValue(a);
  12835. c.selectPage(d[0])
  12836. }
  12837. }
  12838. }
  12839. }
  12840. }
  12841. CKEDITOR.plugins.add("filebrowser", {
  12842. requires: "popup",
  12843. init: function(a) {
  12844. a._.filebrowserFn = CKEDITOR.tools.addFunction(f,
  12845. a);
  12846. a.on("destroy", function() { CKEDITOR.tools.removeFunction(this._.filebrowserFn) })
  12847. }
  12848. });
  12849. CKEDITOR.on("dialogDefinition", function(a) {
  12850. if (a.editor.plugins.filebrowser)
  12851. for (var b = a.data.definition, c, f = 0; f < b.contents.length; ++f)
  12852. if (c = b.contents[f]) { d(a.editor, a.data.name, b, c.elements); if (c.hidden && c.filebrowser) c.hidden = !j(b, c.id, c.filebrowser) }
  12853. })
  12854. }(),
  12855. function() {
  12856. function a(a) {
  12857. var c = a.config,
  12858. d = a.fire("uiSpace", { space: "top", html: "" }).html,
  12859. j = function() {
  12860. function d(a, c, f) {
  12861. h.setStyle(c, b(f));
  12862. h.setStyle("position",
  12863. a)
  12864. }
  12865. function f(a) {
  12866. var b = k.getDocumentPosition();
  12867. switch (a) {
  12868. case "top":
  12869. d("absolute", "top", b.y - s - x);
  12870. break;
  12871. case "pin":
  12872. d("fixed", "top", r);
  12873. break;
  12874. case "bottom":
  12875. d("absolute", "top", b.y + (p.height || p.bottom - p.top) + x)
  12876. }
  12877. i = a
  12878. }
  12879. var i, k, l, p, t, s, u, w = c.floatSpaceDockedOffsetX || 0,
  12880. x = c.floatSpaceDockedOffsetY || 0,
  12881. v = c.floatSpacePinnedOffsetX || 0,
  12882. r = c.floatSpacePinnedOffsetY || 0;
  12883. return function(c) {
  12884. if (k = a.editable()) {
  12885. c && c.name == "focus" && h.show();
  12886. h.removeStyle("left");
  12887. h.removeStyle("right");
  12888. l = h.getClientRect();
  12889. p = k.getClientRect();
  12890. t = e.getViewPaneSize();
  12891. s = l.height;
  12892. u = "pageXOffset" in e.$ ? e.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft;
  12893. if (i) {
  12894. s + x <= p.top ? f("top") : s + x > t.height - p.bottom ? f("pin") : f("bottom");
  12895. var c = t.width / 2,
  12896. c = p.left > 0 && p.right < t.width && p.width > l.width ? a.config.contentsLangDirection == "rtl" ? "right" : "left" : c - p.left > p.right - c ? "left" : "right",
  12897. d;
  12898. if (l.width > t.width) {
  12899. c = "left";
  12900. d = 0
  12901. } else {
  12902. d = c == "left" ? p.left > 0 ? p.left : 0 : p.right < t.width ? t.width - p.right : 0;
  12903. if (d + l.width > t.width) {
  12904. c = c == "left" ? "right" : "left";
  12905. d = 0
  12906. }
  12907. }
  12908. h.setStyle(c,
  12909. b((i == "pin" ? v : w) + d + (i == "pin" ? 0 : c == "left" ? u : -u)))
  12910. } else {
  12911. i = "pin";
  12912. f("pin");
  12913. j(c)
  12914. }
  12915. }
  12916. }
  12917. }();
  12918. if (d) {
  12919. var f = new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir="{langDir}" title="' + (CKEDITOR.env.gecko ? " " : "") + '" lang="{langCode}" role="application" style="{style}"' + (a.title ? ' aria-labelledby="cke_{name}_arialbl"' : " ") + ">" + (a.title ? '<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>' :
  12920. " ") + '<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),
  12921. h = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(f.output({ content: d, id: a.id, langDir: a.lang.dir, langCode: a.langCode, name: a.name, style: "display:none;z-index:" + (c.baseFloatZIndex - 1), topId: a.ui.spaceId("top"), voiceLabel: a.title }))),
  12922. i = CKEDITOR.tools.eventsBuffer(500, j),
  12923. k = CKEDITOR.tools.eventsBuffer(100, j);
  12924. h.unselectable();
  12925. h.on("mousedown", function(a) {
  12926. a = a.data;
  12927. a.getTarget().hasAscendant("a",
  12928. 1) || a.preventDefault()
  12929. });
  12930. a.on("focus", function(b) {
  12931. j(b);
  12932. a.on("change", i.input);
  12933. e.on("scroll", k.input);
  12934. e.on("resize", k.input)
  12935. });
  12936. a.on("blur", function() {
  12937. h.hide();
  12938. a.removeListener("change", i.input);
  12939. e.removeListener("scroll", k.input);
  12940. e.removeListener("resize", k.input)
  12941. });
  12942. a.on("destroy", function() {
  12943. e.removeListener("scroll", k.input);
  12944. e.removeListener("resize", k.input);
  12945. h.clearCustomData();
  12946. h.remove()
  12947. });
  12948. a.focusManager.hasFocus && h.show();
  12949. a.focusManager.add(h, 1)
  12950. }
  12951. }
  12952. var e = CKEDITOR.document.getWindow(),
  12953. b = CKEDITOR.tools.cssLength;
  12954. CKEDITOR.plugins.add("floatingspace", { init: function(b) { b.on("loaded", function() { a(this) }, null, null, 20) } })
  12955. }(), CKEDITOR.plugins.add("listblock", {
  12956. requires: "panel",
  12957. onLoad: function() {
  12958. var a = CKEDITOR.addTemplate("panel-list", '<ul role="presentation" class="cke_panel_list">{items}</ul>'),
  12959. e = CKEDITOR.addTemplate("panel-list-item", '<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')" {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),
  12960. b = CKEDITOR.addTemplate("panel-list-group", '<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),
  12961. g = /\'/g;
  12962. CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) { return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b)) };
  12963. CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
  12964. base: CKEDITOR.ui.panel.block,
  12965. $: function(a, b) {
  12966. var b = b || {},
  12967. e = b.attributes || (b.attributes = {});
  12968. (this.multiSelect = !!b.multiSelect) && (e["aria-multiselectable"] = true);
  12969. !e.role && (e.role = "listbox");
  12970. this.base.apply(this, arguments);
  12971. this.element.setAttribute("role", e.role);
  12972. e = this.keys;
  12973. e[40] = "next";
  12974. e[9] = "next";
  12975. e[38] = "prev";
  12976. e[CKEDITOR.SHIFT + 9] = "prev";
  12977. e[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  12978. CKEDITOR.env.ie && (e[13] = "mouseup");
  12979. this._.pendingHtml = [];
  12980. this._.pendingList = [];
  12981. this._.items = {};
  12982. this._.groups = {}
  12983. },
  12984. _: {
  12985. close: function() {
  12986. if (this._.started) {
  12987. var b = a.output({ items: this._.pendingList.join("") });
  12988. this._.pendingList = [];
  12989. this._.pendingHtml.push(b);
  12990. delete this._.started
  12991. }
  12992. },
  12993. getClick: function() {
  12994. if (!this._.click) this._.click =
  12995. CKEDITOR.tools.addFunction(function(a) { var b = this.toggle(a); if (this.onClick) this.onClick(a, b) }, this);
  12996. return this._.click
  12997. }
  12998. },
  12999. proto: {
  13000. add: function(a, b, j) {
  13001. var f = CKEDITOR.tools.getNextId();
  13002. if (!this._.started) {
  13003. this._.started = 1;
  13004. this._.size = this._.size || 0
  13005. }
  13006. this._.items[a] = f;
  13007. var h;
  13008. h = CKEDITOR.tools.htmlEncodeAttr(a).replace(g, "\\'");
  13009. a = { id: f, val: h, onclick: CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick", clickFn: this._.getClick(), title: CKEDITOR.tools.htmlEncodeAttr(j || a), text: b || a };
  13010. this._.pendingList.push(e.output(a))
  13011. },
  13012. startGroup: function(a) {
  13013. this._.close();
  13014. var d = CKEDITOR.tools.getNextId();
  13015. this._.groups[a] = d;
  13016. this._.pendingHtml.push(b.output({ id: d, label: a }))
  13017. },
  13018. commit: function() {
  13019. this._.close();
  13020. this.element.appendHtml(this._.pendingHtml.join(""));
  13021. delete this._.size;
  13022. this._.pendingHtml = []
  13023. },
  13024. toggle: function(a) {
  13025. var b = this.isMarked(a);
  13026. b ? this.unmark(a) : this.mark(a);
  13027. return !b
  13028. },
  13029. hideGroup: function(a) {
  13030. var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext();
  13031. if (a) {
  13032. a.setStyle("display", "none");
  13033. b && b.getName() == "ul" &&
  13034. b.setStyle("display", "none")
  13035. }
  13036. },
  13037. hideItem: function(a) { this.element.getDocument().getById(this._.items[a]).setStyle("display", "none") },
  13038. showAll: function() {
  13039. var a = this._.items,
  13040. b = this._.groups,
  13041. e = this.element.getDocument(),
  13042. f;
  13043. for (f in a) e.getById(a[f]).setStyle("display", "");
  13044. for (var g in b) {
  13045. a = e.getById(b[g]);
  13046. f = a.getNext();
  13047. a.setStyle("display", "");
  13048. f && f.getName() == "ul" && f.setStyle("display", "")
  13049. }
  13050. },
  13051. mark: function(a) {
  13052. this.multiSelect || this.unmarkAll();
  13053. var a = this._.items[a],
  13054. b = this.element.getDocument().getById(a);
  13055. b.addClass("cke_selected");
  13056. this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", true);
  13057. this.onMark && this.onMark(b)
  13058. },
  13059. unmark: function(a) {
  13060. var b = this.element.getDocument(),
  13061. a = this._.items[a],
  13062. e = b.getById(a);
  13063. e.removeClass("cke_selected");
  13064. b.getById(a + "_option").removeAttribute("aria-selected");
  13065. this.onUnmark && this.onUnmark(e)
  13066. },
  13067. unmarkAll: function() {
  13068. var a = this._.items,
  13069. b = this.element.getDocument(),
  13070. e;
  13071. for (e in a) {
  13072. var f = a[e];
  13073. b.getById(f).removeClass("cke_selected");
  13074. b.getById(f + "_option").removeAttribute("aria-selected")
  13075. }
  13076. this.onUnmark &&
  13077. this.onUnmark()
  13078. },
  13079. isMarked: function(a) { return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected") },
  13080. focus: function(a) {
  13081. this._.focusIndex = -1;
  13082. var b = this.element.getElementsByTag("a"),
  13083. e, f = -1;
  13084. if (a)
  13085. for (e = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++f);) { if (a.equals(e)) { this._.focusIndex = f; break } } else this.element.focus();
  13086. e && setTimeout(function() { e.focus() }, 0)
  13087. }
  13088. }
  13089. })
  13090. }
  13091. }),
  13092. function() {
  13093. var a = '<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"' +
  13094. (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href=\"javascript:void('{titleJs}')\"") + ' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';
  13095. CKEDITOR.env.gecko && CKEDITOR.env.mac && (a = a + ' onkeypress="return false;"');
  13096. CKEDITOR.env.gecko && (a = a + ' onblur="this.style.cssText = this.style.cssText;"');
  13097. var a = a + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' +
  13098. (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),
  13099. a = a + '>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',
  13100. e = CKEDITOR.addTemplate("buttonArrow", '<span class="cke_button_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : "") + "</span>"),
  13101. b = CKEDITOR.addTemplate("button", a);
  13102. CKEDITOR.plugins.add("button", { beforeInit: function(a) { a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler) } });
  13103. CKEDITOR.UI_BUTTON = "button";
  13104. CKEDITOR.ui.button = function(a) {
  13105. CKEDITOR.tools.extend(this, a, { title: a.label, click: a.click || function(b) { b.execCommand(a.command) } });
  13106. this._ = {}
  13107. };
  13108. CKEDITOR.ui.button.handler = { create: function(a) { return new CKEDITOR.ui.button(a) } };
  13109. CKEDITOR.ui.button.prototype = {
  13110. render: function(a, c) {
  13111. function d() {
  13112. var b = a.mode;
  13113. if (b) {
  13114. b = this.modes[b] ? l[b] !== void 0 ? l[b] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  13115. b = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : b;
  13116. this.setState(b);
  13117. this.refresh && this.refresh()
  13118. }
  13119. }
  13120. var j = CKEDITOR.env,
  13121. f = this._.id = CKEDITOR.tools.getNextId(),
  13122. h = "",
  13123. i = this.command,
  13124. k;
  13125. this._.editor = a;
  13126. var n = { id: f, button: this, editor: a, focus: function() { CKEDITOR.document.getById(f).focus() }, execute: function() { this.button.click(a) }, attach: function(a) { this.button.attach(a) } },
  13127. o = CKEDITOR.tools.addFunction(function(a) { if (n.onkey) { a = new CKEDITOR.dom.event(a); return n.onkey(n, a.getKeystroke()) !== false } }),
  13128. q =
  13129. CKEDITOR.tools.addFunction(function(a) {
  13130. var b;
  13131. n.onfocus && (b = n.onfocus(n, new CKEDITOR.dom.event(a)) !== false);
  13132. return b
  13133. }),
  13134. m = 0;
  13135. n.clickFn = k = CKEDITOR.tools.addFunction(function() {
  13136. if (m) {
  13137. a.unlockSelection(1);
  13138. m = 0
  13139. }
  13140. n.execute();
  13141. j.iOS && a.focus()
  13142. });
  13143. if (this.modes) {
  13144. var l = {};
  13145. a.on("beforeModeUnload", function() { if (a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED) l[a.mode] = this._.state }, this);
  13146. a.on("activeFilterChange", d, this);
  13147. a.on("mode", d, this);
  13148. !this.readOnly && a.on("readOnly", d, this)
  13149. } else if (i)
  13150. if (i = a.getCommand(i)) {
  13151. i.on("state",
  13152. function() { this.setState(i.state) }, this);
  13153. h = h + (i.state == CKEDITOR.TRISTATE_ON ? "on" : i.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off")
  13154. }
  13155. if (this.directional) a.on("contentDirChanged", function(b) {
  13156. var c = CKEDITOR.document.getById(this._.id),
  13157. d = c.getFirst(),
  13158. b = b.data;
  13159. b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl");
  13160. d.setAttribute("style", CKEDITOR.skin.getIconStyle(t, b == "rtl", this.icon, this.iconOffset))
  13161. }, this);
  13162. i || (h = h + "off");
  13163. var p = this.name || this.command,
  13164. t = p;
  13165. if (this.icon &&
  13166. !/\./.test(this.icon)) {
  13167. t = this.icon;
  13168. this.icon = null
  13169. }
  13170. h = { id: f, name: p, iconName: t, label: this.label, cls: this.className || "", state: h, ariaDisabled: h == "disabled" ? "true" : "false", title: this.title, titleJs: j.gecko && !j.hc ? "" : (this.title || "").replace("'", ""), hasArrow: this.hasArrow ? "true" : "false", keydownFn: o, focusFn: q, clickFn: k, style: CKEDITOR.skin.getIconStyle(t, a.lang.dir == "rtl", this.icon, this.iconOffset), arrowHtml: this.hasArrow ? e.output() : "" };
  13171. b.output(h, c);
  13172. if (this.onRender) this.onRender();
  13173. return n
  13174. },
  13175. setState: function(a) {
  13176. if (this._.state ==
  13177. a) return false;
  13178. this._.state = a;
  13179. var b = CKEDITOR.document.getById(this._.id);
  13180. if (b) {
  13181. b.setState(a, "cke_button");
  13182. a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", true) : b.removeAttribute("aria-disabled");
  13183. if (this.hasArrow) {
  13184. a = a == CKEDITOR.TRISTATE_ON ? this._.editor.lang.button.selectedLabel.replace(/%1/g, this.label) : this.label;
  13185. CKEDITOR.document.getById(this._.id + "_label").setText(a)
  13186. } else a == CKEDITOR.TRISTATE_ON ? b.setAttribute("aria-pressed", true) : b.removeAttribute("aria-pressed");
  13187. return true
  13188. }
  13189. return false
  13190. },
  13191. getState: function() { return this._.state },
  13192. toFeature: function(a) { if (this._.feature) return this._.feature; var b = this;!this.allowedContent && (!this.requiredContent && this.command) && (b = a.getCommand(this.command) || b); return this._.feature = b }
  13193. };
  13194. CKEDITOR.ui.prototype.addButton = function(a, b) { this.add(a, CKEDITOR.UI_BUTTON, b) }
  13195. }(), CKEDITOR.plugins.add("richcombo", { requires: "floatpanel,listblock,button", beforeInit: function(a) { a.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler) } }),
  13196. function() {
  13197. var a =
  13198. '<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" title="{title}" tabindex="-1"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href=\"javascript:void('{titleJs}')\"") + ' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';
  13199. CKEDITOR.env.gecko && CKEDITOR.env.mac && (a = a + ' onkeypress="return false;"');
  13200. CKEDITOR.env.gecko && (a = a + ' onblur="this.style.cssText = this.style.cssText;"');
  13201. var a = a + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : CKEDITOR.env.air ? "&nbsp;" : "") + "</span></span></a></span>"),
  13202. e = CKEDITOR.addTemplate("combo", a);
  13203. CKEDITOR.UI_RICHCOMBO = "richcombo";
  13204. CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({
  13205. $: function(a) {
  13206. CKEDITOR.tools.extend(this, a, { canGroup: false, title: a.label, modes: { wysiwyg: 1 }, editorFocus: 1 });
  13207. a = this.panel || {};
  13208. delete this.panel;
  13209. this.id = CKEDITOR.tools.getNextNumber();
  13210. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  13211. a.className = "cke_combopanel";
  13212. a.block = { multiSelect: a.multiSelect, attributes: a.attributes };
  13213. a.toolbarRelated = true;
  13214. this._ = {
  13215. panelDefinition: a,
  13216. items: {}
  13217. }
  13218. },
  13219. proto: {
  13220. renderHtml: function(a) {
  13221. var e = [];
  13222. this.render(a, e);
  13223. return e.join("")
  13224. },
  13225. render: function(a, g) {
  13226. function c() {
  13227. if (this.getState() != CKEDITOR.TRISTATE_ON) {
  13228. var c = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  13229. if (a.readOnly && !this.readOnly) c = CKEDITOR.TRISTATE_DISABLED;
  13230. this.setState(c);
  13231. this.setValue("");
  13232. c != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
  13233. }
  13234. }
  13235. var d = CKEDITOR.env,
  13236. j = "cke_" + this.id,
  13237. f = CKEDITOR.tools.addFunction(function(c) {
  13238. if (o) {
  13239. a.unlockSelection(1);
  13240. o = 0
  13241. }
  13242. i.execute(c)
  13243. },
  13244. this),
  13245. h = this,
  13246. i = {
  13247. id: j,
  13248. combo: this,
  13249. focus: function() { CKEDITOR.document.getById(j).getChild(1).focus() },
  13250. execute: function(c) {
  13251. var d = h._;
  13252. if (d.state != CKEDITOR.TRISTATE_DISABLED) {
  13253. h.createPanel(a);
  13254. if (d.on) d.panel.hide();
  13255. else {
  13256. h.commit();
  13257. var f = h.getValue();
  13258. f ? d.list.mark(f) : d.list.unmarkAll();
  13259. d.panel.showBlock(h.id, new CKEDITOR.dom.element(c), 4)
  13260. }
  13261. }
  13262. },
  13263. clickFn: f
  13264. };
  13265. a.on("activeFilterChange", c, this);
  13266. a.on("mode", c, this);
  13267. a.on("selectionChange", c, this);
  13268. !this.readOnly && a.on("readOnly", c, this);
  13269. var k = CKEDITOR.tools.addFunction(function(c,
  13270. d) {
  13271. var c = new CKEDITOR.dom.event(c),
  13272. e = c.getKeystroke();
  13273. if (e == 40) a.once("panelShow", function(a) { a.data._.panel._.currentBlock.onKeyDown(40) });
  13274. switch (e) {
  13275. case 13:
  13276. case 32:
  13277. case 40:
  13278. CKEDITOR.tools.callFunction(f, d);
  13279. break;
  13280. default:
  13281. i.onkey(i, e)
  13282. }
  13283. c.preventDefault()
  13284. }),
  13285. n = CKEDITOR.tools.addFunction(function() { i.onfocus && i.onfocus() }),
  13286. o = 0;
  13287. i.keyDownFn = k;
  13288. d = {
  13289. id: j,
  13290. name: this.name || this.command,
  13291. label: this.label,
  13292. title: this.title,
  13293. cls: this.className || "",
  13294. titleJs: d.gecko && !d.hc ? "" : (this.title || "").replace("'", ""),
  13295. keydownFn: k,
  13296. focusFn: n,
  13297. clickFn: f
  13298. };
  13299. e.output(d, g);
  13300. if (this.onRender) this.onRender();
  13301. return i
  13302. },
  13303. createPanel: function(a) {
  13304. if (!this._.panel) {
  13305. var e = this._.panelDefinition,
  13306. c = this._.panelDefinition.block,
  13307. d = e.parent || CKEDITOR.document.getBody(),
  13308. j = "cke_combopanel__" + this.name,
  13309. f = new CKEDITOR.ui.floatPanel(a, d, e),
  13310. h = f.addListBlock(this.id, c),
  13311. i = this;
  13312. f.onShow = function() {
  13313. this.element.addClass(j);
  13314. i.setState(CKEDITOR.TRISTATE_ON);
  13315. i._.on = 1;
  13316. i.editorFocus && !a.focusManager.hasFocus && a.focus();
  13317. if (i.onOpen) i.onOpen();
  13318. a.once("panelShow",
  13319. function() { h.focus(!h.multiSelect && i.getValue()) })
  13320. };
  13321. f.onHide = function(c) {
  13322. this.element.removeClass(j);
  13323. i.setState(i.modes && i.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  13324. i._.on = 0;
  13325. if (!c && i.onClose) i.onClose()
  13326. };
  13327. f.onEscape = function() { f.hide(1) };
  13328. h.onClick = function(a, b) {
  13329. i.onClick && i.onClick.call(i, a, b);
  13330. f.hide()
  13331. };
  13332. this._.panel = f;
  13333. this._.list = h;
  13334. f.getBlock(this.id).onHide = function() {
  13335. i._.on = 0;
  13336. i.setState(CKEDITOR.TRISTATE_OFF)
  13337. };
  13338. this.init && this.init()
  13339. }
  13340. },
  13341. setValue: function(a, e) {
  13342. this._.value = a;
  13343. var c =
  13344. this.document.getById("cke_" + this.id + "_text");
  13345. if (c) {
  13346. if (!a && !e) {
  13347. e = this.label;
  13348. c.addClass("cke_combo_inlinelabel")
  13349. } else c.removeClass("cke_combo_inlinelabel");
  13350. c.setText(typeof e != "undefined" ? e : a)
  13351. }
  13352. },
  13353. getValue: function() { return this._.value || "" },
  13354. unmarkAll: function() { this._.list.unmarkAll() },
  13355. mark: function(a) { this._.list.mark(a) },
  13356. hideItem: function(a) { this._.list.hideItem(a) },
  13357. hideGroup: function(a) { this._.list.hideGroup(a) },
  13358. showAll: function() { this._.list.showAll() },
  13359. add: function(a, e, c) {
  13360. this._.items[a] = c || a;
  13361. this._.list.add(a, e, c)
  13362. },
  13363. startGroup: function(a) { this._.list.startGroup(a) },
  13364. commit: function() {
  13365. if (!this._.committed) {
  13366. this._.list.commit();
  13367. this._.committed = 1;
  13368. CKEDITOR.ui.fire("ready", this)
  13369. }
  13370. this._.committed = 1
  13371. },
  13372. setState: function(a) {
  13373. if (this._.state != a) {
  13374. var e = this.document.getById("cke_" + this.id);
  13375. e.setState(a, "cke_combo");
  13376. a == CKEDITOR.TRISTATE_DISABLED ? e.setAttribute("aria-disabled", true) : e.removeAttribute("aria-disabled");
  13377. this._.state = a
  13378. }
  13379. },
  13380. getState: function() { return this._.state },
  13381. enable: function() {
  13382. this._.state ==
  13383. CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
  13384. },
  13385. disable: function() {
  13386. if (this._.state != CKEDITOR.TRISTATE_DISABLED) {
  13387. this._.lastState = this._.state;
  13388. this.setState(CKEDITOR.TRISTATE_DISABLED)
  13389. }
  13390. }
  13391. },
  13392. statics: { handler: { create: function(a) { return new CKEDITOR.ui.richCombo(a) } } }
  13393. });
  13394. CKEDITOR.ui.prototype.addRichCombo = function(a, e) { this.add(a, CKEDITOR.UI_RICHCOMBO, e) }
  13395. }(), CKEDITOR.plugins.add("format", {
  13396. requires: "richcombo",
  13397. init: function(a) {
  13398. if (!a.blockless) {
  13399. for (var e = a.config, b = a.lang.format, g = e.format_tags.split(";"),
  13400. c = {}, d = 0, j = [], f = 0; f < g.length; f++) {
  13401. var h = g[f],
  13402. i = new CKEDITOR.style(e["format_" + h]);
  13403. if (!a.filter.customConfig || a.filter.check(i)) {
  13404. d++;
  13405. c[h] = i;
  13406. c[h]._.enterMode = a.config.enterMode;
  13407. j.push(i)
  13408. }
  13409. }
  13410. d !== 0 && a.ui.addRichCombo("Format", {
  13411. label: b.label,
  13412. title: b.panelTitle,
  13413. toolbar: "styles,20",
  13414. allowedContent: j,
  13415. panel: { css: [CKEDITOR.skin.getPath("editor")].concat(e.contentsCss), multiSelect: false, attributes: { "aria-label": b.panelTitle } },
  13416. init: function() {
  13417. this.startGroup(b.panelTitle);
  13418. for (var a in c) {
  13419. var d = b["tag_" + a];
  13420. this.add(a,
  13421. c[a].buildPreview(d), d)
  13422. }
  13423. },
  13424. onClick: function(b) {
  13425. a.focus();
  13426. a.fire("saveSnapshot");
  13427. var b = c[b],
  13428. d = a.elementPath();
  13429. a[b.checkActive(d, a) ? "removeStyle" : "applyStyle"](b);
  13430. setTimeout(function() { a.fire("saveSnapshot") }, 0)
  13431. },
  13432. onRender: function() {
  13433. a.on("selectionChange", function(b) {
  13434. var d = this.getValue(),
  13435. b = b.data.path;
  13436. this.refresh();
  13437. for (var f in c)
  13438. if (c[f].checkActive(b, a)) { f != d && this.setValue(f, a.lang.format["tag_" + f]); return }
  13439. this.setValue("")
  13440. }, this)
  13441. },
  13442. onOpen: function() {
  13443. this.showAll();
  13444. for (var b in c) a.activeFilter.check(c[b]) ||
  13445. this.hideItem(b)
  13446. },
  13447. refresh: function() {
  13448. var b = a.elementPath();
  13449. if (b) {
  13450. if (b.isContextFor("p"))
  13451. for (var d in c)
  13452. if (a.activeFilter.check(c[d])) return;
  13453. this.setState(CKEDITOR.TRISTATE_DISABLED)
  13454. }
  13455. }
  13456. })
  13457. }
  13458. }
  13459. }), CKEDITOR.config.format_tags = "p;h1;h2;h3;h4;h5;h6;pre;address;div;img", CKEDITOR.config.format_p = { element: "p" }, CKEDITOR.config.format_div = { element: "div" }, CKEDITOR.config.format_pre = { element: "pre" }, CKEDITOR.config.format_address = { element: "address" }, CKEDITOR.config.format_h1 = { element: "h1" }, CKEDITOR.config.format_h2 = { element: "h2" },
  13460. CKEDITOR.config.format_h3 = { element: "h3" }, CKEDITOR.config.format_h4 = { element: "h4" }, CKEDITOR.config.format_h5 = { element: "h5" }, CKEDITOR.config.format_h6 = { element: "h6" }, CKEDITOR.config.format_img = { element: "img" },
  13461. function() {
  13462. var a = {
  13463. canUndo: false,
  13464. exec: function(a) {
  13465. var b = a.document.createElement("hr");
  13466. a.insertElement(b)
  13467. },
  13468. allowedContent: "hr",
  13469. requiredContent: "hr"
  13470. };
  13471. CKEDITOR.plugins.add("horizontalrule", {
  13472. init: function(e) {
  13473. if (!e.blockless) {
  13474. e.addCommand("horizontalrule", a);
  13475. e.ui.addButton && e.ui.addButton("HorizontalRule", {
  13476. label: e.lang.horizontalrule.toolbar,
  13477. command: "horizontalrule",
  13478. toolbar: "insert,40"
  13479. })
  13480. }
  13481. }
  13482. })
  13483. }(), CKEDITOR.plugins.add("htmlwriter", {
  13484. init: function(a) {
  13485. var e = new CKEDITOR.htmlWriter;
  13486. e.forceSimpleAmpersand = a.config.forceSimpleAmpersand;
  13487. e.indentationChars = a.config.dataIndentationChars || "\t";
  13488. a.dataProcessor.writer = e
  13489. }
  13490. }), CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({
  13491. base: CKEDITOR.htmlParser.basicWriter,
  13492. $: function() {
  13493. this.base();
  13494. this.indentationChars = "\t";
  13495. this.selfClosingEnd = " />";
  13496. this.lineBreakChars = "\n";
  13497. this.sortAttributes = 1;
  13498. this._.indent = 0;
  13499. this._.indentation =
  13500. "";
  13501. this._.inPre = 0;
  13502. this._.rules = {};
  13503. var a = CKEDITOR.dtd,
  13504. e;
  13505. for (e in CKEDITOR.tools.extend({}, a.$nonBodyContent, a.$block, a.$listItem, a.$tableContent)) this.setRules(e, { indent: !a[e]["#"], breakBeforeOpen: 1, breakBeforeClose: !a[e]["#"], breakAfterClose: 1, needsSpace: e in a.$block && !(e in { li: 1, dt: 1, dd: 1 }) });
  13506. this.setRules("br", { breakAfterOpen: 1 });
  13507. this.setRules("title", { indent: 0, breakAfterOpen: 0 });
  13508. this.setRules("style", { indent: 0, breakBeforeClose: 1 });
  13509. this.setRules("pre", { breakAfterOpen: 1, indent: 0 })
  13510. },
  13511. proto: {
  13512. openTag: function(a) {
  13513. var e =
  13514. this._.rules[a];
  13515. this._.afterCloser && (e && e.needsSpace && this._.needsSpace) && this._.output.push("\n");
  13516. if (this._.indent) this.indentation();
  13517. else if (e && e.breakBeforeOpen) {
  13518. this.lineBreak();
  13519. this.indentation()
  13520. }
  13521. this._.output.push("<", a);
  13522. this._.afterCloser = 0
  13523. },
  13524. openTagClose: function(a, e) {
  13525. var b = this._.rules[a];
  13526. if (e) { this._.output.push(this.selfClosingEnd); if (b && b.breakAfterClose) this._.needsSpace = b.needsSpace } else { this._.output.push(">"); if (b && b.indent) this._.indentation = this._.indentation + this.indentationChars }
  13527. b &&
  13528. b.breakAfterOpen && this.lineBreak();
  13529. a == "pre" && (this._.inPre = 1)
  13530. },
  13531. attribute: function(a, e) {
  13532. if (typeof e == "string") {
  13533. this.forceSimpleAmpersand && (e = e.replace(/&amp;/g, "&"));
  13534. e = CKEDITOR.tools.htmlEncodeAttr(e)
  13535. }
  13536. this._.output.push(" ", a, '="', e, '"')
  13537. },
  13538. closeTag: function(a) {
  13539. var e = this._.rules[a];
  13540. if (e && e.indent) this._.indentation = this._.indentation.substr(this.indentationChars.length);
  13541. if (this._.indent) this.indentation();
  13542. else if (e && e.breakBeforeClose) {
  13543. this.lineBreak();
  13544. this.indentation()
  13545. }
  13546. this._.output.push("</", a, ">");
  13547. a == "pre" && (this._.inPre = 0);
  13548. if (e && e.breakAfterClose) {
  13549. this.lineBreak();
  13550. this._.needsSpace = e.needsSpace
  13551. }
  13552. this._.afterCloser = 1
  13553. },
  13554. text: function(a) {
  13555. if (this._.indent) { this.indentation();!this._.inPre && (a = CKEDITOR.tools.ltrim(a)) }
  13556. this._.output.push(a)
  13557. },
  13558. comment: function(a) {
  13559. this._.indent && this.indentation();
  13560. this._.output.push("<\!--", a, "--\>")
  13561. },
  13562. lineBreak: function() {
  13563. !this._.inPre && this._.output.length > 0 && this._.output.push(this.lineBreakChars);
  13564. this._.indent = 1
  13565. },
  13566. indentation: function() {
  13567. !this._.inPre && this._.indentation &&
  13568. this._.output.push(this._.indentation);
  13569. this._.indent = 0
  13570. },
  13571. reset: function() {
  13572. this._.output = [];
  13573. this._.indent = 0;
  13574. this._.indentation = "";
  13575. this._.afterCloser = 0;
  13576. this._.inPre = 0
  13577. },
  13578. setRules: function(a, e) {
  13579. var b = this._.rules[a];
  13580. b ? CKEDITOR.tools.extend(b, e, true) : this._.rules[a] = e
  13581. }
  13582. }
  13583. }),
  13584. function() {
  13585. function a(a, e) { e || (e = a.getSelection().getSelectedElement()); if (e && e.is("img") && !e.data("cke-realelement") && !e.isReadOnly()) return e }
  13586. function e(a) {
  13587. var e = a.getStyle("float");
  13588. if (e == "inherit" || e == "none") e = 0;
  13589. e || (e = a.getAttribute("align"));
  13590. return e
  13591. }
  13592. CKEDITOR.plugins.add("image", {
  13593. requires: "dialog",
  13594. init: function(b) {
  13595. if (!b.plugins.image2) {
  13596. CKEDITOR.dialog.add("image", this.path + "dialogs/image.js");
  13597. var e = "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
  13598. CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (e = "img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");
  13599. b.addCommand("image", new CKEDITOR.dialogCommand("image", {
  13600. allowedContent: e,
  13601. requiredContent: "img[alt,src]",
  13602. contentTransformations: [
  13603. ["img{width}: sizeToStyle",
  13604. "img[width]: sizeToAttribute"
  13605. ],
  13606. ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"]
  13607. ]
  13608. }));
  13609. b.ui.addButton && b.ui.addButton("Image", { label: b.lang.common.image, command: "image", toolbar: "insert,10" });
  13610. b.on("doubleclick", function(a) { var b = a.data.element; if (b.is("img") && !b.data("cke-realelement") && !b.isReadOnly()) a.data.dialog = "image" });
  13611. b.addMenuItems && b.addMenuItems({ image: { label: b.lang.image.menu, command: "image", group: "image" } });
  13612. b.contextMenu && b.contextMenu.addListener(function(c) { if (a(b, c)) return { image: CKEDITOR.TRISTATE_OFF } })
  13613. }
  13614. },
  13615. afterInit: function(b) {
  13616. function g(c) {
  13617. var d = b.getCommand("justify" + c);
  13618. if (d) {
  13619. if (c == "left" || c == "right") d.on("exec", function(d) {
  13620. var f = a(b),
  13621. g;
  13622. if (f) {
  13623. g = e(f);
  13624. if (g == c) {
  13625. f.removeStyle("float");
  13626. c == e(f) && f.removeAttribute("align")
  13627. } else f.setStyle("float", c);
  13628. d.cancel()
  13629. }
  13630. });
  13631. d.on("refresh", function(d) {
  13632. var f = a(b);
  13633. if (f) {
  13634. f = e(f);
  13635. this.setState(f == c ? CKEDITOR.TRISTATE_ON : c == "right" || c == "left" ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  13636. d.cancel()
  13637. }
  13638. })
  13639. }
  13640. }
  13641. if (!b.plugins.image2) {
  13642. g("left");
  13643. g("right");
  13644. g("center");
  13645. g("block")
  13646. }
  13647. }
  13648. })
  13649. }(),
  13650. CKEDITOR.config.image_removeLinkByEmptyURL = !0,
  13651. function() {
  13652. function a(a, b) {
  13653. var c = g.exec(a),
  13654. e = g.exec(b);
  13655. if (c) { if (!c[2] && e[2] == "px") return e[1]; if (c[2] == "px" && !e[2]) return e[1] + "px" }
  13656. return b
  13657. }
  13658. var e = CKEDITOR.htmlParser.cssStyle,
  13659. b = CKEDITOR.tools.cssLength,
  13660. g = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,
  13661. c = {
  13662. elements: {
  13663. $: function(b) {
  13664. var c = b.attributes;
  13665. if ((c = (c = (c = c && c["data-cke-realelement"]) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(c))) && c.children[0]) && b.attributes["data-cke-resizable"]) {
  13666. var f =
  13667. (new e(b)).rules,
  13668. b = c.attributes,
  13669. g = f.width,
  13670. f = f.height;
  13671. g && (b.width = a(b.width, g));
  13672. f && (b.height = a(b.height, f))
  13673. }
  13674. return c
  13675. }
  13676. }
  13677. };
  13678. CKEDITOR.plugins.add("fakeobjects", {
  13679. init: function(a) { a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}", "fakeobjects") },
  13680. afterInit: function(a) {
  13681. (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(c, { applyToAll: true })
  13682. }
  13683. });
  13684. CKEDITOR.editor.prototype.createFakeElement = function(a, c, f, g) {
  13685. var i = this.lang.fakeobjects,
  13686. i = i[f] || i.unknown,
  13687. c = {
  13688. "class": c,
  13689. "data-cke-realelement": encodeURIComponent(a.getOuterHtml()),
  13690. "data-cke-real-node-type": a.type,
  13691. alt: i,
  13692. title: i,
  13693. align: a.getAttribute("align") || ""
  13694. };
  13695. if (!CKEDITOR.env.hc) c.src = CKEDITOR.tools.transparentImageData;
  13696. f && (c["data-cke-real-element-type"] = f);
  13697. if (g) {
  13698. c["data-cke-resizable"] = g;
  13699. f = new e;
  13700. g = a.getAttribute("width");
  13701. a = a.getAttribute("height");
  13702. g && (f.rules.width = b(g));
  13703. a && (f.rules.height = b(a));
  13704. f.populate(c)
  13705. }
  13706. return this.document.createElement("img", { attributes: c })
  13707. };
  13708. CKEDITOR.editor.prototype.createFakeParserElement = function(a, c, f, g) {
  13709. var i = this.lang.fakeobjects,
  13710. i = i[f] ||
  13711. i.unknown,
  13712. k;
  13713. k = new CKEDITOR.htmlParser.basicWriter;
  13714. a.writeHtml(k);
  13715. k = k.getHtml();
  13716. c = { "class": c, "data-cke-realelement": encodeURIComponent(k), "data-cke-real-node-type": a.type, alt: i, title: i, align: a.attributes.align || "" };
  13717. if (!CKEDITOR.env.hc) c.src = CKEDITOR.tools.transparentImageData;
  13718. f && (c["data-cke-real-element-type"] = f);
  13719. if (g) {
  13720. c["data-cke-resizable"] = g;
  13721. g = a.attributes;
  13722. a = new e;
  13723. f = g.width;
  13724. g = g.height;
  13725. f !== void 0 && (a.rules.width = b(f));
  13726. g !== void 0 && (a.rules.height = b(g));
  13727. a.populate(c)
  13728. }
  13729. return new CKEDITOR.htmlParser.element("img",
  13730. c)
  13731. };
  13732. CKEDITOR.editor.prototype.restoreRealElement = function(b) {
  13733. if (b.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null;
  13734. var c = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(b.data("cke-realelement")), this.document);
  13735. if (b.data("cke-resizable")) {
  13736. var f = b.getStyle("width"),
  13737. b = b.getStyle("height");
  13738. f && c.setAttribute("width", a(c.getAttribute("width"), f));
  13739. b && c.setAttribute("height", a(c.getAttribute("height"), b))
  13740. }
  13741. return c
  13742. }
  13743. }(), "use strict",
  13744. function() {
  13745. function a(a) { return a.replace(/'/g, "\\$&") }
  13746. function e(a) {
  13747. for (var b, c = a.length, d = [], f = 0; f < c; f++) {
  13748. b = a.charCodeAt(f);
  13749. d.push(b)
  13750. }
  13751. return "String.fromCharCode(" + d.join(",") + ")"
  13752. }
  13753. function b(b, c) {
  13754. var d = b.plugins.link,
  13755. f = d.compiledProtectionFunction.params,
  13756. e, g;
  13757. g = [d.compiledProtectionFunction.name, "("];
  13758. for (var h = 0; h < f.length; h++) {
  13759. d = f[h].toLowerCase();
  13760. e = c[d];
  13761. h > 0 && g.push(",");
  13762. g.push("'", e ? a(encodeURIComponent(c[d])) : "", "'")
  13763. }
  13764. g.push(")");
  13765. return g.join("")
  13766. }
  13767. function g(a) {
  13768. var a = a.config.emailProtection || "",
  13769. b;
  13770. if (a && a != "encode") {
  13771. b = {};
  13772. a.replace(/^([^(]+)\(([^)]+)\)$/,
  13773. function(a, c, d) {
  13774. b.name = c;
  13775. b.params = [];
  13776. d.replace(/[^,\s]+/g, function(a) { b.params.push(a) })
  13777. })
  13778. }
  13779. return b
  13780. }
  13781. CKEDITOR.plugins.add("link", {
  13782. requires: "dialog,fakeobjects",
  13783. onLoad: function() {
  13784. function a(b) { return c.replace(/%1/g, b == "rtl" ? "right" : "left").replace(/%2/g, "cke_contents_" + b) }
  13785. var b = "background:url(" + CKEDITOR.getUrl(this.path + "images" + (CKEDITOR.env.hidpi ? "/hidpi" : "") + "/anchor.png") + ") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
  13786. c = ".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{" +
  13787. b + "padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{" + b + "width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
  13788. CKEDITOR.addCss(a("ltr") + a("rtl"))
  13789. },
  13790. init: function(a) {
  13791. var b = "a[!href]";
  13792. CKEDITOR.dialog.isTabEnabled(a, "link", "advanced") && (b = b.replace("]", ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));
  13793. CKEDITOR.dialog.isTabEnabled(a, "link", "target") && (b = b.replace("]", ",target,onclick]"));
  13794. a.addCommand("link", new CKEDITOR.dialogCommand("link", { allowedContent: b, requiredContent: "a[href]" }));
  13795. a.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", { allowedContent: "a[!name,id]", requiredContent: "a[name]" }));
  13796. a.addCommand("unlink", new CKEDITOR.unlinkCommand);
  13797. a.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand);
  13798. a.setKeystroke(CKEDITOR.CTRL + 76, "link");
  13799. if (a.ui.addButton) {
  13800. a.ui.addButton("Link", { label: a.lang.link.toolbar, command: "link", toolbar: "links,10" });
  13801. a.ui.addButton("Unlink", { label: a.lang.link.unlink, command: "unlink", toolbar: "links,20" });
  13802. a.ui.addButton("Anchor", {
  13803. label: a.lang.link.anchor.toolbar,
  13804. command: "anchor",
  13805. toolbar: "links,30"
  13806. })
  13807. }
  13808. CKEDITOR.dialog.add("link", this.path + "dialogs/link.js");
  13809. CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js");
  13810. a.on("doubleclick", function(b) {
  13811. var c = CKEDITOR.plugins.link.getSelectedLink(a) || b.data.element;
  13812. if (!c.isReadOnly())
  13813. if (c.is("a")) {
  13814. b.data.dialog = c.getAttribute("name") && (!c.getAttribute("href") || !c.getChildCount()) ? "anchor" : "link";
  13815. b.data.link = c
  13816. } else if (CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, c)) b.data.dialog = "anchor"
  13817. }, null, null, 0);
  13818. a.on("doubleclick",
  13819. function(b) { b.data.dialog in { link: 1, anchor: 1 } && b.data.link && a.getSelection().selectElement(b.data.link) }, null, null, 20);
  13820. a.addMenuItems && a.addMenuItems({ anchor: { label: a.lang.link.anchor.menu, command: "anchor", group: "anchor", order: 1 }, removeAnchor: { label: a.lang.link.anchor.remove, command: "removeAnchor", group: "anchor", order: 5 }, link: { label: a.lang.link.menu, command: "link", group: "link", order: 1 }, unlink: { label: a.lang.link.unlink, command: "unlink", group: "link", order: 5 } });
  13821. a.contextMenu && a.contextMenu.addListener(function(b) {
  13822. if (!b ||
  13823. b.isReadOnly()) return null;
  13824. b = CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, b);
  13825. if (!b && !(b = CKEDITOR.plugins.link.getSelectedLink(a))) return null;
  13826. var c = {};
  13827. b.getAttribute("href") && b.getChildCount() && (c = { link: CKEDITOR.TRISTATE_OFF, unlink: CKEDITOR.TRISTATE_OFF });
  13828. if (b && b.hasAttribute("name")) c.anchor = c.removeAnchor = CKEDITOR.TRISTATE_OFF;
  13829. return c
  13830. });
  13831. this.compiledProtectionFunction = g(a)
  13832. },
  13833. afterInit: function(a) {
  13834. a.dataProcessor.dataFilter.addRules({
  13835. elements: {
  13836. a: function(b) {
  13837. return !b.attributes.name ? null : !b.children.length ?
  13838. a.createFakeParserElement(b, "cke_anchor", "anchor") : null
  13839. }
  13840. }
  13841. });
  13842. var b = a._.elementsPath && a._.elementsPath.filters;
  13843. b && b.push(function(b, c) { if (c == "a" && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, b) || b.getAttribute("name") && (!b.getAttribute("href") || !b.getChildCount()))) return "anchor" })
  13844. }
  13845. });
  13846. var c = /^javascript:/,
  13847. d = /^mailto:([^?]+)(?:\?(.+))?$/,
  13848. j = /subject=([^;?:@&=$,\/]*)/,
  13849. f = /body=([^;?:@&=$,\/]*)/,
  13850. h = /^#(.*)$/,
  13851. i = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
  13852. k = /^(_(?:self|top|parent|blank))$/,
  13853. n = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
  13854. o = /^javascript:([^(]+)\(([^)]+)\)$/,
  13855. q = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
  13856. m = /(?:^|,)([^=]+)=(\d+|yes|no)/gi,
  13857. l = { id: "advId", dir: "advLangDir", accessKey: "advAccessKey", name: "advName", lang: "advLangCode", tabindex: "advTabIndex", title: "advTitle", type: "advContentType", "class": "advCSSClasses", charset: "advCharset", style: "advStyles", rel: "advRel" };
  13858. CKEDITOR.plugins.link = {
  13859. getSelectedLink: function(a) {
  13860. var b = a.getSelection(),
  13861. c = b.getSelectedElement();
  13862. if (c && c.is("a")) return c;
  13863. if (b = b.getRanges()[0]) { b.shrink(CKEDITOR.SHRINK_TEXT); return a.elementPath(b.getCommonAncestor()).contains("a", 1) }
  13864. return null
  13865. },
  13866. getEditorAnchors: function(a) {
  13867. for (var b = a.editable(), c = b.isInline() && !a.plugins.divarea ? a.document : b, b = c.getElementsByTag("a"), c = c.getElementsByTag("img"), d = [], f = 0, e; e = b.getItem(f++);)
  13868. if (e.data("cke-saved-name") || e.hasAttribute("name")) d.push({ name: e.data("cke-saved-name") || e.getAttribute("name"), id: e.getAttribute("id") });
  13869. for (f = 0; e = c.getItem(f++);)(e =
  13870. this.tryRestoreFakeAnchor(a, e)) && d.push({ name: e.getAttribute("name"), id: e.getAttribute("id") });
  13871. return d
  13872. },
  13873. fakeAnchor: true,
  13874. tryRestoreFakeAnchor: function(a, b) { if (b && b.data("cke-real-element-type") && b.data("cke-real-element-type") == "anchor") { var c = a.restoreRealElement(b); if (c.data("cke-saved-name")) return c } },
  13875. parseLinkAttributes: function(a, b) {
  13876. var e = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "",
  13877. g = a.plugins.link.compiledProtectionFunction,
  13878. w = a.config.emailProtection,
  13879. x, v = {};
  13880. e.match(c) && (w == "encode" ?
  13881. e = e.replace(n, function(a, b, c) { return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + (c && c.replace(/\\'/g, "'")) }) : w && e.replace(o, function(a, b, c) {
  13882. if (b == g.name) {
  13883. v.type = "email";
  13884. for (var a = v.email = {}, b = /(^')|('$)/g, c = c.match(/[^,\s]+/g), d = c.length, f, e, h = 0; h < d; h++) {
  13885. f = decodeURIComponent;
  13886. e = c[h].replace(b, "").replace(/\\'/g, "'");
  13887. e = f(e);
  13888. f = g.params[h].toLowerCase();
  13889. a[f] = e
  13890. }
  13891. a.address = [a.name, a.domain].join("@")
  13892. }
  13893. }));
  13894. if (!v.type)
  13895. if (w = e.match(h)) {
  13896. v.type = "anchor";
  13897. v.anchor = {};
  13898. v.anchor.name = v.anchor.id = w[1]
  13899. } else if (w =
  13900. e.match(d)) {
  13901. x = e.match(j);
  13902. e = e.match(f);
  13903. v.type = "email";
  13904. var r = v.email = {};
  13905. r.address = w[1];
  13906. x && (r.subject = decodeURIComponent(x[1]));
  13907. e && (r.body = decodeURIComponent(e[1]))
  13908. } else if (e && (x = e.match(i))) {
  13909. v.type = "url";
  13910. v.url = {};
  13911. v.url.protocol = x[1];
  13912. v.url.url = x[2]
  13913. }
  13914. if (b) {
  13915. if (e = b.getAttribute("target")) v.target = { type: e.match(k) ? e : "frame", name: e };
  13916. else if (e = (e = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && e.match(q))
  13917. for (v.target = { type: "popup", name: e[1] }; w = m.exec(e[2]);)(w[2] == "yes" || w[2] == "1") && !(w[1] in {
  13918. height: 1,
  13919. width: 1,
  13920. top: 1,
  13921. left: 1
  13922. }) ? v.target[w[1]] = true : isFinite(w[2]) && (v.target[w[1]] = w[2]);
  13923. var e = {},
  13924. y;
  13925. for (y in l)(w = b.getAttribute(y)) && (e[l[y]] = w);
  13926. if (y = b.data("cke-saved-name") || e.advName) e.advName = y;
  13927. if (!CKEDITOR.tools.isEmpty(e)) v.advanced = e
  13928. }
  13929. return v
  13930. },
  13931. getLinkAttributes: function(c, d) {
  13932. var f = c.config.emailProtection || "",
  13933. g = {};
  13934. switch (d.type) {
  13935. case "url":
  13936. var f = d.url && d.url.protocol !== void 0 ? d.url.protocol : "http://",
  13937. h = d.url && CKEDITOR.tools.trim(d.url.url) || "";
  13938. g["data-cke-saved-href"] = h.indexOf("/") === 0 ? h : f + h;
  13939. break;
  13940. case "anchor":
  13941. f = d.anchor && d.anchor.id;
  13942. g["data-cke-saved-href"] = "#" + (d.anchor && d.anchor.name || f || "");
  13943. break;
  13944. case "email":
  13945. var i = d.email,
  13946. h = i.address;
  13947. switch (f) {
  13948. case "":
  13949. case "encode":
  13950. var j = encodeURIComponent(i.subject || ""),
  13951. k = encodeURIComponent(i.body || ""),
  13952. i = [];
  13953. j && i.push("subject=" + j);
  13954. k && i.push("body=" + k);
  13955. i = i.length ? "?" + i.join("&") : "";
  13956. if (f == "encode") {
  13957. f = ["javascript:void(location.href='mailto:'+", e(h)];
  13958. i && f.push("+'", a(i), "'");
  13959. f.push(")")
  13960. } else f = ["mailto:", h, i];
  13961. break;
  13962. default:
  13963. f = h.split("@", 2);
  13964. i.name = f[0];
  13965. i.domain = f[1];
  13966. f = ["javascript:", b(c, i)]
  13967. }
  13968. g["data-cke-saved-href"] = f.join("")
  13969. }
  13970. if (d.target)
  13971. if (d.target.type == "popup") {
  13972. for (var f = ["window.open(this.href, '", d.target.name || "", "', '"], m = ["resizable", "status", "location", "toolbar", "menubar", "fullscreen", "scrollbars", "dependent"], h = m.length, j = function(a) { d.target[a] && m.push(a + "=" + d.target[a]) }, i = 0; i < h; i++) m[i] = m[i] + (d.target[m[i]] ? "=yes" : "=no");
  13973. j("width");
  13974. j("left");
  13975. j("height");
  13976. j("top");
  13977. f.push(m.join(","), "'); return false;");
  13978. g["data-cke-pa-onclick"] = f.join("")
  13979. } else if (d.target.type !=
  13980. "notSet" && d.target.name) g.target = d.target.name;
  13981. if (d.advanced) { for (var q in l)(f = d.advanced[l[q]]) && (g[q] = f); if (g.name) g["data-cke-saved-name"] = g.name }
  13982. if (g["data-cke-saved-href"]) g.href = g["data-cke-saved-href"];
  13983. q = CKEDITOR.tools.extend({ target: 1, onclick: 1, "data-cke-pa-onclick": 1, "data-cke-saved-name": 1 }, l);
  13984. for (var n in g) delete q[n];
  13985. return { set: g, removed: CKEDITOR.tools.objectKeys(q) }
  13986. }
  13987. };
  13988. CKEDITOR.unlinkCommand = function() {};
  13989. CKEDITOR.unlinkCommand.prototype = {
  13990. exec: function(a) {
  13991. var b = new CKEDITOR.style({
  13992. element: "a",
  13993. type: CKEDITOR.STYLE_INLINE,
  13994. alwaysRemoveElement: 1
  13995. });
  13996. a.removeStyle(b)
  13997. },
  13998. refresh: function(a, b) {
  13999. var c = b.lastElement && b.lastElement.getAscendant("a", true);
  14000. c && c.getName() == "a" && c.getAttribute("href") && c.getChildCount() ? this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  14001. },
  14002. contextSensitive: 1,
  14003. startDisabled: 1,
  14004. requiredContent: "a[href]"
  14005. };
  14006. CKEDITOR.removeAnchorCommand = function() {};
  14007. CKEDITOR.removeAnchorCommand.prototype = {
  14008. exec: function(a) {
  14009. var b = a.getSelection(),
  14010. c = b.createBookmarks(),
  14011. d;
  14012. if (b &&
  14013. (d = b.getSelectedElement()) && (!d.getChildCount() ? CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, d) : d.is("a"))) d.remove(1);
  14014. else if (d = CKEDITOR.plugins.link.getSelectedLink(a))
  14015. if (d.hasAttribute("href")) {
  14016. d.removeAttributes({ name: 1, "data-cke-saved-name": 1 });
  14017. d.removeClass("cke_anchor")
  14018. } else d.remove(1);
  14019. b.selectBookmarks(c)
  14020. },
  14021. requiredContent: "a[name]"
  14022. };
  14023. CKEDITOR.tools.extend(CKEDITOR.config, { linkShowAdvancedTab: true, linkShowTargetTab: true })
  14024. }(), "use strict",
  14025. function() {
  14026. function a(a, b, c) {
  14027. return k(b) && k(c) && c.equals(b.getNext(function(a) {
  14028. return !(Y(a) ||
  14029. Z(a) || n(a))
  14030. }))
  14031. }
  14032. function e(a) {
  14033. this.upper = a[0];
  14034. this.lower = a[1];
  14035. this.set.apply(this, a.slice(2))
  14036. }
  14037. function b(a) {
  14038. var b = a.element;
  14039. if (b && k(b))
  14040. if ((b = b.getAscendant(a.triggers, true)) && a.editable.contains(b)) { var c = d(b); if (c.getAttribute("contenteditable") == "true") return b; if (c.is(a.triggers)) return c }
  14041. return null
  14042. }
  14043. function g(a, b, c) {
  14044. u(a, b);
  14045. u(a, c);
  14046. a = b.size.bottom;
  14047. c = c.size.top;
  14048. return a && c ? 0 | (a + c) / 2 : a || c
  14049. }
  14050. function c(a, b, c) {
  14051. return b = b[c ? "getPrevious" : "getNext"](function(b) {
  14052. return b && b.type == CKEDITOR.NODE_TEXT && !Y(b) ||
  14053. k(b) && !n(b) && !i(a, b)
  14054. })
  14055. }
  14056. function d(a, b) {
  14057. if (a.data("cke-editable")) return null;
  14058. for (b || (a = a.getParent()); a;) {
  14059. if (a.data("cke-editable")) break;
  14060. if (a.hasAttribute("contenteditable")) return a;
  14061. a = a.getParent()
  14062. }
  14063. return null
  14064. }
  14065. function j(a) {
  14066. var b = a.doc,
  14067. c = z('<span contenteditable="false" style="' + P + "position:absolute;border-top:1px dashed " + a.boxColor + '"></span>', b),
  14068. d = CKEDITOR.getUrl(this.path + "images/" + (B.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") + ".png");
  14069. r(c, {
  14070. attach: function() {
  14071. this.wrap.getParent() || this.wrap.appendTo(a.editable,
  14072. true);
  14073. return this
  14074. },
  14075. lineChildren: [r(z('<span title="' + a.editor.lang.magicline.title + '" contenteditable="false">&#8629;</span>', b), {
  14076. base: P + "height:17px;width:17px;" + (a.rtl ? "left" : "right") + ":17px;background:url(" + d + ") center no-repeat " + a.boxColor + ";cursor:pointer;" + (B.hc ? "font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;" : "") + (B.hidpi ? "background-size: 9px 10px;" : ""),
  14077. looks: ["top:-8px;" + CKEDITOR.tools.cssVendorPrefix("border-radius", "2px", 1), "top:-17px;" + CKEDITOR.tools.cssVendorPrefix("border-radius",
  14078. "2px 2px 0px 0px", 1), "top:-1px;" + CKEDITOR.tools.cssVendorPrefix("border-radius", "0px 0px 2px 2px", 1)]
  14079. }), r(z(W, b), { base: V + "left:0px;border-left-color:" + a.boxColor + ";", looks: ["border-width:8px 0 8px 8px;top:-8px", "border-width:8px 0 0 8px;top:-8px", "border-width:0 0 8px 8px;top:0px"] }), r(z(W, b), { base: V + "right:0px;border-right-color:" + a.boxColor + ";", looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px", "border-width:0 8px 8px 0;top:0px"] })],
  14080. detach: function() {
  14081. this.wrap.getParent() &&
  14082. this.wrap.remove();
  14083. return this
  14084. },
  14085. mouseNear: function() {
  14086. u(a, this);
  14087. var b = a.holdDistance,
  14088. c = this.size;
  14089. return c && a.mouse.y > c.top - b && a.mouse.y < c.bottom + b && a.mouse.x > c.left - b && a.mouse.x < c.right + b ? true : false
  14090. },
  14091. place: function() {
  14092. var b = a.view,
  14093. c = a.editable,
  14094. d = a.trigger,
  14095. f = d.upper,
  14096. e = d.lower,
  14097. g = f || e,
  14098. h = g.getParent(),
  14099. i = {};
  14100. this.trigger = d;
  14101. f && u(a, f, true);
  14102. e && u(a, e, true);
  14103. u(a, h, true);
  14104. a.inInlineMode && w(a, true);
  14105. if (h.equals(c)) {
  14106. i.left = b.scroll.x;
  14107. i.right = -b.scroll.x;
  14108. i.width = ""
  14109. } else {
  14110. i.left = g.size.left - g.size.margin.left + b.scroll.x -
  14111. (a.inInlineMode ? b.editable.left + b.editable.border.left : 0);
  14112. i.width = g.size.outerWidth + g.size.margin.left + g.size.margin.right + b.scroll.x;
  14113. i.right = ""
  14114. }
  14115. if (f && e) i.top = f.size.margin.bottom === e.size.margin.top ? 0 | f.size.bottom + f.size.margin.bottom / 2 : f.size.margin.bottom < e.size.margin.top ? f.size.bottom + f.size.margin.bottom : f.size.bottom + f.size.margin.bottom - e.size.margin.top;
  14116. else if (f) { if (!e) i.top = f.size.bottom + f.size.margin.bottom } else i.top = e.size.top - e.size.margin.top;
  14117. if (d.is(L) || i.top > b.scroll.y - 15 && i.top <
  14118. b.scroll.y + 5) {
  14119. i.top = a.inInlineMode ? 0 : b.scroll.y;
  14120. this.look(L)
  14121. } else if (d.is(H) || i.top > b.pane.bottom - 5 && i.top < b.pane.bottom + 15) {
  14122. i.top = a.inInlineMode ? b.editable.height + b.editable.padding.top + b.editable.padding.bottom : b.pane.bottom - 1;
  14123. this.look(H)
  14124. } else {
  14125. if (a.inInlineMode) i.top = i.top - (b.editable.top + b.editable.border.top);
  14126. this.look(Q)
  14127. }
  14128. if (a.inInlineMode) {
  14129. i.top--;
  14130. i.top = i.top + b.editable.scroll.top;
  14131. i.left = i.left + b.editable.scroll.left
  14132. }
  14133. for (var j in i) i[j] = CKEDITOR.tools.cssLength(i[j]);
  14134. this.setStyles(i)
  14135. },
  14136. look: function(a) {
  14137. if (this.oldLook !=
  14138. a) {
  14139. for (var b = this.lineChildren.length, c; b--;)(c = this.lineChildren[b]).setAttribute("style", c.base + c.looks[0 | a / 2]);
  14140. this.oldLook = a
  14141. }
  14142. },
  14143. wrap: new y("span", a.doc)
  14144. });
  14145. for (b = c.lineChildren.length; b--;) c.lineChildren[b].appendTo(c);
  14146. c.look(Q);
  14147. c.appendTo(c.wrap);
  14148. c.unselectable();
  14149. c.lineChildren[0].on("mouseup", function(b) {
  14150. c.detach();
  14151. f(a, function(b) {
  14152. var c = a.line.trigger;
  14153. b[c.is(J) ? "insertBefore" : "insertAfter"](c.is(J) ? c.lower : c.upper)
  14154. }, true);
  14155. a.editor.focus();
  14156. !B.ie && a.enterMode != CKEDITOR.ENTER_BR && a.hotNode.scrollIntoView();
  14157. b.data.preventDefault(true)
  14158. });
  14159. c.on("mousedown", function(a) { a.data.preventDefault(true) });
  14160. a.line = c
  14161. }
  14162. function f(a, b, c) {
  14163. var f = new CKEDITOR.dom.range(a.doc),
  14164. e = a.editor,
  14165. g;
  14166. if (B.ie && a.enterMode == CKEDITOR.ENTER_BR) g = a.doc.createText(O);
  14167. else {
  14168. g = (g = d(a.element, true)) && g.data("cke-enter-mode") || a.enterMode;
  14169. g = new y(D[g], a.doc);
  14170. g.is("br") || a.doc.createText(O).appendTo(g)
  14171. }
  14172. c && e.fire("saveSnapshot");
  14173. b(g);
  14174. f.moveToPosition(g, CKEDITOR.POSITION_AFTER_START);
  14175. e.getSelection().selectRanges([f]);
  14176. a.hotNode = g;
  14177. c && e.fire("saveSnapshot")
  14178. }
  14179. function h(a, e) {
  14180. return {
  14181. canUndo: true,
  14182. modes: { wysiwyg: 1 },
  14183. exec: function() {
  14184. function g(b) {
  14185. var c = B.ie && B.version < 9 ? " " : O,
  14186. d = a.hotNode && a.hotNode.getText() == c && a.element.equals(a.hotNode) && a.lastCmdDirection === !!e;
  14187. f(a, function(c) {
  14188. d && a.hotNode && a.hotNode.remove();
  14189. c[e ? "insertAfter" : "insertBefore"](b);
  14190. c.setAttributes({ "data-cke-magicline-hot": 1, "data-cke-magicline-dir": !!e });
  14191. a.lastCmdDirection = !!e
  14192. });
  14193. !B.ie && a.enterMode != CKEDITOR.ENTER_BR && a.hotNode.scrollIntoView();
  14194. a.line.detach()
  14195. }
  14196. return function(f) {
  14197. var f = f.getSelection().getStartElement(),
  14198. h, f = f.getAscendant(N, 1);
  14199. if (!m(a, f) && f && !f.equals(a.editable) && !f.contains(a.editable)) {
  14200. if ((h = d(f)) && h.getAttribute("contenteditable") == "false") f = h;
  14201. a.element = f;
  14202. h = c(a, f, !e);
  14203. var i;
  14204. if (k(h) && h.is(a.triggers) && h.is(R) && (!c(a, h, !e) || (i = c(a, h, !e)) && k(i) && i.is(a.triggers))) g(h);
  14205. else {
  14206. i = b(a, f);
  14207. if (k(i))
  14208. if (c(a, i, !e))(f = c(a, i, !e)) && (k(f) && f.is(a.triggers)) && g(i);
  14209. else g(i)
  14210. }
  14211. }
  14212. }
  14213. }()
  14214. }
  14215. }
  14216. function i(a, b) { if (!b || !(b.type == CKEDITOR.NODE_ELEMENT && b.$)) return false; var c = a.line; return c.wrap.equals(b) || c.wrap.contains(b) }
  14217. function k(a) {
  14218. return a &&
  14219. a.type == CKEDITOR.NODE_ELEMENT && a.$
  14220. }
  14221. function n(a) {
  14222. if (!k(a)) return false;
  14223. var b;
  14224. if (!(b = o(a)))
  14225. if (k(a)) {
  14226. b = { left: 1, right: 1, center: 1 };
  14227. b = !(!b[a.getComputedStyle("float")] && !b[a.getAttribute("align")])
  14228. } else b = false;
  14229. return b
  14230. }
  14231. function o(a) { return !!{ absolute: 1, fixed: 1 }[a.getComputedStyle("position")] }
  14232. function q(a, b) { return k(b) ? b.is(a.triggers) : null }
  14233. function m(a, b) {
  14234. if (!b) return false;
  14235. for (var c = b.getParents(1), d = c.length; d--;)
  14236. for (var f = a.tabuList.length; f--;)
  14237. if (c[d].hasAttribute(a.tabuList[f])) return true;
  14238. return false
  14239. }
  14240. function l(a, b, c) {
  14241. b = b[c ? "getLast" : "getFirst"](function(b) { return a.isRelevant(b) && !b.is(K) });
  14242. if (!b) return false;
  14243. u(a, b);
  14244. return c ? b.size.top > a.mouse.y : b.size.bottom < a.mouse.y
  14245. }
  14246. function p(a) {
  14247. var b = a.editable,
  14248. c = a.mouse,
  14249. d = a.view,
  14250. f = a.triggerOffset;
  14251. w(a);
  14252. var g = c.y > (a.inInlineMode ? d.editable.top + d.editable.height / 2 : Math.min(d.editable.height, d.pane.height) / 2),
  14253. b = b[g ? "getLast" : "getFirst"](function(a) { return !(Y(a) || Z(a)) });
  14254. if (!b) return null;
  14255. i(a, b) && (b = a.line.wrap[g ? "getPrevious" : "getNext"](function(a) {
  14256. return !(Y(a) ||
  14257. Z(a))
  14258. }));
  14259. if (!k(b) || n(b) || !q(a, b)) return null;
  14260. u(a, b);
  14261. if (!g && b.size.top >= 0 && c.y > 0 && c.y < b.size.top + f) { a = a.inInlineMode || d.scroll.y === 0 ? L : Q; return new e([null, b, J, E, a]) }
  14262. if (g && b.size.bottom <= d.pane.height && c.y > b.size.bottom - f && c.y < d.pane.height) { a = a.inInlineMode || b.size.bottom > d.pane.height - f && b.size.bottom < d.pane.height ? H : Q; return new e([b, null, C, E, a]) }
  14263. return null
  14264. }
  14265. function t(a) {
  14266. var d = a.mouse,
  14267. f = a.view,
  14268. g = a.triggerOffset,
  14269. h = b(a);
  14270. if (!h) return null;
  14271. u(a, h);
  14272. var g = Math.min(g, 0 | h.size.outerHeight / 2),
  14273. i = [],
  14274. j, m;
  14275. if (d.y >
  14276. h.size.top - 1 && d.y < h.size.top + g) m = false;
  14277. else if (d.y > h.size.bottom - g && d.y < h.size.bottom + 1) m = true;
  14278. else return null;
  14279. if (n(h) || l(a, h, m) || h.getParent().is(M)) return null;
  14280. var p = c(a, h, !m);
  14281. if (p) {
  14282. if (p && p.type == CKEDITOR.NODE_TEXT) return null;
  14283. if (k(p)) {
  14284. if (n(p) || !q(a, p) || p.getParent().is(M)) return null;
  14285. i = [p, h][m ? "reverse" : "concat"]().concat([F, E])
  14286. }
  14287. } else {
  14288. if (h.equals(a.editable[m ? "getLast" : "getFirst"](a.isRelevant))) {
  14289. w(a);
  14290. m && d.y > h.size.bottom - g && d.y < f.pane.height && h.size.bottom > f.pane.height - g && h.size.bottom < f.pane.height ?
  14291. j = H : d.y > 0 && d.y < h.size.top + g && (j = L)
  14292. } else j = Q;
  14293. i = [null, h][m ? "reverse" : "concat"]().concat([m ? C : J, E, j, h.equals(a.editable[m ? "getLast" : "getFirst"](a.isRelevant)) ? m ? H : L : Q])
  14294. }
  14295. return 0 in i ? new e(i) : null
  14296. }
  14297. function s(a, b, c, d) {
  14298. for (var f = function() { var c = B.ie ? b.$.currentStyle : a.win.$.getComputedStyle(b.$, ""); return B.ie ? function(a) { return c[CKEDITOR.tools.cssStyleToDomStyle(a)] } : function(a) { return c.getPropertyValue(a) } }(), e = b.getDocumentPosition(), g = {}, h = {}, i = {}, j = {}, k = X.length; k--;) {
  14299. g[X[k]] = parseInt(f("border-" +
  14300. X[k] + "-width"), 10) || 0;
  14301. i[X[k]] = parseInt(f("padding-" + X[k]), 10) || 0;
  14302. h[X[k]] = parseInt(f("margin-" + X[k]), 10) || 0
  14303. }(!c || d) && x(a, d);
  14304. j.top = e.y - (c ? 0 : a.view.scroll.y);
  14305. j.left = e.x - (c ? 0 : a.view.scroll.x);
  14306. j.outerWidth = b.$.offsetWidth;
  14307. j.outerHeight = b.$.offsetHeight;
  14308. j.height = j.outerHeight - (i.top + i.bottom + g.top + g.bottom);
  14309. j.width = j.outerWidth - (i.left + i.right + g.left + g.right);
  14310. j.bottom = j.top + j.outerHeight;
  14311. j.right = j.left + j.outerWidth;
  14312. if (a.inInlineMode) j.scroll = { top: b.$.scrollTop, left: b.$.scrollLeft };
  14313. return r({
  14314. border: g,
  14315. padding: i,
  14316. margin: h,
  14317. ignoreScroll: c
  14318. }, j, true)
  14319. }
  14320. function u(a, b, c) { if (!k(b)) return b.size = null; if (b.size) { if (b.size.ignoreScroll == c && b.size.date > new Date - T) return null } else b.size = {}; return r(b.size, s(a, b, c), { date: +new Date }, true) }
  14321. function w(a, b) { a.view.editable = s(a, a.editable, b, true) }
  14322. function x(a, b) {
  14323. if (!a.view) a.view = {};
  14324. var c = a.view;
  14325. if (b || !(c && c.date > new Date - T)) {
  14326. var d = a.win,
  14327. c = d.getScrollPosition(),
  14328. d = d.getViewPaneSize();
  14329. r(a.view, {
  14330. scroll: {
  14331. x: c.x,
  14332. y: c.y,
  14333. width: a.doc.$.documentElement.scrollWidth - d.width,
  14334. height: a.doc.$.documentElement.scrollHeight -
  14335. d.height
  14336. },
  14337. pane: { width: d.width, height: d.height, bottom: d.height + c.y },
  14338. date: +new Date
  14339. }, true)
  14340. }
  14341. }
  14342. function v(a, b, c, d) {
  14343. for (var f = d, g = d, h = 0, i = false, j = false, k = a.view.pane.height, m = a.mouse; m.y + h < k && m.y - h > 0;) {
  14344. i || (i = b(f, d));
  14345. j || (j = b(g, d));
  14346. !i && m.y - h > 0 && (f = c(a, { x: m.x, y: m.y - h }));
  14347. !j && m.y + h < k && (g = c(a, { x: m.x, y: m.y + h }));
  14348. if (i && j) break;
  14349. h = h + 2
  14350. }
  14351. return new e([f, g, null, null])
  14352. }
  14353. CKEDITOR.plugins.add("magicline", {
  14354. init: function(a) {
  14355. var d = a.config,
  14356. g = d.magicline_triggerOffset || 30,
  14357. l = {
  14358. editor: a,
  14359. enterMode: d.enterMode,
  14360. triggerOffset: g,
  14361. holdDistance: 0 |
  14362. g * (d.magicline_holdDistance || 0.5),
  14363. boxColor: d.magicline_color || "#ff0000",
  14364. rtl: d.contentsLangDirection == "rtl",
  14365. tabuList: ["data-cke-hidden-sel"].concat(d.magicline_tabuList || []),
  14366. triggers: d.magicline_everywhere ? N : { table: 1, hr: 1, div: 1, ul: 1, ol: 1, dl: 1, form: 1, blockquote: 1 }
  14367. },
  14368. q, u, v;
  14369. l.isRelevant = function(a) { return k(a) && !i(l, a) && !n(a) };
  14370. a.on("contentDom", function() {
  14371. var g = a.editable(),
  14372. k = a.document,
  14373. n = a.window;
  14374. r(l, { editable: g, inInlineMode: g.isInline(), doc: k, win: n, hotNode: null }, true);
  14375. l.boundary = l.inInlineMode ? l.editable :
  14376. l.doc.getDocumentElement();
  14377. if (!g.is(G.$inline)) {
  14378. l.inInlineMode && !o(g) && g.setStyles({ position: "relative", top: null, left: null });
  14379. j.call(this, l);
  14380. x(l);
  14381. g.attachListener(a, "beforeUndoImage", function() { l.line.detach() });
  14382. g.attachListener(a, "beforeGetData", function() {
  14383. if (l.line.wrap.getParent()) {
  14384. l.line.detach();
  14385. a.once("getData", function() { l.line.attach() }, null, null, 1E3)
  14386. }
  14387. }, null, null, 0);
  14388. g.attachListener(l.inInlineMode ? k : k.getWindow().getFrame(), "mouseout", function(b) {
  14389. if (a.mode == "wysiwyg")
  14390. if (l.inInlineMode) {
  14391. var c =
  14392. b.data.$.clientX,
  14393. b = b.data.$.clientY;
  14394. x(l);
  14395. w(l, true);
  14396. var d = l.view.editable,
  14397. f = l.view.scroll;
  14398. if (!(c > d.left - f.x && c < d.right - f.x) || !(b > d.top - f.y && b < d.bottom - f.y)) {
  14399. clearTimeout(v);
  14400. v = null;
  14401. l.line.detach()
  14402. }
  14403. } else {
  14404. clearTimeout(v);
  14405. v = null;
  14406. l.line.detach()
  14407. }
  14408. });
  14409. g.attachListener(g, "keyup", function() { l.hiddenMode = 0 });
  14410. g.attachListener(g, "keydown", function(b) {
  14411. if (a.mode == "wysiwyg") switch (b.data.getKeystroke()) {
  14412. case 2228240:
  14413. case 16:
  14414. l.hiddenMode = 1;
  14415. l.line.detach()
  14416. }
  14417. });
  14418. g.attachListener(l.inInlineMode ? g : k, "mousemove", function(b) {
  14419. u =
  14420. true;
  14421. if (!(a.mode != "wysiwyg" || a.readOnly || v)) {
  14422. var c = { x: b.data.$.clientX, y: b.data.$.clientY };
  14423. v = setTimeout(function() {
  14424. l.mouse = c;
  14425. v = l.trigger = null;
  14426. x(l);
  14427. if (u && !l.hiddenMode && a.focusManager.hasFocus && !l.line.mouseNear() && (l.element = S(l, true))) {
  14428. if ((l.trigger = p(l) || t(l) || ba(l)) && !m(l, l.trigger.upper || l.trigger.lower)) l.line.attach().place();
  14429. else {
  14430. l.trigger = null;
  14431. l.line.detach()
  14432. }
  14433. u = false
  14434. }
  14435. }, 30)
  14436. }
  14437. });
  14438. g.attachListener(n, "scroll", function() {
  14439. if (a.mode == "wysiwyg") {
  14440. l.line.detach();
  14441. if (B.webkit) {
  14442. l.hiddenMode = 1;
  14443. clearTimeout(q);
  14444. q = setTimeout(function() { if (!l.mouseDown) l.hiddenMode = 0 }, 50)
  14445. }
  14446. }
  14447. });
  14448. g.attachListener(A ? k : n, "mousedown", function() {
  14449. if (a.mode == "wysiwyg") {
  14450. l.line.detach();
  14451. l.hiddenMode = 1;
  14452. l.mouseDown = 1
  14453. }
  14454. });
  14455. g.attachListener(A ? k : n, "mouseup", function() {
  14456. l.hiddenMode = 0;
  14457. l.mouseDown = 0
  14458. });
  14459. a.addCommand("accessPreviousSpace", h(l));
  14460. a.addCommand("accessNextSpace", h(l, true));
  14461. a.setKeystroke([
  14462. [d.magicline_keystrokePrevious, "accessPreviousSpace"],
  14463. [d.magicline_keystrokeNext, "accessNextSpace"]
  14464. ]);
  14465. a.on("loadSnapshot", function() {
  14466. var b, c, d, f;
  14467. for (f in {
  14468. p: 1,
  14469. br: 1,
  14470. div: 1
  14471. }) {
  14472. b = a.document.getElementsByTag(f);
  14473. for (d = b.count(); d--;)
  14474. if ((c = b.getItem(d)).data("cke-magicline-hot")) {
  14475. l.hotNode = c;
  14476. l.lastCmdDirection = c.data("cke-magicline-dir") === "true" ? true : false;
  14477. return
  14478. }
  14479. }
  14480. });
  14481. this.backdoor = { accessFocusSpace: f, boxTrigger: e, isLine: i, getAscendantTrigger: b, getNonEmptyNeighbour: c, getSize: s, that: l, triggerEdge: t, triggerEditable: p, triggerExpand: ba }
  14482. }
  14483. }, this)
  14484. }
  14485. });
  14486. var r = CKEDITOR.tools.extend,
  14487. y = CKEDITOR.dom.element,
  14488. z = y.createFromHtml,
  14489. B = CKEDITOR.env,
  14490. A = CKEDITOR.env.ie && CKEDITOR.env.version <
  14491. 9,
  14492. G = CKEDITOR.dtd,
  14493. D = {},
  14494. J = 128,
  14495. C = 64,
  14496. F = 32,
  14497. E = 16,
  14498. I = 8,
  14499. L = 4,
  14500. H = 2,
  14501. Q = 1,
  14502. O = " ",
  14503. M = G.$listItem,
  14504. K = G.$tableContent,
  14505. R = r({}, G.$nonEditable, G.$empty),
  14506. N = G.$block,
  14507. T = 100,
  14508. P = "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
  14509. V = P + "border-color:transparent;display:block;border-style:solid;",
  14510. W = "<span>" + O + "</span>";
  14511. D[CKEDITOR.ENTER_BR] = "br";
  14512. D[CKEDITOR.ENTER_P] = "p";
  14513. D[CKEDITOR.ENTER_DIV] = "div";
  14514. e.prototype = {
  14515. set: function(a, b, c) {
  14516. this.properties = a + b +
  14517. (c || Q);
  14518. return this
  14519. },
  14520. is: function(a) { return (this.properties & a) == a }
  14521. };
  14522. var S = function() {
  14523. function a(b, c) { var d = b.$.elementFromPoint(c.x, c.y); return d && d.nodeType ? new CKEDITOR.dom.element(d) : null }
  14524. return function(b, c, d) {
  14525. if (!b.mouse) return null;
  14526. var f = b.doc,
  14527. e = b.line.wrap,
  14528. d = d || b.mouse,
  14529. g = a(f, d);
  14530. if (c && i(b, g)) {
  14531. e.hide();
  14532. g = a(f, d);
  14533. e.show()
  14534. }
  14535. return !g || !(g.type == CKEDITOR.NODE_ELEMENT && g.$) || B.ie && B.version < 9 && !b.boundary.equals(g) && !b.boundary.contains(g) ? null : g
  14536. }
  14537. }(),
  14538. Y = CKEDITOR.dom.walker.whitespaces(),
  14539. Z = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),
  14540. ba = function() {
  14541. function b(d) {
  14542. var f = d.element,
  14543. e, h, i;
  14544. if (!k(f) || f.contains(d.editable) || f.isReadOnly()) return null;
  14545. i = v(d, function(a, b) { return !b.equals(a) }, function(a, b) { return S(a, true, b) }, f);
  14546. e = i.upper;
  14547. h = i.lower;
  14548. if (a(d, e, h)) return i.set(F, I);
  14549. if (e && f.contains(e))
  14550. for (; !e.getParent().equals(f);) e = e.getParent();
  14551. else e = f.getFirst(function(a) { return c(d, a) });
  14552. if (h && f.contains(h))
  14553. for (; !h.getParent().equals(f);) h = h.getParent();
  14554. else h = f.getLast(function(a) { return c(d, a) });
  14555. if (!e || !h) return null;
  14556. u(d, e);
  14557. u(d, h);
  14558. if (!(d.mouse.y >
  14559. e.size.top && d.mouse.y < h.size.bottom)) return null;
  14560. for (var f = Number.MAX_VALUE, j, m, l, q; h && !h.equals(e);) {
  14561. if (!(m = e.getNext(d.isRelevant))) break;
  14562. j = Math.abs(g(d, e, m) - d.mouse.y);
  14563. if (j < f) {
  14564. f = j;
  14565. l = e;
  14566. q = m
  14567. }
  14568. e = m;
  14569. u(d, e)
  14570. }
  14571. if (!l || !q || !(d.mouse.y > l.size.top && d.mouse.y < q.size.bottom)) return null;
  14572. i.upper = l;
  14573. i.lower = q;
  14574. return i.set(F, I)
  14575. }
  14576. function c(a, b) { return !(b && b.type == CKEDITOR.NODE_TEXT || Z(b) || n(b) || i(a, b) || b.type == CKEDITOR.NODE_ELEMENT && b.$ && b.is("br")) }
  14577. return function(c) {
  14578. var d = b(c),
  14579. f;
  14580. if (f = d) {
  14581. f = d.upper;
  14582. var e = d.lower;
  14583. f = !f || !e || n(e) || n(f) || e.equals(f) || f.equals(e) || e.contains(f) || f.contains(e) ? false : q(c, f) && q(c, e) && a(c, f, e) ? true : false
  14584. }
  14585. return f ? d : null
  14586. }
  14587. }(),
  14588. X = ["top", "left", "right", "bottom"]
  14589. }(), CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51, CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52,
  14590. function() {
  14591. function a(a) {
  14592. if (!a || a.type != CKEDITOR.NODE_ELEMENT || a.getName() != "form") return [];
  14593. for (var b = [], c = ["style", "className"], e = 0; e < c.length; e++) {
  14594. var g = a.$.elements.namedItem(c[e]);
  14595. if (g) {
  14596. g = new CKEDITOR.dom.element(g);
  14597. b.push([g, g.nextSibling]);
  14598. g.remove()
  14599. }
  14600. }
  14601. return b
  14602. }
  14603. function e(a, b) {
  14604. if (a && !(a.type != CKEDITOR.NODE_ELEMENT || a.getName() != "form") && b.length > 0)
  14605. for (var c = b.length - 1; c >= 0; c--) {
  14606. var e = b[c][0],
  14607. g = b[c][1];
  14608. g ? e.insertBefore(g) : e.appendTo(a)
  14609. }
  14610. }
  14611. function b(b, c) {
  14612. var f = a(b),
  14613. g = {},
  14614. i = b.$;
  14615. if (!c) {
  14616. g["class"] = i.className || "";
  14617. i.className = ""
  14618. }
  14619. g.inline = i.style.cssText || "";
  14620. if (!c) i.style.cssText = "position: static; overflow: visible";
  14621. e(f);
  14622. return g
  14623. }
  14624. function g(b, c) {
  14625. var f = a(b),
  14626. g = b.$;
  14627. if ("class" in c) g.className =
  14628. c["class"];
  14629. if ("inline" in c) g.style.cssText = c.inline;
  14630. e(f)
  14631. }
  14632. function c(a) {
  14633. if (!a.editable().isInline()) {
  14634. var b = CKEDITOR.instances,
  14635. c;
  14636. for (c in b) {
  14637. var e = b[c];
  14638. if (e.mode == "wysiwyg" && !e.readOnly) {
  14639. e = e.document.getBody();
  14640. e.setAttribute("contentEditable", false);
  14641. e.setAttribute("contentEditable", true)
  14642. }
  14643. }
  14644. if (a.editable().hasFocus) {
  14645. a.toolbox.focus();
  14646. a.focus()
  14647. }
  14648. }
  14649. }
  14650. CKEDITOR.plugins.add("maximize", {
  14651. init: function(a) {
  14652. function e() {
  14653. var b = i.getViewPaneSize();
  14654. a.resize(b.width, b.height, null, true)
  14655. }
  14656. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  14657. var f =
  14658. a.lang,
  14659. h = CKEDITOR.document,
  14660. i = h.getWindow(),
  14661. k, n, o, q = CKEDITOR.TRISTATE_OFF;
  14662. a.addCommand("maximize", {
  14663. modes: { wysiwyg: !CKEDITOR.env.iOS, source: !CKEDITOR.env.iOS },
  14664. readOnly: 1,
  14665. editorFocus: false,
  14666. exec: function() {
  14667. var m = a.container.getFirst(function(a) { return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner") }),
  14668. l = a.ui.space("contents");
  14669. if (a.mode == "wysiwyg") {
  14670. var p = a.getSelection();
  14671. k = p && p.getRanges();
  14672. n = i.getScrollPosition()
  14673. } else {
  14674. var t = a.editable().$;
  14675. k = !CKEDITOR.env.ie && [t.selectionStart, t.selectionEnd];
  14676. n = [t.scrollLeft,
  14677. t.scrollTop
  14678. ]
  14679. }
  14680. if (this.state == CKEDITOR.TRISTATE_OFF) {
  14681. i.on("resize", e);
  14682. o = i.getScrollPosition();
  14683. for (p = a.container; p = p.getParent();) {
  14684. p.setCustomData("maximize_saved_styles", b(p));
  14685. p.setStyle("z-index", a.config.baseFloatZIndex - 5)
  14686. }
  14687. l.setCustomData("maximize_saved_styles", b(l, true));
  14688. m.setCustomData("maximize_saved_styles", b(m, true));
  14689. l = { overflow: CKEDITOR.env.webkit ? "" : "hidden", width: 0, height: 0 };
  14690. h.getDocumentElement().setStyles(l);
  14691. !CKEDITOR.env.gecko && h.getDocumentElement().setStyle("position", "fixed");
  14692. (!CKEDITOR.env.gecko ||
  14693. !CKEDITOR.env.quirks) && h.getBody().setStyles(l);
  14694. CKEDITOR.env.ie ? setTimeout(function() { i.$.scrollTo(0, 0) }, 0) : i.$.scrollTo(0, 0);
  14695. m.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute");
  14696. m.$.offsetLeft;
  14697. m.setStyles({ "z-index": a.config.baseFloatZIndex - 5, left: "0px", top: "0px" });
  14698. m.addClass("cke_maximized");
  14699. e();
  14700. l = m.getDocumentPosition();
  14701. m.setStyles({ left: -1 * l.x + "px", top: -1 * l.y + "px" });
  14702. CKEDITOR.env.gecko && c(a)
  14703. } else if (this.state == CKEDITOR.TRISTATE_ON) {
  14704. i.removeListener("resize", e);
  14705. l = [l,
  14706. m
  14707. ];
  14708. for (p = 0; p < l.length; p++) {
  14709. g(l[p], l[p].getCustomData("maximize_saved_styles"));
  14710. l[p].removeCustomData("maximize_saved_styles")
  14711. }
  14712. for (p = a.container; p = p.getParent();) {
  14713. g(p, p.getCustomData("maximize_saved_styles"));
  14714. p.removeCustomData("maximize_saved_styles")
  14715. }
  14716. CKEDITOR.env.ie ? setTimeout(function() { i.$.scrollTo(o.x, o.y) }, 0) : i.$.scrollTo(o.x, o.y);
  14717. m.removeClass("cke_maximized");
  14718. if (CKEDITOR.env.webkit) {
  14719. m.setStyle("display", "inline");
  14720. setTimeout(function() { m.setStyle("display", "block") }, 0)
  14721. }
  14722. a.fire("resize")
  14723. }
  14724. this.toggleState();
  14725. if (p = this.uiItems[0]) {
  14726. l = this.state == CKEDITOR.TRISTATE_OFF ? f.maximize.maximize : f.maximize.minimize;
  14727. p = CKEDITOR.document.getById(p._.id);
  14728. p.getChild(1).setHtml(l);
  14729. p.setAttribute("title", l);
  14730. p.setAttribute("href", 'javascript:void("' + l + '");')
  14731. }
  14732. if (a.mode == "wysiwyg")
  14733. if (k) {
  14734. CKEDITOR.env.gecko && c(a);
  14735. a.getSelection().selectRanges(k);
  14736. (t = a.getSelection().getStartElement()) && t.scrollIntoView(true)
  14737. } else i.$.scrollTo(n.x, n.y);
  14738. else {
  14739. if (k) {
  14740. t.selectionStart = k[0];
  14741. t.selectionEnd = k[1]
  14742. }
  14743. t.scrollLeft = n[0];
  14744. t.scrollTop = n[1]
  14745. }
  14746. k =
  14747. n = null;
  14748. q = this.state;
  14749. a.fire("maximize", this.state)
  14750. },
  14751. canUndo: false
  14752. });
  14753. a.ui.addButton && a.ui.addButton("Maximize", { label: f.maximize.maximize, command: "maximize", toolbar: "tools,10" });
  14754. a.on("mode", function() {
  14755. var b = a.getCommand("maximize");
  14756. b.setState(b.state == CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : q)
  14757. }, null, null, 100)
  14758. }
  14759. }
  14760. })
  14761. }(),
  14762. function() {
  14763. function a(a, e, c) {
  14764. var d = CKEDITOR.cleanWord;
  14765. if (d) c();
  14766. else {
  14767. a = CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile || e + "filter/default.js");
  14768. CKEDITOR.scriptLoader.load(a,
  14769. c, null, true)
  14770. }
  14771. return !d
  14772. }
  14773. function e(a) { a.data.type = "html" }
  14774. CKEDITOR.plugins.add("pastefromword", {
  14775. requires: "clipboard",
  14776. init: function(b) {
  14777. var g = 0,
  14778. c = this.path;
  14779. b.addCommand("pastefromword", {
  14780. canUndo: false,
  14781. async: true,
  14782. exec: function(a) {
  14783. var b = this;
  14784. g = 1;
  14785. a.once("beforePaste", e);
  14786. a.getClipboardData({ title: a.lang.pastefromword.title }, function(c) {
  14787. c && a.fire("paste", { type: "html", dataValue: c.dataValue });
  14788. a.fire("afterCommandExec", { name: "pastefromword", command: b, returnValue: !!c })
  14789. })
  14790. }
  14791. });
  14792. b.ui.addButton && b.ui.addButton("PasteFromWord", { label: b.lang.pastefromword.toolbar, command: "pastefromword", toolbar: "clipboard,50" });
  14793. b.on("pasteState", function(a) { b.getCommand("pastefromword").setState(a.data) });
  14794. b.on("paste", function(d) {
  14795. var e = d.data,
  14796. f = e.dataValue;
  14797. if (f && (g || /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(f))) {
  14798. var h = a(b, c, function() {
  14799. if (h) b.fire("paste", e);
  14800. else if (!b.config.pasteFromWordPromptCleanup || g || confirm(b.lang.pastefromword.confirmCleanup)) e.dataValue = CKEDITOR.cleanWord(f, b);
  14801. g = 0
  14802. });
  14803. h && d.cancel()
  14804. }
  14805. }, null, null, 3)
  14806. }
  14807. })
  14808. }(),
  14809. function() {
  14810. var a = {
  14811. canUndo: false,
  14812. async: true,
  14813. exec: function(e) {
  14814. e.getClipboardData({ title: e.lang.pastetext.title }, function(b) {
  14815. b && e.fire("paste", { type: "text", dataValue: b.dataValue });
  14816. e.fire("afterCommandExec", { name: "pastetext", command: a, returnValue: !!b })
  14817. })
  14818. }
  14819. };
  14820. CKEDITOR.plugins.add("pastetext", {
  14821. requires: "clipboard",
  14822. init: function(e) {
  14823. e.addCommand("pastetext", a);
  14824. e.ui.addButton && e.ui.addButton("PasteText", { label: e.lang.pastetext.button, command: "pastetext", toolbar: "clipboard,40" });
  14825. if (e.config.forcePasteAsPlainText) e.on("beforePaste",
  14826. function(a) { if (a.data.type != "html") a.data.type = "text" });
  14827. e.on("pasteState", function(a) { e.getCommand("pastetext").setState(a.data) })
  14828. }
  14829. })
  14830. }(), CKEDITOR.plugins.add("removeformat", {
  14831. init: function(a) {
  14832. a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
  14833. a.ui.addButton && a.ui.addButton("RemoveFormat", { label: a.lang.removeformat.toolbar, command: "removeFormat", toolbar: "cleanup,10" })
  14834. }
  14835. }), CKEDITOR.plugins.removeformat = {
  14836. commands: {
  14837. removeformat: {
  14838. exec: function(a) {
  14839. for (var e = a._.removeFormatRegex ||
  14840. (a._.removeFormatRegex = RegExp("^(?:" + a.config.removeFormatTags.replace(/,/g, "|") + ")$", "i")), b = a._.removeAttributes || (a._.removeAttributes = a.config.removeFormatAttributes.split(",")), g = CKEDITOR.plugins.removeformat.filter, c = a.getSelection().getRanges(), d = c.createIterator(), j = function(a) { return a.type == CKEDITOR.NODE_ELEMENT }, f; f = d.getNextRange();) {
  14841. f.collapsed || f.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  14842. var h = f.createBookmark(),
  14843. i = h.startNode,
  14844. k = h.endNode,
  14845. n = function(b) {
  14846. for (var c = a.elementPath(b), d = c.elements,
  14847. f = 1, h; h = d[f]; f++) {
  14848. if (h.equals(c.block) || h.equals(c.blockLimit)) break;
  14849. e.test(h.getName()) && g(a, h) && b.breakParent(h)
  14850. }
  14851. };
  14852. n(i);
  14853. if (k) {
  14854. n(k);
  14855. for (i = i.getNextSourceNode(true, CKEDITOR.NODE_ELEMENT); i;) {
  14856. if (i.equals(k)) break;
  14857. if (i.isReadOnly()) {
  14858. if (i.getPosition(k) & CKEDITOR.POSITION_CONTAINS) break;
  14859. i = i.getNext(j)
  14860. } else {
  14861. n = i.getNextSourceNode(false, CKEDITOR.NODE_ELEMENT);
  14862. if (!(i.getName() == "img" && i.data("cke-realelement")) && g(a, i))
  14863. if (e.test(i.getName())) i.remove(1);
  14864. else {
  14865. i.removeAttributes(b);
  14866. a.fire("removeFormatCleanup",
  14867. i)
  14868. }
  14869. i = n
  14870. }
  14871. }
  14872. }
  14873. f.moveToBookmark(h)
  14874. }
  14875. a.forceNextSelectionCheck();
  14876. a.getSelection().selectRanges(c)
  14877. }
  14878. }
  14879. },
  14880. filter: function(a, e) {
  14881. for (var b = a._.removeFormatFilters || [], g = 0; g < b.length; g++)
  14882. if (b[g](e) === false) return false;
  14883. return true
  14884. }
  14885. }, CKEDITOR.editor.prototype.addRemoveFormatFilter = function(a) {
  14886. if (!this._.removeFormatFilters) this._.removeFormatFilters = [];
  14887. this._.removeFormatFilters.push(a)
  14888. }, CKEDITOR.config.removeFormatTags = "b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var",
  14889. CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign", CKEDITOR.plugins.add("resize", {
  14890. init: function(a) {
  14891. var e, b, g, c;
  14892. function d(d) {
  14893. var h = e,
  14894. j = b,
  14895. k = h + (d.data.$.screenX - g) * (i == "rtl" ? -1 : 1),
  14896. d = j + (d.data.$.screenY - c);
  14897. n && (h = Math.max(f.resize_minWidth, Math.min(k, f.resize_maxWidth)));
  14898. o && (j = Math.max(f.resize_minHeight, Math.min(d, f.resize_maxHeight)));
  14899. a.resize(n ? h : null, j)
  14900. }
  14901. function j() {
  14902. CKEDITOR.document.removeListener("mousemove", d);
  14903. CKEDITOR.document.removeListener("mouseup", j);
  14904. if (a.document) {
  14905. a.document.removeListener("mousemove", d);
  14906. a.document.removeListener("mouseup", j)
  14907. }
  14908. }
  14909. var f = a.config,
  14910. h = a.ui.spaceId("resizer"),
  14911. i = a.element ? a.element.getDirection(1) : "ltr";
  14912. !f.resize_dir && (f.resize_dir = "vertical");
  14913. f.resize_maxWidth === void 0 && (f.resize_maxWidth = 3E3);
  14914. f.resize_maxHeight === void 0 && (f.resize_maxHeight = 3E3);
  14915. f.resize_minWidth === void 0 && (f.resize_minWidth = 750);
  14916. f.resize_minHeight === void 0 && (f.resize_minHeight = 250);
  14917. if (f.resize_enabled !== false) {
  14918. var k = null,
  14919. n = (f.resize_dir == "both" || f.resize_dir ==
  14920. "horizontal") && f.resize_minWidth != f.resize_maxWidth,
  14921. o = (f.resize_dir == "both" || f.resize_dir == "vertical") && f.resize_minHeight != f.resize_maxHeight,
  14922. q = CKEDITOR.tools.addFunction(function(h) {
  14923. k || (k = a.getResizable());
  14924. e = k.$.offsetWidth || 0;
  14925. b = k.$.offsetHeight || 0;
  14926. g = h.screenX;
  14927. c = h.screenY;
  14928. f.resize_minWidth > e && (f.resize_minWidth = e);
  14929. f.resize_minHeight > b && (f.resize_minHeight = b);
  14930. CKEDITOR.document.on("mousemove", d);
  14931. CKEDITOR.document.on("mouseup", j);
  14932. if (a.document) {
  14933. a.document.on("mousemove", d);
  14934. a.document.on("mouseup",
  14935. j)
  14936. }
  14937. h.preventDefault && h.preventDefault()
  14938. });
  14939. a.on("destroy", function() { CKEDITOR.tools.removeFunction(q) });
  14940. a.on("uiSpace", function(b) {
  14941. if (b.data.space == "bottom") {
  14942. var c = "";
  14943. n && !o && (c = " cke_resizer_horizontal");
  14944. !n && o && (c = " cke_resizer_vertical");
  14945. var d = '<span id="' + h + '" class="cke_resizer' + c + " cke_resizer_" + i + '" title="' + CKEDITOR.tools.htmlEncode(a.lang.common.resize) + '" onmousedown="CKEDITOR.tools.callFunction(' + q + ', event)">' + (i == "ltr" ? "◢" : "◣") + "</span>";
  14946. i == "ltr" && c == "ltr" ? b.data.html = b.data.html + d : b.data.html =
  14947. d + b.data.html
  14948. }
  14949. }, a, null, 100);
  14950. a.on("maximize", function(b) { a.ui.space("resizer")[b.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]() })
  14951. }
  14952. }
  14953. }), CKEDITOR.plugins.add("menubutton", {
  14954. requires: "button,menu",
  14955. onLoad: function() {
  14956. var a = function(a) {
  14957. var b = this._,
  14958. g = b.menu;
  14959. if (b.state !== CKEDITOR.TRISTATE_DISABLED)
  14960. if (b.on && g) g.hide();
  14961. else {
  14962. b.previousState = b.state;
  14963. if (!g) {
  14964. g = b.menu = new CKEDITOR.menu(a, { panel: { className: "cke_menu_panel", attributes: { "aria-label": a.lang.common.options } } });
  14965. g.onHide = CKEDITOR.tools.bind(function() {
  14966. var c =
  14967. this.command ? a.getCommand(this.command).modes : this.modes;
  14968. this.setState(!c || c[a.mode] ? b.previousState : CKEDITOR.TRISTATE_DISABLED);
  14969. b.on = 0
  14970. }, this);
  14971. this.onMenu && g.addListener(this.onMenu)
  14972. }
  14973. this.setState(CKEDITOR.TRISTATE_ON);
  14974. b.on = 1;
  14975. setTimeout(function() { g.show(CKEDITOR.document.getById(b.id), 4) }, 0)
  14976. }
  14977. };
  14978. CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({
  14979. base: CKEDITOR.ui.button,
  14980. $: function(e) {
  14981. delete e.panel;
  14982. this.base(e);
  14983. this.hasArrow = true;
  14984. this.click = a
  14985. },
  14986. statics: { handler: { create: function(a) { return new CKEDITOR.ui.menuButton(a) } } }
  14987. })
  14988. },
  14989. beforeInit: function(a) { a.ui.addHandler(CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler) }
  14990. }), CKEDITOR.UI_MENUBUTTON = "menubutton", "use strict", CKEDITOR.plugins.add("scayt", {
  14991. requires: "menubutton,dialog",
  14992. tabToOpen: null,
  14993. dialogName: "scaytDialog",
  14994. init: function(a) {
  14995. var e = this,
  14996. b = CKEDITOR.plugins.scayt;
  14997. this.bindEvents(a);
  14998. this.parseConfig(a);
  14999. this.addRule(a);
  15000. CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + "dialogs/options.js"));
  15001. this.addMenuItems(a);
  15002. var g = a.lang.scayt,
  15003. c = CKEDITOR.env;
  15004. a.ui.add("Scayt",
  15005. CKEDITOR.UI_MENUBUTTON, {
  15006. label: g.text_title,
  15007. title: a.plugins.wsc ? a.lang.wsc.title : g.text_title,
  15008. modes: { wysiwyg: !(c.ie && (c.version < 8 || c.quirks)) },
  15009. toolbar: "spellchecker,20",
  15010. refresh: function() {
  15011. var c = a.ui.instances.Scayt.getState();
  15012. a.scayt && (c = b.state[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
  15013. a.fire("scaytButtonState", c)
  15014. },
  15015. onRender: function() {
  15016. var b = this;
  15017. a.on("scaytButtonState", function(a) { typeof a.data !== void 0 && b.setState(a.data) })
  15018. },
  15019. onMenu: function() {
  15020. var c = a.scayt;
  15021. a.getMenuItem("scaytToggle").label =
  15022. a.lang.scayt[c && b.state[a.name] ? "btn_disable" : "btn_enable"];
  15023. c = { scaytToggle: CKEDITOR.TRISTATE_OFF, scaytOptions: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, scaytLangs: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, scaytDict: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, scaytAbout: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED };
  15024. a.config.scayt_uiTabs[0] || delete c.scaytOptions;
  15025. a.config.scayt_uiTabs[1] || delete c.scaytLangs;
  15026. a.config.scayt_uiTabs[2] || delete c.scaytDict;
  15027. return c
  15028. }
  15029. });
  15030. if (a.contextMenu && a.addMenuItems) {
  15031. a.contextMenu.addListener(function() {
  15032. var b = a.scayt,
  15033. c;
  15034. if (b) {
  15035. var f = b.getSelectionNode();
  15036. if (f = f ? f.getAttribute(b.getNodeAttribute()) : f) {
  15037. c = e.menuGenerator(a, f, e);
  15038. b.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" ."))
  15039. }
  15040. }
  15041. return c
  15042. });
  15043. a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function(b) {
  15044. return function() {
  15045. var c = a.scayt;
  15046. c && c.hideBanner();
  15047. return b.apply(this)
  15048. }
  15049. })
  15050. }
  15051. },
  15052. addMenuItems: function(a) {
  15053. var e = this,
  15054. b = CKEDITOR.plugins.scayt;
  15055. a.addMenuGroup("scaytButton");
  15056. var g = a.config.scayt_contextMenuItemsOrder.split("|");
  15057. if (g && g.length)
  15058. for (var c = 0; c < g.length; c++) a.addMenuGroup("scayt_" + g[c], c - 10);
  15059. g = {
  15060. scaytToggle: {
  15061. label: a.lang.scayt.btn_enable,
  15062. group: "scaytButton",
  15063. onClick: function() {
  15064. var c = a.scayt;
  15065. b.state[a.name] = !b.state[a.name];
  15066. b.state[a.name] === true ? c || b.createScayt(a) : c && b.destroy(a)
  15067. }
  15068. },
  15069. scaytAbout: {
  15070. label: a.lang.scayt.btn_about,
  15071. group: "scaytButton",
  15072. onClick: function() {
  15073. a.scayt.tabToOpen =
  15074. "about";
  15075. a.lockSelection();
  15076. a.openDialog(e.dialogName)
  15077. }
  15078. },
  15079. scaytOptions: {
  15080. label: a.lang.scayt.btn_options,
  15081. group: "scaytButton",
  15082. onClick: function() {
  15083. a.scayt.tabToOpen = "options";
  15084. a.lockSelection();
  15085. a.openDialog(e.dialogName)
  15086. }
  15087. },
  15088. scaytLangs: {
  15089. label: a.lang.scayt.btn_langs,
  15090. group: "scaytButton",
  15091. onClick: function() {
  15092. a.scayt.tabToOpen = "langs";
  15093. a.lockSelection();
  15094. a.openDialog(e.dialogName)
  15095. }
  15096. },
  15097. scaytDict: {
  15098. label: a.lang.scayt.btn_dictionaries,
  15099. group: "scaytButton",
  15100. onClick: function() {
  15101. a.scayt.tabToOpen = "dictionaries";
  15102. a.lockSelection();
  15103. a.openDialog(e.dialogName)
  15104. }
  15105. }
  15106. };
  15107. if (a.plugins.wsc) g.WSC = {
  15108. label: a.lang.wsc.toolbar,
  15109. group: "scaytButton",
  15110. onClick: function() {
  15111. var b = CKEDITOR.plugins.scayt,
  15112. c = a.scayt,
  15113. f = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  15114. if (f = f.replace(/\s/g, "")) {
  15115. c && (b.state[a.name] && c.setMarkupPaused) && c.setMarkupPaused(true);
  15116. a.lockSelection();
  15117. a.execCommand("checkspell")
  15118. } else alert("Nothing to check!")
  15119. }
  15120. };
  15121. a.addMenuItems(g)
  15122. },
  15123. bindEvents: function(a) {
  15124. function e() {
  15125. var b = a.scayt;
  15126. if (b) {
  15127. b.removeMarkupInSelectionNode();
  15128. b.fire("startSpellCheck")
  15129. }
  15130. }
  15131. var b = CKEDITOR.plugins.scayt,
  15132. g = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE;
  15133. CKEDITOR.on("dialogDefinition", function(a) { if (a.data.name === "scaytDialog") a.data.definition.dialog.on("cancel", function() { return false }, this, null, -1) });
  15134. var c = function() { a.scayt && b.destroy(a) },
  15135. d = function() { b.state[a.name] && !a.readOnly && b.createScayt(a) },
  15136. j = function() {
  15137. var b = a.editable();
  15138. b.attachListener(b, "focus", function() {
  15139. var b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[a.name] && a.scayt,
  15140. c, d;
  15141. if ((g || b) && a._.savedSelection)
  15142. for (var b = a._.savedSelection.getSelectedElement(), b = !b && a._.savedSelection.getRanges(), f = 0; f < b.length; f++) {
  15143. d = b[f];
  15144. c = d.startContainer.getText().length;
  15145. (c < d.startOffset || c < d.endOffset) && a.unlockSelection(false)
  15146. }
  15147. }, this, null, -10)
  15148. },
  15149. f = function() {
  15150. if (g) {
  15151. a.on("blur", c);
  15152. a.on("focus", d);
  15153. a.focusManager.hasFocus && d()
  15154. } else d();
  15155. j()
  15156. };
  15157. a.on("contentDom", f);
  15158. a.on("beforeCommandExec", function(c) {
  15159. var d;
  15160. if (c.data.name in b.options.disablingCommandExec && a.mode == "wysiwyg") {
  15161. if (d = a.scayt) {
  15162. b.destroy(a);
  15163. a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)
  15164. }
  15165. } else if (c.data.name === "bold" || c.data.name === "italic" || c.data.name === "underline" || c.data.name === "strike" || c.data.name === "subscript" || c.data.name === "superscript")
  15166. if (d = a.scayt) {
  15167. d.removeMarkupInSelectionNode();
  15168. setTimeout(function() { d.fire("startSpellCheck") }, 0)
  15169. }
  15170. });
  15171. a.on("beforeSetMode", function(c) {
  15172. if (c.data == "source") {
  15173. if (c = a.scayt) {
  15174. b.destroy(a);
  15175. a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)
  15176. }
  15177. if (a.document) {
  15178. a.document.getBody().removeAttribute("_jquid");
  15179. a.document.getBody().removeAttribute("dir")
  15180. }
  15181. }
  15182. });
  15183. a.on("afterCommandExec", function(b) { var c; if (a.mode == "wysiwyg" && (b.data.name == "undo" || b.data.name == "redo"))(c = a.scayt) && setTimeout(function() { c.fire("startSpellCheck") }, 250) });
  15184. a.on("readOnly", function(c) {
  15185. var d;
  15186. if (c) {
  15187. d = a.scayt;
  15188. if (c.editor.readOnly === true) d && d.fire("removeMarkupInDocument", {});
  15189. else if (d) d.fire("startSpellCheck");
  15190. else if (c.editor.mode == "wysiwyg" && b.state[c.editor.name] === true) {
  15191. b.createScayt(a);
  15192. c.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)
  15193. }
  15194. }
  15195. });
  15196. a.on("beforeDestroy", c);
  15197. a.on("setData", function() {
  15198. c();
  15199. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && f()
  15200. }, this, null, 50);
  15201. a.on("insertElement", function() { CKEDITOR.env.ie ? setTimeout(function() { e() }, 50) : e() }, this, null, 50);
  15202. a.on("insertHtml", function() { e() }, this, null, 50);
  15203. a.on("insertText", function() { e() }, this, null, 50);
  15204. a.on("scaytDialogShown", function(b) { b.data.selectPage(a.scayt.tabToOpen) })
  15205. },
  15206. parseConfig: function(a) {
  15207. var e = CKEDITOR.plugins.scayt;
  15208. e.replaceOldOptionsNames(a.config);
  15209. if (typeof a.config.scayt_autoStartup !==
  15210. "boolean") a.config.scayt_autoStartup = false;
  15211. e.state[a.name] = a.config.scayt_autoStartup;
  15212. if (!a.config.scayt_contextCommands) a.config.scayt_contextCommands = "ignore|ignoreall|add";
  15213. if (!a.config.scayt_contextMenuItemsOrder) a.config.scayt_contextMenuItemsOrder = "suggest|moresuggest|control";
  15214. if (!a.config.scayt_sLang) a.config.scayt_sLang = "en_US";
  15215. if (a.config.scayt_maxSuggestions === void 0 || typeof a.config.scayt_maxSuggestions != "number" || a.config.scayt_maxSuggestions < 0) a.config.scayt_maxSuggestions = 5;
  15216. if (a.config.scayt_customDictionaryIds ===
  15217. void 0 || typeof a.config.scayt_customDictionaryIds !== "string") a.config.scayt_customDictionaryIds = "";
  15218. if (a.config.scayt_userDictionaryName === void 0 || typeof a.config.scayt_userDictionaryName !== "string") a.config.scayt_userDictionaryName = null;
  15219. if (typeof a.config.scayt_uiTabs === "string" && a.config.scayt_uiTabs.split(",").length === 3) {
  15220. var b = [],
  15221. g = [];
  15222. a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");
  15223. CKEDITOR.tools.search(a.config.scayt_uiTabs, function(a) {
  15224. if (Number(a) === 1 || Number(a) === 0) {
  15225. g.push(true);
  15226. b.push(Number(a))
  15227. } else g.push(false)
  15228. });
  15229. a.config.scayt_uiTabs = CKEDITOR.tools.search(g, false) === null ? b : [1, 1, 1]
  15230. } else a.config.scayt_uiTabs = [1, 1, 1];
  15231. if (typeof a.config.scayt_serviceProtocol != "string") a.config.scayt_serviceProtocol = null;
  15232. if (typeof a.config.scayt_serviceHost != "string") a.config.scayt_serviceHost = null;
  15233. if (typeof a.config.scayt_servicePort != "string") a.config.scayt_servicePort = null;
  15234. if (typeof a.config.scayt_servicePath != "string") a.config.scayt_servicePath = null;
  15235. if (!a.config.scayt_moreSuggestions) a.config.scayt_moreSuggestions = "on";
  15236. if (typeof a.config.scayt_customerId !==
  15237. "string") a.config.scayt_customerId = "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2";
  15238. if (typeof a.config.scayt_srcUrl !== "string") {
  15239. e = document.location.protocol;
  15240. e = e.search(/https?:/) != -1 ? e : "http:";
  15241. a.config.scayt_srcUrl = e + "//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js"
  15242. }
  15243. if (typeof CKEDITOR.config.scayt_handleCheckDirty !== "boolean") CKEDITOR.config.scayt_handleCheckDirty = true;
  15244. if (typeof CKEDITOR.config.scayt_handleUndoRedo !== "boolean") CKEDITOR.config.scayt_handleUndoRedo =
  15245. true;
  15246. if (a.config.scayt_disableOptionsStorage) {
  15247. var e = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ? a.config.scayt_disableOptionsStorage : typeof a.config.scayt_disableOptionsStorage === "string" ? [a.config.scayt_disableOptionsStorage] : void 0,
  15248. c = ["all", "options", "lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
  15249. d = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
  15250. j = CKEDITOR.tools.search,
  15251. f = CKEDITOR.tools.indexOf;
  15252. a.config.scayt_disableOptionsStorage = function(a) {
  15253. for (var b = [], e = 0; e < a.length; e++) {
  15254. var g = a[e],
  15255. o = !!j(a, "options");
  15256. if (!j(c, g) || o && j(d, function(a) { if (a === "lang") return false })) return;
  15257. j(d, g) && d.splice(f(d, g), 1);
  15258. if (g === "all" || o && j(a, "lang")) return [];
  15259. g === "options" && (d = ["lang"])
  15260. }
  15261. return b = b.concat(d)
  15262. }(e)
  15263. }
  15264. },
  15265. addRule: function(a) {
  15266. var e = a.dataProcessor,
  15267. b = e && e.htmlFilter,
  15268. g = a._.elementsPath && a._.elementsPath.filters,
  15269. e = e && e.dataFilter,
  15270. c = a.addRemoveFormatFilter,
  15271. d = function(b) {
  15272. var c =
  15273. CKEDITOR.plugins.scayt;
  15274. if (a.scayt && b.hasAttribute(c.options.data_attribute_name)) return false
  15275. },
  15276. j = function(b) {
  15277. var c = CKEDITOR.plugins.scayt,
  15278. d = true;
  15279. a.scayt && b.hasAttribute(c.options.data_attribute_name) && (d = false);
  15280. return d
  15281. };
  15282. g && g.push(d);
  15283. e && e.addRules({
  15284. elements: {
  15285. span: function(b) {
  15286. var c = CKEDITOR.plugins.scayt;
  15287. if (c && c.state[a.name] && b.classes && CKEDITOR.tools.search(b.classes, c.options.misspelled_word_class))
  15288. if (b.classes && b.parent.type === CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  15289. delete b.attributes.style;
  15290. delete b.name
  15291. } else delete b.classes[CKEDITOR.tools.indexOf(b.classes,
  15292. c.options.misspelled_word_class)];
  15293. return b
  15294. }
  15295. }
  15296. });
  15297. b && b.addRules({
  15298. elements: {
  15299. span: function(b) {
  15300. var c = CKEDITOR.plugins.scayt;
  15301. if (c && c.state[a.name] && b.hasClass(c.options.misspelled_word_class) && b.attributes[c.options.data_attribute_name]) {
  15302. b.removeClass(c.options.misspelled_word_class);
  15303. delete b.attributes[c.options.data_attribute_name];
  15304. delete b.name
  15305. }
  15306. return b
  15307. }
  15308. }
  15309. });
  15310. c && c.call(a, j)
  15311. },
  15312. scaytMenuDefinition: function(a) {
  15313. var e = this,
  15314. a = a.scayt;
  15315. return {
  15316. scayt_ignore: {
  15317. label: a.getLocal("btn_ignore"),
  15318. group: "scayt_control",
  15319. order: 1,
  15320. exec: function(a) { a.scayt.ignoreWord() }
  15321. },
  15322. scayt_ignoreall: { label: a.getLocal("btn_ignoreAll"), group: "scayt_control", order: 2, exec: function(a) { a.scayt.ignoreAllWords() } },
  15323. scayt_add: {
  15324. label: a.getLocal("btn_addWord"),
  15325. group: "scayt_control",
  15326. order: 3,
  15327. exec: function(a) {
  15328. var e = a.scayt;
  15329. setTimeout(function() { e.addWordToUserDictionary() }, 10)
  15330. }
  15331. },
  15332. option: {
  15333. label: a.getLocal("btn_options"),
  15334. group: "scayt_control",
  15335. order: 4,
  15336. exec: function(a) {
  15337. a.scayt.tabToOpen = "options";
  15338. a.lockSelection();
  15339. a.openDialog(e.dialogName)
  15340. },
  15341. verification: function(a) {
  15342. return a.config.scayt_uiTabs[0] ==
  15343. 1 ? true : false
  15344. }
  15345. },
  15346. language: {
  15347. label: a.getLocal("btn_langs"),
  15348. group: "scayt_control",
  15349. order: 5,
  15350. exec: function(a) {
  15351. a.scayt.tabToOpen = "langs";
  15352. a.lockSelection();
  15353. a.openDialog(e.dialogName)
  15354. },
  15355. verification: function(a) { return a.config.scayt_uiTabs[1] == 1 ? true : false }
  15356. },
  15357. dictionary: {
  15358. label: a.getLocal("btn_dictionaries"),
  15359. group: "scayt_control",
  15360. order: 6,
  15361. exec: function(a) {
  15362. a.scayt.tabToOpen = "dictionaries";
  15363. a.lockSelection();
  15364. a.openDialog(e.dialogName)
  15365. },
  15366. verification: function(a) { return a.config.scayt_uiTabs[2] == 1 ? true : false }
  15367. },
  15368. about: {
  15369. label: a.getLocal("btn_about"),
  15370. group: "scayt_control",
  15371. order: 7,
  15372. exec: function(a) {
  15373. a.scayt.tabToOpen = "about";
  15374. a.lockSelection();
  15375. a.openDialog(e.dialogName)
  15376. }
  15377. }
  15378. }
  15379. },
  15380. buildSuggestionMenuItems: function(a, e) {
  15381. var b = {},
  15382. g = {},
  15383. c = a.scayt;
  15384. if (e.length > 0 && e[0] !== "no_any_suggestions")
  15385. for (var d = 0; d < e.length; d++) {
  15386. var j = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_");
  15387. a.addCommand(j, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d]));
  15388. if (d < a.config.scayt_maxSuggestions) {
  15389. a.addMenuItem(j, {
  15390. label: e[d],
  15391. command: j,
  15392. group: "scayt_suggest",
  15393. order: d + 1
  15394. });
  15395. b[j] = CKEDITOR.TRISTATE_OFF
  15396. } else {
  15397. a.addMenuItem(j, { label: e[d], command: j, group: "scayt_moresuggest", order: d + 1 });
  15398. g[j] = CKEDITOR.TRISTATE_OFF;
  15399. if (a.config.scayt_moreSuggestions === "on") {
  15400. a.addMenuItem("scayt_moresuggest", { label: c.getLocal("btn_moreSuggestions"), group: "scayt_moresuggest", order: 10, getItems: function() { return g } });
  15401. b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF
  15402. }
  15403. }
  15404. } else {
  15405. b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED;
  15406. a.addCommand("no_scayt_suggest", { exec: function() {} });
  15407. a.addMenuItem("no_scayt_suggest", { label: c.getLocal("btn_noSuggestions") || "no_scayt_suggest", command: "no_scayt_suggest", group: "scayt_suggest", order: 0 })
  15408. }
  15409. return b
  15410. },
  15411. menuGenerator: function(a, e) {
  15412. var b = a.scayt,
  15413. g = this.scaytMenuDefinition(a),
  15414. c = {},
  15415. d = a.config.scayt_contextCommands.split("|");
  15416. b.fire("getSuggestionsList", { lang: b.getLang(), word: e });
  15417. c = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions);
  15418. if (a.config.scayt_contextCommands == "off") return c;
  15419. for (var j in g)
  15420. if (!(CKEDITOR.tools.indexOf(d, j.replace("scayt_", "")) == -1 && a.config.scayt_contextCommands !=
  15421. "all")) {
  15422. c[j] = CKEDITOR.TRISTATE_OFF;
  15423. typeof g[j].verification === "function" && !g[j].verification(a) && delete c[j];
  15424. a.addCommand(j, { exec: g[j].exec });
  15425. a.addMenuItem(j, { label: a.lang.scayt[g[j].label] || g[j].label, command: j, group: g[j].group, order: g[j].order })
  15426. }
  15427. return c
  15428. },
  15429. createCommand: function(a) { return { exec: function(e) { e.scayt.replaceSelectionNode({ word: a }) } } }
  15430. }), CKEDITOR.plugins.scayt = {
  15431. state: {},
  15432. suggestions: [],
  15433. loadingHelper: { loadOrder: [] },
  15434. isLoading: !1,
  15435. options: {
  15436. disablingCommandExec: { source: !0, newpage: !0, templates: !0 },
  15437. data_attribute_name: "data-scayt-word",
  15438. misspelled_word_class: "scayt-misspell-word"
  15439. },
  15440. backCompatibilityMap: { scayt_service_protocol: "scayt_serviceProtocol", scayt_service_host: "scayt_serviceHost", scayt_service_port: "scayt_servicePort", scayt_service_path: "scayt_servicePath", scayt_customerid: "scayt_customerId" },
  15441. replaceOldOptionsNames: function(a) {
  15442. for (var e in a)
  15443. if (e in this.backCompatibilityMap) {
  15444. a[this.backCompatibilityMap[e]] = a[e];
  15445. delete a[e]
  15446. }
  15447. },
  15448. createScayt: function(a) {
  15449. var e = this;
  15450. this.loadScaytLibrary(a,
  15451. function(a) {
  15452. var g = {
  15453. lang: a.config.scayt_sLang,
  15454. container: a.editable().$.nodeName == "BODY" ? a.document.getWindow().$.frameElement : a.editable().$,
  15455. customDictionary: a.config.scayt_customDictionaryIds,
  15456. userDictionaryName: a.config.scayt_userDictionaryName,
  15457. localization: a.langCode,
  15458. customer_id: a.config.scayt_customerId,
  15459. debug: a.config.scayt_debug,
  15460. data_attribute_name: e.options.data_attribute_name,
  15461. misspelled_word_class: e.options.misspelled_word_class,
  15462. "options-to-restore": a.config.scayt_disableOptionsStorage,
  15463. focused: a.editable().hasFocus,
  15464. ignoreElementsRegex: a.config.scayt_elementsToIgnore
  15465. };
  15466. if (a.config.scayt_serviceProtocol) g.service_protocol = a.config.scayt_serviceProtocol;
  15467. if (a.config.scayt_serviceHost) g.service_host = a.config.scayt_serviceHost;
  15468. if (a.config.scayt_servicePort) g.service_port = a.config.scayt_servicePort;
  15469. if (a.config.scayt_servicePath) g.service_path = a.config.scayt_servicePath;
  15470. g = new SCAYT.CKSCAYT(g, function() {}, function() {});
  15471. g.subscribe("suggestionListSend", function(a) {
  15472. for (var b = {}, e = [], f = 0; f < a.suggestionList.length; f++)
  15473. if (!b["word_" +
  15474. a.suggestionList[f]]) {
  15475. b["word_" + a.suggestionList[f]] = a.suggestionList[f];
  15476. e.push(a.suggestionList[f])
  15477. }
  15478. CKEDITOR.plugins.scayt.suggestions = e
  15479. });
  15480. a.scayt = g;
  15481. a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON)
  15482. })
  15483. },
  15484. destroy: function(a) {
  15485. a.scayt && a.scayt.destroy();
  15486. delete a.scayt;
  15487. a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF)
  15488. },
  15489. loadScaytLibrary: function(a, e) {
  15490. var b = this;
  15491. if (typeof window.SCAYT === "undefined" || typeof window.SCAYT.CKSCAYT !== "function") {
  15492. this.loadingHelper[a.name] = e;
  15493. this.loadingHelper.loadOrder.push(a.name);
  15494. CKEDITOR.scriptLoader.load(a.config.scayt_srcUrl, function() {
  15495. var a;
  15496. CKEDITOR.fireOnce("scaytReady");
  15497. for (var c = 0; c < b.loadingHelper.loadOrder.length; c++) {
  15498. a = b.loadingHelper.loadOrder[c];
  15499. if (typeof b.loadingHelper[a] === "function") b.loadingHelper[a](CKEDITOR.instances[a]);
  15500. delete b.loadingHelper[a]
  15501. }
  15502. b.loadingHelper.loadOrder = []
  15503. })
  15504. } else if (window.SCAYT && typeof window.SCAYT.CKSCAYT === "function") {
  15505. CKEDITOR.fireOnce("scaytReady");
  15506. a.scayt || typeof e === "function" && e(a)
  15507. }
  15508. }
  15509. }, CKEDITOR.on("scaytReady",
  15510. function() {
  15511. if (CKEDITOR.config.scayt_handleCheckDirty === true) {
  15512. var a = CKEDITOR.editor.prototype;
  15513. a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function(a) {
  15514. return function() {
  15515. var e = null,
  15516. c = this.scayt;
  15517. if (!CKEDITOR.plugins.scayt || !CKEDITOR.plugins.scayt.state[this.name] || !this.scayt) e = a.call(this);
  15518. else if (e = this.status == "ready") var d = c.removeMarkupFromString(this.getSnapshot()),
  15519. c = c.removeMarkupFromString(this._.previousValue),
  15520. e = e && c !== d;
  15521. return e
  15522. }
  15523. });
  15524. a.resetDirty = CKEDITOR.tools.override(a.resetDirty, function(a) {
  15525. return function() {
  15526. var e =
  15527. this.scayt;
  15528. !CKEDITOR.plugins.scayt || !CKEDITOR.plugins.scayt.state[this.name] || !this.scayt ? a.call(this) : this._.previousValue = e.removeMarkupFromString(this.getSnapshot())
  15529. }
  15530. })
  15531. }
  15532. if (CKEDITOR.config.scayt_handleUndoRedo === true) {
  15533. var a = CKEDITOR.plugins.undo.Image.prototype,
  15534. e = typeof a.equalsContent == "function" ? "equalsContent" : "equals";
  15535. a[e] = CKEDITOR.tools.override(a[e], function(a) {
  15536. return function(e) {
  15537. var c = e.editor.scayt,
  15538. d = this.contents,
  15539. j = e.contents,
  15540. f = null;
  15541. if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[e.editor.name] &&
  15542. e.editor.scayt) {
  15543. this.contents = c.removeMarkupFromString(d) || "";
  15544. e.contents = c.removeMarkupFromString(j) || ""
  15545. }
  15546. f = a.apply(this, arguments);
  15547. this.contents = d;
  15548. e.contents = j;
  15549. return f
  15550. }
  15551. })
  15552. }
  15553. }),
  15554. function() {
  15555. var a = {
  15556. preserveState: true,
  15557. editorFocus: false,
  15558. readOnly: 1,
  15559. exec: function(a) {
  15560. this.toggleState();
  15561. this.refresh(a)
  15562. },
  15563. refresh: function(a) {
  15564. if (a.document) {
  15565. var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass";
  15566. a.editable()[b]("cke_show_borders")
  15567. }
  15568. }
  15569. };
  15570. CKEDITOR.plugins.add("showborders", {
  15571. modes: { wysiwyg: 1 },
  15572. onLoad: function() {
  15573. var a;
  15574. a = (CKEDITOR.env.ie6Compat ? [".%1 table.%2,", ".%1 table.%2 td, .%1 table.%2 th", "{", "border : #d3d3d3 1px dotted", "}"] : [".%1 table.%2,", ".%1 table.%2 > tr > td, .%1 table.%2 > tr > th,", ".%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,", ".%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,", ".%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th", "{", "border : #d3d3d3 1px dotted", "}"]).join("").replace(/%2/g, "cke_show_border").replace(/%1/g, "cke_show_borders ");
  15575. CKEDITOR.addCss(a)
  15576. },
  15577. init: function(e) {
  15578. var b = e.addCommand("showborders", a);
  15579. b.canUndo = false;
  15580. e.config.startupShowBorders !== false && b.setState(CKEDITOR.TRISTATE_ON);
  15581. e.on("mode", function() { b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(e) }, null, null, 100);
  15582. e.on("contentDom", function() { b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(e) });
  15583. e.on("removeFormatCleanup", function(a) {
  15584. a = a.data;
  15585. e.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && (a.is("table") && (!a.hasAttribute("border") || parseInt(a.getAttribute("border"), 10) <= 0)) &&
  15586. a.addClass("cke_show_border")
  15587. })
  15588. },
  15589. afterInit: function(a) {
  15590. var b = a.dataProcessor,
  15591. a = b && b.dataFilter,
  15592. b = b && b.htmlFilter;
  15593. a && a.addRules({
  15594. elements: {
  15595. table: function(a) {
  15596. var a = a.attributes,
  15597. b = a["class"],
  15598. d = parseInt(a.border, 10);
  15599. if ((!d || d <= 0) && (!b || b.indexOf("cke_show_border") == -1)) a["class"] = (b || "") + " cke_show_border"
  15600. }
  15601. }
  15602. });
  15603. b && b.addRules({
  15604. elements: {
  15605. table: function(a) {
  15606. var a = a.attributes,
  15607. b = a["class"];
  15608. b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(/^\s+|\s+$/, ""))
  15609. }
  15610. }
  15611. })
  15612. }
  15613. });
  15614. CKEDITOR.on("dialogDefinition",
  15615. function(a) {
  15616. var b = a.data.name;
  15617. if (b == "table" || b == "tableProperties") {
  15618. a = a.data.definition;
  15619. b = a.getContents("info").get("txtBorder");
  15620. b.commit = CKEDITOR.tools.override(b.commit, function(a) {
  15621. return function(b, d) {
  15622. a.apply(this, arguments);
  15623. var e = parseInt(this.getValue(), 10);
  15624. d[!e || e <= 0 ? "addClass" : "removeClass"]("cke_show_border")
  15625. }
  15626. });
  15627. if (a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) {
  15628. a.setup = CKEDITOR.tools.override(a.setup, function(a) {
  15629. return function() {
  15630. a.apply(this, arguments);
  15631. this.setValue(this.getValue().replace(/cke_show_border/,
  15632. ""))
  15633. }
  15634. });
  15635. a.commit = CKEDITOR.tools.override(a.commit, function(a) {
  15636. return function(b, d) {
  15637. a.apply(this, arguments);
  15638. parseInt(d.getAttribute("border"), 10) || d.addClass("cke_show_border")
  15639. }
  15640. })
  15641. }
  15642. }
  15643. })
  15644. }(),
  15645. function() {
  15646. CKEDITOR.plugins.add("sourcearea", {
  15647. init: function(e) {
  15648. function b() {
  15649. var a = c && this.equals(CKEDITOR.document.getActive());
  15650. this.hide();
  15651. this.setStyle("height", this.getParent().$.clientHeight + "px");
  15652. this.setStyle("width", this.getParent().$.clientWidth + "px");
  15653. this.show();
  15654. a && this.focus()
  15655. }
  15656. if (e.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  15657. var g =
  15658. CKEDITOR.plugins.sourcearea;
  15659. e.addMode("source", function(c) {
  15660. var g = e.ui.space("contents").getDocument().createElement("textarea");
  15661. g.setStyles(CKEDITOR.tools.extend({ width: CKEDITOR.env.ie7Compat ? "99%" : "100%", height: "100%", resize: "none", outline: "none", "text-align": "left" }, CKEDITOR.tools.cssVendorPrefix("tab-size", e.config.sourceAreaTabSize || 4)));
  15662. g.setAttribute("dir", "ltr");
  15663. g.addClass("cke_source cke_reset cke_enable_context_menu");
  15664. e.ui.space("contents").append(g);
  15665. g = e.editable(new a(e, g));
  15666. g.setData(e.getData(1));
  15667. if (CKEDITOR.env.ie) {
  15668. g.attachListener(e, "resize", b, g);
  15669. g.attachListener(CKEDITOR.document.getWindow(), "resize", b, g);
  15670. CKEDITOR.tools.setTimeout(b, 0, g)
  15671. }
  15672. e.fire("ariaWidget", this);
  15673. c()
  15674. });
  15675. e.addCommand("source", g.commands.source);
  15676. e.ui.addButton && e.ui.addButton("Source", { label: e.lang.sourcearea.toolbar, command: "source", toolbar: "mode,10" });
  15677. e.on("mode", function() { e.getCommand("source").setState(e.mode == "source" ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) });
  15678. var c = CKEDITOR.env.ie && CKEDITOR.env.version == 9
  15679. }
  15680. }
  15681. });
  15682. var a =
  15683. CKEDITOR.tools.createClass({
  15684. base: CKEDITOR.editable,
  15685. proto: {
  15686. setData: function(a) {
  15687. this.setValue(a);
  15688. this.status = "ready";
  15689. this.editor.fire("dataReady")
  15690. },
  15691. getData: function() { return this.getValue() },
  15692. insertHtml: function() {},
  15693. insertElement: function() {},
  15694. insertText: function() {},
  15695. setReadOnly: function(a) { this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly") },
  15696. detach: function() {
  15697. a.baseProto.detach.call(this);
  15698. this.clearCustomData();
  15699. this.remove()
  15700. }
  15701. }
  15702. })
  15703. }(), CKEDITOR.plugins.sourcearea = {
  15704. commands: {
  15705. source: {
  15706. modes: {
  15707. wysiwyg: 1,
  15708. source: 1
  15709. },
  15710. editorFocus: !1,
  15711. readOnly: 1,
  15712. exec: function(a) {
  15713. a.mode == "wysiwyg" && a.fire("saveSnapshot");
  15714. a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
  15715. a.setMode(a.mode == "source" ? "wysiwyg" : "source")
  15716. },
  15717. canUndo: !1
  15718. }
  15719. }
  15720. }, CKEDITOR.plugins.add("specialchar", {
  15721. availableLangs: {
  15722. af: 1,
  15723. ar: 1,
  15724. bg: 1,
  15725. ca: 1,
  15726. cs: 1,
  15727. cy: 1,
  15728. da: 1,
  15729. de: 1,
  15730. el: 1,
  15731. en: 1,
  15732. "en-gb": 1,
  15733. eo: 1,
  15734. es: 1,
  15735. et: 1,
  15736. fa: 1,
  15737. fi: 1,
  15738. fr: 1,
  15739. "fr-ca": 1,
  15740. gl: 1,
  15741. he: 1,
  15742. hr: 1,
  15743. hu: 1,
  15744. id: 1,
  15745. it: 1,
  15746. ja: 1,
  15747. km: 1,
  15748. ku: 1,
  15749. lt: 1,
  15750. lv: 1,
  15751. nb: 1,
  15752. nl: 1,
  15753. no: 1,
  15754. pl: 1,
  15755. pt: 1,
  15756. "pt-br": 1,
  15757. ru: 1,
  15758. si: 1,
  15759. sk: 1,
  15760. sl: 1,
  15761. sq: 1,
  15762. sv: 1,
  15763. th: 1,
  15764. tr: 1,
  15765. tt: 1,
  15766. ug: 1,
  15767. uk: 1,
  15768. vi: 1,
  15769. zh: 1,
  15770. "zh-cn": 1
  15771. },
  15772. requires: "dialog",
  15773. init: function(a) {
  15774. var e = this;
  15775. CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js");
  15776. a.addCommand("specialchar", {
  15777. exec: function() {
  15778. var b = a.langCode,
  15779. b = e.availableLangs[b] ? b : e.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  15780. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e.path + "dialogs/lang/" + b + ".js"), function() {
  15781. CKEDITOR.tools.extend(a.lang.specialchar, e.langEntries[b]);
  15782. a.openDialog("specialchar")
  15783. })
  15784. },
  15785. modes: { wysiwyg: 1 },
  15786. canUndo: false
  15787. });
  15788. a.ui.addButton && a.ui.addButton("SpecialChar", { label: a.lang.specialchar.toolbar, command: "specialchar", toolbar: "insert,50" })
  15789. }
  15790. }), CKEDITOR.config.specialChars = "! &quot; # $ % &amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ &euro; &lsquo; &rsquo; &ldquo; &rdquo; &ndash; &mdash; &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml; &copy; &ordf; &laquo; &not; &reg; &macr; &deg; &sup2; &sup3; &acute; &micro; &para; &middot; &cedil; &sup1; &ordm; &raquo; &frac14; &frac12; &frac34; &iquest; &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &times; &Oslash; &Ugrave; &Uacute; &Ucirc; &Uuml; &Yacute; &THORN; &szlig; &agrave; &aacute; &acirc; &atilde; &auml; &aring; &aelig; &ccedil; &egrave; &eacute; &ecirc; &euml; &igrave; &iacute; &icirc; &iuml; &eth; &ntilde; &ograve; &oacute; &ocirc; &otilde; &ouml; &divide; &oslash; &ugrave; &uacute; &ucirc; &uuml; &yacute; &thorn; &yuml; &OElig; &oelig; &#372; &#374 &#373 &#375; &sbquo; &#8219; &bdquo; &hellip; &trade; &#9658; &bull; &rarr; &rArr; &hArr; &diams; &asymp;".split(" "),
  15791. function() {
  15792. CKEDITOR.plugins.add("stylescombo", {
  15793. requires: "richcombo",
  15794. init: function(a) {
  15795. var e = a.config,
  15796. b = a.lang.stylescombo,
  15797. g = {},
  15798. c = [],
  15799. d = [];
  15800. a.on("stylesSet", function(b) {
  15801. if (b = b.data.styles) {
  15802. for (var f, h, i, k = 0, n = b.length; k < n; k++) {
  15803. f = b[k];
  15804. if (!(a.blockless && f.element in CKEDITOR.dtd.$block)) {
  15805. h = f.name;
  15806. f = new CKEDITOR.style(f);
  15807. if (!a.filter.customConfig || a.filter.check(f)) {
  15808. f._name = h;
  15809. f._.enterMode = e.enterMode;
  15810. f._.type = i = f.assignedTo || f.type;
  15811. f._.weight = k + (i == CKEDITOR.STYLE_OBJECT ? 1 : i == CKEDITOR.STYLE_BLOCK ? 2 : 3) * 1E3;
  15812. g[h] = f;
  15813. c.push(f);
  15814. d.push(f)
  15815. }
  15816. }
  15817. }
  15818. c.sort(function(a, b) { return a._.weight - b._.weight })
  15819. }
  15820. });
  15821. a.ui.addRichCombo("Styles", {
  15822. label: b.label,
  15823. title: b.panelTitle,
  15824. toolbar: "styles,10",
  15825. allowedContent: d,
  15826. panel: { css: [CKEDITOR.skin.getPath("editor")].concat(e.contentsCss), multiSelect: true, attributes: { "aria-label": b.panelTitle } },
  15827. init: function() {
  15828. var a, d, e, g, k, n;
  15829. k = 0;
  15830. for (n = c.length; k < n; k++) {
  15831. a = c[k];
  15832. d = a._name;
  15833. g = a._.type;
  15834. if (g != e) {
  15835. this.startGroup(b["panelTitle" + g]);
  15836. e = g
  15837. }
  15838. this.add(d, a.type == CKEDITOR.STYLE_OBJECT ? d : a.buildPreview(),
  15839. d)
  15840. }
  15841. this.commit()
  15842. },
  15843. onClick: function(b) {
  15844. a.focus();
  15845. a.fire("saveSnapshot");
  15846. var b = g[b],
  15847. c = a.elementPath();
  15848. a[b.checkActive(c, a) ? "removeStyle" : "applyStyle"](b);
  15849. a.fire("saveSnapshot")
  15850. },
  15851. onRender: function() {
  15852. a.on("selectionChange", function(b) {
  15853. for (var c = this.getValue(), b = b.data.path.elements, d = 0, e = b.length, k; d < e; d++) {
  15854. k = b[d];
  15855. for (var n in g)
  15856. if (g[n].checkElementRemovable(k, true, a)) { n != c && this.setValue(n); return }
  15857. }
  15858. this.setValue("")
  15859. }, this)
  15860. },
  15861. onOpen: function() {
  15862. var c = a.getSelection().getSelectedElement(),
  15863. c = a.elementPath(c),
  15864. d = [0, 0, 0, 0];
  15865. this.showAll();
  15866. this.unmarkAll();
  15867. for (var e in g) {
  15868. var i = g[e],
  15869. k = i._.type;
  15870. i.checkApplicable(c, a, a.activeFilter) ? d[k]++ : this.hideItem(e);
  15871. i.checkActive(c, a) && this.mark(e)
  15872. }
  15873. d[CKEDITOR.STYLE_BLOCK] || this.hideGroup(b["panelTitle" + CKEDITOR.STYLE_BLOCK]);
  15874. d[CKEDITOR.STYLE_INLINE] || this.hideGroup(b["panelTitle" + CKEDITOR.STYLE_INLINE]);
  15875. d[CKEDITOR.STYLE_OBJECT] || this.hideGroup(b["panelTitle" + CKEDITOR.STYLE_OBJECT])
  15876. },
  15877. refresh: function() {
  15878. var b = a.elementPath();
  15879. if (b) {
  15880. for (var c in g)
  15881. if (g[c].checkApplicable(b,
  15882. a, a.activeFilter)) return;
  15883. this.setState(CKEDITOR.TRISTATE_DISABLED)
  15884. }
  15885. },
  15886. reset: function() {
  15887. g = {};
  15888. c = []
  15889. }
  15890. })
  15891. }
  15892. })
  15893. }(),
  15894. function() {
  15895. function a(a) {
  15896. return {
  15897. editorFocus: false,
  15898. canUndo: false,
  15899. modes: { wysiwyg: 1 },
  15900. exec: function(b) {
  15901. if (b.editable().hasFocus) {
  15902. var e = b.getSelection(),
  15903. f;
  15904. if (f = (new CKEDITOR.dom.elementPath(e.getCommonAncestor(), e.root)).contains({ td: 1, th: 1 }, 1)) {
  15905. var e = b.createRange(),
  15906. g = CKEDITOR.tools.tryThese(function() {
  15907. var b = f.getParent().$.cells[f.$.cellIndex + (a ? -1 : 1)];
  15908. b.parentNode.parentNode;
  15909. return b
  15910. }, function() {
  15911. var b =
  15912. f.getParent(),
  15913. b = b.getAscendant("table").$.rows[b.$.rowIndex + (a ? -1 : 1)];
  15914. return b.cells[a ? b.cells.length - 1 : 0]
  15915. });
  15916. if (!g && !a) {
  15917. for (var i = f.getAscendant("table").$, g = f.getParent().$.cells, i = new CKEDITOR.dom.element(i.insertRow(-1), b.document), k = 0, n = g.length; k < n; k++) i.append((new CKEDITOR.dom.element(g[k], b.document)).clone(false, false)).appendBogus();
  15918. e.moveToElementEditStart(i)
  15919. } else if (g) {
  15920. g = new CKEDITOR.dom.element(g);
  15921. e.moveToElementEditStart(g);
  15922. (!e.checkStartOfBlock() || !e.checkEndOfBlock()) && e.selectNodeContents(g)
  15923. } else return true;
  15924. e.select(true);
  15925. return true
  15926. }
  15927. }
  15928. return false
  15929. }
  15930. }
  15931. }
  15932. var e = { editorFocus: false, modes: { wysiwyg: 1, source: 1 } },
  15933. b = { exec: function(a) { a.container.focusNext(true, a.tabIndex) } },
  15934. g = { exec: function(a) { a.container.focusPrevious(true, a.tabIndex) } };
  15935. CKEDITOR.plugins.add("tab", {
  15936. init: function(c) {
  15937. for (var d = c.config.enableTabKeyTools !== false, j = c.config.tabSpaces || 0, f = ""; j--;) f = f + " ";
  15938. if (f) c.on("key", function(a) {
  15939. if (a.data.keyCode == 9) {
  15940. c.insertText(f);
  15941. a.cancel()
  15942. }
  15943. });
  15944. if (d) c.on("key", function(a) {
  15945. (a.data.keyCode == 9 && c.execCommand("selectNextCell") ||
  15946. a.data.keyCode == CKEDITOR.SHIFT + 9 && c.execCommand("selectPreviousCell")) && a.cancel()
  15947. });
  15948. c.addCommand("blur", CKEDITOR.tools.extend(b, e));
  15949. c.addCommand("blurBack", CKEDITOR.tools.extend(g, e));
  15950. c.addCommand("selectNextCell", a());
  15951. c.addCommand("selectPreviousCell", a(true))
  15952. }
  15953. })
  15954. }(), CKEDITOR.dom.element.prototype.focusNext = function(a, e) {
  15955. var b = e === void 0 ? this.getTabIndex() : e,
  15956. g, c, d, j, f, h;
  15957. if (b <= 0)
  15958. for (f = this.getNextSourceNode(a, CKEDITOR.NODE_ELEMENT); f;) {
  15959. if (f.isVisible() && f.getTabIndex() === 0) { d = f; break }
  15960. f = f.getNextSourceNode(false,
  15961. CKEDITOR.NODE_ELEMENT)
  15962. } else
  15963. for (f = this.getDocument().getBody().getFirst(); f = f.getNextSourceNode(false, CKEDITOR.NODE_ELEMENT);) {
  15964. if (!g)
  15965. if (!c && f.equals(this)) {
  15966. c = true;
  15967. if (a) {
  15968. if (!(f = f.getNextSourceNode(true, CKEDITOR.NODE_ELEMENT))) break;
  15969. g = 1
  15970. }
  15971. } else c && !this.contains(f) && (g = 1);
  15972. if (f.isVisible() && !((h = f.getTabIndex()) < 0)) {
  15973. if (g && h == b) { d = f; break }
  15974. if (h > b && (!d || !j || h < j)) {
  15975. d = f;
  15976. j = h
  15977. } else if (!d && h === 0) {
  15978. d = f;
  15979. j = h
  15980. }
  15981. }
  15982. }
  15983. d && d.focus()
  15984. }, CKEDITOR.dom.element.prototype.focusPrevious = function(a, e) {
  15985. for (var b = e === void 0 ? this.getTabIndex() :
  15986. e, g, c, d, j = 0, f, h = this.getDocument().getBody().getLast(); h = h.getPreviousSourceNode(false, CKEDITOR.NODE_ELEMENT);) {
  15987. if (!g)
  15988. if (!c && h.equals(this)) {
  15989. c = true;
  15990. if (a) {
  15991. if (!(h = h.getPreviousSourceNode(true, CKEDITOR.NODE_ELEMENT))) break;
  15992. g = 1
  15993. }
  15994. } else c && !this.contains(h) && (g = 1);
  15995. if (h.isVisible() && !((f = h.getTabIndex()) < 0))
  15996. if (b <= 0) {
  15997. if (g && f === 0) { d = h; break }
  15998. if (f > j) {
  15999. d = h;
  16000. j = f
  16001. }
  16002. } else {
  16003. if (g && f == b) { d = h; break }
  16004. if (f < b && (!d || f > j)) {
  16005. d = h;
  16006. j = f
  16007. }
  16008. }
  16009. }
  16010. d && d.focus()
  16011. }, CKEDITOR.plugins.add("table", {
  16012. requires: "dialog",
  16013. init: function(a) {
  16014. function e(a) {
  16015. return CKEDITOR.tools.extend(a || {}, { contextSensitive: 1, refresh: function(a, b) { this.setState(b.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED) } })
  16016. }
  16017. if (!a.blockless) {
  16018. var b = a.lang.table;
  16019. a.addCommand("table", new CKEDITOR.dialogCommand("table", {
  16020. context: "table",
  16021. allowedContent: "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];" + (a.plugins.dialogadvtab ? "table" + a.plugins.dialogadvtab.allowedContent() : ""),
  16022. requiredContent: "table",
  16023. contentTransformations: [
  16024. ["table{width}: sizeToStyle",
  16025. "table[width]: sizeToAttribute"
  16026. ]
  16027. ]
  16028. }));
  16029. a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", e()));
  16030. a.addCommand("tableDelete", e({
  16031. exec: function(a) {
  16032. var b = a.elementPath().contains("table", 1);
  16033. if (b) {
  16034. var d = b.getParent(),
  16035. e = a.editable();
  16036. d.getChildCount() == 1 && (!d.is("td", "th") && !d.equals(e)) && (b = d);
  16037. a = a.createRange();
  16038. a.moveToPosition(b, CKEDITOR.POSITION_BEFORE_START);
  16039. b.remove();
  16040. a.select()
  16041. }
  16042. }
  16043. }));
  16044. a.ui.addButton && a.ui.addButton("Table", { label: b.toolbar, command: "table", toolbar: "insert,30" });
  16045. CKEDITOR.dialog.add("table", this.path + "dialogs/table.js");
  16046. CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js");
  16047. a.addMenuItems && a.addMenuItems({ table: { label: b.menu, command: "tableProperties", group: "table", order: 5 }, tabledelete: { label: b.deleteTable, command: "tableDelete", group: "table", order: 1 } });
  16048. a.on("doubleclick", function(a) { if (a.data.element.is("table")) a.data.dialog = "tableProperties" });
  16049. a.contextMenu && a.contextMenu.addListener(function() { return { tabledelete: CKEDITOR.TRISTATE_OFF, table: CKEDITOR.TRISTATE_OFF } })
  16050. }
  16051. }
  16052. }),
  16053. function() {
  16054. function a(a) {
  16055. function b(a) {
  16056. if (!(c.length > 0) && a.type == CKEDITOR.NODE_ELEMENT && o.test(a.getName()) && !a.getCustomData("selected_cell")) {
  16057. CKEDITOR.dom.element.setMarker(d, a, "selected_cell", true);
  16058. c.push(a)
  16059. }
  16060. }
  16061. for (var a = a.getRanges(), c = [], d = {}, f = 0; f < a.length; f++) {
  16062. var e = a[f];
  16063. if (e.collapsed) {
  16064. e = e.getCommonAncestor();
  16065. (e = e.getAscendant("td", true) || e.getAscendant("th", true)) && c.push(e)
  16066. } else {
  16067. var e = new CKEDITOR.dom.walker(e),
  16068. g;
  16069. for (e.guard = b; g = e.next();)
  16070. if (g.type != CKEDITOR.NODE_ELEMENT || !g.is(CKEDITOR.dtd.table))
  16071. if ((g =
  16072. g.getAscendant("td", true) || g.getAscendant("th", true)) && !g.getCustomData("selected_cell")) {
  16073. CKEDITOR.dom.element.setMarker(d, g, "selected_cell", true);
  16074. c.push(g)
  16075. }
  16076. }
  16077. }
  16078. CKEDITOR.dom.element.clearAllMarkers(d);
  16079. return c
  16080. }
  16081. function e(b, c) {
  16082. for (var d = a(b), f = d[0], e = f.getAscendant("table"), f = f.getDocument(), g = d[0].getParent(), h = g.$.rowIndex, d = d[d.length - 1], i = d.getParent().$.rowIndex + d.$.rowSpan - 1, d = new CKEDITOR.dom.element(e.$.rows[i]), h = c ? h : i, g = c ? g : d, d = CKEDITOR.tools.buildTableMap(e), e = d[h], h = c ? d[h - 1] : d[h + 1], d = d[0].length,
  16083. f = f.createElement("tr"), i = 0; e[i] && i < d; i++) {
  16084. var j;
  16085. if (e[i].rowSpan > 1 && h && e[i] == h[i]) {
  16086. j = e[i];
  16087. j.rowSpan = j.rowSpan + 1
  16088. } else {
  16089. j = (new CKEDITOR.dom.element(e[i])).clone();
  16090. j.removeAttribute("rowSpan");
  16091. j.appendBogus();
  16092. f.append(j);
  16093. j = j.$
  16094. }
  16095. i = i + (j.colSpan - 1)
  16096. }
  16097. c ? f.insertBefore(g) : f.insertAfter(g)
  16098. }
  16099. function b(c) {
  16100. if (c instanceof CKEDITOR.dom.selection) {
  16101. for (var d = a(c), f = d[0].getAscendant("table"), e = CKEDITOR.tools.buildTableMap(f), c = d[0].getParent().$.rowIndex, d = d[d.length - 1], g = d.getParent().$.rowIndex + d.$.rowSpan - 1, d = [],
  16102. h = c; h <= g; h++) {
  16103. for (var i = e[h], j = new CKEDITOR.dom.element(f.$.rows[h]), k = 0; k < i.length; k++) {
  16104. var n = new CKEDITOR.dom.element(i[k]),
  16105. o = n.getParent().$.rowIndex;
  16106. if (n.$.rowSpan == 1) n.remove();
  16107. else {
  16108. n.$.rowSpan = n.$.rowSpan - 1;
  16109. if (o == h) {
  16110. o = e[h + 1];
  16111. o[k - 1] ? n.insertAfter(new CKEDITOR.dom.element(o[k - 1])) : (new CKEDITOR.dom.element(f.$.rows[h + 1])).append(n, 1)
  16112. }
  16113. }
  16114. k = k + (n.$.colSpan - 1)
  16115. }
  16116. d.push(j)
  16117. }
  16118. e = f.$.rows;
  16119. f = new CKEDITOR.dom.element(e[g + 1] || (c > 0 ? e[c - 1] : null) || f.$.parentNode);
  16120. for (h = d.length; h >= 0; h--) b(d[h]);
  16121. return f
  16122. }
  16123. if (c instanceof CKEDITOR.dom.element) {
  16124. f = c.getAscendant("table");
  16125. f.$.rows.length == 1 ? f.remove() : c.remove()
  16126. }
  16127. return null
  16128. }
  16129. function g(a, b) {
  16130. for (var c = b ? Infinity : 0, d = 0; d < a.length; d++) {
  16131. var f;
  16132. f = a[d];
  16133. for (var e = b, g = f.getParent().$.cells, h = 0, i = 0; i < g.length; i++) {
  16134. var j = g[i],
  16135. h = h + (e ? 1 : j.colSpan);
  16136. if (j == f.$) break
  16137. }
  16138. f = h - 1;
  16139. if (b ? f < c : f > c) c = f
  16140. }
  16141. return c
  16142. }
  16143. function c(b, c) {
  16144. for (var d = a(b), f = d[0].getAscendant("table"), e = g(d, 1), d = g(d), e = c ? e : d, h = CKEDITOR.tools.buildTableMap(f), f = [], d = [], i = h.length, j = 0; j < i; j++) {
  16145. f.push(h[j][e]);
  16146. d.push(c ? h[j][e - 1] : h[j][e +
  16147. 1
  16148. ])
  16149. }
  16150. for (j = 0; j < i; j++)
  16151. if (f[j]) {
  16152. if (f[j].colSpan > 1 && d[j] == f[j]) {
  16153. e = f[j];
  16154. e.colSpan = e.colSpan + 1
  16155. } else {
  16156. e = (new CKEDITOR.dom.element(f[j])).clone();
  16157. e.removeAttribute("colSpan");
  16158. e.appendBogus();
  16159. e[c ? "insertBefore" : "insertAfter"].call(e, new CKEDITOR.dom.element(f[j]));
  16160. e = e.$
  16161. }
  16162. j = j + (e.rowSpan - 1)
  16163. }
  16164. }
  16165. function d(a, b) {
  16166. var c = a.getStartElement();
  16167. if (c = c.getAscendant("td", 1) || c.getAscendant("th", 1)) {
  16168. var d = c.clone();
  16169. d.appendBogus();
  16170. b ? d.insertBefore(c) : d.insertAfter(c)
  16171. }
  16172. }
  16173. function j(b) {
  16174. if (b instanceof CKEDITOR.dom.selection) {
  16175. var b =
  16176. a(b),
  16177. c = b[0] && b[0].getAscendant("table"),
  16178. d;
  16179. a: {
  16180. var e = 0;d = b.length - 1;
  16181. for (var g = {}, h, i; h = b[e++];) CKEDITOR.dom.element.setMarker(g, h, "delete_cell", true);
  16182. for (e = 0; h = b[e++];)
  16183. if ((i = h.getPrevious()) && !i.getCustomData("delete_cell") || (i = h.getNext()) && !i.getCustomData("delete_cell")) {
  16184. CKEDITOR.dom.element.clearAllMarkers(g);
  16185. d = i;
  16186. break a
  16187. }
  16188. CKEDITOR.dom.element.clearAllMarkers(g);i = b[0].getParent();
  16189. if (i = i.getPrevious()) d = i.getLast();
  16190. else {
  16191. i = b[d].getParent();
  16192. d = (i = i.getNext()) ? i.getChild(0) : null
  16193. }
  16194. }
  16195. for (i = b.length - 1; i >=
  16196. 0; i--) j(b[i]);
  16197. d ? f(d, true) : c && c.remove()
  16198. } else if (b instanceof CKEDITOR.dom.element) {
  16199. c = b.getParent();
  16200. c.getChildCount() == 1 ? c.remove() : b.remove()
  16201. }
  16202. }
  16203. function f(a, b) {
  16204. var c = a.getDocument(),
  16205. d = CKEDITOR.document;
  16206. if (CKEDITOR.env.ie && CKEDITOR.env.version == 10) {
  16207. d.focus();
  16208. c.focus()
  16209. }
  16210. c = new CKEDITOR.dom.range(c);
  16211. if (!c["moveToElementEdit" + (b ? "End" : "Start")](a)) {
  16212. c.selectNodeContents(a);
  16213. c.collapse(b ? false : true)
  16214. }
  16215. c.select(true)
  16216. }
  16217. function h(a, b, c) {
  16218. a = a[b];
  16219. if (typeof c == "undefined") return a;
  16220. for (b = 0; a && b < a.length; b++) {
  16221. if (c.is &&
  16222. a[b] == c.$) return b;
  16223. if (b == c) return new CKEDITOR.dom.element(a[b])
  16224. }
  16225. return c.is ? -1 : null
  16226. }
  16227. function i(b, c, d) {
  16228. var f = a(b),
  16229. e;
  16230. if ((c ? f.length != 1 : f.length < 2) || (e = b.getCommonAncestor()) && e.type == CKEDITOR.NODE_ELEMENT && e.is("table")) return false;
  16231. var g, b = f[0];
  16232. e = b.getAscendant("table");
  16233. var i = CKEDITOR.tools.buildTableMap(e),
  16234. j = i.length,
  16235. k = i[0].length,
  16236. n = b.getParent().$.rowIndex,
  16237. o = h(i, n, b);
  16238. if (c) {
  16239. var y;
  16240. try {
  16241. var z = parseInt(b.getAttribute("rowspan"), 10) || 1;
  16242. g = parseInt(b.getAttribute("colspan"), 10) || 1;
  16243. y = i[c == "up" ? n - z : c == "down" ?
  16244. n + z : n][c == "left" ? o - g : c == "right" ? o + g : o]
  16245. } catch (B) { return false }
  16246. if (!y || b.$ == y) return false;
  16247. f[c == "up" || c == "left" ? "unshift" : "push"](new CKEDITOR.dom.element(y))
  16248. }
  16249. for (var c = b.getDocument(), A = n, z = y = 0, G = !d && new CKEDITOR.dom.documentFragment(c), D = 0, c = 0; c < f.length; c++) {
  16250. g = f[c];
  16251. var J = g.getParent(),
  16252. C = g.getFirst(),
  16253. F = g.$.colSpan,
  16254. E = g.$.rowSpan,
  16255. J = J.$.rowIndex,
  16256. I = h(i, J, g),
  16257. D = D + F * E,
  16258. z = Math.max(z, I - o + F);
  16259. y = Math.max(y, J - n + E);
  16260. if (!d) {
  16261. F = g;
  16262. (E = F.getBogus()) && E.remove();
  16263. F.trim();
  16264. if (g.getChildren().count()) {
  16265. if (J != A && C && (!C.isBlockBoundary ||
  16266. !C.isBlockBoundary({ br: 1 })))(A = G.getLast(CKEDITOR.dom.walker.whitespaces(true))) && (!A.is || !A.is("br")) && G.append("br");
  16267. g.moveChildren(G)
  16268. }
  16269. c ? g.remove() : g.setHtml("")
  16270. }
  16271. A = J
  16272. }
  16273. if (d) return y * z == D;
  16274. G.moveChildren(b);
  16275. b.appendBogus();
  16276. z >= k ? b.removeAttribute("rowSpan") : b.$.rowSpan = y;
  16277. y >= j ? b.removeAttribute("colSpan") : b.$.colSpan = z;
  16278. d = new CKEDITOR.dom.nodeList(e.$.rows);
  16279. f = d.count();
  16280. for (c = f - 1; c >= 0; c--) {
  16281. e = d.getItem(c);
  16282. if (!e.$.cells.length) {
  16283. e.remove();
  16284. f++
  16285. }
  16286. }
  16287. return b
  16288. }
  16289. function k(b, c) {
  16290. var d = a(b);
  16291. if (d.length > 1) return false;
  16292. if (c) return true;
  16293. var d = d[0],
  16294. f = d.getParent(),
  16295. e = f.getAscendant("table"),
  16296. g = CKEDITOR.tools.buildTableMap(e),
  16297. i = f.$.rowIndex,
  16298. j = h(g, i, d),
  16299. k = d.$.rowSpan,
  16300. n;
  16301. if (k > 1) {
  16302. n = Math.ceil(k / 2);
  16303. for (var k = Math.floor(k / 2), f = i + n, e = new CKEDITOR.dom.element(e.$.rows[f]), g = h(g, f), o, f = d.clone(), i = 0; i < g.length; i++) { o = g[i]; if (o.parentNode == e.$ && i > j) { f.insertBefore(new CKEDITOR.dom.element(o)); break } else o = null }
  16304. o || e.append(f)
  16305. } else {
  16306. k = n = 1;
  16307. e = f.clone();
  16308. e.insertAfter(f);
  16309. e.append(f = d.clone());
  16310. o = h(g, i);
  16311. for (j = 0; j < o.length; j++) o[j].rowSpan++
  16312. }
  16313. f.appendBogus();
  16314. d.$.rowSpan = n;
  16315. f.$.rowSpan = k;
  16316. n == 1 && d.removeAttribute("rowSpan");
  16317. k == 1 && f.removeAttribute("rowSpan");
  16318. return f
  16319. }
  16320. function n(b, c) {
  16321. var d = a(b);
  16322. if (d.length > 1) return false;
  16323. if (c) return true;
  16324. var d = d[0],
  16325. f = d.getParent(),
  16326. e = f.getAscendant("table"),
  16327. e = CKEDITOR.tools.buildTableMap(e),
  16328. g = h(e, f.$.rowIndex, d),
  16329. i = d.$.colSpan;
  16330. if (i > 1) {
  16331. f = Math.ceil(i / 2);
  16332. i = Math.floor(i / 2)
  16333. } else {
  16334. for (var i = f = 1, j = [], k = 0; k < e.length; k++) {
  16335. var n = e[k];
  16336. j.push(n[g]);
  16337. n[g].rowSpan > 1 && (k = k + (n[g].rowSpan - 1))
  16338. }
  16339. for (e = 0; e < j.length; e++) j[e].colSpan++
  16340. }
  16341. e = d.clone();
  16342. e.insertAfter(d);
  16343. e.appendBogus();
  16344. d.$.colSpan = f;
  16345. e.$.colSpan = i;
  16346. f == 1 && d.removeAttribute("colSpan");
  16347. i == 1 && e.removeAttribute("colSpan");
  16348. return e
  16349. }
  16350. var o = /^(?:td|th)$/;
  16351. CKEDITOR.plugins.tabletools = {
  16352. requires: "table,dialog,contextmenu",
  16353. init: function(g) {
  16354. function h(a) { return CKEDITOR.tools.extend(a || {}, { contextSensitive: 1, refresh: function(a, b) { this.setState(b.contains({ td: 1, th: 1 }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED) } }) }
  16355. function l(a, b) {
  16356. var c = g.addCommand(a, b);
  16357. g.addFeature(c)
  16358. }
  16359. var o = g.lang.table;
  16360. l("cellProperties", new CKEDITOR.dialogCommand("cellProperties", h({ allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]", requiredContent: "table" })));
  16361. CKEDITOR.dialog.add("cellProperties", this.path + "dialogs/tableCell.js");
  16362. l("rowDelete", h({
  16363. requiredContent: "table",
  16364. exec: function(a) {
  16365. a = a.getSelection();
  16366. f(b(a))
  16367. }
  16368. }));
  16369. l("rowInsertBefore", h({
  16370. requiredContent: "table",
  16371. exec: function(a) {
  16372. a = a.getSelection();
  16373. e(a, true)
  16374. }
  16375. }));
  16376. l("rowInsertAfter", h({
  16377. requiredContent: "table",
  16378. exec: function(a) {
  16379. a = a.getSelection();
  16380. e(a)
  16381. }
  16382. }));
  16383. l("columnDelete", h({
  16384. requiredContent: "table",
  16385. exec: function(b) {
  16386. for (var b = b.getSelection(), b = a(b), c = b[0], d = b[b.length - 1], b = c.getAscendant("table"), e = CKEDITOR.tools.buildTableMap(b), g, h, i = [], j = 0, k = e.length; j < k; j++)
  16387. for (var m = 0, l = e[j].length; m < l; m++) {
  16388. e[j][m] == c.$ && (g = m);
  16389. e[j][m] == d.$ && (h = m)
  16390. }
  16391. for (j = g; j <= h; j++)
  16392. for (m = 0; m < e.length; m++) {
  16393. d = e[m];
  16394. c = new CKEDITOR.dom.element(b.$.rows[m]);
  16395. d = new CKEDITOR.dom.element(d[j]);
  16396. if (d.$) {
  16397. d.$.colSpan == 1 ? d.remove() : d.$.colSpan = d.$.colSpan -
  16398. 1;
  16399. m = m + (d.$.rowSpan - 1);
  16400. c.$.cells.length || i.push(c)
  16401. }
  16402. }
  16403. h = b.$.rows[0] && b.$.rows[0].cells;
  16404. g = new CKEDITOR.dom.element(h[g] || (g ? h[g - 1] : b.$.parentNode));
  16405. i.length == k && b.remove();
  16406. g && f(g, true)
  16407. }
  16408. }));
  16409. l("columnInsertBefore", h({
  16410. requiredContent: "table",
  16411. exec: function(a) {
  16412. a = a.getSelection();
  16413. c(a, true)
  16414. }
  16415. }));
  16416. l("columnInsertAfter", h({
  16417. requiredContent: "table",
  16418. exec: function(a) {
  16419. a = a.getSelection();
  16420. c(a)
  16421. }
  16422. }));
  16423. l("cellDelete", h({
  16424. requiredContent: "table",
  16425. exec: function(a) {
  16426. a = a.getSelection();
  16427. j(a)
  16428. }
  16429. }));
  16430. l("cellMerge", h({
  16431. allowedContent: "td[colspan,rowspan]",
  16432. requiredContent: "td[colspan,rowspan]",
  16433. exec: function(a) { f(i(a.getSelection()), true) }
  16434. }));
  16435. l("cellMergeRight", h({ allowedContent: "td[colspan]", requiredContent: "td[colspan]", exec: function(a) { f(i(a.getSelection(), "right"), true) } }));
  16436. l("cellMergeDown", h({ allowedContent: "td[rowspan]", requiredContent: "td[rowspan]", exec: function(a) { f(i(a.getSelection(), "down"), true) } }));
  16437. l("cellVerticalSplit", h({ allowedContent: "td[rowspan]", requiredContent: "td[rowspan]", exec: function(a) { f(k(a.getSelection())) } }));
  16438. l("cellHorizontalSplit",
  16439. h({ allowedContent: "td[colspan]", requiredContent: "td[colspan]", exec: function(a) { f(n(a.getSelection())) } }));
  16440. l("cellInsertBefore", h({
  16441. requiredContent: "table",
  16442. exec: function(a) {
  16443. a = a.getSelection();
  16444. d(a, true)
  16445. }
  16446. }));
  16447. l("cellInsertAfter", h({
  16448. requiredContent: "table",
  16449. exec: function(a) {
  16450. a = a.getSelection();
  16451. d(a)
  16452. }
  16453. }));
  16454. g.addMenuItems && g.addMenuItems({
  16455. tablecell: {
  16456. label: o.cell.menu,
  16457. group: "tablecell",
  16458. order: 1,
  16459. getItems: function() {
  16460. var b = g.getSelection(),
  16461. c = a(b);
  16462. return {
  16463. tablecell_insertBefore: CKEDITOR.TRISTATE_OFF,
  16464. tablecell_insertAfter: CKEDITOR.TRISTATE_OFF,
  16465. tablecell_delete: CKEDITOR.TRISTATE_OFF,
  16466. tablecell_merge: i(b, null, true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  16467. tablecell_merge_right: i(b, "right", true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  16468. tablecell_merge_down: i(b, "down", true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  16469. tablecell_split_vertical: k(b, true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  16470. tablecell_split_horizontal: n(b, true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  16471. tablecell_properties: c.length > 0 ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  16472. }
  16473. }
  16474. },
  16475. tablecell_insertBefore: { label: o.cell.insertBefore, group: "tablecell", command: "cellInsertBefore", order: 5 },
  16476. tablecell_insertAfter: { label: o.cell.insertAfter, group: "tablecell", command: "cellInsertAfter", order: 10 },
  16477. tablecell_delete: { label: o.cell.deleteCell, group: "tablecell", command: "cellDelete", order: 15 },
  16478. tablecell_merge: { label: o.cell.merge, group: "tablecell", command: "cellMerge", order: 16 },
  16479. tablecell_merge_right: {
  16480. label: o.cell.mergeRight,
  16481. group: "tablecell",
  16482. command: "cellMergeRight",
  16483. order: 17
  16484. },
  16485. tablecell_merge_down: { label: o.cell.mergeDown, group: "tablecell", command: "cellMergeDown", order: 18 },
  16486. tablecell_split_horizontal: { label: o.cell.splitHorizontal, group: "tablecell", command: "cellHorizontalSplit", order: 19 },
  16487. tablecell_split_vertical: { label: o.cell.splitVertical, group: "tablecell", command: "cellVerticalSplit", order: 20 },
  16488. tablecell_properties: { label: o.cell.title, group: "tablecellproperties", command: "cellProperties", order: 21 },
  16489. tablerow: {
  16490. label: o.row.menu,
  16491. group: "tablerow",
  16492. order: 1,
  16493. getItems: function() {
  16494. return {
  16495. tablerow_insertBefore: CKEDITOR.TRISTATE_OFF,
  16496. tablerow_insertAfter: CKEDITOR.TRISTATE_OFF,
  16497. tablerow_delete: CKEDITOR.TRISTATE_OFF
  16498. }
  16499. }
  16500. },
  16501. tablerow_insertBefore: { label: o.row.insertBefore, group: "tablerow", command: "rowInsertBefore", order: 5 },
  16502. tablerow_insertAfter: { label: o.row.insertAfter, group: "tablerow", command: "rowInsertAfter", order: 10 },
  16503. tablerow_delete: { label: o.row.deleteRow, group: "tablerow", command: "rowDelete", order: 15 },
  16504. tablecolumn: {
  16505. label: o.column.menu,
  16506. group: "tablecolumn",
  16507. order: 1,
  16508. getItems: function() {
  16509. return {
  16510. tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF,
  16511. tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF,
  16512. tablecolumn_delete: CKEDITOR.TRISTATE_OFF
  16513. }
  16514. }
  16515. },
  16516. tablecolumn_insertBefore: { label: o.column.insertBefore, group: "tablecolumn", command: "columnInsertBefore", order: 5 },
  16517. tablecolumn_insertAfter: { label: o.column.insertAfter, group: "tablecolumn", command: "columnInsertAfter", order: 10 },
  16518. tablecolumn_delete: { label: o.column.deleteColumn, group: "tablecolumn", command: "columnDelete", order: 15 }
  16519. });
  16520. g.contextMenu && g.contextMenu.addListener(function(a, b, c) {
  16521. return (a = c.contains({ td: 1, th: 1 },
  16522. 1)) && !a.isReadOnly() ? { tablecell: CKEDITOR.TRISTATE_OFF, tablerow: CKEDITOR.TRISTATE_OFF, tablecolumn: CKEDITOR.TRISTATE_OFF } : null
  16523. })
  16524. },
  16525. getSelectedCells: a
  16526. };
  16527. CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools)
  16528. }(), CKEDITOR.tools.buildTableMap = function(a) {
  16529. for (var a = a.$.rows, e = -1, b = [], g = 0; g < a.length; g++) {
  16530. e++;
  16531. !b[e] && (b[e] = []);
  16532. for (var c = -1, d = 0; d < a[g].cells.length; d++) {
  16533. var j = a[g].cells[d];
  16534. for (c++; b[e][c];) c++;
  16535. for (var f = isNaN(j.colSpan) ? 1 : j.colSpan, j = isNaN(j.rowSpan) ? 1 : j.rowSpan, h = 0; h < j; h++) {
  16536. b[e + h] || (b[e +
  16537. h] = []);
  16538. for (var i = 0; i < f; i++) b[e + h][c + i] = a[g].cells[d]
  16539. }
  16540. c = c + (f - 1)
  16541. }
  16542. }
  16543. return b
  16544. },
  16545. function() {
  16546. function a(a) {
  16547. function b() {
  16548. for (var d = g(), h = CKEDITOR.tools.clone(a.config.toolbarGroups) || e(a), i = 0; i < h.length; i++) {
  16549. var k = h[i];
  16550. if (k != "/") {
  16551. typeof k == "string" && (k = h[i] = { name: k });
  16552. var l, p = k.groups;
  16553. if (p)
  16554. for (var t = 0; t < p.length; t++) {
  16555. l = p[t];
  16556. (l = d[l]) && f(k, l)
  16557. }(l = d[k.name]) && f(k, l)
  16558. }
  16559. }
  16560. return h
  16561. }
  16562. function g() {
  16563. var b = {},
  16564. d, f, e;
  16565. for (d in a.ui.items) {
  16566. f = a.ui.items[d];
  16567. e = f.toolbar || "others";
  16568. e = e.split(",");
  16569. f = e[0];
  16570. e = parseInt(e[1] || -1, 10);
  16571. b[f] ||
  16572. (b[f] = []);
  16573. b[f].push({ name: d, order: e })
  16574. }
  16575. for (f in b) b[f] = b[f].sort(function(a, b) { return a.order == b.order ? 0 : b.order < 0 ? -1 : a.order < 0 ? 1 : a.order < b.order ? -1 : 1 });
  16576. return b
  16577. }
  16578. function f(b, d) { if (d.length) { b.items ? b.items.push(a.ui.create("-")) : b.items = []; for (var f; f = d.shift();) { f = typeof f == "string" ? f : f.name; if (!i || CKEDITOR.tools.indexOf(i, f) == -1)(f = a.ui.create(f)) && a.addFeature(f) && b.items.push(f) } } }
  16579. function h(a) {
  16580. var b = [],
  16581. c, d, e;
  16582. for (c = 0; c < a.length; ++c) {
  16583. d = a[c];
  16584. e = {};
  16585. if (d == "/") b.push(d);
  16586. else if (CKEDITOR.tools.isArray(d)) {
  16587. f(e,
  16588. CKEDITOR.tools.clone(d));
  16589. b.push(e)
  16590. } else if (d.items) {
  16591. f(e, CKEDITOR.tools.clone(d.items));
  16592. e.name = d.name;
  16593. b.push(e)
  16594. }
  16595. }
  16596. return b
  16597. }
  16598. var i = a.config.removeButtons,
  16599. i = i && i.split(","),
  16600. k = a.config.toolbar;
  16601. typeof k == "string" && (k = a.config["toolbar_" + k]);
  16602. return a.toolbar = k ? h(k) : b()
  16603. }
  16604. function e(a) {
  16605. return a._.toolbarGroups || (a._.toolbarGroups = [{ name: "document", groups: ["mode", "document", "doctools"] }, { name: "clipboard", groups: ["clipboard", "undo"] }, { name: "editing", groups: ["find", "selection", "spellchecker"] }, { name: "forms" }, "/",
  16606. { name: "basicstyles", groups: ["basicstyles", "cleanup"] }, { name: "paragraph", groups: ["list", "indent", "blocks", "align", "bidi"] }, { name: "links" }, { name: "insert" }, "/", { name: "styles" }, { name: "colors" }, { name: "tools" }, { name: "others" }, { name: "about" }
  16607. ])
  16608. }
  16609. var b = function() {
  16610. this.toolbars = [];
  16611. this.focusCommandExecuted = false
  16612. };
  16613. b.prototype.focus = function() {
  16614. for (var a = 0, b; b = this.toolbars[a++];)
  16615. for (var e = 0, f; f = b.items[e++];)
  16616. if (f.focus) { f.focus(); return }
  16617. };
  16618. var g = {
  16619. modes: { wysiwyg: 1, source: 1 },
  16620. readOnly: 1,
  16621. exec: function(a) {
  16622. if (a.toolbox) {
  16623. a.toolbox.focusCommandExecuted =
  16624. true;
  16625. CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() { a.toolbox.focus() }, 100) : a.toolbox.focus()
  16626. }
  16627. }
  16628. };
  16629. CKEDITOR.plugins.add("toolbar", {
  16630. requires: "button",
  16631. init: function(c) {
  16632. var d, e = function(a, b) {
  16633. var g, k = c.lang.dir == "rtl",
  16634. n = c.config.toolbarGroupCycling,
  16635. o = k ? 37 : 39,
  16636. k = k ? 39 : 37,
  16637. n = n === void 0 || n;
  16638. switch (b) {
  16639. case 9:
  16640. case CKEDITOR.SHIFT + 9:
  16641. for (; !g || !g.items.length;) {
  16642. g = b == 9 ? (g ? g.next : a.toolbar.next) || c.toolbox.toolbars[0] : (g ? g.previous : a.toolbar.previous) || c.toolbox.toolbars[c.toolbox.toolbars.length - 1];
  16643. if (g.items.length)
  16644. for (a =
  16645. g.items[d ? g.items.length - 1 : 0]; a && !a.focus;)(a = d ? a.previous : a.next) || (g = 0)
  16646. }
  16647. a && a.focus();
  16648. return false;
  16649. case o:
  16650. g = a;
  16651. do { g = g.next;!g && n && (g = a.toolbar.items[0]) } while (g && !g.focus);
  16652. g ? g.focus() : e(a, 9);
  16653. return false;
  16654. case 40:
  16655. if (a.button && a.button.hasArrow) {
  16656. c.once("panelShow", function(a) { a.data._.panel._.currentBlock.onKeyDown(40) });
  16657. a.execute()
  16658. } else e(a, b == 40 ? o : k);
  16659. return false;
  16660. case k:
  16661. case 38:
  16662. g = a;
  16663. do { g = g.previous;!g && n && (g = a.toolbar.items[a.toolbar.items.length - 1]) } while (g && !g.focus);
  16664. if (g) g.focus();
  16665. else {
  16666. d = 1;
  16667. e(a,
  16668. CKEDITOR.SHIFT + 9);
  16669. d = 0
  16670. }
  16671. return false;
  16672. case 27:
  16673. c.focus();
  16674. return false;
  16675. case 13:
  16676. case 32:
  16677. a.execute();
  16678. return false
  16679. }
  16680. return true
  16681. };
  16682. c.on("uiSpace", function(d) {
  16683. if (d.data.space == c.config.toolbarLocation) {
  16684. d.removeListener();
  16685. c.toolbox = new b;
  16686. var g = CKEDITOR.tools.getNextId(),
  16687. i = ['<span id="', g, '" class="cke_voice_label">', c.lang.toolbar.toolbars, "</span>", '<span id="' + c.ui.spaceId("toolbox") + '" class="cke_toolbox" role="group" aria-labelledby="', g, '" onmousedown="return false;">'],
  16688. g = c.config.toolbarStartupExpanded !==
  16689. false,
  16690. k, n;
  16691. c.config.toolbarCanCollapse && c.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && i.push('<span class="cke_toolbox_main"' + (g ? ">" : ' style="display:none">'));
  16692. for (var o = c.toolbox.toolbars, q = a(c), m = 0; m < q.length; m++) {
  16693. var l, p = 0,
  16694. t, s = q[m],
  16695. u;
  16696. if (s) {
  16697. if (k) {
  16698. i.push("</span>");
  16699. n = k = 0
  16700. }
  16701. if (s === "/"){}
  16702. // i.push('<span class="cke_toolbar_break"></span>');
  16703. else {
  16704. u = s.items || s;
  16705. for (var w = 0; w < u.length; w++) {
  16706. var x = u[w],
  16707. v;
  16708. if (x)
  16709. if (x.type == CKEDITOR.UI_SEPARATOR) n = k && x;
  16710. else {
  16711. v = x.canGroup !== false;
  16712. if (!p) {
  16713. l = CKEDITOR.tools.getNextId();
  16714. p = {
  16715. id: l,
  16716. items: []
  16717. };
  16718. t = s.name && (c.lang.toolbar.toolbarGroups[s.name] || s.name);
  16719. i.push('<span id="', l, '" class="cke_toolbar"', t ? ' aria-labelledby="' + l + '_label"' : "", ' role="toolbar">');
  16720. t && i.push('<span id="', l, '_label" class="cke_voice_label">', t, "</span>");
  16721. i.push('<span class="cke_toolbar_start"></span>');
  16722. var r = o.push(p) - 1;
  16723. if (r > 0) {
  16724. p.previous = o[r - 1];
  16725. p.previous.next = p
  16726. }
  16727. }
  16728. if (v) {
  16729. if (!k) {
  16730. i.push('<span class="cke_toolgroup" role="presentation">');
  16731. k = 1
  16732. }
  16733. } else if (k) {
  16734. i.push("</span>");
  16735. k = 0
  16736. }
  16737. l = function(a) {
  16738. a = a.render(c, i);
  16739. r = p.items.push(a) -
  16740. 1;
  16741. if (r > 0) {
  16742. a.previous = p.items[r - 1];
  16743. a.previous.next = a
  16744. }
  16745. a.toolbar = p;
  16746. a.onkey = e;
  16747. a.onfocus = function() { c.toolbox.focusCommandExecuted || c.focus() }
  16748. };
  16749. if (n) {
  16750. l(n);
  16751. n = 0
  16752. }
  16753. l(x)
  16754. }
  16755. }
  16756. if (k) {
  16757. i.push("</span>");
  16758. n = k = 0
  16759. }
  16760. p && i.push('<span class="cke_toolbar_end"></span></span>')
  16761. }
  16762. }
  16763. }
  16764. c.config.toolbarCanCollapse && i.push("</span>");
  16765. if (c.config.toolbarCanCollapse && c.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  16766. var y = CKEDITOR.tools.addFunction(function() { c.execCommand("toolbarCollapse") });
  16767. c.on("destroy", function() { CKEDITOR.tools.removeFunction(y) });
  16768. c.addCommand("toolbarCollapse", {
  16769. readOnly: 1,
  16770. exec: function(a) {
  16771. var b = a.ui.space("toolbar_collapser"),
  16772. c = b.getPrevious(),
  16773. d = a.ui.space("contents"),
  16774. f = c.getParent(),
  16775. e = parseInt(d.$.style.height, 10),
  16776. g = f.$.offsetHeight,
  16777. h = b.hasClass("cke_toolbox_collapser_min");
  16778. if (h) {
  16779. c.show();
  16780. b.removeClass("cke_toolbox_collapser_min");
  16781. b.setAttribute("title", a.lang.toolbar.toolbarCollapse)
  16782. } else {
  16783. c.hide();
  16784. b.addClass("cke_toolbox_collapser_min");
  16785. b.setAttribute("title", a.lang.toolbar.toolbarExpand)
  16786. }
  16787. b.getFirst().setText(h ? "▲" : "◀");
  16788. d.setStyle("height", e - (f.$.offsetHeight - g) + "px");
  16789. a.fire("resize")
  16790. },
  16791. modes: { wysiwyg: 1, source: 1 }
  16792. });
  16793. c.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse");
  16794. i.push('<a title="' + (g ? c.lang.toolbar.toolbarCollapse : c.lang.toolbar.toolbarExpand) + '" id="' + c.ui.spaceId("toolbar_collapser") + '" tabIndex="-1" class="cke_toolbox_collapser');
  16795. g || i.push(" cke_toolbox_collapser_min");
  16796. i.push('" onclick="CKEDITOR.tools.callFunction(' + y + ')">', '<span class="cke_arrow">&#9650;</span>',
  16797. "</a>")
  16798. }
  16799. i.push("</span>");
  16800. d.data.html = d.data.html + i.join("")
  16801. }
  16802. });
  16803. c.on("destroy", function() {
  16804. if (this.toolbox) {
  16805. var a, b = 0,
  16806. c, d, e;
  16807. for (a = this.toolbox.toolbars; b < a.length; b++) {
  16808. d = a[b].items;
  16809. for (c = 0; c < d.length; c++) {
  16810. e = d[c];
  16811. e.clickFn && CKEDITOR.tools.removeFunction(e.clickFn);
  16812. e.keyDownFn && CKEDITOR.tools.removeFunction(e.keyDownFn)
  16813. }
  16814. }
  16815. }
  16816. });
  16817. c.on("uiReady", function() {
  16818. var a = c.ui.space("toolbox");
  16819. a && c.focusManager.add(a, 1)
  16820. });
  16821. c.addCommand("toolbarFocus", g);
  16822. c.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
  16823. c.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
  16824. c.ui.addHandler(CKEDITOR.UI_SEPARATOR, { create: function() { return { render: function(a, b) { b.push('<span class="cke_toolbar_separator" role="separator"></span>'); return {} } } } })
  16825. }
  16826. });
  16827. CKEDITOR.ui.prototype.addToolbarGroup = function(a, b, g) {
  16828. var f = e(this.editor),
  16829. h = b === 0,
  16830. i = { name: a };
  16831. if (g) {
  16832. if (g = CKEDITOR.tools.search(f, function(a) { return a.name == g })) {
  16833. !g.groups && (g.groups = []);
  16834. if (b) { b = CKEDITOR.tools.indexOf(g.groups, b); if (b >= 0) { g.groups.splice(b + 1, 0, a); return } }
  16835. h ? g.groups.splice(0, 0, a) : g.groups.push(a);
  16836. return
  16837. }
  16838. b = null
  16839. }
  16840. b &&
  16841. (b = CKEDITOR.tools.indexOf(f, function(a) { return a.name == b }));
  16842. h ? f.splice(0, 0, a) : typeof b == "number" ? f.splice(b + 1, 0, i) : f.push(a)
  16843. }
  16844. }(), CKEDITOR.UI_SEPARATOR = "separator", CKEDITOR.config.toolbarLocation = "top", "use strict",
  16845. function() {
  16846. var a = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90],
  16847. e = { 8: 1, 46: 1 };
  16848. CKEDITOR.plugins.add("undo", {
  16849. init: function(c) {
  16850. function e(a) { j.enabled && a.data.command.canUndo !== false && j.save() }
  16851. function g() {
  16852. j.enabled = c.readOnly ? false : c.mode == "wysiwyg";
  16853. j.onChange()
  16854. }
  16855. var j =
  16856. c.undoManager = new b(c),
  16857. n = j.editingHandler = new d(j),
  16858. o = c.addCommand("undo", {
  16859. exec: function() {
  16860. if (j.undo()) {
  16861. c.selectionChange();
  16862. this.fire("afterUndo")
  16863. }
  16864. },
  16865. startDisabled: true,
  16866. canUndo: false
  16867. }),
  16868. q = c.addCommand("redo", {
  16869. exec: function() {
  16870. if (j.redo()) {
  16871. c.selectionChange();
  16872. this.fire("afterRedo")
  16873. }
  16874. },
  16875. startDisabled: true,
  16876. canUndo: false
  16877. });
  16878. c.setKeystroke([
  16879. [a[0], "undo"],
  16880. [a[1], "redo"],
  16881. [a[2], "redo"]
  16882. ]);
  16883. j.onChange = function() {
  16884. o.setState(j.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  16885. q.setState(j.redoable() ? CKEDITOR.TRISTATE_OFF :
  16886. CKEDITOR.TRISTATE_DISABLED)
  16887. };
  16888. c.on("beforeCommandExec", e);
  16889. c.on("afterCommandExec", e);
  16890. c.on("saveSnapshot", function(a) { j.save(a.data && a.data.contentOnly) });
  16891. c.on("contentDom", n.attachListeners, n);
  16892. c.on("instanceReady", function() { c.fire("saveSnapshot") });
  16893. c.on("beforeModeUnload", function() { c.mode == "wysiwyg" && j.save(true) });
  16894. c.on("mode", g);
  16895. c.on("readOnly", g);
  16896. if (c.ui.addButton) {
  16897. c.ui.addButton("Undo", { label: c.lang.undo.undo, command: "undo", toolbar: "undo,10" });
  16898. c.ui.addButton("Redo", {
  16899. label: c.lang.undo.redo,
  16900. command: "redo",
  16901. toolbar: "undo,20"
  16902. })
  16903. }
  16904. c.resetUndo = function() {
  16905. j.reset();
  16906. c.fire("saveSnapshot")
  16907. };
  16908. c.on("updateSnapshot", function() { j.currentImage && j.update() });
  16909. c.on("lockSnapshot", function(a) {
  16910. a = a.data;
  16911. j.lock(a && a.dontUpdate, a && a.forceUpdate)
  16912. });
  16913. c.on("unlockSnapshot", j.unlock, j)
  16914. }
  16915. });
  16916. CKEDITOR.plugins.undo = {};
  16917. var b = CKEDITOR.plugins.undo.UndoManager = function(a) {
  16918. this.strokesRecorded = [0, 0];
  16919. this.locked = null;
  16920. this.previousKeyGroup = -1;
  16921. this.limit = a.config.undoStackSize || 20;
  16922. this.strokesLimit = 25;
  16923. this.editor = a;
  16924. this.reset()
  16925. };
  16926. b.prototype = {
  16927. type: function(a, c) {
  16928. var d = b.getKeyGroup(a),
  16929. e = this.strokesRecorded[d] + 1,
  16930. c = c || e >= this.strokesLimit;
  16931. if (!this.typing) {
  16932. this.hasUndo = this.typing = true;
  16933. this.hasRedo = false;
  16934. this.onChange()
  16935. }
  16936. if (c) {
  16937. e = 0;
  16938. this.editor.fire("saveSnapshot")
  16939. } else this.editor.fire("change");
  16940. this.strokesRecorded[d] = e;
  16941. this.previousKeyGroup = d
  16942. },
  16943. keyGroupChanged: function(a) { return b.getKeyGroup(a) != this.previousKeyGroup },
  16944. reset: function() {
  16945. this.snapshots = [];
  16946. this.index = -1;
  16947. this.currentImage = null;
  16948. this.hasRedo = this.hasUndo = false;
  16949. this.locked = null;
  16950. this.resetType()
  16951. },
  16952. resetType: function() {
  16953. this.strokesRecorded = [0, 0];
  16954. this.typing = false;
  16955. this.previousKeyGroup = -1
  16956. },
  16957. refreshState: function() {
  16958. this.hasUndo = !!this.getNextImage(true);
  16959. this.hasRedo = !!this.getNextImage(false);
  16960. this.resetType();
  16961. this.onChange()
  16962. },
  16963. save: function(a, b, c) {
  16964. var d = this.editor;
  16965. if (this.locked || d.status != "ready" || d.mode != "wysiwyg") return false;
  16966. var e = d.editable();
  16967. if (!e || e.status != "ready") return false;
  16968. e = this.snapshots;
  16969. b || (b = new g(d));
  16970. if (b.contents === false) return false;
  16971. if (this.currentImage)
  16972. if (b.equalsContent(this.currentImage)) {
  16973. if (a ||
  16974. b.equalsSelection(this.currentImage)) return false
  16975. } else c !== false && d.fire("change");
  16976. e.splice(this.index + 1, e.length - this.index - 1);
  16977. e.length == this.limit && e.shift();
  16978. this.index = e.push(b) - 1;
  16979. this.currentImage = b;
  16980. c !== false && this.refreshState();
  16981. return true
  16982. },
  16983. restoreImage: function(a) {
  16984. var b = this.editor,
  16985. c;
  16986. if (a.bookmarks) {
  16987. b.focus();
  16988. c = b.getSelection()
  16989. }
  16990. this.locked = { level: 999 };
  16991. this.editor.loadSnapshot(a.contents);
  16992. if (a.bookmarks) c.selectBookmarks(a.bookmarks);
  16993. else if (CKEDITOR.env.ie) {
  16994. c = this.editor.document.getBody().$.createTextRange();
  16995. c.collapse(true);
  16996. c.select()
  16997. }
  16998. this.locked = null;
  16999. this.index = a.index;
  17000. this.currentImage = this.snapshots[this.index];
  17001. this.update();
  17002. this.refreshState();
  17003. b.fire("change")
  17004. },
  17005. getNextImage: function(a) {
  17006. var b = this.snapshots,
  17007. c = this.currentImage,
  17008. d;
  17009. if (c)
  17010. if (a)
  17011. for (d = this.index - 1; d >= 0; d--) { a = b[d]; if (!c.equalsContent(a)) { a.index = d; return a } } else
  17012. for (d = this.index + 1; d < b.length; d++) { a = b[d]; if (!c.equalsContent(a)) { a.index = d; return a } }
  17013. return null
  17014. },
  17015. redoable: function() { return this.enabled && this.hasRedo },
  17016. undoable: function() {
  17017. return this.enabled &&
  17018. this.hasUndo
  17019. },
  17020. undo: function() { if (this.undoable()) { this.save(true); var a = this.getNextImage(true); if (a) return this.restoreImage(a), true } return false },
  17021. redo: function() { if (this.redoable()) { this.save(true); if (this.redoable()) { var a = this.getNextImage(false); if (a) return this.restoreImage(a), true } } return false },
  17022. update: function(a) {
  17023. if (!this.locked) {
  17024. a || (a = new g(this.editor));
  17025. for (var b = this.index, c = this.snapshots; b > 0 && this.currentImage.equalsContent(c[b - 1]);) b = b - 1;
  17026. c.splice(b, this.index - b + 1, a);
  17027. this.index = b;
  17028. this.currentImage =
  17029. a
  17030. }
  17031. },
  17032. updateSelection: function(a) {
  17033. if (!this.snapshots.length) return false;
  17034. var b = this.snapshots,
  17035. c = b[b.length - 1];
  17036. if (c.equalsContent(a) && !c.equalsSelection(a)) { this.currentImage = b[b.length - 1] = a; return true }
  17037. return false
  17038. },
  17039. lock: function(a, b) {
  17040. if (this.locked) this.locked.level++;
  17041. else if (a) this.locked = { level: 1 };
  17042. else {
  17043. var c = null;
  17044. if (b) c = true;
  17045. else {
  17046. var d = new g(this.editor, true);
  17047. this.currentImage && this.currentImage.equalsContent(d) && (c = d)
  17048. }
  17049. this.locked = { update: c, level: 1 }
  17050. }
  17051. },
  17052. unlock: function() {
  17053. if (this.locked && !--this.locked.level) {
  17054. var a =
  17055. this.locked.update;
  17056. this.locked = null;
  17057. if (a === true) this.update();
  17058. else if (a) {
  17059. var b = new g(this.editor, true);
  17060. a.equalsContent(b) || this.update()
  17061. }
  17062. }
  17063. }
  17064. };
  17065. b.navigationKeyCodes = { 37: 1, 38: 1, 39: 1, 40: 1, 36: 1, 35: 1, 33: 1, 34: 1 };
  17066. b.keyGroups = { PRINTABLE: 0, FUNCTIONAL: 1 };
  17067. b.isNavigationKey = function(a) { return !!b.navigationKeyCodes[a] };
  17068. b.getKeyGroup = function(a) { var c = b.keyGroups; return e[a] ? c.FUNCTIONAL : c.PRINTABLE };
  17069. b.getOppositeKeyGroup = function(a) { var c = b.keyGroups; return a == c.FUNCTIONAL ? c.PRINTABLE : c.FUNCTIONAL };
  17070. b.ieFunctionalKeysBug =
  17071. function(a) { return CKEDITOR.env.ie && b.getKeyGroup(a) == b.keyGroups.FUNCTIONAL };
  17072. var g = CKEDITOR.plugins.undo.Image = function(a, b) {
  17073. this.editor = a;
  17074. a.fire("beforeUndoImage");
  17075. var c = a.getSnapshot();
  17076. CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, ""));
  17077. this.contents = c;
  17078. if (!b) this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(true);
  17079. a.fire("afterUndoImage")
  17080. },
  17081. c = /\b(?:href|src|name)="[^"]*?"/gi;
  17082. g.prototype = {
  17083. equalsContent: function(a) {
  17084. var b = this.contents,
  17085. a = a.contents;
  17086. if (CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat ||
  17087. CKEDITOR.env.quirks)) {
  17088. b = b.replace(c, "");
  17089. a = a.replace(c, "")
  17090. }
  17091. return b != a ? false : true
  17092. },
  17093. equalsSelection: function(a) {
  17094. var b = this.bookmarks,
  17095. a = a.bookmarks;
  17096. if (b || a) {
  17097. if (!b || !a || b.length != a.length) return false;
  17098. for (var c = 0; c < b.length; c++) {
  17099. var d = b[c],
  17100. e = a[c];
  17101. if (d.startOffset != e.startOffset || d.endOffset != e.endOffset || !CKEDITOR.tools.arrayCompare(d.start, e.start) || !CKEDITOR.tools.arrayCompare(d.end, e.end)) return false
  17102. }
  17103. }
  17104. return true
  17105. }
  17106. };
  17107. var d = CKEDITOR.plugins.undo.NativeEditingHandler = function(a) {
  17108. this.undoManager = a;
  17109. this.ignoreInputEvent =
  17110. false;
  17111. this.keyEventsStack = new j;
  17112. this.lastKeydownImage = null
  17113. };
  17114. d.prototype = {
  17115. onKeydown: function(c) {
  17116. var d = c.data.getKey();
  17117. if (d !== 229)
  17118. if (CKEDITOR.tools.indexOf(a, c.data.getKeystroke()) > -1) c.data.preventDefault();
  17119. else {
  17120. this.keyEventsStack.cleanUp(c);
  17121. c = this.undoManager;
  17122. this.keyEventsStack.getLast(d) || this.keyEventsStack.push(d);
  17123. this.lastKeydownImage = new g(c.editor);
  17124. if (b.isNavigationKey(d) || this.undoManager.keyGroupChanged(d))
  17125. if (c.strokesRecorded[0] || c.strokesRecorded[1]) {
  17126. c.save(false, this.lastKeydownImage,
  17127. false);
  17128. c.resetType()
  17129. }
  17130. }
  17131. },
  17132. onInput: function() {
  17133. if (this.ignoreInputEvent) this.ignoreInputEvent = false;
  17134. else {
  17135. var a = this.keyEventsStack.getLast();
  17136. a || (a = this.keyEventsStack.push(0));
  17137. this.keyEventsStack.increment(a.keyCode);
  17138. if (this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit) {
  17139. this.undoManager.type(a.keyCode, true);
  17140. this.keyEventsStack.resetInputs()
  17141. }
  17142. }
  17143. },
  17144. onKeyup: function(a) {
  17145. var c = this.undoManager,
  17146. a = a.data.getKey(),
  17147. d = this.keyEventsStack.getTotalInputs();
  17148. this.keyEventsStack.remove(a);
  17149. if (!b.ieFunctionalKeysBug(a) ||
  17150. !this.lastKeydownImage || !this.lastKeydownImage.equalsContent(new g(c.editor, true)))
  17151. if (d > 0) c.type(a);
  17152. else if (b.isNavigationKey(a)) this.onNavigationKey(true)
  17153. },
  17154. onNavigationKey: function(a) {
  17155. var b = this.undoManager;
  17156. (a || !b.save(true, null, false)) && b.updateSelection(new g(b.editor));
  17157. b.resetType()
  17158. },
  17159. ignoreInputEventListener: function() { this.ignoreInputEvent = true },
  17160. attachListeners: function() {
  17161. var a = this.undoManager.editor,
  17162. c = a.editable(),
  17163. d = this;
  17164. c.attachListener(c, "keydown", function(a) { d.onKeydown(a); if (b.ieFunctionalKeysBug(a.data.getKey())) d.onInput() },
  17165. null, null, 999);
  17166. c.attachListener(c, CKEDITOR.env.ie ? "keypress" : "input", d.onInput, d, null, 999);
  17167. c.attachListener(c, "keyup", d.onKeyup, d, null, 999);
  17168. c.attachListener(c, "paste", d.ignoreInputEventListener, d, null, 999);
  17169. c.attachListener(c, "drop", d.ignoreInputEventListener, d, null, 999);
  17170. c.attachListener(c.isInline() ? c : a.document.getDocumentElement(), "click", function() { d.onNavigationKey() }, null, null, 999);
  17171. c.attachListener(this.undoManager.editor, "blur", function() { d.keyEventsStack.remove(9) }, null, null, 999)
  17172. }
  17173. };
  17174. var j = CKEDITOR.plugins.undo.KeyEventsStack =
  17175. function() { this.stack = [] };
  17176. j.prototype = {
  17177. push: function(a) { return this.stack[this.stack.push({ keyCode: a, inputs: 0 }) - 1] },
  17178. getLastIndex: function(a) {
  17179. if (typeof a != "number") return this.stack.length - 1;
  17180. for (var b = this.stack.length; b--;)
  17181. if (this.stack[b].keyCode == a) return b;
  17182. return -1
  17183. },
  17184. getLast: function(a) { a = this.getLastIndex(a); return a != -1 ? this.stack[a] : null },
  17185. increment: function(a) { this.getLast(a).inputs++ },
  17186. remove: function(a) {
  17187. a = this.getLastIndex(a);
  17188. a != -1 && this.stack.splice(a, 1)
  17189. },
  17190. resetInputs: function(a) {
  17191. if (typeof a ==
  17192. "number") this.getLast(a).inputs = 0;
  17193. else
  17194. for (a = this.stack.length; a--;) this.stack[a].inputs = 0
  17195. },
  17196. getTotalInputs: function() { for (var a = this.stack.length, b = 0; a--;) b = b + this.stack[a].inputs; return b },
  17197. cleanUp: function(a) {
  17198. a = a.data.$;
  17199. !a.ctrlKey && !a.metaKey && this.remove(17);
  17200. a.shiftKey || this.remove(16);
  17201. a.altKey || this.remove(18)
  17202. }
  17203. }
  17204. }(), CKEDITOR.plugins.add("wsc", {
  17205. requires: "dialog",
  17206. parseApi: function(a) {
  17207. a.config.wsc_onFinish = typeof a.config.wsc_onFinish === "function" ? a.config.wsc_onFinish : function() {};
  17208. a.config.wsc_onClose =
  17209. typeof a.config.wsc_onClose === "function" ? a.config.wsc_onClose : function() {}
  17210. },
  17211. parseConfig: function(a) {
  17212. a.config.wsc_customerId = a.config.wsc_customerId || CKEDITOR.config.wsc_customerId || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";
  17213. a.config.wsc_customDictionaryIds = a.config.wsc_customDictionaryIds || CKEDITOR.config.wsc_customDictionaryIds || "";
  17214. a.config.wsc_userDictionaryName = a.config.wsc_userDictionaryName || CKEDITOR.config.wsc_userDictionaryName || "";
  17215. a.config.wsc_customLoaderScript =
  17216. a.config.wsc_customLoaderScript || CKEDITOR.config.wsc_customLoaderScript;
  17217. CKEDITOR.config.wsc_cmd = a.config.wsc_cmd || CKEDITOR.config.wsc_cmd || "spell";
  17218. CKEDITOR.config.wsc_version = "v4.3.0-26-g5bcf855";
  17219. CKEDITOR.config.wsc_removeGlobalVariable = true
  17220. },
  17221. init: function(a) {
  17222. var e = CKEDITOR.env;
  17223. this.parseConfig(a);
  17224. this.parseApi(a);
  17225. a.addCommand("checkspell", new CKEDITOR.dialogCommand("checkspell")).modes = {
  17226. wysiwyg: !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname && !(e.ie && (e.version <
  17227. 8 || e.quirks))
  17228. };
  17229. typeof a.plugins.scayt == "undefined" && a.ui.addButton && a.ui.addButton("SpellChecker", {
  17230. label: a.lang.wsc.toolbar,
  17231. click: function(a) {
  17232. var e = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  17233. (e = e.replace(/\s/g, "")) ? a.execCommand("checkspell"): alert("Nothing to check!")
  17234. },
  17235. toolbar: "spellchecker,10"
  17236. });
  17237. CKEDITOR.dialog.add("checkspell", this.path + (CKEDITOR.env.ie && CKEDITOR.env.version <= 7 ? "dialogs/wsc_ie.js" : window.postMessage ? "dialogs/wsc.js" : "dialogs/wsc_ie.js"))
  17238. }
  17239. }),
  17240. function() {
  17241. function a(a) {
  17242. var b = this.editor,
  17243. g = a.document,
  17244. f = g.body,
  17245. h = g.getElementById("cke_actscrpt");
  17246. h && h.parentNode.removeChild(h);
  17247. (h = g.getElementById("cke_shimscrpt")) && h.parentNode.removeChild(h);
  17248. (h = g.getElementById("cke_basetagscrpt")) && h.parentNode.removeChild(h);
  17249. f.contentEditable = true;
  17250. if (CKEDITOR.env.ie) {
  17251. f.hideFocus = true;
  17252. f.disabled = true;
  17253. f.removeAttribute("disabled")
  17254. }
  17255. delete this._.isLoadingData;
  17256. this.$ = f;
  17257. g = new CKEDITOR.dom.document(g);
  17258. this.setup();
  17259. this.fixInitialSelection();
  17260. if (CKEDITOR.env.ie) {
  17261. g.getDocumentElement().addClass(g.$.compatMode);
  17262. b.config.enterMode != CKEDITOR.ENTER_P && this.attachListener(g, "selectionchange", function() {
  17263. var a = g.getBody(),
  17264. c = b.getSelection(),
  17265. e = c && c.getRanges()[0];
  17266. e && (a.getHtml().match(/^<p>(?:&nbsp;|<br>)<\/p>$/i) && e.startContainer.equals(a)) && setTimeout(function() {
  17267. e = b.getSelection().getRanges()[0];
  17268. if (!e.startContainer.equals("body")) {
  17269. a.getFirst().remove(1);
  17270. e.moveToElementEditEnd(a);
  17271. e.select()
  17272. }
  17273. }, 0)
  17274. })
  17275. }
  17276. if (CKEDITOR.env.webkit || CKEDITOR.env.ie && CKEDITOR.env.version > 10) g.getDocumentElement().on("mousedown", function(a) {
  17277. a.data.getTarget().is("html") &&
  17278. setTimeout(function() { b.editable().focus() })
  17279. });
  17280. e(b);
  17281. try { b.document.$.execCommand("2D-position", false, true) } catch (i) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && b.document.$.compatMode == "CSS1Compat") && this.attachListener(this, "keydown", function(a) {
  17282. var c = a.data.getKeystroke();
  17283. if (c == 33 || c == 34)
  17284. if (CKEDITOR.env.ie) setTimeout(function() { b.getSelection().scrollIntoView() }, 0);
  17285. else if (b.window.$.innerHeight > this.$.offsetHeight) {
  17286. var e = b.createRange();
  17287. e[c == 33 ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
  17288. e.select();
  17289. a.data.preventDefault()
  17290. }
  17291. });
  17292. CKEDITOR.env.ie && this.attachListener(g, "blur", function() { try { g.$.selection.empty() } catch (a) {} });
  17293. CKEDITOR.env.iOS && this.attachListener(g, "touchend", function() { a.focus() });
  17294. f = b.document.getElementsByTag("title").getItem(0);
  17295. f.data("cke-title", f.getText());
  17296. if (CKEDITOR.env.ie) b.document.$.title = this._.docTitle;
  17297. CKEDITOR.tools.setTimeout(function() {
  17298. if (this.status == "unloaded") this.status = "ready";
  17299. b.fire("contentDom");
  17300. if (this._.isPendingFocus) {
  17301. b.focus();
  17302. this._.isPendingFocus =
  17303. false
  17304. }
  17305. setTimeout(function() { b.fire("dataReady") }, 0);
  17306. CKEDITOR.env.ie && setTimeout(function() {
  17307. if (b.document) {
  17308. var a = b.document.$.body;
  17309. a.runtimeStyle.marginBottom = "0px";
  17310. a.runtimeStyle.marginBottom = ""
  17311. }
  17312. }, 1E3)
  17313. }, 0, this)
  17314. }
  17315. function e(a) {
  17316. function b() {
  17317. var d;
  17318. a.editable().attachListener(a, "selectionChange", function() {
  17319. var b = a.getSelection().getSelectedElement();
  17320. if (b) {
  17321. if (d) {
  17322. d.detachEvent("onresizestart", e);
  17323. d = null
  17324. }
  17325. b.$.attachEvent("onresizestart", e);
  17326. d = b.$
  17327. }
  17328. })
  17329. }
  17330. function e(a) { a.returnValue = false }
  17331. if (CKEDITOR.env.gecko) try {
  17332. var f =
  17333. a.document.$;
  17334. f.execCommand("enableObjectResizing", false, !a.config.disableObjectResizing);
  17335. f.execCommand("enableInlineTableEditing", false, !a.config.disableNativeTableHandles)
  17336. } catch (g) {} else CKEDITOR.env.ie && (CKEDITOR.env.version < 11 && a.config.disableObjectResizing) && b(a)
  17337. }
  17338. function b() {
  17339. var a = [];
  17340. if (CKEDITOR.document.$.documentMode >= 8) {
  17341. a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");
  17342. var b = [],
  17343. e;
  17344. for (e in CKEDITOR.dtd.$removeEmpty) b.push("html.CSS1Compat " + e + "[contenteditable=false]");
  17345. a.push(b.join(",") + "{display:inline-block}")
  17346. } else if (CKEDITOR.env.gecko) {
  17347. a.push("html{height:100% !important}");
  17348. a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")
  17349. }
  17350. a.push("html{cursor:text;*cursor:auto}");
  17351. a.push("img,input,textarea{cursor:default}");
  17352. return a.join("\n")
  17353. }
  17354. CKEDITOR.plugins.add("wysiwygarea", {
  17355. init: function(a) {
  17356. a.config.fullPage && a.addFeature({ allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]", requiredContent: "body" });
  17357. a.addMode("wysiwyg",
  17358. function(b) {
  17359. function e(f) {
  17360. f && f.removeListener();
  17361. a.editable(new g(a, h.$.contentWindow.document.body));
  17362. a.setData(a.getData(1), b)
  17363. }
  17364. var f = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();",
  17365. f = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent(f) + "}())" : "",
  17366. h = CKEDITOR.dom.element.createFromHtml('<iframe src="' + f + '" frameBorder="0"></iframe>');
  17367. h.setStyles({ width: "100%", height: "100%" });
  17368. h.addClass("cke_wysiwyg_frame cke_reset");
  17369. var i = a.ui.space("contents");
  17370. i.append(h);
  17371. if (f = CKEDITOR.env.ie || CKEDITOR.env.gecko) h.on("load", e);
  17372. var k = a.title,
  17373. n = a.fire("ariaEditorHelpLabel", {}).label;
  17374. if (k) {
  17375. CKEDITOR.env.ie && n && (k = k + (", " + n));
  17376. h.setAttribute("title", k)
  17377. }
  17378. if (n) {
  17379. var k = CKEDITOR.tools.getNextId(),
  17380. o = CKEDITOR.dom.element.createFromHtml('<span id="' + k + '" class="cke_voice_label">' + n + "</span>");
  17381. i.append(o, 1);
  17382. h.setAttribute("aria-describedby", k)
  17383. }
  17384. a.on("beforeModeUnload", function(a) {
  17385. a.removeListener();
  17386. o && o.remove()
  17387. });
  17388. h.setAttributes({
  17389. tabIndex: a.tabIndex,
  17390. allowTransparency: "true"
  17391. });
  17392. !f && e();
  17393. if (CKEDITOR.env.webkit) {
  17394. f = function() {
  17395. i.setStyle("width", "100%");
  17396. h.hide();
  17397. h.setSize("width", i.getSize("width"));
  17398. i.removeStyle("width");
  17399. h.show()
  17400. };
  17401. h.setCustomData("onResize", f);
  17402. CKEDITOR.document.getWindow().on("resize", f)
  17403. }
  17404. a.fire("ariaWidget", h)
  17405. })
  17406. }
  17407. });
  17408. CKEDITOR.editor.prototype.addContentsCss = function(a) {
  17409. var b = this.config,
  17410. e = b.contentsCss;
  17411. if (!CKEDITOR.tools.isArray(e)) b.contentsCss = e ? [e] : [];
  17412. b.contentsCss.push(a)
  17413. };
  17414. var g = CKEDITOR.tools.createClass({
  17415. $: function() {
  17416. this.base.apply(this,
  17417. arguments);
  17418. this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(b) { CKEDITOR.tools.setTimeout(a, 0, this, b) }, this);
  17419. this._.docTitle = this.getWindow().getFrame().getAttribute("title")
  17420. },
  17421. base: CKEDITOR.editable,
  17422. proto: {
  17423. setData: function(a, d) {
  17424. var e = this.editor;
  17425. if (d) {
  17426. this.setHtml(a);
  17427. this.fixInitialSelection();
  17428. e.fire("dataReady")
  17429. } else {
  17430. this._.isLoadingData = true;
  17431. e._.dataStore = { id: 1 };
  17432. var f = e.config,
  17433. g = f.fullPage,
  17434. i = f.docType,
  17435. k = CKEDITOR.tools.buildStyleHtml(b()).replace(/<style>/, '<style data-cke-temp="1">');
  17436. g || (k = k + CKEDITOR.tools.buildStyleHtml(e.config.contentsCss));
  17437. var n = f.baseHref ? '<base href="' + f.baseHref + '" data-cke-temp="1" />' : "";
  17438. g && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) { e.docType = i = a; return "" }).replace(/<\?xml\s[^\?]*\?>/i, function(a) { e.xmlDeclaration = a; return "" }));
  17439. a = e.dataProcessor.toHtml(a);
  17440. if (g) {
  17441. /<body[\s|>]/.test(a) || (a = "<body>" + a);
  17442. /<html[\s|>]/.test(a) || (a = "<html>" + a + "</html>");
  17443. /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (a = a.replace(/<head[^>]*>/, "$&<title></title>")) : a = a.replace(/<html[^>]*>/,
  17444. "$&<head><title></title></head>");
  17445. n && (a = a.replace(/<head[^>]*?>/, "$&" + n));
  17446. a = a.replace(/<\/head\s*>/, k + "$&");
  17447. a = i + a
  17448. } else a = f.docType + '<html dir="' + f.contentsLangDirection + '" lang="' + (f.contentsLanguage || e.langCode) + '"><head><title>' + this._.docTitle + "</title>" + n + k + "</head><body" + (f.bodyId ? ' id="' + f.bodyId + '"' : "") + (f.bodyClass ? ' class="' + f.bodyClass + '"' : "") + ">" + a + "</body></html>";
  17449. if (CKEDITOR.env.gecko) {
  17450. a = a.replace(/<body/, '<body contenteditable="true" ');
  17451. CKEDITOR.env.version < 2E4 && (a = a.replace(/<body[^>]*>/,
  17452. "$&<\!-- cke-content-start --\>"))
  17453. }
  17454. f = '<script id="cke_actscrpt" type="text/javascript"' + (CKEDITOR.env.ie ? ' defer="defer" ' : "") + ">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction(" + this._.frameLoadedHandler + ",window);wasLoaded=1;}" + (CKEDITOR.env.ie ? "onload();" : 'document.addEventListener("DOMContentLoaded", onload, false );') + "<\/script>";
  17455. CKEDITOR.env.ie && CKEDITOR.env.version < 9 && (f = f + '<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)<\/script>');
  17456. n && (CKEDITOR.env.ie && CKEDITOR.env.version < 10) && (f = f + '<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;<\/script>');
  17457. a = a.replace(/(?=\s*<\/(:?head)>)/, f);
  17458. this.clearCustomData();
  17459. this.clearListeners();
  17460. e.fire("contentDomUnload");
  17461. var o = this.getDocument();
  17462. try { o.write(a) } catch (q) { setTimeout(function() { o.write(a) }, 0) }
  17463. }
  17464. },
  17465. getData: function(a) {
  17466. if (a) return this.getHtml();
  17467. var a = this.editor,
  17468. b = a.config,
  17469. e = b.fullPage,
  17470. f = e && a.docType,
  17471. g = e && a.xmlDeclaration,
  17472. i = this.getDocument(),
  17473. e = e ? i.getDocumentElement().getOuterHtml() : i.getBody().getHtml();
  17474. CKEDITOR.env.gecko && b.enterMode != CKEDITOR.ENTER_BR && (e = e.replace(/<br>(?=\s*(:?$|<\/body>))/, ""));
  17475. e = a.dataProcessor.toDataFormat(e);
  17476. g && (e = g + "\n" + e);
  17477. f && (e = f + "\n" + e);
  17478. return e
  17479. },
  17480. focus: function() { this._.isLoadingData ? this._.isPendingFocus = true : g.baseProto.focus.call(this) },
  17481. detach: function() {
  17482. var a = this.editor,
  17483. b = a.document,
  17484. a = a.window.getFrame();
  17485. g.baseProto.detach.call(this);
  17486. this.clearCustomData();
  17487. b.getDocumentElement().clearCustomData();
  17488. a.clearCustomData();
  17489. CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
  17490. (b = a.removeCustomData("onResize")) && b.removeListener();
  17491. a.remove()
  17492. }
  17493. }
  17494. })
  17495. }(), CKEDITOR.config.disableObjectResizing = !1, CKEDITOR.config.disableNativeTableHandles = !0, CKEDITOR.config.disableNativeSpellChecker = !0, CKEDITOR.config.contentsCss = CKEDITOR.getUrl("contents.css"), CKEDITOR.config.plugins = "dialogui,dialog,a11yhelp,about,basicstyles,blockquote,clipboard,panel,floatpanel,menu,contextmenu,elementspath,indent,indentlist,list,enterkey,entities,popup,filebrowser,floatingspace,listblock,button,richcombo,format,horizontalrule,htmlwriter,fakeobjects,link,magicline,maximize,pastefromword,pastetext,removeformat,resize,menubutton,scayt,showborders,sourcearea,specialchar,stylescombo,tab,table,tabletools,toolbar,undo,wsc,wysiwygarea",
  17496. CKEDITOR.config.skin = "moono",
  17497. function() {
  17498. var a = function(a, b) { for (var g = CKEDITOR.getUrl("plugins/" + b), a = a.split(","), c = 0; c < a.length; c++) CKEDITOR.skin.icons[a[c]] = { path: g, offset: -a[++c], bgsize: a[++c] } };
  17499. CKEDITOR.env.hidpi ? a("about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,codesnippet,384,,bgcolor,408,,textcolor,432,,creatediv,456,,docprops-rtl,480,,docprops,504,,find-rtl,528,,find,552,,replace,576,,flash,600,,button,624,,checkbox,648,,form,672,,hiddenfield,696,,radio,744,,select-rtl,768,,select,792,,textarea-rtl,816,,textarea,840,,textfield-rtl,864,,textfield,888,,horizontalrule,912,,iframe,936,indent-rtl,984,,indent,1008,,outdent-rtl,1032,,outdent,1056,,justifyblock,1080,,justifycenter,1104,,justifyleft,1128,,justifyright,1152,,language,1176,,anchor-rtl,1200,,anchor,1224,,link,1248,,unlink,1272,,bulletedlist-rtl,1296,,bulletedlist,1320,,numberedlist-rtl,1344,,numberedlist,1368,,mathjax,1392,,maximize,1416,,newpage-rtl,1440,,newpage,1464,,pagebreak-rtl,1488,,pagebreak,1512,,pastefromword-rtl,1536,,pastefromword,1560,,pastetext-rtl,1584,,pastetext,1608,,placeholder,1632,,preview-rtl,1656,,preview,1680,,print,1704,,removeformat,1728,,save,1752,,scayt,1776,,selectall,1800,,showblocks-rtl,1824,,showblocks,1848,,smiley,1872,,source-rtl,1896,,source,1920,,sourcedialog-rtl,1944,,sourcedialog,1968,,specialchar,1992,,table,2016,,templates-rtl,2040,,templates,2064,,uicolor,2088,,redo-rtl,2112,,redo,2136,,undo-rtl,2160,,undo,2184,,simplebox,4416,auto,spellchecker,2232,",
  17500. "icons_hidpi.png") : a("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,codesnippet,384,auto,bgcolor,408,auto,textcolor,432,auto,creatediv,456,auto,docprops-rtl,480,auto,docprops,504,auto,find-rtl,528,auto,find,552,auto,replace,576,auto,flash,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,auto,radio,744,auto,select-rtl,768,auto,select,792,auto,textarea-rtl,816,auto,textarea,840,auto,textfield-rtl,864,auto,textfield,888,auto,horizontalrule,912,auto,iframe,936,auto,auto,indent-rtl,984,auto,indent,1008,auto,outdent-rtl,1032,auto,outdent,1056,auto,justifyblock,1080,auto,justifycenter,1104,auto,justifyleft,1128,auto,justifyright,1152,auto,language,1176,auto,anchor-rtl,1200,auto,anchor,1224,auto,link,1248,auto,unlink,1272,auto,bulletedlist-rtl,1296,auto,bulletedlist,1320,auto,numberedlist-rtl,1344,auto,numberedlist,1368,auto,mathjax,1392,auto,maximize,1416,auto,newpage-rtl,1440,auto,newpage,1464,auto,pagebreak-rtl,1488,auto,pagebreak,1512,auto,pastefromword-rtl,1536,auto,pastefromword,1560,auto,pastetext-rtl,1584,auto,pastetext,1608,auto,placeholder,1632,auto,preview-rtl,1656,auto,preview,1680,auto,print,1704,auto,removeformat,1728,auto,save,1752,auto,scayt,1776,auto,selectall,1800,auto,showblocks-rtl,1824,auto,showblocks,1848,auto,smiley,1872,auto,source-rtl,1896,auto,source,1920,auto,sourcedialog-rtl,1944,auto,sourcedialog,1968,auto,specialchar,1992,auto,table,2016,auto,templates-rtl,2040,auto,templates,2064,auto,uicolor,2088,auto,redo-rtl,2112,auto,redo,2136,auto,undo-rtl,2160,auto,undo,2184,auto,simplebox,2208,auto,spellchecker,2232,auto",
  17501. "icons.png")
  17502. }()
  17503. })();