ckeditor.js 1.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931
  1. /*
  2. Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
  3. CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model.
  4. */
  5. (function() {
  6. if (window.CKEDITOR && window.CKEDITOR.dom) return;
  7. window.CKEDITOR || (window.CKEDITOR = function() {
  8. var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,
  9. d = {
  10. timestamp: "N7OC",
  11. version: "4.23.0-lts",
  12. revision: "7282fa87bc",
  13. rnd: Math.floor(900 * Math.random()) + 100,
  14. _: {
  15. pending: [],
  16. basePathSrcPattern: a
  17. },
  18. status: "unloaded",
  19. basePath: function() {
  20. var b = window.CKEDITOR_BASEPATH || "";
  21. if (!b)
  22. for (var c = document.getElementsByTagName("script"), d = 0; d < c.length; d++) {
  23. var k = c[d].src.match(a);
  24. if (k) {
  25. b = k[1];
  26. break
  27. }
  28. } - 1 == b.indexOf(":/") && "//" != b.slice(0, 2) && (b = 0 === b.indexOf("/") ? location.href
  29. .match(/^.*?:\/\/[^\/]*/)[0] +
  30. b : location.href.match(/^[^\?]*\/(?:)/)[0] + b);
  31. if (!b)
  32. throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
  33. return b
  34. }(),
  35. getUrl: function(a) {
  36. -1 == a.indexOf(":/") && 0 !== a.indexOf("/") && (a = this.basePath + a);
  37. return a = this.appendTimestamp(a)
  38. },
  39. appendTimestamp: function(a) {
  40. if (!this.timestamp || "/" === a.charAt(a.length - 1) || /[&?]t=/.test(a)) return a;
  41. var b = 0 <= a.indexOf("?") ? "\x26" : "?";
  42. return a + b + "t\x3d" + this.timestamp
  43. },
  44. domReady: function() {
  45. function a() {
  46. try {
  47. document.addEventListener ? (document.removeEventListener("DOMContentLoaded", a, !1), window
  48. .removeEventListener("load", a, !1), b()) : document.attachEvent && "complete" === document
  49. .readyState && (document.detachEvent("onreadystatechange", a), window.detachEvent("onload", a),
  50. b())
  51. } catch (c) {}
  52. }
  53. function b() {
  54. for (var a; a = c.shift();) a()
  55. }
  56. var c = [];
  57. return function(b) {
  58. function e() {
  59. try {
  60. document.documentElement.doScroll("left")
  61. } catch (b) {
  62. setTimeout(e, 1);
  63. return
  64. }
  65. a()
  66. }
  67. c.push(b);
  68. "complete" === document.readyState &&
  69. setTimeout(a, 1);
  70. if (1 == c.length)
  71. if (document.addEventListener) document.addEventListener("DOMContentLoaded", a, !1), window
  72. .addEventListener("load", a, !1);
  73. else if (document.attachEvent) {
  74. document.attachEvent("onreadystatechange", a);
  75. window.attachEvent("onload", a);
  76. b = !1;
  77. try {
  78. b = !window.frameElement
  79. } catch (d) {}
  80. document.documentElement.doScroll && b && e()
  81. }
  82. }
  83. }()
  84. },
  85. b = window.CKEDITOR_GETURL;
  86. if (b) {
  87. var c = d.getUrl;
  88. d.getUrl = function(a) {
  89. return b.call(d, a) || c.call(d, a)
  90. }
  91. }
  92. return d
  93. }());
  94. (function() {
  95. var a = {};
  96. CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(a) {
  97. var b = CKEDITOR.event.prototype,
  98. c;
  99. for (c in b) null == a[c] && (a[c] = b[c])
  100. }, CKEDITOR.event.prototype = function() {
  101. function d(a) {
  102. var e = b(this);
  103. return e[a] || (e[a] = new c(a))
  104. }
  105. var b = function(a) {
  106. a = a.getPrivate && a.getPrivate() || a._ || (a._ = {});
  107. return a.events || (a.events = {})
  108. },
  109. c = function(a) {
  110. this.name = a;
  111. this.listeners = []
  112. };
  113. c.prototype = {
  114. getListenerIndex: function(a) {
  115. for (var b = 0, c = this.listeners; b < c.length; b++)
  116. if (c[b].fn ==
  117. a) return b;
  118. return -1
  119. }
  120. };
  121. return {
  122. define: function(a, b) {
  123. var c = d.call(this, a);
  124. CKEDITOR.tools.extend(c, b, !0)
  125. },
  126. on: function(b, c, h, k, l) {
  127. function q(w, B, y, l) {
  128. w = {
  129. name: b,
  130. sender: this,
  131. editor: w,
  132. data: B,
  133. listenerData: k,
  134. stop: y,
  135. cancel: l,
  136. removeListener: f
  137. };
  138. return !1 === c.call(h, w) ? a : w.data
  139. }
  140. function f() {
  141. w.removeListener(b, c)
  142. }
  143. var w = this,
  144. B = d.call(this, b);
  145. if (0 > B.getListenerIndex(c)) {
  146. B = B.listeners;
  147. h || (h = this);
  148. isNaN(l) && (l = 10);
  149. q.fn = c;
  150. q.priority = l;
  151. for (var y = B.length - 1; 0 <= y; y--)
  152. if (B[y].priority <= l) return B.splice(y + 1, 0, q), {
  153. removeListener: f
  154. };
  155. B.unshift(q)
  156. }
  157. return {
  158. removeListener: f
  159. }
  160. },
  161. once: function() {
  162. var a = Array.prototype.slice.call(arguments),
  163. b = a[1];
  164. a[1] = function(a) {
  165. a.removeListener();
  166. return b.apply(this, arguments)
  167. };
  168. return this.on.apply(this, a)
  169. },
  170. capture: function() {
  171. CKEDITOR.event.useCapture = 1;
  172. var a = this.on.apply(this, arguments);
  173. CKEDITOR.event.useCapture = 0;
  174. return a
  175. },
  176. fire: function() {
  177. var c = 0,
  178. e = function() {
  179. c = 1
  180. },
  181. d = 0,
  182. k = function() {
  183. d = 1
  184. };
  185. return function(l, q, f) {
  186. var w = b(this)[l];
  187. l = c;
  188. var B = d;
  189. c = d = 0;
  190. if (w) {
  191. var y = w.listeners;
  192. if (y.length)
  193. for (var y = y.slice(0),
  194. F, r = 0; r < y.length; r++) {
  195. if (w.errorProof) try {
  196. F = y[r].call(this, f, q, e, k)
  197. } catch (m) {} else F = y[r].call(this, f, q, e, k);
  198. F === a ? d = 1 : "undefined" != typeof F && (q = F);
  199. if (c || d) break
  200. }
  201. }
  202. q = d ? !1 : "undefined" == typeof q ? !0 : q;
  203. c = l;
  204. d = B;
  205. return q
  206. }
  207. }(),
  208. fireOnce: function(a, c, d) {
  209. c = this.fire(a, c, d);
  210. delete b(this)[a];
  211. return c
  212. },
  213. removeListener: function(a, c) {
  214. var d = b(this)[a];
  215. if (d) {
  216. var k = d.getListenerIndex(c);
  217. 0 <= k && d.listeners.splice(k, 1)
  218. }
  219. },
  220. removeAllListeners: function() {
  221. var a = b(this),
  222. c;
  223. for (c in a) delete a[c]
  224. },
  225. hasListeners: function(a) {
  226. return (a =
  227. b(this)[a]) && 0 < a.listeners.length
  228. }
  229. }
  230. }())
  231. })();
  232. CKEDITOR.editor || (CKEDITOR.editor = function() {
  233. CKEDITOR._.pending.push([this, arguments]);
  234. CKEDITOR.event.call(this)
  235. }, CKEDITOR.editor.prototype.fire = function(a, d) {
  236. a in {
  237. instanceReady: 1,
  238. loaded: 1
  239. } && (this[a] = !0);
  240. return CKEDITOR.event.prototype.fire.call(this, a, d, this)
  241. }, CKEDITOR.editor.prototype.fireOnce = function(a, d) {
  242. a in {
  243. instanceReady: 1,
  244. loaded: 1
  245. } && (this[a] = !0);
  246. return CKEDITOR.event.prototype.fireOnce.call(this, a, d, this)
  247. }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
  248. CKEDITOR.env || (CKEDITOR.env = function() {
  249. var a = navigator.userAgent.toLowerCase(),
  250. d = a.match(/edge[ \/](\d+.?\d*)/),
  251. b = -1 < a.indexOf("trident/"),
  252. b = !(!d && !b),
  253. b = {
  254. ie: b,
  255. edge: !!d,
  256. webkit: !b && -1 < a.indexOf(" applewebkit/"),
  257. air: -1 < a.indexOf(" adobeair/"),
  258. mac: -1 < a.indexOf("macintosh"),
  259. quirks: "BackCompat" == document.compatMode && (!document.documentMode || 10 > document.documentMode),
  260. mobile: -1 < a.indexOf("mobile"),
  261. iOS: /(ipad|iphone|ipod)/.test(a),
  262. isCustomDomain: function() {
  263. if (!this.ie) return !1;
  264. var a = document.domain,
  265. b = window.location.hostname;
  266. return a != b && a != "[" + b + "]"
  267. },
  268. secure: "https:" == location.protocol
  269. };
  270. b.gecko = "Gecko" == navigator.product && !b.webkit && !b.ie;
  271. b.webkit && (-1 < a.indexOf("chrome") ? b.chrome = !0 : b.safari = !0);
  272. var c = 0;
  273. b.ie && (c = d ? parseFloat(d[1]) : b.quirks || !document.documentMode ? parseFloat(a.match(/msie (\d+)/)[
  274. 1]) : document.documentMode, b.ie9Compat = 9 == c, b.ie8Compat = 8 == c, b.ie7Compat = 7 == c, b
  275. .ie6Compat = 7 > c || b.quirks);
  276. b.gecko && (d = a.match(/rv:([\d\.]+)/)) && (d = d[1].split("."), c = 1E4 * d[0] + 100 * (d[1] || 0) + 1 * (d[
  277. 2] || 0));
  278. b.air && (c = parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
  279. b.webkit && (c = parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
  280. b.version = c;
  281. b.isCompatible = !(b.ie && 7 > c) && !(b.gecko && 4E4 > c) && !(b.webkit && 534 > c);
  282. b.hidpi = 2 <= window.devicePixelRatio;
  283. b.needsBrFiller = b.gecko || b.webkit || b.ie && 10 < c;
  284. b.needsNbspFiller = b.ie && 11 > c;
  285. b.cssClass = "cke_browser_" + (b.ie ? "ie" : b.gecko ? "gecko" : b.webkit ? "webkit" : "unknown");
  286. b.quirks && (b.cssClass += " cke_browser_quirks");
  287. b.ie && (b.cssClass += " cke_browser_ie" + (b.quirks ? "6 cke_browser_iequirks" : b.version));
  288. b.air && (b.cssClass += " cke_browser_air");
  289. b.iOS && (b.cssClass += " cke_browser_ios");
  290. b.hidpi && (b.cssClass += " cke_hidpi");
  291. return b
  292. }());
  293. "unloaded" == CKEDITOR.status && function() {
  294. CKEDITOR.event.implementOn(CKEDITOR);
  295. CKEDITOR.loadFullCore = function() {
  296. if ("basic_ready" != CKEDITOR.status) CKEDITOR.loadFullCore._load = 1;
  297. else {
  298. delete CKEDITOR.loadFullCore;
  299. var a = document.createElement("script");
  300. a.type = "text/javascript";
  301. a.src = CKEDITOR.basePath + "ckeditor.js";
  302. document.getElementsByTagName("head")[0].appendChild(a)
  303. }
  304. };
  305. CKEDITOR.loadFullCoreTimeout = 0;
  306. CKEDITOR.add = function(a) {
  307. (this._.pending || (this._.pending = [])).push(a)
  308. };
  309. (function() {
  310. CKEDITOR.domReady(function() {
  311. var a =
  312. CKEDITOR.loadFullCore,
  313. d = CKEDITOR.loadFullCoreTimeout;
  314. a && (CKEDITOR.status = "basic_ready", a && a._load ? a() : d && setTimeout(function() {
  315. CKEDITOR.loadFullCore && CKEDITOR.loadFullCore()
  316. }, 1E3 * d))
  317. })
  318. })();
  319. CKEDITOR.status = "basic_loaded"
  320. }();
  321. "use strict";
  322. CKEDITOR.VERBOSITY_WARN = 1;
  323. CKEDITOR.VERBOSITY_ERROR = 2;
  324. CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR;
  325. CKEDITOR.warn = function(a, d) {
  326. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN && CKEDITOR.fire("log", {
  327. type: "warn",
  328. errorCode: a,
  329. additionalData: d
  330. })
  331. };
  332. CKEDITOR.error = function(a, d) {
  333. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR && CKEDITOR.fire("log", {
  334. type: "error",
  335. errorCode: a,
  336. additionalData: d
  337. })
  338. };
  339. CKEDITOR.on("log", function(a) {
  340. if (window.console && window.console.log) {
  341. var d = console[a.data.type] ? a.data.type : "log",
  342. b = a.data.errorCode;
  343. if (a = a.data.additionalData) console[d]("[CKEDITOR] Error code: " + b + ".", a);
  344. else console[d]("[CKEDITOR] Error code: " + b + ".");
  345. console[d](
  346. "[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#" +
  347. b)
  348. }
  349. }, null, null, 999);
  350. CKEDITOR.dom = {};
  351. (function() {
  352. function a(a, b, c) {
  353. this._minInterval = a;
  354. this._context = c;
  355. this._lastOutput = this._scheduledTimer = 0;
  356. this._output = CKEDITOR.tools.bind(b, c || {});
  357. var f = this;
  358. this.input = function() {
  359. function a() {
  360. f._lastOutput = (new Date).getTime();
  361. f._scheduledTimer = 0;
  362. f._call()
  363. }
  364. if (!f._scheduledTimer || !1 !== f._reschedule()) {
  365. var w = (new Date).getTime() - f._lastOutput;
  366. w < f._minInterval ? f._scheduledTimer = setTimeout(a, f._minInterval - w) : a()
  367. }
  368. }
  369. }
  370. function d(w, b, c) {
  371. a.call(this, w, b, c);
  372. this._args = [];
  373. var f = this;
  374. this.input = CKEDITOR.tools.override(this.input,
  375. function(a) {
  376. return function() {
  377. f._args = Array.prototype.slice.call(arguments);
  378. a.call(this)
  379. }
  380. })
  381. }
  382. var b = [],
  383. c = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "",
  384. g = /&/g,
  385. e = />/g,
  386. h = /</g,
  387. k = /"/g,
  388. l = /&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,
  389. q = {
  390. lt: "\x3c",
  391. gt: "\x3e",
  392. amp: "\x26",
  393. quot: '"',
  394. nbsp: " ",
  395. shy: "­"
  396. },
  397. f = function(a, b) {
  398. return "#" == b[0] ? String.fromCharCode(parseInt(b.slice(1), 10)) : q[b]
  399. };
  400. CKEDITOR.on("reset", function() {
  401. b = []
  402. });
  403. CKEDITOR.tools = {
  404. arrayCompare: function(a, b) {
  405. if (!a && !b) return !0;
  406. if (!a || !b || a.length != b.length) return !1;
  407. for (var c = 0; c < a.length; c++)
  408. if (a[c] != b[c]) return !1;
  409. return !0
  410. },
  411. getIndex: function(a, b) {
  412. for (var c = 0; c < a.length; ++c)
  413. if (b(a[c])) return c;
  414. return -1
  415. },
  416. clone: function(a) {
  417. var b;
  418. if (a && a instanceof Array) {
  419. b = [];
  420. for (var c = 0; c < a.length; c++) b[c] = CKEDITOR.tools.clone(a[c]);
  421. return b
  422. }
  423. if (null === a || "object" != typeof a || a instanceof String || a instanceof Number ||
  424. a instanceof Boolean || a instanceof Date || a instanceof RegExp || a.nodeType || a.window === a)
  425. return a;
  426. b = new a.constructor;
  427. for (c in a) b[c] =
  428. CKEDITOR.tools.clone(a[c]);
  429. return b
  430. },
  431. capitalize: function(a, b) {
  432. return a.charAt(0).toUpperCase() + (b ? a.slice(1) : a.slice(1).toLowerCase())
  433. },
  434. extend: function(a) {
  435. var b = arguments.length,
  436. c, f;
  437. "boolean" == typeof(c = arguments[b - 1]) ? b-- : "boolean" == typeof(c = arguments[b - 2]) && (f =
  438. arguments[b - 1], b -= 2);
  439. for (var k = 1; k < b; k++) {
  440. var m = arguments[k] || {};
  441. CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(m), function(b) {
  442. if (!0 === c || null == a[b])
  443. if (!f || b in f) a[b] = m[b]
  444. })
  445. }
  446. return a
  447. },
  448. prototypedCopy: function(a) {
  449. var b = function() {};
  450. b.prototype = a;
  451. return new b
  452. },
  453. copy: function(a) {
  454. var b = {},
  455. c;
  456. for (c in a) b[c] = a[c];
  457. return b
  458. },
  459. isArray: function(a) {
  460. return "[object Array]" == Object.prototype.toString.call(a)
  461. },
  462. isEmpty: function(a) {
  463. for (var b in a)
  464. if (a.hasOwnProperty(b)) return !1;
  465. return !0
  466. },
  467. cssVendorPrefix: function(a, b, f) {
  468. if (f) return c + a + ":" + b + ";" + a + ":" + b;
  469. f = {};
  470. f[a] = b;
  471. f[c + a] = b;
  472. return f
  473. },
  474. cssStyleToDomStyle: function() {
  475. var a = document.createElement("div").style,
  476. b = "undefined" != typeof a.cssFloat ? "cssFloat" : "undefined" != typeof a.styleFloat ?
  477. "styleFloat" :
  478. "float";
  479. return function(a) {
  480. return "float" == a ? b : a.replace(/-./g, function(a) {
  481. return a.substr(1).toUpperCase()
  482. })
  483. }
  484. }(),
  485. buildStyleHtml: function(a) {
  486. a = [].concat(a);
  487. for (var b, c = [], f = 0; f < a.length; f++)
  488. if (b = a[f]) /@import|[{}]/.test(b) ? c.push("\x3cstyle\x3e" + b + "\x3c/style\x3e") : (b = CKEDITOR
  489. .appendTimestamp(b), c.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"' + b +
  490. '"\x3e'));
  491. return c.join("")
  492. },
  493. htmlEncode: function(a) {
  494. return void 0 === a || null === a ? "" : String(a).replace(g, "\x26amp;").replace(e, "\x26gt;").replace(
  495. h,
  496. "\x26lt;")
  497. },
  498. htmlDecode: function(a) {
  499. return a.replace(l, f)
  500. },
  501. htmlEncodeAttr: function(a) {
  502. return CKEDITOR.tools.htmlEncode(a).replace(k, "\x26quot;")
  503. },
  504. htmlDecodeAttr: function(a) {
  505. return CKEDITOR.tools.htmlDecode(a)
  506. },
  507. transformPlainTextToHtml: function(a, b) {
  508. var c = b == CKEDITOR.ENTER_BR,
  509. f = this.htmlEncode(a.replace(/\r\n/g, "\n")),
  510. f = f.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;"),
  511. k = b == CKEDITOR.ENTER_P ? "p" : "div";
  512. if (!c) {
  513. var m = /\n{2}/g;
  514. if (m.test(f)) var l = "\x3c" + k + "\x3e",
  515. e = "\x3c/" + k + "\x3e",
  516. f = l + f.replace(m, function() {
  517. return e +
  518. l
  519. }) + e
  520. }
  521. f = f.replace(/\n/g, "\x3cbr\x3e");
  522. c || (f = f.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/" + k + "\x3e)"), function(a) {
  523. return CKEDITOR.tools.repeat(a, 2)
  524. }));
  525. f = f.replace(/^ | $/g, "\x26nbsp;");
  526. return f = f.replace(/(>|\s) /g, function(a, b) {
  527. return b + "\x26nbsp;"
  528. }).replace(/ (?=<)/g, "\x26nbsp;")
  529. },
  530. getNextNumber: function() {
  531. var a = 0;
  532. return function() {
  533. return ++a
  534. }
  535. }(),
  536. getNextId: function() {
  537. return "cke_" + this.getNextNumber()
  538. },
  539. getUniqueId: function() {
  540. for (var a = "e", b = 0; 8 > b; b++) a += Math.floor(65536 * (1 + Math.random())).toString(16)
  541. .substring(1);
  542. return a
  543. },
  544. override: function(a, b) {
  545. var c = b(a);
  546. c.prototype = a.prototype;
  547. return c
  548. },
  549. setTimeout: function(a, b, c, f, k) {
  550. k || (k = window);
  551. c || (c = k);
  552. return k.setTimeout(function() {
  553. f ? a.apply(c, [].concat(f)) : a.apply(c)
  554. }, b || 0)
  555. },
  556. debounce: function(a, b) {
  557. var c;
  558. return function() {
  559. var f = this,
  560. k = arguments;
  561. clearTimeout(c);
  562. c = setTimeout(function() {
  563. c = null;
  564. a.apply(f, k)
  565. }, b)
  566. }
  567. },
  568. throttle: function(a, b, c) {
  569. return new this.buffers.throttle(a, b, c)
  570. },
  571. trim: function() {
  572. var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
  573. return function(b) {
  574. return b.replace(a,
  575. "")
  576. }
  577. }(),
  578. ltrim: function() {
  579. var a = /^[ \t\n\r]+/g;
  580. return function(b) {
  581. return b.replace(a, "")
  582. }
  583. }(),
  584. rtrim: function() {
  585. var a = /[ \t\n\r]+$/g;
  586. return function(b) {
  587. return b.replace(a, "")
  588. }
  589. }(),
  590. indexOf: function(a, b) {
  591. if ("function" == typeof b)
  592. for (var c = 0, f = a.length; c < f; c++) {
  593. if (b(a[c])) return c
  594. } else {
  595. if (a.indexOf) return a.indexOf(b);
  596. c = 0;
  597. for (f = a.length; c < f; c++)
  598. if (a[c] === b) return c
  599. }
  600. return -1
  601. },
  602. search: function(a, b) {
  603. var c = CKEDITOR.tools.indexOf(a, b);
  604. return 0 <= c ? a[c] : null
  605. },
  606. bind: function(a, b) {
  607. var c = Array.prototype.slice.call(arguments,
  608. 2);
  609. return function() {
  610. return a.apply(b, c.concat(Array.prototype.slice.call(arguments)))
  611. }
  612. },
  613. createClass: function(a) {
  614. var b = a.$,
  615. c = a.base,
  616. f = a.privates || a._,
  617. k = a.proto;
  618. a = a.statics;
  619. !b && (b = function() {
  620. c && this.base.apply(this, arguments)
  621. });
  622. if (f) var m = b,
  623. b = function() {
  624. var a = this._ || (this._ = {}),
  625. b;
  626. for (b in f) {
  627. var c = f[b];
  628. a[b] = "function" == typeof c ? CKEDITOR.tools.bind(c, this) : c
  629. }
  630. m.apply(this, arguments)
  631. };
  632. c && (b.prototype = this.prototypedCopy(c.prototype), b.prototype.constructor = b, b.base = c, b
  633. .baseProto = c.prototype, b.prototype.base =
  634. function v() {
  635. this.base = c.prototype.base;
  636. c.apply(this, arguments);
  637. this.base = v
  638. });
  639. k && this.extend(b.prototype, k, !0);
  640. a && this.extend(b, a, !0);
  641. return b
  642. },
  643. addFunction: function(a, c) {
  644. return b.push(function() {
  645. return a.apply(c || this, arguments)
  646. }) - 1
  647. },
  648. removeFunction: function(a) {
  649. b[a] = null
  650. },
  651. callFunction: function(a) {
  652. var c = b[a];
  653. return c && c.apply(window, Array.prototype.slice.call(arguments, 1))
  654. },
  655. cssLength: function() {
  656. var a = /^-?\d+\.?\d*px$/,
  657. b;
  658. return function(c) {
  659. b = CKEDITOR.tools.trim(c + "") + "px";
  660. return a.test(b) ? b : c || ""
  661. }
  662. }(),
  663. convertToPx: function() {
  664. var a, b;
  665. return function(c) {
  666. if (!a || a.isDetached()) a = CKEDITOR.dom.element.createFromHtml(
  667. '\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"\x3e\x3c/div\x3e',
  668. CKEDITOR.document), CKEDITOR.document.getBody().append(a);
  669. if (!/%$/.test(c)) {
  670. var f = 0 > parseFloat(c);
  671. f && (c = c.replace("-", ""));
  672. a.setStyle("width", c);
  673. b = a.getClientRect();
  674. c = Math.round(b.width);
  675. return f ? -c : c
  676. }
  677. return c
  678. }
  679. }(),
  680. repeat: function(a, b) {
  681. return Array(b + 1).join(a)
  682. },
  683. tryThese: function() {
  684. for (var a,
  685. b = 0, c = arguments.length; b < c; b++) {
  686. var f = arguments[b];
  687. try {
  688. a = f();
  689. break
  690. } catch (k) {}
  691. }
  692. return a
  693. },
  694. genKey: function() {
  695. return Array.prototype.slice.call(arguments).join("-")
  696. },
  697. defer: function(a) {
  698. return function() {
  699. var b = arguments,
  700. c = this;
  701. window.setTimeout(function() {
  702. a.apply(c, b)
  703. }, 0)
  704. }
  705. },
  706. normalizeCssText: function(a, b) {
  707. var c = [],
  708. f, k = CKEDITOR.tools.parseCssText(a, !0, b);
  709. for (f in k) c.push(f + ":" + k[f]);
  710. c.sort();
  711. return c.length ? c.join(";") + ";" : ""
  712. },
  713. convertRgbToHex: function(a) {
  714. return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,
  715. function(a, b, c, f) {
  716. a = [b, c, f];
  717. for (b = 0; 3 > b; b++) a[b] = ("0" + parseInt(a[b], 10).toString(16)).slice(-2);
  718. return "#" + a.join("")
  719. })
  720. },
  721. normalizeHex: function(a) {
  722. return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi, function(a, b, c, f) {
  723. a = b.toLowerCase();
  724. 3 == a.length && (a = a.split(""), a = [a[0], a[0], a[1], a[1], a[2], a[2]].join(""));
  725. return "#" + a + f
  726. })
  727. },
  728. _isValidColorFormat: function(a) {
  729. if (!a) return !1;
  730. a = a.replace(/\s+/g, "");
  731. return /^[a-z0-9()#%,./]+$/i.test(a)
  732. },
  733. parseCssText: function(a, b, c) {
  734. var f = {};
  735. c && (a = (new CKEDITOR.dom.element("span")).setAttribute("style",
  736. a).getAttribute("style") || "");
  737. a && (a = CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));
  738. if (!a || ";" == a) return f;
  739. a.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, c, w) {
  740. b && (c = c.toLowerCase(), "font-family" == c && (w = w.replace(/\s*,\s*/g, ",")), w = CKEDITOR
  741. .tools.trim(w));
  742. f[c] = w
  743. });
  744. return f
  745. },
  746. writeCssText: function(a, b) {
  747. var c, f = [];
  748. for (c in a) f.push(c + ":" + a[c]);
  749. b && f.sort();
  750. return f.join("; ")
  751. },
  752. objectCompare: function(a, b, c) {
  753. var f;
  754. if (!a && !b) return !0;
  755. if (!a || !b) return !1;
  756. for (f in a)
  757. if (a[f] != b[f]) return !1;
  758. if (!c)
  759. for (f in b)
  760. if (a[f] != b[f]) return !1;
  761. return !0
  762. },
  763. objectKeys: function(a) {
  764. return CKEDITOR.tools.object.keys(a)
  765. },
  766. convertArrayToObject: function(a, b) {
  767. var c = {};
  768. 1 == arguments.length && (b = !0);
  769. for (var f = 0, k = a.length; f < k; ++f) c[a[f]] = b;
  770. return c
  771. },
  772. getStyledSpans: function(a, b) {
  773. var c = CKEDITOR.env.ie && 8 == CKEDITOR.env.version ? a.toUpperCase() : a,
  774. c = b.find("span[style*\x3d" + c + "]").toArray();
  775. return CKEDITOR.tools.array.filter(c, function(b) {
  776. return !!b.getStyle(a)
  777. })
  778. },
  779. fixDomain: function() {
  780. for (var a;;) try {
  781. a =
  782. window.parent.document.domain;
  783. break
  784. } catch (b) {
  785. a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain;
  786. if (!a) break;
  787. document.domain = a
  788. }
  789. return !!a
  790. },
  791. eventsBuffer: function(a, b, c) {
  792. return new this.buffers.event(a, b, c)
  793. },
  794. enableHtml5Elements: function(a, b) {
  795. for (var c =
  796. "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video"
  797. .split(" "), f = c.length, k; f--;) k = a.createElement(c[f]), b && a.appendChild(k)
  798. },
  799. checkIfAnyArrayItemMatches: function(a,
  800. b) {
  801. for (var c = 0, f = a.length; c < f; ++c)
  802. if (a[c].match(b)) return !0;
  803. return !1
  804. },
  805. checkIfAnyObjectPropertyMatches: function(a, b) {
  806. for (var c in a)
  807. if (c.match(b)) return !0;
  808. return !1
  809. },
  810. keystrokeToString: function(a, b) {
  811. var c = this.keystrokeToArray(a, b);
  812. c.display = c.display.join("+");
  813. c.aria = c.aria.join("+");
  814. return c
  815. },
  816. keystrokeToArray: function(a, b) {
  817. var c = b & 16711680,
  818. f = b & 65535,
  819. k = CKEDITOR.env.mac,
  820. m = [],
  821. l = [];
  822. c & CKEDITOR.CTRL && (m.push(k ? "⌘" : a[17]), l.push(k ? a[224] : a[17]));
  823. c & CKEDITOR.ALT && (m.push(k ? "⌥" : a[18]), l.push(a[18]));
  824. c & CKEDITOR.SHIFT &&
  825. (m.push(k ? "⇧" : a[16]), l.push(a[16]));
  826. f && (a[f] ? (m.push(a[f]), l.push(a[f])) : (m.push(String.fromCharCode(f)), l.push(String.fromCharCode(
  827. f))));
  828. return {
  829. display: m,
  830. aria: l
  831. }
  832. },
  833. transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",
  834. getCookie: function(a) {
  835. a = a.toLowerCase();
  836. for (var b = document.cookie.split(";"), c, f, k = 0; k < b.length; k++)
  837. if (c = b[k].split("\x3d"), f = decodeURIComponent(CKEDITOR.tools.trim(c[0]).toLowerCase()), f === a)
  838. return decodeURIComponent(1 < c.length ?
  839. c[1] : "");
  840. return null
  841. },
  842. setCookie: function(a, b) {
  843. document.cookie = encodeURIComponent(a) + "\x3d" + encodeURIComponent(b) + ";path\x3d/"
  844. },
  845. getCsrfToken: function() {
  846. var a = CKEDITOR.tools.getCookie("ckCsrfToken");
  847. if (!a || 40 != a.length) {
  848. var a = [],
  849. b = "";
  850. if (window.crypto && window.crypto.getRandomValues) a = new Uint8Array(40), window.crypto
  851. .getRandomValues(a);
  852. else
  853. for (var c = 0; 40 > c; c++) a.push(Math.floor(256 * Math.random()));
  854. for (c = 0; c < a.length; c++) var f = "abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[c] % 36),
  855. b = b + (.5 < Math.random() ?
  856. f.toUpperCase() : f);
  857. a = b;
  858. CKEDITOR.tools.setCookie("ckCsrfToken", a)
  859. }
  860. return a
  861. },
  862. escapeCss: function(a) {
  863. if (a)
  864. if (window.CSS && CSS.escape) a = CSS.escape(a);
  865. else {
  866. a = String(a);
  867. for (var b = a.length, c = -1, f, k = "", m = a.charCodeAt(0); ++c < b;) f = a.charCodeAt(c), k =
  868. 0 == f ? k + "�" : 127 == f || 1 <= f && 31 >= f || 0 == c && 48 <= f && 57 >= f || 1 == c &&
  869. 48 <= f && 57 >= f && 45 == m ? k + ("\\" + f.toString(16) + " ") : 0 == c && 1 == b && 45 == f ?
  870. k + ("\\" + a.charAt(c)) : 128 <= f || 45 == f || 95 == f || 48 <= f && 57 >= f || 65 <= f &&
  871. 90 >= f || 97 <= f && 122 >= f ? k + a.charAt(c) : k + ("\\" + a.charAt(c));
  872. a = k
  873. }
  874. else a = "";
  875. return a
  876. },
  877. getMouseButton: function(a) {
  878. return (a = a && a.data ? a.data.$ : a) ? CKEDITOR.tools.normalizeMouseButton(a.button) : !1
  879. },
  880. normalizeMouseButton: function(a, b) {
  881. if (!CKEDITOR.env.ie || 9 <= CKEDITOR.env.version && !CKEDITOR.env.ie6Compat) return a;
  882. for (var c = [
  883. [CKEDITOR.MOUSE_BUTTON_LEFT, 1],
  884. [CKEDITOR.MOUSE_BUTTON_MIDDLE, 4],
  885. [CKEDITOR.MOUSE_BUTTON_RIGHT, 2]
  886. ], f = 0; f < c.length; f++) {
  887. var k = c[f];
  888. if (k[0] === a && b) return k[1];
  889. if (!b && k[1] === a) return k[0]
  890. }
  891. },
  892. convertHexStringToBytes: function(a) {
  893. var b = [],
  894. c = a.length / 2,
  895. f;
  896. for (f = 0; f < c; f++) b.push(parseInt(a.substr(2 *
  897. f, 2), 16));
  898. return b
  899. },
  900. convertBytesToBase64: function(a) {
  901. var b = "",
  902. c = a.length,
  903. f;
  904. for (f = 0; f < c; f += 3) {
  905. var k = a.slice(f, f + 3),
  906. m = k.length,
  907. l = [],
  908. e;
  909. if (3 > m)
  910. for (e = m; 3 > e; e++) k[e] = 0;
  911. l[0] = (k[0] & 252) >> 2;
  912. l[1] = (k[0] & 3) << 4 | k[1] >> 4;
  913. l[2] = (k[1] & 15) << 2 | (k[2] & 192) >> 6;
  914. l[3] = k[2] & 63;
  915. for (e = 0; 4 > e; e++) b = e <= m ? b +
  916. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l[e]) : b + "\x3d"
  917. }
  918. return b
  919. },
  920. style: {
  921. parse: {
  922. _borderStyle: "none hidden dotted dashed solid double groove ridge inset outset".split(" "),
  923. _widthRegExp: /^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,
  924. _rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  925. _hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  926. background: function(a) {
  927. var b = {},
  928. c = this._findColor(a);
  929. c.length && (b.color = c[0], CKEDITOR.tools.array.forEach(c, function(b) {
  930. a = a.replace(b, "")
  931. }));
  932. if (a = CKEDITOR.tools.trim(a)) b.unprocessed = a;
  933. return b
  934. },
  935. margin: function(a) {
  936. return CKEDITOR.tools.style.parse.sideShorthand(a, function(a) {
  937. return a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g) || ["0px"]
  938. })
  939. },
  940. sideShorthand: function(a, b) {
  941. function c(a) {
  942. f.top = k[a[0]];
  943. f.right = k[a[1]];
  944. f.bottom = k[a[2]];
  945. f.left = k[a[3]]
  946. }
  947. var f = {},
  948. k = b ? b(a) : a.split(/\s+/);
  949. switch (k.length) {
  950. case 1:
  951. c([0, 0, 0, 0]);
  952. break;
  953. case 2:
  954. c([0, 1, 0, 1]);
  955. break;
  956. case 3:
  957. c([0, 1, 2, 1]);
  958. break;
  959. case 4:
  960. c([0, 1, 2, 3])
  961. }
  962. return f
  963. },
  964. border: function(a) {
  965. return CKEDITOR.tools.style.border.fromCssRule(a)
  966. },
  967. _findColor: function(a) {
  968. var b = [],
  969. c = CKEDITOR.tools.array,
  970. b = b.concat(a.match(this._rgbaRegExp) || []),
  971. b = b.concat(a.match(this._hslaRegExp) || []);
  972. return b = b.concat(c.filter(a.split(/\s+/),
  973. function(a) {
  974. return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi) ? !0 : a.toLowerCase() in CKEDITOR.tools
  975. .style.parse._colors
  976. }))
  977. }
  978. }
  979. },
  980. array: {
  981. filter: function(a, b, c) {
  982. var f = [];
  983. this.forEach(a, function(k, m) {
  984. b.call(c, k, m, a) && f.push(k)
  985. });
  986. return f
  987. },
  988. find: function(a, b, c) {
  989. for (var f = a.length, k = 0; k < f;) {
  990. if (b.call(c, a[k], k, a)) return a[k];
  991. k++
  992. }
  993. },
  994. forEach: function(a, b, c) {
  995. var f = a.length,
  996. k;
  997. for (k = 0; k < f; k++) b.call(c, a[k], k, a)
  998. },
  999. map: function(a, b, c) {
  1000. for (var f = [], k = 0; k < a.length; k++) f.push(b.call(c, a[k], k, a));
  1001. return f
  1002. },
  1003. reduce: function(a,
  1004. b, c, f) {
  1005. for (var k = 0; k < a.length; k++) c = b.call(f, c, a[k], k, a);
  1006. return c
  1007. },
  1008. every: function(a, b, c) {
  1009. if (!a.length) return !0;
  1010. b = this.filter(a, b, c);
  1011. return a.length === b.length
  1012. },
  1013. some: function(a, b, c) {
  1014. for (var f = 0; f < a.length; f++)
  1015. if (b.call(c, a[f], f, a)) return !0;
  1016. return !1
  1017. },
  1018. zip: function(a, b) {
  1019. return CKEDITOR.tools.array.map(a, function(a, c) {
  1020. return [a, b[c]]
  1021. })
  1022. },
  1023. unique: function(a) {
  1024. return this.filter(a, function(b, c) {
  1025. return c === CKEDITOR.tools.array.indexOf(a, b)
  1026. })
  1027. }
  1028. },
  1029. object: {
  1030. DONT_ENUMS: "toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor"
  1031. .split(" "),
  1032. entries: function(a) {
  1033. return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(a), function(b) {
  1034. return [b, a[b]]
  1035. })
  1036. },
  1037. values: function(a) {
  1038. return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(a), function(b) {
  1039. return a[b]
  1040. })
  1041. },
  1042. keys: function(a) {
  1043. var b = Object.prototype.hasOwnProperty,
  1044. c = [],
  1045. f = CKEDITOR.tools.object.DONT_ENUMS;
  1046. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (!a || "object" !== typeof a)) {
  1047. b = [];
  1048. if ("string" === typeof a)
  1049. for (c = 0; c < a.length; c++) b.push(String(c));
  1050. return b
  1051. }
  1052. for (var k in a) c.push(k);
  1053. if (CKEDITOR.env.ie &&
  1054. 9 > CKEDITOR.env.version)
  1055. for (k = 0; k < f.length; k++) b.call(a, f[k]) && c.push(f[k]);
  1056. return c
  1057. },
  1058. findKey: function(a, b) {
  1059. if ("object" !== typeof a) return null;
  1060. for (var c in a)
  1061. if (a[c] === b) return c;
  1062. return null
  1063. },
  1064. merge: function(a, b) {
  1065. var c = CKEDITOR.tools,
  1066. f = c.clone(a),
  1067. k = c.clone(b);
  1068. c.array.forEach(c.object.keys(k), function(a) {
  1069. f[a] = "object" === typeof k[a] && "object" === typeof f[a] ? c.object.merge(f[a], k[a]) : k[a]
  1070. });
  1071. return f
  1072. }
  1073. },
  1074. getAbsoluteRectPosition: function(a, b) {
  1075. function c(a) {
  1076. if (a) {
  1077. var b = a.getClientRect();
  1078. f.top += b.top;
  1079. f.left +=
  1080. b.left;
  1081. "x" in f && "y" in f && (f.x += b.x, f.y += b.y);
  1082. c(a.getWindow().getFrame())
  1083. }
  1084. }
  1085. var f = CKEDITOR.tools.copy(b);
  1086. c(a.getFrame());
  1087. var k = CKEDITOR.document.getWindow().getScrollPosition();
  1088. f.top += k.y;
  1089. f.left += k.x;
  1090. "x" in f && "y" in f && (f.y += k.y, f.x += k.x);
  1091. f.right = f.left + f.width;
  1092. f.bottom = f.top + f.height;
  1093. return f
  1094. }
  1095. };
  1096. a.prototype = {
  1097. reset: function() {
  1098. this._lastOutput = 0;
  1099. this._clearTimer()
  1100. },
  1101. _reschedule: function() {
  1102. return !1
  1103. },
  1104. _call: function() {
  1105. this._output()
  1106. },
  1107. _clearTimer: function() {
  1108. this._scheduledTimer && clearTimeout(this._scheduledTimer);
  1109. this._scheduledTimer = 0
  1110. }
  1111. };
  1112. d.prototype = CKEDITOR.tools.prototypedCopy(a.prototype);
  1113. d.prototype._reschedule = function() {
  1114. this._scheduledTimer && this._clearTimer()
  1115. };
  1116. d.prototype._call = function() {
  1117. this._output.apply(this._context, this._args)
  1118. };
  1119. CKEDITOR.tools.buffers = {};
  1120. CKEDITOR.tools.buffers.event = a;
  1121. CKEDITOR.tools.buffers.throttle = d;
  1122. CKEDITOR.tools.style.border = CKEDITOR.tools.createClass({
  1123. $: function(a) {
  1124. a = a || {};
  1125. this.width = a.width;
  1126. this.style = a.style;
  1127. this.color = a.color;
  1128. this._.normalize()
  1129. },
  1130. _: {
  1131. normalizeMap: {
  1132. color: [
  1133. [/windowtext/g,
  1134. "black"
  1135. ]
  1136. ]
  1137. },
  1138. normalize: function() {
  1139. for (var a in this._.normalizeMap) {
  1140. var b = this[a];
  1141. b && (this[a] = CKEDITOR.tools.array.reduce(this._.normalizeMap[a], function(a, b) {
  1142. return a.replace(b[0], b[1])
  1143. }, b))
  1144. }
  1145. }
  1146. },
  1147. proto: {
  1148. toString: function() {
  1149. return CKEDITOR.tools.array.filter([this.width, this.style, this.color], function(a) {
  1150. return !!a
  1151. }).join(" ")
  1152. }
  1153. },
  1154. statics: {
  1155. fromCssRule: function(a) {
  1156. var b = {},
  1157. c = a.split(/\s+/g);
  1158. a = CKEDITOR.tools.style.parse._findColor(a);
  1159. a.length && (b.color = a[0]);
  1160. CKEDITOR.tools.array.forEach(c, function(a) {
  1161. b.style ||
  1162. -1 === CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle, a) ? !b.width &&
  1163. CKEDITOR.tools.style.parse._widthRegExp.test(a) && (b.width = a) : b.style = a
  1164. });
  1165. return new CKEDITOR.tools.style.border(b)
  1166. },
  1167. splitCssValues: function(a, b) {
  1168. b = b || {};
  1169. var c = CKEDITOR.tools.array.reduce(["width", "style", "color"], function(c, f) {
  1170. var k = a["border-" + f] || b[f];
  1171. c[f] = k ? CKEDITOR.tools.style.parse.sideShorthand(k) : null;
  1172. return c
  1173. }, {});
  1174. return CKEDITOR.tools.array.reduce(["top", "right", "bottom", "left"], function(b, f) {
  1175. var k = {},
  1176. l;
  1177. for (l in c) {
  1178. var e =
  1179. a["border-" + f + "-" + l];
  1180. k[l] = e ? e : c[l] && c[l][f]
  1181. }
  1182. b["border-" + f] = new CKEDITOR.tools.style.border(k);
  1183. return b
  1184. }, {})
  1185. }
  1186. }
  1187. });
  1188. CKEDITOR.tools.array.indexOf = CKEDITOR.tools.indexOf;
  1189. CKEDITOR.tools.array.isArray = CKEDITOR.tools.isArray;
  1190. CKEDITOR.MOUSE_BUTTON_LEFT = 0;
  1191. CKEDITOR.MOUSE_BUTTON_MIDDLE = 1;
  1192. CKEDITOR.MOUSE_BUTTON_RIGHT = 2
  1193. })();
  1194. CKEDITOR.dtd = function() {
  1195. var a = CKEDITOR.tools.extend,
  1196. d = function(a, b) {
  1197. for (var c = CKEDITOR.tools.clone(a), k = 1; k < arguments.length; k++) {
  1198. b = arguments[k];
  1199. for (var l in b) delete c[l]
  1200. }
  1201. return c
  1202. },
  1203. b = {},
  1204. c = {},
  1205. g = {
  1206. address: 1,
  1207. article: 1,
  1208. aside: 1,
  1209. blockquote: 1,
  1210. details: 1,
  1211. div: 1,
  1212. dl: 1,
  1213. fieldset: 1,
  1214. figure: 1,
  1215. footer: 1,
  1216. form: 1,
  1217. h1: 1,
  1218. h2: 1,
  1219. h3: 1,
  1220. h4: 1,
  1221. h5: 1,
  1222. h6: 1,
  1223. header: 1,
  1224. hgroup: 1,
  1225. hr: 1,
  1226. main: 1,
  1227. menu: 1,
  1228. nav: 1,
  1229. ol: 1,
  1230. p: 1,
  1231. pre: 1,
  1232. section: 1,
  1233. table: 1,
  1234. ul: 1
  1235. },
  1236. e = {
  1237. command: 1,
  1238. link: 1,
  1239. meta: 1,
  1240. noscript: 1,
  1241. script: 1,
  1242. style: 1
  1243. },
  1244. h = {},
  1245. k = {
  1246. "#": 1
  1247. },
  1248. l = {
  1249. center: 1,
  1250. dir: 1,
  1251. noframes: 1
  1252. };
  1253. a(b, {
  1254. a: 1,
  1255. abbr: 1,
  1256. area: 1,
  1257. audio: 1,
  1258. b: 1,
  1259. bdi: 1,
  1260. bdo: 1,
  1261. br: 1,
  1262. button: 1,
  1263. canvas: 1,
  1264. cite: 1,
  1265. code: 1,
  1266. command: 1,
  1267. datalist: 1,
  1268. del: 1,
  1269. dfn: 1,
  1270. em: 1,
  1271. embed: 1,
  1272. i: 1,
  1273. iframe: 1,
  1274. img: 1,
  1275. input: 1,
  1276. ins: 1,
  1277. kbd: 1,
  1278. keygen: 1,
  1279. label: 1,
  1280. map: 1,
  1281. mark: 1,
  1282. meter: 1,
  1283. noscript: 1,
  1284. object: 1,
  1285. output: 1,
  1286. progress: 1,
  1287. q: 1,
  1288. ruby: 1,
  1289. s: 1,
  1290. samp: 1,
  1291. script: 1,
  1292. select: 1,
  1293. small: 1,
  1294. span: 1,
  1295. strong: 1,
  1296. sub: 1,
  1297. sup: 1,
  1298. textarea: 1,
  1299. time: 1,
  1300. u: 1,
  1301. "var": 1,
  1302. video: 1,
  1303. wbr: 1
  1304. }, k, {
  1305. acronym: 1,
  1306. applet: 1,
  1307. basefont: 1,
  1308. big: 1,
  1309. font: 1,
  1310. isindex: 1,
  1311. strike: 1,
  1312. style: 1,
  1313. tt: 1
  1314. });
  1315. a(c, g, b, l);
  1316. d = {
  1317. a: d(b, {
  1318. a: 1,
  1319. button: 1
  1320. }),
  1321. abbr: b,
  1322. address: c,
  1323. area: h,
  1324. article: c,
  1325. aside: c,
  1326. audio: a({
  1327. source: 1,
  1328. track: 1
  1329. }, c),
  1330. b: b,
  1331. base: h,
  1332. bdi: b,
  1333. bdo: b,
  1334. blockquote: c,
  1335. body: c,
  1336. br: h,
  1337. button: d(b, {
  1338. a: 1,
  1339. button: 1
  1340. }),
  1341. canvas: b,
  1342. caption: c,
  1343. cite: b,
  1344. code: b,
  1345. col: h,
  1346. colgroup: {
  1347. col: 1
  1348. },
  1349. command: h,
  1350. datalist: a({
  1351. option: 1
  1352. }, b),
  1353. dd: c,
  1354. del: b,
  1355. details: a({
  1356. summary: 1
  1357. }, c),
  1358. dfn: b,
  1359. div: c,
  1360. dl: {
  1361. dt: 1,
  1362. dd: 1
  1363. },
  1364. dt: c,
  1365. em: b,
  1366. embed: h,
  1367. fieldset: a({
  1368. legend: 1
  1369. }, c),
  1370. figcaption: c,
  1371. figure: a({
  1372. figcaption: 1
  1373. }, c),
  1374. footer: c,
  1375. form: c,
  1376. h1: b,
  1377. h2: b,
  1378. h3: b,
  1379. h4: b,
  1380. h5: b,
  1381. h6: b,
  1382. head: a({
  1383. title: 1,
  1384. base: 1
  1385. }, e),
  1386. header: c,
  1387. hgroup: {
  1388. h1: 1,
  1389. h2: 1,
  1390. h3: 1,
  1391. h4: 1,
  1392. h5: 1,
  1393. h6: 1
  1394. },
  1395. hr: h,
  1396. html: a({
  1397. head: 1,
  1398. body: 1
  1399. }, c, e),
  1400. i: b,
  1401. iframe: k,
  1402. img: h,
  1403. input: h,
  1404. ins: b,
  1405. kbd: b,
  1406. keygen: h,
  1407. label: b,
  1408. legend: b,
  1409. li: c,
  1410. link: h,
  1411. main: c,
  1412. map: c,
  1413. mark: b,
  1414. menu: a({
  1415. li: 1
  1416. }, c),
  1417. meta: h,
  1418. meter: d(b, {
  1419. meter: 1
  1420. }),
  1421. nav: c,
  1422. noscript: a({
  1423. link: 1,
  1424. meta: 1,
  1425. style: 1
  1426. }, b),
  1427. object: a({
  1428. param: 1
  1429. }, b),
  1430. ol: {
  1431. li: 1
  1432. },
  1433. optgroup: {
  1434. option: 1
  1435. },
  1436. option: k,
  1437. output: b,
  1438. p: b,
  1439. param: h,
  1440. pre: b,
  1441. progress: d(b, {
  1442. progress: 1
  1443. }),
  1444. q: b,
  1445. rp: b,
  1446. rt: b,
  1447. ruby: a({
  1448. rp: 1,
  1449. rt: 1
  1450. }, b),
  1451. s: b,
  1452. samp: b,
  1453. script: k,
  1454. section: c,
  1455. select: {
  1456. optgroup: 1,
  1457. option: 1
  1458. },
  1459. small: b,
  1460. source: h,
  1461. span: b,
  1462. strong: b,
  1463. style: k,
  1464. sub: b,
  1465. summary: a({
  1466. h1: 1,
  1467. h2: 1,
  1468. h3: 1,
  1469. h4: 1,
  1470. h5: 1,
  1471. h6: 1
  1472. }, b),
  1473. sup: b,
  1474. table: {
  1475. caption: 1,
  1476. colgroup: 1,
  1477. thead: 1,
  1478. tfoot: 1,
  1479. tbody: 1,
  1480. tr: 1
  1481. },
  1482. tbody: {
  1483. tr: 1
  1484. },
  1485. td: c,
  1486. textarea: k,
  1487. tfoot: {
  1488. tr: 1
  1489. },
  1490. th: c,
  1491. thead: {
  1492. tr: 1
  1493. },
  1494. time: d(b, {
  1495. time: 1
  1496. }),
  1497. title: k,
  1498. tr: {
  1499. th: 1,
  1500. td: 1
  1501. },
  1502. track: h,
  1503. u: b,
  1504. ul: {
  1505. li: 1
  1506. },
  1507. "var": b,
  1508. video: a({
  1509. source: 1,
  1510. track: 1
  1511. }, c),
  1512. wbr: h,
  1513. acronym: b,
  1514. applet: a({
  1515. param: 1
  1516. }, c),
  1517. basefont: h,
  1518. big: b,
  1519. center: c,
  1520. dialog: h,
  1521. dir: {
  1522. li: 1
  1523. },
  1524. font: b,
  1525. isindex: h,
  1526. noframes: c,
  1527. strike: b,
  1528. tt: b
  1529. };
  1530. a(d, {
  1531. $block: a({
  1532. audio: 1,
  1533. dd: 1,
  1534. dt: 1,
  1535. figcaption: 1,
  1536. li: 1,
  1537. video: 1
  1538. }, g, l),
  1539. $blockLimit: {
  1540. article: 1,
  1541. aside: 1,
  1542. audio: 1,
  1543. body: 1,
  1544. caption: 1,
  1545. details: 1,
  1546. dir: 1,
  1547. div: 1,
  1548. dl: 1,
  1549. fieldset: 1,
  1550. figcaption: 1,
  1551. figure: 1,
  1552. footer: 1,
  1553. form: 1,
  1554. header: 1,
  1555. hgroup: 1,
  1556. main: 1,
  1557. menu: 1,
  1558. nav: 1,
  1559. ol: 1,
  1560. section: 1,
  1561. table: 1,
  1562. td: 1,
  1563. th: 1,
  1564. tr: 1,
  1565. ul: 1,
  1566. video: 1
  1567. },
  1568. $cdata: {
  1569. script: 1,
  1570. style: 1
  1571. },
  1572. $editable: {
  1573. address: 1,
  1574. article: 1,
  1575. aside: 1,
  1576. blockquote: 1,
  1577. body: 1,
  1578. details: 1,
  1579. div: 1,
  1580. fieldset: 1,
  1581. figcaption: 1,
  1582. footer: 1,
  1583. form: 1,
  1584. h1: 1,
  1585. h2: 1,
  1586. h3: 1,
  1587. h4: 1,
  1588. h5: 1,
  1589. h6: 1,
  1590. header: 1,
  1591. hgroup: 1,
  1592. main: 1,
  1593. nav: 1,
  1594. p: 1,
  1595. pre: 1,
  1596. section: 1
  1597. },
  1598. $empty: {
  1599. area: 1,
  1600. base: 1,
  1601. basefont: 1,
  1602. br: 1,
  1603. col: 1,
  1604. command: 1,
  1605. dialog: 1,
  1606. embed: 1,
  1607. hr: 1,
  1608. img: 1,
  1609. input: 1,
  1610. isindex: 1,
  1611. keygen: 1,
  1612. link: 1,
  1613. meta: 1,
  1614. param: 1,
  1615. source: 1,
  1616. track: 1,
  1617. wbr: 1
  1618. },
  1619. $inline: b,
  1620. $list: {
  1621. dl: 1,
  1622. ol: 1,
  1623. ul: 1
  1624. },
  1625. $listItem: {
  1626. dd: 1,
  1627. dt: 1,
  1628. li: 1
  1629. },
  1630. $nonBodyContent: a({
  1631. body: 1,
  1632. head: 1,
  1633. html: 1
  1634. }, d.head),
  1635. $nonEditable: {
  1636. applet: 1,
  1637. audio: 1,
  1638. button: 1,
  1639. embed: 1,
  1640. iframe: 1,
  1641. map: 1,
  1642. object: 1,
  1643. option: 1,
  1644. param: 1,
  1645. script: 1,
  1646. textarea: 1,
  1647. video: 1
  1648. },
  1649. $object: {
  1650. applet: 1,
  1651. audio: 1,
  1652. button: 1,
  1653. hr: 1,
  1654. iframe: 1,
  1655. img: 1,
  1656. input: 1,
  1657. object: 1,
  1658. select: 1,
  1659. table: 1,
  1660. textarea: 1,
  1661. video: 1
  1662. },
  1663. $removeEmpty: {
  1664. abbr: 1,
  1665. acronym: 1,
  1666. b: 1,
  1667. bdi: 1,
  1668. bdo: 1,
  1669. big: 1,
  1670. cite: 1,
  1671. code: 1,
  1672. del: 1,
  1673. dfn: 1,
  1674. em: 1,
  1675. font: 1,
  1676. i: 1,
  1677. ins: 1,
  1678. label: 1,
  1679. kbd: 1,
  1680. mark: 1,
  1681. meter: 1,
  1682. output: 1,
  1683. q: 1,
  1684. ruby: 1,
  1685. s: 1,
  1686. samp: 1,
  1687. small: 1,
  1688. span: 1,
  1689. strike: 1,
  1690. strong: 1,
  1691. sub: 1,
  1692. sup: 1,
  1693. time: 1,
  1694. tt: 1,
  1695. u: 1,
  1696. "var": 1
  1697. },
  1698. $tabIndex: {
  1699. a: 1,
  1700. area: 1,
  1701. button: 1,
  1702. input: 1,
  1703. object: 1,
  1704. select: 1,
  1705. textarea: 1
  1706. },
  1707. $tableContent: {
  1708. caption: 1,
  1709. col: 1,
  1710. colgroup: 1,
  1711. tbody: 1,
  1712. td: 1,
  1713. tfoot: 1,
  1714. th: 1,
  1715. thead: 1,
  1716. tr: 1
  1717. },
  1718. $transparent: {
  1719. a: 1,
  1720. audio: 1,
  1721. canvas: 1,
  1722. del: 1,
  1723. ins: 1,
  1724. map: 1,
  1725. noscript: 1,
  1726. object: 1,
  1727. video: 1
  1728. },
  1729. $intermediate: {
  1730. caption: 1,
  1731. colgroup: 1,
  1732. dd: 1,
  1733. dt: 1,
  1734. figcaption: 1,
  1735. legend: 1,
  1736. li: 1,
  1737. optgroup: 1,
  1738. option: 1,
  1739. rp: 1,
  1740. rt: 1,
  1741. summary: 1,
  1742. tbody: 1,
  1743. td: 1,
  1744. tfoot: 1,
  1745. th: 1,
  1746. thead: 1,
  1747. tr: 1
  1748. }
  1749. });
  1750. return d
  1751. }();
  1752. CKEDITOR.dom.event = function(a) {
  1753. this.$ = a
  1754. };
  1755. CKEDITOR.dom.event.prototype = {
  1756. getKey: function() {
  1757. return this.$.keyCode || this.$.which
  1758. },
  1759. getKeystroke: function() {
  1760. var a = this.getKey();
  1761. if (this.$.ctrlKey || this.$.metaKey) a += CKEDITOR.CTRL;
  1762. this.$.shiftKey && (a += CKEDITOR.SHIFT);
  1763. this.$.altKey && (a += CKEDITOR.ALT);
  1764. return a
  1765. },
  1766. preventDefault: function(a) {
  1767. var d = this.$;
  1768. d.preventDefault ? d.preventDefault() : d.returnValue = !1;
  1769. a && this.stopPropagation()
  1770. },
  1771. stopPropagation: function() {
  1772. var a = this.$;
  1773. a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0
  1774. },
  1775. getTarget: function() {
  1776. var a =
  1777. this.$.target || this.$.srcElement;
  1778. return a ? new CKEDITOR.dom.node(a) : null
  1779. },
  1780. getPhase: function() {
  1781. return this.$.eventPhase || 2
  1782. },
  1783. getPageOffset: function() {
  1784. var a = this.getTarget().getDocument().$;
  1785. return {
  1786. x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft),
  1787. y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop)
  1788. }
  1789. }
  1790. };
  1791. CKEDITOR.CTRL = 1114112;
  1792. CKEDITOR.SHIFT = 2228224;
  1793. CKEDITOR.ALT = 4456448;
  1794. CKEDITOR.EVENT_PHASE_CAPTURING = 1;
  1795. CKEDITOR.EVENT_PHASE_AT_TARGET = 2;
  1796. CKEDITOR.EVENT_PHASE_BUBBLING = 3;
  1797. CKEDITOR.HISTORY_NATIVE = 1;
  1798. CKEDITOR.HISTORY_HASH = 2;
  1799. CKEDITOR.HISTORY_OFF = 0;
  1800. CKEDITOR.dom.domObject = function(a) {
  1801. a && (this.$ = a)
  1802. };
  1803. CKEDITOR.dom.domObject.prototype = function() {
  1804. var a = function(a, b) {
  1805. return function(c) {
  1806. "undefined" != typeof CKEDITOR && a.fire(b, new CKEDITOR.dom.event(c))
  1807. }
  1808. };
  1809. return {
  1810. getPrivate: function() {
  1811. var a;
  1812. (a = this.getCustomData("_")) || this.setCustomData("_", a = {});
  1813. return a
  1814. },
  1815. on: function(d) {
  1816. var b = this.getCustomData("_cke_nativeListeners");
  1817. b || (b = {}, this.setCustomData("_cke_nativeListeners", b));
  1818. b[d] || (b = b[d] = a(this, d), this.$.addEventListener ? this.$.addEventListener(d, b, !!CKEDITOR.event
  1819. .useCapture) : this.$.attachEvent && this.$.attachEvent("on" +
  1820. d, b));
  1821. return CKEDITOR.event.prototype.on.apply(this, arguments)
  1822. },
  1823. removeListener: function(a) {
  1824. CKEDITOR.event.prototype.removeListener.apply(this, arguments);
  1825. if (!this.hasListeners(a)) {
  1826. var b = this.getCustomData("_cke_nativeListeners"),
  1827. c = b && b[a];
  1828. c && (this.$.removeEventListener ? this.$.removeEventListener(a, c, !1) : this.$.detachEvent && this.$
  1829. .detachEvent("on" + a, c), delete b[a])
  1830. }
  1831. },
  1832. removeAllListeners: function() {
  1833. try {
  1834. var a = this.getCustomData("_cke_nativeListeners"),
  1835. b;
  1836. for (b in a) {
  1837. var c = a[b];
  1838. this.$.detachEvent ? this.$.detachEvent("on" +
  1839. b, c) : this.$.removeEventListener && this.$.removeEventListener(b, c, !1);
  1840. delete a[b]
  1841. }
  1842. } catch (g) {
  1843. if (!CKEDITOR.env.edge || -2146828218 !== g.number) throw g;
  1844. }
  1845. CKEDITOR.event.prototype.removeAllListeners.call(this)
  1846. }
  1847. }
  1848. }();
  1849. (function(a) {
  1850. var d = {};
  1851. CKEDITOR.on("reset", function() {
  1852. d = {}
  1853. });
  1854. a.equals = function(a) {
  1855. try {
  1856. return a && a.$ === this.$
  1857. } catch (c) {
  1858. return !1
  1859. }
  1860. };
  1861. a.setCustomData = function(a, c) {
  1862. var g = this.getUniqueId();
  1863. (d[g] || (d[g] = {}))[a] = c;
  1864. return this
  1865. };
  1866. a.getCustomData = function(a) {
  1867. var c = this.$["data-cke-expando"];
  1868. return (c = c && d[c]) && a in c ? c[a] : null
  1869. };
  1870. a.removeCustomData = function(a) {
  1871. var c = this.$["data-cke-expando"],
  1872. c = c && d[c],
  1873. g, e;
  1874. c && (g = c[a], e = a in c, delete c[a]);
  1875. return e ? g : null
  1876. };
  1877. a.clearCustomData = function() {
  1878. this.removeAllListeners();
  1879. var a =
  1880. this.getUniqueId();
  1881. a && delete d[a]
  1882. };
  1883. a.getUniqueId = function() {
  1884. return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber())
  1885. };
  1886. CKEDITOR.event.implementOn(a)
  1887. })(CKEDITOR.dom.domObject.prototype);
  1888. CKEDITOR.dom.node = function(a) {
  1889. return a ? new CKEDITOR.dom[a.nodeType == CKEDITOR.NODE_DOCUMENT ? "document" : a.nodeType == CKEDITOR
  1890. .NODE_ELEMENT ? "element" : a.nodeType == CKEDITOR.NODE_TEXT ? "text" : a.nodeType == CKEDITOR
  1891. .NODE_COMMENT ? "comment" : a.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ? "documentFragment" : "domObject"
  1892. ](a) : this
  1893. };
  1894. CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject;
  1895. CKEDITOR.NODE_ELEMENT = 1;
  1896. CKEDITOR.NODE_DOCUMENT = 9;
  1897. CKEDITOR.NODE_TEXT = 3;
  1898. CKEDITOR.NODE_COMMENT = 8;
  1899. CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11;
  1900. CKEDITOR.POSITION_IDENTICAL = 0;
  1901. CKEDITOR.POSITION_DISCONNECTED = 1;
  1902. CKEDITOR.POSITION_FOLLOWING = 2;
  1903. CKEDITOR.POSITION_PRECEDING = 4;
  1904. CKEDITOR.POSITION_IS_CONTAINED = 8;
  1905. CKEDITOR.POSITION_CONTAINS = 16;
  1906. CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, {
  1907. appendTo: function(a, d) {
  1908. a.append(this, d);
  1909. return a
  1910. },
  1911. clone: function(a, d) {
  1912. function b(c) {
  1913. c["data-cke-expando"] && (c["data-cke-expando"] = !1);
  1914. if (c.nodeType == CKEDITOR.NODE_ELEMENT || c.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  1915. if (d || c.nodeType != CKEDITOR.NODE_ELEMENT || c.removeAttribute("id", !1), a) {
  1916. c = c.childNodes;
  1917. for (var g = 0; g < c.length; g++) b(c[g])
  1918. }
  1919. }
  1920. function c(b) {
  1921. if (b.type == CKEDITOR.NODE_ELEMENT || b.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1922. if (b.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1923. var d =
  1924. b.getName();
  1925. ":" == d[0] && b.renameNode(d.substring(1))
  1926. }
  1927. if (a)
  1928. for (d = 0; d < b.getChildCount(); d++) c(b.getChild(d))
  1929. }
  1930. }
  1931. var g = this.$.cloneNode(a);
  1932. b(g);
  1933. g = new CKEDITOR.dom.node(g);
  1934. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (this.type == CKEDITOR.NODE_ELEMENT || this.type ==
  1935. CKEDITOR.NODE_DOCUMENT_FRAGMENT) && c(g);
  1936. return g
  1937. },
  1938. hasPrevious: function() {
  1939. return !!this.$.previousSibling
  1940. },
  1941. hasNext: function() {
  1942. return !!this.$.nextSibling
  1943. },
  1944. insertAfter: function(a) {
  1945. a.$.parentNode.insertBefore(this.$, a.$.nextSibling);
  1946. return a
  1947. },
  1948. insertBefore: function(a) {
  1949. a.$.parentNode.insertBefore(this.$,
  1950. a.$);
  1951. return a
  1952. },
  1953. insertBeforeMe: function(a) {
  1954. this.$.parentNode.insertBefore(a.$, this.$);
  1955. return a
  1956. },
  1957. getAddress: function(a) {
  1958. for (var d = [], b = this.getDocument().$.documentElement, c = this; c && c != b;) {
  1959. var g = c.getParent();
  1960. g && d.unshift(this.getIndex.call(c, a));
  1961. c = g
  1962. }
  1963. return d
  1964. },
  1965. getDocument: function() {
  1966. return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument)
  1967. },
  1968. getIndex: function(a) {
  1969. function d(a, b) {
  1970. var c = b ? a.getNext() : a.getPrevious();
  1971. return c && c.type == CKEDITOR.NODE_TEXT ? c.isEmpty() ? d(c, b) : c :
  1972. null
  1973. }
  1974. var b = this,
  1975. c = -1,
  1976. g;
  1977. if (!this.getParent() || a && b.type == CKEDITOR.NODE_TEXT && b.isEmpty() && !d(b) && !d(b, !0)) return -
  1978. 1;
  1979. do
  1980. if (!a || b.equals(this) || b.type != CKEDITOR.NODE_TEXT || !g && !b.isEmpty()) c++, g = b.type ==
  1981. CKEDITOR.NODE_TEXT; while (b = b.getPrevious());
  1982. return c
  1983. },
  1984. getNextSourceNode: function(a, d, b) {
  1985. if (b && !b.call) {
  1986. var c = b;
  1987. b = function(a) {
  1988. return !a.equals(c)
  1989. }
  1990. }
  1991. a = !a && this.getFirst && this.getFirst();
  1992. var g;
  1993. if (!a) {
  1994. if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  1995. a = this.getNext()
  1996. }
  1997. for (; !a && (g = (g || this).getParent());) {
  1998. if (b &&
  1999. !1 === b(g, !0)) return null;
  2000. a = g.getNext()
  2001. }
  2002. return !a || b && !1 === b(a) ? null : d && d != a.type ? a.getNextSourceNode(!1, d, b) : a
  2003. },
  2004. getPreviousSourceNode: function(a, d, b) {
  2005. if (b && !b.call) {
  2006. var c = b;
  2007. b = function(a) {
  2008. return !a.equals(c)
  2009. }
  2010. }
  2011. a = !a && this.getLast && this.getLast();
  2012. var g;
  2013. if (!a) {
  2014. if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  2015. a = this.getPrevious()
  2016. }
  2017. for (; !a && (g = (g || this).getParent());) {
  2018. if (b && !1 === b(g, !0)) return null;
  2019. a = g.getPrevious()
  2020. }
  2021. return !a || b && !1 === b(a) ? null : d && a.type != d ? a.getPreviousSourceNode(!1, d, b) :
  2022. a
  2023. },
  2024. getPrevious: function(a) {
  2025. var d = this.$,
  2026. b;
  2027. do b = (d = d.previousSibling) && 10 != d.nodeType && new CKEDITOR.dom.node(d); while (b && a && !a(b));
  2028. return b
  2029. },
  2030. getNext: function(a) {
  2031. var d = this.$,
  2032. b;
  2033. do b = (d = d.nextSibling) && new CKEDITOR.dom.node(d); while (b && a && !a(b));
  2034. return b
  2035. },
  2036. getParent: function(a) {
  2037. var d = this.$.parentNode;
  2038. return d && (d.nodeType == CKEDITOR.NODE_ELEMENT || a && d.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ?
  2039. new CKEDITOR.dom.node(d) : null
  2040. },
  2041. getParents: function(a) {
  2042. var d = this,
  2043. b = [];
  2044. do b[a ? "push" : "unshift"](d); while (d = d.getParent());
  2045. return b
  2046. },
  2047. getCommonAncestor: function(a) {
  2048. if (a.equals(this)) return this;
  2049. if (a.contains && a.contains(this)) return a;
  2050. var d = this.contains ? this : this.getParent();
  2051. do
  2052. if (d.contains(a)) return d; while (d = d.getParent());
  2053. return null
  2054. },
  2055. getPosition: function(a) {
  2056. var d = this.$,
  2057. b = a.$;
  2058. if (d.compareDocumentPosition) return d.compareDocumentPosition(b);
  2059. if (d == b) return CKEDITOR.POSITION_IDENTICAL;
  2060. if (this.type == CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) {
  2061. if (d.contains) {
  2062. if (d.contains(b)) return CKEDITOR.POSITION_CONTAINS +
  2063. CKEDITOR.POSITION_PRECEDING;
  2064. if (b.contains(d)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  2065. }
  2066. if ("sourceIndex" in d) return 0 > d.sourceIndex || 0 > b.sourceIndex ? CKEDITOR.POSITION_DISCONNECTED :
  2067. d.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
  2068. }
  2069. d = this.getAddress();
  2070. a = a.getAddress();
  2071. for (var b = Math.min(d.length, a.length), c = 0; c < b; c++)
  2072. if (d[c] != a[c]) return d[c] < a[c] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
  2073. return d.length < a.length ? CKEDITOR.POSITION_CONTAINS +
  2074. CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  2075. },
  2076. getAscendant: function(a, d) {
  2077. var b = this.$,
  2078. c, g;
  2079. d || (b = b.parentNode);
  2080. "function" == typeof a ? (g = !0, c = a) : (g = !1, c = function(b) {
  2081. b = "string" == typeof b.nodeName ? b.nodeName.toLowerCase() : "";
  2082. return "string" == typeof a ? b == a : b in a
  2083. });
  2084. for (; b;) {
  2085. if (c(g ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b);
  2086. try {
  2087. b = b.parentNode
  2088. } catch (e) {
  2089. b = null
  2090. }
  2091. }
  2092. return null
  2093. },
  2094. hasAscendant: function(a, d) {
  2095. var b = this.$;
  2096. d || (b = b.parentNode);
  2097. for (; b;) {
  2098. if (b.nodeName &&
  2099. b.nodeName.toLowerCase() == a) return !0;
  2100. b = b.parentNode
  2101. }
  2102. return !1
  2103. },
  2104. move: function(a, d) {
  2105. a.append(this.remove(), d)
  2106. },
  2107. remove: function(a) {
  2108. var d = this.$,
  2109. b = d.parentNode;
  2110. if (b) {
  2111. if (a)
  2112. for (; a = d.firstChild;) b.insertBefore(d.removeChild(a), d);
  2113. b.removeChild(d)
  2114. }
  2115. return this
  2116. },
  2117. replace: function(a) {
  2118. this.insertBefore(a);
  2119. a.remove()
  2120. },
  2121. trim: function() {
  2122. this.ltrim();
  2123. this.rtrim()
  2124. },
  2125. ltrim: function() {
  2126. for (var a; this.getFirst && (a = this.getFirst());) {
  2127. if (a.type == CKEDITOR.NODE_TEXT) {
  2128. var d = CKEDITOR.tools.ltrim(a.getText()),
  2129. b = a.getLength();
  2130. if (d) d.length <
  2131. b && (a.split(b - d.length), this.$.removeChild(this.$.firstChild));
  2132. else {
  2133. a.remove();
  2134. continue
  2135. }
  2136. }
  2137. break
  2138. }
  2139. },
  2140. rtrim: function() {
  2141. for (var a; this.getLast && (a = this.getLast());) {
  2142. if (a.type == CKEDITOR.NODE_TEXT) {
  2143. var d = CKEDITOR.tools.rtrim(a.getText()),
  2144. b = a.getLength();
  2145. if (d) d.length < b && (a.split(d.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild));
  2146. else {
  2147. a.remove();
  2148. continue
  2149. }
  2150. }
  2151. break
  2152. }
  2153. CKEDITOR.env.needsBrFiller && (a = this.$.lastChild) && 1 == a.type && "br" == a.nodeName.toLowerCase() &&
  2154. a.parentNode.removeChild(a)
  2155. },
  2156. isReadOnly: function(a) {
  2157. var d =
  2158. this;
  2159. this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent());
  2160. CKEDITOR.env.edge && d && d.is("textarea", "input") && (a = !0);
  2161. if (!a && d && "undefined" != typeof d.$.isContentEditable) return !(d.$.isContentEditable || d.data(
  2162. "cke-editable"));
  2163. for (; d;) {
  2164. if (d.data("cke-editable")) return !1;
  2165. if (d.hasAttribute("contenteditable")) return "false" == d.getAttribute("contenteditable");
  2166. d = d.getParent()
  2167. }
  2168. return !0
  2169. }
  2170. });
  2171. CKEDITOR.dom.window = function(a) {
  2172. CKEDITOR.dom.domObject.call(this, a)
  2173. };
  2174. CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject;
  2175. CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
  2176. focus: function() {
  2177. this.$.focus()
  2178. },
  2179. getViewPaneSize: function() {
  2180. var a = this.$.document,
  2181. d = "CSS1Compat" == a.compatMode;
  2182. return {
  2183. width: (d ? a.documentElement.clientWidth : a.body.clientWidth) || 0,
  2184. height: (d ? a.documentElement.clientHeight : a.body.clientHeight) || 0
  2185. }
  2186. },
  2187. getScrollPosition: function() {
  2188. var a = this.$;
  2189. if ("pageXOffset" in a) return {
  2190. x: a.pageXOffset || 0,
  2191. y: a.pageYOffset || 0
  2192. };
  2193. a = a.document;
  2194. return {
  2195. x: a.documentElement.scrollLeft || a.body.scrollLeft || 0,
  2196. y: a.documentElement.scrollTop ||
  2197. a.body.scrollTop || 0
  2198. }
  2199. },
  2200. getFrame: function() {
  2201. var a = this.$.frameElement;
  2202. return a ? new CKEDITOR.dom.element.get(a) : null
  2203. }
  2204. });
  2205. CKEDITOR.dom.document = function(a) {
  2206. CKEDITOR.dom.domObject.call(this, a)
  2207. };
  2208. CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject;
  2209. CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
  2210. type: CKEDITOR.NODE_DOCUMENT,
  2211. appendStyleSheet: function(a) {
  2212. a = CKEDITOR.appendTimestamp(a);
  2213. if (this.$.createStyleSheet) this.$.createStyleSheet(a);
  2214. else {
  2215. var d = new CKEDITOR.dom.element("link");
  2216. d.setAttributes({
  2217. rel: "stylesheet",
  2218. type: "text/css",
  2219. href: a
  2220. });
  2221. this.getHead().append(d)
  2222. }
  2223. },
  2224. appendStyleText: function(a) {
  2225. if (this.$.createStyleSheet) {
  2226. var d = this.$.createStyleSheet("");
  2227. d.cssText = a
  2228. } else {
  2229. var b = new CKEDITOR.dom.element("style", this);
  2230. b.append(new CKEDITOR.dom.text(a,
  2231. this));
  2232. this.getHead().append(b)
  2233. }
  2234. return d || b.$.sheet
  2235. },
  2236. createElement: function(a, d) {
  2237. var b = new CKEDITOR.dom.element(a, this);
  2238. d && (d.attributes && b.setAttributes(d.attributes), d.styles && b.setStyles(d.styles));
  2239. return b
  2240. },
  2241. createText: function(a) {
  2242. return new CKEDITOR.dom.text(a, this)
  2243. },
  2244. focus: function() {
  2245. this.getWindow().focus()
  2246. },
  2247. getActive: function() {
  2248. var a;
  2249. try {
  2250. a = this.$.activeElement
  2251. } catch (d) {
  2252. return null
  2253. }
  2254. return new CKEDITOR.dom.element(a)
  2255. },
  2256. getById: function(a) {
  2257. return (a = this.$.getElementById(a)) ? new CKEDITOR.dom.element(a) :
  2258. null
  2259. },
  2260. getByAddress: function(a, d) {
  2261. for (var b = this.$.documentElement, c = 0; b && c < a.length; c++) {
  2262. var g = a[c];
  2263. if (d)
  2264. for (var e = -1, h = 0; h < b.childNodes.length; h++) {
  2265. var k = b.childNodes[h];
  2266. if (!0 !== d || 3 != k.nodeType || !k.previousSibling || 3 != k.previousSibling.nodeType)
  2267. if (e++, e == g) {
  2268. b = k;
  2269. break
  2270. }
  2271. } else b = b.childNodes[g]
  2272. }
  2273. return b ? new CKEDITOR.dom.node(b) : null
  2274. },
  2275. getElementsByTag: function(a, d) {
  2276. CKEDITOR.env.ie && 8 >= document.documentMode || !d || (a = d + ":" + a);
  2277. return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))
  2278. },
  2279. getHead: function() {
  2280. var a =
  2281. this.$.getElementsByTagName("head")[0];
  2282. return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element(
  2283. "head"), !0)
  2284. },
  2285. getBody: function() {
  2286. return new CKEDITOR.dom.element(this.$.body)
  2287. },
  2288. getDocumentElement: function() {
  2289. return new CKEDITOR.dom.element(this.$.documentElement)
  2290. },
  2291. getWindow: function() {
  2292. return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView)
  2293. },
  2294. write: function(a) {
  2295. this.$.open("text/html", "replace");
  2296. CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,
  2297. '$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e(' + CKEDITOR.tools.fixDomain + ")();\x3c/script\x3e"));
  2298. this.$.write(a);
  2299. this.$.close()
  2300. },
  2301. find: function(a) {
  2302. return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))
  2303. },
  2304. findOne: function(a) {
  2305. return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null
  2306. },
  2307. _getHtml5ShivFrag: function() {
  2308. var a = this.getCustomData("html5ShivFrag");
  2309. a || (a = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(a, !0), this.setCustomData(
  2310. "html5ShivFrag", a));
  2311. return a
  2312. }
  2313. });
  2314. CKEDITOR.dom.nodeList = function(a) {
  2315. this.$ = a
  2316. };
  2317. CKEDITOR.dom.nodeList.prototype = {
  2318. count: function() {
  2319. return this.$.length
  2320. },
  2321. getItem: function(a) {
  2322. return 0 > a || a >= this.$.length ? null : (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null
  2323. },
  2324. toArray: function() {
  2325. return CKEDITOR.tools.array.map(this.$, function(a) {
  2326. return new CKEDITOR.dom.node(a)
  2327. })
  2328. }
  2329. };
  2330. CKEDITOR.dom.element = function(a, d) {
  2331. "string" == typeof a && (a = (d ? d.$ : document).createElement(a));
  2332. CKEDITOR.dom.domObject.call(this, a)
  2333. };
  2334. CKEDITOR.dom.element.get = function(a) {
  2335. return (a = "string" == typeof a ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ?
  2336. a : new CKEDITOR.dom.element(a))
  2337. };
  2338. CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node;
  2339. CKEDITOR.dom.element.createFromHtml = function(a, d) {
  2340. var b = new CKEDITOR.dom.element("div", d);
  2341. b.setHtml(a);
  2342. return b.getFirst().remove()
  2343. };
  2344. CKEDITOR.dom.element.setMarker = function(a, d, b, c) {
  2345. var g = d.getCustomData("list_marker_id") || d.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber())
  2346. .getCustomData("list_marker_id"),
  2347. e = d.getCustomData("list_marker_names") || d.setCustomData("list_marker_names", {}).getCustomData(
  2348. "list_marker_names");
  2349. a[g] = d;
  2350. e[b] = 1;
  2351. return d.setCustomData(b, c)
  2352. };
  2353. CKEDITOR.dom.element.clearAllMarkers = function(a) {
  2354. for (var d in a) CKEDITOR.dom.element.clearMarkers(a, a[d], 1)
  2355. };
  2356. CKEDITOR.dom.element.clearMarkers = function(a, d, b) {
  2357. var c = d.getCustomData("list_marker_names"),
  2358. g = d.getCustomData("list_marker_id"),
  2359. e;
  2360. for (e in c) d.removeCustomData(e);
  2361. d.removeCustomData("list_marker_names");
  2362. b && (d.removeCustomData("list_marker_id"), delete a[g])
  2363. };
  2364. (function() {
  2365. function a(a, b) {
  2366. return -1 < (" " + a + " ").replace(e, " ").indexOf(" " + b + " ")
  2367. }
  2368. function d(a) {
  2369. var b = !0;
  2370. a.$.id || (a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber(), b = !1);
  2371. return function() {
  2372. b || a.removeAttribute("id")
  2373. }
  2374. }
  2375. function b(a, b) {
  2376. var c = CKEDITOR.tools.escapeCss(a.$.id);
  2377. return "#" + c + " " + b.split(/,\s*/).join(", #" + c + " ")
  2378. }
  2379. function c(a) {
  2380. for (var b = 0, c = 0, f = h[a].length; c < f; c++) b += parseFloat(this.getComputedStyle(h[a][c]) || 0,
  2381. 10) || 0;
  2382. return b
  2383. }
  2384. var g = document.createElement("_").classList,
  2385. g = "undefined" !== typeof g &&
  2386. null !== String(g.add).match(/\[Native code\]/gi),
  2387. e = /[\n\t\r]/g;
  2388. CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
  2389. type: CKEDITOR.NODE_ELEMENT,
  2390. addClass: g ? function(a) {
  2391. this.$.classList.add(a);
  2392. return this
  2393. } : function(b) {
  2394. var c = this.$.className;
  2395. c && (a(c, b) || (c += " " + b));
  2396. this.$.className = c || b;
  2397. return this
  2398. },
  2399. removeClass: g ? function(a) {
  2400. var b = this.$;
  2401. b.classList.remove(a);
  2402. b.className || b.removeAttribute("class");
  2403. return this
  2404. } : function(b) {
  2405. var c = this.getAttribute("class");
  2406. c && a(c, b) && ((c = c.replace(new RegExp("(?:^|\\s+)" +
  2407. b + "(?\x3d\\s|$)"), "").replace(/^\s+/, "")) ? this.setAttribute("class", c) : this
  2408. .removeAttribute("class"));
  2409. return this
  2410. },
  2411. hasClass: function(b) {
  2412. return a(this.$.className, b)
  2413. },
  2414. append: function(a, b) {
  2415. "string" == typeof a && (a = this.getDocument().createElement(a));
  2416. b ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$);
  2417. return a
  2418. },
  2419. appendHtml: function(a) {
  2420. if (this.$.childNodes.length) {
  2421. var b = new CKEDITOR.dom.element("div", this.getDocument());
  2422. b.setHtml(a);
  2423. b.moveChildren(this)
  2424. } else this.setHtml(a)
  2425. },
  2426. appendText: function(a) {
  2427. null !=
  2428. this.$.text && CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? this.$.text += a : this.append(
  2429. new CKEDITOR.dom.text(a))
  2430. },
  2431. appendBogus: function(a) {
  2432. if (a || CKEDITOR.env.needsBrFiller) {
  2433. for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());)
  2434. a = a.getPrevious();
  2435. a && a.is && a.is("br") || (a = this.getDocument().createElement("br"), CKEDITOR.env.gecko && a
  2436. .setAttribute("type", "_moz"), this.append(a))
  2437. }
  2438. },
  2439. breakParent: function(a, b) {
  2440. var c = new CKEDITOR.dom.range(this.getDocument());
  2441. c.setStartAfter(this);
  2442. c.setEndAfter(a);
  2443. var f = c.extractContents(!1, b || !1),
  2444. e;
  2445. c.insertNode(this.remove());
  2446. if (CKEDITOR.env.ie && !CKEDITOR.env.edge) {
  2447. for (c = new CKEDITOR.dom.element("div"); e = f.getFirst();) e.$.style.backgroundColor && (e.$.style
  2448. .backgroundColor = e.$.style.backgroundColor), c.append(e);
  2449. c.insertAfter(this);
  2450. c.remove(!0)
  2451. } else f.insertAfterNode(this)
  2452. },
  2453. contains: document.compareDocumentPosition ? function(a) {
  2454. return !!(this.$.compareDocumentPosition(a.$) & 16)
  2455. } : function(a) {
  2456. var b = this.$;
  2457. return a.type != CKEDITOR.NODE_ELEMENT ? b.contains(a.getParent().$) :
  2458. b != a.$ && b.contains(a.$)
  2459. },
  2460. focus: function() {
  2461. function a() {
  2462. try {
  2463. this.$.focus()
  2464. } catch (b) {}
  2465. }
  2466. return function(b) {
  2467. b ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this)
  2468. }
  2469. }(),
  2470. getHtml: function() {
  2471. var a = this.$.innerHTML;
  2472. return CKEDITOR.env.ie ? a.replace(/<\?[^>]*>/g, "") : a
  2473. },
  2474. getOuterHtml: function() {
  2475. if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
  2476. var a = this.$.ownerDocument.createElement("div");
  2477. a.appendChild(this.$.cloneNode(!0));
  2478. return a.innerHTML
  2479. },
  2480. getClientRect: function(a) {
  2481. var b = CKEDITOR.tools.extend({},
  2482. this.$.getBoundingClientRect());
  2483. !b.width && (b.width = b.right - b.left);
  2484. !b.height && (b.height = b.bottom - b.top);
  2485. return a ? CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(), b) : b
  2486. },
  2487. setHtml: CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? function(a) {
  2488. try {
  2489. var b = this.$;
  2490. if (this.getParent()) return b.innerHTML = a;
  2491. var c = this.getDocument()._getHtml5ShivFrag();
  2492. c.appendChild(b);
  2493. b.innerHTML = a;
  2494. c.removeChild(b);
  2495. return a
  2496. } catch (f) {
  2497. this.$.innerHTML = "";
  2498. b = new CKEDITOR.dom.element("body", this.getDocument());
  2499. b.$.innerHTML = a;
  2500. for (b = b.getChildren(); b.count();) this.append(b.getItem(0));
  2501. return a
  2502. }
  2503. } : function(a) {
  2504. return this.$.innerHTML = a
  2505. },
  2506. setText: function() {
  2507. var a = document.createElement("p");
  2508. a.innerHTML = "x";
  2509. a = a.textContent;
  2510. return function(b) {
  2511. this.$[a ? "textContent" : "innerText"] = b
  2512. }
  2513. }(),
  2514. getAttribute: function() {
  2515. var a = function(a) {
  2516. return this.$.getAttribute(a, 2)
  2517. };
  2518. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  2519. switch (a) {
  2520. case "class":
  2521. a = "className";
  2522. break;
  2523. case "http-equiv":
  2524. a = "httpEquiv";
  2525. break;
  2526. case "name":
  2527. return this.$.name;
  2528. case "tabindex":
  2529. return a = this.$.getAttribute(a,
  2530. 2), 0 !== a && 0 === this.$.tabIndex && (a = null), a;
  2531. case "checked":
  2532. return a = this.$.attributes.getNamedItem(a), (a.specified ? a.nodeValue : this.$.checked) ?
  2533. "checked" : null;
  2534. case "hspace":
  2535. case "value":
  2536. return this.$[a];
  2537. case "style":
  2538. return this.$.style.cssText;
  2539. case "contenteditable":
  2540. case "contentEditable":
  2541. return this.$.attributes.getNamedItem("contentEditable").specified ? this.$.getAttribute(
  2542. "contentEditable") : null
  2543. }
  2544. return this.$.getAttribute(a, 2)
  2545. } : a
  2546. }(),
  2547. getAttributes: function(a) {
  2548. var b = {},
  2549. c = this.$.attributes,
  2550. f;
  2551. a = CKEDITOR.tools.isArray(a) ?
  2552. a : [];
  2553. for (f = 0; f < c.length; f++) - 1 === CKEDITOR.tools.indexOf(a, c[f].name) && (b[c[f].name] = c[f]
  2554. .value);
  2555. return b
  2556. },
  2557. getChildren: function() {
  2558. return new CKEDITOR.dom.nodeList(this.$.childNodes)
  2559. },
  2560. getClientSize: function() {
  2561. return {
  2562. width: this.$.clientWidth,
  2563. height: this.$.clientHeight
  2564. }
  2565. },
  2566. getComputedStyle: document.defaultView && document.defaultView.getComputedStyle ? function(a) {
  2567. var b = this.getWindow().$.getComputedStyle(this.$, null);
  2568. return b ? b.getPropertyValue(a) : ""
  2569. } : function(a) {
  2570. return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2571. },
  2572. getDtd: function() {
  2573. var a = CKEDITOR.dtd[this.getName()];
  2574. this.getDtd = function() {
  2575. return a
  2576. };
  2577. return a
  2578. },
  2579. getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag,
  2580. getTabIndex: function() {
  2581. var a = this.$.tabIndex;
  2582. return 0 !== a || CKEDITOR.dtd.$tabIndex[this.getName()] || 0 === parseInt(this.getAttribute(
  2583. "tabindex"), 10) ? a : -1
  2584. },
  2585. getText: function() {
  2586. return this.$.textContent || this.$.innerText || ""
  2587. },
  2588. getWindow: function() {
  2589. return this.getDocument().getWindow()
  2590. },
  2591. getId: function() {
  2592. return this.$.id || null
  2593. },
  2594. getNameAtt: function() {
  2595. return this.$.name ||
  2596. null
  2597. },
  2598. getName: function() {
  2599. var a = this.$.nodeName.toLowerCase();
  2600. if (CKEDITOR.env.ie && 8 >= document.documentMode) {
  2601. var b = this.$.scopeName;
  2602. "HTML" != b && (a = b.toLowerCase() + ":" + a)
  2603. }
  2604. this.getName = function() {
  2605. return a
  2606. };
  2607. return this.getName()
  2608. },
  2609. getValue: function() {
  2610. return this.$.value
  2611. },
  2612. getFirst: function(a) {
  2613. var b = this.$.firstChild;
  2614. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getNext(a));
  2615. return b
  2616. },
  2617. getLast: function(a) {
  2618. var b = this.$.lastChild;
  2619. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getPrevious(a));
  2620. return b
  2621. },
  2622. getStyle: function(a) {
  2623. return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2624. },
  2625. is: function() {
  2626. var a = this.getName();
  2627. if ("object" == typeof arguments[0]) return !!arguments[0][a];
  2628. for (var b = 0; b < arguments.length; b++)
  2629. if (arguments[b] == a) return !0;
  2630. return !1
  2631. },
  2632. isEditable: function(a) {
  2633. var b = this.getName();
  2634. return this.isReadOnly() || "none" == this.getComputedStyle("display") || "hidden" == this
  2635. .getComputedStyle("visibility") || CKEDITOR.dtd.$nonEditable[b] || CKEDITOR.dtd.$empty[b] || this
  2636. .is("a") && (this.data("cke-saved-name") || this.hasAttribute("name")) && !this.getChildCount() ? !
  2637. 1 : !1 !== a ? (a = CKEDITOR.dtd[b] ||
  2638. CKEDITOR.dtd.span, !(!a || !a["#"])) : !0
  2639. },
  2640. isIdentical: function(a) {
  2641. var b = this.clone(0, 1);
  2642. a = a.clone(0, 1);
  2643. b.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2644. a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2645. if (b.$.isEqualNode) return b.$.style.cssText = CKEDITOR.tools.normalizeCssText(b.$.style.cssText), a
  2646. .$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText), b.$.isEqualNode(a.$);
  2647. b = b.getOuterHtml();
  2648. a =
  2649. a.getOuterHtml();
  2650. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && this.is("a")) {
  2651. var c = this.getParent();
  2652. c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(b), b = c.getHtml(), c.setHtml(a), a =
  2653. c.getHtml())
  2654. }
  2655. return b == a
  2656. },
  2657. isVisible: function() {
  2658. var a = (this.$.offsetHeight || this.$.offsetWidth) && "hidden" != this.getComputedStyle(
  2659. "visibility"),
  2660. b, c;
  2661. a && CKEDITOR.env.webkit && (b = this.getWindow(), !b.equals(CKEDITOR.document.getWindow()) && (c = b
  2662. .$.frameElement) && (a = (new CKEDITOR.dom.element(c)).isVisible()));
  2663. return !!a
  2664. },
  2665. isEmptyInlineRemoveable: function() {
  2666. if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return !1;
  2667. for (var a = this.getChildren(), b = 0, c = a.count(); b < c; b++) {
  2668. var f = a.getItem(b);
  2669. if (f.type != CKEDITOR.NODE_ELEMENT || !f.data("cke-bookmark"))
  2670. if (f.type == CKEDITOR.NODE_ELEMENT && !f.isEmptyInlineRemoveable() || f.type == CKEDITOR
  2671. .NODE_TEXT && CKEDITOR.tools.trim(f.getText())) return !1
  2672. }
  2673. return !0
  2674. },
  2675. hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function() {
  2676. for (var a = this.$.attributes, b = 0; b < a.length; b++) {
  2677. var c = a[b];
  2678. switch (c.nodeName) {
  2679. case "class":
  2680. if (this.getAttribute("class")) return !0;
  2681. case "data-cke-expando":
  2682. continue;
  2683. default:
  2684. if (c.specified) return !0
  2685. }
  2686. }
  2687. return !1
  2688. } : function() {
  2689. var a = this.$.attributes,
  2690. b = a.length,
  2691. c = {
  2692. "data-cke-expando": 1,
  2693. _moz_dirty: 1
  2694. };
  2695. return 0 < b && (2 < b || !c[a[0].nodeName] || 2 == b && !c[a[1].nodeName])
  2696. },
  2697. hasAttribute: function() {
  2698. function a(b) {
  2699. var c = this.$.attributes.getNamedItem(b);
  2700. if ("input" == this.getName()) switch (b) {
  2701. case "class":
  2702. return 0 < this.$.className.length;
  2703. case "checked":
  2704. return !!this.$.checked;
  2705. case "value":
  2706. return b = this.getAttribute("type"), "checkbox" == b || "radio" == b ? "on" != this.$.value :
  2707. !!this.$.value
  2708. }
  2709. return c ?
  2710. c.specified : !1
  2711. }
  2712. return CKEDITOR.env.ie ? 8 > CKEDITOR.env.version ? function(b) {
  2713. return "name" == b ? !!this.$.name : a.call(this, b)
  2714. } : a : function(a) {
  2715. return !!this.$.attributes.getNamedItem(a)
  2716. }
  2717. }(),
  2718. hide: function() {
  2719. this.setStyle("display", "none")
  2720. },
  2721. moveChildren: function(a, b) {
  2722. var c = this.$;
  2723. a = a.$;
  2724. if (c != a) {
  2725. var f;
  2726. if (b)
  2727. for (; f = c.lastChild;) a.insertBefore(c.removeChild(f), a.firstChild);
  2728. else
  2729. for (; f = c.firstChild;) a.appendChild(c.removeChild(f))
  2730. }
  2731. },
  2732. mergeSiblings: function() {
  2733. function a(b, c, f) {
  2734. if (c && c.type == CKEDITOR.NODE_ELEMENT) {
  2735. for (var e = []; c.data("cke-bookmark") || c.isEmptyInlineRemoveable();)
  2736. if (e.push(c), c = f ? c.getNext() : c.getPrevious(), !c || c.type != CKEDITOR.NODE_ELEMENT)
  2737. return;
  2738. if (b.isIdentical(c)) {
  2739. for (var k = f ? b.getLast() : b.getFirst(); e.length;) e.shift().move(b, !f);
  2740. c.moveChildren(b, !f);
  2741. c.remove();
  2742. k && k.type == CKEDITOR.NODE_ELEMENT && k.mergeSiblings()
  2743. }
  2744. }
  2745. }
  2746. return function(b) {
  2747. if (!1 === b || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) a(this, this.getNext(),
  2748. !0), a(this, this.getPrevious())
  2749. }
  2750. }(),
  2751. show: function() {
  2752. this.setStyles({
  2753. display: "",
  2754. visibility: ""
  2755. })
  2756. },
  2757. setAttribute: function() {
  2758. var a = function(a, b) {
  2759. this.$.setAttribute(a, b);
  2760. return this
  2761. };
  2762. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(b, c) {
  2763. "class" == b ? this.$.className = c : "style" == b ? this.$.style.cssText = c : "tabindex" == b ?
  2764. this.$.tabIndex = c : "checked" == b ? this.$.checked = c : "contenteditable" == b ? a.call(
  2765. this, "contentEditable", c) : a.apply(this, arguments);
  2766. return this
  2767. } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(b, c) {
  2768. if ("src" == b && c.match(/^http:\/\//)) try {
  2769. a.apply(this,
  2770. arguments)
  2771. } catch (f) {} else a.apply(this, arguments);
  2772. return this
  2773. } : a
  2774. }(),
  2775. setAttributes: function(a) {
  2776. for (var b in a) this.setAttribute(b, a[b]);
  2777. return this
  2778. },
  2779. setValue: function(a) {
  2780. this.$.value = a;
  2781. return this
  2782. },
  2783. removeAttribute: function() {
  2784. var a = function(a) {
  2785. this.$.removeAttribute(a)
  2786. };
  2787. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  2788. "class" == a ? a = "className" : "tabindex" == a ? a = "tabIndex" : "contenteditable" == a && (a =
  2789. "contentEditable");
  2790. this.$.removeAttribute(a)
  2791. } : a
  2792. }(),
  2793. removeAttributes: function(a) {
  2794. if (CKEDITOR.tools.isArray(a))
  2795. for (var b =
  2796. 0; b < a.length; b++) this.removeAttribute(a[b]);
  2797. else
  2798. for (b in a = a || this.getAttributes(), a) a.hasOwnProperty(b) && this.removeAttribute(b)
  2799. },
  2800. removeStyle: function(a) {
  2801. var b = this.$.style;
  2802. if (b.removeProperty || "border" != a && "margin" != a && "padding" != a) b.removeProperty ? b
  2803. .removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)), this.$.style
  2804. .cssText || this.removeAttribute("style");
  2805. else {
  2806. var c = ["top", "left", "right", "bottom"],
  2807. f;
  2808. "border" == a && (f = ["color", "style", "width"]);
  2809. for (var b = [], e = 0; e < c.length; e++)
  2810. if (f)
  2811. for (var d =
  2812. 0; d < f.length; d++) b.push([a, c[e], f[d]].join("-"));
  2813. else b.push([a, c[e]].join("-"));
  2814. for (a = 0; a < b.length; a++) this.removeStyle(b[a])
  2815. }
  2816. },
  2817. setStyle: function(a, b) {
  2818. this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b;
  2819. return this
  2820. },
  2821. setStyles: function(a) {
  2822. for (var b in a) this.setStyle(b, a[b]);
  2823. return this
  2824. },
  2825. setOpacity: function(a) {
  2826. CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? (a = Math.round(100 * a), this.setStyle("filter", 100 <=
  2827. a ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity\x3d" + a + ")")) : this.setStyle(
  2828. "opacity", a)
  2829. },
  2830. unselectable: function() {
  2831. this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
  2832. "none"));
  2833. if (CKEDITOR.env.ie) {
  2834. this.setAttribute("unselectable", "on");
  2835. for (var a, b = this.getElementsByTag("*"), c = 0, f = b.count(); c < f; c++) a = b.getItem(c), a
  2836. .setAttribute("unselectable", "on")
  2837. }
  2838. },
  2839. getPositionedAncestor: function() {
  2840. for (var a = this;
  2841. "html" != a.getName();) {
  2842. if ("static" != a.getComputedStyle("position")) return a;
  2843. a = a.getParent()
  2844. }
  2845. return null
  2846. },
  2847. getDocumentPosition: function(a) {
  2848. var b = 0,
  2849. c = 0,
  2850. f = this.getDocument(),
  2851. e = f.getBody(),
  2852. d = "BackCompat" == f.$.compatMode;
  2853. if (document.documentElement.getBoundingClientRect && (CKEDITOR.env.ie ?
  2854. 8 !== CKEDITOR.env.version : 1)) {
  2855. var g = this.$.getBoundingClientRect(),
  2856. h = f.$.documentElement,
  2857. r = h.clientTop || e.$.clientTop || 0,
  2858. m = h.clientLeft || e.$.clientLeft || 0,
  2859. L = !0;
  2860. CKEDITOR.env.ie && (L = f.getDocumentElement().contains(this), f = f.getBody().contains(this), L =
  2861. d && f || !d && L);
  2862. L && (CKEDITOR.env.webkit || CKEDITOR.env.ie && 12 <= CKEDITOR.env.version ? (b = e.$.scrollLeft ||
  2863. h.scrollLeft, c = e.$.scrollTop || h.scrollTop) : (c = d ? e.$ : h, b = c.scrollLeft, c = c
  2864. .scrollTop), b = g.left + b - m, c = g.top + c - r)
  2865. } else
  2866. for (r = this, m = null; r && "body" != r.getName() &&
  2867. "html" != r.getName();) {
  2868. b += r.$.offsetLeft - r.$.scrollLeft;
  2869. c += r.$.offsetTop - r.$.scrollTop;
  2870. r.equals(this) || (b += r.$.clientLeft || 0, c += r.$.clientTop || 0);
  2871. for (; m && !m.equals(r);) b -= m.$.scrollLeft, c -= m.$.scrollTop, m = m.getParent();
  2872. m = r;
  2873. r = (g = r.$.offsetParent) ? new CKEDITOR.dom.element(g) : null
  2874. }
  2875. a && (g = this.getWindow(), r = a.getWindow(), !g.equals(r) && g.$.frameElement && (a = (new CKEDITOR
  2876. .dom.element(g.$.frameElement)).getDocumentPosition(a), b += a.x, c += a.y));
  2877. document.documentElement.getBoundingClientRect || !CKEDITOR.env.gecko ||
  2878. d || (b += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0);
  2879. return {
  2880. x: b,
  2881. y: c
  2882. }
  2883. },
  2884. scrollIntoView: function(a) {
  2885. var b = this.getParent();
  2886. if (b) {
  2887. do
  2888. if ((b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$
  2889. .clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1), b.is(
  2890. "html")) {
  2891. var c = b.getWindow();
  2892. try {
  2893. var f = c.$.frameElement;
  2894. f && (b = new CKEDITOR.dom.element(f))
  2895. } catch (e) {}
  2896. } while (b = b.getParent())
  2897. }
  2898. },
  2899. scrollIntoParent: function(a, b, c) {
  2900. var f, e, d, g;
  2901. function h(b, c) {
  2902. /body|html/.test(a.getName()) ?
  2903. a.getWindow().$.scrollBy(b, c) : (a.$.scrollLeft += b, a.$.scrollTop += c)
  2904. }
  2905. function r(a, b) {
  2906. var c = {
  2907. x: 0,
  2908. y: 0
  2909. };
  2910. if (!a.is(L ? "body" : "html")) {
  2911. var f = a.$.getBoundingClientRect();
  2912. c.x = f.left;
  2913. c.y = f.top
  2914. }
  2915. f = a.getWindow();
  2916. f.equals(b) || (f = r(CKEDITOR.dom.element.get(f.$.frameElement), b), c.x += f.x, c.y += f.y);
  2917. return c
  2918. }
  2919. function m(a, b) {
  2920. return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0
  2921. }!a && (a = this.getWindow());
  2922. d = a.getDocument();
  2923. var L = "BackCompat" == d.$.compatMode;
  2924. a instanceof CKEDITOR.dom.window && (a = L ? d.getBody() : d.getDocumentElement());
  2925. CKEDITOR.env.webkit && (d = this.getEditor(!1)) && (d._.previousScrollTop = null);
  2926. d = a.getWindow();
  2927. e = r(this, d);
  2928. var v = r(a, d),
  2929. J = this.$.offsetHeight;
  2930. f = this.$.offsetWidth;
  2931. var G = a.$.clientHeight,
  2932. p = a.$.clientWidth;
  2933. d = e.x - m(this, "left") - v.x || 0;
  2934. g = e.y - m(this, "top") - v.y || 0;
  2935. f = e.x + f + m(this, "right") - (v.x + p) || 0;
  2936. e = e.y + J + m(this, "bottom") - (v.y + G) || 0;
  2937. (0 > g || 0 < e) && h(0, !0 === b ? g : !1 === b ? e : 0 > g ? g : e);
  2938. c && (0 > d || 0 < f) && h(0 > d ? d : f, 0)
  2939. },
  2940. setState: function(a, b, c) {
  2941. b = b || "cke";
  2942. switch (a) {
  2943. case CKEDITOR.TRISTATE_ON:
  2944. this.addClass(b + "_on");
  2945. this.removeClass(b +
  2946. "_off");
  2947. this.removeClass(b + "_disabled");
  2948. c && this.setAttribute("aria-pressed", !0);
  2949. c && this.removeAttribute("aria-disabled");
  2950. break;
  2951. case CKEDITOR.TRISTATE_DISABLED:
  2952. this.addClass(b + "_disabled");
  2953. this.removeClass(b + "_off");
  2954. this.removeClass(b + "_on");
  2955. c && this.setAttribute("aria-disabled", !0);
  2956. c && this.removeAttribute("aria-pressed");
  2957. break;
  2958. default:
  2959. this.addClass(b + "_off"), this.removeClass(b + "_on"), this.removeClass(b + "_disabled"), c &&
  2960. this.removeAttribute("aria-pressed"), c && this.removeAttribute("aria-disabled")
  2961. }
  2962. },
  2963. getFrameDocument: function() {
  2964. var a = this.$;
  2965. try {
  2966. a.contentWindow.document
  2967. } catch (b) {
  2968. a.src = a.src
  2969. }
  2970. return a && new CKEDITOR.dom.document(a.contentWindow.document)
  2971. },
  2972. copyAttributes: function(a, b) {
  2973. var c = this.$.attributes;
  2974. b = b || {};
  2975. for (var f = 0; f < c.length; f++) {
  2976. var e = c[f],
  2977. d = e.nodeName.toLowerCase(),
  2978. g;
  2979. if (!(d in b))
  2980. if ("checked" == d && (g = this.getAttribute(d))) a.setAttribute(d, g);
  2981. else if (!CKEDITOR.env.ie || this.hasAttribute(d)) g = this.getAttribute(d), null === g && (g = e
  2982. .nodeValue), a.setAttribute(d, g)
  2983. }
  2984. "" !== this.$.style.cssText &&
  2985. (a.$.style.cssText = this.$.style.cssText)
  2986. },
  2987. renameNode: function(a) {
  2988. if (this.getName() != a) {
  2989. var b = this.getDocument();
  2990. a = new CKEDITOR.dom.element(a, b);
  2991. this.copyAttributes(a);
  2992. this.moveChildren(a);
  2993. this.getParent(!0) && this.$.parentNode.replaceChild(a.$, this.$);
  2994. a.$["data-cke-expando"] = this.$["data-cke-expando"];
  2995. this.$ = a.$;
  2996. delete this.getName
  2997. }
  2998. },
  2999. getChild: function() {
  3000. function a(b, c) {
  3001. var f = b.childNodes;
  3002. if (0 <= c && c < f.length) return f[c]
  3003. }
  3004. return function(b) {
  3005. var c = this.$;
  3006. if (b.slice)
  3007. for (b = b.slice(); 0 < b.length && c;) c = a(c,
  3008. b.shift());
  3009. else c = a(c, b);
  3010. return c ? new CKEDITOR.dom.node(c) : null
  3011. }
  3012. }(),
  3013. getChildCount: function() {
  3014. return this.$.childNodes.length
  3015. },
  3016. disableContextMenu: function() {
  3017. function a(b) {
  3018. return b.type == CKEDITOR.NODE_ELEMENT && b.hasClass("cke_enable_context_menu")
  3019. }
  3020. this.on("contextmenu", function(b) {
  3021. b.data.getTarget().getAscendant(a, !0) || b.data.preventDefault()
  3022. })
  3023. },
  3024. getDirection: function(a) {
  3025. return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() && this
  3026. .getParent().getDirection(1) || this.getDocument().$.dir ||
  3027. "ltr" : this.getStyle("direction") || this.getAttribute("dir")
  3028. },
  3029. data: function(a, b) {
  3030. a = "data-" + a;
  3031. if (void 0 === b) return this.getAttribute(a);
  3032. !1 === b ? this.removeAttribute(a) : this.setAttribute(a, b);
  3033. return null
  3034. },
  3035. getEditor: function(a) {
  3036. var b = CKEDITOR.instances,
  3037. c, f, e;
  3038. a = a || void 0 === a;
  3039. for (c in b)
  3040. if (f = b[c], f.element.equals(this) && f.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || !a && (
  3041. e = f.editable()) && (e.equals(this) || e.contains(this))) return f;
  3042. return null
  3043. },
  3044. find: function(a) {
  3045. var c = d(this);
  3046. a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this,
  3047. a)));
  3048. c();
  3049. return a
  3050. },
  3051. findOne: function(a) {
  3052. var c = d(this);
  3053. a = this.$.querySelector(b(this, a));
  3054. c();
  3055. return a ? new CKEDITOR.dom.element(a) : null
  3056. },
  3057. forEach: function(a, b, c) {
  3058. if (!(c || b && this.type != b)) var f = a(this);
  3059. if (!1 !== f) {
  3060. c = this.getChildren();
  3061. for (var e = 0; e < c.count(); e++) f = c.getItem(e), f.type == CKEDITOR.NODE_ELEMENT ? f.forEach(a,
  3062. b) : b && f.type != b || a(f)
  3063. }
  3064. },
  3065. fireEventHandler: function(a, b) {
  3066. var c = "on" + a,
  3067. f = this.$;
  3068. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version) {
  3069. var e = f.ownerDocument.createEventObject(),
  3070. d;
  3071. for (d in b) e[d] = b[d];
  3072. f.fireEvent(c,
  3073. e)
  3074. } else f[f[a] ? a : c](b)
  3075. },
  3076. isDetached: function() {
  3077. var a = this.getDocument(),
  3078. b = a.getDocumentElement();
  3079. return b.equals(this) || b.contains(this) ? !CKEDITOR.env.ie || 8 < CKEDITOR.env.version && !CKEDITOR
  3080. .env.quirks ? !a.$.defaultView : !1 : !0
  3081. }
  3082. });
  3083. var h = {
  3084. width: ["border-left-width", "border-right-width", "padding-left", "padding-right"],
  3085. height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"]
  3086. };
  3087. CKEDITOR.dom.element.prototype.setSize = function(a, b, e) {
  3088. "number" == typeof b && (!e || CKEDITOR.env.ie && CKEDITOR.env.quirks ||
  3089. (b -= c.call(this, a)), this.setStyle(a, b + "px"))
  3090. };
  3091. CKEDITOR.dom.element.prototype.getSize = function(a, b) {
  3092. var e = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools
  3093. .capitalize(a)]) || 0;
  3094. b && (e -= c.call(this, a));
  3095. return e
  3096. }
  3097. })();
  3098. CKEDITOR.dom.documentFragment = function(a) {
  3099. a = a || CKEDITOR.document;
  3100. this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() : a
  3101. };
  3102. CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, {
  3103. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  3104. insertAfterNode: function(a) {
  3105. a = a.$;
  3106. a.parentNode.insertBefore(this.$, a.nextSibling)
  3107. },
  3108. getHtml: function() {
  3109. var a = new CKEDITOR.dom.element("div");
  3110. this.clone(1, 1).appendTo(a);
  3111. return a.getHtml().replace(/\s*data-cke-expando=".*?"/g, "")
  3112. }
  3113. }, !0, {
  3114. append: 1,
  3115. appendBogus: 1,
  3116. clone: 1,
  3117. getFirst: 1,
  3118. getHtml: 1,
  3119. getLast: 1,
  3120. getParent: 1,
  3121. getNext: 1,
  3122. getPrevious: 1,
  3123. appendTo: 1,
  3124. moveChildren: 1,
  3125. insertBefore: 1,
  3126. insertAfterNode: 1,
  3127. replace: 1,
  3128. trim: 1,
  3129. type: 1,
  3130. ltrim: 1,
  3131. rtrim: 1,
  3132. getDocument: 1,
  3133. getChildCount: 1,
  3134. getChild: 1,
  3135. getChildren: 1
  3136. });
  3137. CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.document.prototype, !0, {
  3138. find: 1,
  3139. findOne: 1
  3140. });
  3141. (function() {
  3142. function a(a, b) {
  3143. var c = this.range;
  3144. if (this._.end) return null;
  3145. if (!this._.start) {
  3146. this._.start = 1;
  3147. if (c.collapsed) return this.end(), null;
  3148. c.optimize()
  3149. }
  3150. var f, e = c.startContainer;
  3151. f = c.endContainer;
  3152. var d = c.startOffset,
  3153. g = c.endOffset,
  3154. w, k = this.guard,
  3155. h = this.type,
  3156. l = a ? "getPreviousSourceNode" : "getNextSourceNode";
  3157. if (!a && !this._.guardLTR) {
  3158. var q = f.type == CKEDITOR.NODE_ELEMENT ? f : f.getParent(),
  3159. E = f.type == CKEDITOR.NODE_ELEMENT ? f.getChild(g) : f.getNext();
  3160. this._.guardLTR = function(a, b) {
  3161. return (!b || !q.equals(a)) && (!E ||
  3162. !a.equals(E)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
  3163. }
  3164. }
  3165. if (a && !this._.guardRTL) {
  3166. var z = e.type == CKEDITOR.NODE_ELEMENT ? e : e.getParent(),
  3167. t = e.type == CKEDITOR.NODE_ELEMENT ? d ? e.getChild(d - 1) : null : e.getPrevious();
  3168. this._.guardRTL = function(a, b) {
  3169. return (!b || !z.equals(a)) && (!t || !a.equals(t)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a
  3170. .equals(c.root))
  3171. }
  3172. }
  3173. var D = a ? this._.guardRTL : this._.guardLTR;
  3174. w = k ? function(a, b) {
  3175. return !1 === D(a, b) ? !1 : k(a, b)
  3176. } : D;
  3177. this.current ? f = this.current[l](!1, h, w) : (a ? f.type == CKEDITOR.NODE_ELEMENT &&
  3178. (f = 0 < g ? f.getChild(g - 1) : !1 === w(f, !0) ? null : f.getPreviousSourceNode(!0, h, w)) : (f = e, f
  3179. .type == CKEDITOR.NODE_ELEMENT && ((f = f.getChild(d)) || (f = !1 === w(e, !0) ? null : e
  3180. .getNextSourceNode(!0, h, w)))), f && !1 === w(f) && (f = null));
  3181. for (; f && !this._.end;) {
  3182. this.current = f;
  3183. if (!this.evaluator || !1 !== this.evaluator(f)) {
  3184. if (!b) return f
  3185. } else if (b && this.evaluator) return !1;
  3186. f = f[l](!1, h, w)
  3187. }
  3188. this.end();
  3189. return this.current = null
  3190. }
  3191. function d(b) {
  3192. for (var c, f = null; c = a.call(this, b);) f = c;
  3193. return f
  3194. }
  3195. CKEDITOR.dom.walker = CKEDITOR.tools.createClass({
  3196. $: function(a) {
  3197. this.range =
  3198. a;
  3199. this._ = {}
  3200. },
  3201. proto: {
  3202. end: function() {
  3203. this._.end = 1
  3204. },
  3205. next: function() {
  3206. return a.call(this)
  3207. },
  3208. previous: function() {
  3209. return a.call(this, 1)
  3210. },
  3211. checkForward: function() {
  3212. return !1 !== a.call(this, 0, 1)
  3213. },
  3214. checkBackward: function() {
  3215. return !1 !== a.call(this, 1, 1)
  3216. },
  3217. lastForward: function() {
  3218. return d.call(this)
  3219. },
  3220. lastBackward: function() {
  3221. return d.call(this, 1)
  3222. },
  3223. reset: function() {
  3224. delete this.current;
  3225. this._ = {}
  3226. }
  3227. }
  3228. });
  3229. var b = {
  3230. block: 1,
  3231. "list-item": 1,
  3232. table: 1,
  3233. "table-row-group": 1,
  3234. "table-header-group": 1,
  3235. "table-footer-group": 1,
  3236. "table-row": 1,
  3237. "table-column-group": 1,
  3238. "table-column": 1,
  3239. "table-cell": 1,
  3240. "table-caption": 1
  3241. },
  3242. c = {
  3243. absolute: 1,
  3244. fixed: 1
  3245. };
  3246. CKEDITOR.dom.element.prototype.isBlockBoundary = function(a) {
  3247. return "none" != this.getComputedStyle("float") || this.getComputedStyle("position") in c || !b[this
  3248. .getComputedStyle("display")] ? !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) : !0
  3249. };
  3250. CKEDITOR.dom.walker.blockBoundary = function(a) {
  3251. return function(b) {
  3252. return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a))
  3253. }
  3254. };
  3255. CKEDITOR.dom.walker.listItemBoundary = function() {
  3256. return this.blockBoundary({
  3257. br: 1
  3258. })
  3259. };
  3260. CKEDITOR.dom.walker.bookmark = function(a, b) {
  3261. function c(a) {
  3262. return a && a.getName && "span" == a.getName() && a.data("cke-bookmark")
  3263. }
  3264. return function(f) {
  3265. var e, d;
  3266. e = f && f.type != CKEDITOR.NODE_ELEMENT && (d = f.getParent()) && c(d);
  3267. e = a ? e : e || c(f);
  3268. return !!(b ^ e)
  3269. }
  3270. };
  3271. CKEDITOR.dom.walker.whitespaces = function(a) {
  3272. return function(b) {
  3273. var c;
  3274. b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b
  3275. .getText() == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);
  3276. return !!(a ^ c)
  3277. }
  3278. };
  3279. CKEDITOR.dom.walker.invisible =
  3280. function(a) {
  3281. var b = CKEDITOR.dom.walker.whitespaces(),
  3282. c = CKEDITOR.env.webkit ? 1 : 0;
  3283. return function(f) {
  3284. b(f) ? f = 1 : (f.type == CKEDITOR.NODE_TEXT && (f = f.getParent()), f = f.$.offsetWidth <= c);
  3285. return !!(a ^ f)
  3286. }
  3287. };
  3288. CKEDITOR.dom.walker.nodeType = function(a, b) {
  3289. return function(c) {
  3290. return !!(b ^ c.type == a)
  3291. }
  3292. };
  3293. CKEDITOR.dom.walker.bogus = function(a) {
  3294. function b(a) {
  3295. return !e(a) && !h(a)
  3296. }
  3297. return function(c) {
  3298. var f = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && g.test(c.getText());
  3299. f && (f = c.getParent(), c = c.getNext(b), f = f.isBlockBoundary() &&
  3300. (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary()));
  3301. return !!(a ^ f)
  3302. }
  3303. };
  3304. CKEDITOR.dom.walker.temp = function(a) {
  3305. return function(b) {
  3306. b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  3307. b = b && b.hasAttribute("data-cke-temp");
  3308. return !!(a ^ b)
  3309. }
  3310. };
  3311. var g = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  3312. e = CKEDITOR.dom.walker.whitespaces(),
  3313. h = CKEDITOR.dom.walker.bookmark(),
  3314. k = CKEDITOR.dom.walker.temp(),
  3315. l = function(a) {
  3316. return h(a) || e(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd
  3317. .$empty)
  3318. };
  3319. CKEDITOR.dom.walker.ignored =
  3320. function(a) {
  3321. return function(b) {
  3322. b = e(b) || h(b) || k(b);
  3323. return !!(a ^ b)
  3324. }
  3325. };
  3326. var q = CKEDITOR.dom.walker.ignored();
  3327. CKEDITOR.dom.walker.empty = function(a) {
  3328. return function(b) {
  3329. for (var c = 0, f = b.getChildCount(); c < f; ++c)
  3330. if (!q(b.getChild(c))) return !!a;
  3331. return !a
  3332. }
  3333. };
  3334. var f = CKEDITOR.dom.walker.empty(),
  3335. w = CKEDITOR.dom.walker.validEmptyBlockContainers = CKEDITOR.tools.extend(function(a) {
  3336. var b = {},
  3337. c;
  3338. for (c in a) CKEDITOR.dtd[c]["#"] && (b[c] = 1);
  3339. return b
  3340. }(CKEDITOR.dtd.$block), {
  3341. caption: 1,
  3342. td: 1,
  3343. th: 1
  3344. });
  3345. CKEDITOR.dom.walker.editable = function(a) {
  3346. return function(b) {
  3347. b =
  3348. q(b) ? !1 : b.type == CKEDITOR.NODE_TEXT || b.type == CKEDITOR.NODE_ELEMENT && (b.is(CKEDITOR.dtd
  3349. .$inline) || b.is("hr") || "false" == b.getAttribute("contenteditable") || !CKEDITOR.env
  3350. .needsBrFiller && b.is(w) && f(b)) ? !0 : !1;
  3351. return !!(a ^ b)
  3352. }
  3353. };
  3354. CKEDITOR.dom.element.prototype.getBogus = function() {
  3355. var a = this;
  3356. do a = a.getPreviousSourceNode(); while (l(a));
  3357. return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && g.test(a.getText())) ? a : !1
  3358. }
  3359. })();
  3360. "use strict";
  3361. CKEDITOR.dom.range = function(a) {
  3362. this.endOffset = this.endContainer = this.startOffset = this.startContainer = null;
  3363. this.collapsed = !0;
  3364. var d = a instanceof CKEDITOR.dom.document;
  3365. this.document = d ? a : a.getDocument();
  3366. this.root = d ? a.getBody() : a
  3367. };
  3368. (function() {
  3369. function a(a) {
  3370. a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a
  3371. .startOffset == a.endOffset
  3372. }
  3373. function d(a, b, c, e, d) {
  3374. function g(a, b, c, f) {
  3375. var Q = c ? a.getPrevious() : a.getNext();
  3376. if (f && h) return Q;
  3377. q || f ? b.append(a.clone(!0, d), c) : (a.remove(), l && b.append(a, c));
  3378. return Q
  3379. }
  3380. function m() {
  3381. var a, b, c, f = Math.min(N.length, x.length);
  3382. for (a = 0; a < f; a++)
  3383. if (b = N[a], c = x[a], !b.equals(c)) return a;
  3384. return a - 1
  3385. }
  3386. function k() {
  3387. var b = H - 1,
  3388. c = D && C && !p.equals(u);
  3389. b < M - 1 || b < n - 1 || c ? (c ? a.moveToPosition(u,
  3390. CKEDITOR.POSITION_BEFORE_START) : n == b + 1 && t ? a.moveToPosition(x[b], CKEDITOR
  3391. .POSITION_BEFORE_END) : a.moveToPosition(x[b + 1], CKEDITOR.POSITION_BEFORE_START), e && (b = N[b +
  3392. 1]) && b.type == CKEDITOR.NODE_ELEMENT && (c = CKEDITOR.dom.element.createFromHtml(
  3393. '\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e', a.document),
  3394. c.insertAfter(b), b.mergeSiblings(!1), a.moveToBookmark({
  3395. startNode: c
  3396. }))) : a.collapse(!0)
  3397. }
  3398. a.optimizeBookmark();
  3399. var h = 0 === b,
  3400. l = 1 == b,
  3401. q = 2 == b;
  3402. b = q || l;
  3403. var p = a.startContainer,
  3404. u = a.endContainer,
  3405. K = a.startOffset,
  3406. E = a.endOffset,
  3407. z, t, D, C, I, T;
  3408. if (q && u.type == CKEDITOR.NODE_TEXT && (p.equals(u) || p.type === CKEDITOR.NODE_ELEMENT && p.getFirst()
  3409. .equals(u))) c.append(a.document.createText(u.substring(K, E)));
  3410. else {
  3411. u.type == CKEDITOR.NODE_TEXT ? q ? T = !0 : u = u.split(E) : 0 < u.getChildCount() ? E >= u
  3412. .getChildCount() ? (u = u.getChild(E - 1), t = !0) : u = u.getChild(E) : C = t = !0;
  3413. p.type == CKEDITOR.NODE_TEXT ? q ? I = !0 : p.split(K) : 0 < p.getChildCount() ? 0 === K ? (p = p.getChild(
  3414. K), z = !0) : p = p.getChild(K - 1) : D = z = !0;
  3415. for (var N = p.getParents(), x = u.getParents(), H = m(),
  3416. M = N.length - 1, n = x.length - 1, A = c, Q, aa, X, ea = -1, V = H; V <= M; V++) {
  3417. aa = N[V];
  3418. X = aa.getNext();
  3419. for (V != M || aa.equals(x[V]) && M < n ? b && (Q = A.append(aa.clone(0, d))) : z ? g(aa, A, !1, D) : I &&
  3420. A.append(a.document.createText(aa.substring(K))); X;) {
  3421. if (X.equals(x[V])) {
  3422. ea = V;
  3423. break
  3424. }
  3425. X = g(X, A)
  3426. }
  3427. A = Q
  3428. }
  3429. A = c;
  3430. for (V = H; V <= n; V++)
  3431. if (c = x[V], X = c.getPrevious(), c.equals(N[V])) b && (A = A.getChild(0));
  3432. else {
  3433. V != n || c.equals(N[V]) && n < M ? b && (Q = A.append(c.clone(0, d))) : t ? g(c, A, !1, C) : T && A
  3434. .append(a.document.createText(c.substring(0, E)));
  3435. if (V > ea)
  3436. for (; X;) X = g(X, A, !0);
  3437. A = Q
  3438. } q ||
  3439. k()
  3440. }
  3441. }
  3442. function b() {
  3443. var a = !1,
  3444. b = CKEDITOR.dom.walker.whitespaces(),
  3445. c = CKEDITOR.dom.walker.bookmark(!0),
  3446. d = CKEDITOR.dom.walker.bogus();
  3447. return function(g) {
  3448. return c(g) || b(g) ? !0 : d(g) && !a ? a = !0 : g.type == CKEDITOR.NODE_TEXT && (g.hasAscendant("pre") ||
  3449. CKEDITOR.tools.trim(g.getText()).length) || g.type == CKEDITOR.NODE_ELEMENT && !g.is(e) ? !1 : !0
  3450. }
  3451. }
  3452. function c(a) {
  3453. var b = CKEDITOR.dom.walker.whitespaces(),
  3454. c = CKEDITOR.dom.walker.bookmark(1);
  3455. return function(e) {
  3456. return c(e) || b(e) ? !0 : !a && h(e) || e.type == CKEDITOR.NODE_ELEMENT && e.is(CKEDITOR.dtd
  3457. .$removeEmpty)
  3458. }
  3459. }
  3460. function g(a) {
  3461. return function() {
  3462. var b;
  3463. return this[a ? "getPreviousNode" : "getNextNode"](function(a) {
  3464. !b && q(a) && (b = a);
  3465. return l(a) && !(h(a) && a.equals(b))
  3466. })
  3467. }
  3468. }
  3469. var e = {
  3470. abbr: 1,
  3471. acronym: 1,
  3472. b: 1,
  3473. bdo: 1,
  3474. big: 1,
  3475. cite: 1,
  3476. code: 1,
  3477. del: 1,
  3478. dfn: 1,
  3479. em: 1,
  3480. font: 1,
  3481. i: 1,
  3482. ins: 1,
  3483. label: 1,
  3484. kbd: 1,
  3485. q: 1,
  3486. samp: 1,
  3487. small: 1,
  3488. span: 1,
  3489. strike: 1,
  3490. strong: 1,
  3491. sub: 1,
  3492. sup: 1,
  3493. tt: 1,
  3494. u: 1,
  3495. "var": 1
  3496. },
  3497. h = CKEDITOR.dom.walker.bogus(),
  3498. k = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  3499. l = CKEDITOR.dom.walker.editable(),
  3500. q = CKEDITOR.dom.walker.ignored(!0);
  3501. CKEDITOR.dom.range.prototype = {
  3502. clone: function() {
  3503. var a =
  3504. new CKEDITOR.dom.range(this.root);
  3505. a._setStartContainer(this.startContainer);
  3506. a.startOffset = this.startOffset;
  3507. a._setEndContainer(this.endContainer);
  3508. a.endOffset = this.endOffset;
  3509. a.collapsed = this.collapsed;
  3510. return a
  3511. },
  3512. collapse: function(a) {
  3513. a ? (this._setEndContainer(this.startContainer), this.endOffset = this.startOffset) : (this
  3514. ._setStartContainer(this.endContainer), this.startOffset = this.endOffset);
  3515. this.collapsed = !0
  3516. },
  3517. cloneContents: function(a) {
  3518. var b = new CKEDITOR.dom.documentFragment(this.document);
  3519. this.collapsed ||
  3520. d(this, 2, b, !1, "undefined" == typeof a ? !0 : a);
  3521. return b
  3522. },
  3523. deleteContents: function(a) {
  3524. this.collapsed || d(this, 0, null, a)
  3525. },
  3526. extractContents: function(a, b) {
  3527. var c = new CKEDITOR.dom.documentFragment(this.document);
  3528. this.collapsed || d(this, 1, c, a, "undefined" == typeof b ? !0 : b);
  3529. return c
  3530. },
  3531. equals: function(a) {
  3532. return this.startOffset === a.startOffset && this.endOffset === a.endOffset && this.startContainer
  3533. .equals(a.startContainer) && this.endContainer.equals(a.endContainer)
  3534. },
  3535. createBookmark: function(a) {
  3536. function b(a) {
  3537. return a.getAscendant(function(a) {
  3538. var b;
  3539. if (b = a.data && a.data("cke-temp")) b = -1 === CKEDITOR.tools.array.indexOf(["cke_copybin",
  3540. "cke_pastebin"
  3541. ], a.getAttribute("id"));
  3542. return b
  3543. }, !0)
  3544. }
  3545. var c = this.startContainer,
  3546. e = this.endContainer,
  3547. d = this.collapsed,
  3548. g, m, k, h;
  3549. g = this.document.createElement("span");
  3550. g.data("cke-bookmark", 1);
  3551. g.setStyle("display", "none");
  3552. g.setHtml("\x26nbsp;");
  3553. a && (k = "cke_bm_" + CKEDITOR.tools.getNextNumber(), g.setAttribute("id", k + (d ? "C" : "S")));
  3554. d || (m = g.clone(), m.setHtml("\x26nbsp;"), a && m.setAttribute("id", k + "E"), h = this.clone(), b(
  3555. e) && (e = b(e),
  3556. h.moveToPosition(e, CKEDITOR.POSITION_AFTER_END)), h.collapse(), h.insertNode(m));
  3557. h = this.clone();
  3558. b(c) && (e = b(c), h.moveToPosition(e, CKEDITOR.POSITION_BEFORE_START));
  3559. h.collapse(!0);
  3560. h.insertNode(g);
  3561. m ? (this.setStartAfter(g), this.setEndBefore(m)) : this.moveToPosition(g, CKEDITOR.POSITION_AFTER_END);
  3562. return {
  3563. startNode: a ? k + (d ? "C" : "S") : g,
  3564. endNode: a ? k + "E" : m,
  3565. serializable: a,
  3566. collapsed: d
  3567. }
  3568. },
  3569. createBookmark2: function() {
  3570. function a(b) {
  3571. var f = b.container,
  3572. e = b.offset,
  3573. d;
  3574. d = f;
  3575. var g = e;
  3576. d = d.type != CKEDITOR.NODE_ELEMENT || 0 === g || g == d.getChildCount() ?
  3577. 0 : d.getChild(g - 1).type == CKEDITOR.NODE_TEXT && d.getChild(g).type == CKEDITOR.NODE_TEXT;
  3578. d && (f = f.getChild(e - 1), e = f.getLength());
  3579. if (f.type == CKEDITOR.NODE_ELEMENT && 0 < e) {
  3580. a: {
  3581. for (d = f; e--;)
  3582. if (g = d.getChild(e).getIndex(!0), 0 <= g) {
  3583. e = g;
  3584. break a
  3585. } e = -1
  3586. }
  3587. e += 1
  3588. }
  3589. if (f.type == CKEDITOR.NODE_TEXT) {
  3590. d = f;
  3591. for (g = 0;
  3592. (d = d.getPrevious()) && d.type == CKEDITOR.NODE_TEXT;) g += d.getText().replace(CKEDITOR.dom
  3593. .selection.FILLING_CHAR_SEQUENCE, "").length;
  3594. d = g;
  3595. f.isEmpty() ? (g = f.getPrevious(c), d ? (e = d, f = g ? g.getNext() : f.getParent().getFirst()) : (
  3596. f = f.getParent(),
  3597. e = g ? g.getIndex(!0) + 1 : 0)) : e += d
  3598. }
  3599. b.container = f;
  3600. b.offset = e
  3601. }
  3602. function b(a, c) {
  3603. var f = c.getCustomData("cke-fillingChar");
  3604. if (f) {
  3605. var e = a.container;
  3606. f.equals(e) && (a.offset -= CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length, 0 >= a.offset && (a
  3607. .offset = e.getIndex(), a.container = e.getParent()))
  3608. }
  3609. }
  3610. var c = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, !0);
  3611. return function(c) {
  3612. var e = this.collapsed,
  3613. d = {
  3614. container: this.startContainer,
  3615. offset: this.startOffset
  3616. },
  3617. m = {
  3618. container: this.endContainer,
  3619. offset: this.endOffset
  3620. };
  3621. c && (a(d), b(d, this.root),
  3622. e || (a(m), b(m, this.root)));
  3623. return {
  3624. start: d.container.getAddress(c),
  3625. end: e ? null : m.container.getAddress(c),
  3626. startOffset: d.offset,
  3627. endOffset: m.offset,
  3628. normalized: c,
  3629. collapsed: e,
  3630. is2: !0
  3631. }
  3632. }
  3633. }(),
  3634. moveToBookmark: function(a) {
  3635. if (a.is2) {
  3636. var b = this.document.getByAddress(a.start, a.normalized),
  3637. c = a.startOffset,
  3638. e = a.end && this.document.getByAddress(a.end, a.normalized);
  3639. a = a.endOffset;
  3640. this.setStart(b, c);
  3641. e ? this.setEnd(e, a) : this.collapse(!0)
  3642. } else b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode, a = c ? this
  3643. .document.getById(a.endNode) :
  3644. a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(
  3645. !0)
  3646. },
  3647. getBoundaryNodes: function() {
  3648. var a = this.startContainer,
  3649. b = this.endContainer,
  3650. c = this.startOffset,
  3651. e = this.endOffset,
  3652. d;
  3653. if (a.type == CKEDITOR.NODE_ELEMENT)
  3654. if (d = a.getChildCount(), d > c) a = a.getChild(c);
  3655. else if (1 > d) a = a.getPreviousSourceNode();
  3656. else {
  3657. for (a = a.$; a.lastChild;) a = a.lastChild;
  3658. a = new CKEDITOR.dom.node(a);
  3659. a = a.getNextSourceNode() || a
  3660. }
  3661. if (b.type == CKEDITOR.NODE_ELEMENT)
  3662. if (d = b.getChildCount(), d > e) b = b.getChild(e).getPreviousSourceNode(!0);
  3663. else if (1 > d) b = b.getPreviousSourceNode();
  3664. else {
  3665. for (b = b.$; b.lastChild;) b = b.lastChild;
  3666. b = new CKEDITOR.dom.node(b)
  3667. }
  3668. a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b);
  3669. return {
  3670. startNode: a,
  3671. endNode: b
  3672. }
  3673. },
  3674. getCommonAncestor: function(a, b) {
  3675. var c = this.startContainer,
  3676. e = this.endContainer,
  3677. c = c.equals(e) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c
  3678. .getChild(this.startOffset) : c : c.getCommonAncestor(e);
  3679. return b && !c.is ? c.getParent() : c
  3680. },
  3681. optimize: function() {
  3682. var a = this.startContainer,
  3683. b = this.startOffset;
  3684. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this
  3685. .setStartBefore(a));
  3686. a = this.endContainer;
  3687. b = this.endOffset;
  3688. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(
  3689. a))
  3690. },
  3691. optimizeBookmark: function() {
  3692. var a = this.startContainer,
  3693. b = this.endContainer;
  3694. a.is && a.is("span") && a.data("cke-bookmark") && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
  3695. b && b.is && b.is("span") && b.data("cke-bookmark") && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
  3696. },
  3697. trim: function(a,
  3698. b) {
  3699. var c = this.startContainer,
  3700. e = this.startOffset,
  3701. d = this.collapsed;
  3702. if ((!a || d) && c && c.type == CKEDITOR.NODE_TEXT) {
  3703. if (e)
  3704. if (e >= c.getLength()) e = c.getIndex() + 1, c = c.getParent();
  3705. else {
  3706. var g = c.split(e),
  3707. e = c.getIndex() + 1,
  3708. c = c.getParent();
  3709. this.startContainer.equals(this.endContainer) ? this.setEnd(g, this.endOffset - this
  3710. .startOffset) : c.equals(this.endContainer) && (this.endOffset += 1)
  3711. }
  3712. else e = c.getIndex(), c = c.getParent();
  3713. this.setStart(c, e);
  3714. if (d) {
  3715. this.collapse(!0);
  3716. return
  3717. }
  3718. }
  3719. c = this.endContainer;
  3720. e = this.endOffset;
  3721. b || d || !c || c.type !=
  3722. CKEDITOR.NODE_TEXT || (e ? (e >= c.getLength() || c.split(e), e = c.getIndex() + 1) : e = c
  3723. .getIndex(), c = c.getParent(), this.setEnd(c, e))
  3724. },
  3725. enlarge: function(a, b) {
  3726. function c(a) {
  3727. return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a
  3728. }
  3729. function e(a, b, c) {
  3730. var f = new CKEDITOR.dom.range(c);
  3731. f.setStart(a, b);
  3732. f.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  3733. c = new CKEDITOR.dom.walker(f);
  3734. for (c.guard = function(a) {
  3735. return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary())
  3736. }; f = c.next();) {
  3737. if (f.type != CKEDITOR.NODE_TEXT) return !1;
  3738. g = f != a ? f.getText() : f.substring(b);
  3739. if (d.test(g)) return !1
  3740. }
  3741. return !0
  3742. }
  3743. var d = new RegExp(/[^\s\ufeff]/),
  3744. g, m;
  3745. switch (a) {
  3746. case CKEDITOR.ENLARGE_INLINE:
  3747. var k = 1;
  3748. case CKEDITOR.ENLARGE_ELEMENT:
  3749. if (this.collapsed) break;
  3750. var h = this.getCommonAncestor();
  3751. m = this.root;
  3752. var q, l, p, u, K, E = !1,
  3753. z;
  3754. z = this.startContainer;
  3755. var t = this.startOffset;
  3756. z.type == CKEDITOR.NODE_TEXT ? (t && (z = !CKEDITOR.tools.trim(z.substring(0, t)).length && z, E = !
  3757. !z), z && ((u = z.getPrevious()) || (p = z.getParent()))) : (t && (u = z.getChild(t - 1) || z
  3758. .getLast()), u || (p = z));
  3759. for (p = c(p); p ||
  3760. u;) {
  3761. if (p && !u) {
  3762. !K && p.equals(h) && (K = !0);
  3763. if (k ? p.isBlockBoundary() : !m.contains(p)) break;
  3764. E && "inline" == p.getComputedStyle("display") || (E = !1, K ? q = p : this.setStartBefore(p));
  3765. u = p.getPrevious()
  3766. }
  3767. for (; u;)
  3768. if (z = !1, u.type == CKEDITOR.NODE_COMMENT) u = u.getPrevious();
  3769. else {
  3770. if (u.type == CKEDITOR.NODE_TEXT) g = u.getText(), d.test(g) && (u = null), z = /[\s\ufeff]$/
  3771. .test(g);
  3772. else if ((u.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && u.is("br")) && !u.data(
  3773. "cke-bookmark"))
  3774. if (E && CKEDITOR.dtd.$removeEmpty[u.getName()]) {
  3775. g = u.getText();
  3776. if (d.test(g)) u =
  3777. null;
  3778. else
  3779. for (var t = u.$.getElementsByTagName("*"), D = 0, C; C = t[D++];)
  3780. if (!CKEDITOR.dtd.$removeEmpty[C.nodeName.toLowerCase()]) {
  3781. u = null;
  3782. break
  3783. } u && (z = !!g.length)
  3784. } else u = null;
  3785. z && (E ? K ? q = p : p && this.setStartBefore(p) : E = !0);
  3786. if (u) {
  3787. z = u.getPrevious();
  3788. if (!p && !z) {
  3789. p = u;
  3790. u = null;
  3791. break
  3792. }
  3793. u = z
  3794. } else p = null
  3795. } p && (p = c(p.getParent()))
  3796. }
  3797. z = this.endContainer;
  3798. t = this.endOffset;
  3799. p = u = null;
  3800. K = E = !1;
  3801. z.type == CKEDITOR.NODE_TEXT ? CKEDITOR.tools.trim(z.substring(t)).length ? E = !0 : (E = !z
  3802. .getLength(), t == z.getLength() ? (u = z.getNext()) || (p = z.getParent()) : e(z,
  3803. t, m) && (p = z.getParent())) : (u = z.getChild(t)) || (p = z);
  3804. for (; p || u;) {
  3805. if (p && !u) {
  3806. !K && p.equals(h) && (K = !0);
  3807. if (k ? p.isBlockBoundary() : !m.contains(p)) break;
  3808. E && "inline" == p.getComputedStyle("display") || (E = !1, K ? l = p : p && this.setEndAfter(
  3809. p));
  3810. u = p.getNext()
  3811. }
  3812. for (; u;) {
  3813. z = !1;
  3814. if (u.type == CKEDITOR.NODE_TEXT) g = u.getText(), e(u, 0, m) || (u = null), z = /^[\s\ufeff]/
  3815. .test(g);
  3816. else if (u.type == CKEDITOR.NODE_ELEMENT) {
  3817. if ((0 < u.$.offsetWidth || b && u.is("br")) && !u.data("cke-bookmark"))
  3818. if (E && CKEDITOR.dtd.$removeEmpty[u.getName()]) {
  3819. g = u.getText();
  3820. if (d.test(g)) u =
  3821. null;
  3822. else
  3823. for (t = u.$.getElementsByTagName("*"), D = 0; C = t[D++];)
  3824. if (!CKEDITOR.dtd.$removeEmpty[C.nodeName.toLowerCase()]) {
  3825. u = null;
  3826. break
  3827. } u && (z = !!g.length)
  3828. } else u = null
  3829. } else z = 1;
  3830. z && E && (K ? l = p : this.setEndAfter(p));
  3831. if (u) {
  3832. z = u.getNext();
  3833. if (!p && !z) {
  3834. p = u;
  3835. u = null;
  3836. break
  3837. }
  3838. u = z
  3839. } else p = null
  3840. }
  3841. p && (p = c(p.getParent()))
  3842. }
  3843. q && l && (h = q.contains(l) ? l : q, this.setStartBefore(h), this.setEndAfter(h));
  3844. break;
  3845. case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
  3846. case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
  3847. p = new CKEDITOR.dom.range(this.root);
  3848. m = this.root;
  3849. p.setStartAt(m,
  3850. CKEDITOR.POSITION_AFTER_START);
  3851. p.setEnd(this.startContainer, this.startOffset);
  3852. p = new CKEDITOR.dom.walker(p);
  3853. var I, T, N = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? {
  3854. br: 1
  3855. } : null),
  3856. x = null,
  3857. H = function(a) {
  3858. if (a.type == CKEDITOR.NODE_ELEMENT && "false" == a.getAttribute("contenteditable"))
  3859. if (x) {
  3860. if (x.equals(a)) {
  3861. x = null;
  3862. return
  3863. }
  3864. } else x = a;
  3865. else if (x) return;
  3866. var b = N(a);
  3867. b || (I = a);
  3868. return b
  3869. },
  3870. k = function(a) {
  3871. var b = H(a);
  3872. !b && a.is && a.is("br") && (T = a);
  3873. return b
  3874. };
  3875. p.guard = H;
  3876. p = p.lastBackward();
  3877. I = I || m;
  3878. this.setStartAt(I,
  3879. !I.is("br") && (!p && this.checkStartOfBlock() || p && I.contains(p)) ? CKEDITOR
  3880. .POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
  3881. if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
  3882. p = this.clone();
  3883. p = new CKEDITOR.dom.walker(p);
  3884. var M = CKEDITOR.dom.walker.whitespaces(),
  3885. n = CKEDITOR.dom.walker.bookmark();
  3886. p.evaluator = function(a) {
  3887. return !M(a) && !n(a)
  3888. };
  3889. if ((p = p.previous()) && p.type == CKEDITOR.NODE_ELEMENT && p.is("br")) break
  3890. }
  3891. p = this.clone();
  3892. p.collapse();
  3893. p.setEndAt(m, CKEDITOR.POSITION_BEFORE_END);
  3894. p = new CKEDITOR.dom.walker(p);
  3895. p.guard =
  3896. a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? k : H;
  3897. I = x = T = null;
  3898. p = p.lastForward();
  3899. I = I || m;
  3900. this.setEndAt(I, !p && this.checkEndOfBlock() || p && I.contains(p) ? CKEDITOR.POSITION_BEFORE_END :
  3901. CKEDITOR.POSITION_BEFORE_START);
  3902. T && this.setEndAfter(T)
  3903. }
  3904. },
  3905. shrink: function(a, b, c) {
  3906. var e = "boolean" === typeof c ? c : c && "boolean" === typeof c.shrinkOnBlockBoundary ? c
  3907. .shrinkOnBlockBoundary : !0,
  3908. d = c && c.skipBogus;
  3909. if (!this.collapsed) {
  3910. a = a || CKEDITOR.SHRINK_TEXT;
  3911. var g = this.clone(),
  3912. m = this.startContainer,
  3913. h = this.endContainer,
  3914. k = this.startOffset,
  3915. q = this.endOffset,
  3916. l = c = 1;
  3917. m && m.type == CKEDITOR.NODE_TEXT && (k ? k >= m.getLength() ? g.setStartAfter(m) : (g.setStartBefore(
  3918. m), c = 0) : g.setStartBefore(m));
  3919. h && h.type == CKEDITOR.NODE_TEXT && (q ? q >= h.getLength() ? g.setEndAfter(h) : (g.setEndAfter(h),
  3920. l = 0) : g.setEndBefore(h));
  3921. var g = new CKEDITOR.dom.walker(g),
  3922. p = CKEDITOR.dom.walker.bookmark(),
  3923. u = CKEDITOR.dom.walker.bogus();
  3924. g.evaluator = function(b) {
  3925. return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT)
  3926. };
  3927. var K;
  3928. g.guard = function(b, c) {
  3929. if (d && u(b) || p(b)) return !0;
  3930. if (a == CKEDITOR.SHRINK_ELEMENT &&
  3931. b.type == CKEDITOR.NODE_TEXT || c && b.equals(K) || !1 === e && b.type == CKEDITOR
  3932. .NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute(
  3933. "contenteditable")) return !1;
  3934. c || b.type != CKEDITOR.NODE_ELEMENT || (K = b);
  3935. return !0
  3936. };
  3937. c && (m = g[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(m, b ?
  3938. CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
  3939. l && (g.reset(), (g = g[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this
  3940. .setEndAt(g, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END));
  3941. return !(!c && !l)
  3942. }
  3943. },
  3944. insertNode: function(a) {
  3945. this.optimizeBookmark();
  3946. this.trim(!1, !0);
  3947. var b = this.startContainer,
  3948. c = b.getChild(this.startOffset);
  3949. c ? a.insertBefore(c) : b.append(a);
  3950. a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
  3951. this.setStartBefore(a)
  3952. },
  3953. moveToPosition: function(a, b) {
  3954. this.setStartAt(a, b);
  3955. this.collapse(!0)
  3956. },
  3957. moveToRange: function(a) {
  3958. this.setStart(a.startContainer, a.startOffset);
  3959. this.setEnd(a.endContainer, a.endOffset)
  3960. },
  3961. selectNodeContents: function(a) {
  3962. this.setStart(a, 0);
  3963. this.setEnd(a,
  3964. a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
  3965. },
  3966. setStart: function(b, c) {
  3967. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex(), b = b
  3968. .getParent());
  3969. this._setStartContainer(b);
  3970. this.startOffset = c;
  3971. this.endContainer || (this._setEndContainer(b), this.endOffset = c);
  3972. a(this)
  3973. },
  3974. setEnd: function(b, c) {
  3975. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b
  3976. .getParent());
  3977. this._setEndContainer(b);
  3978. this.endOffset = c;
  3979. this.startContainer || (this._setStartContainer(b),
  3980. this.startOffset = c);
  3981. a(this)
  3982. },
  3983. setStartAfter: function(a) {
  3984. this.setStart(a.getParent(), a.getIndex() + 1)
  3985. },
  3986. setStartBefore: function(a) {
  3987. this.setStart(a.getParent(), a.getIndex())
  3988. },
  3989. setEndAfter: function(a) {
  3990. this.setEnd(a.getParent(), a.getIndex() + 1)
  3991. },
  3992. setEndBefore: function(a) {
  3993. this.setEnd(a.getParent(), a.getIndex())
  3994. },
  3995. setStartAt: function(b, c) {
  3996. switch (c) {
  3997. case CKEDITOR.POSITION_AFTER_START:
  3998. this.setStart(b, 0);
  3999. break;
  4000. case CKEDITOR.POSITION_BEFORE_END:
  4001. b.type == CKEDITOR.NODE_TEXT ? this.setStart(b, b.getLength()) : this.setStart(b,
  4002. b.getChildCount());
  4003. break;
  4004. case CKEDITOR.POSITION_BEFORE_START:
  4005. this.setStartBefore(b);
  4006. break;
  4007. case CKEDITOR.POSITION_AFTER_END:
  4008. this.setStartAfter(b)
  4009. }
  4010. a(this)
  4011. },
  4012. setEndAt: function(b, c) {
  4013. switch (c) {
  4014. case CKEDITOR.POSITION_AFTER_START:
  4015. this.setEnd(b, 0);
  4016. break;
  4017. case CKEDITOR.POSITION_BEFORE_END:
  4018. b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount());
  4019. break;
  4020. case CKEDITOR.POSITION_BEFORE_START:
  4021. this.setEndBefore(b);
  4022. break;
  4023. case CKEDITOR.POSITION_AFTER_END:
  4024. this.setEndAfter(b)
  4025. }
  4026. a(this)
  4027. },
  4028. fixBlock: function(a,
  4029. b) {
  4030. var c = this.createBookmark(),
  4031. e = this.document.createElement(b);
  4032. this.collapse(a);
  4033. this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  4034. this.extractContents().appendTo(e);
  4035. e.trim();
  4036. this.insertNode(e);
  4037. var d = e.getBogus();
  4038. d && d.remove();
  4039. e.appendBogus();
  4040. this.moveToBookmark(c);
  4041. return e
  4042. },
  4043. splitBlock: function(a, b) {
  4044. var c = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
  4045. e = new CKEDITOR.dom.elementPath(this.endContainer, this.root),
  4046. d = c.block,
  4047. g = e.block,
  4048. m = null;
  4049. if (!c.blockLimit.equals(e.blockLimit)) return null;
  4050. "br" !=
  4051. a && (d || (d = this.fixBlock(!0, a), g = (new CKEDITOR.dom.elementPath(this.endContainer, this.root))
  4052. .block), g || (g = this.fixBlock(!1, a)));
  4053. c = d && this.checkStartOfBlock();
  4054. e = g && this.checkEndOfBlock();
  4055. this.deleteContents();
  4056. d && d.equals(g) && (e ? (m = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this
  4057. .moveToPosition(g, CKEDITOR.POSITION_AFTER_END), g = null) : c ? (m = new CKEDITOR.dom
  4058. .elementPath(this.startContainer, this.root), this.moveToPosition(d, CKEDITOR
  4059. .POSITION_BEFORE_START), d = null) : (g = this.splitElement(d, b ||
  4060. !1), d.is("ul", "ol") || d.appendBogus()));
  4061. return {
  4062. previousBlock: d,
  4063. nextBlock: g,
  4064. wasStartOfBlock: c,
  4065. wasEndOfBlock: e,
  4066. elementPath: m
  4067. }
  4068. },
  4069. splitElement: function(a, b) {
  4070. if (!this.collapsed) return null;
  4071. this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
  4072. var c = this.extractContents(!1, b || !1),
  4073. e = a.clone(!1, b || !1);
  4074. c.appendTo(e);
  4075. e.insertAfter(a);
  4076. this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  4077. return e
  4078. },
  4079. removeEmptyBlocksAtEnd: function() {
  4080. function a(f) {
  4081. return function(a) {
  4082. return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() ||
  4083. f.is("table") && a.is("caption") ? !1 : !0
  4084. }
  4085. }
  4086. var b = CKEDITOR.dom.walker.whitespaces(),
  4087. c = CKEDITOR.dom.walker.bookmark(!1);
  4088. return function(b) {
  4089. for (var c = this.createBookmark(), e = this[b ? "endPath" : "startPath"](), d = e.block || e
  4090. .blockLimit, g; d && !d.equals(e.root) && !d.getFirst(a(d));) g = d.getParent(), this[b ?
  4091. "setEndAt" : "setStartAt"](d, CKEDITOR.POSITION_AFTER_END), d.remove(1), d = g;
  4092. this.moveToBookmark(c)
  4093. }
  4094. }(),
  4095. startPath: function() {
  4096. return new CKEDITOR.dom.elementPath(this.startContainer, this.root)
  4097. },
  4098. endPath: function() {
  4099. return new CKEDITOR.dom.elementPath(this.endContainer,
  4100. this.root)
  4101. },
  4102. checkBoundaryOfElement: function(a, b) {
  4103. var e = b == CKEDITOR.START,
  4104. d = this.clone();
  4105. d.collapse(e);
  4106. d[e ? "setStartAt" : "setEndAt"](a, e ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
  4107. d = new CKEDITOR.dom.walker(d);
  4108. d.evaluator = c(e);
  4109. return d[e ? "checkBackward" : "checkForward"]()
  4110. },
  4111. checkStartOfBlock: function(a) {
  4112. var c = this.startContainer,
  4113. e = this.startOffset;
  4114. CKEDITOR.env.ie && e && c.type == CKEDITOR.NODE_TEXT && (c = CKEDITOR.tools.ltrim(c.substring(0, e)), k
  4115. .test(c) && this.trim(0, 1));
  4116. a || this.trim();
  4117. a = new CKEDITOR.dom.elementPath(this.startContainer,
  4118. this.root);
  4119. c = this.clone();
  4120. c.collapse(!0);
  4121. c.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START);
  4122. a = new CKEDITOR.dom.walker(c);
  4123. a.evaluator = b();
  4124. return a.checkBackward()
  4125. },
  4126. checkEndOfBlock: function(a) {
  4127. var c = this.endContainer,
  4128. e = this.endOffset;
  4129. CKEDITOR.env.ie && c.type == CKEDITOR.NODE_TEXT && (c = CKEDITOR.tools.rtrim(c.substring(e)), k.test(
  4130. c) && this.trim(1, 0));
  4131. a || this.trim();
  4132. a = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
  4133. c = this.clone();
  4134. c.collapse(!1);
  4135. c.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END);
  4136. a = new CKEDITOR.dom.walker(c);
  4137. a.evaluator = b();
  4138. return a.checkForward()
  4139. },
  4140. getPreviousNode: function(a, b, c) {
  4141. var e = this.clone();
  4142. e.collapse(1);
  4143. e.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START);
  4144. c = new CKEDITOR.dom.walker(e);
  4145. c.evaluator = a;
  4146. c.guard = b;
  4147. return c.previous()
  4148. },
  4149. getNextNode: function(a, b, c) {
  4150. var e = this.clone();
  4151. e.collapse();
  4152. e.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
  4153. c = new CKEDITOR.dom.walker(e);
  4154. c.evaluator = a;
  4155. c.guard = b;
  4156. return c.next()
  4157. },
  4158. checkReadOnly: function() {
  4159. function a(b, c) {
  4160. for (; b;) {
  4161. if (b.type ==
  4162. CKEDITOR.NODE_ELEMENT) {
  4163. if ("false" == b.getAttribute("contentEditable") && !b.data("cke-editable")) return 0;
  4164. if (b.is("html") || "true" == b.getAttribute("contentEditable") && (b.contains(c) || b.equals(c)))
  4165. break
  4166. }
  4167. b = b.getParent()
  4168. }
  4169. return 1
  4170. }
  4171. return function() {
  4172. var b = this.startContainer,
  4173. c = this.endContainer;
  4174. return !(a(b, c) && a(c, b))
  4175. }
  4176. }(),
  4177. moveToElementEditablePosition: function(a, b) {
  4178. if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) return this.moveToPosition(a, b ? CKEDITOR
  4179. .POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START),
  4180. !0;
  4181. for (var c = 0; a;) {
  4182. if (a.type == CKEDITOR.NODE_TEXT) {
  4183. b && this.endContainer && this.checkEndOfBlock() && k.test(a.getText()) ? this.moveToPosition(a,
  4184. CKEDITOR.POSITION_BEFORE_START) : this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END :
  4185. CKEDITOR.POSITION_BEFORE_START);
  4186. c = 1;
  4187. break
  4188. }
  4189. if (a.type == CKEDITOR.NODE_ELEMENT)
  4190. if (a.isEditable()) this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR
  4191. .POSITION_AFTER_START), c = 1;
  4192. else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a,
  4193. CKEDITOR.POSITION_BEFORE_START);
  4194. else if ("false" == a.getAttribute("contenteditable") && a.is(CKEDITOR.dtd.$block)) return this
  4195. .setStartBefore(a), this.setEndAfter(a), !0;
  4196. var e = a,
  4197. d = c,
  4198. g = void 0;
  4199. e.type == CKEDITOR.NODE_ELEMENT && e.isEditable(!1) && (g = e[b ? "getLast" : "getFirst"](q));
  4200. d || g || (g = e[b ? "getPrevious" : "getNext"](q));
  4201. a = g
  4202. }
  4203. return !!c
  4204. },
  4205. moveToClosestEditablePosition: function(a, b) {
  4206. var c, e = 0,
  4207. d, g, m = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
  4208. a ? (c = new CKEDITOR.dom.range(this.root), c.moveToPosition(a, m[b ? 0 : 1])) : c = this.clone();
  4209. if (a &&
  4210. !a.is(CKEDITOR.dtd.$block)) e = 1;
  4211. else if (d = c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) e = 1, (g = d.type == CKEDITOR
  4212. .NODE_ELEMENT) && d.is(CKEDITOR.dtd.$block) && "false" == d.getAttribute("contenteditable") ? (c
  4213. .setStartAt(d, CKEDITOR.POSITION_BEFORE_START), c.setEndAt(d, CKEDITOR.POSITION_AFTER_END)) : !
  4214. CKEDITOR.env.needsBrFiller && g && d.is(CKEDITOR.dom.walker.validEmptyBlockContainers) ? (c.setEnd(d,
  4215. 0), c.collapse()) : c.moveToPosition(d, m[b ? 1 : 0]);
  4216. e && this.moveToRange(c);
  4217. return !!e
  4218. },
  4219. moveToElementEditStart: function(a) {
  4220. return this.moveToElementEditablePosition(a)
  4221. },
  4222. moveToElementEditEnd: function(a) {
  4223. return this.moveToElementEditablePosition(a, !0)
  4224. },
  4225. getEnclosedNode: function() {
  4226. var a = this.clone();
  4227. a.optimize();
  4228. if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT)
  4229. return null;
  4230. var a = new CKEDITOR.dom.walker(a),
  4231. b = CKEDITOR.dom.walker.bookmark(!1, !0),
  4232. c = CKEDITOR.dom.walker.whitespaces(!0);
  4233. a.evaluator = function(a) {
  4234. return c(a) && b(a)
  4235. };
  4236. var e = a.next();
  4237. a.reset();
  4238. return e && e.equals(a.previous()) ? e : null
  4239. },
  4240. getTouchedStartNode: function() {
  4241. var a = this.startContainer;
  4242. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a
  4243. },
  4244. getTouchedEndNode: function() {
  4245. var a = this.endContainer;
  4246. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
  4247. },
  4248. getNextEditableNode: g(),
  4249. getPreviousEditableNode: g(1),
  4250. _getTableElement: function(a) {
  4251. a = a || {
  4252. td: 1,
  4253. th: 1,
  4254. tr: 1,
  4255. tbody: 1,
  4256. thead: 1,
  4257. tfoot: 1,
  4258. table: 1
  4259. };
  4260. var b = this.getTouchedStartNode(),
  4261. c = this.getTouchedEndNode(),
  4262. e = b.getAscendant("table", !0),
  4263. c = c.getAscendant("table", !0);
  4264. return e && !this.root.contains(e) ?
  4265. null : this.getEnclosedNode() ? this.getEnclosedNode().getAscendant(a, !0) : e && c && (e.equals(c) ||
  4266. e.contains(c) || c.contains(e)) ? b.getAscendant(a, !0) : null
  4267. },
  4268. scrollIntoView: function() {
  4269. var a = new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", this.document),
  4270. b, c, e, d = this.clone();
  4271. d.optimize();
  4272. (e = d.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = d.startContainer.getText(), b = d
  4273. .startContainer.split(d.startOffset), a.insertAfter(d.startContainer)) : d.insertNode(a);
  4274. a.scrollIntoView();
  4275. e && (d.startContainer.setText(c),
  4276. b.remove());
  4277. a.remove()
  4278. },
  4279. getClientRects: function() {
  4280. function a(b, c) {
  4281. var e = CKEDITOR.tools.array.map(b, function(a) {
  4282. return a
  4283. }),
  4284. d = new CKEDITOR.dom.range(c.root),
  4285. f, g, h;
  4286. c.startContainer instanceof CKEDITOR.dom.element && (g = 0 === c.startOffset && c.startContainer
  4287. .hasAttribute("data-widget"));
  4288. c.endContainer instanceof CKEDITOR.dom.element && (h = (h = c.endOffset === (c.endContainer
  4289. .getChildCount ? c.endContainer.getChildCount() : c.endContainer.length)) && c.endContainer
  4290. .hasAttribute("data-widget"));
  4291. g && d.setStart(c.startContainer.getParent(),
  4292. c.startContainer.getIndex());
  4293. h && d.setEnd(c.endContainer.getParent(), c.endContainer.getIndex() + 1);
  4294. if (g || h) c = d;
  4295. d = c.cloneContents().find("[data-cke-widget-id]").toArray();
  4296. if (d = CKEDITOR.tools.array.map(d, function(a) {
  4297. var b = c.root.editor;
  4298. a = a.getAttribute("data-cke-widget-id");
  4299. return b.widgets.instances[a].element
  4300. })) return d = CKEDITOR.tools.array.map(d, function(a) {
  4301. var b;
  4302. b = a.getParent().hasClass("cke_widget_wrapper") ? a.getParent() : a;
  4303. f = this.root.getDocument().$.createRange();
  4304. f.setStart(b.getParent().$, b.getIndex());
  4305. f.setEnd(b.getParent().$, b.getIndex() + 1);
  4306. b = f.getClientRects();
  4307. b.widgetRect = a.getClientRect();
  4308. return b
  4309. }, c), CKEDITOR.tools.array.forEach(d, function(a) {
  4310. function b(d) {
  4311. CKEDITOR.tools.array.forEach(e, function(b, f) {
  4312. var g = CKEDITOR.tools.objectCompare(a[d], b);
  4313. g || (g = CKEDITOR.tools.objectCompare(a.widgetRect, b));
  4314. g && (Array.prototype.splice.call(e, f, a.length - d, a.widgetRect), c = !0)
  4315. });
  4316. c || (d < e.length - 1 ? b(d + 1) : e.push(a.widgetRect))
  4317. }
  4318. var c;
  4319. b(0)
  4320. }), e
  4321. }
  4322. function b(a, c, d) {
  4323. var f;
  4324. c.collapsed ? d.startContainer instanceof CKEDITOR.dom.element ?
  4325. (a = d.checkStartOfBlock(), f = new CKEDITOR.dom.text("​"), a ? d.startContainer.append(f, !0) :
  4326. 0 === d.startOffset ? f.insertBefore(d.startContainer.getFirst()) : (d = d.startContainer
  4327. .getChildren().getItem(d.startOffset - 1), f.insertAfter(d)), c.setStart(f.$, 0), c.setEnd(f.$,
  4328. 0), a = c.getClientRects(), f.remove()) : d.startContainer instanceof CKEDITOR.dom.text && (
  4329. "" === d.startContainer.getText() ? (d.startContainer.setText("​"), a = c.getClientRects(), d
  4330. .startContainer.setText("")) : a = [e(d.createBookmark())]) : a = [e(d.createBookmark())];
  4331. return a
  4332. }
  4333. function c(a, b, e) {
  4334. a = CKEDITOR.tools.extend({}, a);
  4335. b && (a = CKEDITOR.tools.getAbsoluteRectPosition(e.document.getWindow(), a));
  4336. !a.width && (a.width = a.right - a.left);
  4337. !a.height && (a.height = a.bottom - a.top);
  4338. return a
  4339. }
  4340. function e(a) {
  4341. var b = a.startNode;
  4342. a = a.endNode;
  4343. var c;
  4344. b.setText("​");
  4345. b.removeStyle("display");
  4346. a ? (a.setText("​"), a.removeStyle("display"), c = [b.getClientRect(), a.getClientRect()], a
  4347. .remove()) : c = [b.getClientRect(), b.getClientRect()];
  4348. b.remove();
  4349. return {
  4350. right: Math.max(c[0].right, c[1].right),
  4351. bottom: Math.max(c[0].bottom,
  4352. c[1].bottom),
  4353. left: Math.min(c[0].left, c[1].left),
  4354. top: Math.min(c[0].top, c[1].top),
  4355. width: Math.abs(c[0].left - c[1].left),
  4356. height: Math.max(c[0].bottom, c[1].bottom) - Math.min(c[0].top, c[1].top)
  4357. }
  4358. }
  4359. return void 0 !== document.getSelection ? function(e) {
  4360. var d = this.root.getDocument().$.createRange(),
  4361. g;
  4362. d.setStart(this.startContainer.$, this.startOffset);
  4363. d.setEnd(this.endContainer.$, this.endOffset);
  4364. g = d.getClientRects();
  4365. g = a(g, this);
  4366. g.length || (g = b(g, d, this));
  4367. return CKEDITOR.tools.array.map(g, function(a) {
  4368. return c(a, e, this)
  4369. },
  4370. this)
  4371. } : function(a) {
  4372. return [c(e(this.createBookmark()), a, this)]
  4373. }
  4374. }(),
  4375. _setStartContainer: function(a) {
  4376. this.startContainer = a
  4377. },
  4378. _setEndContainer: function(a) {
  4379. this.endContainer = a
  4380. },
  4381. _find: function(a, b) {
  4382. var c = this.getCommonAncestor(),
  4383. e = this.getBoundaryNodes(),
  4384. d = [],
  4385. g, m, h, k;
  4386. if (c && c.find)
  4387. for (m = c.find(a), g = 0; g < m.count(); g++)
  4388. if (c = m.getItem(g), b || !c.isReadOnly()) h = c.getPosition(e.startNode) & CKEDITOR
  4389. .POSITION_FOLLOWING || e.startNode.equals(c), k = c.getPosition(e.endNode) & CKEDITOR
  4390. .POSITION_PRECEDING + CKEDITOR.POSITION_IS_CONTAINED ||
  4391. e.endNode.equals(c), h && k && d.push(c);
  4392. return d
  4393. }
  4394. };
  4395. CKEDITOR.dom.range.mergeRanges = function(a) {
  4396. return CKEDITOR.tools.array.reduce(a, function(a, b) {
  4397. var c = a[a.length - 1],
  4398. e = !1;
  4399. b = b.clone();
  4400. b.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  4401. if (c) {
  4402. var d = new CKEDITOR.dom.range(b.root),
  4403. e = new CKEDITOR.dom.walker(d),
  4404. f = CKEDITOR.dom.walker.whitespaces();
  4405. d.setStart(c.endContainer, c.endOffset);
  4406. d.setEnd(b.startContainer, b.startOffset);
  4407. for (d = e.next(); f(d) || b.endContainer.equals(d);) d = e.next();
  4408. e = !d
  4409. }
  4410. e ? c.setEnd(b.endContainer, b.endOffset) :
  4411. a.push(b);
  4412. return a
  4413. }, [])
  4414. }
  4415. })();
  4416. CKEDITOR.POSITION_AFTER_START = 1;
  4417. CKEDITOR.POSITION_BEFORE_END = 2;
  4418. CKEDITOR.POSITION_BEFORE_START = 3;
  4419. CKEDITOR.POSITION_AFTER_END = 4;
  4420. CKEDITOR.ENLARGE_ELEMENT = 1;
  4421. CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2;
  4422. CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3;
  4423. CKEDITOR.ENLARGE_INLINE = 4;
  4424. CKEDITOR.START = 1;
  4425. CKEDITOR.END = 2;
  4426. CKEDITOR.SHRINK_ELEMENT = 1;
  4427. CKEDITOR.SHRINK_TEXT = 2;
  4428. "use strict";
  4429. (function() {
  4430. function a(a) {
  4431. 1 > arguments.length || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks =
  4432. 0, this._ || (this._ = {}))
  4433. }
  4434. function d(a) {
  4435. var b = [];
  4436. a.forEach(function(a) {
  4437. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  4438. }, CKEDITOR.NODE_ELEMENT, !0);
  4439. return b
  4440. }
  4441. function b(a, c, e, g) {
  4442. a: {
  4443. null == g && (g = d(e));
  4444. for (var h; h = g.shift();)
  4445. if (h.getDtd().p) {
  4446. g = {
  4447. element: h,
  4448. remaining: g
  4449. };
  4450. break a
  4451. } g = null
  4452. }
  4453. if (!g) return 0;
  4454. if ((h = CKEDITOR.filter.instances[g.element.data("cke-filter")]) && !h.check(c)) return b(a,
  4455. c, e, g.remaining);c = new CKEDITOR.dom.range(g.element);c.selectNodeContents(g.element);c = c
  4456. .createIterator();c.enlargeBr = a.enlargeBr;c.enforceRealBlocks = a.enforceRealBlocks;c.activeFilter = c
  4457. .filter = h;a._.nestedEditable = {
  4458. element: g.element,
  4459. container: e,
  4460. remaining: g.remaining,
  4461. iterator: c
  4462. };
  4463. return 1
  4464. }
  4465. function c(a, b, c) {
  4466. if (!b) return !1;
  4467. a = a.clone();
  4468. a.collapse(!c);
  4469. return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END)
  4470. }
  4471. var g = /^[\r\n\t ]+$/,
  4472. e = CKEDITOR.dom.walker.bookmark(!1, !0),
  4473. h = CKEDITOR.dom.walker.whitespaces(!0),
  4474. k = function(a) {
  4475. return e(a) && h(a)
  4476. },
  4477. l = {
  4478. dd: 1,
  4479. dt: 1,
  4480. li: 1
  4481. };
  4482. a.prototype = {
  4483. getNextParagraph: function(a) {
  4484. var d, h, B, y, F;
  4485. a = a || "p";
  4486. if (this._.nestedEditable) {
  4487. if (d = this._.nestedEditable.iterator.getNextParagraph(a)) return this.activeFilter = this._
  4488. .nestedEditable.iterator.activeFilter, d;
  4489. this.activeFilter = this.filter;
  4490. if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) return this
  4491. .activeFilter = this._.nestedEditable.iterator.activeFilter, this._.nestedEditable.iterator
  4492. .getNextParagraph(a);
  4493. this._.nestedEditable =
  4494. null
  4495. }
  4496. if (!this.range.root.getDtd()[a]) return null;
  4497. if (!this._.started) {
  4498. var r = this.range.clone();
  4499. h = r.startPath();
  4500. var m = r.endPath(),
  4501. L = !r.collapsed && c(r, h.block),
  4502. v = !r.collapsed && c(r, m.block, 1);
  4503. r.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
  4504. L && r.setStartAt(h.block, CKEDITOR.POSITION_BEFORE_END);
  4505. v && r.setEndAt(m.block, CKEDITOR.POSITION_AFTER_START);
  4506. h = r.endContainer.hasAscendant("pre", !0) || r.startContainer.hasAscendant("pre", !0);
  4507. r.enlarge(this.forceBrBreak && !h || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR
  4508. .ENLARGE_BLOCK_CONTENTS);
  4509. r.collapsed || (h = new CKEDITOR.dom.walker(r.clone()), m = CKEDITOR.dom.walker.bookmark(!0, !0), h
  4510. .evaluator = m, this._.nextNode = h.next(), h = new CKEDITOR.dom.walker(r.clone()), h.evaluator =
  4511. m, h = h.previous(), this._.lastNode = h.getNextSourceNode(!0, null, r.root), this._.lastNode &&
  4512. this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) &&
  4513. this._.lastNode.getParent().isBlockBoundary() && (m = this.range.clone(), m.moveToPosition(this._
  4514. .lastNode, CKEDITOR.POSITION_AFTER_END), m.checkEndOfBlock() &&
  4515. (m = new CKEDITOR.dom.elementPath(m.endContainer, m.root), this._.lastNode = (m.block || m
  4516. .blockLimit).getNextSourceNode(!0))), this._.lastNode && r.root.contains(this._.lastNode) || (
  4517. this._.lastNode = this._.docEndMarker = r.document.createText(""), this._.lastNode.insertAfter(
  4518. h)), r = null);
  4519. this._.started = 1;
  4520. h = r
  4521. }
  4522. m = this._.nextNode;
  4523. r = this._.lastNode;
  4524. for (this._.nextNode = null; m;) {
  4525. var L = 0,
  4526. v = m.hasAscendant("pre"),
  4527. J = m.type != CKEDITOR.NODE_ELEMENT,
  4528. G = 0;
  4529. if (J) m.type == CKEDITOR.NODE_TEXT && g.test(m.getText()) && (J = 0);
  4530. else {
  4531. var p = m.getName();
  4532. if (CKEDITOR.dtd.$block[p] && "false" == m.getAttribute("contenteditable")) {
  4533. d = m;
  4534. b(this, a, d);
  4535. break
  4536. } else if (m.isBlockBoundary(this.forceBrBreak && !v && {
  4537. br: 1
  4538. })) {
  4539. if ("br" == p) J = 1;
  4540. else if (!h && !m.getChildCount() && "hr" != p) {
  4541. d = m;
  4542. B = m.equals(r);
  4543. break
  4544. }
  4545. h && (h.setEndAt(m, CKEDITOR.POSITION_BEFORE_START), "br" != p && (this._.nextNode = m));
  4546. L = 1
  4547. } else {
  4548. if (m.getFirst()) {
  4549. h || (h = this.range.clone(), h.setStartAt(m, CKEDITOR.POSITION_BEFORE_START));
  4550. m = m.getFirst();
  4551. continue
  4552. }
  4553. J = 1
  4554. }
  4555. }
  4556. J && !h && (h = this.range.clone(), h.setStartAt(m, CKEDITOR.POSITION_BEFORE_START));
  4557. B = (!L || J) && m.equals(r);
  4558. if (h && !L)
  4559. for (; !m.getNext(k) && !B;) {
  4560. p = m.getParent();
  4561. if (p.isBlockBoundary(this.forceBrBreak && !v && {
  4562. br: 1
  4563. })) {
  4564. L = 1;
  4565. J = 0;
  4566. B || p.equals(r);
  4567. h.setEndAt(p, CKEDITOR.POSITION_BEFORE_END);
  4568. break
  4569. }
  4570. m = p;
  4571. J = 1;
  4572. B = m.equals(r);
  4573. G = 1
  4574. }
  4575. J && h.setEndAt(m, CKEDITOR.POSITION_AFTER_END);
  4576. m = this._getNextSourceNode(m, G, r);
  4577. if ((B = !m) || L && h) break
  4578. }
  4579. if (!d) {
  4580. if (!h) return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null;
  4581. d = new CKEDITOR.dom.elementPath(h.startContainer, h.root);
  4582. m = d.blockLimit;
  4583. L = {
  4584. div: 1,
  4585. th: 1,
  4586. td: 1
  4587. };
  4588. d = d.block;
  4589. !d && m && !this.enforceRealBlocks && L[m.getName()] && h.checkStartOfBlock() && h
  4590. .checkEndOfBlock() && !m.equals(h.root) ? d = m : !d || this.enforceRealBlocks && d.is(l) ? (d = this
  4591. .range.document.createElement(a), h.extractContents().appendTo(d), d.trim(), h.insertNode(d), y =
  4592. F = !0) : "li" != d.getName() ? h.checkStartOfBlock() && h.checkEndOfBlock() || (d = d.clone(!1),
  4593. h.extractContents().appendTo(d), d.trim(), F = h.splitBlock(), y = !F.wasStartOfBlock, F = !F
  4594. .wasEndOfBlock, h.insertNode(d)) : B || (this._.nextNode = d.equals(r) ? null : this
  4595. ._getNextSourceNode(h.getBoundaryNodes().endNode,
  4596. 1, r))
  4597. }
  4598. y && (y = d.getPrevious()) && y.type == CKEDITOR.NODE_ELEMENT && ("br" == y.getName() ? y.remove() : y
  4599. .getLast() && "br" == y.getLast().$.nodeName.toLowerCase() && y.getLast().remove());
  4600. F && (y = d.getLast()) && y.type == CKEDITOR.NODE_ELEMENT && "br" == y.getName() && (!CKEDITOR.env
  4601. .needsBrFiller || y.getPrevious(e) || y.getNext(e)) && y.remove();
  4602. this._.nextNode || (this._.nextNode = B || d.equals(r) || !r ? null : this._getNextSourceNode(d, 1, r));
  4603. return d
  4604. },
  4605. _getNextSourceNode: function(a, b, c) {
  4606. function d(a) {
  4607. return !(a.equals(c) || a.equals(g))
  4608. }
  4609. var g =
  4610. this.range.root;
  4611. for (a = a.getNextSourceNode(b, null, d); !e(a);) a = a.getNextSourceNode(b, null, d);
  4612. return a
  4613. }
  4614. };
  4615. CKEDITOR.dom.range.prototype.createIterator = function() {
  4616. return new a(this)
  4617. }
  4618. })();
  4619. CKEDITOR.command = function(a, d) {
  4620. this.uiItems = [];
  4621. this.exec = function(b) {
  4622. if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return !1;
  4623. this.editorFocus && a.focus();
  4624. return !1 === this.fire("exec") ? !0 : !1 !== d.exec.call(this, a, b)
  4625. };
  4626. this.refresh = function(a, b) {
  4627. if (!this.readOnly && a.readOnly) return !0;
  4628. if (this.context && !b.isContextFor(this.context) || !this.checkAllowed(!0)) return this.disable(), !0;
  4629. this.startDisabled || this.enable();
  4630. this.modes && !this.modes[a.mode] && this.disable();
  4631. return !1 === this.fire("refresh", {
  4632. editor: a,
  4633. path: b
  4634. }) ? !0 : d.refresh && !1 !== d.refresh.apply(this, arguments)
  4635. };
  4636. var b;
  4637. this.checkAllowed = function(c) {
  4638. return c || "boolean" != typeof b ? b = a.activeFilter.checkFeature(this) : b
  4639. };
  4640. CKEDITOR.tools.extend(this, d, {
  4641. modes: {
  4642. wysiwyg: 1
  4643. },
  4644. editorFocus: 1,
  4645. contextSensitive: !!d.context,
  4646. state: CKEDITOR.TRISTATE_DISABLED
  4647. });
  4648. CKEDITOR.event.call(this)
  4649. };
  4650. CKEDITOR.command.prototype = {
  4651. enable: function() {
  4652. this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(this.preserveState &&
  4653. "undefined" != typeof this.previousState ? this.previousState : CKEDITOR.TRISTATE_OFF)
  4654. },
  4655. disable: function() {
  4656. this.setState(CKEDITOR.TRISTATE_DISABLED)
  4657. },
  4658. setState: function(a) {
  4659. if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return !1;
  4660. this.previousState = this.state;
  4661. this.state = a;
  4662. this.fire("state");
  4663. return !0
  4664. },
  4665. toggleState: function() {
  4666. this.state == CKEDITOR.TRISTATE_OFF ?
  4667. this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR
  4668. .TRISTATE_OFF)
  4669. }
  4670. };
  4671. CKEDITOR.event.implementOn(CKEDITOR.command.prototype);
  4672. CKEDITOR.ENTER_P = 1;
  4673. CKEDITOR.ENTER_BR = 2;
  4674. CKEDITOR.ENTER_DIV = 3;
  4675. CKEDITOR.config = {
  4676. customConfig: "config.js",
  4677. autoUpdateElement: !0,
  4678. language: "",
  4679. licenseKey: "",
  4680. defaultLanguage: "en",
  4681. contentsLangDirection: "",
  4682. enterMode: CKEDITOR.ENTER_P,
  4683. forceEnterMode: !1,
  4684. shiftEnterMode: CKEDITOR.ENTER_BR,
  4685. docType: "\x3c!DOCTYPE html\x3e",
  4686. bodyId: "",
  4687. bodyClass: "",
  4688. fullPage: !1,
  4689. height: 200,
  4690. contentsCss: CKEDITOR.getUrl("contents.css"),
  4691. extraPlugins: "",
  4692. removePlugins: "",
  4693. protectedSource: [],
  4694. tabIndex: 0,
  4695. useComputedState: !0,
  4696. width: "",
  4697. baseFloatZIndex: 1E4,
  4698. blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL +
  4699. 85
  4700. ]
  4701. };
  4702. (function() {
  4703. function a(a, b, c, e, d) {
  4704. var g, f;
  4705. a = [];
  4706. for (g in b) {
  4707. f = b[g];
  4708. f = "boolean" == typeof f ? {} : "function" == typeof f ? {
  4709. match: f
  4710. } : D(f);
  4711. "$" != g.charAt(0) && (f.elements = g);
  4712. c && (f.featureName = c.toLowerCase());
  4713. var n = f;
  4714. n.elements = h(n.elements, /\s+/) || null;
  4715. n.propertiesOnly = n.propertiesOnly || !0 === n.elements;
  4716. var t = /\s*,\s*/,
  4717. x = void 0;
  4718. for (x in T) {
  4719. n[x] = h(n[x], t) || null;
  4720. var m = n,
  4721. C = N[x],
  4722. k = h(n[N[x]], t),
  4723. E = n[x],
  4724. A = [],
  4725. I = !0,
  4726. H = void 0;
  4727. k ? I = !1 : k = {};
  4728. for (H in E) "!" == H.charAt(0) && (H = H.slice(1), A.push(H), k[H] = !0, I = !1);
  4729. for (; H = A.pop();) E[H] = E["!" +
  4730. H], delete E["!" + H];
  4731. m[C] = (I ? !1 : k) || null
  4732. }
  4733. n.match = n.match || null;
  4734. e.push(f);
  4735. a.push(f)
  4736. }
  4737. b = d.elements;
  4738. d = d.generic;
  4739. var z;
  4740. c = 0;
  4741. for (e = a.length; c < e; ++c) {
  4742. g = D(a[c]);
  4743. f = !0 === g.classes || !0 === g.styles || !0 === g.attributes;
  4744. n = g;
  4745. x = C = t = void 0;
  4746. for (t in T) n[t] = L(n[t]);
  4747. m = !0;
  4748. for (x in N) {
  4749. t = N[x];
  4750. C = n[t];
  4751. k = [];
  4752. E = void 0;
  4753. for (E in C) - 1 < E.indexOf("*") ? k.push(new RegExp("^" + E.replace(/\*/g, ".*") + "$")) : k.push(E);
  4754. C = k;
  4755. C.length && (n[t] = C, m = !1)
  4756. }
  4757. n.nothingRequired = m;
  4758. n.noProperties = !(n.attributes || n.classes || n.styles);
  4759. if (!0 === g.elements || null ===
  4760. g.elements) d[f ? "unshift" : "push"](g);
  4761. else
  4762. for (z in n = g.elements, delete g.elements, n)
  4763. if (b[z]) b[z][f ? "unshift" : "push"](g);
  4764. else b[z] = [g]
  4765. }
  4766. }
  4767. function d(a, c, e, d) {
  4768. if (!a.match || a.match(c))
  4769. if (d || k(a, c))
  4770. if (a.propertiesOnly || (e.valid = !0), e.allAttributes || (e.allAttributes = b(a.attributes, c
  4771. .attributes, e.validAttributes)), e.allStyles || (e.allStyles = b(a.styles, c.styles, e.validStyles)),
  4772. !e.allClasses) {
  4773. a = a.classes;
  4774. c = c.classes;
  4775. d = e.validClasses;
  4776. if (a)
  4777. if (!0 === a) a = !0;
  4778. else {
  4779. for (var g = 0, f = c.length, n; g < f; ++g) n = c[g], d[n] || (d[n] =
  4780. a(n));
  4781. a = !1
  4782. }
  4783. else a = !1;
  4784. e.allClasses = a
  4785. }
  4786. }
  4787. function b(a, b, c) {
  4788. if (!a) return !1;
  4789. if (!0 === a) return !0;
  4790. for (var e in b) c[e] || (c[e] = a(e));
  4791. return !1
  4792. }
  4793. function c(a, b, c) {
  4794. if (!a.match || a.match(b)) {
  4795. if (a.noProperties) return !1;
  4796. c.hadInvalidAttribute = g(a.attributes, b.attributes) || c.hadInvalidAttribute;
  4797. c.hadInvalidStyle = g(a.styles, b.styles) || c.hadInvalidStyle;
  4798. a = a.classes;
  4799. b = b.classes;
  4800. if (a) {
  4801. for (var e = !1, d = !0 === a, f = b.length; f--;)
  4802. if (d || a(b[f])) b.splice(f, 1), e = !0;
  4803. a = e
  4804. } else a = !1;
  4805. c.hadInvalidClass = a || c.hadInvalidClass
  4806. }
  4807. }
  4808. function g(a,
  4809. b) {
  4810. if (!a) return !1;
  4811. var c = !1,
  4812. e = !0 === a,
  4813. d;
  4814. for (d in b)
  4815. if (e || a(d)) delete b[d], c = !0;
  4816. return c
  4817. }
  4818. function e(a, b, c) {
  4819. if (a.disabled || a.customConfig && !c || !b) return !1;
  4820. a._.cachedChecks = {};
  4821. return !0
  4822. }
  4823. function h(a, b) {
  4824. if (!a) return !1;
  4825. if (!0 === a) return a;
  4826. if ("string" == typeof a) return a = C(a), "*" == a ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b));
  4827. if (CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : !1;
  4828. var c = {},
  4829. e = 0,
  4830. d;
  4831. for (d in a) c[d] = a[d], e++;
  4832. return e ? c : !1
  4833. }
  4834. function k(a, b) {
  4835. if (a.nothingRequired) return !0;
  4836. var c, e, d, g;
  4837. if (d = a.requiredClasses)
  4838. for (g = b.classes, c = 0; c < d.length; ++c)
  4839. if (e = d[c], "string" == typeof e) {
  4840. if (-1 == CKEDITOR.tools.indexOf(g, e)) return !1
  4841. } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(g, e)) return !1;
  4842. return l(b.styles, a.requiredStyles) && l(b.attributes, a.requiredAttributes)
  4843. }
  4844. function l(a, b) {
  4845. if (!b) return !0;
  4846. for (var c = 0, e; c < b.length; ++c)
  4847. if (e = b[c], "string" == typeof e) {
  4848. if (!(e in a)) return !1
  4849. } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, e)) return !1;
  4850. return !0
  4851. }
  4852. function q(a) {
  4853. if (!a) return {};
  4854. a = a.split(/\s*,\s*/).sort();
  4855. for (var b = {}; a.length;) b[a.shift()] = "cke-test";
  4856. return b
  4857. }
  4858. function f(a) {
  4859. var b, c, e, d, g = {},
  4860. f = 1;
  4861. for (a = C(a); b = a.match(x);)(c = b[2]) ? (e = w(c, "styles"), d = w(c, "attrs"), c = w(c, "classes")) : e =
  4862. d = c = null, g["$" + f++] = {
  4863. elements: b[1],
  4864. classes: c,
  4865. styles: e,
  4866. attributes: d
  4867. }, a = a.slice(b[0].length);
  4868. return g
  4869. }
  4870. function w(a, b) {
  4871. var c = a.match(H[b]);
  4872. return c ? C(c[1]) : null
  4873. }
  4874. function B(a) {
  4875. var b = a.styleBackup = a.attributes.style,
  4876. c = a.classBackup = a.attributes["class"];
  4877. a.styles || (a.styles = CKEDITOR.tools.parseCssText(b ||
  4878. "", 1));
  4879. a.classes || (a.classes = c ? c.split(/\s+/) : [])
  4880. }
  4881. function y(a, b, e, g) {
  4882. var f = 0,
  4883. t;
  4884. g.toHtml && (b.name = b.name.replace(M, "$1"));
  4885. if (g.doCallbacks && a.elementCallbacks) {
  4886. a: {
  4887. t = a.elementCallbacks;
  4888. for (var h = 0, x = t.length, C; h < x; ++h)
  4889. if (C = t[h](b)) {
  4890. t = C;
  4891. break a
  4892. } t = void 0
  4893. }
  4894. if (t) return t
  4895. }
  4896. if (g.doTransform && (t = a._.transformations[b.name])) {
  4897. B(b);
  4898. for (h = 0; h < t.length; ++h) p(a, b, t[h]);
  4899. r(b)
  4900. }
  4901. if (g.doFilter) {
  4902. a: {
  4903. h = b.name;x = a._;a = x.allowedRules.elements[h];t = x.allowedRules.generic;h = x.disallowedRules
  4904. .elements[h];x = x.disallowedRules.generic;
  4905. C = g.skipRequired;
  4906. var D = {
  4907. valid: !1,
  4908. validAttributes: {},
  4909. validClasses: {},
  4910. validStyles: {},
  4911. allAttributes: !1,
  4912. allClasses: !1,
  4913. allStyles: !1,
  4914. hadInvalidAttribute: !1,
  4915. hadInvalidClass: !1,
  4916. hadInvalidStyle: !1
  4917. },
  4918. k, E;
  4919. if (a || t) {
  4920. B(b);
  4921. if (h)
  4922. for (k = 0, E = h.length; k < E; ++k)
  4923. if (!1 === c(h[k], b, D)) {
  4924. a = null;
  4925. break a
  4926. } if (x)
  4927. for (k = 0, E = x.length; k < E; ++k) c(x[k], b, D);
  4928. if (a)
  4929. for (k = 0, E = a.length; k < E; ++k) d(a[k], b, D, C);
  4930. if (t)
  4931. for (k = 0, E = t.length; k < E; ++k) d(t[k], b, D, C);
  4932. a = D
  4933. } else a = null
  4934. }
  4935. if (!a || !a.valid) return e.push(b),
  4936. 1;E = a.validAttributes;
  4937. var A = a.validStyles;
  4938. t = a.validClasses;
  4939. var h = b.attributes,
  4940. I = b.styles,
  4941. x = b.classes;C = b.classBackup;
  4942. var N = b.styleBackup,
  4943. H, z, l = [],
  4944. D = [],
  4945. T = /^data-cke-/;k = !1;delete h.style;delete h["class"];delete b.classBackup;delete b.styleBackup;
  4946. if (!a.allAttributes)
  4947. for (H in h) E[H] || (T.test(H) ? H == (z = H.replace(/^data-cke-saved-/, "")) || E[z] || (delete h[H],
  4948. k = !0) : (delete h[H], k = !0));
  4949. if (!a.allStyles || a.hadInvalidStyle) {
  4950. for (H in I) a.allStyles || A[H] ? l.push(H + ":" + I[H]) : k = !0;
  4951. l.length && (h.style = l.sort().join("; "))
  4952. } else N && (h.style = N);
  4953. if (!a.allClasses ||
  4954. a.hadInvalidClass) {
  4955. for (H = 0; H < x.length; ++H)(a.allClasses || t[x[H]]) && D.push(x[H]);
  4956. D.length && (h["class"] = D.sort().join(" "));
  4957. C && D.length < C.split(/\s+/).length && (k = !0)
  4958. } else C && (h["class"] = C);k && (f = 1);
  4959. if (!g.skipFinalValidation && !m(b)) return e.push(b),
  4960. 1
  4961. }
  4962. g.toHtml && (b.name = b.name.replace(n, "cke:$1"));
  4963. return f
  4964. }
  4965. function F(a) {
  4966. var b = [],
  4967. c;
  4968. for (c in a) - 1 < c.indexOf("*") && b.push(c.replace(/\*/g, ".*"));
  4969. return b.length ? new RegExp("^(?:" + b.join("|") + ")$") : null
  4970. }
  4971. function r(a) {
  4972. var b = a.attributes,
  4973. c;
  4974. delete b.style;
  4975. delete b["class"];
  4976. if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) b.style = c;
  4977. a.classes.length && (b["class"] = a.classes.sort().join(" "))
  4978. }
  4979. function m(a) {
  4980. switch (a.name) {
  4981. case "a":
  4982. if (!(a.children.length || a.attributes.name || a.attributes.id)) return !1;
  4983. break;
  4984. case "img":
  4985. if (!a.attributes.src) return !1
  4986. }
  4987. return !0
  4988. }
  4989. function L(a) {
  4990. if (!a) return !1;
  4991. if (!0 === a) return !0;
  4992. var b = F(a);
  4993. return function(c) {
  4994. return c in a || b && c.match(b)
  4995. }
  4996. }
  4997. function v() {
  4998. return new CKEDITOR.htmlParser.element("br")
  4999. }
  5000. function J(a) {
  5001. return a.type == CKEDITOR.NODE_ELEMENT && ("br" ==
  5002. a.name || t.$block[a.name])
  5003. }
  5004. function G(a, b, c) {
  5005. var e = a.name;
  5006. if (t.$empty[e] || !a.children.length) "hr" == e && "br" == b ? a.replaceWith(v()) : (a.parent && c.push({
  5007. check: "it",
  5008. el: a.parent
  5009. }), a.remove());
  5010. else if (t.$block[e] || "tr" == e)
  5011. if ("br" == b) a.previous && !J(a.previous) && (b = v(), b.insertBefore(a)), a.next && !J(a.next) && (b =
  5012. v(), b.insertAfter(a)), a.replaceWithChildren();
  5013. else {
  5014. var e = a.children,
  5015. d;
  5016. b: {
  5017. d = t[b];
  5018. for (var g = 0, f = e.length, n; g < f; ++g)
  5019. if (n = e[g], n.type == CKEDITOR.NODE_ELEMENT && !d[n.name]) {
  5020. d = !1;
  5021. break b
  5022. } d = !0
  5023. }
  5024. if (d) a.name = b, a.attributes = {}, c.push({
  5025. check: "parent-down",
  5026. el: a
  5027. });
  5028. else {
  5029. d = a.parent;
  5030. for (var g = d.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || "body" == d.name, h, x, f = e.length; 0 < f;)
  5031. n = e[--f], g && (n.type == CKEDITOR.NODE_TEXT || n.type == CKEDITOR.NODE_ELEMENT && t.$inline[n
  5032. .name]) ? (h || (h = new CKEDITOR.htmlParser.element(b), h.insertAfter(a), c.push({
  5033. check: "parent-down",
  5034. el: h
  5035. })), h.add(n, 0)) : (h = null, x = t[d.name] || t.span, n.insertAfter(a), d.type == CKEDITOR
  5036. .NODE_DOCUMENT_FRAGMENT || n.type != CKEDITOR.NODE_ELEMENT || x[n.name] || c.push({
  5037. check: "el-up",
  5038. el: n
  5039. }));
  5040. a.remove()
  5041. }
  5042. }
  5043. else e in {
  5044. style: 1,
  5045. script: 1
  5046. } ? a.remove() : (a.parent && c.push({
  5047. check: "it",
  5048. el: a.parent
  5049. }), a.replaceWithChildren())
  5050. }
  5051. function p(a, b, c) {
  5052. var e, d;
  5053. for (e = 0; e < c.length; ++e)
  5054. if (d = c[e], !(d.check && !a.check(d.check, !1) || d.left && !d.left(b))) {
  5055. d.right(b, A);
  5056. break
  5057. }
  5058. }
  5059. function u(a, b) {
  5060. var c = b.getDefinition(),
  5061. e = c.attributes,
  5062. d = c.styles,
  5063. g, f, n, t;
  5064. if (a.name != c.element) return !1;
  5065. for (g in e)
  5066. if ("class" == g)
  5067. for (c = e[g].split(/\s+/), n = a.classes.join("|"); t = c.pop();) {
  5068. if (-1 == n.indexOf(t)) return !1
  5069. } else if (a.attributes[g] != e[g]) return !1;
  5070. for (f in d)
  5071. if (a.styles[f] !=
  5072. d[f]) return !1;
  5073. return !0
  5074. }
  5075. function K(a, b) {
  5076. var c, e;
  5077. "string" == typeof a ? c = a : a instanceof CKEDITOR.style ? e = a : (c = a[0], e = a[1]);
  5078. return [{
  5079. element: c,
  5080. left: e,
  5081. right: function(a, c) {
  5082. c.transform(a, b)
  5083. }
  5084. }]
  5085. }
  5086. function E(a) {
  5087. return function(b) {
  5088. return u(b, a)
  5089. }
  5090. }
  5091. function z(a) {
  5092. return function(b, c) {
  5093. c[a](b)
  5094. }
  5095. }
  5096. var t = CKEDITOR.dtd,
  5097. D = CKEDITOR.tools.copy,
  5098. C = CKEDITOR.tools.trim,
  5099. I = ["", "p", "br", "div"];
  5100. CKEDITOR.FILTER_SKIP_TREE = 2;
  5101. CKEDITOR.filter = function(a, b) {
  5102. this.allowedContent = [];
  5103. this.disallowedContent = [];
  5104. this.elementCallbacks = null;
  5105. this.disabled = !1;
  5106. this.editor = null;
  5107. this.id = CKEDITOR.tools.getNextNumber();
  5108. this._ = {
  5109. allowedRules: {
  5110. elements: {},
  5111. generic: []
  5112. },
  5113. disallowedRules: {
  5114. elements: {},
  5115. generic: []
  5116. },
  5117. transformations: {},
  5118. cachedTests: {},
  5119. cachedChecks: {}
  5120. };
  5121. CKEDITOR.filter.instances[this.id] = this;
  5122. var c = this.editor = a instanceof CKEDITOR.editor ? a : null;
  5123. if (c && !b) {
  5124. this.customConfig = !0;
  5125. var e = c.config.allowedContent;
  5126. !0 === e ? this.disabled = !0 : (e || (this.customConfig = !1), this.allow(e, "config", 1), this.allow(c
  5127. .config.extraAllowedContent, "extra", 1), this.allow(I[c.enterMode] +
  5128. " " + I[c.shiftEnterMode], "default", 1), this.disallow(c.config.disallowedContent))
  5129. } else this.customConfig = !1, this.allow(b || a, "default", 1)
  5130. };
  5131. CKEDITOR.filter.instances = {};
  5132. CKEDITOR.filter.prototype = {
  5133. allow: function(b, c, d) {
  5134. if (!e(this, b, d)) return !1;
  5135. var g, n;
  5136. if ("string" == typeof b) b = f(b);
  5137. else if (b instanceof CKEDITOR.style) {
  5138. if (b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, d);
  5139. g = b.getDefinition();
  5140. b = {};
  5141. d = g.attributes;
  5142. b[g.element] = g = {
  5143. styles: g.styles,
  5144. requiredStyles: g.styles && CKEDITOR.tools.object.keys(g.styles)
  5145. };
  5146. d && (d = D(d), g.classes = d["class"] ? d["class"].split(/\s+/) : null, g.requiredClasses = g
  5147. .classes, delete d["class"], g.attributes = d, g.requiredAttributes = d && CKEDITOR.tools.object
  5148. .keys(d))
  5149. } else if (CKEDITOR.tools.isArray(b)) {
  5150. for (g = 0; g < b.length; ++g) n = this.allow(b[g], c, d);
  5151. return n
  5152. }
  5153. a(this, b, c, this.allowedContent, this._.allowedRules);
  5154. return !0
  5155. },
  5156. applyTo: function(a, b, c, e) {
  5157. if (this.disabled) return !1;
  5158. var d = this,
  5159. g = [],
  5160. f = this.editor && this.editor.config.protectedSource,
  5161. n, h = !1,
  5162. x = {
  5163. doFilter: !c,
  5164. doTransform: !0,
  5165. doCallbacks: !0,
  5166. toHtml: b
  5167. };
  5168. a.forEach(function(a) {
  5169. if (a.type == CKEDITOR.NODE_ELEMENT) {
  5170. if ("off" == a.attributes["data-cke-filter"]) return !1;
  5171. if (!b || "span" != a.name || !~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf(
  5172. "data-cke-"))
  5173. if (n = y(d, a, g, x), n & 1) h = !0;
  5174. else if (n & 2) return !1
  5175. } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
  5176. var c;
  5177. a: {
  5178. var e = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));c = [];
  5179. var t, C, m;
  5180. if (f)
  5181. for (C = 0; C < f.length; ++C)
  5182. if ((m = e.match(f[C])) && m[0].length == e.length) {
  5183. c = !0;
  5184. break a
  5185. } e = CKEDITOR.htmlParser.fragment.fromHtml(e);1 == e.children.length && (t = e
  5186. .children[0]).type == CKEDITOR.NODE_ELEMENT && y(d, t, c, x);c = !c.length
  5187. }
  5188. c || g.push(a)
  5189. }
  5190. }, null, !0);
  5191. g.length && (h = !0);
  5192. var C;
  5193. a = [];
  5194. e = I[e || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)];
  5195. for (var D; c = g.pop();) c.type == CKEDITOR.NODE_ELEMENT ? G(c, e, a) : c.remove();
  5196. for (; C = a.pop();)
  5197. if (c = C.el, c.parent) switch (D = t[c.parent.name] || t.span, C.check) {
  5198. case "it":
  5199. t.$removeEmpty[c.name] && !c.children.length ? G(c, e, a) : m(c) || G(c, e, a);
  5200. break;
  5201. case "el-up":
  5202. c.parent.type ==
  5203. CKEDITOR.NODE_DOCUMENT_FRAGMENT || D[c.name] || G(c, e, a);
  5204. break;
  5205. case "parent-down":
  5206. c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || D[c.name] || G(c.parent, e, a)
  5207. }
  5208. return h
  5209. },
  5210. checkFeature: function(a) {
  5211. if (this.disabled || !a) return !0;
  5212. a.toFeature && (a = a.toFeature(this.editor));
  5213. return !a.requiredContent || this.check(a.requiredContent)
  5214. },
  5215. disable: function() {
  5216. this.disabled = !0
  5217. },
  5218. disallow: function(b) {
  5219. if (!e(this, b, !0)) return !1;
  5220. "string" == typeof b && (b = f(b));
  5221. a(this, b, null, this.disallowedContent, this._.disallowedRules);
  5222. return !0
  5223. },
  5224. addContentForms: function(a) {
  5225. if (!this.disabled && a) {
  5226. var b, c, e = [],
  5227. d;
  5228. for (b = 0; b < a.length && !d; ++b) c = a[b], ("string" == typeof c || c instanceof CKEDITOR
  5229. .style) && this.check(c) && (d = c);
  5230. if (d) {
  5231. for (b = 0; b < a.length; ++b) e.push(K(a[b], d));
  5232. this.addTransformations(e)
  5233. }
  5234. }
  5235. },
  5236. addElementCallback: function(a) {
  5237. this.elementCallbacks || (this.elementCallbacks = []);
  5238. this.elementCallbacks.push(a)
  5239. },
  5240. addFeature: function(a) {
  5241. if (this.disabled || !a) return !0;
  5242. a.toFeature && (a = a.toFeature(this.editor));
  5243. this.allow(a.allowedContent, a.name);
  5244. this.addTransformations(a.contentTransformations);
  5245. this.addContentForms(a.contentForms);
  5246. return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a
  5247. .requiredContent) : !0
  5248. },
  5249. addTransformations: function(a) {
  5250. var b, c;
  5251. if (!this.disabled && a) {
  5252. var e = this._.transformations,
  5253. d;
  5254. for (d = 0; d < a.length; ++d) {
  5255. b = a[d];
  5256. var g = void 0,
  5257. f = void 0,
  5258. n = void 0,
  5259. t = void 0,
  5260. h = void 0,
  5261. x = void 0;
  5262. c = [];
  5263. for (f = 0; f < b.length; ++f) n = b[f], "string" == typeof n ? (n = n.split(/\s*:\s*/), t = n[0],
  5264. h = null, x = n[1]) : (t = n.check, h = n.left, x = n.right), g || (g = n, g = g.element ? g
  5265. .element : t ? t.match(/^([a-z0-9]+)/i)[0] :
  5266. g.left.getDefinition().element), h instanceof CKEDITOR.style && (h = E(h)), c.push({
  5267. check: t == g ? null : t,
  5268. left: h,
  5269. right: "string" == typeof x ? z(x) : x
  5270. });
  5271. b = g;
  5272. e[b] || (e[b] = []);
  5273. e[b].push(c)
  5274. }
  5275. }
  5276. },
  5277. check: function(a, b, c) {
  5278. if (this.disabled) return !0;
  5279. if (CKEDITOR.tools.isArray(a)) {
  5280. for (var e = a.length; e--;)
  5281. if (this.check(a[e], b, c)) return !0;
  5282. return !1
  5283. }
  5284. var d, g;
  5285. if ("string" == typeof a) {
  5286. g = a + "\x3c" + (!1 === b ? "0" : "1") + (c ? "1" : "0") + "\x3e";
  5287. if (g in this._.cachedChecks) return this._.cachedChecks[g];
  5288. d = f(a).$1;
  5289. var n = d.styles,
  5290. e = d.classes;
  5291. d.name = d.elements;
  5292. d.classes = e = e ? e.split(/\s*,\s*/) : [];
  5293. d.styles = q(n);
  5294. d.attributes = q(d.attributes);
  5295. d.children = [];
  5296. e.length && (d.attributes["class"] = e.join(" "));
  5297. n && (d.attributes.style = CKEDITOR.tools.writeCssText(d.styles))
  5298. } else d = a.getDefinition(), n = d.styles, e = d.attributes || {}, n && !CKEDITOR.tools.isEmpty(n) ? (
  5299. n = D(n), e.style = CKEDITOR.tools.writeCssText(n, !0)) : n = {}, d = {
  5300. name: d.element,
  5301. attributes: e,
  5302. classes: e["class"] ? e["class"].split(/\s+/) : [],
  5303. styles: n,
  5304. children: []
  5305. };
  5306. var n = CKEDITOR.tools.clone(d),
  5307. t = [],
  5308. h;
  5309. if (!1 !== b && (h = this._.transformations[d.name])) {
  5310. for (e =
  5311. 0; e < h.length; ++e) p(this, d, h[e]);
  5312. r(d)
  5313. }
  5314. y(this, n, t, {
  5315. doFilter: !0,
  5316. doTransform: !1 !== b,
  5317. skipRequired: !c,
  5318. skipFinalValidation: !c
  5319. });
  5320. 0 < t.length ? c = !1 : ((b = d.attributes["class"]) && (d.attributes["class"] = d.attributes["class"]
  5321. .split(" ").sort().join(" ")), c = CKEDITOR.tools.objectCompare(d.attributes, n.attributes, !0),
  5322. b && (d.attributes["class"] = b));
  5323. "string" == typeof a && (this._.cachedChecks[g] = c);
  5324. return c
  5325. },
  5326. getAllowedEnterMode: function() {
  5327. var a = ["p", "div", "br"],
  5328. b = {
  5329. p: CKEDITOR.ENTER_P,
  5330. div: CKEDITOR.ENTER_DIV,
  5331. br: CKEDITOR.ENTER_BR
  5332. };
  5333. return function(c, e) {
  5334. var d = a.slice(),
  5335. g;
  5336. if (this.check(I[c])) return c;
  5337. for (e || (d = d.reverse()); g = d.pop();)
  5338. if (this.check(g)) return b[g];
  5339. return CKEDITOR.ENTER_BR
  5340. }
  5341. }(),
  5342. clone: function() {
  5343. var a = new CKEDITOR.filter,
  5344. b = CKEDITOR.tools.clone;
  5345. a.allowedContent = b(this.allowedContent);
  5346. a._.allowedRules = b(this._.allowedRules);
  5347. a.disallowedContent = b(this.disallowedContent);
  5348. a._.disallowedRules = b(this._.disallowedRules);
  5349. a._.transformations = b(this._.transformations);
  5350. a.disabled = this.disabled;
  5351. a.editor = this.editor;
  5352. return a
  5353. },
  5354. destroy: function() {
  5355. delete CKEDITOR.filter.instances[this.id];
  5356. delete this._;
  5357. delete this.allowedContent;
  5358. delete this.disallowedContent
  5359. }
  5360. };
  5361. var T = {
  5362. styles: 1,
  5363. attributes: 1,
  5364. classes: 1
  5365. },
  5366. N = {
  5367. styles: "requiredStyles",
  5368. attributes: "requiredAttributes",
  5369. classes: "requiredClasses"
  5370. },
  5371. x =
  5372. /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
  5373. H = {
  5374. styles: /{([^}]+)}/,
  5375. attrs: /\[([^\]]+)\]/,
  5376. classes: /\(([^\)]+)\)/
  5377. },
  5378. M = /^cke:(object|embed|param)$/,
  5379. n = /^(object|embed|param)$/,
  5380. A;
  5381. A = CKEDITOR.filter.transformationsTools = {
  5382. sizeToStyle: function(a) {
  5383. this.lengthToStyle(a,
  5384. "width");
  5385. this.lengthToStyle(a, "height")
  5386. },
  5387. sizeToAttribute: function(a) {
  5388. this.lengthToAttribute(a, "width");
  5389. this.lengthToAttribute(a, "height")
  5390. },
  5391. lengthToStyle: function(a, b, c) {
  5392. c = c || b;
  5393. if (!(c in a.styles)) {
  5394. var e = a.attributes[b];
  5395. e && (/^\d+$/.test(e) && (e += "px"), a.styles[c] = e)
  5396. }
  5397. delete a.attributes[b]
  5398. },
  5399. lengthToAttribute: function(a, b, c) {
  5400. c = c || b;
  5401. if (!(c in a.attributes)) {
  5402. var e = a.styles[b],
  5403. d = e && e.match(/^(\d+)(?:\.\d*)?px$/);
  5404. d ? a.attributes[c] = d[1] : "cke-test" == e && (a.attributes[c] = "cke-test")
  5405. }
  5406. delete a.styles[b]
  5407. },
  5408. alignmentToStyle: function(a) {
  5409. if (!("float" in
  5410. a.styles)) {
  5411. var b = a.attributes.align;
  5412. if ("left" == b || "right" == b) a.styles["float"] = b
  5413. }
  5414. delete a.attributes.align
  5415. },
  5416. alignmentToAttribute: function(a) {
  5417. if (!("align" in a.attributes)) {
  5418. var b = a.styles["float"];
  5419. if ("left" == b || "right" == b) a.attributes.align = b
  5420. }
  5421. delete a.styles["float"]
  5422. },
  5423. splitBorderShorthand: function(a) {
  5424. if (a.styles.border) {
  5425. var b = CKEDITOR.tools.style.parse.border(a.styles.border);
  5426. b.color && (a.styles["border-color"] = b.color);
  5427. b.style && (a.styles["border-style"] = b.style);
  5428. b.width && (a.styles["border-width"] = b.width);
  5429. delete a.styles.border
  5430. }
  5431. },
  5432. listTypeToStyle: function(a) {
  5433. if (a.attributes.type) switch (a.attributes.type) {
  5434. case "a":
  5435. a.styles["list-style-type"] = "lower-alpha";
  5436. break;
  5437. case "A":
  5438. a.styles["list-style-type"] = "upper-alpha";
  5439. break;
  5440. case "i":
  5441. a.styles["list-style-type"] = "lower-roman";
  5442. break;
  5443. case "I":
  5444. a.styles["list-style-type"] = "upper-roman";
  5445. break;
  5446. case "1":
  5447. a.styles["list-style-type"] = "decimal";
  5448. break;
  5449. default:
  5450. a.styles["list-style-type"] = a.attributes.type
  5451. }
  5452. },
  5453. splitMarginShorthand: function(a) {
  5454. function b(e) {
  5455. a.styles["margin-top"] =
  5456. c[e[0]];
  5457. a.styles["margin-right"] = c[e[1]];
  5458. a.styles["margin-bottom"] = c[e[2]];
  5459. a.styles["margin-left"] = c[e[3]]
  5460. }
  5461. if (a.styles.margin) {
  5462. var c = a.styles.margin.match(/(auto|0|(?:\-?[\.\d]+(?:\w+|%)))/g) || ["0px"];
  5463. switch (c.length) {
  5464. case 1:
  5465. b([0, 0, 0, 0]);
  5466. break;
  5467. case 2:
  5468. b([0, 1, 0, 1]);
  5469. break;
  5470. case 3:
  5471. b([0, 1, 2, 1]);
  5472. break;
  5473. case 4:
  5474. b([0, 1, 2, 3])
  5475. }
  5476. delete a.styles.margin
  5477. }
  5478. },
  5479. matchesStyle: u,
  5480. transform: function(a, b) {
  5481. if ("string" == typeof b) a.name = b;
  5482. else {
  5483. var c = b.getDefinition(),
  5484. e = c.styles,
  5485. d = c.attributes,
  5486. g, f, n, t;
  5487. a.name = c.element;
  5488. for (g in d)
  5489. if ("class" ==
  5490. g)
  5491. for (c = a.classes.join("|"), n = d[g].split(/\s+/); t = n.pop();) - 1 == c.indexOf(t) && a
  5492. .classes.push(t);
  5493. else a.attributes[g] = d[g];
  5494. for (f in e) a.styles[f] = e[f]
  5495. }
  5496. }
  5497. }
  5498. })();
  5499. (function() {
  5500. CKEDITOR.focusManager = function(a) {
  5501. if (a.focusManager) return a.focusManager;
  5502. this.hasFocus = !1;
  5503. this.currentActive = null;
  5504. this._ = {
  5505. editor: a
  5506. };
  5507. return this
  5508. };
  5509. CKEDITOR.focusManager._ = {
  5510. blurDelay: 200
  5511. };
  5512. CKEDITOR.focusManager.prototype = {
  5513. focus: function(a) {
  5514. this._.timer && clearTimeout(this._.timer);
  5515. a && (this.currentActive = a);
  5516. this.hasFocus || this._.locked || ((a = CKEDITOR.currentInstance) && a.focusManager.blur(1), this
  5517. .hasFocus = !0, (a = this._.editor.container) && a.addClass("cke_focus"), this._.editor.fire(
  5518. "focus"))
  5519. },
  5520. lock: function() {
  5521. this._.locked =
  5522. 1
  5523. },
  5524. unlock: function() {
  5525. delete this._.locked
  5526. },
  5527. blur: function(a) {
  5528. function d() {
  5529. if (this.hasFocus) {
  5530. this.hasFocus = !1;
  5531. var a = this._.editor.container;
  5532. a && a.removeClass("cke_focus");
  5533. this._.editor.fire("blur")
  5534. }
  5535. }
  5536. if (!this._.locked) {
  5537. this._.timer && clearTimeout(this._.timer);
  5538. var b = CKEDITOR.focusManager._.blurDelay;
  5539. a || !b ? d.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function() {
  5540. delete this._.timer;
  5541. d.call(this)
  5542. }, b, this)
  5543. }
  5544. },
  5545. add: function(a, d) {
  5546. var b = a.getCustomData("focusmanager");
  5547. if (!b || b != this) {
  5548. b && b.remove(a);
  5549. var b =
  5550. "focus",
  5551. c = "blur";
  5552. d && (CKEDITOR.env.ie ? (b = "focusin", c = "focusout") : CKEDITOR.event.useCapture = 1);
  5553. var g = {
  5554. blur: function() {
  5555. a.equals(this.currentActive) && this.blur()
  5556. },
  5557. focus: function() {
  5558. this.focus(a)
  5559. }
  5560. };
  5561. a.on(b, g.focus, this);
  5562. a.on(c, g.blur, this);
  5563. d && (CKEDITOR.event.useCapture = 0);
  5564. a.setCustomData("focusmanager", this);
  5565. a.setCustomData("focusmanager_handlers", g)
  5566. }
  5567. },
  5568. remove: function(a) {
  5569. a.removeCustomData("focusmanager");
  5570. var d = a.removeCustomData("focusmanager_handlers");
  5571. a.removeListener("blur", d.blur);
  5572. a.removeListener("focus",
  5573. d.focus)
  5574. }
  5575. }
  5576. })();
  5577. CKEDITOR.keystrokeHandler = function(a) {
  5578. if (a.keystrokeHandler) return a.keystrokeHandler;
  5579. this.keystrokes = {};
  5580. this.blockedKeystrokes = {};
  5581. this._ = {
  5582. editor: a
  5583. };
  5584. return this
  5585. };
  5586. (function() {
  5587. var a, d = function(b) {
  5588. b = b.data;
  5589. var d = b.getKeystroke(),
  5590. e = this.keystrokes[d],
  5591. h = this._.editor;
  5592. a = !1 === h.fire("key", {
  5593. keyCode: d,
  5594. domEvent: b
  5595. });
  5596. a || (e && (a = !1 !== h.execCommand(e, {
  5597. from: "keystrokeHandler"
  5598. })), a || (a = !!this.blockedKeystrokes[d]));
  5599. a && b.preventDefault(!0);
  5600. return !a
  5601. },
  5602. b = function(b) {
  5603. a && (a = !1, b.data.preventDefault(!0))
  5604. };
  5605. CKEDITOR.keystrokeHandler.prototype = {
  5606. attach: function(a) {
  5607. a.on("keydown", d, this);
  5608. if (CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this)
  5609. }
  5610. }
  5611. })();
  5612. (function() {
  5613. CKEDITOR.lang = {
  5614. languages: {
  5615. af: 1,
  5616. ar: 1,
  5617. az: 1,
  5618. bg: 1,
  5619. bn: 1,
  5620. bs: 1,
  5621. ca: 1,
  5622. cs: 1,
  5623. cy: 1,
  5624. da: 1,
  5625. de: 1,
  5626. "de-ch": 1,
  5627. el: 1,
  5628. "en-au": 1,
  5629. "en-ca": 1,
  5630. "en-gb": 1,
  5631. en: 1,
  5632. eo: 1,
  5633. es: 1,
  5634. "es-mx": 1,
  5635. et: 1,
  5636. eu: 1,
  5637. fa: 1,
  5638. fi: 1,
  5639. fo: 1,
  5640. "fr-ca": 1,
  5641. fr: 1,
  5642. gl: 1,
  5643. gu: 1,
  5644. he: 1,
  5645. hi: 1,
  5646. hr: 1,
  5647. hu: 1,
  5648. id: 1,
  5649. is: 1,
  5650. it: 1,
  5651. ja: 1,
  5652. ka: 1,
  5653. km: 1,
  5654. ko: 1,
  5655. ku: 1,
  5656. lt: 1,
  5657. lv: 1,
  5658. mk: 1,
  5659. mn: 1,
  5660. ms: 1,
  5661. nb: 1,
  5662. nl: 1,
  5663. no: 1,
  5664. oc: 1,
  5665. pl: 1,
  5666. "pt-br": 1,
  5667. pt: 1,
  5668. ro: 1,
  5669. ru: 1,
  5670. si: 1,
  5671. sk: 1,
  5672. sl: 1,
  5673. sq: 1,
  5674. "sr-latn": 1,
  5675. sr: 1,
  5676. sv: 1,
  5677. th: 1,
  5678. tr: 1,
  5679. tt: 1,
  5680. ug: 1,
  5681. uk: 1,
  5682. vi: 1,
  5683. "zh-cn": 1,
  5684. zh: 1
  5685. },
  5686. rtl: {
  5687. ar: 1,
  5688. fa: 1,
  5689. he: 1,
  5690. ku: 1,
  5691. ug: 1
  5692. },
  5693. load: function(a, d, b) {
  5694. a && CKEDITOR.lang.languages[a] ||
  5695. (a = this.detect(d, a));
  5696. var c = this;
  5697. d = function() {
  5698. c[a].dir = c.rtl[a] ? "rtl" : "ltr";
  5699. b(a, c[a])
  5700. };
  5701. this[a] ? d() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), d, this)
  5702. },
  5703. detect: function(a, d) {
  5704. var b = this.languages;
  5705. d = d || navigator.userLanguage || navigator.language || a;
  5706. var c = d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
  5707. g = c[1],
  5708. c = c[2];
  5709. b[g + "-" + c] ? g = g + "-" + c : b[g] || (g = null);
  5710. CKEDITOR.lang.detect = g ? function() {
  5711. return g
  5712. } : function(a) {
  5713. return a
  5714. };
  5715. return g || a
  5716. }
  5717. }
  5718. })();
  5719. CKEDITOR.scriptLoader = function() {
  5720. var a = {},
  5721. d = {};
  5722. return {
  5723. load: function(b, c, g, e) {
  5724. var h = "string" == typeof b;
  5725. h && (b = [b]);
  5726. g || (g = CKEDITOR);
  5727. var k = b.length,
  5728. l = k,
  5729. q = [],
  5730. f = [],
  5731. w = function(a) {
  5732. c && (h ? c.call(g, a) : c.call(g, q, f))
  5733. };
  5734. if (0 === l) w(!0);
  5735. else {
  5736. var B = function(a, b) {
  5737. (b ? q : f).push(a);
  5738. 0 >= --l && (e && CKEDITOR.document.getDocumentElement().removeStyle("cursor"), w(b))
  5739. },
  5740. y = function(b, c) {
  5741. a[b] = 1;
  5742. var e = d[b];
  5743. delete d[b];
  5744. for (var g = 0; g < e.length; g++) e[g](b, c)
  5745. },
  5746. F = function(b) {
  5747. if (a[b]) B(b, !0);
  5748. else {
  5749. var e = d[b] || (d[b] = []);
  5750. e.push(B);
  5751. if (!(1 < e.length)) {
  5752. var g =
  5753. new CKEDITOR.dom.element("script");
  5754. g.setAttributes({
  5755. type: "text/javascript",
  5756. src: b
  5757. });
  5758. c && (CKEDITOR.env.ie && (8 >= CKEDITOR.env.version || CKEDITOR.env.ie9Compat) ? g.$
  5759. .onreadystatechange = function() {
  5760. if ("loaded" == g.$.readyState || "complete" == g.$.readyState) g.$.onreadystatechange =
  5761. null, y(b, !0)
  5762. } : (g.$.onload = function() {
  5763. setTimeout(function() {
  5764. g.$.onload = null;
  5765. g.$.onerror = null;
  5766. y(b, !0)
  5767. }, 0)
  5768. }, g.$.onerror = function() {
  5769. g.$.onload = null;
  5770. g.$.onerror = null;
  5771. y(b, !1)
  5772. }));
  5773. g.appendTo(CKEDITOR.document.getHead())
  5774. }
  5775. }
  5776. };
  5777. e && CKEDITOR.document.getDocumentElement().setStyle("cursor",
  5778. "wait");
  5779. for (var r = 0; r < k; r++) F(b[r])
  5780. }
  5781. },
  5782. queue: function() {
  5783. function a() {
  5784. var b;
  5785. (b = c[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0)
  5786. }
  5787. var c = [];
  5788. return function(d, e) {
  5789. var h = this;
  5790. c.push({
  5791. scriptUrl: d,
  5792. callback: function() {
  5793. e && e.apply(this, arguments);
  5794. c.shift();
  5795. a.call(h)
  5796. }
  5797. });
  5798. 1 == c.length && a.call(this)
  5799. }
  5800. }()
  5801. }
  5802. }();
  5803. CKEDITOR.resourceManager = function(a, d) {
  5804. this.basePath = a;
  5805. this.fileName = d;
  5806. this.registered = {};
  5807. this.loaded = {};
  5808. this.externals = {};
  5809. this._ = {
  5810. waitingList: {}
  5811. }
  5812. };
  5813. CKEDITOR.resourceManager.prototype = {
  5814. add: function(a, d) {
  5815. if (this.registered[a]) throw Error('[CKEDITOR.resourceManager.add] The resource name "' + a +
  5816. '" is already registered.');
  5817. var b = this.registered[a] = d || {};
  5818. b.name = a;
  5819. b.path = this.getPath(a);
  5820. CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b);
  5821. return this.get(a)
  5822. },
  5823. get: function(a) {
  5824. return this.registered[a] || null
  5825. },
  5826. getPath: function(a) {
  5827. var d = this.externals[a];
  5828. return CKEDITOR.getUrl(d && d.dir || this.basePath + a + "/")
  5829. },
  5830. getFilePath: function(a) {
  5831. var d = this.externals[a];
  5832. return CKEDITOR.getUrl(this.getPath(a) + (d ? d.file : this.fileName + ".js"))
  5833. },
  5834. addExternal: function(a, d, b) {
  5835. b || (d = d.replace(/[^\/]+$/, function(a) {
  5836. b = a;
  5837. return ""
  5838. }));
  5839. b = b || this.fileName + ".js";
  5840. a = a.split(",");
  5841. for (var c = 0; c < a.length; c++) this.externals[a[c]] = {
  5842. dir: d,
  5843. file: b
  5844. }
  5845. },
  5846. load: function(a, d, b) {
  5847. CKEDITOR.tools.isArray(a) || (a = a ? [a] : []);
  5848. for (var c = this.loaded, g = this.registered, e = [], h = {}, k = {}, l = 0; l < a.length; l++) {
  5849. var q = a[l];
  5850. if (q)
  5851. if (c[q] || g[q]) k[q] = this.get(q);
  5852. else {
  5853. var f = this.getFilePath(q);
  5854. e.push(f);
  5855. f in h || (h[f] = []);
  5856. h[f].push(q)
  5857. }
  5858. }
  5859. CKEDITOR.scriptLoader.load(e,
  5860. function(a, e) {
  5861. if (e.length) throw Error('[CKEDITOR.resourceManager.load] Resource name "' + h[e[0]].join(",") +
  5862. '" was not found at "' + e[0] + '".');
  5863. for (var g = 0; g < a.length; g++)
  5864. for (var f = h[a[g]], l = 0; l < f.length; l++) {
  5865. var m = f[l];
  5866. k[m] = this.get(m);
  5867. c[m] = 1
  5868. }
  5869. d.call(b, k)
  5870. }, this)
  5871. }
  5872. };
  5873. CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin");
  5874. CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(a) {
  5875. var d = {};
  5876. return function(b, c, g) {
  5877. var e = {},
  5878. h = function(b) {
  5879. a.call(this, b, function(a) {
  5880. CKEDITOR.tools.extend(e, a);
  5881. var b = [],
  5882. f;
  5883. for (f in a) {
  5884. var k = a[f],
  5885. B = k && k.requires;
  5886. if (!d[f]) {
  5887. if (k.icons)
  5888. for (var y = k.icons.split(","), F = y.length; F--;) CKEDITOR.skin.addIcon(y[F], k.path +
  5889. "icons/" + (CKEDITOR.env.hidpi && k.hidpi ? "hidpi/" : "") + y[F] + ".png");
  5890. k.isSupportedEnvironment = k.isSupportedEnvironment || function() {
  5891. return !0
  5892. };
  5893. d[f] = 1
  5894. }
  5895. if (B)
  5896. for (B.split && (B =
  5897. B.split(",")), k = 0; k < B.length; k++) e[B[k]] || b.push(B[k])
  5898. }
  5899. if (b.length) h.call(this, b);
  5900. else {
  5901. for (f in e) k = e[f], k.onLoad && !k.onLoad._called && (!1 === k.onLoad() && delete e[f], k
  5902. .onLoad._called = 1);
  5903. c && c.call(g || window, e)
  5904. }
  5905. }, this)
  5906. };
  5907. h.call(this, b)
  5908. }
  5909. });
  5910. CKEDITOR.plugins.setLang = function(a, d, b) {
  5911. var c = this.get(a);
  5912. a = c.langEntries || (c.langEntries = {});
  5913. c = c.lang || (c.lang = []);
  5914. c.split && (c = c.split(",")); - 1 == CKEDITOR.tools.indexOf(c, d) && c.push(d);
  5915. a[d] = b
  5916. };
  5917. CKEDITOR.ui = function(a) {
  5918. if (a.ui) return a.ui;
  5919. this.items = {};
  5920. this.instances = {};
  5921. this.editor = a;
  5922. this._ = {
  5923. handlers: {}
  5924. };
  5925. return this
  5926. };
  5927. CKEDITOR.ui.prototype = {
  5928. add: function(a, d, b) {
  5929. b.name = a.toLowerCase();
  5930. var c = this.items[a] = {
  5931. type: d,
  5932. command: b.command || null,
  5933. args: Array.prototype.slice.call(arguments, 2)
  5934. };
  5935. CKEDITOR.tools.extend(c, b)
  5936. },
  5937. get: function(a) {
  5938. return this.instances[a]
  5939. },
  5940. create: function(a) {
  5941. var d = this.items[a],
  5942. b = d && this._.handlers[d.type],
  5943. c = d && d.command && this.editor.getCommand(d.command),
  5944. b = b && b.create.apply(this, d.args);
  5945. this.instances[a] = b;
  5946. c && c.uiItems.push(b);
  5947. b && !b.type && (b.type = d.type);
  5948. return b
  5949. },
  5950. addHandler: function(a, d) {
  5951. this._.handlers[a] =
  5952. d
  5953. },
  5954. space: function(a) {
  5955. return CKEDITOR.document.getById(this.spaceId(a))
  5956. },
  5957. spaceId: function(a) {
  5958. return this.editor.id + "_" + a
  5959. }
  5960. };
  5961. CKEDITOR.event.implementOn(CKEDITOR.ui);
  5962. (function() {
  5963. function a(a, g, f) {
  5964. CKEDITOR.event.call(this);
  5965. a = a && CKEDITOR.tools.clone(a);
  5966. if (void 0 !== g) {
  5967. if (!(g instanceof CKEDITOR.dom.element)) throw Error("Expect element of type CKEDITOR.dom.element.");
  5968. if (!f) throw Error("One of the element modes must be specified.");
  5969. if (CKEDITOR.env.ie && CKEDITOR.env.quirks && f == CKEDITOR.ELEMENT_MODE_INLINE) throw Error(
  5970. "Inline element mode is not supported on IE quirks.");
  5971. if (!b(g, f)) throw Error('The specified element mode is not supported on element: "' + g.getName() + '".');
  5972. this.element = g;
  5973. this.elementMode = f;
  5974. this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (g.getId() || g.getNameAtt())
  5975. } else this.elementMode = CKEDITOR.ELEMENT_MODE_NONE;
  5976. this._ = {};
  5977. this.commands = {};
  5978. this.templates = {};
  5979. this.name = this.name || d();
  5980. this.id = CKEDITOR.tools.getNextId();
  5981. this.status = "unloaded";
  5982. this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
  5983. this.ui = new CKEDITOR.ui(this);
  5984. this.focusManager = new CKEDITOR.focusManager(this);
  5985. this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
  5986. this.on("readOnly",
  5987. c);
  5988. this.on("selectionChange", function(a) {
  5989. e(this, a.data.path)
  5990. });
  5991. this.on("activeFilterChange", function() {
  5992. e(this, this.elementPath(), !0)
  5993. });
  5994. this.on("mode", c);
  5995. CKEDITOR.dom.selection.setupEditorOptimization(this);
  5996. this.on("instanceReady", function() {
  5997. if (this.config.startupFocus) {
  5998. if ("end" === this.config.startupFocus) {
  5999. var a = this.createRange();
  6000. a.selectNodeContents(this.editable());
  6001. a.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
  6002. a.collapse();
  6003. this.getSelection().selectRanges([a])
  6004. }
  6005. this.focus()
  6006. }
  6007. });
  6008. CKEDITOR.fire("instanceCreated",
  6009. null, this);
  6010. CKEDITOR.add(this);
  6011. CKEDITOR.tools.setTimeout(function() {
  6012. this.isDestroyed() || this.isDetached() || k(this, a)
  6013. }, 0, this)
  6014. }
  6015. function d() {
  6016. do var a = "editor" + ++F; while (CKEDITOR.instances[a]);
  6017. return a
  6018. }
  6019. function b(a, b) {
  6020. return b == CKEDITOR.ELEMENT_MODE_INLINE ? a.is(CKEDITOR.dtd.$editable) || a.is("textarea") : b == CKEDITOR
  6021. .ELEMENT_MODE_REPLACE ? !a.is(CKEDITOR.dtd.$nonBodyContent) : 1
  6022. }
  6023. function c() {
  6024. var a = this.commands,
  6025. b;
  6026. for (b in a) g(this, a[b])
  6027. }
  6028. function g(a, b) {
  6029. b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" :
  6030. b.modes[a.mode] ? "enable" : "disable"]()
  6031. }
  6032. function e(a, b, c) {
  6033. if (b) {
  6034. var e, d, g = a.commands;
  6035. for (d in g) e = g[d], (c || e.contextSensitive) && e.refresh(a, b)
  6036. }
  6037. }
  6038. function h(a) {
  6039. var b = a.config.customConfig;
  6040. if (!b) return !1;
  6041. var b = CKEDITOR.getUrl(b),
  6042. c = r[b] || (r[b] = {});
  6043. c.fn ? (c.fn.call(a, a.config), CKEDITOR.getUrl(a.config.customConfig) != b && h(a) || a.fireOnce(
  6044. "customConfigLoaded")) : CKEDITOR.scriptLoader.queue(b, function() {
  6045. c.fn = c.fn || CKEDITOR.editorConfig || function() {};
  6046. h(a)
  6047. });
  6048. return !0
  6049. }
  6050. function k(a, b) {
  6051. a.on("customConfigLoaded", function() {
  6052. if (b) {
  6053. if (b.on)
  6054. for (var c in b.on) a.on(c,
  6055. b.on[c]);
  6056. CKEDITOR.tools.extend(a.config, b, !0);
  6057. delete a.config.on
  6058. }
  6059. c = a.config;
  6060. a.readOnly = c.readOnly ? !0 : a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is(
  6061. "textarea") ? a.element.hasAttribute("disabled") || a.element.hasAttribute("readonly") : a.element
  6062. .isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.element.hasAttribute("disabled") ||
  6063. a.element.hasAttribute("readonly") : !1;
  6064. a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR
  6065. .dtd[a.element.getName()].p) :
  6066. !1;
  6067. a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") || 0;
  6068. a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
  6069. a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
  6070. c.skin && (CKEDITOR.skinName = c.skin);
  6071. a.fireOnce("configLoaded");
  6072. a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
  6073. a.filter = a.activeFilter = new CKEDITOR.filter(a);
  6074. l(a)
  6075. });
  6076. b && null != b.customConfig && (a.config.customConfig = b.customConfig);
  6077. h(a) || a.fireOnce("customConfigLoaded")
  6078. }
  6079. function l(a) {
  6080. CKEDITOR.skin.loadPart("editor", function() {
  6081. q(a)
  6082. })
  6083. }
  6084. function q(a) {
  6085. CKEDITOR.lang.load(a.config.language, a.config.defaultLanguage, function(b, c) {
  6086. var e = a.config.title,
  6087. d = a.config.applicationTitle;
  6088. a.langCode = b;
  6089. a.lang = CKEDITOR.tools.prototypedCopy(c);
  6090. a.title = "string" == typeof e || !1 === e ? e : [a.lang.editor, a.name].join(", ");
  6091. a.applicationTitle = "string" == typeof d || !1 === d ? d : [a.lang.application, a.name].join(", ");
  6092. a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR
  6093. .ELEMENT_MODE_INLINE ?
  6094. a.element.getDirection(1) : a.lang.dir);
  6095. a.fire("langLoaded");
  6096. f(a)
  6097. })
  6098. }
  6099. function f(a) {
  6100. a.getStylesSet(function(b) {
  6101. a.once("loaded", function() {
  6102. a.fire("stylesSet", {
  6103. styles: b
  6104. })
  6105. }, null, null, 1);
  6106. w(a)
  6107. })
  6108. }
  6109. function w(a) {
  6110. function b(a) {
  6111. if (!a) return "";
  6112. CKEDITOR.tools.isArray(a) && (a = a.join(","));
  6113. return a.replace(/\s/g, "")
  6114. }
  6115. var c = a.config,
  6116. e = b(c.plugins),
  6117. d = b(c.extraPlugins),
  6118. g = b(c.removePlugins);
  6119. if (d) var f = new RegExp("(?:^|,)(?:" + d.replace(/,/g, "|") + ")(?\x3d,|$)", "g"),
  6120. e = e.replace(f, ""),
  6121. e = e + ("," + d);
  6122. if (g) var h = new RegExp("(?:^|,)(?:" +
  6123. g.replace(/,/g, "|") + ")(?\x3d,|$)", "g"),
  6124. e = e.replace(h, "");
  6125. CKEDITOR.env.air && (e += ",adobeair");
  6126. CKEDITOR.plugins.load(e.split(","), function(b) {
  6127. var e = [],
  6128. d = [],
  6129. g = [];
  6130. a.plugins = CKEDITOR.tools.extend({}, a.plugins, b);
  6131. for (var f in b) {
  6132. var k = b[f],
  6133. l = k.lang,
  6134. N = null,
  6135. x = k.requires,
  6136. H;
  6137. CKEDITOR.tools.isArray(x) && (x = x.join(","));
  6138. if (x && (H = x.match(h)))
  6139. for (; x = H.pop();) CKEDITOR.error("editor-plugin-required", {
  6140. plugin: x.replace(",", ""),
  6141. requiredBy: f
  6142. });
  6143. l && !a.lang[f] && (l.split && (l = l.split(",")), 0 <= CKEDITOR.tools.indexOf(l, a.langCode) ?
  6144. N = a.langCode : (N = a.langCode.replace(/-.*/, ""), N = N != a.langCode && 0 <= CKEDITOR.tools
  6145. .indexOf(l, N) ? N : 0 <= CKEDITOR.tools.indexOf(l, "en") ? "en" : l[0]), k.langEntries && k
  6146. .langEntries[N] ? (a.lang[f] = k.langEntries[N], N = null) : g.push(CKEDITOR.getUrl(k.path +
  6147. "lang/" + N + ".js")));
  6148. d.push(N);
  6149. e.push(k)
  6150. }
  6151. CKEDITOR.scriptLoader.load(g, function() {
  6152. if (!a.isDestroyed() && !a.isDetached()) {
  6153. for (var b = ["beforeInit", "init", "afterInit"], g = 0; g < b.length; g++)
  6154. for (var f = 0; f < e.length; f++) {
  6155. var h = e[f];
  6156. 0 === g && d[f] && h.lang && h.langEntries && (a.lang[h.name] =
  6157. h.langEntries[d[f]]);
  6158. if (h[b[g]]) h[b[g]](a)
  6159. }
  6160. a.fireOnce("pluginsLoaded");
  6161. c.keystrokes && a.setKeystroke(a.config.keystrokes);
  6162. for (f = 0; f < a.config.blockedKeystrokes.length; f++) a.keystrokeHandler.blockedKeystrokes[a
  6163. .config.blockedKeystrokes[f]] = 1;
  6164. a.status = "loaded";
  6165. a.fireOnce("loaded");
  6166. CKEDITOR.fire("instanceLoaded", null, a)
  6167. }
  6168. })
  6169. })
  6170. }
  6171. function B() {
  6172. var a = this.element;
  6173. if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
  6174. var b = this.getData();
  6175. this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
  6176. a.is("textarea") ?
  6177. a.setValue(b) : a.setHtml(b);
  6178. return !0
  6179. }
  6180. return !1
  6181. }
  6182. function y(a, b) {
  6183. function c(a) {
  6184. var b = a.startContainer,
  6185. e = a.endContainer,
  6186. d = b.is && b.is("tr"),
  6187. g = b.is && b.is("td");
  6188. a = g && b.equals(e) && a.endOffset === b.getChildCount();
  6189. b = g && 1 === b.getChildCount() && "img" === b.getChildren().getItem(0).getName();
  6190. return d || a && !b ? !0 : !1
  6191. }
  6192. function e(a) {
  6193. var b = a.startContainer;
  6194. return b.is("tr") ? a.cloneContents() : b.clone(!0)
  6195. }
  6196. for (var d = new CKEDITOR.dom.documentFragment, g, f, h, k = 0; k < a.length; k++) {
  6197. var z = a[k],
  6198. t = z.startContainer.getAscendant("tr",
  6199. !0);
  6200. c(z) ? (g || (g = t.getAscendant("table").clone(), g.append(t.getAscendant({
  6201. thead: 1,
  6202. tbody: 1,
  6203. tfoot: 1
  6204. }).clone()), d.append(g), g = g.findOne("thead, tbody, tfoot")), f && f.equals(t) || (f = t, h = t
  6205. .clone(), g.append(h)), h.append(e(z))) : d.append(z.cloneContents())
  6206. }
  6207. return g ? d : b.getHtmlFromRange(a[0])
  6208. }
  6209. a.prototype = CKEDITOR.editor.prototype;
  6210. CKEDITOR.editor = a;
  6211. var F = 0,
  6212. r = {};
  6213. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  6214. plugins: {
  6215. detectConflict: function(a, b) {
  6216. for (var c = 0; c < b.length; c++) {
  6217. var e = b[c];
  6218. if (this[e]) return CKEDITOR.warn("editor-plugin-conflict", {
  6219. plugin: a,
  6220. replacedWith: e
  6221. }), !0
  6222. }
  6223. return !1
  6224. }
  6225. },
  6226. addCommand: function(a, b) {
  6227. b.name = a.toLowerCase();
  6228. var c = b instanceof CKEDITOR.command ? b : new CKEDITOR.command(this, b);
  6229. this.mode && g(this, c);
  6230. return this.commands[a] = c
  6231. },
  6232. _attachToForm: function() {
  6233. function a(b) {
  6234. c.updateElement();
  6235. c._.required && !e.getValue() && !1 === c.fire("required") && b.data.preventDefault()
  6236. }
  6237. function b(a) {
  6238. return !!(a && a.call && a.apply)
  6239. }
  6240. var c = this,
  6241. e = c.element,
  6242. d = new CKEDITOR.dom.element(e.$.form);
  6243. e.is("textarea") && d && (d.on("submit", a), b(d.$.submit) && (d.$.submit =
  6244. CKEDITOR.tools.override(d.$.submit, function(b) {
  6245. return function() {
  6246. a();
  6247. b.apply ? b.apply(this) : b()
  6248. }
  6249. })), c.on("destroy", function() {
  6250. d.removeListener("submit", a)
  6251. }))
  6252. },
  6253. destroy: function(a) {
  6254. var b = CKEDITOR.filter.instances,
  6255. c = this;
  6256. this.fire("beforeDestroy");
  6257. !a && B.call(this);
  6258. this.editable(null);
  6259. this.filter && delete this.filter;
  6260. CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(b), function(a) {
  6261. a = b[a];
  6262. c === a.editor && a.destroy()
  6263. });
  6264. delete this.activeFilter;
  6265. this.status = "destroyed";
  6266. this.fire("destroy");
  6267. this.removeAllListeners();
  6268. CKEDITOR.remove(this);
  6269. CKEDITOR.fire("instanceDestroyed", null, this)
  6270. },
  6271. elementPath: function(a) {
  6272. if (!a) {
  6273. a = this.getSelection();
  6274. if (!a) return null;
  6275. a = a.getStartElement()
  6276. }
  6277. return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
  6278. },
  6279. createRange: function() {
  6280. var a = this.editable();
  6281. return a ? new CKEDITOR.dom.range(a) : null
  6282. },
  6283. execCommand: function(a, b) {
  6284. var c = this.getCommand(a),
  6285. e = {
  6286. name: a,
  6287. commandData: b || {},
  6288. command: c
  6289. };
  6290. return c && c.state != CKEDITOR.TRISTATE_DISABLED && !1 !== this.fire("beforeCommandExec", e) && (e
  6291. .returnValue =
  6292. c.exec(e.commandData), !c.async && !1 !== this.fire("afterCommandExec", e)) ? e.returnValue : !1
  6293. },
  6294. getCommand: function(a) {
  6295. return this.commands[a]
  6296. },
  6297. getData: function(a) {
  6298. !a && this.fire("beforeGetData");
  6299. var b = this._.data;
  6300. "string" != typeof b && (b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ?
  6301. b.is("textarea") ? b.getValue() : b.getHtml() : "");
  6302. b = {
  6303. dataValue: b
  6304. };
  6305. !a && this.fire("getData", b);
  6306. return b.dataValue
  6307. },
  6308. getSnapshot: function() {
  6309. var a = this.fire("getSnapshot");
  6310. "string" != typeof a && (a = (a = this.element) && this.elementMode ==
  6311. CKEDITOR.ELEMENT_MODE_REPLACE ? a.is("textarea") ? a.getValue() : a.getHtml() : "");
  6312. return a
  6313. },
  6314. loadSnapshot: function(a) {
  6315. this.fire("loadSnapshot", a)
  6316. },
  6317. setData: function(a, b, c) {
  6318. var e = !0,
  6319. d = b;
  6320. b && "object" == typeof b && (c = b.internal, d = b.callback, e = !b.noSnapshot);
  6321. !c && e && this.fire("saveSnapshot");
  6322. if (d || !c) this.once("dataReady", function(a) {
  6323. !c && e && this.fire("saveSnapshot");
  6324. d && d.call(a.editor)
  6325. });
  6326. a = {
  6327. dataValue: a
  6328. };
  6329. !c && this.fire("setData", a);
  6330. this._.data = a.dataValue;
  6331. !c && this.fire("afterSetData", a)
  6332. },
  6333. setReadOnly: function(a) {
  6334. a =
  6335. null == a || a;
  6336. this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this
  6337. .editable().setReadOnly(a), this.fire("readOnly"))
  6338. },
  6339. insertHtml: function(a, b, c) {
  6340. this.fire("insertHtml", {
  6341. dataValue: a,
  6342. mode: b,
  6343. range: c
  6344. })
  6345. },
  6346. insertText: function(a) {
  6347. this.fire("insertText", a)
  6348. },
  6349. insertElement: function(a) {
  6350. this.fire("insertElement", a)
  6351. },
  6352. getSelectedHtml: function(a) {
  6353. var b = this.editable(),
  6354. c = this.getSelection(),
  6355. c = c && c.getRanges();
  6356. if (!b || !c || 0 === c.length) return null;
  6357. b = y(c, b);
  6358. return a ? b.getHtml() : b
  6359. },
  6360. extractSelectedHtml: function(a,
  6361. b) {
  6362. var c = this.editable(),
  6363. e = this.getSelection().getRanges(),
  6364. d = new CKEDITOR.dom.documentFragment,
  6365. g;
  6366. if (!c || 0 === e.length) return null;
  6367. for (g = 0; g < e.length; g++) d.append(c.extractHtmlFromRange(e[g], b));
  6368. b || this.getSelection().selectRanges([e[0]]);
  6369. return a ? d.getHtml() : d
  6370. },
  6371. focus: function() {
  6372. this.fire("beforeFocus")
  6373. },
  6374. checkDirty: function() {
  6375. return "ready" == this.status && this._.previousValue !== this.getSnapshot()
  6376. },
  6377. resetDirty: function() {
  6378. this._.previousValue = this.getSnapshot()
  6379. },
  6380. updateElement: function() {
  6381. return B.call(this)
  6382. },
  6383. setKeystroke: function() {
  6384. for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[
  6385. 0] : [
  6386. [].slice.call(arguments, 0)
  6387. ], c, e, d = b.length; d--;) c = b[d], e = 0, CKEDITOR.tools.isArray(c) && (e = c[1], c = c[0]),
  6388. e ? a[c] = e : delete a[c]
  6389. },
  6390. getCommandKeystroke: function(a, b) {
  6391. var c = "string" === typeof a ? this.getCommand(a) : a,
  6392. e = [];
  6393. if (c) {
  6394. var d = CKEDITOR.tools.object.findKey(this.commands, c),
  6395. g = this.keystrokeHandler.keystrokes;
  6396. if (c.fakeKeystroke) e.push(c.fakeKeystroke);
  6397. else
  6398. for (var f in g) g[f] === d && e.push(f)
  6399. }
  6400. return b ?
  6401. e : e[0] || null
  6402. },
  6403. addFeature: function(a) {
  6404. return this.filter.addFeature(a)
  6405. },
  6406. setActiveFilter: function(a) {
  6407. a || (a = this.filter);
  6408. this.activeFilter !== a && (this.activeFilter = a, this.fire("activeFilterChange"), a === this
  6409. .filter ? this.setActiveEnterMode(null, null) : this.setActiveEnterMode(a.getAllowedEnterMode(this
  6410. .enterMode), a.getAllowedEnterMode(this.shiftEnterMode, !0)))
  6411. },
  6412. setActiveEnterMode: function(a, b) {
  6413. a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
  6414. b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
  6415. if (this.activeEnterMode != a || this.activeShiftEnterMode != b) this.activeEnterMode = a, this
  6416. .activeShiftEnterMode = b, this.fire("activeEnterModeChange")
  6417. },
  6418. showNotification: function(a) {
  6419. alert(a)
  6420. },
  6421. isDetached: function() {
  6422. return !!this.container && this.container.isDetached()
  6423. },
  6424. isDestroyed: function() {
  6425. return "destroyed" === this.status
  6426. }
  6427. });
  6428. CKEDITOR.editor._getEditorElement = function(a) {
  6429. if (!CKEDITOR.env.isCompatible) return null;
  6430. var b = CKEDITOR.dom.element.get(a);
  6431. return b ? b.getEditor() ? (CKEDITOR.error("editor-element-conflict", {
  6432. editorName: b.getEditor().name
  6433. }), null) : b : (CKEDITOR.error("editor-incorrect-element", {
  6434. element: a
  6435. }), null)
  6436. };
  6437. CKEDITOR.editor.initializeDelayedEditorCreation = function(a, b, c) {
  6438. if (b.delayIfDetached_callback) return CKEDITOR.warn("editor-delayed-creation", {
  6439. method: "callback"
  6440. }), b.delayIfDetached_callback(function() {
  6441. CKEDITOR[c](a, b);
  6442. CKEDITOR.warn("editor-delayed-creation-success", {
  6443. method: "callback"
  6444. })
  6445. }), null;
  6446. var e = void 0 === b.delayIfDetached_interval ? CKEDITOR.config.delayIfDetached_interval : b
  6447. .delayIfDetached_interval;
  6448. CKEDITOR.warn("editor-delayed-creation", {
  6449. method: "interval - " + e + " ms"
  6450. });
  6451. var d = setInterval(function() {
  6452. a.isDetached() || (clearInterval(d), CKEDITOR[c](a, b), CKEDITOR.warn(
  6453. "editor-delayed-creation-success", {
  6454. method: "interval - " + e + " ms"
  6455. }))
  6456. }, e);
  6457. return function() {
  6458. clearInterval(d)
  6459. }
  6460. };
  6461. CKEDITOR.editor.shouldDelayEditorCreation = function(a, b) {
  6462. CKEDITOR.editor.mergeDelayedCreationConfigs(b);
  6463. return b && b.delayIfDetached && a.isDetached()
  6464. };
  6465. CKEDITOR.editor.mergeDelayedCreationConfigs = function(a) {
  6466. a && (a.delayIfDetached = "boolean" ===
  6467. typeof a.delayIfDetached ? a.delayIfDetached : CKEDITOR.config.delayIfDetached, a
  6468. .delayIfDetached_interval = isNaN(a.delayIfDetached_interval) ? CKEDITOR.config
  6469. .delayIfDetached_interval : a.delayIfDetached_interval, a.delayIfDetached_callback = a
  6470. .delayIfDetached_callback || CKEDITOR.config.delayIfDetached_callback)
  6471. }
  6472. })();
  6473. CKEDITOR.ELEMENT_MODE_NONE = 0;
  6474. CKEDITOR.ELEMENT_MODE_REPLACE = 1;
  6475. CKEDITOR.ELEMENT_MODE_APPENDTO = 2;
  6476. CKEDITOR.ELEMENT_MODE_INLINE = 3;
  6477. CKEDITOR.config.delayIfDetached = !1;
  6478. CKEDITOR.config.delayIfDetached_callback = void 0;
  6479. CKEDITOR.config.delayIfDetached_interval = 50;
  6480. CKEDITOR.htmlParser = function() {
  6481. this._ = {
  6482. htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--!?>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g
  6483. }
  6484. };
  6485. (function() {
  6486. var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
  6487. d = {
  6488. checked: 1,
  6489. compact: 1,
  6490. declare: 1,
  6491. defer: 1,
  6492. disabled: 1,
  6493. ismap: 1,
  6494. multiple: 1,
  6495. nohref: 1,
  6496. noresize: 1,
  6497. noshade: 1,
  6498. nowrap: 1,
  6499. readonly: 1,
  6500. selected: 1
  6501. };
  6502. CKEDITOR.htmlParser.prototype = {
  6503. onTagOpen: function() {},
  6504. onTagClose: function() {},
  6505. onText: function() {},
  6506. onCDATA: function() {},
  6507. onComment: function() {},
  6508. parse: function(b) {
  6509. for (var c, g, e = 0, h; c = this._.htmlPartsRegex.exec(b);) {
  6510. g = c.index;
  6511. if (g > e)
  6512. if (e = b.substring(e, g), h) h.push(e);
  6513. else this.onText(e);
  6514. e = this._.htmlPartsRegex.lastIndex;
  6515. if (g = c[1])
  6516. if (g = g.toLowerCase(), h && CKEDITOR.dtd.$cdata[g] && (this.onCDATA(h.join("")), h = null), !h) {
  6517. this.onTagClose(g);
  6518. continue
  6519. } if (h) h.push(c[0]);
  6520. else if (g = c[3]) {
  6521. if (g = g.toLowerCase(), !/="/.test(g)) {
  6522. var k = {},
  6523. l, q = c[4];
  6524. c = !!c[5];
  6525. if (q)
  6526. for (; l = a.exec(q);) {
  6527. var f = l[1].toLowerCase();
  6528. l = l[2] || l[3] || l[4] || "";
  6529. k[f] = !l && d[f] ? f : CKEDITOR.tools.htmlDecodeAttr(l)
  6530. }
  6531. this.onTagOpen(g, k, c);
  6532. !h && CKEDITOR.dtd.$cdata[g] && (h = [])
  6533. }
  6534. } else if (g = c[2]) this.onComment(g)
  6535. }
  6536. if (b.length > e) this.onText(b.substring(e,
  6537. b.length))
  6538. }
  6539. }
  6540. })();
  6541. CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
  6542. $: function() {
  6543. this._ = {
  6544. output: []
  6545. }
  6546. },
  6547. proto: {
  6548. openTag: function(a) {
  6549. this._.output.push("\x3c", a)
  6550. },
  6551. openTagClose: function(a, d) {
  6552. d ? this._.output.push(" /\x3e") : this._.output.push("\x3e")
  6553. },
  6554. attribute: function(a, d) {
  6555. "string" == typeof d && (d = CKEDITOR.tools.htmlEncodeAttr(d));
  6556. this._.output.push(" ", a, '\x3d"', d, '"')
  6557. },
  6558. closeTag: function(a) {
  6559. this._.output.push("\x3c/", a, "\x3e")
  6560. },
  6561. text: function(a) {
  6562. this._.output.push(a)
  6563. },
  6564. comment: function(a) {
  6565. this._.output.push("\x3c!--", a,
  6566. "--\x3e")
  6567. },
  6568. write: function(a) {
  6569. this._.output.push(a)
  6570. },
  6571. reset: function() {
  6572. this._.output = [];
  6573. this._.indent = !1
  6574. },
  6575. getHtml: function(a) {
  6576. var d = this._.output.join("");
  6577. a && this.reset();
  6578. return d
  6579. }
  6580. }
  6581. });
  6582. "use strict";
  6583. (function() {
  6584. CKEDITOR.htmlParser.node = function() {};
  6585. CKEDITOR.htmlParser.node.prototype = {
  6586. remove: function() {
  6587. var a = this.parent.children,
  6588. d = CKEDITOR.tools.indexOf(a, this),
  6589. b = this.previous,
  6590. c = this.next;
  6591. b && (b.next = c);
  6592. c && (c.previous = b);
  6593. a.splice(d, 1);
  6594. this.parent = null
  6595. },
  6596. replaceWith: function(a) {
  6597. var d = this.parent.children,
  6598. b = CKEDITOR.tools.indexOf(d, this),
  6599. c = a.previous = this.previous,
  6600. g = a.next = this.next;
  6601. c && (c.next = a);
  6602. g && (g.previous = a);
  6603. d[b] = a;
  6604. a.parent = this.parent;
  6605. this.parent = null
  6606. },
  6607. insertAfter: function(a) {
  6608. var d = a.parent.children,
  6609. b = CKEDITOR.tools.indexOf(d, a),
  6610. c = a.next;
  6611. d.splice(b + 1, 0, this);
  6612. this.next = a.next;
  6613. this.previous = a;
  6614. a.next = this;
  6615. c && (c.previous = this);
  6616. this.parent = a.parent
  6617. },
  6618. insertBefore: function(a) {
  6619. var d = a.parent.children,
  6620. b = CKEDITOR.tools.indexOf(d, a);
  6621. d.splice(b, 0, this);
  6622. this.next = a;
  6623. (this.previous = a.previous) && (a.previous.next = this);
  6624. a.previous = this;
  6625. this.parent = a.parent
  6626. },
  6627. getAscendant: function(a) {
  6628. var d = "function" == typeof a ? a : "string" == typeof a ? function(b) {
  6629. return b.name == a
  6630. } : function(b) {
  6631. return b.name in a
  6632. },
  6633. b = this.parent;
  6634. for (; b &&
  6635. b.type == CKEDITOR.NODE_ELEMENT;) {
  6636. if (d(b)) return b;
  6637. b = b.parent
  6638. }
  6639. return null
  6640. },
  6641. wrapWith: function(a) {
  6642. this.replaceWith(a);
  6643. a.add(this);
  6644. return a
  6645. },
  6646. getIndex: function() {
  6647. return CKEDITOR.tools.indexOf(this.parent.children, this)
  6648. },
  6649. getFilterContext: function(a) {
  6650. return a || {}
  6651. }
  6652. }
  6653. })();
  6654. "use strict";
  6655. CKEDITOR.htmlParser.comment = function(a) {
  6656. this.value = a;
  6657. this._ = {
  6658. isBlockLike: !1
  6659. }
  6660. };
  6661. CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6662. type: CKEDITOR.NODE_COMMENT,
  6663. filter: function(a, d) {
  6664. var b = this.value;
  6665. if (!(b = a.onComment(d, b, this))) return this.remove(), !1;
  6666. if ("string" != typeof b) return this.replaceWith(b), !1;
  6667. this.value = b;
  6668. return !0
  6669. },
  6670. writeHtml: function(a, d) {
  6671. d && this.filter(d);
  6672. a.comment(this.value)
  6673. }
  6674. });
  6675. "use strict";
  6676. (function() {
  6677. CKEDITOR.htmlParser.text = function(a) {
  6678. this.value = a;
  6679. this._ = {
  6680. isBlockLike: !1
  6681. }
  6682. };
  6683. CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6684. type: CKEDITOR.NODE_TEXT,
  6685. filter: function(a, d) {
  6686. if (!(this.value = a.onText(d, this.value, this))) return this.remove(), !1
  6687. },
  6688. writeHtml: function(a, d) {
  6689. d && this.filter(d);
  6690. a.text(this.value)
  6691. }
  6692. })
  6693. })();
  6694. "use strict";
  6695. (function() {
  6696. CKEDITOR.htmlParser.cdata = function(a) {
  6697. this.value = a
  6698. };
  6699. CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6700. type: CKEDITOR.NODE_TEXT,
  6701. filter: function(a) {
  6702. var d = this.getAscendant("style");
  6703. if (d && d.getAscendant({
  6704. math: 1,
  6705. svg: 1
  6706. })) {
  6707. var d = CKEDITOR.htmlParser.fragment.fromHtml(this.value),
  6708. b = new CKEDITOR.htmlParser.basicWriter;
  6709. a.applyTo(d);
  6710. d.writeHtml(b);
  6711. this.value = b.getHtml()
  6712. }
  6713. },
  6714. writeHtml: function(a) {
  6715. a.write(this.value)
  6716. }
  6717. })
  6718. })();
  6719. "use strict";
  6720. CKEDITOR.htmlParser.fragment = function() {
  6721. this.children = [];
  6722. this.parent = null;
  6723. this._ = {
  6724. isBlockLike: !0,
  6725. hasInlineStarted: !1
  6726. }
  6727. };
  6728. (function() {
  6729. function a(a) {
  6730. return a.attributes["data-cke-survive"] ? !1 : "a" == a.name && a.attributes.href || CKEDITOR.dtd
  6731. .$removeEmpty[a.name]
  6732. }
  6733. var d = CKEDITOR.tools.extend({
  6734. table: 1,
  6735. ul: 1,
  6736. ol: 1,
  6737. dl: 1
  6738. }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl),
  6739. b = {
  6740. ol: 1,
  6741. ul: 1
  6742. },
  6743. c = CKEDITOR.tools.extend({}, {
  6744. html: 1
  6745. }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, {
  6746. style: 1,
  6747. script: 1
  6748. }),
  6749. g = {
  6750. ul: "li",
  6751. ol: "li",
  6752. dl: "dd",
  6753. table: "tbody",
  6754. tbody: "tr",
  6755. thead: "tr",
  6756. tfoot: "tr",
  6757. tr: "td"
  6758. };
  6759. CKEDITOR.htmlParser.fragment.fromHtml =
  6760. function(e, h, k) {
  6761. function l(a) {
  6762. var b;
  6763. if (0 < m.length)
  6764. for (var c = 0; c < m.length; c++) {
  6765. var e = m[c],
  6766. d = e.name,
  6767. g = CKEDITOR.dtd[d],
  6768. f = v.name && CKEDITOR.dtd[v.name];
  6769. f && !f[d] || a && g && !g[a] && CKEDITOR.dtd[a] ? d == v.name && (w(v, v.parent, 1), c--) : (b || (
  6770. q(), b = 1), e = e.clone(), e.parent = v, v = e, m.splice(c, 1), c--)
  6771. }
  6772. }
  6773. function q() {
  6774. for (; L.length;) w(L.shift(), v)
  6775. }
  6776. function f(a) {
  6777. if (a._.isBlockLike && "pre" != a.name && "textarea" != a.name) {
  6778. var b = a.children.length,
  6779. c = a.children[b - 1],
  6780. e;
  6781. c && c.type == CKEDITOR.NODE_TEXT && ((e = CKEDITOR.tools.rtrim(c.value)) ?
  6782. c.value = e : a.children.length = b - 1)
  6783. }
  6784. }
  6785. function w(b, c, e) {
  6786. c = c || v || r;
  6787. var d = v;
  6788. void 0 === b.previous && (B(c, b) && (v = c, F.onTagOpen(k, {}), b.returnPoint = c = v), f(b), a(b) && !b
  6789. .children.length || c.add(b), "pre" == b.name && (G = !1), "textarea" == b.name && (J = !1));
  6790. b.returnPoint ? (v = b.returnPoint, delete b.returnPoint) : v = e ? c : d
  6791. }
  6792. function B(a, b) {
  6793. if ((a == r || "body" == a.name) && k && (!a.name || CKEDITOR.dtd[a.name][k])) {
  6794. var c, e;
  6795. return (c = b.attributes && (e = b.attributes["data-cke-real-element-type"]) ? e : b.name) && c in
  6796. CKEDITOR.dtd.$inline && !(c in CKEDITOR.dtd.head) &&
  6797. !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
  6798. }
  6799. }
  6800. function y(a, b) {
  6801. return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || "dt" == a && "dd" ==
  6802. b || "dd" == a && "dt" == b : !1
  6803. }
  6804. var F = new CKEDITOR.htmlParser,
  6805. r = h instanceof CKEDITOR.htmlParser.element ? h : "string" == typeof h ? new CKEDITOR.htmlParser.element(
  6806. h) : new CKEDITOR.htmlParser.fragment,
  6807. m = [],
  6808. L = [],
  6809. v = r,
  6810. J = "textarea" == r.name,
  6811. G = "pre" == r.name;
  6812. F.onTagOpen = function(e, g, f, h) {
  6813. g = new CKEDITOR.htmlParser.element(e, g);
  6814. g.isUnknown && f && (g.isEmpty = !0);
  6815. g.isOptionalClose = h;
  6816. if (a(g)) m.push(g);
  6817. else {
  6818. if ("pre" == e) G = !0;
  6819. else {
  6820. if ("br" == e && G) {
  6821. v.add(new CKEDITOR.htmlParser.text("\n"));
  6822. return
  6823. }
  6824. "textarea" == e && (J = !0)
  6825. }
  6826. if ("br" == e) L.push(g);
  6827. else {
  6828. for (; !(h = (f = v.name) ? CKEDITOR.dtd[f] || (v._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd
  6829. .span) : c, g.isUnknown || v.isUnknown || h[e]);)
  6830. if (v.isOptionalClose) F.onTagClose(f);
  6831. else if (e in b && f in b) f = v.children, (f = f[f.length - 1]) && "li" == f.name || w(f =
  6832. new CKEDITOR.htmlParser.element("li"), v), !g.returnPoint && (g.returnPoint = v), v = f;
  6833. else if (e in CKEDITOR.dtd.$listItem &&
  6834. !y(e, f)) F.onTagOpen("li" == e ? "ul" : "dl", {}, 0, 1);
  6835. else if (f in d && !y(e, f)) !g.returnPoint && (g.returnPoint = v), v = v.parent;
  6836. else if (f in CKEDITOR.dtd.$inline && m.unshift(v), v.parent) w(v, v.parent, 1);
  6837. else {
  6838. g.isOrphan = 1;
  6839. break
  6840. }
  6841. l(e);
  6842. q();
  6843. g.parent = v;
  6844. g.isEmpty ? w(g) : v = g
  6845. }
  6846. }
  6847. };
  6848. F.onTagClose = function(a) {
  6849. for (var b = m.length - 1; 0 <= b; b--)
  6850. if (a == m[b].name) {
  6851. m.splice(b, 1);
  6852. return
  6853. } for (var c = [], e = [], d = v; d != r && d.name != a;) d._.isBlockLike || e.unshift(d), c.push(d),
  6854. d = d.returnPoint || d.parent;
  6855. if (d != r) {
  6856. for (b = 0; b < c.length; b++) {
  6857. var g = c[b];
  6858. w(g, g.parent)
  6859. }
  6860. v =
  6861. d;
  6862. d._.isBlockLike ? q() : (b = CKEDITOR.config.shiftLineBreaks, !0 !== b && L.length && ("function" !==
  6863. typeof b ? q() : (b = b(L[L.length - 1]), !0 !== b && (q(), b instanceof CKEDITOR.htmlParser
  6864. .text && v.add(b), b instanceof CKEDITOR.htmlParser.element && w(b, v)))));
  6865. w(d, d.parent);
  6866. d == v && (v = v.parent);
  6867. m = m.concat(e)
  6868. }
  6869. "body" == a && (k = !1)
  6870. };
  6871. F.onText = function(a) {
  6872. if (!(v._.hasInlineStarted && !L.length || G || J) && (a = CKEDITOR.tools.ltrim(a), 0 === a.length))
  6873. return;
  6874. var b = v.name,
  6875. e = b ? CKEDITOR.dtd[b] || (v._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) :
  6876. c;
  6877. if (!J && !e["#"] && b in d) F.onTagOpen(g[b] || ""), F.onText(a);
  6878. else {
  6879. q();
  6880. l();
  6881. G || J || (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
  6882. a = new CKEDITOR.htmlParser.text(a);
  6883. if (B(v, a)) this.onTagOpen(k, {}, 0, 1);
  6884. v.add(a)
  6885. }
  6886. };
  6887. F.onCDATA = function(a) {
  6888. v.add(new CKEDITOR.htmlParser.cdata(a))
  6889. };
  6890. F.onComment = function(a) {
  6891. q();
  6892. l();
  6893. v.add(new CKEDITOR.htmlParser.comment(a))
  6894. };
  6895. F.parse(e);
  6896. for (q(); v != r;) w(v, v.parent, 1);
  6897. f(r);
  6898. return r
  6899. };
  6900. CKEDITOR.htmlParser.fragment.prototype = {
  6901. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  6902. add: function(a, b) {
  6903. isNaN(b) &&
  6904. (b = this.children.length);
  6905. var c = 0 < b ? this.children[b - 1] : null;
  6906. if (c) {
  6907. if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT && (c.value = CKEDITOR.tools.rtrim(c.value), 0 ===
  6908. c.value.length)) {
  6909. this.children.pop();
  6910. this.add(a);
  6911. return
  6912. }
  6913. c.next = a
  6914. }
  6915. a.previous = c;
  6916. a.parent = this;
  6917. this.children.splice(b, 0, a);
  6918. this._.hasInlineStarted || (this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR
  6919. .NODE_ELEMENT && !a._.isBlockLike)
  6920. },
  6921. filter: function(a, b) {
  6922. b = this.getFilterContext(b);
  6923. a.onRoot(b, this);
  6924. this.filterChildren(a, !1, b)
  6925. },
  6926. filterChildren: function(a,
  6927. b, c) {
  6928. if (this.childrenFilteredBy != a.id) {
  6929. c = this.getFilterContext(c);
  6930. if (b && !this.parent) a.onRoot(c, this);
  6931. this.childrenFilteredBy = a.id;
  6932. for (b = 0; b < this.children.length; b++) !1 === this.children[b].filter(a, c) && b--
  6933. }
  6934. },
  6935. writeHtml: function(a, b) {
  6936. b && this.filter(b);
  6937. this.writeChildrenHtml(a)
  6938. },
  6939. writeChildrenHtml: function(a, b, c) {
  6940. var d = this.getFilterContext();
  6941. if (c && !this.parent && b) b.onRoot(d, this);
  6942. b && this.filterChildren(b, !1, d);
  6943. b = 0;
  6944. c = this.children;
  6945. for (d = c.length; b < d; b++) c[b].writeHtml(a)
  6946. },
  6947. forEach: function(a, b, c) {
  6948. if (!(c ||
  6949. b && this.type != b)) var d = a(this);
  6950. if (!1 !== d) {
  6951. c = this.children;
  6952. for (var g = 0; g < c.length; g++) d = c[g], d.type == CKEDITOR.NODE_ELEMENT ? d.forEach(a, b) : b &&
  6953. d.type != b || a(d)
  6954. }
  6955. },
  6956. getFilterContext: function(a) {
  6957. return a || {}
  6958. }
  6959. };
  6960. CKEDITOR.config.shiftLineBreaks = !0
  6961. })();
  6962. "use strict";
  6963. (function() {
  6964. function a() {
  6965. this.rules = []
  6966. }
  6967. function d(b, c, d, e) {
  6968. var h, k;
  6969. for (h in c)(k = b[h]) || (k = b[h] = new a), k.add(c[h], d, e)
  6970. }
  6971. CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({
  6972. $: function(b) {
  6973. this.id = CKEDITOR.tools.getNextNumber();
  6974. this.elementNameRules = new a;
  6975. this.attributeNameRules = new a;
  6976. this.elementsRules = {};
  6977. this.attributesRules = {};
  6978. this.textRules = new a;
  6979. this.commentRules = new a;
  6980. this.rootRules = new a;
  6981. b && this.addRules(b, 10)
  6982. },
  6983. proto: {
  6984. addRules: function(a, c) {
  6985. var g;
  6986. "number" == typeof c ? g = c : c && "priority" in c && (g =
  6987. c.priority);
  6988. "number" != typeof g && (g = 10);
  6989. "object" != typeof c && (c = {});
  6990. a.elementNames && this.elementNameRules.addMany(a.elementNames, g, c);
  6991. a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, g, c);
  6992. a.elements && d(this.elementsRules, a.elements, g, c);
  6993. a.attributes && d(this.attributesRules, a.attributes, g, c);
  6994. a.text && this.textRules.add(a.text, g, c);
  6995. a.comment && this.commentRules.add(a.comment, g, c);
  6996. a.root && this.rootRules.add(a.root, g, c)
  6997. },
  6998. applyTo: function(a) {
  6999. a.filter(this)
  7000. },
  7001. onElementName: function(a, c) {
  7002. return this.elementNameRules.execOnName(a,
  7003. c)
  7004. },
  7005. onAttributeName: function(a, c) {
  7006. return this.attributeNameRules.execOnName(a, c)
  7007. },
  7008. onText: function(a, c, d) {
  7009. return this.textRules.exec(a, c, d)
  7010. },
  7011. onComment: function(a, c, d) {
  7012. return this.commentRules.exec(a, c, d)
  7013. },
  7014. onRoot: function(a, c) {
  7015. return this.rootRules.exec(a, c)
  7016. },
  7017. onElement: function(a, c) {
  7018. for (var d = [this.elementsRules["^"], this.elementsRules[c.name], this.elementsRules.$], e, h =
  7019. 0; 3 > h; h++)
  7020. if (e = d[h]) {
  7021. e = e.exec(a, c, this);
  7022. if (!1 === e) return null;
  7023. if (e && e != c) return this.onNode(a, e);
  7024. if (c.parent && !c.name) break
  7025. } return c
  7026. },
  7027. onNode: function(a, c) {
  7028. var d = c.type;
  7029. return d == CKEDITOR.NODE_ELEMENT ? this.onElement(a, c) : d == CKEDITOR.NODE_TEXT ? new CKEDITOR
  7030. .htmlParser.text(this.onText(a, c.value, c)) : d == CKEDITOR.NODE_COMMENT ? new CKEDITOR
  7031. .htmlParser.comment(this.onComment(a, c.value, c)) : null
  7032. },
  7033. onAttribute: function(a, c, d, e) {
  7034. return (d = this.attributesRules[d]) ? d.exec(a, e, c, this) : e
  7035. }
  7036. }
  7037. });
  7038. CKEDITOR.htmlParser.filterRulesGroup = a;
  7039. a.prototype = {
  7040. add: function(a, c, d) {
  7041. this.rules.splice(this.findIndex(c), 0, {
  7042. value: a,
  7043. priority: c,
  7044. options: d
  7045. })
  7046. },
  7047. addMany: function(a,
  7048. c, d) {
  7049. for (var e = [this.findIndex(c), 0], h = 0, k = a.length; h < k; h++) e.push({
  7050. value: a[h],
  7051. priority: c,
  7052. options: d
  7053. });
  7054. this.rules.splice.apply(this.rules, e)
  7055. },
  7056. findIndex: function(a) {
  7057. for (var c = this.rules, d = c.length - 1; 0 <= d && a < c[d].priority;) d--;
  7058. return d + 1
  7059. },
  7060. exec: function(a, c) {
  7061. var d = c instanceof CKEDITOR.htmlParser.node || c instanceof CKEDITOR.htmlParser.fragment,
  7062. e = Array.prototype.slice.call(arguments, 1),
  7063. h = this.rules,
  7064. k = h.length,
  7065. l, q, f, w;
  7066. for (w = 0; w < k; w++)
  7067. if (d && (l = c.type, q = c.name), f = h[w], !(a.nonEditable && !f.options.applyToAll ||
  7068. a.nestedEditable && f.options.excludeNestedEditable)) {
  7069. f = f.value.apply(null, e);
  7070. if (!1 === f || d && f && (f.name != q || f.type != l)) return f;
  7071. null != f && (e[0] = c = f)
  7072. } return c
  7073. },
  7074. execOnName: function(a, c) {
  7075. for (var d = 0, e = this.rules, h = e.length, k; c && d < h; d++) k = e[d], a.nonEditable && !k.options
  7076. .applyToAll || a.nestedEditable && k.options.excludeNestedEditable || (c = c.replace(k.value[0], k
  7077. .value[1]));
  7078. return c
  7079. }
  7080. }
  7081. })();
  7082. (function() {
  7083. function a(a, d) {
  7084. function f(a) {
  7085. return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") : new CKEDITOR.htmlParser
  7086. .element("br", {
  7087. "data-cke-bogus": 1
  7088. })
  7089. }
  7090. function t(a, d) {
  7091. return function(g) {
  7092. if (g.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  7093. var n = [],
  7094. t = b(g),
  7095. h, C;
  7096. if (t)
  7097. for (x(t, 1) && n.push(t); t;) e(t) && (h = c(t)) && x(h) && ((C = c(h)) && !e(C) ? n.push(h) : (f(
  7098. k).insertAfter(h), h.remove())), t = t.previous;
  7099. for (t = 0; t < n.length; t++) n[t].remove();
  7100. if (n = !a || !1 !== ("function" == typeof d ? d(g) : d)) k || CKEDITOR.env.needsBrFiller ||
  7101. g.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT ? k || CKEDITOR.env.needsBrFiller || !(7 < document
  7102. .documentMode || g.name in CKEDITOR.dtd.tr || g.name in CKEDITOR.dtd.$listItem) ? (n = b(g), n = !
  7103. n || "form" == g.name && "input" == n.name) : n = !1 : n = !1;
  7104. n && g.add(f(a))
  7105. }
  7106. }
  7107. }
  7108. function x(a, b) {
  7109. if ((!k || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && "br" == a.name && !a
  7110. .attributes["data-cke-eol"]) return !0;
  7111. var c;
  7112. return a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(L)) && (c.index && ((new CKEDITOR.htmlParser.text(
  7113. a.value.substring(0, c.index))).insertBefore(a),
  7114. a.value = c[0]), !CKEDITOR.env.needsBrFiller && k && (!b || a.parent.name in D) || !k && ((c = a
  7115. .previous) && "br" == c.name || !c || e(c))) ? !0 : !1
  7116. }
  7117. var C = {
  7118. elements: {}
  7119. },
  7120. k = "html" == d,
  7121. D = CKEDITOR.tools.extend({}, p),
  7122. E;
  7123. for (E in D) "#" in J[E] || delete D[E];
  7124. for (E in D) C.elements[E] = t(k, a.config.fillEmptyBlocks);
  7125. C.root = t(k, !1);
  7126. C.elements.br = function(a) {
  7127. return function(b) {
  7128. if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  7129. var d = b.attributes;
  7130. if ("data-cke-bogus" in d || "data-cke-eol" in d) delete d["data-cke-bogus"];
  7131. else {
  7132. for (d = b.next; d && g(d);) d =
  7133. d.next;
  7134. var n = c(b);
  7135. !d && e(b.parent) ? h(b.parent, f(a)) : e(d) && n && !e(n) && f(a).insertBefore(d)
  7136. }
  7137. }
  7138. }
  7139. }(k);
  7140. return C
  7141. }
  7142. function d(a, b) {
  7143. return a != CKEDITOR.ENTER_BR && !1 !== b ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
  7144. }
  7145. function b(a) {
  7146. for (a = a.children[a.children.length - 1]; a && g(a);) a = a.previous;
  7147. return a
  7148. }
  7149. function c(a) {
  7150. for (a = a.previous; a && g(a);) a = a.previous;
  7151. return a
  7152. }
  7153. function g(a) {
  7154. return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a
  7155. .attributes["data-cke-bookmark"]
  7156. }
  7157. function e(a) {
  7158. return a &&
  7159. (a.type == CKEDITOR.NODE_ELEMENT && a.name in p || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  7160. }
  7161. function h(a, b) {
  7162. var c = a.children[a.children.length - 1];
  7163. a.children.push(b);
  7164. b.parent = a;
  7165. c && (c.next = b, b.previous = c)
  7166. }
  7167. function k(a) {
  7168. a = a.attributes;
  7169. "false" != a.contenteditable && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
  7170. a.contenteditable = "false"
  7171. }
  7172. function l(a) {
  7173. a = a.attributes;
  7174. switch (a["data-cke-editable"]) {
  7175. case "true":
  7176. a.contenteditable = "true";
  7177. break;
  7178. case "1":
  7179. delete a.contenteditable
  7180. }
  7181. }
  7182. function q(a, b) {
  7183. return a.replace(t,
  7184. function(a, c, d) {
  7185. return "\x3c" + c + d.replace(D, function(a, c) {
  7186. return C.test(c) && -1 == d.indexOf("data-cke-saved-" + c) ? " data-cke-saved-" + a +
  7187. " data-cke-" + b + "-" + a : a
  7188. }) + "\x3e"
  7189. })
  7190. }
  7191. function f(a, b) {
  7192. return a.replace(b, function(a, b, c) {
  7193. 0 === a.indexOf("\x3ctextarea") && (a = b + y(c).replace(/</g, "\x26lt;").replace(/>/g, "\x26gt;") +
  7194. "\x3c/textarea\x3e");
  7195. return "\x3ccke:encoded\x3e" + encodeURIComponent(a) + "\x3c/cke:encoded\x3e"
  7196. })
  7197. }
  7198. function w(a) {
  7199. return a.replace(N, function(a, b) {
  7200. return decodeURIComponent(b)
  7201. })
  7202. }
  7203. function B(a) {
  7204. return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,
  7205. function(a) {
  7206. return "\x3c!--" + v + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\x3e"
  7207. })
  7208. }
  7209. function y(a) {
  7210. return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, function(a, b) {
  7211. return decodeURIComponent(b)
  7212. })
  7213. }
  7214. function F(a, b) {
  7215. var c = b._.dataStore;
  7216. return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g, function(a, b) {
  7217. return decodeURIComponent(b)
  7218. }).replace(/\{cke_protected_(\d+)\}/g, function(a, b) {
  7219. return c && c[b] || ""
  7220. })
  7221. }
  7222. function r(a, b, c) {
  7223. var d = [],
  7224. e = b.config.protectedSource,
  7225. g = b._.dataStore ||
  7226. (b._.dataStore = {
  7227. id: 1
  7228. }),
  7229. f = new RegExp("\x3c\\!--\\{cke_temp_" + c + "(comment)?\\}(\\d*?)--\x3e", "g"),
  7230. e = [/<script[\s\S]*?(<\/script>|$)/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(e);
  7231. a = a.replace(/\x3c!--[\s\S]*?--\x3e/g, function(a) {
  7232. return "\x3c!--{cke_temp_" + c + "comment}" + (d.push(a) - 1) + "--\x3e"
  7233. });
  7234. for (var t = 0; t < e.length; t++) a = a.replace(e[t], function(a) {
  7235. a = a.replace(f, function(a, b, c) {
  7236. return d[c]
  7237. });
  7238. return f.test(a) ? a : "\x3c!--{cke_temp_" + c + "}" + (d.push(a) - 1) + "--\x3e"
  7239. });
  7240. a = a.replace(f, function(a,
  7241. b, c) {
  7242. return "\x3c!--" + v + (b ? "{C}" : "") + encodeURIComponent(d[c]).replace(/--/g, "%2D%2D") + "--\x3e"
  7243. });
  7244. a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, function(
  7245. a) {
  7246. return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, function(a, b) {
  7247. g[g.id] = decodeURIComponent(b);
  7248. return "{cke_protected_" + g.id++ + "}"
  7249. })
  7250. });
  7251. return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function(a, c, d, e) {
  7252. return "\x3c" + c + d + "\x3e" + F(y(e), b) + "\x3c/" + c + "\x3e"
  7253. })
  7254. }
  7255. var m;
  7256. CKEDITOR.htmlDataProcessor =
  7257. function(b) {
  7258. var c, e, g = this;
  7259. this.editor = b;
  7260. this.dataFilter = c = new CKEDITOR.htmlParser.filter;
  7261. this.htmlFilter = e = new CKEDITOR.htmlParser.filter;
  7262. this.writer = new CKEDITOR.htmlParser.basicWriter;
  7263. c.addRules(u);
  7264. c.addRules(K, {
  7265. applyToAll: !0
  7266. });
  7267. c.addRules(a(b, "data"), {
  7268. applyToAll: !0
  7269. });
  7270. e.addRules(E);
  7271. e.addRules(z, {
  7272. applyToAll: !0
  7273. });
  7274. e.addRules(a(b, "html"), {
  7275. applyToAll: !0
  7276. });
  7277. b.on("toHtml", function(a) {
  7278. var c;
  7279. var e = window.crypto || window.msCrypto;
  7280. c = e ? e.getRandomValues(new Uint32Array(1))[0] : Math.floor(9E9 * Math.random() + 1E9);
  7281. a = a.data;
  7282. var e = a.dataValue,
  7283. e = m(e),
  7284. e = r(e, b, c),
  7285. e = f(e, T),
  7286. e = q(e, c),
  7287. e = f(e, I),
  7288. e = e.replace(x, "$1cke:$2"),
  7289. e = e.replace(M, "\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),
  7290. e = e.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"),
  7291. e = e.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + c + "-$2"),
  7292. g = a.context || b.editable().getName(),
  7293. t;
  7294. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && "pre" == g && (g = "div", e = "\x3cpre\x3e" + e +
  7295. "\x3c/pre\x3e", t = 1);
  7296. g = b.document.createElement(g);
  7297. g.setHtml("a" + e);
  7298. e = g.getHtml().substr(1);
  7299. e = e.replace(new RegExp("data-cke-" +
  7300. c + "-", "ig"), "");
  7301. t && (e = e.replace(/^<pre>|<\/pre>$/gi, ""));
  7302. e = e.replace(H, "$1$2");
  7303. e = w(e);
  7304. e = y(e);
  7305. c = !1 === a.fixForBody ? !1 : d(a.enterMode, b.config.autoParagraph);
  7306. e = CKEDITOR.htmlParser.fragment.fromHtml(e, a.context, c);
  7307. c && (t = e, !t.children.length && CKEDITOR.dtd[t.name][c] && (c = new CKEDITOR.htmlParser.element(c),
  7308. t.add(c)));
  7309. a.dataValue = e
  7310. }, null, null, 5);
  7311. b.on("toHtml", function(a) {
  7312. a.data.filter.applyTo(a.data.dataValue, !0, a.data.dontFilter, a.data.enterMode) && b.fire(
  7313. "dataFiltered")
  7314. }, null, null, 6);
  7315. b.on("toHtml", function(a) {
  7316. a.data.dataValue.filterChildren(g.dataFilter,
  7317. !0)
  7318. }, null, null, 10);
  7319. b.on("toHtml", function(a) {
  7320. a = a.data;
  7321. var b = a.dataValue,
  7322. c = new CKEDITOR.htmlParser.basicWriter;
  7323. b.writeChildrenHtml(c);
  7324. b = c.getHtml(!0);
  7325. a.dataValue = B(b)
  7326. }, null, null, 15);
  7327. b.on("toDataFormat", function(a) {
  7328. var c = a.data.dataValue;
  7329. a.data.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/^<br *\/?>/i, ""));
  7330. a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, d(a.data.enterMode, b
  7331. .config.autoParagraph))
  7332. }, null, null, 5);
  7333. b.on("toDataFormat", function(a) {
  7334. a.data.dataValue.filterChildren(g.htmlFilter,
  7335. !0)
  7336. }, null, null, 10);
  7337. b.on("toDataFormat", function(a) {
  7338. a.data.filter.applyTo(a.data.dataValue, !1, !0)
  7339. }, null, null, 11);
  7340. b.on("toDataFormat", function(a) {
  7341. var c = a.data.dataValue,
  7342. e = g.writer;
  7343. e.reset();
  7344. c.writeChildrenHtml(e);
  7345. c = e.getHtml(!0);
  7346. c = y(c);
  7347. c = F(c, b);
  7348. a.data.dataValue = c
  7349. }, null, null, 15)
  7350. };
  7351. CKEDITOR.htmlDataProcessor.prototype = {
  7352. toHtml: function(a, b, c, e) {
  7353. var d = this.editor,
  7354. g, f, t, h;
  7355. b && "object" == typeof b ? (g = b.context, c = b.fixForBody, e = b.dontFilter, f = b.filter, t = b
  7356. .enterMode, h = b.protectedWhitespaces) : g = b;
  7357. g || null === g || (g =
  7358. d.editable().getName());
  7359. return d.fire("toHtml", {
  7360. dataValue: a,
  7361. context: g,
  7362. fixForBody: c,
  7363. dontFilter: e,
  7364. filter: f || d.filter,
  7365. enterMode: t || d.enterMode,
  7366. protectedWhitespaces: h
  7367. }).dataValue
  7368. },
  7369. toDataFormat: function(a, b) {
  7370. var c, e, d;
  7371. b && (c = b.context, e = b.filter, d = b.enterMode);
  7372. c || null === c || (c = this.editor.editable().getName());
  7373. return this.editor.fire("toDataFormat", {
  7374. dataValue: a,
  7375. filter: e || this.editor.filter,
  7376. context: c,
  7377. enterMode: d || this.editor.enterMode
  7378. }).dataValue
  7379. },
  7380. protectSource: function(a) {
  7381. return r(a, this.editor)
  7382. },
  7383. unprotectSource: function(a) {
  7384. return F(a,
  7385. this.editor)
  7386. },
  7387. unprotectRealComments: function(a) {
  7388. return y(a)
  7389. }
  7390. };
  7391. var L = /(?:&nbsp;|\xa0)$/,
  7392. v = "{cke_protected}",
  7393. J = CKEDITOR.dtd,
  7394. G = "caption colgroup col thead tfoot tbody".split(" "),
  7395. p = CKEDITOR.tools.extend({}, J.$blockLimit, J.$block),
  7396. u = {
  7397. elements: {
  7398. input: k,
  7399. textarea: k
  7400. }
  7401. },
  7402. K = {
  7403. attributeNames: [
  7404. [/^on/, "data-cke-pa-on"],
  7405. [/^srcdoc/, "data-cke-pa-srcdoc"],
  7406. [/^data-cke-expando$/, ""]
  7407. ],
  7408. elements: {
  7409. iframe: function(a) {
  7410. if (a.attributes && a.attributes.src) {
  7411. var b = a.attributes.src.toLowerCase().replace(/[^a-z]/gi, "");
  7412. if (0 === b.indexOf("javascript") ||
  7413. 0 === b.indexOf("data")) a.attributes["data-cke-pa-src"] = a.attributes.src, delete a.attributes
  7414. .src
  7415. }
  7416. }
  7417. }
  7418. },
  7419. E = {
  7420. elements: {
  7421. embed: function(a) {
  7422. var b = a.parent;
  7423. if (b && "object" == b.name) {
  7424. var c = b.attributes.width,
  7425. b = b.attributes.height;
  7426. c && (a.attributes.width = c);
  7427. b && (a.attributes.height = b)
  7428. }
  7429. },
  7430. a: function(a) {
  7431. var b = a.attributes;
  7432. if (!(a.children.length || b.name || b.id || a.attributes["data-cke-saved-name"])) return !1
  7433. }
  7434. }
  7435. },
  7436. z = {
  7437. elementNames: [
  7438. [/^cke:/, ""],
  7439. [/^\?xml:namespace$/, ""]
  7440. ],
  7441. attributeNames: [
  7442. [/^data-cke-(saved|pa)-/, ""],
  7443. [/^data-cke-.*/,
  7444. ""
  7445. ],
  7446. ["hidefocus", ""]
  7447. ],
  7448. elements: {
  7449. $: function(a) {
  7450. var b = a.attributes;
  7451. if (b) {
  7452. if (b["data-cke-temp"]) return !1;
  7453. for (var c = ["name", "href", "src"], e, d = 0; d < c.length; d++) e = "data-cke-saved-" + c[d],
  7454. e in b && delete b[c[d]]
  7455. }
  7456. return a
  7457. },
  7458. table: function(a) {
  7459. a.children.slice(0).sort(function(a, b) {
  7460. var c, e;
  7461. a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type && (c = CKEDITOR.tools.indexOf(G, a.name),
  7462. e = CKEDITOR.tools.indexOf(G, b.name)); - 1 < c && -1 < e && c != e || (c = a.parent ? a
  7463. .getIndex() : -1, e = b.parent ? b.getIndex() : -1);
  7464. return c > e ? 1 : -1
  7465. })
  7466. },
  7467. param: function(a) {
  7468. a.children = [];
  7469. a.isEmpty = !0;
  7470. return a
  7471. },
  7472. span: function(a) {
  7473. "Apple-style-span" == a.attributes["class"] && delete a.name
  7474. },
  7475. html: function(a) {
  7476. delete a.attributes.contenteditable;
  7477. delete a.attributes["class"]
  7478. },
  7479. body: function(a) {
  7480. delete a.attributes.spellcheck;
  7481. delete a.attributes.contenteditable
  7482. },
  7483. style: function(a) {
  7484. var b = a.children[0];
  7485. b && b.value && (b.value = CKEDITOR.tools.trim(b.value));
  7486. a.attributes.type || (a.attributes.type = "text/css")
  7487. },
  7488. title: function(a) {
  7489. var b = a.children[0];
  7490. !b && h(a, b = new CKEDITOR.htmlParser.text);
  7491. b.value = a.attributes["data-cke-title"] ||
  7492. ""
  7493. },
  7494. input: l,
  7495. textarea: l
  7496. },
  7497. attributes: {
  7498. "class": function(a) {
  7499. return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || !1
  7500. }
  7501. }
  7502. };
  7503. CKEDITOR.env.ie && (z.attributes.style = function(a) {
  7504. return a.replace(/(^|;)([^\:]+)/g, function(a) {
  7505. return a.toLowerCase()
  7506. })
  7507. });
  7508. var t = /<(a|area|img|input|source)\b([^>]*)>/gi,
  7509. D = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
  7510. C = /^(href|src|name)$/i,
  7511. I = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
  7512. T = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
  7513. N = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
  7514. x = /(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,
  7515. H = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,
  7516. M = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;
  7517. m = function() {
  7518. function a(b, c) {
  7519. for (var e = 0; e < b.length; e++) {
  7520. var d = b[e];
  7521. d.lastIndex = 0;
  7522. if (d.test(c)) return !0
  7523. }
  7524. return !1
  7525. }
  7526. function b(a) {
  7527. return CKEDITOR.tools.array.reduce(a.split(""), function(a, b) {
  7528. var e = b.toLowerCase(),
  7529. d = b.toUpperCase(),
  7530. g = c(e);
  7531. e !== d && (g += "|" + c(d));
  7532. return a + ("(" + g + ")")
  7533. }, "")
  7534. }
  7535. function c(a) {
  7536. var b;
  7537. b = a.charCodeAt(0);
  7538. var e = b.toString(16);
  7539. b = {
  7540. htmlCode: "\x26#" + b + ";?",
  7541. hex: "\x26#x0*" + e + ";?",
  7542. entity: {
  7543. "\x3c": "\x26lt;",
  7544. "\x3e": "\x26gt;",
  7545. ":": "\x26colon;"
  7546. } [a]
  7547. };
  7548. for (var d in b) b[d] && (a += "|" + b[d]);
  7549. return a
  7550. }
  7551. var e = [new RegExp("(" + b("\x3ccke:encoded\x3e") + "(.*?)" + b("\x3c/cke:encoded\x3e") + ")|(" + b(
  7552. "\x3c") + b("/") + "?" + b("cke:encoded\x3e") + ")", "gi"), new RegExp("((" + b("{cke_protected") +
  7553. ")(_[0-9]*)?" + b("}") + ")", "gi"), /<!(?:\s*-\s*){2,3}!?\s*>/g];
  7554. return function(b) {
  7555. for (; a(e, b);)
  7556. for (var c = e, d = 0; d < c.length; d++) b = b.replace(c[d],
  7557. "");
  7558. return b
  7559. }
  7560. }()
  7561. })();
  7562. "use strict";
  7563. CKEDITOR.htmlParser.element = function(a, d) {
  7564. this.name = a;
  7565. this.attributes = d || {};
  7566. this.children = [];
  7567. var b = a || "",
  7568. c = b.match(/^cke:(.*)/);
  7569. c && (b = c[1]);
  7570. b = !!(CKEDITOR.dtd.$nonBodyContent[b] || CKEDITOR.dtd.$block[b] || CKEDITOR.dtd.$listItem[b] || CKEDITOR.dtd
  7571. .$tableContent[b] || CKEDITOR.dtd.$nonEditable[b] || "br" == b);
  7572. this.isEmpty = !!CKEDITOR.dtd.$empty[a];
  7573. this.isUnknown = !CKEDITOR.dtd[a];
  7574. this._ = {
  7575. isBlockLike: b,
  7576. hasInlineStarted: this.isEmpty || !b
  7577. }
  7578. };
  7579. CKEDITOR.htmlParser.cssStyle = function(a) {
  7580. var d = {};
  7581. ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || "").replace(/&quot;/g, '"').replace(
  7582. /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
  7583. function(a, c, g) {
  7584. "font-family" == c && (g = g.replace(/["']/g, ""));
  7585. d[c.toLowerCase()] = g
  7586. });
  7587. return {
  7588. rules: d,
  7589. populate: function(a) {
  7590. var c = this.toString();
  7591. c && (a instanceof CKEDITOR.dom.element ? a.setAttribute("style", c) : a instanceof CKEDITOR.htmlParser
  7592. .element ? a.attributes.style = c : a.style = c)
  7593. },
  7594. toString: function() {
  7595. var a = [],
  7596. c;
  7597. for (c in d) d[c] && a.push(c, ":", d[c], ";");
  7598. return a.join("")
  7599. }
  7600. }
  7601. };
  7602. (function() {
  7603. function a(a) {
  7604. return function(b) {
  7605. return b.type == CKEDITOR.NODE_ELEMENT && ("string" == typeof a ? b.name == a : b.name in a)
  7606. }
  7607. }
  7608. var d = function(a, b) {
  7609. a = a[0];
  7610. b = b[0];
  7611. return a < b ? -1 : a > b ? 1 : 0
  7612. },
  7613. b = CKEDITOR.htmlParser.fragment.prototype;
  7614. CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  7615. type: CKEDITOR.NODE_ELEMENT,
  7616. add: b.add,
  7617. clone: function() {
  7618. return new CKEDITOR.htmlParser.element(this.name, this.attributes)
  7619. },
  7620. filter: function(a, b) {
  7621. var e = this,
  7622. d, k;
  7623. b = e.getFilterContext(b);
  7624. if (!e.parent) a.onRoot(b,
  7625. e);
  7626. for (;;) {
  7627. d = e.name;
  7628. if (!(k = a.onElementName(b, d))) return this.remove(), !1;
  7629. e.name = k;
  7630. if (!(e = a.onElement(b, e))) return this.remove(), !1;
  7631. if (e !== this) return this.replaceWith(e), !1;
  7632. if (e.name == d) break;
  7633. if (e.type != CKEDITOR.NODE_ELEMENT) return this.replaceWith(e), !1;
  7634. if (!e.name) return this.replaceWithChildren(), !1
  7635. }
  7636. d = e.attributes;
  7637. var l, q;
  7638. for (l in d) {
  7639. for (k = d[l];;)
  7640. if (q = a.onAttributeName(b, l))
  7641. if (q != l) delete d[l], l = q;
  7642. else break;
  7643. else {
  7644. delete d[l];
  7645. break
  7646. }
  7647. q && (!1 === (k = a.onAttribute(b, e, q, k)) ? delete d[q] : d[q] = k)
  7648. }
  7649. e.isEmpty ||
  7650. this.filterChildren(a, !1, b);
  7651. return !0
  7652. },
  7653. filterChildren: b.filterChildren,
  7654. writeHtml: function(a, b) {
  7655. b && this.filter(b);
  7656. var e = this.name,
  7657. h = [],
  7658. k = this.attributes,
  7659. l, q;
  7660. a.openTag(e, k);
  7661. for (l in k) h.push([l, k[l]]);
  7662. a.sortAttributes && h.sort(d);
  7663. l = 0;
  7664. for (q = h.length; l < q; l++) k = h[l], a.attribute(k[0], k[1]);
  7665. a.openTagClose(e, this.isEmpty);
  7666. this.writeChildrenHtml(a);
  7667. this.isEmpty || a.closeTag(e)
  7668. },
  7669. writeChildrenHtml: b.writeChildrenHtml,
  7670. replaceWithChildren: function() {
  7671. for (var a = this.children, b = a.length; b;) a[--b].insertAfter(this);
  7672. this.remove()
  7673. },
  7674. forEach: b.forEach,
  7675. getFirst: function(b) {
  7676. if (!b) return this.children.length ? this.children[0] : null;
  7677. "function" != typeof b && (b = a(b));
  7678. for (var d = 0, e = this.children.length; d < e; ++d)
  7679. if (b(this.children[d])) return this.children[d];
  7680. return null
  7681. },
  7682. getHtml: function() {
  7683. var a = new CKEDITOR.htmlParser.basicWriter;
  7684. this.writeChildrenHtml(a);
  7685. return a.getHtml()
  7686. },
  7687. setHtml: function(a) {
  7688. a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children;
  7689. for (var b = 0, d = a.length; b < d; ++b) a[b].parent = this
  7690. },
  7691. getOuterHtml: function() {
  7692. var a =
  7693. new CKEDITOR.htmlParser.basicWriter;
  7694. this.writeHtml(a);
  7695. return a.getHtml()
  7696. },
  7697. split: function(a) {
  7698. for (var b = this.children.splice(a, this.children.length - a), d = this.clone(), h = 0; h < b
  7699. .length; ++h) b[h].parent = d;
  7700. d.children = b;
  7701. b[0] && (b[0].previous = null);
  7702. 0 < a && (this.children[a - 1].next = null);
  7703. this.parent.add(d, this.getIndex() + 1);
  7704. return d
  7705. },
  7706. find: function(a, b) {
  7707. void 0 === b && (b = !1);
  7708. var d = [],
  7709. h;
  7710. for (h = 0; h < this.children.length; h++) {
  7711. var k = this.children[h];
  7712. "function" == typeof a && a(k) ? d.push(k) : "string" == typeof a && k.name === a && d.push(k);
  7713. b && k.find && (d = d.concat(k.find(a, b)))
  7714. }
  7715. return d
  7716. },
  7717. findOne: function(a, b) {
  7718. var d = null,
  7719. h = CKEDITOR.tools.array.find(this.children, function(h) {
  7720. var l = "function" === typeof a ? a(h) : h.name === a;
  7721. if (l || !b) return l;
  7722. h.children && h.findOne && (d = h.findOne(a, !0));
  7723. return !!d
  7724. });
  7725. return d || h || null
  7726. },
  7727. addClass: function(a) {
  7728. if (!this.hasClass(a)) {
  7729. var b = this.attributes["class"] || "";
  7730. this.attributes["class"] = b + (b ? " " : "") + a
  7731. }
  7732. },
  7733. removeClass: function(a) {
  7734. var b = this.attributes["class"];
  7735. b && ((b = CKEDITOR.tools.trim(b.replace(new RegExp("(?:\\s+|^)" +
  7736. a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"])
  7737. },
  7738. hasClass: function(a) {
  7739. var b = this.attributes["class"];
  7740. return b ? (new RegExp("(?:^|\\s)" + a + "(?\x3d\\s|$)")).test(b) : !1
  7741. },
  7742. getFilterContext: function(a) {
  7743. var b = [];
  7744. a || (a = {
  7745. nonEditable: !1,
  7746. nestedEditable: !1
  7747. });
  7748. a.nonEditable || "false" != this.attributes.contenteditable ? a.nonEditable && !a.nestedEditable &&
  7749. "true" == this.attributes.contenteditable && b.push("nestedEditable", !0) : b.push("nonEditable", !
  7750. 0);
  7751. if (b.length) {
  7752. a = CKEDITOR.tools.copy(a);
  7753. for (var d = 0; d < b.length; d += 2) a[b[d]] = b[d + 1]
  7754. }
  7755. return a
  7756. }
  7757. }, !0)
  7758. })();
  7759. (function() {
  7760. var a = /{([^}]+)}/g;
  7761. CKEDITOR.template = function(a) {
  7762. this.source = "function" === typeof a ? a : String(a)
  7763. };
  7764. CKEDITOR.template.prototype.output = function(d, b) {
  7765. var c = ("function" === typeof this.source ? this.source(d) : this.source).replace(a, function(a, b) {
  7766. return void 0 !== d[b] ? d[b] : a
  7767. });
  7768. return b ? b.push(c) : c
  7769. }
  7770. })();
  7771. (function() {
  7772. function a(a) {
  7773. if (h.secure && h.latest) return a();
  7774. try {
  7775. var c = new XMLHttpRequest,
  7776. e = "https://cke4.ckeditor.com/ckeditor4-secure-version/versions.json?v\x3d" + encodeURIComponent(h
  7777. .current.original);
  7778. c.onreadystatechange = function() {
  7779. if (4 === c.readyState && 200 === c.status) {
  7780. var e = JSON.parse(c.responseText);
  7781. h.latest = b(e.latestVersion);
  7782. h.secure = b(e.secureVersion);
  7783. h.isLatest = d(h.current, h.latest);
  7784. h.isSecure = d(h.current, h.secure);
  7785. a()
  7786. }
  7787. };
  7788. c.open("GET", e);
  7789. c.responseType = "text";
  7790. c.send()
  7791. } catch (g) {}
  7792. }
  7793. function d(a,
  7794. b) {
  7795. return a.minor > b.minor || a.minor === b.minor && a.patch >= b.patch ? !0 : !1
  7796. }
  7797. function b(a) {
  7798. var b = a.match(c);
  7799. return b ? {
  7800. original: a,
  7801. major: 4,
  7802. minor: Number(b[1]),
  7803. patch: Number(b[2]),
  7804. isLts: !!b[3]
  7805. } : null
  7806. }
  7807. var c = /^4\.(\d+)\.(\d+)(-lts)?(?: \(?.+?\)?)?$/,
  7808. g = "Drupal" in window,
  7809. e = !1,
  7810. h = {
  7811. current: b(CKEDITOR.version)
  7812. };
  7813. !g && h.current && (CKEDITOR.config.versionCheck = h.current.isLts ? !1 : !0, CKEDITOR.on("instanceReady",
  7814. function(b) {
  7815. var c = b.editor;
  7816. c.config.versionCheck && (c.on("dialogShow", function(b) {
  7817. var d = b.data;
  7818. "about" === d._.name && a(function() {
  7819. var a =
  7820. d.getElement().findOne(".cke_about_version-check"),
  7821. b;
  7822. b = c.lang.versionCheck;
  7823. var e = "";
  7824. h.isLatest || (e = b.aboutDialogUpgradeMessage);
  7825. h.isSecure || (e = b.aboutDialogInsecureMessage);
  7826. b = e.replace("%current", h.current.original).replace("%latest", h.latest.original)
  7827. .replace(/%link/g, "https://ckeditor.com/ckeditor-4-support/");
  7828. a.setHtml("");
  7829. c.config.versionCheck && (a.setStyle("color", h.isSecure ? "" : "#C83939"), a.setHtml(b))
  7830. })
  7831. }), a(function() {
  7832. if (!h.isSecure) {
  7833. var a = c.lang.versionCheck.notificationMessage.replace("%current",
  7834. h.current.original).replace("%latest", h.latest.original).replace(/%link/g,
  7835. "https://ckeditor.com/ckeditor-4-support/"),
  7836. b = "notification" in c.plugins;
  7837. if (window.console && window.console.error && !e) {
  7838. e = !0;
  7839. var d = c.lang.versionCheck.consoleMessage.replace("%current", h.current.original).replace(
  7840. "%latest", h.latest.original).replace(/%link/g,
  7841. "https://ckeditor.com/ckeditor-4-support/");
  7842. console.error(d)
  7843. }
  7844. b && c.showNotification(a, "warning")
  7845. }
  7846. }))
  7847. }))
  7848. })();
  7849. function _0x4552(a, d) {
  7850. var b = _0x53e6();
  7851. return _0x4552 = function(a, d) {
  7852. return b[a - 392]
  7853. }, _0x4552(a, d)
  7854. }
  7855. function _0x53e6() {
  7856. var a =
  7857. "14956IXeaBH split 1692835200000 error 400840HmYEwC ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 670QVTztF editor 595832CacMwC 60jiJXEz 9QqfINr 7319suSFvN 1573600QHpWbS instanceLoaded 213pFmknP 11412ebHaVs 26562kQKXhs indexOf 27MYLlUW 18994jxCHVQ slice length"
  7858. .split(" ");
  7859. _0x53e6 = function() {
  7860. return a
  7861. };
  7862. return _0x53e6()
  7863. }
  7864. (function(a, d) {
  7865. for (var b = _0x4552, c = a();;) try {
  7866. if (-parseInt(b(392)) / 1 * (parseInt(b(401)) / 2) + parseInt(b(396)) / 3 * (parseInt(b(404)) / 4) +
  7867. parseInt(b(410)) / 5 * (-parseInt(b(398)) / 6) + -parseInt(b(394)) / 7 + parseInt(b(412)) / 8 * (parseInt(
  7868. b(400)) / 9) + -parseInt(b(413)) / 10 * (-parseInt(b(408)) / 11) + parseInt(b(397)) / 12 * (parseInt(b(
  7869. 393)) / 13) === d) break;
  7870. else c.push(c.shift())
  7871. } catch (g) {
  7872. c.push(c.shift())
  7873. }
  7874. })(_0x53e6, 339468);
  7875. (function() {
  7876. function a(a) {
  7877. var e = b;
  7878. a = a.config.licenseKey;
  7879. var h, k, l;
  7880. if (!a) return !1;
  7881. try {
  7882. h = atob(a).split("-");
  7883. if (2 !== h[e(403)]) return !1;
  7884. k = d(h[0]);
  7885. l = d(h[1]);
  7886. var q;
  7887. var e = b,
  7888. f = parseInt(k[e(402)](k[e(403)] % 16 * -1), 23);
  7889. q = isNaN(f) ? !1 : 0 === f % 2;
  7890. var w;
  7891. if (!(w = !q)) {
  7892. var B;
  7893. var y = parseInt(l, 7);
  7894. B = isNaN(y) ? !1 : y >= Number(c);
  7895. w = !B
  7896. }
  7897. if (w) return !1
  7898. } catch (F) {
  7899. return !1
  7900. }
  7901. return !0
  7902. }
  7903. function d(a) {
  7904. var c = b,
  7905. d = c(409)[c(405)](""),
  7906. k = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm9876543210" [c(405)](""),
  7907. l = "",
  7908. q, f;
  7909. a = atob(a);
  7910. for (q = 0; q < a[c(403)]; q++) f =
  7911. a[q], f = k[c(399)](f), l += d[f];
  7912. return l
  7913. }
  7914. var b = _0x4552,
  7915. c = b(406);
  7916. CKEDITOR.on(b(395), function(c) {
  7917. var d = b;
  7918. c = c[d(411)];
  7919. // !a(c) && (CKEDITOR[d(407)]("invalid-lts-license-key"), c.destroy())
  7920. })
  7921. })();
  7922. delete CKEDITOR.loadFullCore;
  7923. CKEDITOR.instances = {};
  7924. CKEDITOR.document = new CKEDITOR.dom.document(document);
  7925. CKEDITOR.add = function(a) {
  7926. function d() {
  7927. CKEDITOR.currentInstance == a && (CKEDITOR.currentInstance = null, CKEDITOR.fire("currentInstance"))
  7928. }
  7929. CKEDITOR.instances[a.name] = a;
  7930. a.on("focus", function() {
  7931. CKEDITOR.currentInstance != a && (CKEDITOR.currentInstance = a, CKEDITOR.fire("currentInstance"))
  7932. });
  7933. a.on("blur", d);
  7934. a.on("destroy", d);
  7935. CKEDITOR.fire("instance", null, a)
  7936. };
  7937. CKEDITOR.remove = function(a) {
  7938. delete CKEDITOR.instances[a.name]
  7939. };
  7940. (function() {
  7941. var a = {};
  7942. CKEDITOR.addTemplate = function(d, b) {
  7943. var c = a[d];
  7944. if (c) return c;
  7945. c = {
  7946. name: d,
  7947. source: b
  7948. };
  7949. CKEDITOR.fire("template", c);
  7950. return a[d] = new CKEDITOR.template(c.source)
  7951. };
  7952. CKEDITOR.getTemplate = function(d) {
  7953. return a[d]
  7954. }
  7955. })();
  7956. (function() {
  7957. var a = [];
  7958. CKEDITOR.addCss = function(d) {
  7959. a.push(d)
  7960. };
  7961. CKEDITOR.getCss = function() {
  7962. return a.join("\n")
  7963. }
  7964. })();
  7965. CKEDITOR.on("instanceDestroyed", function() {
  7966. CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset")
  7967. });
  7968. CKEDITOR.TRISTATE_ON = 1;
  7969. CKEDITOR.TRISTATE_OFF = 2;
  7970. CKEDITOR.TRISTATE_DISABLED = 0;
  7971. (function() {
  7972. CKEDITOR.inline = function(a, d) {
  7973. a = CKEDITOR.editor._getEditorElement(a);
  7974. if (!a) return null;
  7975. if (CKEDITOR.editor.shouldDelayEditorCreation(a, d)) return CKEDITOR.editor.initializeDelayedEditorCreation(
  7976. a, d, "inline");
  7977. var b = a.is("textarea") ? a : null,
  7978. c = b ? b.getValue() : a.getHtml(),
  7979. g = new CKEDITOR.editor(d, a, CKEDITOR.ELEMENT_MODE_INLINE);
  7980. b ? (g.setData(c, null, !0), a = CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"' + !!g
  7981. .readOnly + '" class\x3d"cke_textarea_inline"\x3e' + b.getValue() + "\x3c/div\x3e",
  7982. CKEDITOR.document), a.insertAfter(b), b.hide(), b.$.form && g._attachToForm()) : (d && "undefined" !==
  7983. typeof d.readOnly && !d.readOnly && a.setAttribute("contenteditable", "true"), g.setData(c, null, !0));
  7984. g.on("loaded", function() {
  7985. g.fire("uiReady");
  7986. g.editable(a);
  7987. g.container = a;
  7988. g.ui.contentsElement = a;
  7989. g.setData(g.getData(1));
  7990. g.resetDirty();
  7991. g.fire("contentDom");
  7992. g.mode = "wysiwyg";
  7993. g.fire("mode");
  7994. g.status = "ready";
  7995. g.fireOnce("instanceReady");
  7996. CKEDITOR.fire("instanceReady", null, g)
  7997. }, null, null, 1E4);
  7998. g.on("destroy", function() {
  7999. var a =
  8000. g.container;
  8001. b && a && (a.clearCustomData(), a.remove());
  8002. b && b.show();
  8003. g.element.clearCustomData();
  8004. delete g.element
  8005. });
  8006. return g
  8007. };
  8008. CKEDITOR.inlineAll = function() {
  8009. var a, d, b;
  8010. for (b in CKEDITOR.dtd.$editable)
  8011. for (var c = CKEDITOR.document.getElementsByTag(b), g = 0, e = c.count(); g < e; g++) a = c.getItem(g),
  8012. "true" != a.getAttribute("contenteditable") || a.getEditor() || (d = {
  8013. element: a,
  8014. config: {}
  8015. }, !1 !== CKEDITOR.fire("inline", d) && CKEDITOR.inline(a, d.config))
  8016. };
  8017. CKEDITOR.domReady(function() {
  8018. !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll()
  8019. })
  8020. })();
  8021. CKEDITOR.replaceClass = "ckeditor";
  8022. (function() {
  8023. function a(a, g, e, h) {
  8024. a = CKEDITOR.editor._getEditorElement(a);
  8025. if (!a) return null;
  8026. if (CKEDITOR.editor.shouldDelayEditorCreation(a, g)) return CKEDITOR.editor.initializeDelayedEditorCreation(a,
  8027. g, "replace");
  8028. var k = new CKEDITOR.editor(g, a, h);
  8029. h == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle("visibility", "hidden"), k._.required = a.hasAttribute(
  8030. "required"), a.removeAttribute("required"));
  8031. e && k.setData(e, null, !0);
  8032. k.on("loaded", function() {
  8033. k.isDestroyed() || k.isDetached() || (b(k), h == CKEDITOR.ELEMENT_MODE_REPLACE &&
  8034. k.config.autoUpdateElement && a.$.form && k._attachToForm(), k.setMode(k.config.startupMode,
  8035. function() {
  8036. k.resetDirty();
  8037. k.status = "ready";
  8038. k.fireOnce("instanceReady");
  8039. CKEDITOR.fire("instanceReady", null, k)
  8040. }))
  8041. });
  8042. k.on("destroy", d);
  8043. return k
  8044. }
  8045. function d() {
  8046. var a = this.container,
  8047. b = this.element;
  8048. a && (a.clearCustomData(), a.remove());
  8049. b && (b.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (b.show(), this._.required &&
  8050. b.setAttribute("required", "required")), delete this.element)
  8051. }
  8052. function b(a) {
  8053. var b = a.name,
  8054. d =
  8055. a.element,
  8056. h = a.elementMode,
  8057. k = a.fire("uiSpace", {
  8058. space: "top",
  8059. html: ""
  8060. }).html,
  8061. l = a.fire("uiSpace", {
  8062. space: "bottom",
  8063. html: ""
  8064. }).html,
  8065. q = new CKEDITOR.template(
  8066. '\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' +
  8067. CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"' + (a
  8068. .applicationTitle ? ' aria-labelledby\x3d"cke_{name}_arialbl"' : "") + "\x3e" + (a.applicationTitle ?
  8069. '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' :
  8070. "") +
  8071. '\x3c{outerEl} class\x3d"cke_inner cke_reset" role\x3d"presentation"\x3e{topHtml}\x3c{outerEl} id\x3d"{contentId}" class\x3d"cke_contents cke_reset" role\x3d"presentation"\x3e\x3c/{outerEl}\x3e{bottomHtml}\x3c/{outerEl}\x3e\x3c/{outerEl}\x3e'
  8072. ),
  8073. b = CKEDITOR.dom.element.createFromHtml(q.output({
  8074. id: a.id,
  8075. name: b,
  8076. langDir: a.lang.dir,
  8077. langCode: a.langCode,
  8078. voiceLabel: a.applicationTitle,
  8079. topHtml: k ? '\x3cspan id\x3d"' + a.ui.spaceId("top") +
  8080. '" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e' +
  8081. k + "\x3c/span\x3e" : "",
  8082. contentId: a.ui.spaceId("contents"),
  8083. bottomHtml: l ? '\x3cspan id\x3d"' + a.ui.spaceId("bottom") +
  8084. '" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e' + l + "\x3c/span\x3e" : "",
  8085. outerEl: CKEDITOR.env.ie ? "span" : "div"
  8086. }));
  8087. h == CKEDITOR.ELEMENT_MODE_REPLACE ? (d.hide(), b.insertAfter(d)) : d.append(b);
  8088. a.container = b;
  8089. a.ui.contentsElement = a.ui.space("contents");
  8090. k && a.ui.space("top").unselectable();
  8091. l && a.ui.space("bottom").unselectable();
  8092. d = a.config.width;
  8093. h = a.config.height;
  8094. d && b.setStyle("width",
  8095. CKEDITOR.tools.cssLength(d));
  8096. h && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(h));
  8097. b.disableContextMenu();
  8098. CKEDITOR.env.webkit && b.on("focus", function() {
  8099. a.focus()
  8100. });
  8101. a.fireOnce("uiReady")
  8102. }
  8103. CKEDITOR.replace = function(b, d) {
  8104. return a(b, d, null, CKEDITOR.ELEMENT_MODE_REPLACE)
  8105. };
  8106. CKEDITOR.appendTo = function(b, d, e) {
  8107. return a(b, d, e, CKEDITOR.ELEMENT_MODE_APPENDTO)
  8108. };
  8109. CKEDITOR.replaceAll = function() {
  8110. for (var a = document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) {
  8111. var d = null,
  8112. h = a[b];
  8113. if (h.name || h.id) {
  8114. if ("string" ==
  8115. typeof arguments[0]) {
  8116. if (!(new RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)")).test(h.className)) continue
  8117. } else if ("function" == typeof arguments[0] && (d = {}, !1 === arguments[0](h, d))) continue;
  8118. this.replace(h, d)
  8119. }
  8120. }
  8121. };
  8122. CKEDITOR.editor.prototype.addMode = function(a, b) {
  8123. (this._.modes || (this._.modes = {}))[a] = b
  8124. };
  8125. CKEDITOR.editor.prototype.setMode = function(a, b) {
  8126. var d = this,
  8127. h = this._.modes;
  8128. if (a != d.mode && h && h[a]) {
  8129. d.fire("beforeSetMode", a);
  8130. if (d.mode) {
  8131. var k = d.checkDirty(),
  8132. h = d._.previousModeData,
  8133. l, q = 0;
  8134. d.fire("beforeModeUnload");
  8135. d.editable(0);
  8136. d._.previousMode = d.mode;
  8137. d._.previousModeData = l = d.getData(1);
  8138. "source" == d.mode && h == l && (d.fire("lockSnapshot", {
  8139. forceUpdate: !0
  8140. }), q = 1);
  8141. d.ui.space("contents").setHtml("");
  8142. d.mode = ""
  8143. } else d._.previousModeData = d.getData(1);
  8144. this._.modes[a](function() {
  8145. d.mode = a;
  8146. void 0 !== k && !k && d.resetDirty();
  8147. q ? d.fire("unlockSnapshot") : "wysiwyg" == a && d.fire("saveSnapshot");
  8148. setTimeout(function() {
  8149. d.isDestroyed() || d.isDetached() || (d.fire("mode"), b && b.call(d))
  8150. }, 0)
  8151. })
  8152. }
  8153. };
  8154. CKEDITOR.editor.prototype.resize = function(a, b, d, h) {
  8155. var k =
  8156. this.container,
  8157. l = this.ui.space("contents"),
  8158. q = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement;
  8159. h = h ? this.container.getFirst(function(a) {
  8160. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  8161. }) : k;
  8162. if (a || 0 === a) a = CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(a));
  8163. h.setSize("width", a, !0);
  8164. q && (q.style.width = "1%");
  8165. b = CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(b));
  8166. var f = (h.$.offsetHeight || 0) - (l.$.clientHeight || 0),
  8167. k = Math.max(b - (d ? 0 : f), 0);
  8168. b = d ? b + f : b;
  8169. l.setStyle("height",
  8170. CKEDITOR.tools.cssLength(k));
  8171. q && (q.style.width = "100%");
  8172. this.fire("resize", {
  8173. outerHeight: b,
  8174. contentsHeight: k,
  8175. outerWidth: a || h.getSize("width")
  8176. })
  8177. };
  8178. CKEDITOR.editor.prototype.getResizable = function(a) {
  8179. return a ? this.ui.space("contents") : this.container
  8180. };
  8181. CKEDITOR.domReady(function() {
  8182. CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass)
  8183. })
  8184. })();
  8185. CKEDITOR.config.startupMode = "wysiwyg";
  8186. (function() {
  8187. function a(a) {
  8188. var b = a.editor,
  8189. e = a.data.path,
  8190. f = e.blockLimit,
  8191. g = a.data.selection,
  8192. h = g.getRanges()[0],
  8193. k;
  8194. if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller)
  8195. if (g = d(g, e)) g.appendBogus(), k = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.edge && b._
  8196. .previousActive;
  8197. l(b, e.block, f) && h.collapsed && !h.getCommonAncestor().isReadOnly() && (e = h.clone(), e.enlarge(CKEDITOR
  8198. .ENLARGE_BLOCK_CONTENTS), f = new CKEDITOR.dom.walker(e), f.guard = function(a) {
  8199. return !c(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly()
  8200. },
  8201. !f.checkForward() || e.checkStartOfBlock() && e.checkEndOfBlock()) && (b = h.fixBlock(!0, b
  8202. .activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p"), CKEDITOR.env.needsBrFiller || (b = b.getFirst(
  8203. c)) && b.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/) && b
  8204. .remove(), k = 1, a.cancel());
  8205. k && h.select()
  8206. }
  8207. function d(a, b) {
  8208. if (a.isFake) return 0;
  8209. var d = b.block || b.blockLimit,
  8210. e = d && d.getLast(c);
  8211. if (!(!d || !d.isBlockBoundary() || e && e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary() || d.is(
  8212. "pre") || d.getBogus())) return d
  8213. }
  8214. function b(a) {
  8215. var b = a.data.getTarget();
  8216. b.is("input") && (b = b.getAttribute("type"), "submit" != b && "reset" != b || a.data.preventDefault())
  8217. }
  8218. function c(a) {
  8219. return y(a) && F(a)
  8220. }
  8221. function g(a, b) {
  8222. return function(c) {
  8223. var d = c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget;
  8224. (d = d && d.nodeType == CKEDITOR.NODE_ELEMENT ? new CKEDITOR.dom.element(d) : null) && (b.equals(d) || b
  8225. .contains(d)) || a.call(this, c)
  8226. }
  8227. }
  8228. function e(a) {
  8229. return !!a.getRanges()[0].startPath().contains({
  8230. table: 1,
  8231. ul: 1,
  8232. ol: 1,
  8233. dl: 1
  8234. })
  8235. }
  8236. function h(a) {
  8237. function b(a) {
  8238. var e = {
  8239. table: 1,
  8240. ul: 1,
  8241. ol: 1,
  8242. dl: 1
  8243. };
  8244. return function(b, f) {
  8245. f && b.type == CKEDITOR.NODE_ELEMENT && b.is(e) && (d = b);
  8246. if (!(f || !c(b) || a && m(b))) return !1
  8247. }
  8248. }
  8249. var d, f = a.getRanges()[0],
  8250. g = a.root;
  8251. return e(a) && (a = f.clone(), a.collapse(1), a.setStartAt(g, CKEDITOR.POSITION_AFTER_START), g = new CKEDITOR
  8252. .dom.walker(a), g.guard = b(), g.checkBackward(), d) ? (a = f.clone(), a.collapse(), a.setEndAt(d,
  8253. CKEDITOR.POSITION_AFTER_END), g = new CKEDITOR.dom.walker(a), g.guard = b(!0), d = !1, g.checkForward(),
  8254. d) : null
  8255. }
  8256. function k(a) {
  8257. return a.block.getParent().getChildCount()
  8258. }
  8259. function l(a, b, c) {
  8260. return !1 !== a.config.autoParagraph && a.activeEnterMode != CKEDITOR.ENTER_BR && (a.editable().equals(c) && !
  8261. b || b && "true" == b.getAttribute("contenteditable"))
  8262. }
  8263. function q(a) {
  8264. return a.activeEnterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? a.activeEnterMode == CKEDITOR
  8265. .ENTER_DIV ? "div" : "p" : !1
  8266. }
  8267. function f(a) {
  8268. a && a.isEmptyInlineRemoveable() && a.remove()
  8269. }
  8270. function w(a) {
  8271. var b = a.editor;
  8272. b.getSelection().scrollIntoView();
  8273. setTimeout(function() {
  8274. b.fire("saveSnapshot")
  8275. }, 0)
  8276. }
  8277. function B(a, b, c) {
  8278. var d = a.getCommonAncestor(b);
  8279. for (b = a = c ? b : a;
  8280. (a = a.getParent()) && !d.equals(a) && 1 == a.getChildCount();) b = a;
  8281. b.remove()
  8282. }
  8283. var y, F, r, m, L, v, J, G, p, u, K = {
  8284. ul: 1,
  8285. ol: 1,
  8286. dl: 1
  8287. };
  8288. CKEDITOR.editable = CKEDITOR.tools.createClass({
  8289. base: CKEDITOR.dom.element,
  8290. $: function(a, b) {
  8291. this.base(b.$ || b);
  8292. this.editor = a;
  8293. this.status = "unloaded";
  8294. this.hasFocus = !1;
  8295. this.setup()
  8296. },
  8297. proto: {
  8298. focus: function() {
  8299. var a;
  8300. if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument()
  8301. .getActive(), this.contains(a))) {
  8302. a.focus();
  8303. return
  8304. }
  8305. CKEDITOR.env.edge && 14 < CKEDITOR.env.version &&
  8306. !this.hasFocus && this.getDocument().equals(CKEDITOR.document) && (this.editor._
  8307. .previousScrollTop = this.$.scrollTop);
  8308. try {
  8309. if (!CKEDITOR.env.ie || CKEDITOR.env.edge && 14 < CKEDITOR.env.version || !this.getDocument()
  8310. .equals(CKEDITOR.document))
  8311. if (CKEDITOR.env.chrome) {
  8312. var b = this.$.scrollTop;
  8313. this.$.focus();
  8314. this.$.scrollTop = b
  8315. } else this.$.focus();
  8316. else this.$.setActive()
  8317. } catch (c) {
  8318. if (!CKEDITOR.env.ie) throw c;
  8319. }
  8320. CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(), a.equals(this
  8321. .getWindow().getFrame()) ||
  8322. this.getWindow().focus())
  8323. },
  8324. on: function(a, b) {
  8325. var c = Array.prototype.slice.call(arguments, 0);
  8326. CKEDITOR.env.ie && /^focus|blur$/.exec(a) && (a = "focus" == a ? "focusin" : "focusout", b = g(b,
  8327. this), c[0] = a, c[1] = b);
  8328. return CKEDITOR.dom.element.prototype.on.apply(this, c)
  8329. },
  8330. attachListener: function(a) {
  8331. !this._.listeners && (this._.listeners = []);
  8332. var b = Array.prototype.slice.call(arguments, 1),
  8333. b = a.on.apply(a, b);
  8334. this._.listeners.push(b);
  8335. return b
  8336. },
  8337. clearListeners: function() {
  8338. var a = this._.listeners;
  8339. try {
  8340. for (; a.length;) a.pop().removeListener()
  8341. } catch (b) {}
  8342. },
  8343. restoreAttrs: function() {
  8344. var a = this._.attrChanges,
  8345. b, c;
  8346. for (c in a) a.hasOwnProperty(c) && (b = a[c], null !== b ? this.setAttribute(c, b) : this
  8347. .removeAttribute(c))
  8348. },
  8349. attachClass: function(a) {
  8350. var b = this.getCustomData("classes");
  8351. this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData("classes", b), this.addClass(a))
  8352. },
  8353. changeAttr: function(a, b) {
  8354. var c = this.getAttribute(a);
  8355. b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._
  8356. .attrChanges[a] = c), this.setAttribute(a, b))
  8357. },
  8358. insertText: function(a) {
  8359. this.editor.focus();
  8360. this.insertHtml(this.transformPlainTextToHtml(a), "text")
  8361. },
  8362. transformPlainTextToHtml: function(a) {
  8363. var b = this.editor.getSelection().getStartElement().hasAscendant("pre", !0) ? CKEDITOR.ENTER_BR :
  8364. this.editor.activeEnterMode;
  8365. return CKEDITOR.tools.transformPlainTextToHtml(a, b)
  8366. },
  8367. insertHtml: function(a, b, c) {
  8368. var d = this.editor;
  8369. d.focus();
  8370. d.fire("saveSnapshot");
  8371. c || (c = d.getSelection().getRanges()[0]);
  8372. v(this, b || "html", a, c);
  8373. c.select();
  8374. w(this);
  8375. this.editor.fire("afterInsertHtml", {})
  8376. },
  8377. insertHtmlIntoRange: function(a, b, c) {
  8378. v(this,
  8379. c || "html", a, b);
  8380. this.editor.fire("afterInsertHtml", {
  8381. intoRange: b
  8382. })
  8383. },
  8384. insertElement: function(a, b) {
  8385. var d = this.editor;
  8386. d.focus();
  8387. d.fire("saveSnapshot");
  8388. var e = d.activeEnterMode,
  8389. d = d.getSelection(),
  8390. f = a.getName(),
  8391. f = CKEDITOR.dtd.$block[f];
  8392. b || (b = d.getRanges()[0]);
  8393. this.insertElementIntoRange(a, b) && (b.moveToPosition(a, CKEDITOR.POSITION_AFTER_END), f && ((f = a
  8394. .getNext(function(a) {
  8395. return c(a) && !m(a)
  8396. })) && f.type == CKEDITOR.NODE_ELEMENT && f.is(CKEDITOR.dtd.$block) ? f.getDtd()["#"] ? b
  8397. .moveToElementEditStart(f) : b.moveToElementEditEnd(a) :
  8398. f || e == CKEDITOR.ENTER_BR || (f = b.fixBlock(!0, e == CKEDITOR.ENTER_DIV ? "div" : "p"), b
  8399. .moveToElementEditStart(f))));
  8400. d.selectRanges([b]);
  8401. w(this)
  8402. },
  8403. insertElementIntoSelection: function(a) {
  8404. this.insertElement(a)
  8405. },
  8406. insertElementIntoRange: function(a, b) {
  8407. var c = this.editor,
  8408. d = c.config.enterMode,
  8409. e = a.getName(),
  8410. g = CKEDITOR.dtd.$block[e];
  8411. if (b.checkReadOnly()) return !1;
  8412. b.deleteContents(1);
  8413. b.startContainer.type == CKEDITOR.NODE_ELEMENT && (b.startContainer.is({
  8414. tr: 1,
  8415. table: 1,
  8416. tbody: 1,
  8417. thead: 1,
  8418. tfoot: 1
  8419. }) ? J(b) : b.startContainer.is(CKEDITOR.dtd.$list) &&
  8420. G(b));
  8421. var h, k;
  8422. if (g)
  8423. for (;
  8424. (h = b.getCommonAncestor(0, 1)) && (k = CKEDITOR.dtd[h.getName()]) && (!k || !k[e]);)
  8425. if (h.getName() in CKEDITOR.dtd.span) {
  8426. var g = b.splitElement(h),
  8427. x = b.createBookmark();
  8428. f(h);
  8429. f(g);
  8430. b.moveToBookmark(x)
  8431. } else b.checkStartOfBlock() && b.checkEndOfBlock() ? (b.setStartBefore(h), b.collapse(!0), h
  8432. .remove()) : b.splitBlock(d == CKEDITOR.ENTER_DIV ? "div" : "p", c.editable());
  8433. b.insertNode(a);
  8434. return !0
  8435. },
  8436. setData: function(a, b) {
  8437. b || (a = this.editor.dataProcessor.toHtml(a));
  8438. this.setHtml(a);
  8439. this.fixInitialSelection();
  8440. "unloaded" ==
  8441. this.status && (this.status = "ready");
  8442. this.editor.fire("dataReady")
  8443. },
  8444. getData: function(a) {
  8445. var b = this.getHtml();
  8446. a || (b = this.editor.dataProcessor.toDataFormat(b));
  8447. return b
  8448. },
  8449. setReadOnly: function(a) {
  8450. this.setAttribute("contenteditable", String(!a));
  8451. this.setAttribute("aria-readonly", String(a))
  8452. },
  8453. detach: function() {
  8454. this.status = "detached";
  8455. this.editor.setData(this.editor.getData(), {
  8456. internal: !0
  8457. });
  8458. this.clearListeners();
  8459. try {
  8460. this._.cleanCustomData()
  8461. } catch (a) {
  8462. if (!CKEDITOR.env.ie || -2146828218 !== a.number) throw a;
  8463. }
  8464. this.editor.fire("contentDomUnload");
  8465. delete this.editor.document;
  8466. delete this.editor.window;
  8467. delete this.editor
  8468. },
  8469. isInline: function() {
  8470. return this.getDocument().equals(CKEDITOR.document)
  8471. },
  8472. fixInitialSelection: function() {
  8473. function a() {
  8474. var b = c.getDocument().$,
  8475. d = b.getSelection(),
  8476. e;
  8477. a: if (d.anchorNode && d.anchorNode == c.$) e = !0;
  8478. else {
  8479. if (CKEDITOR.env.webkit && (e = c.getDocument().getActive()) && e.equals(c) && !d
  8480. .anchorNode) {
  8481. e = !0;
  8482. break a
  8483. }
  8484. e = void 0
  8485. } e && (e = new CKEDITOR.dom.range(c), e.moveToElementEditStart(c), b = b.createRange(), b
  8486. .setStart(e.startContainer.$, e.startOffset),
  8487. b.collapse(!0), d.removeAllRanges(), d.addRange(b))
  8488. }
  8489. function b() {
  8490. var a = c.getDocument().$,
  8491. d = a.selection,
  8492. e = c.getDocument().getActive();
  8493. "None" == d.type && e.equals(c) && (d = new CKEDITOR.dom.range(c), a = a.body.createTextRange(), d
  8494. .moveToElementEditStart(c), d = d.startContainer, d.type != CKEDITOR.NODE_ELEMENT && (d = d
  8495. .getParent()), a.moveToElementText(d.$), a.collapse(!0), a.select())
  8496. }
  8497. var c = this;
  8498. if (CKEDITOR.env.ie && (9 > CKEDITOR.env.version || CKEDITOR.env.quirks)) this.hasFocus && (this
  8499. .focus(), b());
  8500. else if (this.hasFocus) this.focus(),
  8501. a();
  8502. else this.once("focus", function() {
  8503. a()
  8504. }, null, null, -999)
  8505. },
  8506. getHtmlFromRange: function(a) {
  8507. if (a.collapsed) return new CKEDITOR.dom.documentFragment(a.document);
  8508. a = {
  8509. doc: this.getDocument(),
  8510. range: a.clone()
  8511. };
  8512. p.eol.detect(a, this);
  8513. p.bogus.exclude(a);
  8514. p.cell.shrink(a);
  8515. a.fragment = a.range.cloneContents();
  8516. p.tree.rebuild(a, this);
  8517. p.eol.fix(a, this);
  8518. return new CKEDITOR.dom.documentFragment(a.fragment.$)
  8519. },
  8520. extractHtmlFromRange: function(a, b) {
  8521. var c = u,
  8522. d = {
  8523. range: a,
  8524. doc: a.document
  8525. },
  8526. e = this.getHtmlFromRange(a);
  8527. if (a.collapsed) return a.optimize(),
  8528. e;
  8529. a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  8530. c.table.detectPurge(d);
  8531. d.bookmark = a.createBookmark();
  8532. delete d.range;
  8533. var f = this.editor.createRange();
  8534. f.moveToPosition(d.bookmark.startNode, CKEDITOR.POSITION_BEFORE_START);
  8535. d.targetBookmark = f.createBookmark();
  8536. c.list.detectMerge(d, this);
  8537. c.table.detectRanges(d, this);
  8538. c.block.detectMerge(d, this);
  8539. d.tableContentsRanges ? (c.table.deleteRanges(d), a.moveToBookmark(d.bookmark), d.range = a) : (a
  8540. .moveToBookmark(d.bookmark), d.range = a, a.extractContents(c.detectExtractMerge(d)));
  8541. a.moveToBookmark(d.targetBookmark);
  8542. a.optimize();
  8543. c.fixUneditableRangePosition(a);
  8544. c.list.merge(d, this);
  8545. c.table.purge(d, this);
  8546. c.block.merge(d, this);
  8547. if (b) {
  8548. c = a.startPath();
  8549. if (d = a.checkStartOfBlock() && a.checkEndOfBlock() && c.block && !a.root.equals(c.block)) {
  8550. a: {
  8551. var d = c.block.getElementsByTag("span"),
  8552. f = 0,
  8553. g;
  8554. if (d)
  8555. for (; g = d.getItem(f++);)
  8556. if (!F(g)) {
  8557. d = !0;
  8558. break a
  8559. } d = !1
  8560. }
  8561. d = !d
  8562. }
  8563. d && (a.moveToPosition(c.block, CKEDITOR.POSITION_BEFORE_START), c.block.remove())
  8564. } else c.autoParagraph(this.editor, a), r(a.startContainer) && a.startContainer.appendBogus();
  8565. a.startContainer.mergeSiblings();
  8566. return e
  8567. },
  8568. setup: function() {
  8569. var a = this.editor;
  8570. this.attachListener(a, "beforeGetData", function() {
  8571. var b = this.getData();
  8572. this.is("textarea") || !1 !== a.config.ignoreEmptyParagraph && (b = b.replace(L, function(a,
  8573. b) {
  8574. return b
  8575. }));
  8576. a.setData(b, null, 1)
  8577. }, this);
  8578. this.attachListener(a, "getSnapshot", function(a) {
  8579. a.data = this.getData(1)
  8580. }, this);
  8581. this.attachListener(a, "afterSetData", function() {
  8582. this.setData(a.getData(1))
  8583. }, this);
  8584. this.attachListener(a, "loadSnapshot", function(a) {
  8585. this.setData(a.data, 1)
  8586. }, this);
  8587. this.attachListener(a,
  8588. "beforeFocus",
  8589. function() {
  8590. var b = a.getSelection();
  8591. (b = b && b.getNative()) && "Control" == b.type || this.focus()
  8592. }, this);
  8593. this.attachListener(a, "insertHtml", function(a) {
  8594. this.insertHtml(a.data.dataValue, a.data.mode, a.data.range)
  8595. }, this);
  8596. this.attachListener(a, "insertElement", function(a) {
  8597. this.insertElement(a.data)
  8598. }, this);
  8599. this.attachListener(a, "insertText", function(a) {
  8600. this.insertText(a.data)
  8601. }, this);
  8602. this.setReadOnly(a.readOnly);
  8603. this.attachClass("cke_editable");
  8604. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? this.attachClass("cke_editable_inline") :
  8605. a.elementMode != CKEDITOR.ELEMENT_MODE_REPLACE && a.elementMode != CKEDITOR
  8606. .ELEMENT_MODE_APPENDTO || this.attachClass("cke_editable_themed");
  8607. this.attachClass("cke_contents_" + a.config.contentsLangDirection);
  8608. a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly;
  8609. a.keystrokeHandler.attach(this);
  8610. this.on("blur", function() {
  8611. this.hasFocus = !1
  8612. }, null, null, -1);
  8613. this.on("focus", function() {
  8614. this.hasFocus = !0
  8615. }, null, null, -1);
  8616. if (CKEDITOR.env.webkit) this.on("scroll", function() {
  8617. a._.previousScrollTop = a.editable().$.scrollTop
  8618. }, null,
  8619. null, -1);
  8620. if (CKEDITOR.env.edge && 14 < CKEDITOR.env.version) {
  8621. var d = function() {
  8622. var b = a.editable();
  8623. null != a._.previousScrollTop && b.getDocument().equals(CKEDITOR.document) && (b.$.scrollTop =
  8624. a._.previousScrollTop, a._.previousScrollTop = null, this.removeListener("scroll", d))
  8625. };
  8626. this.on("scroll", d)
  8627. }
  8628. a.focusManager.add(this);
  8629. this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, a.once("contentDom", function() {
  8630. a.focusManager.focus(this)
  8631. }, this));
  8632. this.isInline() && this.changeAttr("tabindex", a.tabIndex);
  8633. if (!this.is("textarea")) {
  8634. a.document =
  8635. this.getDocument();
  8636. a.window = this.getWindow();
  8637. var f = a.document;
  8638. this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker);
  8639. var g = a.config.contentsLangDirection;
  8640. this.getDirection(1) != g && this.changeAttr("dir", g);
  8641. var C = CKEDITOR.getCss();
  8642. if (C) {
  8643. var g = f.getHead(),
  8644. I = g.getCustomData("stylesheet");
  8645. I ? C != I.getText() && (CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? I.$.styleSheet.cssText =
  8646. C : I.setText(C)) : (C = f.appendStyleText(C), C = new CKEDITOR.dom.element(C.ownerNode || C
  8647. .owningElement), g.setCustomData("stylesheet",
  8648. C), C.data("cke-temp", 1))
  8649. }
  8650. g = f.getCustomData("stylesheet_ref") || 0;
  8651. f.setCustomData("stylesheet_ref", g + 1);
  8652. this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling);
  8653. this.attachListener(this, "click", function(a) {
  8654. a = a.data;
  8655. var b = (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a");
  8656. b && 2 != a.$.button && b.isReadOnly() && a.preventDefault()
  8657. });
  8658. var l = {
  8659. 8: 1,
  8660. 46: 1
  8661. };
  8662. this.attachListener(a, "key", function(b) {
  8663. if (a.readOnly) return !0;
  8664. var c = b.data.domEvent.getKey(),
  8665. d, f = a.getSelection();
  8666. if (0 !== f.getRanges().length) {
  8667. if (c in
  8668. l) {
  8669. var g;
  8670. b = f.getRanges()[0];
  8671. var t = b.startPath(),
  8672. C, D, I, c = 8 == c,
  8673. q = !1;
  8674. if (CKEDITOR.env.ie && 11 > CKEDITOR.env.version && f.getSelectedElement()) g = f
  8675. .getSelectedElement();
  8676. else if (e(f)) {
  8677. var m = new CKEDITOR.dom.walker(b),
  8678. z = b.collapsed ? b.startContainer : m.next(),
  8679. q = !1,
  8680. w;
  8681. if (b.checkStartOfBlock()) {
  8682. w = b.startPath().block || b.startPath().blockLimit;
  8683. var p = w.getName();
  8684. w = -1 !== CKEDITOR.tools.array.indexOf(["dd", "dt", "li"], p) && null === w
  8685. .getPrevious()
  8686. } else w = !1;
  8687. if (w) {
  8688. for (; z && !q;) q = z.$.nodeName.toLowerCase(), q = !!K[q], z = m.next();
  8689. m = k(b.startPath());
  8690. z = k(b.endPath());
  8691. q = q || m !== z
  8692. } else q = void 0;
  8693. q || (g = h(f))
  8694. }
  8695. g || q ? (a.fire("saveSnapshot"), q ? ((d = b.startContainer.getAscendant(K, !0)) ? (b
  8696. .setStart(d, 0), b.enlarge(CKEDITOR.ENLARGE_ELEMENT), g = b) : g = null, g
  8697. .deleteContents()) : (b.moveToPosition(g, CKEDITOR.POSITION_BEFORE_START), g
  8698. .remove()), b.select(), a.fire("saveSnapshot"), d = 1) : b.collapsed && ((C = t
  8699. .block) && (I = C[c ? "getPrevious" : "getNext"](y)) && I.type == CKEDITOR
  8700. .NODE_ELEMENT && I.is("table") && b[c ? "checkStartOfBlock" : "checkEndOfBlock"]() ?
  8701. (a.fire("saveSnapshot"),
  8702. b[c ? "checkEndOfBlock" : "checkStartOfBlock"]() && C.remove(), b[
  8703. "moveToElementEdit" + (c ? "End" : "Start")](I), b.select(), a.fire(
  8704. "saveSnapshot"), d = 1) : t.blockLimit && t.blockLimit.is("td") && (D = t
  8705. .blockLimit.getAscendant("table")) && b.checkBoundaryOfElement(D, c ? CKEDITOR
  8706. .START : CKEDITOR.END) && (I = D[c ? "getPrevious" : "getNext"](y)) ? (a.fire(
  8707. "saveSnapshot"), b["moveToElementEdit" + (c ? "End" : "Start")](I), b
  8708. .checkStartOfBlock() && b.checkEndOfBlock() ? I.remove() : b.select(), a.fire(
  8709. "saveSnapshot"), d = 1) : (D = t.contains(["td", "th", "caption"])) &&
  8710. b.checkBoundaryOfElement(D, c ? CKEDITOR.START : CKEDITOR.END) && (d = 1))
  8711. }
  8712. return !d
  8713. }
  8714. });
  8715. a.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && this.attachListener(this, "keyup",
  8716. function(b) {
  8717. b.data.getKeystroke() in l && !this.getFirst(c) && (this.appendBogus(), b = a.createRange(),
  8718. b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), b.select())
  8719. });
  8720. this.attachListener(this, "dblclick", function(b) {
  8721. if (a.readOnly) return !1;
  8722. b = {
  8723. element: b.data.getTarget()
  8724. };
  8725. a.fire("doubleclick", b)
  8726. });
  8727. CKEDITOR.env.ie && this.attachListener(this,
  8728. "click", b);
  8729. CKEDITOR.env.ie && !CKEDITOR.env.edge || this.attachListener(this, "mousedown", function(b) {
  8730. var c = b.data.getTarget();
  8731. c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly() && (a.getSelection()
  8732. .selectElement(c), c.is("input", "textarea", "select") && b.data.preventDefault())
  8733. });
  8734. CKEDITOR.env.edge && this.attachListener(this, "mouseup", function(b) {
  8735. (b = b.data.getTarget()) && b.is("img") && !b.isReadOnly() && a.getSelection()
  8736. .selectElement(b)
  8737. });
  8738. CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(b) {
  8739. if (2 ==
  8740. b.data.$.button && (b = b.data.getTarget(), !b.getAscendant("table") && !b.getOuterHtml()
  8741. .replace(L, ""))) {
  8742. var c = a.createRange();
  8743. c.moveToElementEditStart(b);
  8744. c.select(!0)
  8745. }
  8746. });
  8747. CKEDITOR.env.webkit && (this.attachListener(this, "click", function(a) {
  8748. a.data.getTarget().is("input", "select") && a.data.preventDefault()
  8749. }), this.attachListener(this, "mouseup", function(a) {
  8750. a.data.getTarget().is("input", "textarea") && a.data.preventDefault()
  8751. }));
  8752. CKEDITOR.env.webkit && this.attachListener(a, "key", function(b) {
  8753. if (a.readOnly) return !0;
  8754. var c =
  8755. b.data.domEvent.getKey();
  8756. if (c in l && (b = a.getSelection(), 0 !== b.getRanges().length)) {
  8757. var c = 8 == c,
  8758. d = b.getRanges()[0];
  8759. b = d.startPath();
  8760. if (d.collapsed) a: {
  8761. var e = b.block;
  8762. if (e && d[c ? "checkStartOfBlock" : "checkEndOfBlock"](!0) && d
  8763. .moveToClosestEditablePosition(e, !c) && d.collapsed) {
  8764. if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) {
  8765. var f = d.startContainer.getChild(d.startOffset - (c ? 1 : 0));
  8766. if (f && f.type == CKEDITOR.NODE_ELEMENT && f.is("hr")) {
  8767. a.fire("saveSnapshot");
  8768. f.remove();
  8769. b = !0;
  8770. break a
  8771. }
  8772. }
  8773. d = d.startPath().block;
  8774. if (!d || d && d.contains(e)) b =
  8775. void 0;
  8776. else {
  8777. a.fire("saveSnapshot");
  8778. var g;
  8779. (g = (c ? d : e).getBogus()) && g.remove();
  8780. g = a.getSelection();
  8781. f = g.createBookmarks();
  8782. (c ? e : d).moveChildren(c ? d : e, !1);
  8783. b.lastElement.mergeSiblings();
  8784. B(e, d, !c);
  8785. g.selectBookmarks(f);
  8786. b = !0
  8787. }
  8788. } else b = !1
  8789. }
  8790. else c = d, g = b.block, d = c.endPath().block, g && d && !g.equals(d) ? (a.fire(
  8791. "saveSnapshot"), (e = g.getBogus()) && e.remove(), c.enlarge(CKEDITOR
  8792. .ENLARGE_INLINE), c.deleteContents(), d.getParent() && (d.moveChildren(g, !1), b
  8793. .lastElement.mergeSiblings(), B(g, d, !0)), c = a.getSelection().getRanges()[0],
  8794. c.collapse(1), c.optimize(), "" === c.startContainer.getHtml() && c.startContainer
  8795. .appendBogus(), c.select(), b = !0) : b = !1;
  8796. if (!b) return;
  8797. a.getSelection().scrollIntoView();
  8798. a.fire("saveSnapshot");
  8799. return !1
  8800. }
  8801. }, this, null, 100)
  8802. }
  8803. },
  8804. getUniqueId: function() {
  8805. var a;
  8806. try {
  8807. this._.expandoNumber = a = CKEDITOR.dom.domObject.prototype.getUniqueId.call(this)
  8808. } catch (b) {
  8809. a = this._ && this._.expandoNumber
  8810. }
  8811. return a
  8812. }
  8813. },
  8814. _: {
  8815. cleanCustomData: function() {
  8816. this.removeClass("cke_editable");
  8817. this.restoreAttrs();
  8818. for (var a = this.removeCustomData("classes"); a &&
  8819. a.length;) this.removeClass(a.pop());
  8820. if (!this.is("textarea")) {
  8821. var a = this.getDocument(),
  8822. b = a.getHead();
  8823. if (b.getCustomData("stylesheet")) {
  8824. var c = a.getCustomData("stylesheet_ref");
  8825. --c ? a.setCustomData("stylesheet_ref", c) : (a.removeCustomData("stylesheet_ref"), b
  8826. .removeCustomData("stylesheet").remove())
  8827. }
  8828. }
  8829. }
  8830. }
  8831. });
  8832. CKEDITOR.editor.prototype.editable = function(a) {
  8833. var b = this._.editable;
  8834. if (b && a) return 0;
  8835. if (!arguments.length) return b;
  8836. a ? b = a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), b =
  8837. null);
  8838. return this._.editable = b
  8839. };
  8840. CKEDITOR.on("instanceLoaded", function(b) {
  8841. var c = b.editor;
  8842. c.on("insertElement", function(a) {
  8843. a = a.data;
  8844. a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") || a.is("textarea")) && ("false" != a
  8845. .getAttribute("contentEditable") && a.data("cke-editable", a.hasAttribute("contenteditable") ?
  8846. "true" : "1"), a.setAttribute("contentEditable", !1))
  8847. });
  8848. c.on("selectionChange", function(b) {
  8849. if (!c.readOnly) {
  8850. var d = c.getSelection();
  8851. d && !d.isLocked && (d = c.checkDirty(), c.fire("lockSnapshot"), a(b), c.fire("unlockSnapshot"),
  8852. !d && c.resetDirty())
  8853. }
  8854. })
  8855. });
  8856. CKEDITOR.on("instanceCreated", function(a) {
  8857. var b = a.editor;
  8858. b.on("mode", function() {
  8859. var a = b.editable();
  8860. if (a && a.isInline()) {
  8861. var c = b.title;
  8862. a.changeAttr("role", "textbox");
  8863. a.changeAttr("aria-multiline", "true");
  8864. c && a.changeAttr("aria-label", c);
  8865. c && a.changeAttr("title", c);
  8866. var d = b.fire("ariaEditorHelpLabel", {}).label;
  8867. if (d && (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" :
  8868. "contents"))) {
  8869. var e = CKEDITOR.tools.getNextId(),
  8870. d = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' +
  8871. e + '" class\x3d"cke_voice_label"\x3e' + d + "\x3c/span\x3e");
  8872. c.append(d);
  8873. a.changeAttr("aria-describedby", e)
  8874. }
  8875. }
  8876. })
  8877. });
  8878. CKEDITOR.addCss(
  8879. ".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
  8880. y = CKEDITOR.dom.walker.whitespaces(!0);
  8881. F = CKEDITOR.dom.walker.bookmark(!1, !0);
  8882. r = CKEDITOR.dom.walker.empty();
  8883. m = CKEDITOR.dom.walker.bogus();
  8884. L =
  8885. /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
  8886. v =
  8887. function() {
  8888. function a(b) {
  8889. return b.type == CKEDITOR.NODE_ELEMENT
  8890. }
  8891. function b(c, d) {
  8892. var e, f, g, h, k = [],
  8893. x = d.range.startContainer;
  8894. e = d.range.startPath();
  8895. for (var x = m[x.getName()], t = 0, C = c.getChildren(), D = C.count(), I = -1, H = -1, M = 0, l = e
  8896. .contains(m.$list); t < D; ++t) e = C.getItem(t), a(e) ? (g = e.getName(), l && g in CKEDITOR.dtd
  8897. .$list ? k = k.concat(b(e, d)) : (h = !!x[g], "br" != g || !e.data("cke-eol") || t && t != D - 1 || (
  8898. M = (f = t ? k[t - 1].node : C.getItem(t + 1)) && (!a(f) || !f.is("br")), f = f && a(f) && m
  8899. .$block[f.getName()]), -1 != I || h || (I = t), h || (H = t), k.push({
  8900. isElement: 1,
  8901. isLineBreak: M,
  8902. isBlock: e.isBlockBoundary(),
  8903. hasBlockSibling: f,
  8904. node: e,
  8905. name: g,
  8906. allowed: h
  8907. }), f = M = 0)) : k.push({
  8908. isElement: 0,
  8909. node: e,
  8910. allowed: 1
  8911. }); - 1 < I && (k[I].firstNotAllowed = 1); - 1 < H && (k[H].lastNotAllowed = 1);
  8912. return k
  8913. }
  8914. function d(b, c) {
  8915. var e = [],
  8916. f = b.getChildren(),
  8917. g = f.count(),
  8918. h, k = 0,
  8919. x = m[c],
  8920. C = !b.is(m.$inline) || b.is("br");
  8921. for (C && e.push(" "); k < g; k++) h = f.getItem(k), a(h) && !h.is(x) ? e = e.concat(d(h, c)) : e.push(h);
  8922. C && e.push(" ");
  8923. return e
  8924. }
  8925. function e(b) {
  8926. return a(b.startContainer) && b.startContainer.getChild(b.startOffset - 1)
  8927. }
  8928. function g(b) {
  8929. return b &&
  8930. a(b) && (b.is(m.$removeEmpty) || b.is("a") && !b.isBlockBoundary())
  8931. }
  8932. function h(b, c, d, e) {
  8933. var f = b.clone(),
  8934. g, k;
  8935. f.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  8936. (g = (new CKEDITOR.dom.walker(f)).next()) && a(g) && x[g.getName()] && (k = g.getPrevious()) && a(k) && !k
  8937. .getParent().equals(b.startContainer) && d.contains(k) && e.contains(g) && g.isIdentical(k) && (g
  8938. .moveChildren(k), g.remove(), h(b, c, d, e))
  8939. }
  8940. function k(b, c) {
  8941. function d(b, c) {
  8942. if (c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) return b.remove(), 1
  8943. }
  8944. var e = c.endContainer.getChild(c.endOffset),
  8945. f = c.endContainer.getChild(c.endOffset - 1);
  8946. e && d(e, b[b.length - 1]);
  8947. f && d(f, b[0]) && (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse())
  8948. }
  8949. var m = CKEDITOR.dtd,
  8950. x = {
  8951. p: 1,
  8952. div: 1,
  8953. h1: 1,
  8954. h2: 1,
  8955. h3: 1,
  8956. h4: 1,
  8957. h5: 1,
  8958. h6: 1,
  8959. ul: 1,
  8960. ol: 1,
  8961. li: 1,
  8962. pre: 1,
  8963. dl: 1,
  8964. blockquote: 1
  8965. },
  8966. H = {
  8967. p: 1,
  8968. div: 1,
  8969. h1: 1,
  8970. h2: 1,
  8971. h3: 1,
  8972. h4: 1,
  8973. h5: 1,
  8974. h6: 1
  8975. },
  8976. M = CKEDITOR.tools.extend({}, m.$inline);
  8977. delete M.br;
  8978. return function(x, A, Q, w) {
  8979. var p = x.editor,
  8980. r = !1,
  8981. y;
  8982. "unfiltered_html" == A && (A = "html", r = !0);
  8983. if (!w.checkReadOnly()) {
  8984. var B = (new CKEDITOR.dom.elementPath(w.startContainer, w.root)).blockLimit ||
  8985. w.root;
  8986. A = {
  8987. type: A,
  8988. dontFilter: r,
  8989. editable: x,
  8990. editor: p,
  8991. range: w,
  8992. blockLimit: B,
  8993. mergeCandidates: [],
  8994. zombies: []
  8995. };
  8996. var r = A.range,
  8997. B = A.mergeCandidates,
  8998. u = "html" === A.type,
  8999. v, S, F, W, K;
  9000. "text" == A.type && r.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (S = CKEDITOR.dom.element
  9001. .createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", r.document), r.insertNode(S), r
  9002. .setStartAfter(S));
  9003. F = new CKEDITOR.dom.elementPath(r.startContainer);
  9004. A.endPath = W = new CKEDITOR.dom.elementPath(r.endContainer);
  9005. if (!r.collapsed) {
  9006. v = W.block || W.blockLimit;
  9007. var Z = r.getCommonAncestor();
  9008. v && !v.equals(Z) && !v.contains(Z) && r.checkEndOfBlock() && A.zombies.push(v);
  9009. r.deleteContents()
  9010. }
  9011. for (;
  9012. (K = e(r)) && a(K) && K.isBlockBoundary() && F.contains(K);) r.moveToPosition(K, CKEDITOR
  9013. .POSITION_BEFORE_END);
  9014. h(r, A.blockLimit, F, W);
  9015. S && (r.setEndBefore(S), r.collapse(), S.remove());
  9016. S = r.startPath();
  9017. if (v = S.contains(g, !1, 1)) y = r.splitElement(v), A.inlineStylesRoot = v, A.inlineStylesPeak = S
  9018. .lastElement;
  9019. S = r.createBookmark();
  9020. u && (f(v), f(y));
  9021. (v = S.startNode.getPrevious(c)) && a(v) && g(v) && B.push(v);
  9022. (v = S.startNode.getNext(c)) && a(v) &&
  9023. g(v) && B.push(v);
  9024. for (v = S.startNode;
  9025. (v = v.getParent()) && g(v);) B.push(v);
  9026. r.moveToBookmark(S);
  9027. y = x.getHtml();
  9028. y = "" === y || y.match(L);
  9029. p.enterMode === CKEDITOR.ENTER_DIV && y && ((p = x.getFirst()) && p.remove(), w.setStartAt(x, CKEDITOR
  9030. .POSITION_AFTER_START), w.collapse(!0));
  9031. if (x = Q) {
  9032. x = A.range;
  9033. if ("text" == A.type && A.inlineStylesRoot) {
  9034. w = A.inlineStylesPeak;
  9035. p = w.getDocument().createText("{cke-peak}");
  9036. for (y = A.inlineStylesRoot.getParent(); !w.equals(y);) p = p.appendTo(w.clone()), w = w
  9037. .getParent();
  9038. Q = p.getOuterHtml().split("{cke-peak}").join(Q)
  9039. }
  9040. w =
  9041. A.blockLimit.getName();
  9042. if (/^\s+|\s+$/.test(Q) && "span" in CKEDITOR.dtd[w]) {
  9043. var J = '\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';
  9044. Q = J + Q + J
  9045. }
  9046. Q = A.editor.dataProcessor.toHtml(Q, {
  9047. context: null,
  9048. fixForBody: !1,
  9049. protectedWhitespaces: !!J,
  9050. dontFilter: A.dontFilter,
  9051. filter: A.editor.activeFilter,
  9052. enterMode: A.editor.activeEnterMode
  9053. });
  9054. w = x.document.createElement("body");
  9055. w.setHtml(Q);
  9056. J && (w.getFirst().remove(), w.getLast().remove());
  9057. if ((J = x.startPath().block) && (1 != J.getChildCount() || !J.getBogus())) a: {
  9058. var P;
  9059. if (1 ==
  9060. w.getChildCount() && a(P = w.getFirst()) && P.is(H) && !P.hasAttribute("contenteditable")) {
  9061. J = P.getElementsByTag("*");
  9062. x = 0;
  9063. for (y = J.count(); x < y; x++)
  9064. if (p = J.getItem(x), !p.is(M)) break a;
  9065. P.moveChildren(P.getParent(1));
  9066. P.remove()
  9067. }
  9068. }
  9069. A.dataWrapper = w;
  9070. x = Q
  9071. }
  9072. if (x) {
  9073. P = A.range;
  9074. x = P.document;
  9075. w = A.blockLimit;
  9076. y = 0;
  9077. var G, J = [],
  9078. ca, O;
  9079. Q = S = 0;
  9080. var U, p = P.startContainer;
  9081. K = A.endPath.elements[0];
  9082. var R, r = K.getPosition(p),
  9083. B = !!K.getCommonAncestor(p) && r != CKEDITOR.POSITION_IDENTICAL && !(r & CKEDITOR
  9084. .POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED),
  9085. p = b(A.dataWrapper, A);
  9086. for (A.editor.enterMode !== CKEDITOR.ENTER_BR && k(p, P); y < p.length; y++) {
  9087. r = p[y];
  9088. if (u = r.isLineBreak) u = P, v = w, W = F = void 0, r.hasBlockSibling ? u = 1 : (F = u
  9089. .startContainer.getAscendant(m.$block, 1)) && F.is({
  9090. div: 1,
  9091. p: 1
  9092. }) ? (W = F.getPosition(v), W == CKEDITOR.POSITION_IDENTICAL || W == CKEDITOR
  9093. .POSITION_CONTAINS ? u = 0 : (v = u.splitElement(F), u.moveToPosition(v, CKEDITOR
  9094. .POSITION_AFTER_START), u = 1)) : u = 0;
  9095. if (u) Q = 0 < y;
  9096. else {
  9097. u = P.startPath();
  9098. !r.isBlock && l(A.editor, u.block, u.blockLimit) && (O = q(A.editor)) && (O = x.createElement(
  9099. O),
  9100. O.appendBogus(), P.insertNode(O), CKEDITOR.env.needsBrFiller && (G = O.getBogus()) && G
  9101. .remove(), P.moveToPosition(O, CKEDITOR.POSITION_BEFORE_END));
  9102. if ((u = P.startPath().block) && !u.equals(ca)) {
  9103. if (G = u.getBogus()) G.remove(), J.push(u);
  9104. ca = u
  9105. }
  9106. r.firstNotAllowed && (S = 1);
  9107. if (S && r.isElement) {
  9108. u = P.startContainer;
  9109. for (v = null; u && !m[u.getName()][r.name];) {
  9110. if (u.equals(w)) {
  9111. u = null;
  9112. break
  9113. }
  9114. v = u;
  9115. u = u.getParent()
  9116. }
  9117. if (u) v && (U = P.splitElement(v), A.zombies.push(U), A.zombies.push(v));
  9118. else {
  9119. v = w.getName();
  9120. R = !y;
  9121. u = y == p.length - 1;
  9122. v = d(r.node, v);
  9123. F = [];
  9124. W = v.length;
  9125. for (var Z = 0, Y = void 0, da = 0, fa = -1; Z < W; Z++) Y = v[Z], " " == Y ? (da || R && !
  9126. Z || (F.push(new CKEDITOR.dom.text(" ")), fa = F.length), da = 1) : (F.push(Y), da = 0);
  9127. u && fa == F.length && F.pop();
  9128. R = F
  9129. }
  9130. }
  9131. if (R) {
  9132. for (; u = R.pop();) P.insertNode(u);
  9133. R = 0
  9134. } else P.insertNode(r.node);
  9135. r.lastNotAllowed && y < p.length - 1 && ((U = B ? K : U) && P.setEndAt(U, CKEDITOR
  9136. .POSITION_AFTER_START), S = 0);
  9137. P.collapse()
  9138. }
  9139. }
  9140. 1 != p.length ? G = !1 : (G = p[0], G = G.isElement && "false" == G.node.getAttribute(
  9141. "contenteditable"));
  9142. G && (Q = !0, u = p[0].node, P.setStartAt(u, CKEDITOR.POSITION_BEFORE_START),
  9143. P.setEndAt(u, CKEDITOR.POSITION_AFTER_END));
  9144. A.dontMoveCaret = Q;
  9145. A.bogusNeededBlocks = J
  9146. }
  9147. G = A.range;
  9148. var ba;
  9149. R = A.bogusNeededBlocks;
  9150. for (ca = G.createBookmark(); O = A.zombies.pop();) O.getParent() && (U = G.clone(), U
  9151. .moveToElementEditStart(O), U.removeEmptyBlocksAtEnd());
  9152. if (R)
  9153. for (; O = R.pop();) CKEDITOR.env.needsBrFiller ? O.appendBogus() : O.append(G.document.createText(
  9154. " "));
  9155. for (; O = A.mergeCandidates.pop();) O.mergeSiblings();
  9156. CKEDITOR.env.webkit && G.startPath() && (O = G.startPath(), O.block ? O.block.$.normalize() : O
  9157. .blockLimit && O.blockLimit.$.normalize());
  9158. G.moveToBookmark(ca);
  9159. if (!A.dontMoveCaret) {
  9160. for (O = e(G); O && a(O) && !O.is(m.$empty);) {
  9161. if (O.isBlockBoundary()) G.moveToPosition(O, CKEDITOR.POSITION_BEFORE_END);
  9162. else {
  9163. if (g(O) && O.getHtml().match(/(\s|&nbsp;)$/g)) {
  9164. ba = null;
  9165. break
  9166. }
  9167. ba = G.clone();
  9168. ba.moveToPosition(O, CKEDITOR.POSITION_BEFORE_END)
  9169. }
  9170. O = O.getLast(c)
  9171. }
  9172. ba && G.moveToRange(ba)
  9173. }
  9174. }
  9175. }
  9176. }();
  9177. J = function() {
  9178. function a(b) {
  9179. b = new CKEDITOR.dom.walker(b);
  9180. b.guard = function(a, b) {
  9181. if (b) return !1;
  9182. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent)
  9183. };
  9184. b.evaluator = function(a) {
  9185. return a.type ==
  9186. CKEDITOR.NODE_ELEMENT
  9187. };
  9188. return b
  9189. }
  9190. function b(a, c, d) {
  9191. c = a.getDocument().createElement(c);
  9192. a.append(c, d);
  9193. return c
  9194. }
  9195. function c(a) {
  9196. var b = a.count(),
  9197. d;
  9198. for (b; 0 < b--;) d = a.getItem(b), CKEDITOR.tools.trim(d.getHtml()) || (d.appendBogus(), CKEDITOR.env
  9199. .ie && 9 > CKEDITOR.env.version && d.getChildCount() && d.getFirst().remove())
  9200. }
  9201. return function(d) {
  9202. var e = d.startContainer,
  9203. f = e.getAscendant("table", 1),
  9204. g = !1;
  9205. c(f.getElementsByTag("td"));
  9206. c(f.getElementsByTag("th"));
  9207. f = d.clone();
  9208. f.setStart(e, 0);
  9209. f = a(f).lastBackward();
  9210. f || (f = d.clone(), f.setEndAt(e,
  9211. CKEDITOR.POSITION_BEFORE_END), f = a(f).lastForward(), g = !0);
  9212. f || (f = e);
  9213. f.is("table") ? (d.setStartAt(f, CKEDITOR.POSITION_BEFORE_START), d.collapse(!0), f.remove()) : (f.is({
  9214. tbody: 1,
  9215. thead: 1,
  9216. tfoot: 1
  9217. }) && (f = b(f, "tr", g)), f.is("tr") && (f = b(f, f.getParent().is("thead") ? "th" : "td", g)), (
  9218. e = f.getBogus()) && e.remove(), d.moveToPosition(f, g ? CKEDITOR.POSITION_AFTER_START : CKEDITOR
  9219. .POSITION_BEFORE_END))
  9220. }
  9221. }();
  9222. G = function() {
  9223. function a(b) {
  9224. b = new CKEDITOR.dom.walker(b);
  9225. b.guard = function(a, b) {
  9226. if (b) return !1;
  9227. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$list) ||
  9228. a.is(CKEDITOR.dtd.$listItem)
  9229. };
  9230. b.evaluator = function(a) {
  9231. return a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$listItem)
  9232. };
  9233. return b
  9234. }
  9235. return function(b) {
  9236. var c = b.startContainer,
  9237. d = !1,
  9238. e;
  9239. e = b.clone();
  9240. e.setStart(c, 0);
  9241. e = a(e).lastBackward();
  9242. e || (e = b.clone(), e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END), e = a(e).lastForward(), d = !0);
  9243. e || (e = c);
  9244. e.is(CKEDITOR.dtd.$list) ? (b.setStartAt(e, CKEDITOR.POSITION_BEFORE_START), b.collapse(!0), e
  9245. .remove()) : ((c = e.getBogus()) && c.remove(), b.moveToPosition(e, d ? CKEDITOR.POSITION_AFTER_START :
  9246. CKEDITOR.POSITION_BEFORE_END), b.select())
  9247. }
  9248. }();
  9249. p = {
  9250. eol: {
  9251. detect: function(a, b) {
  9252. var c = a.range,
  9253. d = c.clone(),
  9254. e = c.clone(),
  9255. f = new CKEDITOR.dom.elementPath(c.startContainer, b),
  9256. g = new CKEDITOR.dom.elementPath(c.endContainer, b);
  9257. d.collapse(1);
  9258. e.collapse();
  9259. f.block && d.checkBoundaryOfElement(f.block, CKEDITOR.END) && (c.setStartAfter(f.block), a
  9260. .prependEolBr = 1);
  9261. g.block && e.checkBoundaryOfElement(g.block, CKEDITOR.START) && (c.setEndBefore(g.block), a
  9262. .appendEolBr = 1)
  9263. },
  9264. fix: function(a, b) {
  9265. var c = b.getDocument(),
  9266. d;
  9267. a.appendEolBr && (d =
  9268. this.createEolBr(c), a.fragment.append(d));
  9269. !a.prependEolBr || d && !d.getPrevious() || a.fragment.append(this.createEolBr(c), 1)
  9270. },
  9271. createEolBr: function(a) {
  9272. return a.createElement("br", {
  9273. attributes: {
  9274. "data-cke-eol": 1
  9275. }
  9276. })
  9277. }
  9278. },
  9279. bogus: {
  9280. exclude: function(a) {
  9281. var b = a.range.getBoundaryNodes(),
  9282. c = b.startNode,
  9283. b = b.endNode;
  9284. !b || !m(b) || c && c.equals(b) || a.range.setEndBefore(b)
  9285. }
  9286. },
  9287. tree: {
  9288. rebuild: function(a, b) {
  9289. var c = a.range,
  9290. d = c.getCommonAncestor(),
  9291. e = new CKEDITOR.dom.elementPath(d, b),
  9292. f = new CKEDITOR.dom.elementPath(c.startContainer, b),
  9293. c = new CKEDITOR.dom.elementPath(c.endContainer, b),
  9294. g;
  9295. d.type == CKEDITOR.NODE_TEXT && (d = d.getParent());
  9296. if (e.blockLimit.is({
  9297. tr: 1,
  9298. table: 1
  9299. })) {
  9300. var h = e.contains("table").getParent();
  9301. g = function(a) {
  9302. return !a.equals(h)
  9303. }
  9304. } else if (e.block && e.block.is(CKEDITOR.dtd.$listItem) && (f = f.contains(CKEDITOR.dtd.$list), c = c
  9305. .contains(CKEDITOR.dtd.$list), !f.equals(c))) {
  9306. var k = e.contains(CKEDITOR.dtd.$list).getParent();
  9307. g = function(a) {
  9308. return !a.equals(k)
  9309. }
  9310. }
  9311. g || (g = function(a) {
  9312. return !a.equals(e.block) && !a.equals(e.blockLimit)
  9313. });
  9314. this.rebuildFragment(a,
  9315. b, d, g)
  9316. },
  9317. rebuildFragment: function(a, b, c, d) {
  9318. for (var e; c && !c.equals(b) && d(c);) e = c.clone(0, 1), a.fragment.appendTo(e), a.fragment = e, c =
  9319. c.getParent()
  9320. }
  9321. },
  9322. cell: {
  9323. shrink: function(a) {
  9324. a = a.range;
  9325. var b = a.startContainer,
  9326. c = a.endContainer,
  9327. d = a.startOffset,
  9328. e = a.endOffset;
  9329. b.type == CKEDITOR.NODE_ELEMENT && b.equals(c) && b.is("tr") && ++d == e && a.shrink(CKEDITOR
  9330. .SHRINK_TEXT)
  9331. }
  9332. }
  9333. };
  9334. u = function() {
  9335. function a(b, c) {
  9336. var d = b.getParent();
  9337. if (d.is(CKEDITOR.dtd.$inline)) b[c ? "insertBefore" : "insertAfter"](d)
  9338. }
  9339. function b(c, d, e) {
  9340. a(d);
  9341. a(e, 1);
  9342. for (var f; f =
  9343. e.getNext();) f.insertAfter(d), d = f;
  9344. r(c) && c.remove()
  9345. }
  9346. function c(a, b) {
  9347. var d = new CKEDITOR.dom.range(a);
  9348. d.setStartAfter(b.startNode);
  9349. d.setEndBefore(b.endNode);
  9350. return d
  9351. }
  9352. return {
  9353. list: {
  9354. detectMerge: function(a, b) {
  9355. var d = c(b, a.bookmark),
  9356. e = d.startPath(),
  9357. f = d.endPath(),
  9358. g = e.contains(CKEDITOR.dtd.$list),
  9359. h = f.contains(CKEDITOR.dtd.$list);
  9360. a.mergeList = g && h && g.getParent().equals(h.getParent()) && !g.equals(h);
  9361. a.mergeListItems = e.block && f.block && e.block.is(CKEDITOR.dtd.$listItem) && f.block.is(CKEDITOR
  9362. .dtd.$listItem);
  9363. if (a.mergeList ||
  9364. a.mergeListItems) d = d.clone(), d.setStartBefore(a.bookmark.startNode), d.setEndAfter(a.bookmark
  9365. .endNode), a.mergeListBookmark = d.createBookmark()
  9366. },
  9367. merge: function(a, c) {
  9368. if (a.mergeListBookmark) {
  9369. var d = a.mergeListBookmark.startNode,
  9370. e = a.mergeListBookmark.endNode,
  9371. f = new CKEDITOR.dom.elementPath(d, c),
  9372. g = new CKEDITOR.dom.elementPath(e, c);
  9373. if (a.mergeList) {
  9374. var h = f.contains(CKEDITOR.dtd.$list),
  9375. k = g.contains(CKEDITOR.dtd.$list);
  9376. h.equals(k) || (k.moveChildren(h), k.remove())
  9377. }
  9378. a.mergeListItems && (f = f.contains(CKEDITOR.dtd.$listItem),
  9379. g = g.contains(CKEDITOR.dtd.$listItem), f.equals(g) || b(g, d, e));
  9380. d.remove();
  9381. e.remove()
  9382. }
  9383. }
  9384. },
  9385. block: {
  9386. detectMerge: function(a, b) {
  9387. if (!a.tableContentsRanges && !a.mergeListBookmark) {
  9388. var c = new CKEDITOR.dom.range(b);
  9389. c.setStartBefore(a.bookmark.startNode);
  9390. c.setEndAfter(a.bookmark.endNode);
  9391. a.mergeBlockBookmark = c.createBookmark()
  9392. }
  9393. },
  9394. merge: function(a, c) {
  9395. if (a.mergeBlockBookmark && !a.purgeTableBookmark) {
  9396. var d = a.mergeBlockBookmark.startNode,
  9397. e = a.mergeBlockBookmark.endNode,
  9398. f = new CKEDITOR.dom.elementPath(d, c),
  9399. g = new CKEDITOR.dom.elementPath(e,
  9400. c),
  9401. f = f.block,
  9402. g = g.block;
  9403. f && g && !f.equals(g) && b(g, d, e);
  9404. d.remove();
  9405. e.remove()
  9406. }
  9407. }
  9408. },
  9409. table: function() {
  9410. function a(c) {
  9411. var e = [],
  9412. f, g = new CKEDITOR.dom.walker(c),
  9413. h = c.startPath().contains(d),
  9414. k = c.endPath().contains(d),
  9415. t = {};
  9416. g.guard = function(a, g) {
  9417. if (a.type == CKEDITOR.NODE_ELEMENT) {
  9418. var H = "visited_" + (g ? "out" : "in");
  9419. if (a.getCustomData(H)) return;
  9420. CKEDITOR.dom.element.setMarker(t, a, H, 1)
  9421. }
  9422. if (g && h && a.equals(h)) f = c.clone(), f.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), e.push(
  9423. f);
  9424. else if (!g && k && a.equals(k)) f = c.clone(), f.setStartAt(k,
  9425. CKEDITOR.POSITION_AFTER_START), e.push(f);
  9426. else {
  9427. if (H = !g) H = a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && (!h || b(a, h)) && (!k || b(a,
  9428. k));
  9429. if (!H && (H = g))
  9430. if (a.is(d)) var H = h && h.getAscendant("table", !0),
  9431. D = k && k.getAscendant("table", !0),
  9432. l = a.getAscendant("table", !0),
  9433. H = H && H.contains(l) || D && D.contains(l);
  9434. else H = void 0;
  9435. H && (f = c.clone(), f.selectNodeContents(a), e.push(f))
  9436. }
  9437. };
  9438. g.lastForward();
  9439. CKEDITOR.dom.element.clearAllMarkers(t);
  9440. return e
  9441. }
  9442. function b(a, c) {
  9443. var d = CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED,
  9444. e = a.getPosition(c);
  9445. return e === CKEDITOR.POSITION_IDENTICAL ? !1 : 0 === (e & d)
  9446. }
  9447. var d = {
  9448. td: 1,
  9449. th: 1,
  9450. caption: 1
  9451. };
  9452. return {
  9453. detectPurge: function(a) {
  9454. var b = a.range,
  9455. c = b.clone();
  9456. c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  9457. var c = new CKEDITOR.dom.walker(c),
  9458. e = 0;
  9459. c.evaluator = function(a) {
  9460. a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && ++e
  9461. };
  9462. c.checkForward();
  9463. if (1 < e) {
  9464. var c = b.startPath().contains("table"),
  9465. f = b.endPath().contains("table");
  9466. c && f && b.checkBoundaryOfElement(c, CKEDITOR.START) && b.checkBoundaryOfElement(f, CKEDITOR
  9467. .END) && (b = a.range.clone(), b.setStartBefore(c),
  9468. b.setEndAfter(f), a.purgeTableBookmark = b.createBookmark())
  9469. }
  9470. },
  9471. detectRanges: function(e, f) {
  9472. var g = c(f, e.bookmark),
  9473. h = g.clone(),
  9474. k, n, l = g.getCommonAncestor();
  9475. l.is(CKEDITOR.dtd.$tableContent) && !l.is(d) && (l = l.getAscendant("table", !0));
  9476. n = l;
  9477. l = new CKEDITOR.dom.elementPath(g.startContainer, n);
  9478. n = new CKEDITOR.dom.elementPath(g.endContainer, n);
  9479. l = l.contains("table");
  9480. n = n.contains("table");
  9481. if (l || n) l && n && b(l, n) ? (e.tableSurroundingRange = h, h.setStartAt(l, CKEDITOR
  9482. .POSITION_AFTER_END), h.setEndAt(n, CKEDITOR.POSITION_BEFORE_START),
  9483. h = g.clone(), h.setEndAt(l, CKEDITOR.POSITION_AFTER_END), k = g.clone(), k.setStartAt(n,
  9484. CKEDITOR.POSITION_BEFORE_START), k = a(h).concat(a(k))) : l ? n || (e
  9485. .tableSurroundingRange = h, h.setStartAt(l, CKEDITOR.POSITION_AFTER_END), g.setEndAt(l,
  9486. CKEDITOR.POSITION_AFTER_END)) : (e.tableSurroundingRange = h, h.setEndAt(n, CKEDITOR
  9487. .POSITION_BEFORE_START), g.setStartAt(n, CKEDITOR.POSITION_AFTER_START)), e
  9488. .tableContentsRanges = k ? k : a(g)
  9489. },
  9490. deleteRanges: function(a) {
  9491. for (var b; b = a.tableContentsRanges.pop();) b.extractContents(), r(b.startContainer) &&
  9492. b.startContainer.appendBogus();
  9493. a.tableSurroundingRange && a.tableSurroundingRange.extractContents()
  9494. },
  9495. purge: function(a) {
  9496. if (a.purgeTableBookmark) {
  9497. var b = a.doc,
  9498. c = a.range.clone(),
  9499. b = b.createElement("p");
  9500. b.insertBefore(a.purgeTableBookmark.startNode);
  9501. c.moveToBookmark(a.purgeTableBookmark);
  9502. c.deleteContents();
  9503. a.range.moveToPosition(b, CKEDITOR.POSITION_AFTER_START)
  9504. }
  9505. }
  9506. }
  9507. }(),
  9508. detectExtractMerge: function(a) {
  9509. return !(a.range.startPath().contains(CKEDITOR.dtd.$listItem) && a.range.endPath().contains(CKEDITOR
  9510. .dtd.$listItem))
  9511. },
  9512. fixUneditableRangePosition: function(a) {
  9513. a.startContainer.getDtd()["#"] || a.moveToClosestEditablePosition(null, !0)
  9514. },
  9515. autoParagraph: function(a, b) {
  9516. var c = b.startPath(),
  9517. d;
  9518. l(a, c.block, c.blockLimit) && (d = q(a)) && (d = b.document.createElement(d), d.appendBogus(), b
  9519. .insertNode(d), b.moveToPosition(d, CKEDITOR.POSITION_AFTER_START))
  9520. }
  9521. }
  9522. }()
  9523. })();
  9524. (function() {
  9525. function a(a) {
  9526. return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a)
  9527. }
  9528. function d(b, c) {
  9529. if (0 === b.length || a(b[0].getEnclosedNode())) return !1;
  9530. var d, e;
  9531. if ((d = !c && 1 === b.length) && !(d = b[0].collapsed)) {
  9532. var f = b[0];
  9533. d = f.startContainer.getAscendant({
  9534. td: 1,
  9535. th: 1
  9536. }, !0);
  9537. var g = f.endContainer.getAscendant({
  9538. td: 1,
  9539. th: 1
  9540. }, !0);
  9541. e = CKEDITOR.tools.trim;
  9542. d && d.equals(g) && !d.findOne("td, th, tr, tbody, table") ? (f = f.cloneContents(), d = f.getFirst() ? e(f
  9543. .getFirst().getText()) !== e(d.getText()) : !0) : d = !1
  9544. }
  9545. if (d) return !1;
  9546. for (e = 0; e < b.length; e++)
  9547. if (d = b[e]._getTableElement(), !d) return !1;
  9548. return !0
  9549. }
  9550. function b(a) {
  9551. function b(a) {
  9552. a = a.find("td, th");
  9553. var c = [],
  9554. d;
  9555. for (d = 0; d < a.count(); d++) c.push(a.getItem(d));
  9556. return c
  9557. }
  9558. var c = [],
  9559. d, e;
  9560. for (e = 0; e < a.length; e++) d = a[e]._getTableElement(), d.is && d.is({
  9561. td: 1,
  9562. th: 1
  9563. }) ? c.push(d) : c = c.concat(b(d));
  9564. return c
  9565. }
  9566. function c(a) {
  9567. a = b(a);
  9568. var c = "",
  9569. d = [],
  9570. e, f;
  9571. for (f = 0; f < a.length; f++) e && !e.equals(a[f].getAscendant("tr")) ? (c += d.join("\t") + "\n", e = a[f]
  9572. .getAscendant("tr"), d = []) : 0 === f && (e = a[f].getAscendant("tr")), d.push(a[f].getText());
  9573. return c += d.join("\t")
  9574. }
  9575. function g(a) {
  9576. var b = this.root.editor,
  9577. d = b.getSelection(1);
  9578. this.reset();
  9579. G = !0;
  9580. d.root.once("selectionchange", function(a) {
  9581. a.cancel()
  9582. }, null, null, 0);
  9583. d.selectRanges([a[0]]);
  9584. d = this._.cache;
  9585. d.ranges = new CKEDITOR.dom.rangeList(a);
  9586. d.type = CKEDITOR.SELECTION_TEXT;
  9587. d.selectedElement = a[0]._getTableElement();
  9588. d.selectedText = c(a);
  9589. d.nativeSel = null;
  9590. this.isFake = 1;
  9591. this.rev = L++;
  9592. b._.fakeSelection = this;
  9593. G = !1;
  9594. this.root.fire("selectionchange")
  9595. }
  9596. function e() {
  9597. var b = this._.fakeSelection,
  9598. c;
  9599. if (b) {
  9600. c = this.getSelection(1);
  9601. var e;
  9602. if (!(e = !c) && (e = !c.isHidden())) {
  9603. e = b;
  9604. var f = c.getRanges(),
  9605. g = e.getRanges(),
  9606. h = f.length && f[0]._getTableElement() && f[0]._getTableElement().getAscendant("table", !0),
  9607. k = g.length && g[0]._getTableElement() && g[0]._getTableElement().getAscendant("table", !0),
  9608. l = 1 === f.length && f[0]._getTableElement() && f[0]._getTableElement().is("table"),
  9609. M = 1 === g.length && g[0]._getTableElement() && g[0]._getTableElement().is("table");
  9610. if (a(e.getSelectedElement())) e = !1;
  9611. else {
  9612. var n = 1 === f.length && f[0].collapsed,
  9613. g = d(f, !!CKEDITOR.env.webkit) &&
  9614. d(g);
  9615. h = h && k ? h.equals(k) || k.contains(h) : !1;
  9616. h && (n || g) ? (l && !M && e.selectRanges(f), e = !0) : e = !1
  9617. }
  9618. e = !e
  9619. }
  9620. e && (b.reset(), b = 0)
  9621. }
  9622. if (!b && (b = c || this.getSelection(1), !b || b.getType() == CKEDITOR.SELECTION_NONE)) return;
  9623. this.fire("selectionCheck", b);
  9624. c = this.elementPath();
  9625. c.compare(this._.selectionPreviousPath) || (e = this._.selectionPreviousPath && this._.selectionPreviousPath
  9626. .blockLimit.equals(c.blockLimit), !CKEDITOR.env.webkit && !CKEDITOR.env.gecko || e || (this._
  9627. .previousActive = this.document.getActive()), this._.selectionPreviousPath =
  9628. c, this.fire("selectionChange", {
  9629. selection: b,
  9630. path: c
  9631. }))
  9632. }
  9633. function h() {
  9634. u = !0;
  9635. p || (k.call(this), p = CKEDITOR.tools.setTimeout(k, 200, this))
  9636. }
  9637. function k() {
  9638. p = null;
  9639. u && (CKEDITOR.tools.setTimeout(e, 0, this), u = !1)
  9640. }
  9641. function l(a) {
  9642. return K(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? !0 : !1
  9643. }
  9644. function q(a) {
  9645. function b(c, d) {
  9646. return c && c.type != CKEDITOR.NODE_TEXT ? a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c) : !1
  9647. }
  9648. if (!(a.root instanceof CKEDITOR.editable)) return !1;
  9649. var c = a.startContainer,
  9650. d = a.getPreviousNode(l,
  9651. null, c),
  9652. e = a.getNextNode(l, null, c);
  9653. return b(d) || b(e, 1) || !(d || e || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c
  9654. .getBogus()) ? !0 : !1
  9655. }
  9656. function f(a) {
  9657. w(a, !1);
  9658. var b = a.getDocument().createText(v);
  9659. a.setCustomData("cke-fillingChar", b);
  9660. return b
  9661. }
  9662. function w(a, b) {
  9663. var c = a && a.removeCustomData("cke-fillingChar");
  9664. if (c) {
  9665. if (!1 !== b) {
  9666. var d = a.getDocument().getSelection().getNative(),
  9667. e = d && "None" != d.type && d.getRangeAt(0),
  9668. f = v.length;
  9669. if (c.getLength() > f && e && e.intersectsNode(c.$)) {
  9670. var g = [{
  9671. node: d.anchorNode,
  9672. offset: d.anchorOffset
  9673. },
  9674. {
  9675. node: d.focusNode,
  9676. offset: d.focusOffset
  9677. }
  9678. ];
  9679. d.anchorNode == c.$ && d.anchorOffset > f && (g[0].offset -= f);
  9680. d.focusNode == c.$ && d.focusOffset > f && (g[1].offset -= f)
  9681. }
  9682. }
  9683. c.setText(B(c.getText(), 1));
  9684. g && (c = a.getDocument().$, d = c.getSelection(), c = c.createRange(), c.setStart(g[0].node, g[0].offset),
  9685. c.collapse(!0), d.removeAllRanges(), d.addRange(c), d.extend(g[1].node, g[1].offset))
  9686. }
  9687. }
  9688. function B(a, b) {
  9689. return b ? a.replace(J, function(a, b) {
  9690. return b ? " " : ""
  9691. }) : a.replace(v, "")
  9692. }
  9693. function y(a, b) {
  9694. var c = b && CKEDITOR.tools.htmlEncode(b) || "\x26nbsp;",
  9695. c = CKEDITOR.dom.element.createFromHtml(
  9696. '\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"' + (CKEDITOR.env.ie && 14 > CKEDITOR
  9697. .env.version ? "display:none" : "position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;") +
  9698. '"\x3e' + c + "\x3c/div\x3e", a.document);
  9699. a.fire("lockSnapshot");
  9700. a.editable().append(c);
  9701. var d = a.getSelection(1),
  9702. e = a.createRange(),
  9703. f = d.root.on("selectionchange", function(a) {
  9704. a.cancel()
  9705. }, null, null, 0);
  9706. e.setStartAt(c, CKEDITOR.POSITION_AFTER_START);
  9707. e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  9708. d.selectRanges([e]);
  9709. f.removeListener();
  9710. a.fire("unlockSnapshot");
  9711. a._.hiddenSelectionContainer = c
  9712. }
  9713. function F(b) {
  9714. var c = {
  9715. 37: 1,
  9716. 39: 1,
  9717. 8: 1,
  9718. 46: 1
  9719. };
  9720. return function(d) {
  9721. var e = d.data.getKeystroke();
  9722. if (c[e]) {
  9723. var f = b.getSelection(),
  9724. g = f.getRanges()[0];
  9725. f.isCollapsed() && (g = g[38 > e ? "getPreviousEditableNode" : "getNextEditableNode"]()) && g.type ==
  9726. CKEDITOR.NODE_ELEMENT && "false" == g.getAttribute("contenteditable") && (f = f.getStartElement(), !f
  9727. .isBlockBoundary() || "" !== (void 0 === f.$.textContent ? f.$.innerText : f.$.textContent) || a(f
  9728. .getFirst()) ||
  9729. 8 !== e && 46 !== e || (f.remove(), b.fire("saveSnapshot")), b.getSelection().fake(g), d.data
  9730. .preventDefault(), d.cancel())
  9731. }
  9732. }
  9733. }
  9734. function r(a) {
  9735. for (var b = 0; b < a.length; b++) {
  9736. var c = a[b];
  9737. c.getCommonAncestor().isReadOnly() && a.splice(b, 1);
  9738. if (!c.collapsed) {
  9739. if (c.startContainer.isReadOnly())
  9740. for (var d = c.startContainer, e; d && !((e = d.type == CKEDITOR.NODE_ELEMENT) && d.is("body") || !d
  9741. .isReadOnly());) e && "false" == d.getAttribute("contentEditable") && c.setStartAfter(d), d = d
  9742. .getParent();
  9743. d = c.startContainer;
  9744. e = c.endContainer;
  9745. var f = c.startOffset,
  9746. g = c.endOffset,
  9747. h = c.clone();
  9748. d && d.type == CKEDITOR.NODE_TEXT && (f >= d.getLength() ? h.setStartAfter(d) : h.setStartBefore(d));
  9749. e && e.type == CKEDITOR.NODE_TEXT && (g ? h.setEndAfter(e) : h.setEndBefore(e));
  9750. d = new CKEDITOR.dom.walker(h);
  9751. d.evaluator = function(d) {
  9752. if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) {
  9753. var e = c.clone();
  9754. c.setEndBefore(d);
  9755. c.collapsed && a.splice(b--, 1);
  9756. d.getPosition(h.endContainer) & CKEDITOR.POSITION_CONTAINS || (e.setStartAfter(d), e.collapsed || a
  9757. .splice(b + 1, 0, e));
  9758. return !0
  9759. }
  9760. return !1
  9761. };
  9762. d.next()
  9763. }
  9764. }
  9765. return a
  9766. }
  9767. var m =
  9768. "function" != typeof window.getSelection,
  9769. L = 1,
  9770. v = CKEDITOR.tools.repeat("​", 7),
  9771. J = new RegExp(v + "( )?", "g"),
  9772. G, p, u, K = CKEDITOR.dom.walker.invisible(1),
  9773. E = function() {
  9774. function a(b) {
  9775. return function(a) {
  9776. var c = a.editor.createRange();
  9777. c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
  9778. return !1
  9779. }
  9780. }
  9781. function b(a) {
  9782. return function(b) {
  9783. var c = b.editor,
  9784. d = c.createRange(),
  9785. e;
  9786. if (!c.readOnly) return (e = d.moveToClosestEditablePosition(b.selected, a)) || (e = d
  9787. .moveToClosestEditablePosition(b.selected,
  9788. !a)), e && c.getSelection().selectRanges([d]), c.fire("saveSnapshot"), b.selected.remove(),
  9789. e || (d.moveToElementEditablePosition(c.editable()), c.getSelection().selectRanges([d])), c.fire(
  9790. "saveSnapshot"), !1
  9791. }
  9792. }
  9793. var c = a(),
  9794. d = a(1);
  9795. return {
  9796. 37: c,
  9797. 38: c,
  9798. 39: d,
  9799. 40: d,
  9800. 8: b(),
  9801. 46: b(1)
  9802. }
  9803. }();
  9804. CKEDITOR.on("instanceCreated", function(a) {
  9805. function b() {
  9806. var a = c.getSelection();
  9807. a && a.removeAllRanges()
  9808. }
  9809. var c = a.editor;
  9810. c.on("contentDom", function() {
  9811. function a() {
  9812. p = new CKEDITOR.dom.selection(c.getSelection());
  9813. p.lock()
  9814. }
  9815. function b() {
  9816. k.removeListener("mouseup",
  9817. b);
  9818. l.removeListener("mouseup", b);
  9819. var a = CKEDITOR.document.$.selection,
  9820. c = a.createRange();
  9821. "None" != a.type && c.parentElement() && c.parentElement().ownerDocument == g.$ && c.select()
  9822. }
  9823. function d(a) {
  9824. var b, c;
  9825. b = (b = this.document.getActive()) ? "input" === b.getName() || "textarea" === b.getName() : !1;
  9826. b || (b = this.getSelection(1), (c = f(b)) && !c.equals(n) && (b.selectElement(c), a.data
  9827. .preventDefault()))
  9828. }
  9829. function f(a) {
  9830. a = a.getRanges()[0];
  9831. return a ? (a = a.startContainer.getAscendant(function(a) {
  9832. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable")
  9833. },
  9834. !0)) && "false" === a.getAttribute("contenteditable") ? a : null : null
  9835. }
  9836. var g = c.document,
  9837. k = CKEDITOR.document,
  9838. n = c.editable(),
  9839. t = g.getBody(),
  9840. l = g.getDocumentElement(),
  9841. q = n.isInline(),
  9842. D, p;
  9843. CKEDITOR.env.gecko && n.attachListener(n, "focus", function(a) {
  9844. a.removeListener();
  9845. 0 !== D && (a = c.getSelection().getNative()) && a.isCollapsed && a.anchorNode == n.$ && (a =
  9846. c.createRange(), a.moveToElementEditStart(n), a.select())
  9847. }, null, null, -2);
  9848. n.attachListener(n, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? "focusin" : "focus", function() {
  9849. if (D && (CKEDITOR.env.webkit ||
  9850. CKEDITOR.env.gecko)) {
  9851. D = c._.previousActive && c._.previousActive.equals(g.getActive());
  9852. var a = null != c._.previousScrollTop && c._.previousScrollTop != n.$.scrollTop;
  9853. CKEDITOR.env.webkit && D && a && (n.$.scrollTop = c._.previousScrollTop)
  9854. }
  9855. c.unlockSelection(D);
  9856. D = 0
  9857. }, null, null, -1);
  9858. n.attachListener(n, "mousedown", function() {
  9859. D = 0
  9860. });
  9861. if (CKEDITOR.env.ie || CKEDITOR.env.gecko || q) m ? n.attachListener(n, "beforedeactivate", a, null,
  9862. null, -1) : n.attachListener(c, "selectionCheck", a, null, null, -1), n.attachListener(n,
  9863. CKEDITOR.env.webkit || CKEDITOR.env.gecko ?
  9864. "focusout" : "blur",
  9865. function() {
  9866. var a = p && (p.isFake || 2 > p.getRanges().length);
  9867. CKEDITOR.env.gecko && !q && a || (c.lockSelection(p), D = 1)
  9868. }, null, null, -1), n.attachListener(n, "mousedown", function() {
  9869. D = 0
  9870. });
  9871. if (CKEDITOR.env.ie && !q) {
  9872. var r;
  9873. n.attachListener(n, "mousedown", function(a) {
  9874. 2 == a.data.$.button && ((a = c.document.getSelection()) && a.getType() != CKEDITOR
  9875. .SELECTION_NONE || (r = c.window.getScrollPosition()))
  9876. });
  9877. n.attachListener(n, "mouseup", function(a) {
  9878. 2 == a.data.$.button && r && (c.document.$.documentElement.scrollLeft = r.x, c.document.$
  9879. .documentElement.scrollTop =
  9880. r.y);
  9881. r = null
  9882. });
  9883. if ("BackCompat" != g.$.compatMode) {
  9884. if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) {
  9885. var u, v;
  9886. l.on("mousedown", function(a) {
  9887. function b(a) {
  9888. a = a.data.$;
  9889. if (u) {
  9890. var c = t.$.createTextRange();
  9891. try {
  9892. c.moveToPoint(a.clientX, a.clientY)
  9893. } catch (d) {}
  9894. u.setEndPoint(0 > v.compareEndPoints("StartToStart", c) ? "EndToEnd" :
  9895. "StartToStart", c);
  9896. u.select()
  9897. }
  9898. }
  9899. function c() {
  9900. l.removeListener("mousemove", b);
  9901. k.removeListener("mouseup", c);
  9902. l.removeListener("mouseup", c);
  9903. u.select()
  9904. }
  9905. a = a.data;
  9906. if (a.getTarget().is("html") && a.$.y < l.$.clientHeight &&
  9907. a.$.x < l.$.clientWidth) {
  9908. u = t.$.createTextRange();
  9909. try {
  9910. u.moveToPoint(a.$.clientX, a.$.clientY)
  9911. } catch (d) {}
  9912. v = u.duplicate();
  9913. l.on("mousemove", b);
  9914. k.on("mouseup", c);
  9915. l.on("mouseup", c)
  9916. }
  9917. })
  9918. }
  9919. if (7 < CKEDITOR.env.version && 11 > CKEDITOR.env.version) l.on("mousedown", function(a) {
  9920. a.data.getTarget().is("html") && (k.on("mouseup", b), l.on("mouseup", b))
  9921. })
  9922. }
  9923. }
  9924. n.attachListener(n, "selectionchange", e, c);
  9925. n.attachListener(n, "keyup", h, c);
  9926. n.attachListener(n, "touchstart", h, c);
  9927. n.attachListener(n, "touchend", h, c);
  9928. CKEDITOR.env.ie && n.attachListener(n,
  9929. "keydown", d, c);
  9930. n.attachListener(n, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? "focusin" : "focus", function() {
  9931. c.forceNextSelectionCheck();
  9932. c.selectionChange(1)
  9933. });
  9934. if (q && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
  9935. var y;
  9936. n.attachListener(n, "mousedown", function() {
  9937. y = 1
  9938. });
  9939. n.attachListener(g.getDocumentElement(), "mouseup", function() {
  9940. y && h.call(c);
  9941. y = 0
  9942. })
  9943. } else n.attachListener(CKEDITOR.env.ie ? n : g.getDocumentElement(), "mouseup", h, c);
  9944. CKEDITOR.env.webkit && n.attachListener(g, "keydown", function(a) {
  9945. switch (a.data.getKey()) {
  9946. case 13:
  9947. case 33:
  9948. case 34:
  9949. case 35:
  9950. case 36:
  9951. case 37:
  9952. case 39:
  9953. case 8:
  9954. case 45:
  9955. case 46:
  9956. n.hasFocus &&
  9957. w(n)
  9958. }
  9959. }, null, null, -1);
  9960. n.attachListener(n, "keydown", F(c), null, null, -1)
  9961. });
  9962. c.on("setData", function() {
  9963. c.unlockSelection();
  9964. CKEDITOR.env.webkit && b()
  9965. });
  9966. c.on("contentDomUnload", function() {
  9967. c.unlockSelection()
  9968. });
  9969. if (CKEDITOR.env.ie9Compat) c.on("beforeDestroy", b, null, null, 9);
  9970. c.on("dataReady", function() {
  9971. delete c._.fakeSelection;
  9972. delete c._.hiddenSelectionContainer;
  9973. c.selectionChange(1)
  9974. });
  9975. c.on("loadSnapshot", function() {
  9976. var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),
  9977. b = c.editable().getLast(a);
  9978. b && b.hasAttribute("data-cke-hidden-sel") &&
  9979. (b.remove(), CKEDITOR.env.gecko && (a = c.editable().getFirst(a)) && a.is("br") && a.getAttribute(
  9980. "_moz_editor_bogus_node") && a.remove())
  9981. }, null, null, 100);
  9982. c.on("key", function(a) {
  9983. if ("wysiwyg" == c.mode) {
  9984. var b = c.getSelection();
  9985. if (b.isFake) {
  9986. var d = E[a.data.keyCode];
  9987. if (d) return d({
  9988. editor: c,
  9989. selected: b.getSelectedElement(),
  9990. selection: b,
  9991. keyEvent: a
  9992. })
  9993. }
  9994. }
  9995. })
  9996. });
  9997. if (CKEDITOR.env.webkit) CKEDITOR.on("instanceReady", function(a) {
  9998. var b = a.editor;
  9999. b.on("selectionChange", function() {
  10000. var a = b.editable(),
  10001. c = a.getCustomData("cke-fillingChar");
  10002. c && (c.getCustomData("ready") ? (w(a), a.editor.fire("selectionCheck")) : c.setCustomData("ready",
  10003. 1))
  10004. }, null, null, -1);
  10005. b.on("beforeSetMode", function() {
  10006. w(b.editable())
  10007. }, null, null, -1);
  10008. b.on("getSnapshot", function(a) {
  10009. a.data && (a.data = B(a.data))
  10010. }, b, null, 20);
  10011. b.on("toDataFormat", function(a) {
  10012. a.data.dataValue = B(a.data.dataValue)
  10013. }, null, null, 0)
  10014. });
  10015. CKEDITOR.editor.prototype.selectionChange = function(a) {
  10016. (a ? e : h).call(this)
  10017. };
  10018. CKEDITOR.editor.prototype.getSelection = function(a) {
  10019. return !this._.savedSelection && !this._.fakeSelection ||
  10020. a ? (a = this.editable()) && "wysiwyg" == this.mode && "recreating" !== this.status ? new CKEDITOR.dom
  10021. .selection(a) : null : this._.savedSelection || this._.fakeSelection
  10022. };
  10023. CKEDITOR.editor.prototype.getSelectedRanges = function(a) {
  10024. var b = this.getSelection();
  10025. return b && b.getRanges(a) || []
  10026. };
  10027. CKEDITOR.editor.prototype.lockSelection = function(a) {
  10028. a = a || this.getSelection(1);
  10029. return a.getType() != CKEDITOR.SELECTION_NONE ? (!a.isLocked && a.lock(), this._.savedSelection = a, !0) : !
  10030. 1
  10031. };
  10032. CKEDITOR.editor.prototype.unlockSelection = function(a) {
  10033. var b =
  10034. this._.savedSelection;
  10035. return b ? (b.unlock(a), delete this._.savedSelection, !0) : !1
  10036. };
  10037. CKEDITOR.editor.prototype.forceNextSelectionCheck = function() {
  10038. delete this._.selectionPreviousPath
  10039. };
  10040. CKEDITOR.dom.document.prototype.getSelection = function() {
  10041. return new CKEDITOR.dom.selection(this)
  10042. };
  10043. CKEDITOR.dom.range.prototype.select = function() {
  10044. var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom
  10045. .selection(this.root);
  10046. a.selectRanges([this]);
  10047. return a
  10048. };
  10049. CKEDITOR.SELECTION_NONE = 1;
  10050. CKEDITOR.SELECTION_TEXT =
  10051. 2;
  10052. CKEDITOR.SELECTION_ELEMENT = 3;
  10053. CKEDITOR.dom.selection = function(a) {
  10054. if (a instanceof CKEDITOR.dom.selection) {
  10055. var b = a;
  10056. a = a.root
  10057. }
  10058. var c = a instanceof CKEDITOR.dom.element;
  10059. this.rev = b ? b.rev : L++;
  10060. this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
  10061. this.root = c ? a : this.document.getBody();
  10062. this.isLocked = 0;
  10063. this._ = {
  10064. cache: {}
  10065. };
  10066. if (b) return CKEDITOR.tools.extend(this._.cache, b._.cache), this.isFake = b.isFake, this.isLocked = b
  10067. .isLocked, this;
  10068. a = this.getNative();
  10069. var d, e;
  10070. if (a)
  10071. if (a.getRangeAt) d = (e = a.rangeCount && a.getRangeAt(0)) &&
  10072. new CKEDITOR.dom.node(e.commonAncestorContainer);
  10073. else {
  10074. try {
  10075. e = a.createRange()
  10076. } catch (f) {}
  10077. d = e && CKEDITOR.dom.element.get(e.item && e.item(0) || e.parentElement())
  10078. } if (!d || d.type != CKEDITOR.NODE_ELEMENT && d.type != CKEDITOR.NODE_TEXT || !this.root.equals(d) && !
  10079. this.root.contains(d)) this._.cache.type = CKEDITOR.SELECTION_NONE, this._.cache.startElement = null, this
  10080. ._.cache.selectedElement = null, this._.cache.selectedText = "", this._.cache.ranges = new CKEDITOR.dom
  10081. .rangeList;
  10082. return this
  10083. };
  10084. var z = {
  10085. img: 1,
  10086. hr: 1,
  10087. li: 1,
  10088. table: 1,
  10089. tr: 1,
  10090. td: 1,
  10091. th: 1,
  10092. embed: 1,
  10093. object: 1,
  10094. ol: 1,
  10095. ul: 1,
  10096. a: 1,
  10097. input: 1,
  10098. form: 1,
  10099. select: 1,
  10100. textarea: 1,
  10101. button: 1,
  10102. fieldset: 1,
  10103. thead: 1,
  10104. tfoot: 1
  10105. };
  10106. CKEDITOR.tools.extend(CKEDITOR.dom.selection, {
  10107. _removeFillingCharSequenceString: B,
  10108. _createFillingCharSequenceNode: f,
  10109. FILLING_CHAR_SEQUENCE: v
  10110. });
  10111. CKEDITOR.dom.selection.prototype = {
  10112. getNative: function() {
  10113. return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel = m ? this
  10114. .document.$.selection : this.document.getWindow().$.getSelection()
  10115. },
  10116. getType: m ? function() {
  10117. var a = this._.cache;
  10118. if (a.type) return a.type;
  10119. var b = CKEDITOR.SELECTION_NONE;
  10120. try {
  10121. var c = this.getNative(),
  10122. d = c.type;
  10123. "Text" == d && (b = CKEDITOR.SELECTION_TEXT);
  10124. "Control" == d && (b = CKEDITOR.SELECTION_ELEMENT);
  10125. c.createRange().parentElement() && (b = CKEDITOR.SELECTION_TEXT)
  10126. } catch (e) {}
  10127. return a.type = b
  10128. } : function() {
  10129. var a = this._.cache;
  10130. if (a.type) return a.type;
  10131. var b = CKEDITOR.SELECTION_TEXT,
  10132. c = this.getNative();
  10133. if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
  10134. else if (1 == c.rangeCount) {
  10135. var c = c.getRangeAt(0),
  10136. d = c.startContainer;
  10137. d == c.endContainer && 1 == d.nodeType && 1 == c.endOffset -
  10138. c.startOffset && z[d.childNodes[c.startOffset].nodeName.toLowerCase()] && (b = CKEDITOR
  10139. .SELECTION_ELEMENT)
  10140. }
  10141. return a.type = b
  10142. },
  10143. getRanges: function() {
  10144. var a = m ? function() {
  10145. function a(b) {
  10146. return (new CKEDITOR.dom.node(b)).getIndex()
  10147. }
  10148. var b = function(b, c) {
  10149. b = b.duplicate();
  10150. b.collapse(c);
  10151. var d = b.parentElement();
  10152. if (!d.hasChildNodes()) return {
  10153. container: d,
  10154. offset: 0
  10155. };
  10156. for (var e = d.children, f, g, h = b.duplicate(), k = 0, l = e.length - 1, t = -1, q, m; k <=
  10157. l;)
  10158. if (t = Math.floor((k + l) / 2), f = e[t], h.moveToElementText(f), q = h.compareEndPoints(
  10159. "StartToStart",
  10160. b), 0 < q) l = t - 1;
  10161. else if (0 > q) k = t + 1;
  10162. else return {
  10163. container: d,
  10164. offset: a(f)
  10165. };
  10166. if (-1 == t || t == e.length - 1 && 0 > q) {
  10167. h.moveToElementText(d);
  10168. h.setEndPoint("StartToStart", b);
  10169. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  10170. e = d.childNodes;
  10171. if (!h) return f = e[e.length - 1], f.nodeType != CKEDITOR.NODE_TEXT ? {
  10172. container: d,
  10173. offset: e.length
  10174. } : {
  10175. container: f,
  10176. offset: f.nodeValue.length
  10177. };
  10178. for (d = e.length; 0 < h && 0 < d;) g = e[--d], g.nodeType == CKEDITOR.NODE_TEXT && (m = g,
  10179. h -= g.nodeValue.length);
  10180. return {
  10181. container: m,
  10182. offset: -h
  10183. }
  10184. }
  10185. h.collapse(0 < q ? !0 : !1);
  10186. h.setEndPoint(0 <
  10187. q ? "StartToStart" : "EndToStart", b);
  10188. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  10189. if (!h) return {
  10190. container: d,
  10191. offset: a(f) + (0 < q ? 0 : 1)
  10192. };
  10193. for (; 0 < h;) try {
  10194. g = f[0 < q ? "previousSibling" : "nextSibling"], g.nodeType == CKEDITOR.NODE_TEXT && (h -=
  10195. g.nodeValue.length, m = g), f = g
  10196. } catch (w) {
  10197. return {
  10198. container: d,
  10199. offset: a(f)
  10200. }
  10201. }
  10202. return {
  10203. container: m,
  10204. offset: 0 < q ? -h : m.nodeValue.length + h
  10205. }
  10206. };
  10207. return function() {
  10208. var a = this.getNative(),
  10209. c = a && a.createRange(),
  10210. d = this.getType();
  10211. if (!a) return [];
  10212. if (d == CKEDITOR.SELECTION_TEXT) return a = new CKEDITOR.dom.range(this.root),
  10213. d = b(c, !0), a.setStart(new CKEDITOR.dom.node(d.container), d.offset), d = b(c), a.setEnd(
  10214. new CKEDITOR.dom.node(d.container), d.offset), a.endContainer.getPosition(a
  10215. .startContainer) & CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer
  10216. .getIndex() && a.collapse(), [a];
  10217. if (d == CKEDITOR.SELECTION_ELEMENT) {
  10218. for (var d = [], e = 0; e < c.length; e++) {
  10219. for (var f = c.item(e), g = f.parentNode, h = 0, a = new CKEDITOR.dom.range(this.root); h <
  10220. g.childNodes.length && g.childNodes[h] != f; h++);
  10221. a.setStart(new CKEDITOR.dom.node(g), h);
  10222. a.setEnd(new CKEDITOR.dom.node(g),
  10223. h + 1);
  10224. d.push(a)
  10225. }
  10226. return d
  10227. }
  10228. return []
  10229. }
  10230. }() : function() {
  10231. var a = [],
  10232. b, c = this.getNative();
  10233. if (!c) return a;
  10234. for (var d = 0; d < c.rangeCount; d++) {
  10235. var e = c.getRangeAt(d);
  10236. b = new CKEDITOR.dom.range(this.root);
  10237. b.setStart(new CKEDITOR.dom.node(e.startContainer), e.startOffset);
  10238. b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset);
  10239. a.push(b)
  10240. }
  10241. return a
  10242. };
  10243. return function(b) {
  10244. var c = this._.cache,
  10245. d = c.ranges;
  10246. d || (c.ranges = d = new CKEDITOR.dom.rangeList(a.call(this)));
  10247. return b ? r(new CKEDITOR.dom.rangeList(d.slice())) : d
  10248. }
  10249. }(),
  10250. getStartElement: function() {
  10251. var a =
  10252. this._.cache;
  10253. if (void 0 !== a.startElement) return a.startElement;
  10254. var b;
  10255. switch (this.getType()) {
  10256. case CKEDITOR.SELECTION_ELEMENT:
  10257. return this.getSelectedElement();
  10258. case CKEDITOR.SELECTION_TEXT:
  10259. var c = this.getRanges()[0];
  10260. if (c) {
  10261. if (c.collapsed) b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  10262. else {
  10263. for (c.optimize(); b = c.startContainer, c.startOffset == (b.getChildCount ? b.getChildCount() :
  10264. b.getLength()) && !b.isBlockBoundary();) c.setStartAfter(b);
  10265. b = c.startContainer;
  10266. if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
  10267. if ((b = b.getChild(c.startOffset)) && b.type == CKEDITOR.NODE_ELEMENT)
  10268. for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) b = c, c = c.getFirst();
  10269. else b = c.startContainer
  10270. }
  10271. b = b.$
  10272. }
  10273. }
  10274. return a.startElement = b ? new CKEDITOR.dom.element(b) : null
  10275. },
  10276. getSelectedElement: function() {
  10277. var a = this._.cache;
  10278. if (void 0 !== a.selectedElement) return a.selectedElement;
  10279. var b = this,
  10280. c = CKEDITOR.tools.tryThese(function() {
  10281. return b.getNative().createRange().item(0)
  10282. }, function() {
  10283. for (var a = b.getRanges()[0].clone(), c, d, e = 2; e && !((c = a.getEnclosedNode()) &&
  10284. c.type == CKEDITOR.NODE_ELEMENT && z[c.getName()] && (d = c)); e--) a.shrink(CKEDITOR
  10285. .SHRINK_ELEMENT);
  10286. return d && d.$
  10287. });
  10288. return a.selectedElement = c ? new CKEDITOR.dom.element(c) : null
  10289. },
  10290. getSelectedText: function() {
  10291. var a = this._.cache;
  10292. if (void 0 !== a.selectedText) return a.selectedText;
  10293. var b = this.getNative(),
  10294. b = m ? "Control" == b.type ? "" : b.createRange().text : b.toString();
  10295. return a.selectedText = b
  10296. },
  10297. lock: function() {
  10298. this.getRanges();
  10299. this.getStartElement();
  10300. this.getSelectedElement();
  10301. this.getSelectedText();
  10302. this._.cache.nativeSel = null;
  10303. this.isLocked = 1
  10304. },
  10305. unlock: function(a) {
  10306. if (this.isLocked) {
  10307. if (a) var b = this.getSelectedElement(),
  10308. c = this.getRanges(),
  10309. e = this.isFake;
  10310. this.isLocked = 0;
  10311. this.reset();
  10312. a && (a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 1) && ((a = this.root
  10313. .editor) && a.plugins.tableselection && a.plugins.tableselection.isSupportedEnvironment(a) && d(
  10314. c) ? g.call(this, c) : e ? this.fake(b) : b && 2 > c.length ? this.selectElement(b) : this
  10315. .selectRanges(c))
  10316. }
  10317. },
  10318. reset: function() {
  10319. this._.cache = {};
  10320. this.isFake = 0;
  10321. var a = this.root.editor;
  10322. if (a && a._.fakeSelection)
  10323. if (this.rev ==
  10324. a._.fakeSelection.rev) {
  10325. delete a._.fakeSelection;
  10326. var b = a._.hiddenSelectionContainer;
  10327. if (b) {
  10328. var c = a.checkDirty();
  10329. a.fire("lockSnapshot");
  10330. b.remove();
  10331. a.fire("unlockSnapshot");
  10332. !c && a.resetDirty()
  10333. }
  10334. delete a._.hiddenSelectionContainer
  10335. } else CKEDITOR.warn("selection-fake-reset");
  10336. this.rev = L++
  10337. },
  10338. selectElement: function(a) {
  10339. var b = new CKEDITOR.dom.range(this.root);
  10340. b.setStartBefore(a);
  10341. b.setEndAfter(a);
  10342. this.selectRanges([b])
  10343. },
  10344. selectRanges: function(a) {
  10345. var b = this.root.editor,
  10346. c = b && b._.hiddenSelectionContainer;
  10347. this.reset();
  10348. if (c)
  10349. for (var c = this.root, e, h = 0; h < a.length; ++h) e = a[h], e.endContainer.equals(c) && (e
  10350. .endOffset = Math.min(e.endOffset, c.getChildCount()));
  10351. if (a.length)
  10352. if (this.isLocked) {
  10353. var k = CKEDITOR.document.getActive();
  10354. this.unlock();
  10355. this.selectRanges(a);
  10356. this.lock();
  10357. k && !k.equals(this.root) && k.focus()
  10358. } else {
  10359. var x;
  10360. a: {
  10361. var l, M;
  10362. if (1 == a.length && !(M = a[0]).collapsed && (x = M.getEnclosedNode()) && x.type == CKEDITOR
  10363. .NODE_ELEMENT && (M = M.clone(), M.shrink(CKEDITOR.SHRINK_ELEMENT, !0), (l = M
  10364. .getEnclosedNode()) && l.type == CKEDITOR.NODE_ELEMENT &&
  10365. (x = l), "false" == x.getAttribute("contenteditable"))) break a;x = void 0
  10366. }
  10367. if (x) this.fake(x);
  10368. else if (b && b.plugins.tableselection && b.plugins.tableselection.isSupportedEnvironment(b) && d(
  10369. a) && !G && !a[0]._getTableElement({
  10370. table: 1
  10371. }).hasAttribute("data-cke-tableselection-ignored")) g.call(this, a);
  10372. else {
  10373. if (m) {
  10374. l = CKEDITOR.dom.walker.whitespaces(!0);
  10375. x = /\ufeff|\u00a0/;
  10376. M = {
  10377. table: 1,
  10378. tbody: 1,
  10379. tr: 1
  10380. };
  10381. 1 < a.length && (b = a[a.length - 1], a[0].setEnd(b.endContainer, b.endOffset));
  10382. b = a[0];
  10383. a = b.collapsed;
  10384. var n, A, p;
  10385. if ((c = b.getEnclosedNode()) &&
  10386. c.type == CKEDITOR.NODE_ELEMENT && c.getName() in z && (!c.is("a") || !c.getText())) try {
  10387. p = c.$.createControlRange();
  10388. p.addElement(c.$);
  10389. p.select();
  10390. return
  10391. } catch (r) {}
  10392. if (b.startContainer.type == CKEDITOR.NODE_ELEMENT && b.startContainer.getName() in M || b
  10393. .endContainer.type == CKEDITOR.NODE_ELEMENT && b.endContainer.getName() in M) b.shrink(
  10394. CKEDITOR.NODE_ELEMENT, !0), a = b.collapsed;
  10395. p = b.createBookmark();
  10396. M = p.startNode;
  10397. a || (k = p.endNode);
  10398. p = b.document.$.body.createTextRange();
  10399. p.moveToElementText(M.$);
  10400. p.moveStart("character", 1);
  10401. k ? (x =
  10402. b.document.$.body.createTextRange(), x.moveToElementText(k.$), p.setEndPoint("EndToEnd", x),
  10403. p.moveEnd("character", -1)) : (n = M.getNext(l), A = M.hasAscendant("pre"), n = !(n && n
  10404. .getText && n.getText().match(x)) && (A || !M.hasPrevious() || M.getPrevious().is && M
  10405. .getPrevious().is("br")), A = b.document.createElement("span"), A.setHtml("\x26#65279;"),
  10406. A.insertBefore(M), n && b.document.createText("").insertBefore(M));
  10407. b.setStartBefore(M);
  10408. M.remove();
  10409. a ? (n ? (p.moveStart("character", -1), p.select(), b.document.$.selection.clear()) : p
  10410. .select(),
  10411. b.moveToPosition(A, CKEDITOR.POSITION_BEFORE_START), A.remove()) : (b.setEndBefore(k), k
  10412. .remove(), p.select())
  10413. } else {
  10414. k = this.getNative();
  10415. if (!k) return;
  10416. this.removeAllRanges();
  10417. for (p = 0; p < a.length; p++) {
  10418. if (p < a.length - 1 && (n = a[p], A = a[p + 1], x = n.clone(), x.setStart(n.endContainer, n
  10419. .endOffset), x.setEnd(A.startContainer, A.startOffset), !x.collapsed && (x.shrink(
  10420. CKEDITOR.NODE_ELEMENT, !0), b = x.getCommonAncestor(), x = x.getEnclosedNode(), b
  10421. .isReadOnly() || x && x.isReadOnly()))) {
  10422. A.setStart(n.startContainer, n.startOffset);
  10423. a.splice(p--,
  10424. 1);
  10425. continue
  10426. }
  10427. b = a[p];
  10428. A = this.document.$.createRange();
  10429. b.collapsed && CKEDITOR.env.webkit && q(b) && (x = f(this.root), b.insertNode(x), (n = x
  10430. .getNext()) && !x.getPrevious() && n.type == CKEDITOR.NODE_ELEMENT && "br" == n
  10431. .getName() ? (w(this.root), b.moveToPosition(n, CKEDITOR.POSITION_BEFORE_START)) : b
  10432. .moveToPosition(x, CKEDITOR.POSITION_AFTER_END));
  10433. A.setStart(b.startContainer.$, b.startOffset);
  10434. try {
  10435. A.setEnd(b.endContainer.$, b.endOffset)
  10436. } catch (u) {
  10437. if (0 <= u.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")) b.collapse(1), A.setEnd(b
  10438. .endContainer.$,
  10439. b.endOffset);
  10440. else throw u;
  10441. }
  10442. k.addRange(A)
  10443. }
  10444. }
  10445. this.reset();
  10446. this.root.fire("selectionchange")
  10447. }
  10448. }
  10449. },
  10450. fake: function(a, b) {
  10451. var c = this.root.editor;
  10452. void 0 === b && a.hasAttribute("aria-label") && (b = a.getAttribute("aria-label"));
  10453. this.reset();
  10454. y(c, b);
  10455. var d = this._.cache,
  10456. e = new CKEDITOR.dom.range(this.root);
  10457. e.setStartBefore(a);
  10458. e.setEndAfter(a);
  10459. d.ranges = new CKEDITOR.dom.rangeList(e);
  10460. d.selectedElement = d.startElement = a;
  10461. d.type = CKEDITOR.SELECTION_ELEMENT;
  10462. d.selectedText = d.nativeSel = null;
  10463. this.isFake = 1;
  10464. this.rev = L++;
  10465. c._.fakeSelection =
  10466. this;
  10467. this.root.fire("selectionchange")
  10468. },
  10469. isHidden: function() {
  10470. var a = this.getCommonAncestor();
  10471. a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
  10472. return !(!a || !a.data("cke-hidden-sel"))
  10473. },
  10474. isInTable: function(a) {
  10475. return d(this.getRanges(), a)
  10476. },
  10477. isCollapsed: function() {
  10478. var a = this.getRanges();
  10479. return 1 === a.length && a[0].collapsed
  10480. },
  10481. createBookmarks: function(a) {
  10482. a = this.getRanges().createBookmarks(a);
  10483. this.isFake && (a.isFake = 1);
  10484. return a
  10485. },
  10486. createBookmarks2: function(a) {
  10487. a = this.getRanges().createBookmarks2(a);
  10488. this.isFake && (a.isFake =
  10489. 1);
  10490. return a
  10491. },
  10492. selectBookmarks: function(a) {
  10493. for (var b = [], c, e = 0; e < a.length; e++) {
  10494. var f = new CKEDITOR.dom.range(this.root);
  10495. f.moveToBookmark(a[e]);
  10496. b.push(f)
  10497. }
  10498. a.isFake && (c = d(b) ? b[0]._getTableElement() : b[0].getEnclosedNode(), c && c.type == CKEDITOR
  10499. .NODE_ELEMENT || (CKEDITOR.warn("selection-not-fake"), a.isFake = 0));
  10500. a.isFake && !d(b) ? this.fake(c) : this.selectRanges(b);
  10501. return this
  10502. },
  10503. getCommonAncestor: function() {
  10504. var a = this.getRanges();
  10505. return a.length ? a[0].startContainer.getCommonAncestor(a[a.length - 1].endContainer) : null
  10506. },
  10507. scrollIntoView: function() {
  10508. this.getType() != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView()
  10509. },
  10510. removeAllRanges: function() {
  10511. if (this.getType() != CKEDITOR.SELECTION_NONE) {
  10512. var a = this.getNative();
  10513. try {
  10514. a && a[m ? "empty" : "removeAllRanges"]()
  10515. } catch (b) {}
  10516. this.reset()
  10517. }
  10518. }
  10519. }
  10520. })();
  10521. "use strict";
  10522. CKEDITOR.STYLE_BLOCK = 1;
  10523. CKEDITOR.STYLE_INLINE = 2;
  10524. CKEDITOR.STYLE_OBJECT = 3;
  10525. (function() {
  10526. function a(a, b) {
  10527. for (var c, d;
  10528. (a = a.getParent()) && !a.equals(b);)
  10529. if (a.getAttribute("data-nostyle")) c = a;
  10530. else if (!d) {
  10531. var e = a.getAttribute("contentEditable");
  10532. "false" == e ? c = a : "true" == e && (d = 1)
  10533. }
  10534. return c
  10535. }
  10536. function d(a, b, c, d) {
  10537. return (a.getPosition(b) | d) == d && (!c.childRule || c.childRule(a))
  10538. }
  10539. function b(c) {
  10540. var e = c.document;
  10541. if (c.collapsed) e = L(this, e), c.insertNode(e), c.moveToPosition(e, CKEDITOR.POSITION_BEFORE_END);
  10542. else {
  10543. var f = this.element,
  10544. h = this._.definition,
  10545. k, l = h.ignoreReadonly,
  10546. q = l || h.includeReadonly;
  10547. null ==
  10548. q && (q = c.root.getCustomData("cke_includeReadonly"));
  10549. var m = CKEDITOR.dtd[f];
  10550. m || (k = !0, m = CKEDITOR.dtd.span);
  10551. c.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  10552. c.trim();
  10553. var p = c.createBookmark(),
  10554. w = p.startNode,
  10555. t = p.endNode,
  10556. r = w,
  10557. u;
  10558. if (!l) {
  10559. var v = c.getCommonAncestor(),
  10560. l = a(w, v),
  10561. v = a(t, v);
  10562. l && (r = l.getNextSourceNode(!0));
  10563. v && (t = v)
  10564. }
  10565. for (r.getPosition(t) == CKEDITOR.POSITION_FOLLOWING && (r = 0); r;) {
  10566. l = !1;
  10567. if (r.equals(t)) r = null, l = !0;
  10568. else {
  10569. var y = r.type == CKEDITOR.NODE_ELEMENT ? r.getName() : null,
  10570. v = y && "false" == r.getAttribute("contentEditable"),
  10571. B = y &&
  10572. -1 !== CKEDITOR.tools.array.indexOf(CKEDITOR.style.unstylableElements, y),
  10573. B = y && (r.getAttribute("data-nostyle") || B);
  10574. if (y && r.data("cke-bookmark") || r.type === CKEDITOR.NODE_COMMENT) {
  10575. r = r.getNextSourceNode(!0);
  10576. continue
  10577. }
  10578. if (v && q && CKEDITOR.dtd.$block[y])
  10579. for (var z = r, D = g(z), E = void 0, G = D.length, I = 0, z = G && new CKEDITOR.dom.range(z
  10580. .getDocument()); I < G; ++I) {
  10581. var E = D[I],
  10582. J = CKEDITOR.filter.instances[E.data("cke-filter")];
  10583. if (J ? J.check(this) : 1) z.selectNodeContents(E), b.call(this, z)
  10584. }
  10585. D = y ? !m[y] || B ? 0 : v && !q ? 0 : d(r, t, h, T) : 1;
  10586. if (D)
  10587. if (E =
  10588. r.getParent(), D = h, G = f, I = k, !E || !(E.getDtd() || CKEDITOR.dtd.span)[G] && !I || D
  10589. .parentRule && !D.parentRule(E)) l = !0;
  10590. else {
  10591. if (u || y && CKEDITOR.dtd.$removeEmpty[y] && (r.getPosition(t) | T) != T || (u = c.clone(), u
  10592. .setStartBefore(r)), y = r.type, y == CKEDITOR.NODE_TEXT || v || y == CKEDITOR.NODE_ELEMENT && !
  10593. r.getChildCount()) {
  10594. for (var y = r, K;
  10595. (l = !y.getNext(C)) && (K = y.getParent(), m[K.getName()]) && d(K, w, h, N);) y = K;
  10596. u.setEndAfter(y)
  10597. }
  10598. }
  10599. else l = !0;
  10600. r = r.getNextSourceNode(B || v)
  10601. }
  10602. if (l && u && !u.collapsed) {
  10603. for (var l = L(this, e), v = l.hasAttributes(), B = u.getCommonAncestor(),
  10604. y = {}, D = {}, E = {}, G = {}, U, R, Y; l && B;) {
  10605. if (B.getName() == f) {
  10606. for (U in h.attributes) !G[U] && (Y = B.getAttribute(R)) && (l.getAttribute(U) == Y ? D[U] = 1 : G[
  10607. U] = 1);
  10608. for (R in h.styles) !E[R] && (Y = B.getStyle(R)) && (l.getStyle(R) == Y ? y[R] = 1 : E[R] = 1)
  10609. }
  10610. B = B.getParent()
  10611. }
  10612. for (U in D) l.removeAttribute(U);
  10613. for (R in y) l.removeStyle(R);
  10614. v && !l.hasAttributes() && (l = null);
  10615. l ? (u.extractContents().appendTo(l), u.insertNode(l), F.call(this, l), l.mergeSiblings(), CKEDITOR.env
  10616. .ie || l.$.normalize()) : (l = new CKEDITOR.dom.element("span"), u.extractContents().appendTo(l),
  10617. u.insertNode(l), F.call(this, l), l.remove(!0));
  10618. u = null
  10619. }
  10620. }
  10621. c.moveToBookmark(p);
  10622. c.shrink(CKEDITOR.SHRINK_TEXT);
  10623. c.shrink(CKEDITOR.NODE_ELEMENT, !0)
  10624. }
  10625. }
  10626. function c(a) {
  10627. function b() {
  10628. for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(q.getParent()),
  10629. e = null, f = null, g = 0; g < a.elements.length; g++) {
  10630. var h = a.elements[g];
  10631. if (h == a.block || h == a.blockLimit) break;
  10632. m.checkElementRemovable(h, !0) && (e = h)
  10633. }
  10634. for (g = 0; g < c.elements.length; g++) {
  10635. h = c.elements[g];
  10636. if (h == c.block || h == c.blockLimit) break;
  10637. m.checkElementRemovable(h,
  10638. !0) && (f = h)
  10639. }
  10640. f && q.breakParent(f);
  10641. e && d.breakParent(e)
  10642. }
  10643. a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  10644. var c = a.createBookmark(),
  10645. d = c.startNode,
  10646. e = this._.definition.alwaysRemoveElement;
  10647. if (a.collapsed) {
  10648. for (var f = new CKEDITOR.dom.elementPath(d.getParent(), a.root), g, h = 0, k; h < f.elements.length && (k =
  10649. f.elements[h]) && k != f.block && k != f.blockLimit; h++)
  10650. if (this.checkElementRemovable(k)) {
  10651. var l;
  10652. !e && a.collapsed && (a.checkBoundaryOfElement(k, CKEDITOR.END) || (l = a.checkBoundaryOfElement(k,
  10653. CKEDITOR.START))) ? (g = k, g.match = l ? "start" : "end") :
  10654. (k.mergeSiblings(), k.is(this.element) ? y.call(this, k) : r(k, G(this)[k.getName()]))
  10655. } if (g) {
  10656. e = d;
  10657. for (h = 0;; h++) {
  10658. k = f.elements[h];
  10659. if (k.equals(g)) break;
  10660. else if (k.match) continue;
  10661. else k = k.clone();
  10662. k.append(e);
  10663. e = k
  10664. }
  10665. e["start" == g.match ? "insertBefore" : "insertAfter"](g)
  10666. }
  10667. } else {
  10668. var q = c.endNode,
  10669. m = this;
  10670. b();
  10671. for (f = d; !f.equals(q);) g = f.getNextSourceNode(), f.type == CKEDITOR.NODE_ELEMENT && this
  10672. .checkElementRemovable(f) && (f.getName() == this.element ? y.call(this, f) : r(f, G(this)[f.getName()]),
  10673. g.type == CKEDITOR.NODE_ELEMENT && g.contains(d) &&
  10674. (b(), g = d.getNext())), f = g
  10675. }
  10676. a.moveToBookmark(c);
  10677. a.shrink(CKEDITOR.NODE_ELEMENT, !0)
  10678. }
  10679. function g(a) {
  10680. var b = [];
  10681. a.forEach(function(a) {
  10682. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  10683. }, CKEDITOR.NODE_ELEMENT, !0);
  10684. return b
  10685. }
  10686. function e(a) {
  10687. var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0);
  10688. (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && v(a, this)
  10689. }
  10690. function h(a) {
  10691. var b = a.getCommonAncestor(!0, !0);
  10692. if (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element,
  10693. 1)) {
  10694. var b = this._.definition,
  10695. c = b.attributes;
  10696. if (c)
  10697. for (var d in c) a.removeAttribute(d, c[d]);
  10698. if (b.styles)
  10699. for (var e in b.styles) b.styles.hasOwnProperty(e) && a.removeStyle(e)
  10700. }
  10701. }
  10702. function k(a) {
  10703. var b = a.createBookmark(!0),
  10704. c = a.createIterator();
  10705. c.enforceRealBlocks = !0;
  10706. this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR);
  10707. for (var d, e = a.document, f; d = c.getNextParagraph();) !d.isReadOnly() && (c.activeFilter ? c.activeFilter
  10708. .check(this) : 1) && (f = L(this, e, d), q(d, f));
  10709. a.moveToBookmark(b)
  10710. }
  10711. function l(a) {
  10712. var b = a.createBookmark(1),
  10713. c = a.createIterator();
  10714. c.enforceRealBlocks = !0;
  10715. c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  10716. for (var d, e; d = c.getNextParagraph();) this.checkElementRemovable(d) && (d.is("pre") ? ((e = this._
  10717. .enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR
  10718. .ENTER_P ? "p" : "div")) && d.copyAttributes(e), q(d, e)) : y.call(this, d));
  10719. a.moveToBookmark(b)
  10720. }
  10721. function q(a, b) {
  10722. var c = !b;
  10723. c && (b = a.getDocument().createElement("div"), a.copyAttributes(b));
  10724. var d = b && b.is("pre"),
  10725. e = a.is("pre"),
  10726. g = !d && e;
  10727. if (d && !e) {
  10728. e = b;
  10729. (g =
  10730. a.getBogus()) && g.remove();
  10731. g = a.getHtml();
  10732. g = w(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
  10733. g = g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
  10734. g = g.replace(/([ \t\n\r]+|&nbsp;)/g, " ");
  10735. g = g.replace(/<br\b[^>]*>/gi, "\n");
  10736. if (CKEDITOR.env.ie) {
  10737. var h = a.getDocument().createElement("div");
  10738. h.append(e);
  10739. e.$.outerHTML = "\x3cpre\x3e" + g + "\x3c/pre\x3e";
  10740. e.copyAttributes(h.getFirst());
  10741. e = h.getFirst().remove()
  10742. } else e.setHtml(g);
  10743. b = e
  10744. } else g ? b = B(c ? [a.getHtml()] : f(a), b) : a.moveChildren(b);
  10745. b.replace(a);
  10746. if (d) {
  10747. var c = b,
  10748. k;
  10749. (k = c.getPrevious(I)) &&
  10750. k.type == CKEDITOR.NODE_ELEMENT && k.is("pre") && (d = w(k.getHtml(), /\n$/, "") + "\n\n" + w(c.getHtml(),
  10751. /^\n/, ""), CKEDITOR.env.ie ? c.$.outerHTML = "\x3cpre\x3e" + d + "\x3c/pre\x3e" : c.setHtml(d), k
  10752. .remove())
  10753. } else c && m(b)
  10754. }
  10755. function f(a) {
  10756. var b = [];
  10757. w(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) {
  10758. return b + "\x3c/pre\x3e" + c + "\x3cpre\x3e"
  10759. }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function(a, c) {
  10760. b.push(c)
  10761. });
  10762. return b
  10763. }
  10764. function w(a, b, c) {
  10765. var d = "",
  10766. e = "";
  10767. a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,
  10768. function(a, b, c) {
  10769. b && (d = b);
  10770. c && (e = c);
  10771. return ""
  10772. });
  10773. return d + a.replace(b, c) + e
  10774. }
  10775. function B(a, b) {
  10776. var c;
  10777. 1 < a.length && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
  10778. for (var d = 0; d < a.length; d++) {
  10779. var e = a[d],
  10780. e = e.replace(/(\r\n|\r)/g, "\n"),
  10781. e = w(e, /^[ \t]*\n/, ""),
  10782. e = w(e, /\n$/, ""),
  10783. e = w(e, /^[ \t]+|[ \t]+$/g, function(a, b) {
  10784. return 1 == a.length ? "\x26nbsp;" : b ? " " + CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) :
  10785. CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " "
  10786. }),
  10787. e = e.replace(/\n/g, "\x3cbr\x3e"),
  10788. e = e.replace(/[ \t]{2,}/g, function(a) {
  10789. return CKEDITOR.tools.repeat("\x26nbsp;",
  10790. a.length - 1) + " "
  10791. });
  10792. if (c) {
  10793. var f = b.clone();
  10794. f.setHtml(e);
  10795. c.append(f)
  10796. } else b.setHtml(e)
  10797. }
  10798. return c || b
  10799. }
  10800. function y(a, b) {
  10801. var c = this._.definition,
  10802. d = c.attributes,
  10803. c = c.styles,
  10804. e = G(this)[a.getName()],
  10805. f = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c),
  10806. g;
  10807. for (g in d)
  10808. if ("class" != g && !this._.definition.fullMatch || a.getAttribute(g) == p(g, d[g])) b && "data-" == g
  10809. .slice(0, 5) || (f = a.hasAttribute(g), a.removeAttribute(g));
  10810. for (var h in c) this._.definition.fullMatch && a.getStyle(h) != p(h, c[h], !0) || (f = f || !!a.getStyle(h),
  10811. a.removeStyle(h));
  10812. r(a, e, E[a.getName()]);
  10813. f && (this._.definition.alwaysRemoveElement ? m(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._
  10814. .enterMode == CKEDITOR.ENTER_BR && !a.hasAttributes() ? m(a) : a.renameNode(this._.enterMode == CKEDITOR
  10815. .ENTER_P ? "p" : "div"))
  10816. }
  10817. function F(a) {
  10818. for (var b = G(this), c = a.getElementsByTag(this.element), d, e = c.count(); 0 <= --e;) d = c.getItem(e), d
  10819. .isReadOnly() || y.call(this, d, !0);
  10820. for (var f in b)
  10821. if (f != this.element)
  10822. for (c = a.getElementsByTag(f), e = c.count() - 1; 0 <= e; e--) d = c.getItem(e), d.isReadOnly() || r(d,
  10823. b[f])
  10824. }
  10825. function r(a,
  10826. b, c) {
  10827. if (b = b && b.attributes)
  10828. for (var d = 0; d < b.length; d++) {
  10829. var e = b[d][0],
  10830. f;
  10831. if (f = a.getAttribute(e)) {
  10832. var g = b[d][1];
  10833. (null === g || g.test && g.test(f) || "string" == typeof g && f == g) && a.removeAttribute(e)
  10834. }
  10835. }
  10836. c || m(a)
  10837. }
  10838. function m(a, b) {
  10839. if (!a.hasAttributes() || b)
  10840. if (CKEDITOR.dtd.$block[a.getName()]) {
  10841. var c = a.getPrevious(I),
  10842. d = a.getNext(I);
  10843. !c || c.type != CKEDITOR.NODE_TEXT && c.isBlockBoundary({
  10844. br: 1
  10845. }) || a.append("br", 1);
  10846. !d || d.type != CKEDITOR.NODE_TEXT && d.isBlockBoundary({
  10847. br: 1
  10848. }) || a.append("br");
  10849. a.remove(!0)
  10850. } else c = a.getFirst(), d = a.getLast(),
  10851. a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(), d && !c.equals(d) && d.type ==
  10852. CKEDITOR.NODE_ELEMENT && d.mergeSiblings())
  10853. }
  10854. function L(a, b, c) {
  10855. var d;
  10856. d = a.element;
  10857. "*" == d && (d = "span");
  10858. d = new CKEDITOR.dom.element(d, b);
  10859. c && c.copyAttributes(d);
  10860. d = v(d, a);
  10861. b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData(
  10862. "doc_processing_style", 1);
  10863. return d
  10864. }
  10865. function v(a, b) {
  10866. var c = b._.definition,
  10867. d = c.attributes,
  10868. c = CKEDITOR.style.getStyleText(c);
  10869. if (d)
  10870. for (var e in d) a.setAttribute(e,
  10871. d[e]);
  10872. c && a.setAttribute("style", c);
  10873. a.getDocument().removeCustomData("doc_processing_style");
  10874. return a
  10875. }
  10876. function J(a, b) {
  10877. for (var c in a) a[c] = a[c].replace(D, function(a, c) {
  10878. return b[c]
  10879. })
  10880. }
  10881. function G(a) {
  10882. if (a._.overrides) return a._.overrides;
  10883. var b = a._.overrides = {},
  10884. c = a._.definition.overrides;
  10885. if (c) {
  10886. CKEDITOR.tools.isArray(c) || (c = [c]);
  10887. for (var d = 0; d < c.length; d++) {
  10888. var e = c[d],
  10889. f, g;
  10890. "string" == typeof e ? f = e.toLowerCase() : (f = e.element ? e.element.toLowerCase() : a.element, g = e
  10891. .attributes);
  10892. e = b[f] || (b[f] = {});
  10893. if (g) {
  10894. var e = e.attributes =
  10895. e.attributes || [],
  10896. h;
  10897. for (h in g) e.push([h.toLowerCase(), g[h]])
  10898. }
  10899. }
  10900. }
  10901. return b
  10902. }
  10903. function p(a, b, c) {
  10904. var d = new CKEDITOR.dom.element("span");
  10905. d[c ? "setStyle" : "setAttribute"](a, b);
  10906. return d[c ? "getStyle" : "getAttribute"](a)
  10907. }
  10908. function u(a, b) {
  10909. function c(a, b) {
  10910. return "font-family" == b.toLowerCase() ? a.replace(/["']/g, "") : a
  10911. }
  10912. "string" == typeof a && (a = CKEDITOR.tools.parseCssText(a));
  10913. "string" == typeof b && (b = CKEDITOR.tools.parseCssText(b, !0));
  10914. for (var d in a)
  10915. if (!(d in b) || c(b[d], d) != c(a[d], d) && "inherit" != a[d] && "inherit" != b[d]) return !1;
  10916. return !0
  10917. }
  10918. function K(a, b, c) {
  10919. var d = a.getRanges();
  10920. b = b ? this.removeFromRange : this.applyToRange;
  10921. for (var e, f = d.createIterator(); e = f.getNextRange();) b.call(this, e, c);
  10922. a.selectRanges(d)
  10923. }
  10924. var E = {
  10925. address: 1,
  10926. div: 1,
  10927. h1: 1,
  10928. h2: 1,
  10929. h3: 1,
  10930. h4: 1,
  10931. h5: 1,
  10932. h6: 1,
  10933. p: 1,
  10934. pre: 1,
  10935. section: 1,
  10936. header: 1,
  10937. footer: 1,
  10938. nav: 1,
  10939. article: 1,
  10940. aside: 1,
  10941. figure: 1,
  10942. dialog: 1,
  10943. hgroup: 1,
  10944. time: 1,
  10945. meter: 1,
  10946. menu: 1,
  10947. command: 1,
  10948. keygen: 1,
  10949. output: 1,
  10950. progress: 1,
  10951. details: 1,
  10952. datagrid: 1,
  10953. datalist: 1
  10954. },
  10955. z = {
  10956. a: 1,
  10957. blockquote: 1,
  10958. embed: 1,
  10959. hr: 1,
  10960. img: 1,
  10961. li: 1,
  10962. object: 1,
  10963. ol: 1,
  10964. table: 1,
  10965. td: 1,
  10966. tr: 1,
  10967. th: 1,
  10968. ul: 1,
  10969. dl: 1,
  10970. dt: 1,
  10971. dd: 1,
  10972. form: 1,
  10973. audio: 1,
  10974. video: 1
  10975. },
  10976. t = /\s*(?:;\s*|$)/,
  10977. D = /#\((.+?)\)/g,
  10978. C = CKEDITOR.dom.walker.bookmark(0, 1),
  10979. I = CKEDITOR.dom.walker.whitespaces(1);
  10980. CKEDITOR.style = function(a, b) {
  10981. if ("string" == typeof a.type) return new CKEDITOR.style.customHandlers[a.type](a);
  10982. var c = a.attributes;
  10983. c && c.style && (a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style)),
  10984. delete c.style);
  10985. b && (a = CKEDITOR.tools.clone(a), J(a.attributes, b), J(a.styles, b));
  10986. c = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() :
  10987. a.element : "*";
  10988. this.type = a.type || (E[c] ? CKEDITOR.STYLE_BLOCK : z[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
  10989. "object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT);
  10990. this._ = {
  10991. definition: a
  10992. }
  10993. };
  10994. CKEDITOR.style.prototype = {
  10995. apply: function(a) {
  10996. if (a instanceof CKEDITOR.dom.document) return K.call(this, a.getSelection());
  10997. if (this.checkApplicable(a.elementPath(), a)) {
  10998. var b = this._.enterMode;
  10999. b || (this._.enterMode = a.activeEnterMode);
  11000. K.call(this, a.getSelection(), 0, a);
  11001. this._.enterMode = b
  11002. }
  11003. },
  11004. remove: function(a) {
  11005. if (a instanceof CKEDITOR.dom.document) return K.call(this, a.getSelection(), 1);
  11006. if (this.checkApplicable(a.elementPath(), a)) {
  11007. var b = this._.enterMode;
  11008. b || (this._.enterMode = a.activeEnterMode);
  11009. K.call(this, a.getSelection(), 1, a);
  11010. this._.enterMode = b
  11011. }
  11012. },
  11013. applyToRange: function(a) {
  11014. this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? k :
  11015. this.type == CKEDITOR.STYLE_OBJECT ? e : null;
  11016. return this.applyToRange(a)
  11017. },
  11018. removeFromRange: function(a) {
  11019. this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ?
  11020. l : this.type == CKEDITOR.STYLE_OBJECT ? h : null;
  11021. return this.removeFromRange(a)
  11022. },
  11023. applyToObject: function(a) {
  11024. v(a, this)
  11025. },
  11026. checkActive: function(a, b) {
  11027. switch (this.type) {
  11028. case CKEDITOR.STYLE_BLOCK:
  11029. return this.checkElementRemovable(a.block || a.blockLimit, !0, b);
  11030. case CKEDITOR.STYLE_OBJECT:
  11031. case CKEDITOR.STYLE_INLINE:
  11032. for (var c = a.elements, d = 0, e; d < c.length; d++)
  11033. if (e = c[d], this.type != CKEDITOR.STYLE_INLINE || e != a.block && e != a.blockLimit) {
  11034. if (this.type == CKEDITOR.STYLE_OBJECT) {
  11035. var f = e.getName();
  11036. if (!("string" == typeof this.element ?
  11037. f == this.element : f in this.element)) continue
  11038. }
  11039. if (this.checkElementRemovable(e, !0, b)) return !0
  11040. }
  11041. }
  11042. return !1
  11043. },
  11044. checkApplicable: function(a, b, c) {
  11045. b && b instanceof CKEDITOR.filter && (c = b);
  11046. if (c && !c.check(this)) return !1;
  11047. switch (this.type) {
  11048. case CKEDITOR.STYLE_OBJECT:
  11049. return !!a.contains(this.element);
  11050. case CKEDITOR.STYLE_BLOCK:
  11051. return !!a.blockLimit.getDtd()[this.element]
  11052. }
  11053. return !0
  11054. },
  11055. checkElementMatch: function(a, b) {
  11056. var c = this._.definition;
  11057. if (!a || !c.ignoreReadonly && a.isReadOnly()) return !1;
  11058. var d = a.getName();
  11059. if ("string" == typeof this.element ?
  11060. d == this.element : d in this.element) {
  11061. if (!b && !a.hasAttributes()) return !0;
  11062. if (d = c._AC) c = d;
  11063. else {
  11064. var d = {},
  11065. e = 0,
  11066. f = c.attributes;
  11067. if (f)
  11068. for (var g in f) e++, d[g] = f[g];
  11069. if (g = CKEDITOR.style.getStyleText(c)) d.style || e++, d.style = g;
  11070. d._length = e;
  11071. c = c._AC = d
  11072. }
  11073. if (c._length) {
  11074. for (var h in c)
  11075. if ("_length" != h)
  11076. if (d = a.getAttribute(h) || "", "style" == h ? u(c[h], d) : c[h] == d) {
  11077. if (!b) return !0
  11078. } else if (b) return !1;
  11079. if (b) return !0
  11080. } else return !0
  11081. }
  11082. return !1
  11083. },
  11084. checkElementRemovable: function(a, b, c) {
  11085. if (this.checkElementMatch(a, b, c)) return !0;
  11086. if (b = G(this)[a.getName()]) {
  11087. var d;
  11088. if (!(b = b.attributes)) return !0;
  11089. for (c = 0; c < b.length; c++)
  11090. if (d = b[c][0], d = a.getAttribute(d)) {
  11091. var e = b[c][1];
  11092. if (null === e) return !0;
  11093. if ("string" == typeof e) {
  11094. if (d == e) return !0
  11095. } else if (e.test(d)) return !0
  11096. }
  11097. }
  11098. return !1
  11099. },
  11100. buildPreview: function(a) {
  11101. var b = this._.definition,
  11102. c = [],
  11103. d = b.element;
  11104. "bdo" == d && (d = "span");
  11105. var c = ["\x3c", d],
  11106. e = b.attributes;
  11107. if (e)
  11108. for (var f in e) c.push(" ", f, '\x3d"', e[f], '"');
  11109. (e = CKEDITOR.style.getStyleText(b)) && c.push(' style\x3d"', e, '"');
  11110. c.push("\x3e", a || b.name, "\x3c/", d, "\x3e");
  11111. return c.join("")
  11112. },
  11113. getDefinition: function() {
  11114. return this._.definition
  11115. }
  11116. };
  11117. CKEDITOR.style.getStyleText = function(a) {
  11118. var b = a._ST;
  11119. if (b) return b;
  11120. var b = a.styles,
  11121. c = a.attributes && a.attributes.style || "",
  11122. d = "";
  11123. c.length && (c = c.replace(t, ";"));
  11124. for (var e in b) {
  11125. var f = b[e],
  11126. g = (e + ":" + f).replace(t, ";");
  11127. "inherit" == f ? d += g : c += g
  11128. }
  11129. c.length && (c = CKEDITOR.tools.normalizeCssText(c, !0));
  11130. return a._ST = c + d
  11131. };
  11132. CKEDITOR.style.customHandlers = {};
  11133. CKEDITOR.style.unstylableElements = [];
  11134. CKEDITOR.style.addCustomHandler = function(a) {
  11135. var b = function(a) {
  11136. this._ = {
  11137. definition: a
  11138. };
  11139. this.setup && this.setup(a)
  11140. };
  11141. b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), {
  11142. assignedTo: CKEDITOR.STYLE_OBJECT
  11143. }, a, !0);
  11144. return this.customHandlers[a.type] = b
  11145. };
  11146. var T = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
  11147. N = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
  11148. })();
  11149. CKEDITOR.styleCommand = function(a, d) {
  11150. this.requiredContent = this.allowedContent = this.style = a;
  11151. CKEDITOR.tools.extend(this, d, !0)
  11152. };
  11153. CKEDITOR.styleCommand.prototype.exec = function(a) {
  11154. a.focus();
  11155. this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON && a
  11156. .removeStyle(this.style)
  11157. };
  11158. CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet");
  11159. CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet);
  11160. CKEDITOR.loadStylesSet = function(a, d, b) {
  11161. CKEDITOR.stylesSet.addExternal(a, d, "");
  11162. CKEDITOR.stylesSet.load(a, b)
  11163. };
  11164. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  11165. attachStyleStateChange: function(a, d) {
  11166. var b = this._.styleStateChangeCallbacks;
  11167. b || (b = this._.styleStateChangeCallbacks = [], this.on("selectionChange", function(a) {
  11168. for (var d = 0; d < b.length; d++) {
  11169. var e = b[d],
  11170. h = e.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
  11171. e.fn.call(this, h)
  11172. }
  11173. }));
  11174. b.push({
  11175. style: a,
  11176. fn: d
  11177. })
  11178. },
  11179. applyStyle: function(a) {
  11180. a.apply(this)
  11181. },
  11182. removeStyle: function(a) {
  11183. a.remove(this)
  11184. },
  11185. getStylesSet: function(a) {
  11186. if (this._.stylesDefinitions) a(this._.stylesDefinitions);
  11187. else {
  11188. var d = this,
  11189. b = d.config.stylesCombo_stylesSet || d.config.stylesSet;
  11190. if (!1 === b) a(null);
  11191. else if (b instanceof Array) d._.stylesDefinitions = b, a(b);
  11192. else {
  11193. b || (b = "default");
  11194. var b = b.split(":"),
  11195. c = b[0];
  11196. CKEDITOR.stylesSet.addExternal(c, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
  11197. CKEDITOR.stylesSet.load(c, function(b) {
  11198. d._.stylesDefinitions = b[c];
  11199. a(d._.stylesDefinitions)
  11200. })
  11201. }
  11202. }
  11203. }
  11204. });
  11205. (function() {
  11206. if (window.Promise) CKEDITOR.tools.promise = Promise;
  11207. else {
  11208. var a = CKEDITOR.getUrl("vendor/promise.js");
  11209. if ("function" === typeof window.define && window.define.amd && "function" === typeof window.require)
  11210. return window.require([a], function(a) {
  11211. CKEDITOR.tools.promise = a
  11212. });
  11213. CKEDITOR.scriptLoader.load(a, function(d) {
  11214. if (!d) return CKEDITOR.error("no-vendor-lib", {
  11215. path: a
  11216. });
  11217. if ("undefined" !== typeof window.ES6Promise) return CKEDITOR.tools.promise = ES6Promise
  11218. })
  11219. }
  11220. })();
  11221. (function() {
  11222. function a(a, g, e) {
  11223. a.once("selectionCheck", function(a) {
  11224. if (!d) {
  11225. var c = a.data.getRanges()[0];
  11226. e.equals(c) ? a.cancel() : g.equals(c) && (b = !0)
  11227. }
  11228. }, null, null, -1)
  11229. }
  11230. var d = !0,
  11231. b = !1;
  11232. CKEDITOR.dom.selection.setupEditorOptimization = function(a) {
  11233. a.on("selectionCheck", function(a) {
  11234. a.data && !b && a.data.optimizeInElementEnds();
  11235. b = !1
  11236. });
  11237. a.on("contentDom", function() {
  11238. var b = a.editable();
  11239. b && (b.attachListener(b, "keydown", function(a) {
  11240. this._.shiftPressed = a.data.$.shiftKey
  11241. }, this), b.attachListener(b, "keyup", function(a) {
  11242. this._.shiftPressed =
  11243. a.data.$.shiftKey
  11244. }, this))
  11245. })
  11246. };
  11247. CKEDITOR.dom.selection.prototype.optimizeInElementEnds = function() {
  11248. var b = this.getRanges()[0],
  11249. g = this.root.editor,
  11250. e;
  11251. if (this.root.editor._.shiftPressed || this.isFake || b.isCollapsed || b.startContainer.equals(b
  11252. .endContainer) || (b.endContainer.is ? b.endContainer.is("li") : b.endContainer.getParent().is && b
  11253. .endContainer.getParent().is("li"))) e = !1;
  11254. else if (0 === b.endOffset) e = !0;
  11255. else {
  11256. e = b.startContainer.type === CKEDITOR.NODE_TEXT;
  11257. var h = b.endContainer.type === CKEDITOR.NODE_TEXT,
  11258. k = e ? b.startContainer.getLength() :
  11259. b.startContainer.getChildCount();
  11260. e = b.startOffset === k || e ^ h
  11261. }
  11262. e && (e = b.clone(), b.shrink(CKEDITOR.SHRINK_TEXT, !1, {
  11263. skipBogus: !CKEDITOR.env.webkit
  11264. }), d = !1, a(g, b, e), b.select(), d = !0)
  11265. }
  11266. })();
  11267. (function() {
  11268. function a(a, c) {
  11269. if (b(a)) a = Math.round(c * (parseFloat(a) / 100));
  11270. else if ("string" === typeof a && a.match(/^\d+$/gm) || "string" === typeof a && a.match(/^\d+(?:deg)?$/gm))
  11271. a = parseInt(a, 10);
  11272. return a
  11273. }
  11274. function d(a, c) {
  11275. b(a) ? a = c * (parseFloat(a) / 100) : "string" === typeof a && a.match(/^\d?\.\d+/gm) && (a = parseFloat(a));
  11276. return a
  11277. }
  11278. function b(a) {
  11279. return "string" === typeof a && a.match(/^((\d*\.\d+)|(\d+))%{1}$/gm)
  11280. }
  11281. function c(a, b, c) {
  11282. return !isNaN(a) && a >= b && a <= c
  11283. }
  11284. function g(a) {
  11285. a = a.toString(16);
  11286. return 1 == a.length ? "0" + a : a
  11287. }
  11288. CKEDITOR.tools.color =
  11289. CKEDITOR.tools.createClass({
  11290. $: function(a, b) {
  11291. this._.initialColorCode = a;
  11292. this._.defaultValue = b;
  11293. this._.parseInput(a)
  11294. },
  11295. proto: {
  11296. getHex: function() {
  11297. if (!this._.isValidColor) return this._.defaultValue;
  11298. var a = this._.blendAlphaColor(this._.red, this._.green, this._.blue, this._.alpha);
  11299. return this._.formatHexString(a[0], a[1], a[2])
  11300. },
  11301. getHexWithAlpha: function() {
  11302. if (!this._.isValidColor) return this._.defaultValue;
  11303. var a = Math.round(this._.alpha * CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE);
  11304. return this._.formatHexString(this._.red,
  11305. this._.green, this._.blue, a)
  11306. },
  11307. getRgb: function() {
  11308. if (!this._.isValidColor) return this._.defaultValue;
  11309. var a = this._.blendAlphaColor(this._.red, this._.green, this._.blue, this._.alpha);
  11310. return this._.formatRgbString("rgb", a[0], a[1], a[2])
  11311. },
  11312. getRgba: function() {
  11313. return this._.isValidColor ? this._.formatRgbString("rgba", this._.red, this._.green, this._.blue,
  11314. this._.alpha) : this._.defaultValue
  11315. },
  11316. getHsl: function() {
  11317. var a = 0 === this._.alpha || 1 === this._.alpha;
  11318. if (!this._.isValidColor) return this._.defaultValue;
  11319. this._.type ===
  11320. CKEDITOR.tools.color.TYPE_HSL && a ? a = [this._.hue, this._.saturation, this._.lightness] : (a =
  11321. this._.blendAlphaColor(this._.red, this._.green, this._.blue, this._.alpha), a = this._
  11322. .rgbToHsl(a[0], a[1], a[2]));
  11323. return this._.formatHslString("hsl", a[0], a[1], a[2])
  11324. },
  11325. getHsla: function() {
  11326. var a;
  11327. if (!this._.isValidColor) return this._.defaultValue;
  11328. a = this._.type === CKEDITOR.tools.color.TYPE_HSL ? [this._.hue, this._.saturation, this._
  11329. .lightness] : this._.rgbToHsl(this._.red, this._.green, this._.blue);
  11330. return this._.formatHslString("hsla",
  11331. a[0], a[1], a[2], this._.alpha)
  11332. },
  11333. getInitialValue: function() {
  11334. return this._.initialColorCode
  11335. }
  11336. },
  11337. _: {
  11338. initialColorCode: "",
  11339. isValidColor: !0,
  11340. type: 0,
  11341. hue: 0,
  11342. saturation: 0,
  11343. lightness: 0,
  11344. red: 0,
  11345. green: 0,
  11346. blue: 0,
  11347. alpha: 1,
  11348. blendAlphaColor: function(a, b, c, d) {
  11349. return CKEDITOR.tools.array.map([a, b, c], function(a) {
  11350. return Math.round(CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE - d * (CKEDITOR.tools.color
  11351. .MAX_RGB_CHANNEL_VALUE - a))
  11352. })
  11353. },
  11354. formatHexString: function(a, b, c, d) {
  11355. a = "#" + g(a) + g(b) + g(c);
  11356. void 0 !== d && (a += g(d));
  11357. return a.toUpperCase()
  11358. },
  11359. formatRgbString: function(a,
  11360. b, c, d, g) {
  11361. b = [b, c, d];
  11362. void 0 !== g && b.push(g);
  11363. return a + "(" + b.join(",") + ")"
  11364. },
  11365. formatHslString: function(a, b, c, d, g) {
  11366. return a + "(" + b + "," + c + "%," + d + "%" + (void 0 !== g ? "," + g : "") + ")"
  11367. },
  11368. parseInput: function(a) {
  11369. if ("string" !== typeof a) this._.isValidColor = !1;
  11370. else {
  11371. a = CKEDITOR.tools.trim(a);
  11372. var b = this._.matchStringToNamedColor(a);
  11373. b && (a = b);
  11374. var b = this._.extractColorChannelsFromHex(a),
  11375. c = this._.extractColorChannelsFromRgba(a);
  11376. a = this._.extractColorChannelsFromHsla(a);
  11377. (a = b || c || a) ? (this._.type = a.type, this._.red = a.red, this._.green =
  11378. a.green, this._.blue = a.blue, this._.alpha = a.alpha, a.type === CKEDITOR.tools.color
  11379. .TYPE_HSL && (this._.hue = a.hue, this._.saturation = a.saturation, this._.lightness = a
  11380. .lightness)) : this._.isValidColor = !1
  11381. }
  11382. },
  11383. matchStringToNamedColor: function(a) {
  11384. return CKEDITOR.tools.color.namedColors[a.toLowerCase()] || null
  11385. },
  11386. extractColorChannelsFromHex: function(a) {
  11387. -1 === a.indexOf("#") && (a = "#" + a);
  11388. a.match(CKEDITOR.tools.color.hex3CharsRegExp) && (a = this._.hex3ToHex6(a));
  11389. a.match(CKEDITOR.tools.color.hex4CharsRegExp) && (a = this._.hex4ToHex8(a));
  11390. if (!a.match(CKEDITOR.tools.color.hex6CharsRegExp) && !a.match(CKEDITOR.tools.color
  11391. .hex8CharsRegExp)) return null;
  11392. a = a.split("");
  11393. var b = 1;
  11394. a[7] && a[8] && (b = parseInt(a[7] + a[8], 16), b /= CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE, b =
  11395. Number(b.toFixed(1)));
  11396. return {
  11397. type: CKEDITOR.tools.color.TYPE_RGB,
  11398. red: parseInt(a[1] + a[2], 16),
  11399. green: parseInt(a[3] + a[4], 16),
  11400. blue: parseInt(a[5] + a[6], 16),
  11401. alpha: b
  11402. }
  11403. },
  11404. extractColorChannelsFromRgba: function(b) {
  11405. var c = this._.extractColorChannelsByPattern(b, CKEDITOR.tools.color.rgbRegExp);
  11406. if (!c ||
  11407. 3 > c.length || 4 < c.length) return null;
  11408. var g = 4 === c.length;
  11409. b = a(c[0], CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE);
  11410. var l = a(c[1], CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE),
  11411. q = a(c[2], CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE),
  11412. f = 1;
  11413. g && (f = d(c[3], CKEDITOR.tools.color.MAX_ALPHA_CHANNEL_VALUE));
  11414. c = {
  11415. type: CKEDITOR.tools.color.TYPE_RGB,
  11416. red: b,
  11417. green: l,
  11418. blue: q,
  11419. alpha: f
  11420. };
  11421. return this._.areColorChannelsValid(b, l, q, f) ? c : null
  11422. },
  11423. extractColorChannelsFromHsla: function(b) {
  11424. var c = this._.extractColorChannelsByPattern(b, CKEDITOR.tools.color.hslRegExp);
  11425. if (!c || 3 > c.length || 4 < c.length) return null;
  11426. var g = 4 === c.length,
  11427. l = a(c[0], CKEDITOR.tools.color.MAX_HUE_CHANNEL_VALUE),
  11428. q = d(c[1], CKEDITOR.tools.color.MAX_SATURATION_LIGHTNESS_CHANNEL_VALUE),
  11429. f = d(c[2], CKEDITOR.tools.color.MAX_SATURATION_LIGHTNESS_CHANNEL_VALUE),
  11430. w = 1;
  11431. b = this._.hslToRgb(l, q, f);
  11432. g && (w = d(c[3], CKEDITOR.tools.color.MAX_ALPHA_CHANNEL_VALUE));
  11433. b.push(w);
  11434. c = {
  11435. type: CKEDITOR.tools.color.TYPE_HSL,
  11436. red: b[0],
  11437. green: b[1],
  11438. blue: b[2],
  11439. alpha: b[3],
  11440. hue: l,
  11441. saturation: Math.round(100 * q),
  11442. lightness: Math.round(100 * f)
  11443. };
  11444. return this._.areColorChannelsValid(b[0],
  11445. b[1], b[2], b[3]) ? c : null
  11446. },
  11447. hex3ToHex6: function(a) {
  11448. a = a.split("");
  11449. return "#" + a[1] + a[1] + a[2] + a[2] + a[3] + a[3]
  11450. },
  11451. hex4ToHex8: function(a) {
  11452. return this._.hex3ToHex6(a.substr(0, 4)) + CKEDITOR.tools.repeat(a[4], 2)
  11453. },
  11454. extractColorChannelsByPattern: function(a, b) {
  11455. var c = a.match(b);
  11456. if (!c) return null;
  11457. var d = -1 === c[1].indexOf(",") ? /\s/ : ",",
  11458. d = c[1].split(d),
  11459. d = CKEDITOR.tools.array.reduce(d, function(a, b) {
  11460. var c = CKEDITOR.tools.trim(b);
  11461. return 0 === c.length ? a : a.concat([c])
  11462. }, []);
  11463. c[2] && (c = CKEDITOR.tools.trim(c[2].replace(/[\/,]/, "")), d.push(c));
  11464. return d
  11465. },
  11466. areColorChannelsValid: function(a, b, d, g) {
  11467. return c(a, 0, CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE) && c(b, 0, CKEDITOR.tools.color
  11468. .MAX_RGB_CHANNEL_VALUE) && c(d, 0, CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE) && c(g, 0,
  11469. CKEDITOR.tools.color.MAX_ALPHA_CHANNEL_VALUE)
  11470. },
  11471. hslToRgb: function(a, b, c) {
  11472. var d = function(d) {
  11473. var f = (d + a / 30) % 12;
  11474. d = b * Math.min(c, 1 - c);
  11475. f = Math.min(f - 3, 9 - f, 1);
  11476. f = Math.max(-1, f);
  11477. return Math.round((c - d * f) * CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE)
  11478. };
  11479. return [d(0), d(8), d(4)]
  11480. },
  11481. rgbToHsl: function(a, b, c) {
  11482. a /=
  11483. CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE;
  11484. b /= CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE;
  11485. var d = c / CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE,
  11486. g = Math.max(a, b, d),
  11487. f = Math.min(a, b, d);
  11488. c = g - f;
  11489. var w = 0;
  11490. switch (g) {
  11491. case a:
  11492. w = (b - d) / c % 6;
  11493. break;
  11494. case b:
  11495. w = (d - a) / c + 2;
  11496. break;
  11497. case d:
  11498. w = (a - b) / c + 4
  11499. }
  11500. a = 0 === c ? 0 : 60 * w;
  11501. b = (g + f) / 2;
  11502. g = 0;
  11503. 1 !== b && 0 !== b && (g = c / (1 - Math.abs(2 * b - 1)));
  11504. a = Math.round(a);
  11505. g = Math.round(100 * g);
  11506. b = Math.round(100 * b);
  11507. return [a, g, b]
  11508. }
  11509. },
  11510. statics: {
  11511. TYPE_RGB: 1,
  11512. TYPE_HSL: 2,
  11513. MAX_RGB_CHANNEL_VALUE: 255,
  11514. MAX_ALPHA_CHANNEL_VALUE: 1,
  11515. MAX_HUE_CHANNEL_VALUE: 360,
  11516. MAX_SATURATION_LIGHTNESS_CHANNEL_VALUE: 1,
  11517. hex3CharsRegExp: /#([0-9a-f]{3}$)/gim,
  11518. hex4CharsRegExp: /#([0-9a-f]{4}$)/gim,
  11519. hex6CharsRegExp: /#([0-9a-f]{6}$)/gim,
  11520. hex8CharsRegExp: /#([0-9a-f]{8}$)/gim,
  11521. rgbRegExp: /rgba?\(([.,\d\s%]*)(\s*\/\s*[\d.%]+)?\s*\)/i,
  11522. hslRegExp: /hsla?\((\s*(?:[.\d]+(?:deg)?)(?:\s*,?\s*[.\d]+%){2})((?:(?:\s*\/\s*)|(?:\s*,\s*))[\d.]+%?)?\s*\)/i,
  11523. namedColors: {
  11524. aliceblue: "#F0F8FF",
  11525. antiquewhite: "#FAEBD7",
  11526. aqua: "#00FFFF",
  11527. aquamarine: "#7FFFD4",
  11528. azure: "#F0FFFF",
  11529. beige: "#F5F5DC",
  11530. bisque: "#FFE4C4",
  11531. black: "#000000",
  11532. blanchedalmond: "#FFEBCD",
  11533. blue: "#0000FF",
  11534. blueviolet: "#8A2BE2",
  11535. brown: "#A52A2A",
  11536. burlywood: "#DEB887",
  11537. cadetblue: "#5F9EA0",
  11538. chartreuse: "#7FFF00",
  11539. chocolate: "#D2691E",
  11540. coral: "#FF7F50",
  11541. cornflowerblue: "#6495ED",
  11542. cornsilk: "#FFF8DC",
  11543. crimson: "#DC143C",
  11544. cyan: "#00FFFF",
  11545. darkblue: "#00008B",
  11546. darkcyan: "#008B8B",
  11547. darkgoldenrod: "#B8860B",
  11548. darkgray: "#A9A9A9",
  11549. darkgreen: "#006400",
  11550. darkgrey: "#A9A9A9",
  11551. darkkhaki: "#BDB76B",
  11552. darkmagenta: "#8B008B",
  11553. darkolivegreen: "#556B2F",
  11554. darkorange: "#FF8C00",
  11555. darkorchid: "#9932CC",
  11556. darkred: "#8B0000",
  11557. darksalmon: "#E9967A",
  11558. darkseagreen: "#8FBC8F",
  11559. darkslateblue: "#483D8B",
  11560. darkslategray: "#2F4F4F",
  11561. darkslategrey: "#2F4F4F",
  11562. darkturquoise: "#00CED1",
  11563. darkviolet: "#9400D3",
  11564. deeppink: "#FF1493",
  11565. deepskyblue: "#00BFFF",
  11566. dimgray: "#696969",
  11567. dimgrey: "#696969",
  11568. dodgerblue: "#1E90FF",
  11569. firebrick: "#B22222",
  11570. floralwhite: "#FFFAF0",
  11571. forestgreen: "#228B22",
  11572. fuchsia: "#FF00FF",
  11573. gainsboro: "#DCDCDC",
  11574. ghostwhite: "#F8F8FF",
  11575. gold: "#FFD700",
  11576. goldenrod: "#DAA520",
  11577. gray: "#808080",
  11578. green: "#008000",
  11579. greenyellow: "#ADFF2F",
  11580. grey: "#808080",
  11581. honeydew: "#F0FFF0",
  11582. hotpink: "#FF69B4",
  11583. indianred: "#CD5C5C",
  11584. indigo: "#4B0082",
  11585. ivory: "#FFFFF0",
  11586. khaki: "#F0E68C",
  11587. lavender: "#E6E6FA",
  11588. lavenderblush: "#FFF0F5",
  11589. lawngreen: "#7CFC00",
  11590. lemonchiffon: "#FFFACD",
  11591. lightblue: "#ADD8E6",
  11592. lightcoral: "#F08080",
  11593. lightcyan: "#E0FFFF",
  11594. lightgoldenrodyellow: "#FAFAD2",
  11595. lightgray: "#D3D3D3",
  11596. lightgreen: "#90EE90",
  11597. lightgrey: "#D3D3D3",
  11598. lightpink: "#FFB6C1",
  11599. lightsalmon: "#FFA07A",
  11600. lightseagreen: "#20B2AA",
  11601. lightskyblue: "#87CEFA",
  11602. lightslategray: "#778899",
  11603. lightslategrey: "#778899",
  11604. lightsteelblue: "#B0C4DE",
  11605. lightyellow: "#FFFFE0",
  11606. lime: "#00FF00",
  11607. limegreen: "#32CD32",
  11608. linen: "#FAF0E6",
  11609. magenta: "#FF00FF",
  11610. maroon: "#800000",
  11611. mediumaquamarine: "#66CDAA",
  11612. mediumblue: "#0000CD",
  11613. mediumorchid: "#BA55D3",
  11614. mediumpurple: "#9370DB",
  11615. mediumseagreen: "#3CB371",
  11616. mediumslateblue: "#7B68EE",
  11617. mediumspringgreen: "#00FA9A",
  11618. mediumturquoise: "#48D1CC",
  11619. mediumvioletred: "#C71585",
  11620. midnightblue: "#191970",
  11621. mintcream: "#F5FFFA",
  11622. mistyrose: "#FFE4E1",
  11623. moccasin: "#FFE4B5",
  11624. navajowhite: "#FFDEAD",
  11625. navy: "#000080",
  11626. oldlace: "#FDF5E6",
  11627. olive: "#808000",
  11628. olivedrab: "#6B8E23",
  11629. orange: "#FFA500",
  11630. orangered: "#FF4500",
  11631. orchid: "#DA70D6",
  11632. palegoldenrod: "#EEE8AA",
  11633. palegreen: "#98FB98",
  11634. paleturquoise: "#AFEEEE",
  11635. palevioletred: "#DB7093",
  11636. papayawhip: "#FFEFD5",
  11637. peachpuff: "#FFDAB9",
  11638. peru: "#CD853F",
  11639. pink: "#FFC0CB",
  11640. plum: "#DDA0DD",
  11641. powderblue: "#B0E0E6",
  11642. purple: "#800080",
  11643. rebeccapurple: "#663399",
  11644. red: "#FF0000",
  11645. rosybrown: "#BC8F8F",
  11646. royalblue: "#4169E1",
  11647. saddlebrown: "#8B4513",
  11648. salmon: "#FA8072",
  11649. sandybrown: "#F4A460",
  11650. seagreen: "#2E8B57",
  11651. seashell: "#FFF5EE",
  11652. sienna: "#A0522D",
  11653. silver: "#C0C0C0",
  11654. skyblue: "#87CEEB",
  11655. slateblue: "#6A5ACD",
  11656. slategray: "#708090",
  11657. slategrey: "#708090",
  11658. snow: "#FFFAFA",
  11659. springgreen: "#00FF7F",
  11660. steelblue: "#4682B4",
  11661. tan: "#D2B48C",
  11662. teal: "#008080",
  11663. thistle: "#D8BFD8",
  11664. tomato: "#FF6347",
  11665. turquoise: "#40E0D0",
  11666. violet: "#EE82EE",
  11667. windowtext: "windowtext",
  11668. wheat: "#F5DEB3",
  11669. white: "#FFFFFF",
  11670. whitesmoke: "#F5F5F5",
  11671. yellow: "#FFFF00",
  11672. yellowgreen: "#9ACD32"
  11673. }
  11674. }
  11675. });
  11676. CKEDITOR.tools.style.parse._colors = CKEDITOR.tools.color.namedColors
  11677. })();
  11678. CKEDITOR.dom.comment = function(a, d) {
  11679. "string" == typeof a && (a = (d ? d.$ : document).createComment(a));
  11680. CKEDITOR.dom.domObject.call(this, a)
  11681. };
  11682. CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node;
  11683. CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
  11684. type: CKEDITOR.NODE_COMMENT,
  11685. getOuterHtml: function() {
  11686. return "\x3c!--" + this.$.nodeValue + "--\x3e"
  11687. }
  11688. });
  11689. "use strict";
  11690. (function() {
  11691. var a = {},
  11692. d = {},
  11693. b;
  11694. for (b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1);
  11695. for (b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (d[b] = 1);
  11696. CKEDITOR.dom.elementPath = function(b, g) {
  11697. var e = null,
  11698. h = null,
  11699. k = [],
  11700. l = b,
  11701. q;
  11702. g = g || b.getDocument().getBody();
  11703. l || (l = g);
  11704. do
  11705. if (l.type == CKEDITOR.NODE_ELEMENT) {
  11706. k.push(l);
  11707. if (!this.lastElement && (this.lastElement = l, l.is(CKEDITOR.dtd.$object) || "false" == l.getAttribute(
  11708. "contenteditable"))) continue;
  11709. if (l.equals(g)) break;
  11710. if (!h && (q = l.getName(),
  11711. "true" == l.getAttribute("contenteditable") ? h = l : !e && d[q] && (e = l), a[q])) {
  11712. if (q = !e && "div" == q) {
  11713. a: {
  11714. q = l.getChildren();
  11715. for (var f = 0, w = q.count(); f < w; f++) {
  11716. var B = q.getItem(f);
  11717. if (B.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[B.getName()]) {
  11718. q = !0;
  11719. break a
  11720. }
  11721. }
  11722. q = !1
  11723. }
  11724. q = !q
  11725. }
  11726. q ? e = l : h = l
  11727. }
  11728. } while (l = l.getParent());
  11729. h || (h = g);
  11730. this.block = e;
  11731. this.blockLimit = h;
  11732. this.root = g;
  11733. this.elements = k
  11734. }
  11735. })();
  11736. CKEDITOR.dom.elementPath.prototype = {
  11737. compare: function(a) {
  11738. var d = this.elements;
  11739. a = a && a.elements;
  11740. if (!a || d.length != a.length) return !1;
  11741. for (var b = 0; b < d.length; b++)
  11742. if (!d[b].equals(a[b])) return !1;
  11743. return !0
  11744. },
  11745. contains: function(a, d, b) {
  11746. var c = 0,
  11747. g;
  11748. "string" == typeof a && (g = function(b) {
  11749. return b.getName() == a
  11750. });
  11751. a instanceof CKEDITOR.dom.element ? g = function(b) {
  11752. return b.equals(a)
  11753. } : CKEDITOR.tools.isArray(a) ? g = function(b) {
  11754. return -1 < CKEDITOR.tools.indexOf(a, b.getName())
  11755. } : "function" == typeof a ? g = a : "object" == typeof a && (g = function(b) {
  11756. return b.getName() in
  11757. a
  11758. });
  11759. var e = this.elements,
  11760. h = e.length;
  11761. d && (b ? c += 1 : --h);
  11762. b && (e = Array.prototype.slice.call(e, 0), e.reverse());
  11763. for (; c < h; c++)
  11764. if (g(e[c])) return e[c];
  11765. return null
  11766. },
  11767. isContextFor: function(a) {
  11768. var d;
  11769. return a in CKEDITOR.dtd.$block ? (d = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this
  11770. .block) && this.block || this.blockLimit, !!d.getDtd()[a]) : !0
  11771. },
  11772. direction: function() {
  11773. return (this.block || this.blockLimit || this.root).getDirection(1)
  11774. }
  11775. };
  11776. CKEDITOR.dom.text = function(a, d) {
  11777. "string" == typeof a && (a = (d ? d.$ : document).createTextNode(a));
  11778. this.$ = a
  11779. };
  11780. CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node;
  11781. CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
  11782. type: CKEDITOR.NODE_TEXT,
  11783. getLength: function() {
  11784. return this.$.nodeValue.length
  11785. },
  11786. getText: function() {
  11787. return this.$.nodeValue
  11788. },
  11789. setText: function(a) {
  11790. this.$.nodeValue = a
  11791. },
  11792. isEmpty: function(a) {
  11793. var d = this.getText();
  11794. a && (d = CKEDITOR.tools.trim(d));
  11795. return !d || d === CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE
  11796. },
  11797. split: function(a) {
  11798. var d = this.$.parentNode,
  11799. b = d.childNodes.length,
  11800. c = this.getLength(),
  11801. g = this.getDocument(),
  11802. e = new CKEDITOR.dom.text(this.$.splitText(a), g);
  11803. d.childNodes.length ==
  11804. b && (a >= c ? (e = g.createText(""), e.insertAfter(this)) : (a = g.createText(""), a.insertAfter(e), a
  11805. .remove()));
  11806. return e
  11807. },
  11808. substring: function(a, d) {
  11809. return "number" != typeof d ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, d)
  11810. }
  11811. });
  11812. (function() {
  11813. function a(a, c, d) {
  11814. var e = a.serializable,
  11815. h = c[d ? "endContainer" : "startContainer"],
  11816. k = d ? "endOffset" : "startOffset",
  11817. l = e ? c.document.getById(a.startNode) : a.startNode;
  11818. a = e ? c.document.getById(a.endNode) : a.endNode;
  11819. h.equals(l.getPrevious()) ? (c.startOffset = c.startOffset - h.getLength() - a.getPrevious().getLength(), h =
  11820. a.getNext()) : h.equals(a.getPrevious()) && (c.startOffset -= h.getLength(), h = a.getNext());
  11821. h.equals(l.getParent()) && c[k]++;
  11822. h.equals(a.getParent()) && c[k]++;
  11823. c[d ? "endContainer" : "startContainer"] = h;
  11824. return c
  11825. }
  11826. CKEDITOR.dom.rangeList = function(a) {
  11827. if (a instanceof CKEDITOR.dom.rangeList) return a;
  11828. a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = [];
  11829. return CKEDITOR.tools.extend(a, d)
  11830. };
  11831. var d = {
  11832. createIterator: function() {
  11833. var a = this,
  11834. c = CKEDITOR.dom.walker.bookmark(),
  11835. d = [],
  11836. e;
  11837. return {
  11838. getNextRange: function(h) {
  11839. e = void 0 === e ? 0 : e + 1;
  11840. var k = a[e];
  11841. if (k && 1 < a.length) {
  11842. if (!e)
  11843. for (var l = a.length - 1; 0 <= l; l--) d.unshift(a[l].createBookmark(!0));
  11844. if (h)
  11845. for (var q = 0; a[e + q + 1];) {
  11846. var f = k.document;
  11847. h = 0;
  11848. l = f.getById(d[q].endNode);
  11849. for (f = f.getById(d[q + 1].startNode);;) {
  11850. l =
  11851. l.getNextSourceNode(!1);
  11852. if (f.equals(l)) h = 1;
  11853. else if (c(l) || l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) continue;
  11854. break
  11855. }
  11856. if (!h) break;
  11857. q++
  11858. }
  11859. for (k.moveToBookmark(d.shift()); q--;) l = a[++e], l.moveToBookmark(d.shift()), k.setEnd(l
  11860. .endContainer, l.endOffset)
  11861. }
  11862. return k
  11863. }
  11864. }
  11865. },
  11866. createBookmarks: function(b) {
  11867. for (var c = [], d, e = 0; e < this.length; e++) {
  11868. c.push(d = this[e].createBookmark(b, !0));
  11869. for (var h = e + 1; h < this.length; h++) this[h] = a(d, this[h]), this[h] = a(d, this[h], !0)
  11870. }
  11871. return c
  11872. },
  11873. createBookmarks2: function(a) {
  11874. for (var c = [], d = 0; d <
  11875. this.length; d++) c.push(this[d].createBookmark2(a));
  11876. return c
  11877. },
  11878. moveToBookmarks: function(a) {
  11879. for (var c = 0; c < this.length; c++) this[c].moveToBookmark(a[c])
  11880. }
  11881. }
  11882. })();
  11883. (function() {
  11884. function a() {
  11885. return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/")
  11886. }
  11887. function d(b) {
  11888. var c = CKEDITOR.skin["ua_" + b],
  11889. d = CKEDITOR.env;
  11890. if (c)
  11891. for (var c = c.split(",").sort(function(a, b) {
  11892. return a > b ? -1 : 1
  11893. }), e = 0, g; e < c.length; e++)
  11894. if (g = c[e], d.ie && (g.replace(/^ie/, "") == d.version || d.quirks && "iequirks" == g) && (g = "ie"), d[
  11895. g]) {
  11896. b += "_" + c[e];
  11897. break
  11898. } return CKEDITOR.getUrl(a() + b + ".css")
  11899. }
  11900. function b(a, b) {
  11901. e[a] || (CKEDITOR.document.appendStyleSheet(d(a)), e[a] = 1);
  11902. b && b()
  11903. }
  11904. function c(a) {
  11905. var b =
  11906. a.getById(h);
  11907. b || (b = a.getHead().append("style"), b.setAttribute("id", h), b.setAttribute("type", "text/css"));
  11908. return b
  11909. }
  11910. function g(a, b, c) {
  11911. var d, e, g;
  11912. if (CKEDITOR.env.webkit)
  11913. for (b = b.split("}").slice(0, -1), e = 0; e < b.length; e++) b[e] = b[e].split("{");
  11914. for (var h = 0; h < a.length; h++)
  11915. if (CKEDITOR.env.webkit)
  11916. for (e = 0; e < b.length; e++) {
  11917. g = b[e][1];
  11918. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  11919. a[h].$.sheet.addRule(b[e][0], g)
  11920. } else {
  11921. g = b;
  11922. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  11923. CKEDITOR.env.ie && 11 > CKEDITOR.env.version ?
  11924. a[h].$.styleSheet.cssText += g : a[h].$.innerHTML += g
  11925. }
  11926. }
  11927. var e = {};
  11928. CKEDITOR.skin = {
  11929. path: a,
  11930. loadPart: function(c, d) {
  11931. CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() +
  11932. "skin.js"), function() {
  11933. b(c, d)
  11934. }) : b(c, d)
  11935. },
  11936. getPath: function(a) {
  11937. return CKEDITOR.getUrl(d(a))
  11938. },
  11939. icons: {},
  11940. addIcon: function(a, b, c, d) {
  11941. a = a.toLowerCase();
  11942. this.icons[a] || (this.icons[a] = {
  11943. path: b,
  11944. offset: c || 0,
  11945. bgsize: d || "16px"
  11946. })
  11947. },
  11948. getIconStyle: function(a, b, c, d, e) {
  11949. var g;
  11950. a && (a = a.toLowerCase(), b && (g = this.icons[a + "-rtl"]),
  11951. g || (g = this.icons[a]));
  11952. a = c || g && g.path || "";
  11953. d = d || g && g.offset;
  11954. e = e || g && g.bgsize || "16px";
  11955. a && (a = a.replace(/'/g, "\\'"));
  11956. return a && "background-image:url('" + CKEDITOR.getUrl(a) + "');background-position:0 " + d +
  11957. "px;background-size:" + e + ";"
  11958. }
  11959. };
  11960. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  11961. getUiColor: function() {
  11962. return this.uiColor
  11963. },
  11964. setUiColor: function(a) {
  11965. var b = c(CKEDITOR.document);
  11966. return (this.setUiColor = function(a) {
  11967. this.uiColor = a;
  11968. var c = CKEDITOR.skin.chameleon,
  11969. d = "",
  11970. e = "";
  11971. "function" == typeof c && (d = c(this, "editor"), e =
  11972. c(this, "panel"));
  11973. a = [
  11974. [l, a]
  11975. ];
  11976. g([b], d, a);
  11977. g(k, e, a)
  11978. }).call(this, a)
  11979. }
  11980. });
  11981. var h = "cke_ui_color",
  11982. k = [],
  11983. l = /\$color/g;
  11984. CKEDITOR.on("instanceLoaded", function(a) {
  11985. if (!CKEDITOR.env.ie || !CKEDITOR.env.quirks) {
  11986. var b = a.editor;
  11987. a = function(a) {
  11988. a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
  11989. if (!a.getById("cke_ui_color")) {
  11990. var d = c(a);
  11991. k.push(d);
  11992. b.on("destroy", function() {
  11993. k = CKEDITOR.tools.array.filter(k, function(a) {
  11994. return d !== a
  11995. })
  11996. });
  11997. (a = b.getUiColor()) && g([d], CKEDITOR.skin.chameleon(b, "panel"),
  11998. [
  11999. [l, a]
  12000. ])
  12001. }
  12002. };
  12003. b.on("panelShow", a);
  12004. b.on("menuShow", a);
  12005. b.config.uiColor && b.setUiColor(b.config.uiColor)
  12006. }
  12007. })
  12008. })();
  12009. (function() {
  12010. var a = CKEDITOR.dom.element.createFromHtml(
  12011. '\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',
  12012. CKEDITOR.document);
  12013. a.appendTo(CKEDITOR.document.getHead());
  12014. try {
  12015. var d = a.getComputedStyle("border-top-color"),
  12016. b = a.getComputedStyle("border-right-color");
  12017. CKEDITOR.env.hc = !(!d || d != b)
  12018. } catch (c) {
  12019. CKEDITOR.env.hc = !1
  12020. }
  12021. a.remove();
  12022. CKEDITOR.env.hc && (CKEDITOR.env.cssClass += " cke_hc");
  12023. CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
  12024. CKEDITOR.status = "loaded";
  12025. CKEDITOR.fireOnce("loaded");
  12026. if (a = CKEDITOR._.pending)
  12027. for (delete CKEDITOR._.pending, d = 0; d < a.length; d++) CKEDITOR.editor.prototype.constructor.apply(a[d][0],
  12028. a[d][1]), CKEDITOR.add(a[d][0])
  12029. })();
  12030. /*
  12031. Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
  12032. CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model.
  12033. */
  12034. CKEDITOR.skin.name = "moono-lisa";
  12035. CKEDITOR.skin.ua_editor = "ie,iequirks,ie8,gecko";
  12036. CKEDITOR.skin.ua_dialog = "ie,iequirks,ie8";
  12037. CKEDITOR.skin.chameleon = function() {
  12038. var b = function() {
  12039. return function(b, d) {
  12040. for (var a = b.match(/[^#]./g), e = 0; 3 > e; e++) {
  12041. var f = e,
  12042. c;
  12043. c = parseInt(a[e], 16);
  12044. c = ("0" + (0 > d ? 0 | c * (1 + d) : 0 | c + (255 - c) * d).toString(16)).slice(-2);
  12045. a[f] = c
  12046. }
  12047. return "#" + a.join("")
  12048. }
  12049. }(),
  12050. f = {
  12051. editor: new CKEDITOR.template(
  12052. "{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {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} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {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:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "
  12053. ),
  12054. panel: new CKEDITOR.template(
  12055. ".cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] "
  12056. )
  12057. };
  12058. return function(g, d) {
  12059. var a = b(g.uiColor, .4),
  12060. a = {
  12061. id: "." + g.id,
  12062. defaultBorder: b(a, -.2),
  12063. toolbarElementsBorder: b(a, -.25),
  12064. defaultBackground: a,
  12065. lightBackground: b(a, .8),
  12066. darkBackground: b(a, -.15),
  12067. ckeButtonOn: b(a, .4),
  12068. ckeResizer: b(a, -.4),
  12069. ckeColorauto: b(a, .8),
  12070. dialogBody: b(a, .7),
  12071. dialogTab: b(a, .65),
  12072. dialogTabSelected: "#FFF",
  12073. dialogTabSelectedBorder: "#FFF",
  12074. elementsPathColor: b(a, -.6),
  12075. menubuttonHover: b(a, .1),
  12076. menubuttonIcon: b(a, .5),
  12077. menubuttonIconHover: b(a, .3)
  12078. };
  12079. return f[d].output(a).replace(/\[/g, "{").replace(/\]/g, "}")
  12080. }
  12081. }();
  12082. CKEDITOR.plugins.add("dialogui", {
  12083. onLoad: function() {
  12084. var k = function(b) {
  12085. this._ || (this._ = {});
  12086. this._["default"] = this._.initValue = b["default"] || "";
  12087. this._.required = b.required || !1;
  12088. for (var a = [this._], d = 1; d < arguments.length; d++) a.push(arguments[d]);
  12089. a.push(!0);
  12090. CKEDITOR.tools.extend.apply(CKEDITOR.tools, a);
  12091. return this._
  12092. },
  12093. r = {
  12094. build: function(b, a, d) {
  12095. return new CKEDITOR.ui.dialog.textInput(b, a, d)
  12096. }
  12097. },
  12098. m = {
  12099. build: function(b, a, d) {
  12100. return new CKEDITOR.ui.dialog[a.type](b, a, d)
  12101. }
  12102. },
  12103. q = {
  12104. isChanged: function() {
  12105. return this.getValue() !=
  12106. this.getInitValue()
  12107. },
  12108. reset: function(b) {
  12109. this.setValue(this.getInitValue(), b)
  12110. },
  12111. setInitValue: function() {
  12112. this._.initValue = this.getValue()
  12113. },
  12114. resetInitValue: function() {
  12115. this._.initValue = this._["default"]
  12116. },
  12117. getInitValue: function() {
  12118. return this._.initValue
  12119. }
  12120. },
  12121. v = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  12122. onChange: function(b, a) {
  12123. this._.domOnChangeRegistered || (b.on("load", function() {
  12124. this.getInputElement().on("change", function() {
  12125. b.parts.dialog.isVisible() && this.fire("change", {
  12126. value: this.getValue()
  12127. })
  12128. },
  12129. this)
  12130. }, this), this._.domOnChangeRegistered = !0);
  12131. this.on("change", a)
  12132. }
  12133. }, !0),
  12134. x = /^on([A-Z]\w+)/,
  12135. t = function(b) {
  12136. for (var a in b)(x.test(a) || "title" == a || "type" == a) && delete b[a];
  12137. return b
  12138. },
  12139. w = function(b) {
  12140. b = b.data.getKeystroke();
  12141. b == CKEDITOR.SHIFT + CKEDITOR.ALT + 36 ? this.setDirectionMarker("ltr") : b == CKEDITOR.SHIFT +
  12142. CKEDITOR.ALT + 35 && this.setDirectionMarker("rtl")
  12143. };
  12144. CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
  12145. labeledElement: function(b, a, d, e) {
  12146. if (!(4 > arguments.length)) {
  12147. var c = k.call(this, a);
  12148. c.labelId = CKEDITOR.tools.getNextId() +
  12149. "_label";
  12150. this._.children = [];
  12151. var f = {
  12152. role: a.role || "presentation"
  12153. };
  12154. a.includeLabel && (f["aria-labelledby"] = c.labelId);
  12155. CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "div", null, f, function() {
  12156. var d = [],
  12157. g = a.required ? " cke_required" : "";
  12158. "horizontal" != a.labelLayout ? d.push(
  12159. '\x3clabel class\x3d"cke_dialog_ui_labeled_label' + g + '" ', ' id\x3d"' + c
  12160. .labelId + '"', c.inputId ? ' for\x3d"' + c.inputId + '"' : "", (a.labelStyle ?
  12161. ' style\x3d"' + a.labelStyle + '"' : "") + "\x3e", a.required ? a.label +
  12162. '\x3cspan class\x3d"cke_dialog_ui_labeled_required" aria-hidden\x3d"true"\x3e*\x3c/span\x3e' :
  12163. a.label, "\x3c/label\x3e", '\x3cdiv class\x3d"cke_dialog_ui_labeled_content"', a
  12164. .controlStyle ? ' style\x3d"' + a.controlStyle + '"' : "",
  12165. ' role\x3d"presentation"\x3e', e.call(this, b, a), "\x3c/div\x3e") : (g = {
  12166. type: "hbox",
  12167. widths: a.widths,
  12168. padding: 0,
  12169. children: [{
  12170. type: "html",
  12171. html: '\x3clabel class\x3d"cke_dialog_ui_labeled_label' + g + '" id\x3d"' +
  12172. c.labelId + '" for\x3d"' + c.inputId + '"' + (a.labelStyle ?
  12173. ' style\x3d"' + a.labelStyle + '"' : "") + "\x3e" + CKEDITOR.tools
  12174. .htmlEncode(a.label) + "\x3c/label\x3e"
  12175. }, {
  12176. type: "html",
  12177. html: '\x3cspan class\x3d"cke_dialog_ui_labeled_content"' +
  12178. (a.controlStyle ? ' style\x3d"' + a.controlStyle + '"' : "") + "\x3e" + e
  12179. .call(this, b, a) + "\x3c/span\x3e"
  12180. }]
  12181. }, CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, g, d));
  12182. return d.join("")
  12183. })
  12184. }
  12185. },
  12186. textInput: function(b, a, d) {
  12187. if (!(3 > arguments.length)) {
  12188. k.call(this, a);
  12189. var e = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
  12190. c = {
  12191. "class": "cke_dialog_ui_input_" + a.type,
  12192. id: e,
  12193. type: a.type
  12194. };
  12195. a.validate && (this.validate = a.validate);
  12196. a.maxLength && (c.maxlength = a.maxLength);
  12197. a.size && (c.size = a.size);
  12198. a.inputStyle && (c.style = a.inputStyle);
  12199. var f =
  12200. this,
  12201. h = !1;
  12202. b.on("load", function() {
  12203. f.getInputElement().on("keydown", function(a) {
  12204. 13 == a.data.getKeystroke() && (h = !0)
  12205. });
  12206. f.getInputElement().on("keyup", function(a) {
  12207. 13 == a.data.getKeystroke() && h && (b.getButton("ok") && setTimeout(function() {
  12208. b.getButton("ok").click()
  12209. }, 0), h = !1);
  12210. f.bidi && w.call(f, a)
  12211. }, null, null, 1E3)
  12212. });
  12213. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  12214. var b = ['\x3cdiv class\x3d"cke_dialog_ui_input_', a.type, '" role\x3d"presentation"'];
  12215. a.width && b.push('style\x3d"width:' + a.width + '" ');
  12216. b.push("\x3e\x3cinput ");
  12217. c["aria-labelledby"] = this._.labelId;
  12218. this._.required && (c["aria-required"] = this._.required);
  12219. for (var e in c) b.push(e + '\x3d"' + c[e] + '" ');
  12220. b.push(" /\x3e\x3c/div\x3e");
  12221. return b.join("")
  12222. })
  12223. }
  12224. },
  12225. textarea: function(b, a, d) {
  12226. if (!(3 > arguments.length)) {
  12227. k.call(this, a);
  12228. var e = this,
  12229. c = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea",
  12230. f = {};
  12231. a.validate && (this.validate = a.validate);
  12232. f.rows = a.rows || 5;
  12233. f.cols = a.cols || 20;
  12234. f["class"] = "cke_dialog_ui_input_textarea " + (a["class"] || "");
  12235. "undefined" != typeof a.inputStyle && (f.style = a.inputStyle);
  12236. a.dir && (f.dir = a.dir);
  12237. if (e.bidi) b.on("load", function() {
  12238. e.getInputElement().on("keyup", w)
  12239. }, e);
  12240. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  12241. f["aria-labelledby"] = this._.labelId;
  12242. this._.required && (f["aria-required"] = this._.required);
  12243. var a = [
  12244. '\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',
  12245. c, '" '
  12246. ],
  12247. b;
  12248. for (b in f) a.push(b + '\x3d"' + CKEDITOR.tools.htmlEncode(f[b]) + '" ');
  12249. a.push("\x3e", CKEDITOR.tools.htmlEncode(e._["default"]),
  12250. "\x3c/textarea\x3e\x3c/div\x3e");
  12251. return a.join("")
  12252. })
  12253. }
  12254. },
  12255. checkbox: function(b, a, d) {
  12256. if (!(3 > arguments.length)) {
  12257. var e = k.call(this, a, {
  12258. "default": !!a["default"]
  12259. });
  12260. a.validate && (this.validate = a.validate);
  12261. CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "span", null, null, function() {
  12262. var c = CKEDITOR.tools.extend({}, a, {
  12263. id: a.id ? a.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox"
  12264. }, !0),
  12265. d = [],
  12266. h = CKEDITOR.tools.getNextId() + "_label",
  12267. g = {
  12268. "class": "cke_dialog_ui_checkbox_input",
  12269. type: "checkbox",
  12270. "aria-labelledby": h
  12271. };
  12272. t(c);
  12273. a["default"] && (g.checked = "checked");
  12274. "undefined" !=
  12275. typeof c.inputStyle && (c.style = c.inputStyle);
  12276. e.checkbox = new CKEDITOR.ui.dialog.uiElement(b, c, d, "input", null, g);
  12277. d.push(' \x3clabel id\x3d"', h, '" for\x3d"', g.id, '"' + (a.labelStyle ?
  12278. ' style\x3d"' + a.labelStyle + '"' : "") + "\x3e", CKEDITOR.tools.htmlEncode(a
  12279. .label), "\x3c/label\x3e");
  12280. return d.join("")
  12281. })
  12282. }
  12283. },
  12284. radio: function(b, a, d) {
  12285. if (!(3 > arguments.length)) {
  12286. k.call(this, a);
  12287. this._["default"] || (this._["default"] = this._.initValue = a.items[0][1]);
  12288. a.validate && (this.validate = a.validate);
  12289. var e = [],
  12290. c = this;
  12291. a.role = "radiogroup";
  12292. a.includeLabel = !0;
  12293. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  12294. for (var d = [], h = [], g = (a.id ? a.id : CKEDITOR.tools.getNextId()) + "_radio", n =
  12295. 0; n < a.items.length; n++) {
  12296. var l = a.items[n],
  12297. k = void 0 !== l[2] ? l[2] : l[0],
  12298. m = void 0 !== l[1] ? l[1] : l[0],
  12299. p = CKEDITOR.tools.getNextId() + "_radio_input",
  12300. q = p + "_label",
  12301. p = CKEDITOR.tools.extend({}, a, {
  12302. id: p,
  12303. title: null,
  12304. type: null
  12305. }, !0),
  12306. k = CKEDITOR.tools.extend({}, p, {
  12307. title: k
  12308. }, !0),
  12309. r = {
  12310. type: "radio",
  12311. "class": "cke_dialog_ui_radio_input",
  12312. name: g,
  12313. value: m,
  12314. "aria-labelledby": q
  12315. },
  12316. u = [];
  12317. c._["default"] ==
  12318. m && (r.checked = "checked");
  12319. t(p);
  12320. t(k);
  12321. "undefined" != typeof p.inputStyle && (p.style = p.inputStyle);
  12322. m = new CKEDITOR.ui.dialog.uiElement(b, p, u, "input", null, r);
  12323. m.on("focus", function() {
  12324. c.click()
  12325. });
  12326. e.push(m);
  12327. u.push(" ");
  12328. new CKEDITOR.ui.dialog.uiElement(b, k, u, "label", null, {
  12329. id: q,
  12330. "for": r.id
  12331. }, l[0]);
  12332. d.push(u.join(""))
  12333. }
  12334. new CKEDITOR.ui.dialog.hbox(b, e, d, h);
  12335. return h.join("")
  12336. });
  12337. this._.children = e
  12338. }
  12339. },
  12340. button: function(b, a, d) {
  12341. if (arguments.length) {
  12342. "function" == typeof a && (a = a(b.getParentEditor()));
  12343. k.call(this, a, {
  12344. disabled: a.disabled ||
  12345. !1
  12346. });
  12347. CKEDITOR.event.implementOn(this);
  12348. var e = this;
  12349. b.on("load", function() {
  12350. var a = this.getElement();
  12351. (function() {
  12352. a.on("click", function(a) {
  12353. e.click();
  12354. a.data.preventDefault()
  12355. });
  12356. a.on("keydown", function(a) {
  12357. a.data.getKeystroke() in {
  12358. 32: 1
  12359. } && (e.click(), a.data.preventDefault())
  12360. })
  12361. })();
  12362. a.unselectable()
  12363. }, this);
  12364. var c = CKEDITOR.tools.extend({}, a);
  12365. delete c.style;
  12366. var f = CKEDITOR.tools.getNextId() + "_label";
  12367. CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "a", null, {
  12368. style: a.style,
  12369. href: "javascript:void(0)",
  12370. title: a.label,
  12371. hidefocus: "true",
  12372. "class": a["class"],
  12373. role: "button",
  12374. "aria-labelledby": f
  12375. }, '\x3cspan id\x3d"' + f + '" class\x3d"cke_dialog_ui_button"\x3e' + CKEDITOR.tools
  12376. .htmlEncode(a.label) + "\x3c/span\x3e")
  12377. }
  12378. },
  12379. select: function(b, a, d) {
  12380. if (!(3 > arguments.length)) {
  12381. var e = k.call(this, a);
  12382. a.validate && (this.validate = a.validate);
  12383. e.inputId = CKEDITOR.tools.getNextId() + "_select";
  12384. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  12385. var c = CKEDITOR.tools.extend({}, a, {
  12386. id: a.id ? a.id + "_select" : CKEDITOR.tools.getNextId() + "_select"
  12387. }, !0),
  12388. d = [],
  12389. h = [],
  12390. g = {
  12391. id: e.inputId,
  12392. "class": "cke_dialog_ui_input_select",
  12393. "aria-labelledby": this._.labelId
  12394. };
  12395. d.push('\x3cdiv class\x3d"cke_dialog_ui_input_', a.type, '" role\x3d"presentation"');
  12396. a.width && d.push('style\x3d"width:' + a.width + '" ');
  12397. d.push("\x3e");
  12398. void 0 !== a.size && (g.size = a.size);
  12399. void 0 !== a.multiple && (g.multiple = a.multiple);
  12400. t(c);
  12401. for (var n = 0, l; n < a.items.length && (l = a.items[n]); n++) h.push(
  12402. '\x3coption value\x3d"', CKEDITOR.tools.htmlEncode(void 0 !== l[1] ? l[1] : l[0])
  12403. .replace(/"/g, "\x26quot;"), '" /\x3e ', CKEDITOR.tools.htmlEncode(l[0]));
  12404. "undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
  12405. e.select = new CKEDITOR.ui.dialog.uiElement(b, c, d, "select", null, g, h.join(""));
  12406. d.push("\x3c/div\x3e");
  12407. return d.join("")
  12408. })
  12409. }
  12410. },
  12411. file: function(b, a, d) {
  12412. if (!(3 > arguments.length)) {
  12413. void 0 === a["default"] && (a["default"] = "");
  12414. var e = CKEDITOR.tools.extend(k.call(this, a), {
  12415. definition: a,
  12416. buttons: []
  12417. });
  12418. a.validate && (this.validate = a.validate);
  12419. b.on("load", function() {
  12420. CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")
  12421. });
  12422. CKEDITOR.ui.dialog.labeledElement.call(this,
  12423. b, a, d,
  12424. function() {
  12425. e.frameId = CKEDITOR.tools.getNextId() + "_fileInput";
  12426. var b = [
  12427. '\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
  12428. e.frameId, '" title\x3d"', a.label, '" src\x3d"javascript:void('
  12429. ];
  12430. b.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" +
  12431. CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
  12432. b.push(')"\x3e\x3c/iframe\x3e');
  12433. return b.join("")
  12434. })
  12435. }
  12436. },
  12437. fileButton: function(b, a, d) {
  12438. var e = this;
  12439. if (!(3 > arguments.length)) {
  12440. k.call(this,
  12441. a);
  12442. a.validate && (this.validate = a.validate);
  12443. var c = CKEDITOR.tools.extend({}, a),
  12444. f = c.onClick;
  12445. c.className = (c.className ? c.className + " " : "") + "cke_dialog_ui_button";
  12446. c.onClick = function(c) {
  12447. var d = a["for"];
  12448. c = f ? f.call(this, c) : !1;
  12449. !1 !== c && ("xhr" !== c && b.getContentElement(d[0], d[1]).submit(), this.disable())
  12450. };
  12451. b.on("load", function() {
  12452. b.getContentElement(a["for"][0], a["for"][1])._.buttons.push(e)
  12453. });
  12454. CKEDITOR.ui.dialog.button.call(this, b, c, d)
  12455. }
  12456. },
  12457. html: function() {
  12458. var b = /^\s*<[\w:]+\s+([^>]*)?>/,
  12459. a = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
  12460. d = /\/$/;
  12461. return function(e, c, f) {
  12462. if (!(3 > arguments.length)) {
  12463. var h = [],
  12464. g = c.html;
  12465. "\x3c" != g.charAt(0) && (g = "\x3cspan\x3e" + g + "\x3c/span\x3e");
  12466. var n = c.focus;
  12467. if (n) {
  12468. var l = this.focus;
  12469. this.focus = function() {
  12470. ("function" == typeof n ? n : l).call(this);
  12471. this.fire("focus")
  12472. };
  12473. c.isFocusable && (this.isFocusable = this.isFocusable);
  12474. this.keyboardFocusable = !0
  12475. }
  12476. CKEDITOR.ui.dialog.uiElement.call(this, e, c, h, "span", null, null, "");
  12477. h = h.join("").match(b);
  12478. g = g.match(a) || ["", "", ""];
  12479. d.test(g[1]) && (g[1] = g[1].slice(0, -1), g[2] = "/" + g[2]);
  12480. f.push([g[1],
  12481. " ", h[1] || "", g[2]
  12482. ].join(""))
  12483. }
  12484. }
  12485. }(),
  12486. fieldset: function(b, a, d, e, c) {
  12487. var f = c.label;
  12488. this._ = {
  12489. children: a
  12490. };
  12491. CKEDITOR.ui.dialog.uiElement.call(this, b, c, e, "fieldset", null, null, function() {
  12492. var a = [];
  12493. f && a.push("\x3clegend" + (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : "") +
  12494. "\x3e" + f + "\x3c/legend\x3e");
  12495. for (var b = 0; b < d.length; b++) a.push(d[b]);
  12496. return a.join("")
  12497. })
  12498. }
  12499. }, !0);
  12500. CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
  12501. CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  12502. setLabel: function(b) {
  12503. var a = CKEDITOR.document.getById(this._.labelId);
  12504. 1 > a.getChildCount() ? (new CKEDITOR.dom.text(b, CKEDITOR.document)).appendTo(a) : a.getChild(
  12505. 0).$.nodeValue = b;
  12506. return this
  12507. },
  12508. getLabel: function() {
  12509. var b = CKEDITOR.document.getById(this._.labelId);
  12510. return !b || 1 > b.getChildCount() ? "" : b.getChild(0).getText()
  12511. },
  12512. eventProcessors: v
  12513. }, !0);
  12514. CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  12515. click: function() {
  12516. return this._.disabled ? !1 : this.fire("click", {
  12517. dialog: this._.dialog
  12518. })
  12519. },
  12520. enable: function() {
  12521. this._.disabled = !1;
  12522. var b = this.getElement();
  12523. b && b.removeClass("cke_disabled")
  12524. },
  12525. disable: function() {
  12526. this._.disabled = !0;
  12527. this.getElement().addClass("cke_disabled")
  12528. },
  12529. isVisible: function() {
  12530. return this.getElement().getFirst().isVisible()
  12531. },
  12532. isEnabled: function() {
  12533. return !this._.disabled
  12534. },
  12535. eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  12536. onClick: function(b, a) {
  12537. this.on("click", function() {
  12538. a.apply(this, arguments)
  12539. })
  12540. }
  12541. }, !0),
  12542. accessKeyUp: function() {
  12543. this.click()
  12544. },
  12545. accessKeyDown: function() {
  12546. this.focus()
  12547. },
  12548. keyboardFocusable: !0
  12549. }, !0);
  12550. CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  12551. getInputElement: function() {
  12552. return CKEDITOR.document.getById(this._.inputId)
  12553. },
  12554. focus: function() {
  12555. var b = this.selectParentTab();
  12556. setTimeout(function() {
  12557. var a = b.getInputElement();
  12558. a && a.$.focus()
  12559. }, 0)
  12560. },
  12561. select: function() {
  12562. var b = this.selectParentTab();
  12563. setTimeout(function() {
  12564. var a = b.getInputElement();
  12565. a && (a.$.focus(), a.$.select())
  12566. }, 0)
  12567. },
  12568. accessKeyUp: function() {
  12569. this.select()
  12570. },
  12571. setValue: function(b) {
  12572. if (this.bidi) {
  12573. var a = b && b.charAt(0);
  12574. (a = "‪" == a ? "ltr" : "‫" == a ? "rtl" : null) && (b = b.slice(1));
  12575. this.setDirectionMarker(a)
  12576. }
  12577. b || (b = "");
  12578. return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments)
  12579. },
  12580. getValue: function() {
  12581. var b = CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);
  12582. if (this.bidi && b) {
  12583. var a = this.getDirectionMarker();
  12584. a && (b = ("ltr" == a ? "‪" : "‫") + b)
  12585. }
  12586. return b
  12587. },
  12588. setDirectionMarker: function(b) {
  12589. var a = this.getInputElement();
  12590. b ? a.setAttributes({
  12591. dir: b,
  12592. "data-cke-dir-marker": b
  12593. }) :
  12594. this.getDirectionMarker() && a.removeAttributes(["dir", "data-cke-dir-marker"])
  12595. },
  12596. getDirectionMarker: function() {
  12597. return this.getInputElement().data("cke-dir-marker")
  12598. },
  12599. keyboardFocusable: !0
  12600. }, q, !0);
  12601. CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput;
  12602. CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  12603. getInputElement: function() {
  12604. return this._.select.getElement()
  12605. },
  12606. add: function(b, a, d) {
  12607. var e = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
  12608. c = this.getInputElement().$;
  12609. e.$.text = b;
  12610. e.$.value = void 0 === a || null === a ? b : a;
  12611. void 0 === d || null === d ? CKEDITOR.env.ie ? c.add(e.$) : c.add(e.$, null) : c.add(e.$, d);
  12612. return this
  12613. },
  12614. remove: function(b) {
  12615. this.getInputElement().$.remove(b);
  12616. return this
  12617. },
  12618. clear: function() {
  12619. for (var b = this.getInputElement().$; 0 < b.length;) b.remove(0);
  12620. return this
  12621. },
  12622. keyboardFocusable: !0
  12623. }, q, !0);
  12624. CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  12625. getInputElement: function() {
  12626. return this._.checkbox.getElement()
  12627. },
  12628. setValue: function(b, a) {
  12629. this.getInputElement().$.checked = b;
  12630. !a && this.fire("change", {
  12631. value: b
  12632. });
  12633. return this
  12634. },
  12635. getValue: function() {
  12636. return this.getInputElement().$.checked
  12637. },
  12638. accessKeyUp: function() {
  12639. this.setValue(!this.getValue())
  12640. },
  12641. eventProcessors: {
  12642. onChange: function(b, a) {
  12643. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return v.onChange.apply(this, arguments);
  12644. b.on("load", function() {
  12645. var a = this._.checkbox.getElement();
  12646. a.on("propertychange", function(b) {
  12647. b = b.data.$;
  12648. "checked" == b.propertyName && this.fire("change", {
  12649. value: a.$.checked
  12650. })
  12651. },
  12652. this)
  12653. }, this);
  12654. this.on("change", a);
  12655. return null
  12656. }
  12657. },
  12658. keyboardFocusable: !0
  12659. }, q, !0);
  12660. CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  12661. focus: function() {
  12662. var b = this._.children,
  12663. a = b[0],
  12664. d = this._.dialog._,
  12665. e = d.currentFocusIndex,
  12666. c = e === d.focusList.length - 1 && 0 === this.focusIndex;
  12667. e > this.focusIndex && !c && (a = b[b.length - 1]);
  12668. d.currentFocusIndex = this.focusIndex;
  12669. for (d = 0; d < b.length; d++)
  12670. if (e = b[d], e.getInputElement().$.checked) {
  12671. a = e;
  12672. break
  12673. } a.focus()
  12674. },
  12675. setValue: function(b, a) {
  12676. for (var d = this._.children,
  12677. e, c = 0; c < d.length && (e = d[c]); c++) e.getElement().$.checked = e.getValue() == b;
  12678. !a && this.fire("change", {
  12679. value: b
  12680. });
  12681. return this
  12682. },
  12683. getValue: function() {
  12684. for (var b = this._.children, a = 0; a < b.length; a++)
  12685. if (b[a].getElement().$.checked) return b[a].getValue();
  12686. return null
  12687. },
  12688. accessKeyUp: function() {
  12689. var b = this._.children,
  12690. a;
  12691. for (a = 0; a < b.length; a++)
  12692. if (b[a].getElement().$.checked) {
  12693. b[a].getElement().focus();
  12694. return
  12695. } b[0].getElement().focus()
  12696. },
  12697. click: function() {
  12698. this._.dialog._.currentFocusIndex = this.focusIndex
  12699. },
  12700. eventProcessors: {
  12701. onChange: function(b,
  12702. a) {
  12703. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return v.onChange.apply(this, arguments);
  12704. b.on("load", function() {
  12705. for (var a = this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on(
  12706. "propertychange",
  12707. function(a) {
  12708. a = a.data.$;
  12709. "checked" == a.propertyName && this.$.checked && b.fire("change", {
  12710. value: this.getAttribute("value")
  12711. })
  12712. })
  12713. }, this);
  12714. this.on("change", a);
  12715. return null
  12716. }
  12717. },
  12718. keyboardFocusable: !0
  12719. }, q, !0);
  12720. CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, q, {
  12721. getInputElement: function() {
  12722. var b =
  12723. CKEDITOR.document.getById(this._.frameId).getFrameDocument();
  12724. return 0 < b.$.forms.length ? new CKEDITOR.dom.element(b.$.forms[0].elements[0]) : this
  12725. .getElement()
  12726. },
  12727. submit: function() {
  12728. this.getInputElement().getParent().$.submit();
  12729. return this
  12730. },
  12731. getAction: function() {
  12732. return this.getInputElement().getParent().$.action
  12733. },
  12734. registerEvents: function(b) {
  12735. var a = /^on([A-Z]\w+)/,
  12736. d, e = function(a, b, c, d) {
  12737. a.on("formLoaded", function() {
  12738. a.getInputElement().on(c, d, a)
  12739. })
  12740. },
  12741. c;
  12742. for (c in b)
  12743. if (d = c.match(a)) this.eventProcessors[c] ? this.eventProcessors[c].call(this,
  12744. this._.dialog, b[c]) : e(this, this._.dialog, d[1].toLowerCase(), b[c]);
  12745. return this
  12746. },
  12747. reset: function() {
  12748. function b() {
  12749. d.$.open();
  12750. var b = "";
  12751. e.size && (b = e.size - (CKEDITOR.env.ie ? 7 : 0));
  12752. var k = a.frameId + "_input";
  12753. d.$.write(['\x3chtml dir\x3d"' + g + '" lang\x3d"' + n +
  12754. '"\x3e\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e\x3cbody style\x3d"margin: 0; overflow: hidden; background: transparent;"\x3e',
  12755. '\x3cform enctype\x3d"multipart/form-data" method\x3d"POST" dir\x3d"' + g +
  12756. '" lang\x3d"' + n + '" action\x3d"', CKEDITOR.tools.htmlEncode(e.action),
  12757. '"\x3e\x3clabel id\x3d"', a.labelId, '" for\x3d"', k, '" style\x3d"display:none"\x3e',
  12758. CKEDITOR.tools.htmlEncode(e.label),
  12759. '\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"', k, '" aria-labelledby\x3d"', a
  12760. .labelId, '" type\x3d"file" name\x3d"', CKEDITOR.tools.htmlEncode(e.id || "cke_upload"),
  12761. '" size\x3d"', CKEDITOR.tools.htmlEncode(0 < b ? b : ""),
  12762. '" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e', CKEDITOR.env.ie ? "(" +
  12763. CKEDITOR.tools.fixDomain + ")();" : "", "window.parent.CKEDITOR.tools.callFunction(" +
  12764. f + ");",
  12765. "window.onbeforeunload \x3d function() {window.parent.CKEDITOR.tools.callFunction(" +
  12766. h + ")}", "\x3c/script\x3e"
  12767. ].join(""));
  12768. d.$.close();
  12769. for (b = 0; b < c.length; b++) c[b].enable()
  12770. }
  12771. var a = this._,
  12772. d = CKEDITOR.document.getById(a.frameId).getFrameDocument(),
  12773. e = a.definition,
  12774. c = a.buttons,
  12775. f = this.formLoadedNumber,
  12776. h = this.formUnloadNumber,
  12777. g = a.dialog._.editor.lang.dir,
  12778. n = a.dialog._.editor.langCode;
  12779. f || (f = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() {
  12780. this.fire("formLoaded")
  12781. }, this), h = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() {
  12782. this.getInputElement().clearCustomData()
  12783. },
  12784. this), this.getDialog()._.editor.on("destroy", function() {
  12785. CKEDITOR.tools.removeFunction(f);
  12786. CKEDITOR.tools.removeFunction(h)
  12787. }));
  12788. CKEDITOR.env.gecko ? setTimeout(b, 500) : b()
  12789. },
  12790. getValue: function() {
  12791. return this.getInputElement().$.value || ""
  12792. },
  12793. setInitValue: function() {
  12794. this._.initValue = ""
  12795. },
  12796. eventProcessors: {
  12797. onChange: function(b, a) {
  12798. this._.domOnChangeRegistered || (this.on("formLoaded", function() {
  12799. this.getInputElement().on("change", function() {
  12800. this.fire("change", {
  12801. value: this.getValue()
  12802. })
  12803. }, this)
  12804. }, this), this._.domOnChangeRegistered = !0);
  12805. this.on("change", a)
  12806. }
  12807. },
  12808. keyboardFocusable: !0
  12809. }, !0);
  12810. CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
  12811. CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
  12812. CKEDITOR.dialog.addUIElement("text", r);
  12813. CKEDITOR.dialog.addUIElement("password", r);
  12814. CKEDITOR.dialog.addUIElement("tel", r);
  12815. CKEDITOR.dialog.addUIElement("textarea", m);
  12816. CKEDITOR.dialog.addUIElement("checkbox", m);
  12817. CKEDITOR.dialog.addUIElement("radio", m);
  12818. CKEDITOR.dialog.addUIElement("button", m);
  12819. CKEDITOR.dialog.addUIElement("select", m);
  12820. CKEDITOR.dialog.addUIElement("file", m);
  12821. CKEDITOR.dialog.addUIElement("fileButton", m);
  12822. CKEDITOR.dialog.addUIElement("html", m);
  12823. CKEDITOR.dialog.addUIElement("fieldset", {
  12824. build: function(b, a, d) {
  12825. for (var e = a.children, c, f = [], h = [], g = 0; g < e.length && (c = e[g]); g++) {
  12826. var k = [];
  12827. f.push(k);
  12828. h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b, c, k))
  12829. }
  12830. return new CKEDITOR.ui.dialog[a.type](b, h, f, d, a)
  12831. }
  12832. })
  12833. }
  12834. });
  12835. CKEDITOR.DIALOG_RESIZE_NONE = 0;
  12836. CKEDITOR.DIALOG_RESIZE_WIDTH = 1;
  12837. CKEDITOR.DIALOG_RESIZE_HEIGHT = 2;
  12838. CKEDITOR.DIALOG_RESIZE_BOTH = 3;
  12839. CKEDITOR.DIALOG_STATE_IDLE = 1;
  12840. CKEDITOR.DIALOG_STATE_BUSY = 2;
  12841. (function() {
  12842. function I(a) {
  12843. a._.tabBarMode = !0;
  12844. a._.tabs[a._.currentTabId][0].focus();
  12845. a._.currentFocusIndex = -1
  12846. }
  12847. function J() {
  12848. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a,
  12849. c = b - 1; c > b - a; c--)
  12850. if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  12851. return null
  12852. }
  12853. function W() {
  12854. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c =
  12855. b + 1; c < b + a; c++)
  12856. if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c %
  12857. a];
  12858. return null
  12859. }
  12860. function K(a, b) {
  12861. for (var c = a.$.getElementsByTagName("input"), e = 0, d = c.length; e < d; e++) {
  12862. var f = new CKEDITOR.dom.element(c[e]);
  12863. "text" == f.getAttribute("type").toLowerCase() && (b ? (f.setAttribute("value", f.getCustomData(
  12864. "fake_value") || ""), f.removeCustomData("fake_value")) : (f.setCustomData("fake_value", f
  12865. .getAttribute("value")), f.setAttribute("value", "")))
  12866. }
  12867. }
  12868. function X(a, b) {
  12869. var c = this.getInputElement();
  12870. c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", !0));
  12871. a || (this.select ? this.select() :
  12872. this.focus());
  12873. b && alert(b);
  12874. this.fire("validated", {
  12875. valid: a,
  12876. msg: b
  12877. })
  12878. }
  12879. function Y() {
  12880. var a = this.getInputElement();
  12881. a && a.removeAttribute("aria-invalid")
  12882. }
  12883. function Z(a) {
  12884. var b = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog", aa).output({
  12885. id: CKEDITOR.tools.getNextNumber(),
  12886. editorId: a.id,
  12887. langDir: a.lang.dir,
  12888. langCode: a.langCode,
  12889. editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog",
  12890. closeTitle: a.lang.common.close,
  12891. hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : ""
  12892. })),
  12893. c = b.getChild([0, 0, 0, 0, 0]),
  12894. e =
  12895. c.getChild(0),
  12896. d = c.getChild(1);
  12897. a.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c);
  12898. !CKEDITOR.env.ie || CKEDITOR.env.quirks || CKEDITOR.env.edge || (a = "javascript:void(function(){" +
  12899. encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())",
  12900. CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"' +
  12901. a + '" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(c.getParent()));
  12902. e.unselectable();
  12903. d.unselectable();
  12904. return {
  12905. element: b,
  12906. parts: {
  12907. dialog: b.getChild(0),
  12908. title: e,
  12909. close: d,
  12910. tabs: c.getChild(2),
  12911. contents: c.getChild([3, 0, 0, 0]),
  12912. footer: c.getChild([3, 0, 1, 0])
  12913. }
  12914. }
  12915. }
  12916. function L(a, b, c) {
  12917. this.element = b;
  12918. this.focusIndex = c;
  12919. this.tabIndex = 0;
  12920. this.isFocusable = function() {
  12921. return !b.getAttribute("disabled") && b.isVisible()
  12922. };
  12923. this.focus = function() {
  12924. a._.currentFocusIndex = this.focusIndex;
  12925. this.element.focus()
  12926. };
  12927. b.on("keydown", function(a) {
  12928. a.data.getKeystroke() in {
  12929. 32: 1,
  12930. 13: 1
  12931. } && this.fire("click")
  12932. });
  12933. b.on("focus", function() {
  12934. this.fire("mouseover")
  12935. });
  12936. b.on("blur", function() {
  12937. this.fire("mouseout")
  12938. })
  12939. }
  12940. function ba(a) {
  12941. function b() {
  12942. a.layout()
  12943. }
  12944. var c = CKEDITOR.document.getWindow();
  12945. c.on("resize", b);
  12946. a.on("hide", function() {
  12947. c.removeListener("resize", b)
  12948. })
  12949. }
  12950. function M(a, b) {
  12951. this.dialog = a;
  12952. for (var c = b.contents, e = 0, d; d = c[e]; e++) c[e] = d && new N(a, d);
  12953. CKEDITOR.tools.extend(this, b)
  12954. }
  12955. function N(a, b) {
  12956. this._ = {
  12957. dialog: a
  12958. };
  12959. CKEDITOR.tools.extend(this, b)
  12960. }
  12961. function ca(a) {
  12962. function b(b) {
  12963. var c = a.getSize(),
  12964. h = a.parts.dialog.getParent().getClientSize(),
  12965. q = b.data.$.screenX,
  12966. m = b.data.$.screenY,
  12967. r = q - e.x,
  12968. n = m - e.y;
  12969. e = {
  12970. x: q,
  12971. y: m
  12972. };
  12973. d.x += r;
  12974. d.y += n;
  12975. q = d.x + k[3] < g ? -k[3] : d.x - k[1] > h.width - c.width - g ? h.width - c.width + ("rtl" == f.lang.dir ?
  12976. 0 : k[1]) : d.x;
  12977. c = d.y + k[0] < g ? -k[0] : d.y - k[2] > h.height - c.height - g ? h.height - c.height + k[2] : d.y;
  12978. q = Math.floor(q);
  12979. c = Math.floor(c);
  12980. a.move(q, c, 1);
  12981. b.data.preventDefault()
  12982. }
  12983. function c() {
  12984. CKEDITOR.document.removeListener("mousemove", b);
  12985. CKEDITOR.document.removeListener("mouseup", c);
  12986. if (CKEDITOR.env.ie6Compat) {
  12987. var a = u.getChild(0).getFrameDocument();
  12988. a.removeListener("mousemove", b);
  12989. a.removeListener("mouseup",
  12990. c)
  12991. }
  12992. }
  12993. var e = null,
  12994. d = null,
  12995. f = a.getParentEditor(),
  12996. g = f.config.dialog_magnetDistance,
  12997. k = CKEDITOR.skin.margins || [0, 0, 0, 0];
  12998. "undefined" == typeof g && (g = 20);
  12999. a.parts.title.on("mousedown", function(f) {
  13000. if (!a._.moved) {
  13001. var g = a._.element;
  13002. g.getFirst().setStyle("position", "absolute");
  13003. g.removeStyle("display");
  13004. a._.moved = !0;
  13005. a.layout()
  13006. }
  13007. e = {
  13008. x: f.data.$.screenX,
  13009. y: f.data.$.screenY
  13010. };
  13011. CKEDITOR.document.on("mousemove", b);
  13012. CKEDITOR.document.on("mouseup", c);
  13013. d = a.getPosition();
  13014. CKEDITOR.env.ie6Compat && (g = u.getChild(0).getFrameDocument(), g.on("mousemove",
  13015. b), g.on("mouseup", c));
  13016. f.data.preventDefault()
  13017. }, a)
  13018. }
  13019. function da(a) {
  13020. function b(b) {
  13021. var c = "rtl" == f.lang.dir,
  13022. m = h.width,
  13023. q = h.height,
  13024. w = m + (b.data.$.screenX - l.x) * (c ? -1 : 1) * (a._.moved ? 1 : 2),
  13025. A = q + (b.data.$.screenY - l.y) * (a._.moved ? 1 : 2),
  13026. C = a._.element.getFirst(),
  13027. C = c && parseInt(C.getComputedStyle("right"), 10),
  13028. v = a.getPosition();
  13029. v.x = v.x || 0;
  13030. v.y = v.y || 0;
  13031. v.y + A > p.height && (A = p.height - v.y);
  13032. (c ? C : v.x) + w > p.width && (w = p.width - (c ? C : v.x));
  13033. A = Math.floor(A);
  13034. w = Math.floor(w);
  13035. if (d == CKEDITOR.DIALOG_RESIZE_WIDTH || d == CKEDITOR.DIALOG_RESIZE_BOTH) m =
  13036. Math.max(e.minWidth || 0, w - g);
  13037. if (d == CKEDITOR.DIALOG_RESIZE_HEIGHT || d == CKEDITOR.DIALOG_RESIZE_BOTH) q = Math.max(e.minHeight || 0,
  13038. A - k);
  13039. a.resize(m, q);
  13040. a._.moved && O(a, a._.position.x, a._.position.y);
  13041. a._.moved || a.layout();
  13042. b.data.preventDefault()
  13043. }
  13044. function c() {
  13045. CKEDITOR.document.removeListener("mouseup", c);
  13046. CKEDITOR.document.removeListener("mousemove", b);
  13047. q && (q.remove(), q = null);
  13048. if (CKEDITOR.env.ie6Compat) {
  13049. var a = u.getChild(0).getFrameDocument();
  13050. a.removeListener("mouseup", c);
  13051. a.removeListener("mousemove", b)
  13052. }
  13053. }
  13054. var e = a.definition,
  13055. d = e.resizable;
  13056. if (d != CKEDITOR.DIALOG_RESIZE_NONE) {
  13057. var f = a.getParentEditor(),
  13058. g, k, p, l, h, q, m = CKEDITOR.tools.addFunction(function(d) {
  13059. function e(a) {
  13060. return a.isVisible()
  13061. }
  13062. h = a.getSize();
  13063. var f = a.parts.contents,
  13064. m = f.$.getElementsByTagName("iframe").length,
  13065. w = !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks);
  13066. m && (q = CKEDITOR.dom.element.createFromHtml(
  13067. '\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'
  13068. ), f.append(q));
  13069. k = h.height -
  13070. a.parts.contents.getFirst(e).getSize("height", w);
  13071. g = h.width - a.parts.contents.getFirst(e).getSize("width", 1);
  13072. l = {
  13073. x: d.screenX,
  13074. y: d.screenY
  13075. };
  13076. p = CKEDITOR.document.getWindow().getViewPaneSize();
  13077. CKEDITOR.document.on("mousemove", b);
  13078. CKEDITOR.document.on("mouseup", c);
  13079. CKEDITOR.env.ie6Compat && (f = u.getChild(0).getFrameDocument(), f.on("mousemove", b), f.on("mouseup",
  13080. c));
  13081. d.preventDefault && d.preventDefault()
  13082. });
  13083. a.on("load", function() {
  13084. var b = "";
  13085. d == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = " cke_resizer_horizontal" : d == CKEDITOR
  13086. .DIALOG_RESIZE_HEIGHT &&
  13087. (b = " cke_resizer_vertical");
  13088. b = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer' + b + " cke_resizer_" + f.lang
  13089. .dir + '" title\x3d"' + CKEDITOR.tools.htmlEncode(f.lang.common.resize) +
  13090. '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + m + ', event )"\x3e' + ("ltr" == f.lang.dir ?
  13091. "◢" : "◣") + "\x3c/div\x3e");
  13092. a.parts.footer.append(b, 1)
  13093. });
  13094. f.on("destroy", function() {
  13095. CKEDITOR.tools.removeFunction(m)
  13096. })
  13097. }
  13098. }
  13099. function O(a, b, c) {
  13100. var e = a.parts.dialog.getParent().getClientSize(),
  13101. d = a.getSize(),
  13102. f = a._.viewportRatio,
  13103. g = Math.max(e.width -
  13104. d.width, 0),
  13105. e = Math.max(e.height - d.height, 0);
  13106. f.width = g ? b / g : f.width;
  13107. f.height = e ? c / e : f.height;
  13108. a._.viewportRatio = f
  13109. }
  13110. function H(a) {
  13111. a.data.preventDefault(1)
  13112. }
  13113. function P(a) {
  13114. var b = a.config,
  13115. c = CKEDITOR.skinName || a.config.skin,
  13116. e = b.dialog_backgroundCoverColor || ("moono-lisa" == c ? "black" : "white"),
  13117. c = b.dialog_backgroundCoverOpacity,
  13118. d = b.baseFloatZIndex,
  13119. b = CKEDITOR.tools.genKey(e, c, d),
  13120. f = B[b];
  13121. CKEDITOR.document.getBody().addClass("cke_dialog_open");
  13122. f ? f.show() : (d = ['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ', CKEDITOR.env.ie6Compat ?
  13123. "absolute" : "fixed", "; z-index: ", d, "; top: 0px; left: 0px; ", "; width: 100%; height: 100%;",
  13124. CKEDITOR.env.ie6Compat ? "" : "background-color: " + e, '" class\x3d"cke_dialog_background_cover"\x3e'
  13125. ], CKEDITOR.env.ie6Compat && (e = "\x3chtml\x3e\x3cbody style\x3d\\'background-color:" + e +
  13126. ";\\'\x3e\x3c/body\x3e\x3c/html\x3e", d.push(
  13127. '\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'
  13128. ), d.push("void((function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain +
  13129. ")();document.write( '" + e + "' );document.close();") + "})())"), d.push(
  13130. '" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e'
  13131. )), d.push("\x3c/div\x3e"), f = CKEDITOR.dom.element.createFromHtml(d.join("")), f.setOpacity(
  13132. void 0 !== c ? c : .5), f.on("keydown", H), f.on("keypress", H), f.on("keyup", H), f.appendTo(CKEDITOR
  13133. .document.getBody()), B[b] = f);
  13134. a.focusManager.add(f);
  13135. u = f;
  13136. CKEDITOR.env.mac && CKEDITOR.env.webkit || f.focus()
  13137. }
  13138. function Q(a) {
  13139. CKEDITOR.document.getBody().removeClass("cke_dialog_open");
  13140. u && (a.focusManager.remove(u), u.hide())
  13141. }
  13142. function R(a) {
  13143. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  13144. c = a.data.$.altKey,
  13145. e = a.data.$.shiftKey,
  13146. d = String.fromCharCode(a.data.$.keyCode);
  13147. (b = x[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (e ? "SHIFT+" : "") + d]) && b.length && (b = b[b.length - 1],
  13148. b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key), a.data.preventDefault())
  13149. }
  13150. function S(a) {
  13151. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  13152. c = a.data.$.altKey,
  13153. e = a.data.$.shiftKey,
  13154. d = String.fromCharCode(a.data.$.keyCode);
  13155. (b = x[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (e ?
  13156. "SHIFT+" : "") + d]) && b.length && (b = b[b.length - 1], b.keyup && (b.keyup.call(b.uiElement, b.dialog, b
  13157. .key), a.data.preventDefault()))
  13158. }
  13159. function T(a, b, c, e, d) {
  13160. (x[c] || (x[c] = [])).push({
  13161. uiElement: a,
  13162. dialog: b,
  13163. key: c,
  13164. keyup: d || a.accessKeyUp,
  13165. keydown: e || a.accessKeyDown
  13166. })
  13167. }
  13168. function ea(a) {
  13169. for (var b in x) {
  13170. for (var c = x[b], e = c.length - 1; 0 <= e; e--) c[e].dialog != a && c[e].uiElement != a || c.splice(e, 1);
  13171. 0 === c.length && delete x[b]
  13172. }
  13173. }
  13174. function fa(a, b) {
  13175. a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b])
  13176. }
  13177. function ga() {}
  13178. var y = CKEDITOR.tools.cssLength,
  13179. U, u, V = !1,
  13180. D = !CKEDITOR.env.ie || CKEDITOR.env.edge,
  13181. aa =
  13182. '\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"' +
  13183. (D ? "display:flex" : "") +
  13184. '" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog ' +
  13185. CKEDITOR.env.cssClass + ' cke_{langDir}" style\x3d"' + (D ? "margin:auto" : "position:absolute") +
  13186. '" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e';
  13187. CKEDITOR.dialog = function(a, b) {
  13188. function c() {
  13189. var a = n._.focusList;
  13190. a.sort(function(a, b) {
  13191. return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex
  13192. });
  13193. for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
  13194. }
  13195. function e(a) {
  13196. var b = n._.focusList;
  13197. a = a || 0;
  13198. if (!(1 > b.length)) {
  13199. var c = n._.currentFocusIndex;
  13200. n._.tabBarMode && 0 > a && (c = 0);
  13201. try {
  13202. b[c].getInputElement().$.blur()
  13203. } catch (d) {}
  13204. var e = c,
  13205. f = 1 < n._.pageCount;
  13206. do {
  13207. e += a;
  13208. if (f && !n._.tabBarMode && (e == b.length || -1 == e)) {
  13209. n._.tabBarMode = !0;
  13210. n._.tabs[n._.currentTabId][0].focus();
  13211. n._.currentFocusIndex = -1;
  13212. return
  13213. }
  13214. e = (e + b.length) % b.length;
  13215. if (e == c) break
  13216. } while (a && !b[e].isFocusable());
  13217. b[e].focus();
  13218. "text" == b[e].type && b[e].select()
  13219. }
  13220. }
  13221. function d(b) {
  13222. if (n == CKEDITOR.dialog._.currentTop) {
  13223. var c = b.data.getKeystroke(),
  13224. d = "rtl" == a.lang.dir,
  13225. g = [37, 38, 39, 40];
  13226. q = m = 0;
  13227. if (9 == c || c == CKEDITOR.SHIFT + 9) e(c == CKEDITOR.SHIFT + 9 ? -1 : 1), q = 1;
  13228. else if (c == CKEDITOR.ALT + 121 && !n._.tabBarMode && 1 < n.getPageCount()) I(n), q = 1;
  13229. else if (-1 != CKEDITOR.tools.indexOf(g, c) && n._.tabBarMode) c = -1 != CKEDITOR.tools.indexOf([d ?
  13230. 39 : 37, 38
  13231. ], c) ?
  13232. J.call(n) : W.call(n), n.selectPage(c), n._.tabs[c][0].focus(), q = 1;
  13233. else if (13 != c && 32 != c || !n._.tabBarMode)
  13234. if (13 == c) c = b.data.getTarget(), c.is("a", "button", "select", "textarea") || c.is("input") &&
  13235. "button" == c.$.type || ((c = this.getButton("ok")) && CKEDITOR.tools.setTimeout(c.click, 0, c), q =
  13236. 1), m = 1;
  13237. else if (27 == c)(c = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(c.click, 0, c) : !1 !==
  13238. this.fire("cancel", {
  13239. hide: !0
  13240. }).hide && this.hide(), m = 1;
  13241. else return;
  13242. else this.selectPage(this._.currentTabId), this._.tabBarMode = !1, this._.currentFocusIndex = -1, e(1),
  13243. q = 1;
  13244. f(b)
  13245. }
  13246. }
  13247. function f(a) {
  13248. q ? a.data.preventDefault(1) : m && a.data.stopPropagation()
  13249. }
  13250. var g = CKEDITOR.dialog._.dialogDefinitions[b],
  13251. k = CKEDITOR.tools.clone(U),
  13252. p = a.config.dialog_buttonsOrder || "OS",
  13253. l = a.lang.dir,
  13254. h = {},
  13255. q, m;
  13256. ("OS" == p && CKEDITOR.env.mac || "rtl" == p && "ltr" == l || "ltr" == p && "rtl" == l) && k.buttons
  13257. .reverse();
  13258. g = CKEDITOR.tools.extend(g(a), k);
  13259. g = CKEDITOR.tools.clone(g);
  13260. g = new M(this, g);
  13261. k = Z(a);
  13262. this._ = {
  13263. editor: a,
  13264. element: k.element,
  13265. name: b,
  13266. model: null,
  13267. contentSize: {
  13268. width: 0,
  13269. height: 0
  13270. },
  13271. size: {
  13272. width: 0,
  13273. height: 0
  13274. },
  13275. contents: {},
  13276. buttons: {},
  13277. accessKeyMap: {},
  13278. viewportRatio: {
  13279. width: .5,
  13280. height: .5
  13281. },
  13282. tabs: {},
  13283. tabIdList: [],
  13284. currentTabId: null,
  13285. currentTabIndex: null,
  13286. pageCount: 0,
  13287. lastTab: null,
  13288. tabBarMode: !1,
  13289. focusList: [],
  13290. currentFocusIndex: 0,
  13291. hasFocus: !1
  13292. };
  13293. this.parts = k.parts;
  13294. CKEDITOR.tools.setTimeout(function() {
  13295. a.fire("ariaWidget", this.parts.contents)
  13296. }, 0, this);
  13297. k = {
  13298. top: 0,
  13299. visibility: "hidden"
  13300. };
  13301. CKEDITOR.env.ie6Compat && (k.position = "absolute");
  13302. k["rtl" == l ? "right" : "left"] = 0;
  13303. this.parts.dialog.setStyles(k);
  13304. CKEDITOR.event.call(this);
  13305. this.definition = g = CKEDITOR.fire("dialogDefinition", {
  13306. name: b,
  13307. definition: g,
  13308. dialog: this
  13309. }, a).definition;
  13310. if (!("removeDialogTabs" in a._) && a.config.removeDialogTabs) {
  13311. k = a.config.removeDialogTabs.split(";");
  13312. for (l = 0; l < k.length; l++)
  13313. if (p = k[l].split(":"), 2 == p.length) {
  13314. var r = p[0];
  13315. h[r] || (h[r] = []);
  13316. h[r].push(p[1])
  13317. } a._.removeDialogTabs = h
  13318. }
  13319. if (a._.removeDialogTabs && (h = a._.removeDialogTabs[b]))
  13320. for (l = 0; l < h.length; l++) g.removeContents(h[l]);
  13321. if (g.onLoad) this.on("load", g.onLoad);
  13322. if (g.onShow) this.on("show", g.onShow);
  13323. if (g.onHide) this.on("hide", g.onHide);
  13324. if (g.onOk) this.on("ok",
  13325. function(b) {
  13326. a.fire("saveSnapshot");
  13327. setTimeout(function() {
  13328. a.fire("saveSnapshot")
  13329. }, 0);
  13330. !1 === g.onOk.call(this, b) && (b.data.hide = !1)
  13331. });
  13332. this.state = CKEDITOR.DIALOG_STATE_IDLE;
  13333. if (g.onCancel) this.on("cancel", function(a) {
  13334. !1 === g.onCancel.call(this, a) && (a.data.hide = !1)
  13335. });
  13336. var n = this,
  13337. t = function(a) {
  13338. var b = n._.contents,
  13339. c = !1,
  13340. d;
  13341. for (d in b)
  13342. for (var e in b[d])
  13343. if (c = a.call(this, b[d][e])) return
  13344. };
  13345. this.on("ok", function(a) {
  13346. t(function(b) {
  13347. if (b.validate) {
  13348. var c = b.validate(this),
  13349. d = "string" == typeof c || !1 === c;
  13350. d && (a.data.hide = !1, a.stop());
  13351. X.call(b, !d, "string" == typeof c ? c : void 0);
  13352. return d
  13353. }
  13354. })
  13355. }, this, null, 0);
  13356. this.on("cancel", function(b) {
  13357. t(function(c) {
  13358. if (c.isChanged()) return a.config.dialog_noConfirmCancel || confirm(a.lang.common
  13359. .confirmCancel) || (b.data.hide = !1), !0
  13360. })
  13361. }, this, null, 0);
  13362. this.parts.close.on("click", function(a) {
  13363. !1 !== this.fire("cancel", {
  13364. hide: !0
  13365. }).hide && this.hide();
  13366. a.data.preventDefault()
  13367. }, this);
  13368. this.changeFocus = e;
  13369. var z = this._.element;
  13370. a.focusManager.add(z, 1);
  13371. this.on("show", function() {
  13372. z.on("keydown", d, this);
  13373. if (CKEDITOR.env.gecko) z.on("keypress",
  13374. f, this)
  13375. });
  13376. this.on("hide", function() {
  13377. z.removeListener("keydown", d);
  13378. CKEDITOR.env.gecko && z.removeListener("keypress", f);
  13379. t(function(a) {
  13380. Y.apply(a)
  13381. })
  13382. });
  13383. this.on("iframeAdded", function(a) {
  13384. (new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", d, this, null, 0)
  13385. });
  13386. this.on("show", function() {
  13387. c();
  13388. var b = 1 < n._.pageCount;
  13389. a.config.dialog_startupFocusTab && b ? (n._.tabBarMode = !0, n._.tabs[n._.currentTabId][0].focus(), n
  13390. ._.currentFocusIndex = -1) : this._.hasFocus || (this._.currentFocusIndex = b ? -1 : this._
  13391. .focusList.length -
  13392. 1, g.onFocus ? (b = g.onFocus.call(this)) && b.focus() : e(1))
  13393. }, this, null, 4294967295);
  13394. if (CKEDITOR.env.ie6Compat) this.on("load", function() {
  13395. var a = this.getElement(),
  13396. b = a.getFirst();
  13397. b.remove();
  13398. b.appendTo(a)
  13399. }, this);
  13400. ca(this);
  13401. da(this);
  13402. (new CKEDITOR.dom.text(g.title, CKEDITOR.document)).appendTo(this.parts.title);
  13403. for (l = 0; l < g.contents.length; l++)(h = g.contents[l]) && this.addPage(h);
  13404. this.parts.tabs.on("click", function(a) {
  13405. var b = a.data.getTarget();
  13406. b.hasClass("cke_dialog_tab") && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf("_"))),
  13407. I(this), a.data.preventDefault())
  13408. }, this);
  13409. l = [];
  13410. h = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, {
  13411. type: "hbox",
  13412. className: "cke_dialog_footer_buttons",
  13413. widths: [],
  13414. children: g.buttons
  13415. }, l).getChild();
  13416. this.parts.footer.setHtml(l.join(""));
  13417. for (l = 0; l < h.length; l++) this._.buttons[h[l].id] = h[l]
  13418. };
  13419. CKEDITOR.dialog.prototype = {
  13420. destroy: function() {
  13421. this.hide();
  13422. this._.element.remove()
  13423. },
  13424. resize: function(a, b) {
  13425. if (!this._.contentSize || this._.contentSize.width != a || this._.contentSize.height != b) {
  13426. CKEDITOR.dialog.fire("resize", {
  13427. dialog: this,
  13428. width: a,
  13429. height: b
  13430. }, this._.editor);
  13431. this.fire("resize", {
  13432. width: a,
  13433. height: b
  13434. }, this._.editor);
  13435. this.parts.contents.setStyles({
  13436. width: a + "px",
  13437. height: b + "px"
  13438. });
  13439. if ("rtl" == this._.editor.lang.dir && this._.position) {
  13440. var c = this.parts.dialog.getParent().getClientSize().width;
  13441. this._.position.x = c - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle(
  13442. "right"), 10)
  13443. }
  13444. this._.contentSize = {
  13445. width: a,
  13446. height: b
  13447. }
  13448. }
  13449. },
  13450. getSize: function() {
  13451. var a = this._.element.getFirst();
  13452. return {
  13453. width: a.$.offsetWidth || 0,
  13454. height: a.$.offsetHeight ||
  13455. 0
  13456. }
  13457. },
  13458. move: function(a, b, c) {
  13459. var e = this._.element.getFirst(),
  13460. d = "rtl" == this._.editor.lang.dir;
  13461. CKEDITOR.env.ie && e.setStyle("zoom", "100%");
  13462. var f = this.parts.dialog.getParent().getClientSize(),
  13463. g = this.getSize(),
  13464. k = this._.viewportRatio,
  13465. p = Math.max(f.width - g.width, 0),
  13466. f = Math.max(f.height - g.height, 0);
  13467. this._.position && this._.position.x == a && this._.position.y == b ? (a = Math.floor(p * k.width), b =
  13468. Math.floor(f * k.height)) : O(this, a, b);
  13469. this._.position = {
  13470. x: a,
  13471. y: b
  13472. };
  13473. d && (a = p - a);
  13474. b = {
  13475. top: (0 < b ? b : 0) + "px"
  13476. };
  13477. b[d ? "right" : "left"] = (0 < a ? a : 0) + "px";
  13478. e.setStyles(b);
  13479. c && (this._.moved = 1)
  13480. },
  13481. getPosition: function() {
  13482. return CKEDITOR.tools.extend({}, this._.position)
  13483. },
  13484. show: function() {
  13485. var a = this._.element,
  13486. b = this.definition,
  13487. c = CKEDITOR.document.getBody(),
  13488. e = this._.editor.config.baseFloatZIndex;
  13489. a.getParent() && a.getParent().equals(c) ? a.setStyle("display", D ? "flex" : "block") : a.appendTo(c);
  13490. this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._
  13491. .contentSize && this._.contentSize.height || b.height || b.minHeight);
  13492. this.reset();
  13493. null === this._.currentTabId &&
  13494. this.selectPage(this.definition.contents[0].id);
  13495. null === CKEDITOR.dialog._.currentZIndex && (CKEDITOR.dialog._.currentZIndex = e);
  13496. this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex += 10);
  13497. this.getElement().setStyle("z-index", CKEDITOR.dialog._.currentZIndex);
  13498. null === CKEDITOR.dialog._.currentTop ? (CKEDITOR.dialog._.currentTop = this, this._.parentDialog =
  13499. null, P(this._.editor)) : CKEDITOR.dialog._.currentTop !== this && (this._.parentDialog = CKEDITOR
  13500. .dialog._.currentTop, c = this._.parentDialog.getElement().getFirst(),
  13501. c.$.style.zIndex -= Math.floor(e / 2), this._.parentDialog.getElement().setStyle("z-index", c.$
  13502. .style.zIndex), CKEDITOR.dialog._.currentTop = this);
  13503. a.on("keydown", R);
  13504. a.on("keyup", S);
  13505. this._.hasFocus = !1;
  13506. for (var d in b.contents)
  13507. if (b.contents[d]) {
  13508. var a = b.contents[d],
  13509. e = this._.tabs[a.id],
  13510. c = a.requiredContent,
  13511. f = 0;
  13512. if (e) {
  13513. for (var g in this._.contents[a.id]) {
  13514. var k = this._.contents[a.id][g];
  13515. "hbox" != k.type && "vbox" != k.type && k.getInputElement() && (k.requiredContent && !this._
  13516. .editor.activeFilter.check(k.requiredContent) ? k.disable() :
  13517. (k.enable(), f++))
  13518. }!f || c && !this._.editor.activeFilter.check(c) ? e[0].addClass("cke_dialog_tab_disabled") : e[0]
  13519. .removeClass("cke_dialog_tab_disabled")
  13520. }
  13521. } CKEDITOR.tools.setTimeout(function() {
  13522. this.layout();
  13523. ba(this);
  13524. this.parts.dialog.setStyle("visibility", "");
  13525. this.fireOnce("load", {});
  13526. CKEDITOR.ui.fire("ready", this);
  13527. this.fire("show", {});
  13528. this._.editor.fire("dialogShow", this);
  13529. this._.parentDialog || this._.editor.focusManager.lock();
  13530. this.foreach(function(a) {
  13531. a.setInitValue && a.setInitValue()
  13532. })
  13533. }, 100, this)
  13534. },
  13535. layout: function() {
  13536. var a =
  13537. this.parts.dialog;
  13538. if (this._.moved || !D) {
  13539. var b = this.getSize(),
  13540. c = CKEDITOR.document.getWindow().getViewPaneSize(),
  13541. e;
  13542. this._.moved && this._.position ? (e = this._.position.x, b = this._.position.y) : (e = (c.width - b
  13543. .width) / 2, b = (c.height - b.height) / 2);
  13544. CKEDITOR.env.ie6Compat || (a.setStyle("position", "absolute"), a.removeStyle("margin"));
  13545. e = Math.floor(e);
  13546. b = Math.floor(b);
  13547. this.move(e, b)
  13548. }
  13549. },
  13550. foreach: function(a) {
  13551. for (var b in this._.contents)
  13552. for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
  13553. return this
  13554. },
  13555. reset: function() {
  13556. var a =
  13557. function(a) {
  13558. a.reset && a.reset(1)
  13559. };
  13560. return function() {
  13561. this.foreach(a);
  13562. return this
  13563. }
  13564. }(),
  13565. setupContent: function() {
  13566. var a = arguments;
  13567. this.foreach(function(b) {
  13568. b.setup && b.setup.apply(b, a)
  13569. })
  13570. },
  13571. commitContent: function() {
  13572. var a = arguments;
  13573. this.foreach(function(b) {
  13574. CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
  13575. b.commit && b.commit.apply(b, a)
  13576. })
  13577. },
  13578. hide: function() {
  13579. if (this.parts.dialog.isVisible()) {
  13580. this.fire("hide", {});
  13581. this._.editor.fire("dialogHide", this);
  13582. this.selectPage(this._.tabIdList[0]);
  13583. var a = this._.element;
  13584. a.setStyle("display", "none");
  13585. this.parts.dialog.setStyle("visibility", "hidden");
  13586. for (ea(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
  13587. if (this._.parentDialog) {
  13588. var b = this._.parentDialog.getElement().getFirst(),
  13589. c = parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2);
  13590. this._.parentDialog.getElement().setStyle("z-index", c);
  13591. b.setStyle("z-index", c)
  13592. } else Q(this._.editor);
  13593. if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex -=
  13594. 10;
  13595. else {
  13596. CKEDITOR.dialog._.currentZIndex = null;
  13597. a.removeListener("keydown", R);
  13598. a.removeListener("keyup", S);
  13599. var e = this._.editor;
  13600. e.focus();
  13601. setTimeout(function() {
  13602. e.focusManager.unlock();
  13603. CKEDITOR.env.iOS && e.window.focus()
  13604. }, 0)
  13605. }
  13606. delete this._.parentDialog;
  13607. this.foreach(function(a) {
  13608. a.resetInitValue && a.resetInitValue()
  13609. });
  13610. this.setState(CKEDITOR.DIALOG_STATE_IDLE)
  13611. }
  13612. },
  13613. addPage: function(a) {
  13614. if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
  13615. for (var b = [], c = a.label ? ' title\x3d"' + CKEDITOR.tools.htmlEncode(a.label) +
  13616. '"' : "", e = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, {
  13617. type: "vbox",
  13618. className: "cke_dialog_page_contents",
  13619. children: a.elements,
  13620. expand: !!a.expand,
  13621. padding: a.padding,
  13622. style: a.style || "width: 100%;"
  13623. }, b), d = this._.contents[a.id] = {}, f = e.getChild(), g = 0; e = f.shift();) e.notAllowed ||
  13624. "hbox" == e.type || "vbox" == e.type || g++, d[e.id] = e, "function" == typeof e.getChild && f.push
  13625. .apply(f, e.getChild());
  13626. g || (a.hidden = !0);
  13627. b = CKEDITOR.dom.element.createFromHtml(b.join(""));
  13628. b.setAttribute("role", "tabpanel");
  13629. b.setStyle("min-height",
  13630. "100%");
  13631. e = CKEDITOR.env;
  13632. d = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
  13633. c = CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"', 0 < this._.pageCount ?
  13634. " cke_last" : "cke_first", c, a.hidden ? ' style\x3d"display:none"' : "", ' id\x3d"', d, '"', e
  13635. .gecko && !e.hc ? "" : ' href\x3d"javascript:void(0)"',
  13636. ' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e', a.label, "\x3c/a\x3e"
  13637. ].join(""));
  13638. b.setAttribute("aria-labelledby", d);
  13639. this._.tabs[a.id] = [c, b];
  13640. this._.tabIdList.push(a.id);
  13641. !a.hidden && this._.pageCount++;
  13642. this._.lastTab = c;
  13643. this.updateStyle();
  13644. b.setAttribute("name", a.id);
  13645. b.appendTo(this.parts.contents);
  13646. c.unselectable();
  13647. this.parts.tabs.append(c);
  13648. a.accessKey && (T(this, this, "CTRL+" + a.accessKey, ga, fa), this._.accessKeyMap["CTRL+" + a
  13649. .accessKey] = a.id)
  13650. }
  13651. },
  13652. selectPage: function(a) {
  13653. if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && !1 !== this
  13654. .fire("selectPage", {
  13655. page: a,
  13656. currentPage: this._.currentTabId
  13657. })) {
  13658. for (var b in this._.tabs) {
  13659. var c = this._.tabs[b][0],
  13660. e = this._.tabs[b][1];
  13661. b != a && (c.removeClass("cke_dialog_tab_selected"),
  13662. c.removeAttribute("aria-selected"), e.hide());
  13663. e.setAttribute("aria-hidden", b != a)
  13664. }
  13665. var d = this._.tabs[a];
  13666. d[0].addClass("cke_dialog_tab_selected");
  13667. d[0].setAttribute("aria-selected", !0);
  13668. CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ? (K(d[1]), d[1].show(), setTimeout(function() {
  13669. K(d[1], 1)
  13670. }, 0)) : d[1].show();
  13671. this._.currentTabId = a;
  13672. this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
  13673. }
  13674. },
  13675. updateStyle: function() {
  13676. this.parts.dialog[(1 === this._.pageCount ? "add" : "remove") + "Class"]("cke_single_page")
  13677. },
  13678. hidePage: function(a) {
  13679. var b =
  13680. this._.tabs[a] && this._.tabs[a][0];
  13681. b && 1 != this._.pageCount && b.isVisible() && (a == this._.currentTabId && this.selectPage(J.call(
  13682. this)), b.hide(), this._.pageCount--, this.updateStyle())
  13683. },
  13684. showPage: function(a) {
  13685. if (a = this._.tabs[a] && this._.tabs[a][0]) a.show(), this._.pageCount++, this.updateStyle()
  13686. },
  13687. getElement: function() {
  13688. return this._.element
  13689. },
  13690. getName: function() {
  13691. return this._.name
  13692. },
  13693. getContentElement: function(a, b) {
  13694. var c = this._.contents[a];
  13695. return c && c[b]
  13696. },
  13697. getValueOf: function(a, b) {
  13698. return this.getContentElement(a, b).getValue()
  13699. },
  13700. setValueOf: function(a, b, c) {
  13701. return this.getContentElement(a, b).setValue(c)
  13702. },
  13703. getButton: function(a) {
  13704. return this._.buttons[a]
  13705. },
  13706. click: function(a) {
  13707. return this._.buttons[a].click()
  13708. },
  13709. disableButton: function(a) {
  13710. return this._.buttons[a].disable()
  13711. },
  13712. enableButton: function(a) {
  13713. return this._.buttons[a].enable()
  13714. },
  13715. getPageCount: function() {
  13716. return this._.pageCount
  13717. },
  13718. getParentEditor: function() {
  13719. return this._.editor
  13720. },
  13721. getSelectedElement: function() {
  13722. return this.getParentEditor().getSelection().getSelectedElement()
  13723. },
  13724. addFocusable: function(a,
  13725. b) {
  13726. if ("undefined" == typeof b) b = this._.focusList.length, this._.focusList.push(new L(this, a, b));
  13727. else {
  13728. this._.focusList.splice(b, 0, new L(this, a, b));
  13729. for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++
  13730. }
  13731. },
  13732. setState: function(a) {
  13733. if (this.state != a) {
  13734. this.state = a;
  13735. if (a == CKEDITOR.DIALOG_STATE_BUSY) {
  13736. if (!this.parts.spinner) {
  13737. var b = this.getParentEditor().lang.dir,
  13738. c = {
  13739. attributes: {
  13740. "class": "cke_dialog_spinner"
  13741. },
  13742. styles: {
  13743. "float": "rtl" == b ? "right" : "left"
  13744. }
  13745. };
  13746. c.styles["margin-" + ("rtl" == b ? "left" : "right")] =
  13747. "8px";
  13748. this.parts.spinner = CKEDITOR.document.createElement("div", c);
  13749. this.parts.spinner.setHtml("\x26#8987;");
  13750. this.parts.spinner.appendTo(this.parts.title, 1)
  13751. }
  13752. this.parts.spinner.show();
  13753. this.getButton("ok") && this.getButton("ok").disable()
  13754. } else a == CKEDITOR.DIALOG_STATE_IDLE && (this.parts.spinner && this.parts.spinner.hide(), this
  13755. .getButton("ok") && this.getButton("ok").enable());
  13756. this.fire("state", a)
  13757. }
  13758. },
  13759. getModel: function(a) {
  13760. return this._.model ? this._.model : this.definition.getModel ? this.definition.getModel(a) : null
  13761. },
  13762. setModel: function(a) {
  13763. this._.model = a
  13764. },
  13765. getMode: function(a) {
  13766. if (this.definition.getMode) return this.definition.getMode(a);
  13767. a = this.getModel(a);
  13768. return !a || a instanceof CKEDITOR.dom.element && !a.getParent() ? CKEDITOR.dialog.CREATION_MODE :
  13769. CKEDITOR.dialog.EDITING_MODE
  13770. }
  13771. };
  13772. CKEDITOR.tools.extend(CKEDITOR.dialog, {
  13773. CREATION_MODE: 0,
  13774. EDITING_MODE: 1,
  13775. add: function(a, b) {
  13776. this._.dialogDefinitions[a] && "function" != typeof b || (this._.dialogDefinitions[a] = b)
  13777. },
  13778. exists: function(a) {
  13779. return !!this._.dialogDefinitions[a]
  13780. },
  13781. getCurrent: function() {
  13782. return CKEDITOR.dialog._.currentTop
  13783. },
  13784. isTabEnabled: function(a, b, c) {
  13785. a = a.config.removeDialogTabs;
  13786. return !(a && a.match(new RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)", "i")))
  13787. },
  13788. okButton: function() {
  13789. var a = function(a, c) {
  13790. c = c || {};
  13791. return CKEDITOR.tools.extend({
  13792. id: "ok",
  13793. type: "button",
  13794. label: a.lang.common.ok,
  13795. "class": "cke_dialog_ui_button_ok",
  13796. onClick: function(a) {
  13797. a = a.data.dialog;
  13798. !1 !== a.fire("ok", {
  13799. hide: !0
  13800. }).hide && a.hide()
  13801. }
  13802. }, c, !0)
  13803. };
  13804. a.type = "button";
  13805. a.override = function(b) {
  13806. return CKEDITOR.tools.extend(function(c) {
  13807. return a(c, b)
  13808. }, {
  13809. type: "button"
  13810. }, !0)
  13811. };
  13812. return a
  13813. }(),
  13814. cancelButton: function() {
  13815. var a =
  13816. function(a, c) {
  13817. c = c || {};
  13818. return CKEDITOR.tools.extend({
  13819. id: "cancel",
  13820. type: "button",
  13821. label: a.lang.common.cancel,
  13822. "class": "cke_dialog_ui_button_cancel",
  13823. onClick: function(a) {
  13824. a = a.data.dialog;
  13825. !1 !== a.fire("cancel", {
  13826. hide: !0
  13827. }).hide && a.hide()
  13828. }
  13829. }, c, !0)
  13830. };
  13831. a.type = "button";
  13832. a.override = function(b) {
  13833. return CKEDITOR.tools.extend(function(c) {
  13834. return a(c, b)
  13835. }, {
  13836. type: "button"
  13837. }, !0)
  13838. };
  13839. return a
  13840. }(),
  13841. addUIElement: function(a, b) {
  13842. this._.uiElementBuilders[a] = b
  13843. }
  13844. });
  13845. CKEDITOR.dialog._ = {
  13846. uiElementBuilders: {},
  13847. dialogDefinitions: {},
  13848. currentTop: null,
  13849. currentZIndex: null
  13850. };
  13851. CKEDITOR.event.implementOn(CKEDITOR.dialog);
  13852. CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
  13853. U = {
  13854. resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
  13855. minWidth: 600,
  13856. minHeight: 400,
  13857. buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton]
  13858. };
  13859. var E = function(a, b, c) {
  13860. for (var e = 0, d; d = a[e]; e++)
  13861. if (d.id == b || c && d[c] && (d = E(d[c], b, c))) return d;
  13862. return null
  13863. },
  13864. F = function(a, b, c, e, d) {
  13865. if (c) {
  13866. for (var f = 0, g; g = a[f]; f++) {
  13867. if (g.id == c) return a.splice(f, 0, b), b;
  13868. if (e && g[e] && (g = F(g[e], b, c, e, !0))) return g
  13869. }
  13870. if (d) return null
  13871. }
  13872. a.push(b);
  13873. return b
  13874. },
  13875. G = function(a, b, c) {
  13876. for (var e = 0, d; d = a[e]; e++) {
  13877. if (d.id == b) return a.splice(e, 1);
  13878. if (c && d[c] && (d = G(d[c], b, c))) return d
  13879. }
  13880. return null
  13881. };
  13882. M.prototype = {
  13883. getContents: function(a) {
  13884. return E(this.contents, a)
  13885. },
  13886. getButton: function(a) {
  13887. return E(this.buttons, a)
  13888. },
  13889. addContents: function(a, b) {
  13890. return F(this.contents, a, b)
  13891. },
  13892. addButton: function(a, b) {
  13893. return F(this.buttons, a, b)
  13894. },
  13895. removeContents: function(a) {
  13896. G(this.contents, a)
  13897. },
  13898. removeButton: function(a) {
  13899. G(this.buttons, a)
  13900. }
  13901. };
  13902. N.prototype = {
  13903. get: function(a) {
  13904. return E(this.elements, a, "children")
  13905. },
  13906. add: function(a, b) {
  13907. return F(this.elements, a, b, "children")
  13908. },
  13909. remove: function(a) {
  13910. G(this.elements, a, "children")
  13911. }
  13912. };
  13913. var B = {},
  13914. x = {};
  13915. (function() {
  13916. CKEDITOR.ui.dialog = {
  13917. uiElement: function(a, b, c, e, d, f, g) {
  13918. if (!(4 > arguments.length)) {
  13919. var k = (e.call ? e(b) : e) || "div",
  13920. p = ["\x3c", k, " "],
  13921. l = (d && d.call ? d(b) : d) || {},
  13922. h = (f && f.call ? f(b) : f) || {},
  13923. q = (g && g.call ? g.call(this, a, b) : g) || "",
  13924. m = this.domId = h.id || CKEDITOR.tools.getNextId() + "_uiElement";
  13925. b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (l.display = "none",
  13926. this.notAllowed = !0);
  13927. h.id = m;
  13928. var r = {};
  13929. b.type && (r["cke_dialog_ui_" + b.type] = 1);
  13930. b.className && (r[b.className] = 1);
  13931. b.disabled && (r.cke_disabled = 1);
  13932. for (var n = h["class"] && h["class"].split ? h["class"].split(" ") : [], m = 0; m < n
  13933. .length; m++) n[m] && (r[n[m]] = 1);
  13934. n = [];
  13935. for (m in r) n.push(m);
  13936. h["class"] = n.join(" ");
  13937. b.title && (h.title = b.title);
  13938. r = (b.style || "").split(";");
  13939. b.align && (n = b.align, l["margin-left"] = "left" == n ? 0 : "auto", l["margin-right"] =
  13940. "right" == n ? 0 : "auto");
  13941. for (m in l) r.push(m + ":" + l[m]);
  13942. b.hidden && r.push("display:none");
  13943. for (m = r.length - 1; 0 <=
  13944. m; m--) "" === r[m] && r.splice(m, 1);
  13945. 0 < r.length && (h.style = (h.style ? h.style + "; " : "") + r.join("; "));
  13946. for (m in h) p.push(m + '\x3d"' + CKEDITOR.tools.htmlEncode(h[m]) + '" ');
  13947. p.push("\x3e", q, "\x3c/", k, "\x3e");
  13948. c.push(p.join(""));
  13949. (this._ || (this._ = {})).dialog = a;
  13950. "boolean" == typeof b.isChanged && (this.isChanged = function() {
  13951. return b.isChanged
  13952. });
  13953. "function" == typeof b.isChanged && (this.isChanged = b.isChanged);
  13954. "function" == typeof b.setValue && (this.setValue = CKEDITOR.tools.override(this.setValue,
  13955. function(a) {
  13956. return function(c) {
  13957. a.call(this,
  13958. b.setValue.call(this, c))
  13959. }
  13960. }));
  13961. "function" == typeof b.getValue && (this.getValue = CKEDITOR.tools.override(this.getValue,
  13962. function(a) {
  13963. return function() {
  13964. return b.getValue.call(this, a.call(this))
  13965. }
  13966. }));
  13967. CKEDITOR.event.implementOn(this);
  13968. this.registerEvents(b);
  13969. this.accessKeyUp && this.accessKeyDown && b.accessKey && T(this, a, "CTRL+" + b.accessKey);
  13970. var t = this;
  13971. a.on("load", function() {
  13972. var b = t.getInputElement();
  13973. if (b) {
  13974. var c = t.type in {
  13975. checkbox: 1,
  13976. ratio: 1
  13977. } && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? "cke_dialog_ui_focused" : "";
  13978. b.on("focus",
  13979. function() {
  13980. a._.tabBarMode = !1;
  13981. a._.hasFocus = !0;
  13982. t.fire("focus");
  13983. c && this.addClass(c)
  13984. });
  13985. b.on("blur", function() {
  13986. t.fire("blur");
  13987. c && this.removeClass(c)
  13988. })
  13989. }
  13990. });
  13991. CKEDITOR.tools.extend(this, b);
  13992. this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex = a._.focusList.push(
  13993. this) - 1, this.on("focus", function() {
  13994. a._.currentFocusIndex = t.focusIndex
  13995. }))
  13996. }
  13997. },
  13998. hbox: function(a, b, c, e, d) {
  13999. if (!(4 > arguments.length)) {
  14000. this._ || (this._ = {});
  14001. var f = this._.children = b,
  14002. g = d && d.widths || null,
  14003. k = d && d.height || null,
  14004. p, l = {
  14005. role: "presentation"
  14006. };
  14007. d && d.align && (l.align = d.align);
  14008. CKEDITOR.ui.dialog.uiElement.call(this, a, d || {
  14009. type: "hbox"
  14010. }, e, "table", {}, l, function() {
  14011. var a = ['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];
  14012. for (p = 0; p < c.length; p++) {
  14013. var b = "cke_dialog_ui_hbox_child",
  14014. e = [];
  14015. 0 === p && (b = "cke_dialog_ui_hbox_first");
  14016. p == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
  14017. a.push('\x3ctd class\x3d"', b, '" role\x3d"presentation" ');
  14018. g ? g[p] && e.push("width:" + y(g[p])) : e.push("width:" + Math.floor(100 / c.length) +
  14019. "%");
  14020. k && e.push("height:" + y(k));
  14021. d && void 0 !== d.padding &&
  14022. e.push("padding:" + y(d.padding));
  14023. CKEDITOR.env.ie && CKEDITOR.env.quirks && f[p].align && e.push("text-align:" + f[p]
  14024. .align);
  14025. 0 < e.length && a.push('style\x3d"' + e.join("; ") + '" ');
  14026. a.push("\x3e", c[p], "\x3c/td\x3e")
  14027. }
  14028. a.push("\x3c/tr\x3e\x3c/tbody\x3e");
  14029. return a.join("")
  14030. })
  14031. }
  14032. },
  14033. vbox: function(a, b, c, e, d) {
  14034. if (!(3 > arguments.length)) {
  14035. this._ || (this._ = {});
  14036. var f = this._.children = b,
  14037. g = d && d.width || null,
  14038. k = d && d.heights || null;
  14039. CKEDITOR.ui.dialog.uiElement.call(this, a, d || {
  14040. type: "vbox"
  14041. }, e, "div", null, {
  14042. role: "presentation"
  14043. }, function() {
  14044. var b = ['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];
  14045. b.push('style\x3d"');
  14046. d && d.expand && b.push("height:100%;");
  14047. b.push("width:" + y(g || "100%"), ";");
  14048. CKEDITOR.env.webkit && b.push("float:none;");
  14049. b.push('"');
  14050. b.push('align\x3d"', CKEDITOR.tools.htmlEncode(d && d.align || ("ltr" == a.getParentEditor()
  14051. .lang.dir ? "left" : "right")), '" ');
  14052. b.push("\x3e\x3ctbody\x3e");
  14053. for (var e = 0; e < c.length; e++) {
  14054. var h = [];
  14055. b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');
  14056. g && h.push("width:" + y(g || "100%"));
  14057. k ? h.push("height:" +
  14058. y(k[e])) : d && d.expand && h.push("height:" + Math.floor(100 / c.length) + "%");
  14059. d && void 0 !== d.padding && h.push("padding:" + y(d.padding));
  14060. CKEDITOR.env.ie && CKEDITOR.env.quirks && f[e].align && h.push("text-align:" + f[e]
  14061. .align);
  14062. 0 < h.length && b.push('style\x3d"', h.join("; "), '" ');
  14063. b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e', c[e], "\x3c/td\x3e\x3c/tr\x3e")
  14064. }
  14065. b.push("\x3c/tbody\x3e\x3c/table\x3e");
  14066. return b.join("")
  14067. })
  14068. }
  14069. }
  14070. }
  14071. })();
  14072. CKEDITOR.ui.dialog.uiElement.prototype = {
  14073. getElement: function() {
  14074. return CKEDITOR.document.getById(this.domId)
  14075. },
  14076. getInputElement: function() {
  14077. return this.getElement()
  14078. },
  14079. getDialog: function() {
  14080. return this._.dialog
  14081. },
  14082. setValue: function(a, b) {
  14083. this.getInputElement().setValue(a);
  14084. !b && this.fire("change", {
  14085. value: a
  14086. });
  14087. return this
  14088. },
  14089. getValue: function() {
  14090. return this.getInputElement().getValue()
  14091. },
  14092. isChanged: function() {
  14093. return !1
  14094. },
  14095. selectParentTab: function() {
  14096. for (var a = this.getInputElement();
  14097. (a = a.getParent()) && -1 == a.$.className.search("cke_dialog_page_contents"););
  14098. if (!a) return this;
  14099. a = a.getAttribute("name");
  14100. this._.dialog._.currentTabId !=
  14101. a && this._.dialog.selectPage(a);
  14102. return this
  14103. },
  14104. focus: function() {
  14105. this.selectParentTab().getInputElement().focus();
  14106. return this
  14107. },
  14108. registerEvents: function(a) {
  14109. var b = /^on([A-Z]\w+)/,
  14110. c, e = function(a, b, c, d) {
  14111. b.on("load", function() {
  14112. a.getInputElement().on(c, d, a)
  14113. })
  14114. },
  14115. d;
  14116. for (d in a)
  14117. if (c = d.match(b)) this.eventProcessors[d] ? this.eventProcessors[d].call(this, this._.dialog, a[
  14118. d]) : e(this, this._.dialog, c[1].toLowerCase(), a[d]);
  14119. return this
  14120. },
  14121. eventProcessors: {
  14122. onLoad: function(a, b) {
  14123. a.on("load", b, this)
  14124. },
  14125. onShow: function(a, b) {
  14126. a.on("show",
  14127. b, this)
  14128. },
  14129. onHide: function(a, b) {
  14130. a.on("hide", b, this)
  14131. }
  14132. },
  14133. accessKeyDown: function() {
  14134. this.focus()
  14135. },
  14136. accessKeyUp: function() {},
  14137. disable: function() {
  14138. var a = this.getElement();
  14139. this.getInputElement().setAttribute("disabled", "true");
  14140. a.addClass("cke_disabled")
  14141. },
  14142. enable: function() {
  14143. var a = this.getElement();
  14144. this.getInputElement().removeAttribute("disabled");
  14145. a.removeClass("cke_disabled")
  14146. },
  14147. isEnabled: function() {
  14148. return !this.getElement().hasClass("cke_disabled")
  14149. },
  14150. isVisible: function() {
  14151. return this.getInputElement().isVisible()
  14152. },
  14153. isFocusable: function() {
  14154. return this.isEnabled() && this.isVisible() ? !0 : !1
  14155. }
  14156. };
  14157. CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  14158. getChild: function(a) {
  14159. if (1 > arguments.length) return this._.children.concat();
  14160. a.splice || (a = [a]);
  14161. return 2 > a.length ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]]
  14162. .getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null
  14163. }
  14164. }, !0);
  14165. CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
  14166. (function() {
  14167. var a = {
  14168. build: function(a,
  14169. c, e) {
  14170. for (var d = c.children, f, g = [], k = [], p = 0; p < d.length && (f = d[p]); p++) {
  14171. var l = [];
  14172. g.push(l);
  14173. k.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, l))
  14174. }
  14175. return new CKEDITOR.ui.dialog[c.type](a, k, g, e, c)
  14176. }
  14177. };
  14178. CKEDITOR.dialog.addUIElement("hbox", a);
  14179. CKEDITOR.dialog.addUIElement("vbox", a)
  14180. })();
  14181. CKEDITOR.dialogCommand = function(a, b) {
  14182. this.dialogName = a;
  14183. CKEDITOR.tools.extend(this, b, !0)
  14184. };
  14185. CKEDITOR.dialogCommand.prototype = {
  14186. exec: function(a) {
  14187. var b = this.tabId;
  14188. a.openDialog(this.dialogName, function(a) {
  14189. b && a.selectPage(b)
  14190. })
  14191. },
  14192. canUndo: !1,
  14193. editorFocus: 1
  14194. };
  14195. (function() {
  14196. var a = /^\d*$/,
  14197. b = /^\d*(?:\.\d+)?$/,
  14198. c = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
  14199. e = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
  14200. d = /^(--|-?([a-zA-Z_]|\\))(\\|[a-zA-Z0-9-_])*\s*?:\s*?[^:;]+$/;
  14201. CKEDITOR.VALIDATE_OR = 1;
  14202. CKEDITOR.VALIDATE_AND = 2;
  14203. CKEDITOR.dialog.validate = {
  14204. functions: function() {
  14205. var a = arguments;
  14206. return function(b) {
  14207. this && this.getValue && (b = this.getValue());
  14208. var c, d = CKEDITOR.VALIDATE_AND,
  14209. e = [],
  14210. h;
  14211. for (h = 0; h < a.length; h++)
  14212. if ("function" == typeof a[h]) e.push(a[h]);
  14213. else break;
  14214. h < a.length && "string" == typeof a[h] && (c = a[h], h++);
  14215. h < a.length && "number" == typeof a[h] && (d = a[h]);
  14216. h = d == CKEDITOR.VALIDATE_AND;
  14217. for (var q = 0; q < e.length; q++) {
  14218. var m = !0 === e[q](b);
  14219. h = d == CKEDITOR.VALIDATE_AND ? h && m : h || m
  14220. }
  14221. return h ? !0 : c
  14222. }
  14223. },
  14224. regex: function(a, b) {
  14225. return this.functions(function(b) {
  14226. return a.test(b)
  14227. }, b)
  14228. },
  14229. notEmpty: function(a) {
  14230. return this.functions(function(a) {
  14231. return 0 < a.replace(RegExp(
  14232. "^[\\u0020\\u00a0\\u1680\\u202f\\u205f\\u3000\\u2000-\\u200a\\s]+|[\\u0020\\u00a0\\u1680\\u202f\\u205f\\u3000\\u2000-\\u200a\\s]+$",
  14233. "g"), "").length
  14234. }, a)
  14235. },
  14236. integer: function(b) {
  14237. return this.regex(a, b)
  14238. },
  14239. number: function(a) {
  14240. return this.regex(b, a)
  14241. },
  14242. cssLength: function(a) {
  14243. return this.functions(function(a) {
  14244. return e.test(CKEDITOR.tools.trim(a))
  14245. }, a)
  14246. },
  14247. htmlLength: function(a) {
  14248. return this.functions(function(a) {
  14249. return c.test(CKEDITOR.tools.trim(a))
  14250. }, a)
  14251. },
  14252. inlineStyle: function(a) {
  14253. return this.functions(function(a) {
  14254. a = CKEDITOR.tools.trim(a).split(";");
  14255. "" === a[a.length - 1] && a.pop();
  14256. return CKEDITOR.tools.array.every(a, function(a) {
  14257. return d.test(CKEDITOR.tools.trim(a))
  14258. })
  14259. },
  14260. a)
  14261. },
  14262. equals: function(a, b) {
  14263. return this.functions(function(b) {
  14264. return b == a
  14265. }, b)
  14266. },
  14267. notEqual: function(a, b) {
  14268. return this.functions(function(b) {
  14269. return b != a
  14270. }, b)
  14271. }
  14272. };
  14273. CKEDITOR.on("instanceDestroyed", function(a) {
  14274. if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
  14275. for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
  14276. for (var c in B) B[c].remove();
  14277. B = {}
  14278. }
  14279. a = a.editor._.storedDialogs;
  14280. for (var d in a) a[d].destroy()
  14281. })
  14282. })();
  14283. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  14284. openDialog: function(a, b, c) {
  14285. var e = null,
  14286. d = CKEDITOR.dialog._.dialogDefinitions[a];
  14287. null === CKEDITOR.dialog._.currentTop && P(this);
  14288. if ("function" == typeof d) d = this._.storedDialogs || (this._.storedDialogs = {}), e = d[a] || (d[
  14289. a] = new CKEDITOR.dialog(this, a)), e.setModel(c), b && b.call(e, e), e.show();
  14290. else {
  14291. if ("failed" == d) throw Q(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a +
  14292. '" failed when loading definition.');
  14293. "string" == typeof d && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d), function() {
  14294. "function" != typeof CKEDITOR.dialog._.dialogDefinitions[a] && (CKEDITOR.dialog._
  14295. .dialogDefinitions[a] = "failed");
  14296. this.openDialog(a, b, c)
  14297. }, this, 0, 1)
  14298. }
  14299. CKEDITOR.skin.loadPart("dialog");
  14300. if (e) e.once("hide", function() {
  14301. e.setModel(null)
  14302. }, null, null, 999);
  14303. return e
  14304. }
  14305. });
  14306. CKEDITOR.plugins.add("dialog", {
  14307. requires: "dialogui",
  14308. init: function(a) {
  14309. V || (CKEDITOR.document.appendStyleSheet(this.path + "styles/dialog.css"), V = !0);
  14310. a.on("doubleclick", function(b) {
  14311. b.data.dialog && a.openDialog(b.data.dialog)
  14312. }, null, null, 999)
  14313. }
  14314. })
  14315. })();
  14316. CKEDITOR.plugins.add("about", {
  14317. requires: "dialog",
  14318. init: function(a) {
  14319. var b = a.addCommand("about", new CKEDITOR.dialogCommand("about"));
  14320. b.modes = {
  14321. wysiwyg: 1,
  14322. source: 1
  14323. };
  14324. b.canUndo = !1;
  14325. b.readOnly = 1;
  14326. a.ui.addButton && a.ui.addButton("About", {
  14327. label: a.lang.about.dlgTitle,
  14328. command: "about",
  14329. toolbar: "about"
  14330. });
  14331. CKEDITOR.dialog.add("about", this.path + "dialogs/about.js")
  14332. }
  14333. });
  14334. (function() {
  14335. CKEDITOR.plugins.add("a11yhelp", {
  14336. requires: "dialog",
  14337. availableLangs: {
  14338. af: 1,
  14339. ar: 1,
  14340. az: 1,
  14341. bg: 1,
  14342. ca: 1,
  14343. cs: 1,
  14344. cy: 1,
  14345. da: 1,
  14346. de: 1,
  14347. "de-ch": 1,
  14348. el: 1,
  14349. en: 1,
  14350. "en-au": 1,
  14351. "en-gb": 1,
  14352. eo: 1,
  14353. es: 1,
  14354. "es-mx": 1,
  14355. et: 1,
  14356. eu: 1,
  14357. fa: 1,
  14358. fi: 1,
  14359. fo: 1,
  14360. fr: 1,
  14361. "fr-ca": 1,
  14362. gl: 1,
  14363. gu: 1,
  14364. he: 1,
  14365. hi: 1,
  14366. hr: 1,
  14367. hu: 1,
  14368. id: 1,
  14369. it: 1,
  14370. ja: 1,
  14371. km: 1,
  14372. ko: 1,
  14373. ku: 1,
  14374. lt: 1,
  14375. lv: 1,
  14376. mk: 1,
  14377. mn: 1,
  14378. nb: 1,
  14379. nl: 1,
  14380. no: 1,
  14381. oc: 1,
  14382. pl: 1,
  14383. pt: 1,
  14384. "pt-br": 1,
  14385. ro: 1,
  14386. ru: 1,
  14387. si: 1,
  14388. sk: 1,
  14389. sl: 1,
  14390. sq: 1,
  14391. sr: 1,
  14392. "sr-latn": 1,
  14393. sv: 1,
  14394. th: 1,
  14395. tr: 1,
  14396. tt: 1,
  14397. ug: 1,
  14398. uk: 1,
  14399. vi: 1,
  14400. zh: 1,
  14401. "zh-cn": 1
  14402. },
  14403. init: function(b) {
  14404. var c = this;
  14405. b.addCommand("a11yHelp", {
  14406. exec: function() {
  14407. var a =
  14408. b.langCode,
  14409. a = c.availableLangs[a] ? a : c.availableLangs[a.replace(/-.*/, "")] ? a.replace(/-.*/,
  14410. "") : "en";
  14411. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + a + ".js"),
  14412. function() {
  14413. b.lang.a11yhelp = c.langEntries[a];
  14414. b.openDialog("a11yHelp")
  14415. })
  14416. },
  14417. modes: {
  14418. wysiwyg: 1,
  14419. source: 1
  14420. },
  14421. readOnly: 1,
  14422. canUndo: !1
  14423. });
  14424. b.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp");
  14425. CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js");
  14426. b.on("ariaEditorHelpLabel", function(a) {
  14427. a.data.label = b.lang.common.editorHelp
  14428. })
  14429. }
  14430. })
  14431. })();
  14432. (function() {
  14433. function f(c) {
  14434. var a = this.att;
  14435. c = c && c.hasAttribute(a) && c.getAttribute(a) || "";
  14436. void 0 !== c && this.setValue(c)
  14437. }
  14438. function g() {
  14439. for (var c, a = 0; a < arguments.length; a++)
  14440. if (arguments[a] instanceof CKEDITOR.dom.element) {
  14441. c = arguments[a];
  14442. break
  14443. } if (c) {
  14444. var a = this.att,
  14445. b = this.getValue();
  14446. b ? c.setAttribute(a, b) : c.removeAttribute(a, b)
  14447. }
  14448. }
  14449. var k = {
  14450. id: 1,
  14451. dir: 1,
  14452. classes: 1,
  14453. styles: 1
  14454. };
  14455. CKEDITOR.plugins.add("dialogadvtab", {
  14456. requires: "dialog",
  14457. allowedContent: function(c) {
  14458. c || (c = k);
  14459. var a = [];
  14460. c.id && a.push("id");
  14461. c.dir && a.push("dir");
  14462. var b =
  14463. "";
  14464. a.length && (b += "[" + a.join(",") + "]");
  14465. c.classes && (b += "(*)");
  14466. c.styles && (b += "{*}");
  14467. return b
  14468. },
  14469. createAdvancedTab: function(c, a, b) {
  14470. a || (a = k);
  14471. var d = c.lang.common,
  14472. h = {
  14473. id: "advanced",
  14474. label: d.advancedTab,
  14475. title: d.advancedTab,
  14476. elements: [{
  14477. type: "vbox",
  14478. padding: 1,
  14479. children: []
  14480. }]
  14481. },
  14482. e = [];
  14483. if (a.id || a.dir) a.id && e.push({
  14484. id: "advId",
  14485. att: "id",
  14486. type: "text",
  14487. requiredContent: b ? b + "[id]" : null,
  14488. label: d.id,
  14489. setup: f,
  14490. commit: g
  14491. }), a.dir && e.push({
  14492. id: "advLangDir",
  14493. att: "dir",
  14494. type: "select",
  14495. requiredContent: b ? b + "[dir]" : null,
  14496. label: d.langDir,
  14497. "default": "",
  14498. style: "width:100%",
  14499. items: [
  14500. [d.notSet, ""],
  14501. [d.langDirLTR, "ltr"],
  14502. [d.langDirRTL, "rtl"]
  14503. ],
  14504. setup: f,
  14505. commit: g
  14506. }), h.elements[0].children.push({
  14507. type: "hbox",
  14508. widths: ["50%", "50%"],
  14509. children: [].concat(e)
  14510. });
  14511. if (a.styles || a.classes) e = [], a.styles && e.push({
  14512. id: "advStyles",
  14513. att: "style",
  14514. type: "text",
  14515. requiredContent: b ? b + "{cke-xyz}" : null,
  14516. label: d.styles,
  14517. "default": "",
  14518. validate: CKEDITOR.dialog.validate.inlineStyle(d.invalidInlineStyle),
  14519. onChange: function() {},
  14520. getStyle: function(a, c) {
  14521. var b = this.getValue().match(new RegExp("(?:^|;)\\s*" +
  14522. a + "\\s*:\\s*([^;]*)", "i"));
  14523. return b ? b[1] : c
  14524. },
  14525. updateStyle: function(a, b) {
  14526. var d = this.getValue(),
  14527. e = c.document.createElement("span");
  14528. e.setAttribute("style", d);
  14529. e.setStyle(a, b);
  14530. d = CKEDITOR.tools.normalizeCssText(e.getAttribute("style"));
  14531. this.setValue(d, 1)
  14532. },
  14533. setup: f,
  14534. commit: g
  14535. }), a.classes && e.push({
  14536. type: "hbox",
  14537. widths: ["45%", "55%"],
  14538. children: [{
  14539. id: "advCSSClasses",
  14540. att: "class",
  14541. type: "text",
  14542. requiredContent: b ? b + "(cke-xyz)" : null,
  14543. label: d.cssClasses,
  14544. "default": "",
  14545. setup: f,
  14546. commit: g
  14547. }]
  14548. }), h.elements[0].children.push({
  14549. type: "hbox",
  14550. widths: ["50%", "50%"],
  14551. children: [].concat(e)
  14552. });
  14553. return h
  14554. }
  14555. })
  14556. })();
  14557. CKEDITOR.plugins.add("basicstyles", {
  14558. init: function(a) {
  14559. var f = 0,
  14560. d = function(h, d, c, b) {
  14561. if (b) {
  14562. b = new CKEDITOR.style(b);
  14563. var g = e[c];
  14564. g.unshift(b);
  14565. a.attachStyleStateChange(b, function(b) {
  14566. !a.readOnly && a.getCommand(c).setState(b)
  14567. });
  14568. a.addCommand(c, new CKEDITOR.styleCommand(b, {
  14569. contentForms: g
  14570. }));
  14571. a.ui.addButton && a.ui.addButton(h, {
  14572. isToggle: !0,
  14573. label: d,
  14574. command: c,
  14575. toolbar: "basicstyles," + (f += 10)
  14576. })
  14577. }
  14578. },
  14579. e = {
  14580. bold: ["strong", "b", ["span", function(a) {
  14581. a = a.styles["font-weight"];
  14582. return "bold" == a || 700 <= +a
  14583. }]],
  14584. italic: ["em", "i", ["span", function(a) {
  14585. return "italic" ==
  14586. a.styles["font-style"]
  14587. }]],
  14588. underline: ["u", ["span", function(a) {
  14589. return "underline" == a.styles["text-decoration"]
  14590. }]],
  14591. strike: ["s", "strike", ["span", function(a) {
  14592. return "line-through" == a.styles["text-decoration"]
  14593. }]],
  14594. subscript: ["sub"],
  14595. superscript: ["sup"]
  14596. },
  14597. c = a.config,
  14598. b = a.lang.basicstyles;
  14599. d("Bold", b.bold, "bold", c.coreStyles_bold);
  14600. d("Italic", b.italic, "italic", c.coreStyles_italic);
  14601. d("Underline", b.underline, "underline", c.coreStyles_underline);
  14602. d("Strike", b.strike, "strike", c.coreStyles_strike);
  14603. d("Subscript", b.subscript,
  14604. "subscript", c.coreStyles_subscript);
  14605. d("Superscript", b.superscript, "superscript", c.coreStyles_superscript);
  14606. a.setKeystroke([
  14607. [CKEDITOR.CTRL + 66, "bold"],
  14608. [CKEDITOR.CTRL + 73, "italic"],
  14609. [CKEDITOR.CTRL + 85, "underline"]
  14610. ])
  14611. },
  14612. afterInit: function(a) {
  14613. if (a.config.coreStyles_toggleSubSup) {
  14614. var f = a.getCommand("subscript"),
  14615. d = a.getCommand("superscript");
  14616. if (f && d) a.on("afterCommandExec", function(e) {
  14617. e = e.data.name;
  14618. if ("subscript" === e || "superscript" === e) {
  14619. var c = "subscript" === e ? d : f;
  14620. ("subscript" === e ? f : d).state === CKEDITOR.TRISTATE_ON &&
  14621. c.state === CKEDITOR.TRISTATE_ON && (c.exec(a), a.fire("updateSnapshot"))
  14622. }
  14623. })
  14624. }
  14625. }
  14626. });
  14627. CKEDITOR.config.coreStyles_bold = {
  14628. element: "strong",
  14629. overrides: "b"
  14630. };
  14631. CKEDITOR.config.coreStyles_italic = {
  14632. element: "em",
  14633. overrides: "i"
  14634. };
  14635. CKEDITOR.config.coreStyles_underline = {
  14636. element: "u"
  14637. };
  14638. CKEDITOR.config.coreStyles_strike = {
  14639. element: "s",
  14640. overrides: "strike"
  14641. };
  14642. CKEDITOR.config.coreStyles_subscript = {
  14643. element: "sub"
  14644. };
  14645. CKEDITOR.config.coreStyles_superscript = {
  14646. element: "sup"
  14647. };
  14648. CKEDITOR.config.coreStyles_toggleSubSup = !1;
  14649. (function() {
  14650. function q(a, f, e, b) {
  14651. if (!a.isReadOnly() && !a.equals(e.editable())) {
  14652. CKEDITOR.dom.element.setMarker(b, a, "bidi_processed", 1);
  14653. b = a;
  14654. for (var c = e.editable();
  14655. (b = b.getParent()) && !b.equals(c);)
  14656. if (b.getCustomData("bidi_processed")) {
  14657. a.removeStyle("direction");
  14658. a.removeAttribute("dir");
  14659. return
  14660. } b = e.config.useComputedState;
  14661. (b ? a.getComputedStyle("direction") : a.getStyle("direction") || a.hasAttribute("dir")) != f && (a
  14662. .removeStyle("direction"), b ? (a.removeAttribute("dir"), f != a.getComputedStyle("direction") && a
  14663. .setAttribute("dir",
  14664. f)) : a.setAttribute("dir", f), e.forceNextSelectionCheck())
  14665. }
  14666. }
  14667. function v(a, f, e) {
  14668. var b = a.getCommonAncestor(!1, !0);
  14669. a = a.clone();
  14670. a.enlarge(e == CKEDITOR.ENTER_BR ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  14671. if (a.checkBoundaryOfElement(b, CKEDITOR.START) && a.checkBoundaryOfElement(b, CKEDITOR.END)) {
  14672. for (var c; b && b.type == CKEDITOR.NODE_ELEMENT && (c = b.getParent()) && 1 == c.getChildCount() && !(b
  14673. .getName() in f);) b = c;
  14674. return b.type == CKEDITOR.NODE_ELEMENT && b.getName() in f && b
  14675. }
  14676. }
  14677. function p(a) {
  14678. return {
  14679. context: "p",
  14680. allowedContent: {
  14681. "h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td": {
  14682. propertiesOnly: !0,
  14683. attributes: "dir"
  14684. }
  14685. },
  14686. requiredContent: "p[dir]",
  14687. refresh: function(a, e) {
  14688. var b = a.config.useComputedState,
  14689. c;
  14690. if (!b) {
  14691. c = e.lastElement;
  14692. for (var h = a.editable(); c && !(c.getName() in u || c.equals(h));) {
  14693. var d = c.getParent();
  14694. if (!d) break;
  14695. c = d
  14696. }
  14697. }
  14698. c = c || e.block || e.blockLimit;
  14699. c.equals(a.editable()) && (h = a.getSelection().getRanges()[0].getEnclosedNode()) && h.type == CKEDITOR
  14700. .NODE_ELEMENT && (c = h);
  14701. c && (b = b ? c.getComputedStyle("direction") : c.getStyle("direction") ||
  14702. c.getAttribute("dir"), a.getCommand("bidirtl").setState("rtl" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR
  14703. .TRISTATE_OFF), a.getCommand("bidiltr").setState("ltr" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR
  14704. .TRISTATE_OFF));
  14705. b = (e.block || e.blockLimit || a.editable()).getDirection(1);
  14706. b != (a._.selDir || a.lang.dir) && (a._.selDir = b, a.fire("contentDirChanged", b))
  14707. },
  14708. exec: function(f) {
  14709. var e = f.getSelection(),
  14710. b = f.config.enterMode,
  14711. c = e.getRanges();
  14712. if (c && c.length) {
  14713. for (var h = {}, d = e.createBookmarks(), c = c.createIterator(), g, l = 0; g = c.getNextRange(1);) {
  14714. var k =
  14715. g.getEnclosedNode();
  14716. k && (!k || k.type == CKEDITOR.NODE_ELEMENT && k.getName() in r) || (k = v(g, t, b));
  14717. k && q(k, a, f, h);
  14718. var m = new CKEDITOR.dom.walker(g),
  14719. n = d[l].startNode,
  14720. p = d[l++].endNode;
  14721. m.evaluator = function(a) {
  14722. var c = b == CKEDITOR.ENTER_P ? "p" : "div",
  14723. d;
  14724. if (d = (a ? a.type == CKEDITOR.NODE_ELEMENT : !1) && a.getName() in t) {
  14725. if (c = a.is(c)) c = (c = a.getParent()) ? c.type == CKEDITOR.NODE_ELEMENT : !1;
  14726. d = !(c && a.getParent().is("blockquote"))
  14727. }
  14728. return !!(d && a.getPosition(n) & CKEDITOR.POSITION_FOLLOWING && (a.getPosition(p) & CKEDITOR
  14729. .POSITION_PRECEDING +
  14730. CKEDITOR.POSITION_CONTAINS) == CKEDITOR.POSITION_PRECEDING)
  14731. };
  14732. for (; k = m.next();) q(k, a, f, h);
  14733. g = g.createIterator();
  14734. for (g.enlargeBr = b != CKEDITOR.ENTER_BR; k = g.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" :
  14735. "div");) q(k, a, f, h)
  14736. }
  14737. CKEDITOR.dom.element.clearAllMarkers(h);
  14738. f.forceNextSelectionCheck();
  14739. e.selectBookmarks(d);
  14740. f.focus()
  14741. }
  14742. }
  14743. }
  14744. }
  14745. function w(a) {
  14746. var f = a == l.setAttribute,
  14747. e = a == l.removeAttribute,
  14748. b = /\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
  14749. return function(c, h) {
  14750. if (!this.isReadOnly()) {
  14751. var d;
  14752. if (d = c == (f || e ? "dir" : "direction") || "style" ==
  14753. c && (e || b.test(h))) {
  14754. a: {
  14755. d = this;
  14756. for (var g = d.getDocument().getBody().getParent(); d;) {
  14757. if (d.equals(g)) {
  14758. d = !1;
  14759. break a
  14760. }
  14761. d = d.getParent()
  14762. }
  14763. d = !0
  14764. }
  14765. d = !d
  14766. }
  14767. if (d && (d = this.getDirection(1), g = a.apply(this, arguments), d != this.getDirection(1)))
  14768. return this.getDocument().fire("dirChanged", this), g
  14769. }
  14770. return a.apply(this, arguments)
  14771. }
  14772. }
  14773. var t = {
  14774. table: 1,
  14775. ul: 1,
  14776. ol: 1,
  14777. blockquote: 1,
  14778. div: 1
  14779. },
  14780. r = {},
  14781. u = {};
  14782. CKEDITOR.tools.extend(r, t, {
  14783. tr: 1,
  14784. p: 1,
  14785. div: 1,
  14786. li: 1
  14787. });
  14788. CKEDITOR.tools.extend(u, r, {
  14789. td: 1
  14790. });
  14791. CKEDITOR.plugins.add("bidi", {
  14792. init: function(a) {
  14793. function f(b, c, e,
  14794. d, f) {
  14795. a.addCommand(e, new CKEDITOR.command(a, d));
  14796. a.ui.addButton && a.ui.addButton(b, {
  14797. isToggle: !0,
  14798. label: c,
  14799. command: e,
  14800. toolbar: "bidi," + f
  14801. })
  14802. }
  14803. if (!a.blockless) {
  14804. var e = a.lang.bidi;
  14805. f("BidiLtr", e.ltr, "bidiltr", p("ltr"), 10);
  14806. f("BidiRtl", e.rtl, "bidirtl", p("rtl"), 20);
  14807. a.on("contentDom", function() {
  14808. a.document.on("dirChanged", function(b) {
  14809. a.fire("dirChanged", {
  14810. node: b.data,
  14811. dir: b.data.getDirection(1)
  14812. })
  14813. })
  14814. });
  14815. a.on("contentDirChanged", function(b) {
  14816. b = (a.lang.dir != b.data ? "add" : "remove") + "Class";
  14817. var c = a.ui.space(a.config.toolbarLocation);
  14818. if (c) c[b]("cke_mixed_dir_content")
  14819. })
  14820. }
  14821. }
  14822. });
  14823. for (var l = CKEDITOR.dom.element.prototype, n = ["setStyle", "removeStyle", "setAttribute", "removeAttribute"],
  14824. m = 0; m < n.length; m++) l[n[m]] = CKEDITOR.tools.override(l[n[m]], w)
  14825. })();
  14826. (function() {
  14827. var m = {
  14828. exec: function(g) {
  14829. var a = g.getCommand("blockquote").state,
  14830. k = g.getSelection(),
  14831. c = k && k.getRanges()[0];
  14832. if (c) {
  14833. var h = k.createBookmarks();
  14834. if (CKEDITOR.env.ie) {
  14835. var e = h[0].startNode,
  14836. b = h[0].endNode,
  14837. d;
  14838. if (e && "blockquote" == e.getParent().getName())
  14839. for (d = e; d = d.getNext();)
  14840. if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
  14841. e.move(d, !0);
  14842. break
  14843. } if (b && "blockquote" == b.getParent().getName())
  14844. for (d = b; d = d.getPrevious();)
  14845. if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
  14846. b.move(d);
  14847. break
  14848. }
  14849. }
  14850. var f = c.createIterator();
  14851. f.enlargeBr = g.config.enterMode != CKEDITOR.ENTER_BR;
  14852. if (a == CKEDITOR.TRISTATE_OFF) {
  14853. for (e = []; a = f.getNextParagraph();) e.push(a);
  14854. 1 > e.length && (a = g.document.createElement(g.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div"),
  14855. b = h.shift(), c.insertNode(a), a.append(new CKEDITOR.dom.text("", g.document)), c
  14856. .moveToBookmark(b), c.selectNodeContents(a), c.collapse(!0), b = c.createBookmark(), e.push(a),
  14857. h.unshift(b));
  14858. d = e[0].getParent();
  14859. c = [];
  14860. for (b = 0; b < e.length; b++) a = e[b], d = d.getCommonAncestor(a.getParent());
  14861. for (a = {
  14862. table: 1,
  14863. tbody: 1,
  14864. tr: 1,
  14865. ol: 1,
  14866. ul: 1
  14867. }; a[d.getName()];) d = d.getParent();
  14868. for (b = null; 0 < e.length;) {
  14869. for (a = e.shift(); !a.getParent().equals(d);) a = a.getParent();
  14870. a.equals(b) || c.push(a);
  14871. b = a
  14872. }
  14873. for (; 0 < c.length;)
  14874. if (a = c.shift(), "blockquote" == a.getName()) {
  14875. for (b = new CKEDITOR.dom.documentFragment(g.document); a.getFirst();) b.append(a.getFirst()
  14876. .remove()), e.push(b.getLast());
  14877. b.replace(a)
  14878. } else e.push(a);
  14879. c = g.document.createElement("blockquote");
  14880. for (c.insertBefore(e[0]); 0 < e.length;) a = e.shift(), c.append(a)
  14881. } else if (a == CKEDITOR.TRISTATE_ON) {
  14882. b = [];
  14883. for (d = {}; a = f.getNextParagraph();) {
  14884. for (e = c = null; a.getParent();) {
  14885. if ("blockquote" == a.getParent().getName()) {
  14886. c = a.getParent();
  14887. e = a;
  14888. break
  14889. }
  14890. a = a.getParent()
  14891. }
  14892. c && e && !e.getCustomData("blockquote_moveout") && (b.push(e), CKEDITOR.dom.element.setMarker(d,
  14893. e, "blockquote_moveout", !0))
  14894. }
  14895. CKEDITOR.dom.element.clearAllMarkers(d);
  14896. a = [];
  14897. e = [];
  14898. for (d = {}; 0 < b.length;) f = b.shift(), c = f.getParent(), f.getPrevious() ? f.getNext() ? (f
  14899. .breakParent(f.getParent()), e.push(f.getNext())) : f.remove().insertAfter(c) : f.remove()
  14900. .insertBefore(c), c.getCustomData("blockquote_processed") ||
  14901. (e.push(c), CKEDITOR.dom.element.setMarker(d, c, "blockquote_processed", !0)), a.push(f);
  14902. CKEDITOR.dom.element.clearAllMarkers(d);
  14903. for (b = e.length - 1; 0 <= b; b--) {
  14904. c = e[b];
  14905. a: {
  14906. d = c;
  14907. for (var f = 0, m = d.getChildCount(), l = void 0; f < m && (l = d.getChild(f)); f++)
  14908. if (l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) {
  14909. d = !1;
  14910. break a
  14911. } d = !0
  14912. }
  14913. d && c.remove()
  14914. }
  14915. if (g.config.enterMode == CKEDITOR.ENTER_BR)
  14916. for (c = !0; a.length;)
  14917. if (f = a.shift(), "div" == f.getName()) {
  14918. b = new CKEDITOR.dom.documentFragment(g.document);
  14919. !c || !f.getPrevious() || f.getPrevious().type ==
  14920. CKEDITOR.NODE_ELEMENT && f.getPrevious().isBlockBoundary() || b.append(g.document
  14921. .createElement("br"));
  14922. for (c = f.getNext() && !(f.getNext().type == CKEDITOR.NODE_ELEMENT && f.getNext()
  14923. .isBlockBoundary()); f.getFirst();) f.getFirst().remove().appendTo(b);
  14924. c && b.append(g.document.createElement("br"));
  14925. b.replace(f);
  14926. c = !1
  14927. }
  14928. }
  14929. k.selectBookmarks(h);
  14930. g.focus()
  14931. }
  14932. },
  14933. refresh: function(g, a) {
  14934. this.setState(g.elementPath(a.block || a.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON :
  14935. CKEDITOR.TRISTATE_OFF)
  14936. },
  14937. context: "blockquote",
  14938. allowedContent: "blockquote",
  14939. requiredContent: "blockquote"
  14940. };
  14941. CKEDITOR.plugins.add("blockquote", {
  14942. init: function(g) {
  14943. g.blockless || (g.addCommand("blockquote", m), g.ui.addButton && g.ui.addButton("Blockquote", {
  14944. isToggle: !0,
  14945. label: g.lang.blockquote.toolbar,
  14946. command: "blockquote",
  14947. toolbar: "blocks,10"
  14948. }))
  14949. }
  14950. })
  14951. })();
  14952. (function() {
  14953. function q(b, a) {
  14954. CKEDITOR.tools.extend(this, a, {
  14955. editor: b,
  14956. id: "cke-" + CKEDITOR.tools.getUniqueId(),
  14957. area: b._.notificationArea
  14958. });
  14959. a.type || (this.type = "info");
  14960. this.element = this._createElement();
  14961. b.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)
  14962. }
  14963. function r(b) {
  14964. var a = this;
  14965. this.editor = b;
  14966. this.notifications = [];
  14967. this.element = this._createElement();
  14968. this._uiBuffer = CKEDITOR.tools.eventsBuffer(10, this._layout, this);
  14969. this._changeBuffer = CKEDITOR.tools.eventsBuffer(500, this._layout,
  14970. this);
  14971. b.on("destroy", function() {
  14972. a._removeListeners();
  14973. a.element.remove()
  14974. })
  14975. }
  14976. CKEDITOR.plugins.add("notification", {
  14977. init: function(b) {
  14978. function a(b) {
  14979. var a = new CKEDITOR.dom.element("div");
  14980. a.setStyles({
  14981. position: "fixed",
  14982. "margin-left": "-9999px"
  14983. });
  14984. a.setAttributes({
  14985. "aria-live": "assertive",
  14986. "aria-atomic": "true"
  14987. });
  14988. a.setText(b);
  14989. CKEDITOR.document.getBody().append(a);
  14990. setTimeout(function() {
  14991. a.remove()
  14992. }, 100)
  14993. }
  14994. b._.notificationArea = new r(b);
  14995. b.showNotification = function(a, d, e) {
  14996. var f, l;
  14997. "progress" == d ? f = e : l = e;
  14998. a = new CKEDITOR.plugins.notification(b, {
  14999. message: a,
  15000. type: d,
  15001. progress: f,
  15002. duration: l
  15003. });
  15004. a.show();
  15005. return a
  15006. };
  15007. b.on("key", function(c) {
  15008. if (27 == c.data.keyCode) {
  15009. var d = b._.notificationArea.notifications;
  15010. d.length && (a(b.lang.notification.closed), d[d.length - 1].hide(), c.cancel())
  15011. }
  15012. })
  15013. }
  15014. });
  15015. q.prototype = {
  15016. show: function() {
  15017. !1 !== this.editor.fire("notificationShow", {
  15018. notification: this
  15019. }) && (this.area.add(this), this._hideAfterTimeout())
  15020. },
  15021. update: function(b) {
  15022. var a = !0;
  15023. !1 === this.editor.fire("notificationUpdate", {
  15024. notification: this,
  15025. options: b
  15026. }) && (a = !1);
  15027. var c = this.element,
  15028. d = c.findOne(".cke_notification_message"),
  15029. e = c.findOne(".cke_notification_progress"),
  15030. f = b.type;
  15031. c.removeAttribute("role");
  15032. b.progress && "progress" != this.type && (f = "progress");
  15033. f && (c.removeClass(this._getClass()), c.removeAttribute("aria-label"), this.type = f, c.addClass(this
  15034. ._getClass()), c.setAttribute("aria-label", this.type), "progress" != this.type || e ?
  15035. "progress" != this.type && e && e.remove() : (e = this._createProgressElement(), e.insertBefore(d)));
  15036. void 0 !== b.message && (this.message = b.message, d.setHtml(this.message));
  15037. void 0 !== b.progress && (this.progress = b.progress,
  15038. e && e.setStyle("width", this._getPercentageProgress()));
  15039. a && b.important && (c.setAttribute("role", "alert"), this.isVisible() || this.area.add(this));
  15040. this.duration = b.duration;
  15041. this._hideAfterTimeout()
  15042. },
  15043. hide: function() {
  15044. !1 !== this.editor.fire("notificationHide", {
  15045. notification: this
  15046. }) && this.area.remove(this)
  15047. },
  15048. isVisible: function() {
  15049. return 0 <= CKEDITOR.tools.indexOf(this.area.notifications, this)
  15050. },
  15051. _createElement: function() {
  15052. var b = this,
  15053. a, c, d = this.editor.lang.common.close;
  15054. a = new CKEDITOR.dom.element("div");
  15055. a.addClass("cke_notification");
  15056. a.addClass(this._getClass());
  15057. a.setAttributes({
  15058. id: this.id,
  15059. role: "alert",
  15060. "aria-label": this.type
  15061. });
  15062. "progress" == this.type && a.append(this._createProgressElement());
  15063. c = new CKEDITOR.dom.element("p");
  15064. c.addClass("cke_notification_message");
  15065. c.setHtml(this.message);
  15066. a.append(c);
  15067. c = CKEDITOR.dom.element.createFromHtml(
  15068. '\x3ca class\x3d"cke_notification_close" href\x3d"javascript:void(0)" title\x3d"' + d +
  15069. '" role\x3d"button" tabindex\x3d"-1"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e');
  15070. a.append(c);
  15071. c.on("click",
  15072. function() {
  15073. b.editor.focus();
  15074. b.hide()
  15075. });
  15076. return a
  15077. },
  15078. _getClass: function() {
  15079. return "progress" == this.type ? "cke_notification_info" : "cke_notification_" + this.type
  15080. },
  15081. _createProgressElement: function() {
  15082. var b = new CKEDITOR.dom.element("span");
  15083. b.addClass("cke_notification_progress");
  15084. b.setStyle("width", this._getPercentageProgress());
  15085. return b
  15086. },
  15087. _getPercentageProgress: function() {
  15088. return Math.round(100 * (this.progress || 0)) + "%"
  15089. },
  15090. _hideAfterTimeout: function() {
  15091. var b = this,
  15092. a;
  15093. this._hideTimeoutId && clearTimeout(this._hideTimeoutId);
  15094. if ("number" == typeof this.duration) a = this.duration;
  15095. else if ("info" == this.type || "success" == this.type) a = "number" == typeof this.editor.config
  15096. .notification_duration ? this.editor.config.notification_duration : 5E3;
  15097. a && (b._hideTimeoutId = setTimeout(function() {
  15098. b.hide()
  15099. }, a))
  15100. }
  15101. };
  15102. r.prototype = {
  15103. add: function(b) {
  15104. this.notifications.push(b);
  15105. this.element.append(b.element);
  15106. 1 == this.element.getChildCount() && (CKEDITOR.document.getBody().append(this.element), this
  15107. ._attachListeners());
  15108. this._layout()
  15109. },
  15110. remove: function(b) {
  15111. var a = CKEDITOR.tools.indexOf(this.notifications,
  15112. b);
  15113. 0 > a || (this.notifications.splice(a, 1), b.element.remove(), this.element.getChildCount() || (this
  15114. ._removeListeners(), this.element.remove()))
  15115. },
  15116. _createElement: function() {
  15117. var b = this.editor,
  15118. a = b.config,
  15119. c = new CKEDITOR.dom.element("div");
  15120. c.addClass("cke_notifications_area");
  15121. c.setAttribute("id", "cke_notifications_area_" + b.name);
  15122. c.setStyle("z-index", a.baseFloatZIndex - 2);
  15123. return c
  15124. },
  15125. _attachListeners: function() {
  15126. var b = CKEDITOR.document.getWindow(),
  15127. a = this.editor;
  15128. b.on("scroll", this._uiBuffer.input);
  15129. b.on("resize", this._uiBuffer.input);
  15130. a.on("change", this._changeBuffer.input);
  15131. a.on("floatingSpaceLayout", this._layout, this, null, 20);
  15132. a.on("blur", this._layout, this, null, 20)
  15133. },
  15134. _removeListeners: function() {
  15135. var b = CKEDITOR.document.getWindow(),
  15136. a = this.editor;
  15137. b.removeListener("scroll", this._uiBuffer.input);
  15138. b.removeListener("resize", this._uiBuffer.input);
  15139. a.removeListener("change", this._changeBuffer.input);
  15140. a.removeListener("floatingSpaceLayout", this._layout);
  15141. a.removeListener("blur", this._layout)
  15142. },
  15143. _layout: function() {
  15144. function b() {
  15145. a.setStyle("left",
  15146. k(n + d.width - g - h))
  15147. }
  15148. var a = this.element,
  15149. c = this.editor,
  15150. d = c.ui.contentsElement.getClientRect(),
  15151. e = c.ui.contentsElement.getDocumentPosition(),
  15152. f, l, u = a.getClientRect(),
  15153. m, g = this._notificationWidth,
  15154. h = this._notificationMargin;
  15155. m = CKEDITOR.document.getWindow();
  15156. var p = m.getScrollPosition(),
  15157. t = m.getViewPaneSize(),
  15158. q = CKEDITOR.document.getBody(),
  15159. r = q.getDocumentPosition(),
  15160. k = CKEDITOR.tools.cssLength;
  15161. g && h || (m = this.element.getChild(0), g = this._notificationWidth = m.getClientRect().width, h = this
  15162. ._notificationMargin = parseInt(m.getComputedStyle("margin-left"),
  15163. 10) + parseInt(m.getComputedStyle("margin-right"), 10));
  15164. c.toolbar && (f = c.ui.space(c.config.toolbarLocation), l = f.getClientRect());
  15165. f && f.isVisible() && l.bottom > d.top && l.bottom < d.bottom - u.height ? a.setStyles({
  15166. position: "fixed",
  15167. top: k(l.bottom)
  15168. }) : 0 < d.top ? a.setStyles({
  15169. position: "absolute",
  15170. top: k(e.y)
  15171. }) : e.y + d.height - u.height > p.y ? a.setStyles({
  15172. position: "fixed",
  15173. top: 0
  15174. }) : a.setStyles({
  15175. position: "absolute",
  15176. top: k(e.y + d.height - u.height)
  15177. });
  15178. var n = "fixed" == a.getStyle("position") ? d.left : "static" != q.getComputedStyle("position") ?
  15179. e.x - r.x : e.x;
  15180. d.width < g + h ? e.x + g + h > p.x + t.width ? b() : a.setStyle("left", k(n)) : e.x + g + h > p.x + t
  15181. .width ? a.setStyle("left", k(n)) : e.x + d.width / 2 + g / 2 + h > p.x + t.width ? a.setStyle("left",
  15182. k(n - e.x + p.x + t.width - g - h)) : 0 > d.left + d.width - g - h ? b() : 0 > d.left + d.width /
  15183. 2 - g / 2 ? a.setStyle("left", k(n - e.x + p.x)) : a.setStyle("left", k(n + d.width / 2 - g / 2 - h /
  15184. 2))
  15185. }
  15186. };
  15187. CKEDITOR.plugins.notification = q
  15188. })();
  15189. (function() {
  15190. var c = '\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"' + (CKEDITOR.env
  15191. .gecko && !CKEDITOR.env.hc ? "" : " href\x3d\"javascript:void('{titleJs}')\"") +
  15192. ' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"{hasArrowAriaHtml}{toggleAriaHtml}';
  15193. CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  15194. CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  15195. var l = "";
  15196. CKEDITOR.env.ie && (l =
  15197. 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26'
  15198. );
  15199. var c = c + (
  15200. ' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"' +
  15201. l +
  15202. 'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"'
  15203. ) +
  15204. '\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcutSpace}{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',
  15205. v = CKEDITOR.addTemplate("buttonArrow", '\x3cspan class\x3d"cke_button_arrow"\x3e' + (CKEDITOR.env.hc ?
  15206. "\x26#9660;" : "") + "\x3c/span\x3e"),
  15207. w = CKEDITOR.addTemplate("button", c);
  15208. CKEDITOR.plugins.add("button", {
  15209. beforeInit: function(a) {
  15210. a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler)
  15211. }
  15212. });
  15213. CKEDITOR.UI_BUTTON = "button";
  15214. CKEDITOR.ui.button = function(a) {
  15215. CKEDITOR.tools.extend(this, a, {
  15216. isToggle: a.isToggle || !1,
  15217. title: a.label,
  15218. click: a.click || function(b) {
  15219. b.execCommand(a.command)
  15220. }
  15221. });
  15222. this._ = {}
  15223. };
  15224. CKEDITOR.ui.button.handler = {
  15225. create: function(a) {
  15226. return new CKEDITOR.ui.button(a)
  15227. }
  15228. };
  15229. CKEDITOR.ui.button.prototype = {
  15230. render: function(a, b) {
  15231. function c() {
  15232. var f = a.mode;
  15233. f && (f = this.modes[f] ? void 0 !== p[f] ? p[f] : CKEDITOR.TRISTATE_OFF :
  15234. CKEDITOR.TRISTATE_DISABLED, f = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : f,
  15235. this.setState(f), this.refresh && this.refresh())
  15236. }
  15237. var p = null,
  15238. q = CKEDITOR.env,
  15239. r = this._.id = CKEDITOR.tools.getNextId(),
  15240. g = "",
  15241. d = this.command,
  15242. l, m, k;
  15243. this._.editor = a;
  15244. var e = {
  15245. id: r,
  15246. button: this,
  15247. editor: a,
  15248. focus: function() {
  15249. CKEDITOR.document.getById(r).focus()
  15250. },
  15251. execute: function() {
  15252. this.button.click(a)
  15253. },
  15254. attach: function(a) {
  15255. this.button.attach(a)
  15256. }
  15257. },
  15258. x = CKEDITOR.tools.addFunction(function(a) {
  15259. if (e.onkey) return a = new CKEDITOR.dom.event(a), !1 !==
  15260. e.onkey(e, a.getKeystroke())
  15261. }),
  15262. y = CKEDITOR.tools.addFunction(function(a) {
  15263. var b;
  15264. e.onfocus && (b = !1 !== e.onfocus(e, new CKEDITOR.dom.event(a)));
  15265. return b
  15266. }),
  15267. u = 0;
  15268. e.clickFn = l = CKEDITOR.tools.addFunction(function() {
  15269. u && (a.unlockSelection(1), u = 0);
  15270. e.execute();
  15271. q.iOS && a.focus()
  15272. });
  15273. this.modes ? (p = {}, a.on("beforeModeUnload", function() {
  15274. a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (p[a.mode] = this._.state)
  15275. }, this), a.on("activeFilterChange", c, this), a.on("mode", c, this), !this.readOnly && a.on(
  15276. "readOnly", c, this)) : d && (d = a.getCommand(d)) &&
  15277. (d.on("state", function() {
  15278. this.setState(d.state)
  15279. }, this), g += d.state == CKEDITOR.TRISTATE_ON ? "on" : d.state == CKEDITOR.TRISTATE_DISABLED ?
  15280. "disabled" : "off");
  15281. var n;
  15282. if (this.directional) a.on("contentDirChanged", function(b) {
  15283. var c = CKEDITOR.document.getById(this._.id),
  15284. d = c.getFirst();
  15285. b = b.data;
  15286. b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl");
  15287. d.setAttribute("style", CKEDITOR.skin.getIconStyle(n, "rtl" == b, this.icon, this.iconOffset))
  15288. }, this);
  15289. d ? (m = a.getCommandKeystroke(d)) && (k = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,
  15290. m)) : g += "off";
  15291. m = this.name || this.command;
  15292. var h = null,
  15293. t = this.icon;
  15294. n = m;
  15295. this.icon && !/\./.test(this.icon) ? (n = this.icon, t = null) : (this.icon && (h = this.icon), CKEDITOR
  15296. .env.hidpi && this.iconHiDpi && (h = this.iconHiDpi));
  15297. h ? (CKEDITOR.skin.addIcon(h, h), t = null) : h = n;
  15298. g = {
  15299. id: r,
  15300. name: m,
  15301. iconName: n,
  15302. label: this.label,
  15303. cls: (this.hasArrow ? "cke_button_expandable " : "") + (this.className || ""),
  15304. state: g,
  15305. ariaDisabled: "disabled" == g ? "true" : "false",
  15306. title: this.title + (k ? " (" + k.display + ")" : ""),
  15307. ariaShortcutSpace: k ? "\x26nbsp;" : "",
  15308. ariaShortcut: k ? a.lang.common.keyboardShortcut +
  15309. " " + k.aria : "",
  15310. titleJs: q.gecko && !q.hc ? "" : (this.title || "").replace("'", ""),
  15311. hasArrow: "string" === typeof this.hasArrow && this.hasArrow || (this.hasArrow ? "true" : "false"),
  15312. keydownFn: x,
  15313. focusFn: y,
  15314. clickFn: l,
  15315. style: CKEDITOR.skin.getIconStyle(h, "rtl" == a.lang.dir, t, this.iconOffset),
  15316. arrowHtml: this.hasArrow ? v.output() : "",
  15317. hasArrowAriaHtml: this.hasArrow ? ' aria-expanded\x3d"false"' : "",
  15318. toggleAriaHtml: this.isToggle ? 'aria-pressed\x3d"false"' : ""
  15319. };
  15320. w.output(g, b);
  15321. if (this.onRender) this.onRender();
  15322. return e
  15323. },
  15324. setState: function(a) {
  15325. if (this._.state ==
  15326. a) return !1;
  15327. this._.state = a;
  15328. var b = CKEDITOR.document.getById(this._.id);
  15329. return b ? (b.setState(a, "cke_button"), b.setAttribute("aria-disabled", a == CKEDITOR
  15330. .TRISTATE_DISABLED), this.isToggle && !this.hasArrow && b.setAttribute("aria-pressed", a ===
  15331. CKEDITOR.TRISTATE_ON), !0) : !1
  15332. },
  15333. getState: function() {
  15334. return this._.state
  15335. },
  15336. toFeature: function(a) {
  15337. if (this._.feature) return this._.feature;
  15338. var b = this;
  15339. this.allowedContent || this.requiredContent || !this.command || (b = a.getCommand(this.command) || b);
  15340. return this._.feature = b
  15341. }
  15342. };
  15343. CKEDITOR.ui.prototype.addButton =
  15344. function(a, b) {
  15345. this.add(a, CKEDITOR.UI_BUTTON, b)
  15346. }
  15347. })();
  15348. (function() {
  15349. function D(b) {
  15350. function d() {
  15351. for (var a = f(), e = CKEDITOR.tools.clone(b.config.toolbarGroups) || v(b), n = 0; n < e.length; n++) {
  15352. var g = e[n];
  15353. if ("/" != g) {
  15354. "string" == typeof g && (g = e[n] = {
  15355. name: g
  15356. });
  15357. var l, d = g.groups;
  15358. if (d)
  15359. for (var h = 0; h < d.length; h++) l = d[h], (l = a[l]) && c(g, l);
  15360. (l = a[g.name]) && c(g, l)
  15361. }
  15362. }
  15363. return e
  15364. }
  15365. function f() {
  15366. var a = {},
  15367. c, e, g;
  15368. for (c in b.ui.items) e = b.ui.items[c], g = e.toolbar || "others", g = g.split(","), e = g[0], g =
  15369. parseInt(g[1] || -1, 10), a[e] || (a[e] = []), a[e].push({
  15370. name: c,
  15371. order: g
  15372. });
  15373. for (e in a) a[e] = a[e].sort(function(a,
  15374. b) {
  15375. return a.order == b.order ? 0 : 0 > b.order ? -1 : 0 > a.order ? 1 : a.order < b.order ? -1 : 1
  15376. });
  15377. return a
  15378. }
  15379. function c(c, e) {
  15380. if (e.length) {
  15381. c.items ? c.items.push(b.ui.create("-")) : c.items = [];
  15382. for (var d; d = e.shift();) d = "string" == typeof d ? d : d.name, a && -1 != CKEDITOR.tools.indexOf(a,
  15383. d) || (d = b.ui.create(d)) && b.addFeature(d) && c.items.push(d)
  15384. }
  15385. }
  15386. function h(a) {
  15387. var b = [],
  15388. e, d, h;
  15389. for (e = 0; e < a.length; ++e) d = a[e], h = {}, "/" == d ? b.push(d) : CKEDITOR.tools.isArray(d) ? (c(h,
  15390. CKEDITOR.tools.clone(d)), b.push(h)) : d.items && (c(h, CKEDITOR.tools.clone(d.items)),
  15391. h.name = d.name, b.push(h));
  15392. return b
  15393. }
  15394. var a = function(a) {
  15395. return a && "string" === typeof a ? a.split(",") : a
  15396. }(b.config.removeButtons),
  15397. e = b.config.toolbar;
  15398. "string" == typeof e && (e = b.config["toolbar_" + e]);
  15399. return b.toolbar = e ? h(e) : d()
  15400. }
  15401. function v(b) {
  15402. return b._.toolbarGroups || (b._.toolbarGroups = [{
  15403. name: "document",
  15404. groups: ["mode", "document", "doctools"]
  15405. }, {
  15406. name: "clipboard",
  15407. groups: ["clipboard", "undo"]
  15408. }, {
  15409. name: "editing",
  15410. groups: ["find", "selection", "spellchecker"]
  15411. }, {
  15412. name: "forms"
  15413. }, "/", {
  15414. name: "basicstyles",
  15415. groups: ["basicstyles", "cleanup"]
  15416. },
  15417. {
  15418. name: "paragraph",
  15419. groups: ["list", "indent", "blocks", "align", "bidi"]
  15420. }, {
  15421. name: "links"
  15422. }, {
  15423. name: "insert"
  15424. }, "/", {
  15425. name: "styles"
  15426. }, {
  15427. name: "colors"
  15428. }, {
  15429. name: "tools"
  15430. }, {
  15431. name: "others"
  15432. }, {
  15433. name: "about"
  15434. }
  15435. ])
  15436. }
  15437. var z = function() {
  15438. this.toolbars = []
  15439. };
  15440. z.prototype.focus = function() {
  15441. for (var b = 0, d; d = this.toolbars[b++];)
  15442. for (var f = 0, c; c = d.items[f++];)
  15443. if (c.focus) {
  15444. c.focus();
  15445. return
  15446. }
  15447. };
  15448. var E = {
  15449. modes: {
  15450. wysiwyg: 1,
  15451. source: 1
  15452. },
  15453. readOnly: 1,
  15454. exec: function(b) {
  15455. b.toolbox && (CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() {
  15456. b.toolbox.focus()
  15457. }, 100) : b.toolbox.focus())
  15458. }
  15459. };
  15460. CKEDITOR.plugins.add("toolbar", {
  15461. requires: "button",
  15462. init: function(b) {
  15463. var d, f = function(c, h) {
  15464. var a, e = "rtl" == b.lang.dir,
  15465. k = b.config.toolbarGroupCycling,
  15466. q = e ? 37 : 39,
  15467. e = e ? 39 : 37,
  15468. k = void 0 === k || k;
  15469. switch (h) {
  15470. case 9:
  15471. case CKEDITOR.SHIFT + 9:
  15472. for (; !a || !a.items.length;)
  15473. if (a = 9 == h ? (a ? a.next : c.toolbar.next) || b.toolbox.toolbars[0] : (a ? a.previous :
  15474. c.toolbar.previous) || b.toolbox.toolbars[b.toolbox.toolbars.length - 1], a.items
  15475. .length)
  15476. for (c = a.items[d ? a.items.length - 1 : 0]; c && !c.focus;)(c = d ? c.previous : c
  15477. .next) || (a = 0);
  15478. c && c.focus();
  15479. return !1;
  15480. case q:
  15481. a = c;
  15482. do a = a.next, !a && k && (a = c.toolbar.items[0]); while (a && !a.focus);
  15483. a ? a.focus() : f(c, 9);
  15484. return !1;
  15485. case 40:
  15486. return c.button && c.button.hasArrow ? c.execute() : f(c, 40 == h ? q : e), !1;
  15487. case e:
  15488. case 38:
  15489. a = c;
  15490. do a = a.previous, !a && k && (a = c.toolbar.items[c.toolbar.items.length - 1]); while (a && !
  15491. a.focus);
  15492. a ? a.focus() : (d = 1, f(c, CKEDITOR.SHIFT + 9), d = 0);
  15493. return !1;
  15494. case 27:
  15495. return b.focus(), !1;
  15496. case 13:
  15497. case 32:
  15498. return c.execute(), !1;
  15499. case CKEDITOR.ALT + 122:
  15500. return b.execCommand("elementsPathFocus"), !1
  15501. }
  15502. return !0
  15503. };
  15504. b.on("uiSpace", function(c) {
  15505. if (c.data.space ==
  15506. b.config.toolbarLocation) {
  15507. c.removeListener();
  15508. b.toolbox = new z;
  15509. var d = CKEDITOR.tools.getNextId(),
  15510. a = ['\x3cspan id\x3d"', d, '" class\x3d"cke_voice_label"\x3e', b.lang.toolbar.toolbars,
  15511. "\x3c/span\x3e", '\x3cspan id\x3d"' + b.ui.spaceId("toolbox") +
  15512. '" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"', d,
  15513. '" onmousedown\x3d"return false;"\x3e'
  15514. ],
  15515. d = !1 !== b.config.toolbarStartupExpanded,
  15516. e, k;
  15517. b.config.toolbarCanCollapse && b.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && a.push(
  15518. '\x3cspan class\x3d"cke_toolbox_main"' +
  15519. (d ? "\x3e" : ' style\x3d"display:none"\x3e'));
  15520. for (var q = b.toolbox.toolbars, n = D(b), g = n.length, l = 0; l < g; l++) {
  15521. var r, m = 0,
  15522. w, p = n[l],
  15523. v = "/" !== p && ("/" === n[l + 1] || l == g - 1),
  15524. x;
  15525. if (p)
  15526. if (e && (a.push("\x3c/span\x3e"), k = e = 0), "/" === p) a.push(
  15527. '\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');
  15528. else {
  15529. x = p.items || p;
  15530. for (var y = 0; y < x.length; y++) {
  15531. var t = x[y],
  15532. A;
  15533. if (t) {
  15534. var B = function(c) {
  15535. c = c.render(b, a);
  15536. u = m.items.push(c) - 1;
  15537. 0 < u && (c.previous = m.items[u - 1], c.previous.next = c);
  15538. c.toolbar = m;
  15539. c.onkey = f
  15540. };
  15541. if (t.type == CKEDITOR.UI_SEPARATOR) k = e &&
  15542. t;
  15543. else {
  15544. A = !1 !== t.canGroup;
  15545. if (!m) {
  15546. r = CKEDITOR.tools.getNextId();
  15547. m = {
  15548. id: r,
  15549. items: []
  15550. };
  15551. w = p.name && (b.lang.toolbar.toolbarGroups[p.name] || p.name);
  15552. a.push('\x3cspan id\x3d"', r, '" class\x3d"cke_toolbar' + (v ?
  15553. ' cke_toolbar_last"' : '"'), w ? ' aria-labelledby\x3d"' + r + '_label"' :
  15554. "", ' role\x3d"toolbar"\x3e');
  15555. w && a.push('\x3cspan id\x3d"', r, '_label" class\x3d"cke_voice_label"\x3e', w,
  15556. "\x3c/span\x3e");
  15557. a.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');
  15558. var u = q.push(m) - 1;
  15559. 0 < u && (m.previous = q[u - 1], m.previous.next = m)
  15560. }
  15561. A ?
  15562. e || (a.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'),
  15563. e = 1) : e && (a.push("\x3c/span\x3e"), e = 0);
  15564. k && (B(k), k = 0);
  15565. B(t)
  15566. }
  15567. }
  15568. }
  15569. e && (a.push("\x3c/span\x3e"), k = e = 0);
  15570. m && a.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')
  15571. }
  15572. }
  15573. b.config.toolbarCanCollapse && a.push("\x3c/span\x3e");
  15574. if (b.config.toolbarCanCollapse && b.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  15575. var C = CKEDITOR.tools.addFunction(function() {
  15576. b.execCommand("toolbarCollapse")
  15577. });
  15578. b.on("destroy", function() {
  15579. CKEDITOR.tools.removeFunction(C)
  15580. });
  15581. b.addCommand("toolbarCollapse", {
  15582. readOnly: 1,
  15583. exec: function(a) {
  15584. var b = a.ui.space("toolbar_collapser"),
  15585. c = b.getPrevious(),
  15586. d = a.ui.space("contents"),
  15587. e = c.getParent(),
  15588. h = parseInt(d.$.style.height, 10),
  15589. g = e.$.offsetHeight,
  15590. f = b.hasClass("cke_toolbox_collapser_min");
  15591. f ? (c.show(), b.removeClass("cke_toolbox_collapser_min"), b.setAttribute("title",
  15592. a.lang.toolbar.toolbarCollapse)) : (c.hide(), b.addClass(
  15593. "cke_toolbox_collapser_min"), b.setAttribute("title", a.lang.toolbar
  15594. .toolbarExpand));
  15595. b.getFirst().setText(f ? "▲" : "◀");
  15596. d.setStyle("height",
  15597. h - (e.$.offsetHeight - g) + "px");
  15598. a.fire("resize", {
  15599. outerHeight: a.container.$.offsetHeight,
  15600. contentsHeight: d.$.offsetHeight,
  15601. outerWidth: a.container.$.offsetWidth
  15602. })
  15603. },
  15604. modes: {
  15605. wysiwyg: 1,
  15606. source: 1
  15607. }
  15608. });
  15609. b.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109),
  15610. "toolbarCollapse");
  15611. a.push('\x3ca title\x3d"' + (d ? b.lang.toolbar.toolbarCollapse : b.lang.toolbar
  15612. .toolbarExpand) + '" id\x3d"' + b.ui.spaceId("toolbar_collapser") +
  15613. '" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');
  15614. d || a.push(" cke_toolbox_collapser_min");
  15615. a.push('" onclick\x3d"CKEDITOR.tools.callFunction(' + C + ')"\x3e',
  15616. '\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e', "\x3c/a\x3e")
  15617. }
  15618. a.push("\x3c/span\x3e");
  15619. c.data.html += a.join("")
  15620. }
  15621. });
  15622. b.on("destroy", function() {
  15623. if (this.toolbox) {
  15624. var b, d = 0,
  15625. a, e, f;
  15626. for (b = this.toolbox.toolbars; d < b.length; d++)
  15627. for (e = b[d].items, a = 0; a < e.length; a++) f = e[a], f.clickFn && CKEDITOR.tools
  15628. .removeFunction(f.clickFn), f.keyDownFn && CKEDITOR.tools.removeFunction(f.keyDownFn)
  15629. }
  15630. });
  15631. b.on("uiReady", function() {
  15632. var c = b.ui.space("toolbox");
  15633. c && b.focusManager.add(c,
  15634. 1)
  15635. });
  15636. b.addCommand("toolbarFocus", E);
  15637. b.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
  15638. b.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
  15639. b.ui.addHandler(CKEDITOR.UI_SEPARATOR, {
  15640. create: function() {
  15641. return {
  15642. render: function(b, d) {
  15643. d.push(
  15644. '\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');
  15645. return {}
  15646. }
  15647. }
  15648. }
  15649. })
  15650. }
  15651. });
  15652. CKEDITOR.ui.prototype.addToolbarGroup = function(b, d, f) {
  15653. var c = v(this.editor),
  15654. h = 0 === d,
  15655. a = {
  15656. name: b
  15657. };
  15658. if (f) {
  15659. if (f = CKEDITOR.tools.search(c, function(a) {
  15660. return a.name == f
  15661. })) {
  15662. !f.groups && (f.groups = []);
  15663. if (d &&
  15664. (d = CKEDITOR.tools.indexOf(f.groups, d), 0 <= d)) {
  15665. f.groups.splice(d + 1, 0, b);
  15666. return
  15667. }
  15668. h ? f.groups.splice(0, 0, b) : f.groups.push(b);
  15669. return
  15670. }
  15671. d = null
  15672. }
  15673. d && (d = CKEDITOR.tools.indexOf(c, function(a) {
  15674. return a.name == d
  15675. }));
  15676. h ? c.splice(0, 0, b) : "number" == typeof d ? c.splice(d + 1, 0, a) : c.push(b)
  15677. }
  15678. })();
  15679. CKEDITOR.UI_SEPARATOR = "separator";
  15680. CKEDITOR.config.toolbarLocation = "top";
  15681. (function() {
  15682. function t(a, b, c) {
  15683. b.type || (b.type = "auto");
  15684. if (c && !1 === a.fire("beforePaste", b) || !b.dataValue && b.dataTransfer.isEmpty()) return !1;
  15685. b.dataValue || (b.dataValue = "");
  15686. if (CKEDITOR.env.gecko && "drop" == b.method && a.toolbox) a.once("afterPaste", function() {
  15687. a.toolbox.focus();
  15688. a.focus()
  15689. });
  15690. return a.fire("paste", b)
  15691. }
  15692. function y(a) {
  15693. function b() {
  15694. var b = a.editable();
  15695. if (CKEDITOR.plugins.clipboard.isCustomCopyCutSupported) {
  15696. var c = function(b) {
  15697. a.getSelection().isCollapsed() || (a.readOnly && "cut" == b.name || n.initPasteDataTransfer(b,
  15698. a), b.data.preventDefault())
  15699. };
  15700. b.on("copy", c);
  15701. b.on("cut", c);
  15702. b.on("cut", function() {
  15703. a.readOnly || a.extractSelectedHtml()
  15704. }, null, null, 999)
  15705. }
  15706. b.on(n.mainPasteEvent, function(a) {
  15707. "beforepaste" == n.mainPasteEvent && u || m(a)
  15708. });
  15709. "beforepaste" == n.mainPasteEvent && (b.on("paste", function(a) {
  15710. w || (g(), a.data.preventDefault(), m(a), e("paste"))
  15711. }), b.on("contextmenu", f, null, null, 0), b.on("beforepaste", function(a) {
  15712. !a.data || a.data.$.ctrlKey || a.data.$.shiftKey || f()
  15713. }, null, null, 0));
  15714. b.on("beforecut", function() {
  15715. !u && l(a)
  15716. });
  15717. var h;
  15718. b.attachListener(CKEDITOR.env.ie ?
  15719. b : a.document.getDocumentElement(), "mouseup",
  15720. function() {
  15721. h = setTimeout(p, 0)
  15722. });
  15723. a.on("destroy", function() {
  15724. clearTimeout(h)
  15725. });
  15726. b.on("keyup", p)
  15727. }
  15728. function c(b) {
  15729. return {
  15730. type: b,
  15731. canUndo: "cut" == b,
  15732. startDisabled: !0,
  15733. fakeKeystroke: "cut" == b ? CKEDITOR.CTRL + 88 : CKEDITOR.CTRL + 67,
  15734. exec: function() {
  15735. "cut" == this.type && l();
  15736. var b;
  15737. var c = this.type;
  15738. if (CKEDITOR.env.ie) b = e(c);
  15739. else try {
  15740. b = a.document.$.execCommand(c, !1, null)
  15741. } catch (h) {
  15742. b = !1
  15743. }
  15744. b || a.showNotification(a.lang.clipboard[this.type + "Error"]);
  15745. return b
  15746. }
  15747. }
  15748. }
  15749. function d() {
  15750. return {
  15751. canUndo: !1,
  15752. async: !0,
  15753. fakeKeystroke: CKEDITOR.CTRL + 86,
  15754. exec: function(a, b) {
  15755. function c(b, m) {
  15756. m = "undefined" !== typeof m ? m : !0;
  15757. b ? (b.method = "paste", b.dataTransfer || (b.dataTransfer = n.initPasteDataTransfer()), t(a, b,
  15758. m)) : d && !a._.forcePasteDialog && a.showNotification(p, "info", a.config
  15759. .clipboard_notificationDuration);
  15760. a._.forcePasteDialog = !1;
  15761. a.fire("afterCommandExec", {
  15762. name: "paste",
  15763. command: h,
  15764. returnValue: !!b
  15765. })
  15766. }
  15767. b = "undefined" !== typeof b && null !== b ? b : {};
  15768. var h = this,
  15769. d = "undefined" !== typeof b.notification ? b.notification : !0,
  15770. m = b.type,
  15771. e = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,
  15772. a.getCommandKeystroke(this)),
  15773. p = "string" === typeof d ? d : a.lang.clipboard.pasteNotification.replace(/%1/,
  15774. '\x3ckbd aria-label\x3d"' + e.aria + '"\x3e' + e.display + "\x3c/kbd\x3e"),
  15775. e = "string" === typeof b ? b : b.dataValue;
  15776. m && !0 !== a.config.forcePasteAsPlainText && "allow-word" !== a.config.forcePasteAsPlainText ? a._
  15777. .nextPasteType = m : delete a._.nextPasteType;
  15778. "string" === typeof e ? c({
  15779. dataValue: e
  15780. }) : a.getClipboardData(c)
  15781. }
  15782. }
  15783. }
  15784. function g() {
  15785. w = 1;
  15786. setTimeout(function() {
  15787. w = 0
  15788. }, 100)
  15789. }
  15790. function f() {
  15791. u = 1;
  15792. setTimeout(function() {
  15793. u = 0
  15794. }, 10)
  15795. }
  15796. function e(b) {
  15797. var c =
  15798. a.document,
  15799. h = c.getBody(),
  15800. d = !1,
  15801. m = function() {
  15802. d = !0
  15803. };
  15804. h.on(b, m);
  15805. 7 < CKEDITOR.env.version ? c.$.execCommand(b) : c.$.selection.createRange().execCommand(b);
  15806. h.removeListener(b, m);
  15807. return d
  15808. }
  15809. function l() {
  15810. if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  15811. var b = a.getSelection(),
  15812. c, h, d;
  15813. b.getType() == CKEDITOR.SELECTION_ELEMENT && (c = b.getSelectedElement()) && (h = b.getRanges()[0], d = a
  15814. .document.createText(""), d.insertBefore(c), h.setStartBefore(d), h.setEndAfter(c), b.selectRanges([
  15815. h]), setTimeout(function() {
  15816. c.getParent() && (d.remove(), b.selectElement(c))
  15817. },
  15818. 0))
  15819. }
  15820. }
  15821. function q(b, c) {
  15822. var h = a.document,
  15823. d = a.editable(),
  15824. m = function(a) {
  15825. a.cancel()
  15826. },
  15827. e;
  15828. if (!h.getById("cke_pastebin")) {
  15829. var p = a.getSelection(),
  15830. g = p.createBookmarks();
  15831. CKEDITOR.env.ie && p.root.fire("selectionchange");
  15832. var k = new CKEDITOR.dom.element(!CKEDITOR.env.webkit && !d.is("body") || CKEDITOR.env.ie ? "div" :
  15833. "body", h);
  15834. k.setAttributes({
  15835. id: "cke_pastebin",
  15836. "data-cke-temp": "1"
  15837. });
  15838. var f = 0,
  15839. h = h.getWindow();
  15840. CKEDITOR.env.webkit ? (d.append(k), k.addClass("cke_editable"), d.is("body") || (f = "static" != d
  15841. .getComputedStyle("position") ?
  15842. d : CKEDITOR.dom.element.get(d.$.offsetParent), f = f.getDocumentPosition().y)) : d.getAscendant(
  15843. CKEDITOR.env.ie ? "body" : "html", 1).append(k);
  15844. k.setStyles({
  15845. position: "absolute",
  15846. top: h.getScrollPosition().y - f + 10 + "px",
  15847. width: "1px",
  15848. height: Math.max(1, h.getViewPaneSize().height - 20) + "px",
  15849. overflow: "hidden",
  15850. margin: 0,
  15851. padding: 0
  15852. });
  15853. CKEDITOR.env.safari && k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text"));
  15854. (f = k.getParent().isReadOnly()) ? (k.setOpacity(0), k.setAttribute("contenteditable", !0)) : k.setStyle(
  15855. "ltr" == a.config.contentsLangDirection ?
  15856. "left" : "right", "-10000px");
  15857. a.on("selectionChange", m, null, null, 0);
  15858. if (CKEDITOR.env.webkit || CKEDITOR.env.gecko) e = d.once("blur", m, null, null, -100);
  15859. f && k.focus();
  15860. f = new CKEDITOR.dom.range(k);
  15861. f.selectNodeContents(k);
  15862. var l = f.select();
  15863. CKEDITOR.env.ie && (e = d.once("blur", function() {
  15864. a.lockSelection(l)
  15865. }));
  15866. var n = CKEDITOR.document.getWindow().getScrollPosition().y;
  15867. setTimeout(function() {
  15868. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = n);
  15869. e && e.removeListener();
  15870. CKEDITOR.env.ie && d.focus();
  15871. p.selectBookmarks(g);
  15872. k.remove();
  15873. var b;
  15874. CKEDITOR.env.webkit && (b = k.getFirst()) && b.is && b.hasClass("Apple-style-span") && (k = b);
  15875. a.removeListener("selectionChange", m);
  15876. c(k.getHtml())
  15877. }, 0)
  15878. }
  15879. }
  15880. function v() {
  15881. if ("paste" == n.mainPasteEvent) return a.fire("beforePaste", {
  15882. type: "auto",
  15883. method: "paste"
  15884. }), !1;
  15885. a.focus();
  15886. g();
  15887. var b = a.focusManager;
  15888. b.lock();
  15889. if (a.editable().fire(n.mainPasteEvent) && !e("paste")) return b.unlock(), !1;
  15890. b.unlock();
  15891. return !0
  15892. }
  15893. function h(b) {
  15894. if ("wysiwyg" == a.mode) switch (b.data.keyCode) {
  15895. case CKEDITOR.CTRL + 86:
  15896. case CKEDITOR.SHIFT + 45:
  15897. b =
  15898. a.editable();
  15899. g();
  15900. "paste" == n.mainPasteEvent && b.fire("beforepaste");
  15901. break;
  15902. case CKEDITOR.CTRL + 88:
  15903. case CKEDITOR.SHIFT + 46:
  15904. a.fire("saveSnapshot"), setTimeout(function() {
  15905. a.fire("saveSnapshot")
  15906. }, 50)
  15907. }
  15908. }
  15909. function m(b) {
  15910. var c = {
  15911. type: "auto",
  15912. method: "paste",
  15913. dataTransfer: n.initPasteDataTransfer(b)
  15914. };
  15915. c.dataTransfer.cacheData();
  15916. var h = !1 !== a.fire("beforePaste", c);
  15917. h && n.canClipboardApiBeTrusted(c.dataTransfer, a) ? (b.data.preventDefault(), setTimeout(function() {
  15918. t(a, c)
  15919. }, 0)) : q(b, function(b) {
  15920. c.dataValue = b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,
  15921. "");
  15922. h && t(a, c)
  15923. })
  15924. }
  15925. function p() {
  15926. if ("wysiwyg" == a.mode) {
  15927. var b = k("paste");
  15928. a.getCommand("cut").setState(k("cut"));
  15929. a.getCommand("copy").setState(k("copy"));
  15930. a.getCommand("paste").setState(b);
  15931. a.fire("pasteState", b)
  15932. }
  15933. }
  15934. function k(b) {
  15935. var c = a.getSelection(),
  15936. c = c && c.getRanges()[0];
  15937. if ((a.readOnly || c && c.checkReadOnly()) && b in {
  15938. paste: 1,
  15939. cut: 1
  15940. }) return CKEDITOR.TRISTATE_DISABLED;
  15941. if ("paste" == b) return CKEDITOR.TRISTATE_OFF;
  15942. b = a.getSelection();
  15943. c = b.getRanges();
  15944. return b.getType() == CKEDITOR.SELECTION_NONE || 1 == c.length && c[0].collapsed ?
  15945. CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF
  15946. }
  15947. var n = CKEDITOR.plugins.clipboard,
  15948. u = 0,
  15949. w = 0;
  15950. (function() {
  15951. a.on("key", h);
  15952. a.on("contentDom", b);
  15953. a.on("selectionChange", p);
  15954. if (a.contextMenu) {
  15955. a.contextMenu.addListener(function() {
  15956. return {
  15957. cut: k("cut"),
  15958. copy: k("copy"),
  15959. paste: k("paste")
  15960. }
  15961. });
  15962. var c = null;
  15963. a.on("menuShow", function() {
  15964. c && (c.removeListener(), c = null);
  15965. var b = a.contextMenu.findItemByCommandName("paste");
  15966. b && b.element && (c = b.element.on("touchend", function() {
  15967. a._.forcePasteDialog = !0
  15968. }))
  15969. })
  15970. }
  15971. if (a.ui.addButton) a.once("instanceReady",
  15972. function() {
  15973. a._.pasteButtons && CKEDITOR.tools.array.forEach(a._.pasteButtons, function(b) {
  15974. if (b = a.ui.get(b))
  15975. if (b = CKEDITOR.document.getById(b._.id)) b.on("touchend", function() {
  15976. a._.forcePasteDialog = !0
  15977. })
  15978. })
  15979. })
  15980. })();
  15981. (function() {
  15982. function b(c, h, d, m, e) {
  15983. var p = a.lang.clipboard[h];
  15984. a.addCommand(h, d);
  15985. a.ui.addButton && a.ui.addButton(c, {
  15986. label: p,
  15987. command: h,
  15988. toolbar: "clipboard," + m
  15989. });
  15990. a.addMenuItems && a.addMenuItem(h, {
  15991. label: p,
  15992. command: h,
  15993. group: "clipboard",
  15994. order: e
  15995. })
  15996. }
  15997. b("Cut", "cut", c("cut"), 10, 1);
  15998. b("Copy", "copy", c("copy"), 20, 4);
  15999. b("Paste",
  16000. "paste", d(), 30, 8);
  16001. a._.pasteButtons || (a._.pasteButtons = []);
  16002. a._.pasteButtons.push("Paste")
  16003. })();
  16004. a.getClipboardData = function(b, c) {
  16005. function h(a) {
  16006. a.removeListener();
  16007. a.cancel();
  16008. c(a.data)
  16009. }
  16010. function d(a) {
  16011. a.removeListener();
  16012. a.cancel();
  16013. c({
  16014. type: e,
  16015. dataValue: a.data.dataValue,
  16016. dataTransfer: a.data.dataTransfer,
  16017. method: "paste"
  16018. })
  16019. }
  16020. var m = !1,
  16021. e = "auto";
  16022. c || (c = b, b = null);
  16023. a.on("beforePaste", function(a) {
  16024. a.removeListener();
  16025. m = !0;
  16026. e = a.data.type
  16027. }, null, null, 1E3);
  16028. a.on("paste", h, null, null, 0);
  16029. !1 === v() && (a.removeListener("paste", h), a._.forcePasteDialog &&
  16030. m && a.fire("pasteDialog") ? (a.on("pasteDialogCommit", d), a.on("dialogHide", function(a) {
  16031. a.removeListener();
  16032. a.data.removeListener("pasteDialogCommit", d);
  16033. a.data._.committed || c(null)
  16034. })) : c(null))
  16035. }
  16036. }
  16037. function z(a) {
  16038. if (CKEDITOR.env.webkit) {
  16039. if (!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html"
  16040. } else if (CKEDITOR.env.ie) {
  16041. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi) && !a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))
  16042. return "html"
  16043. } else if (CKEDITOR.env.gecko) {
  16044. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html"
  16045. } else return "html";
  16046. return "htmlifiedtext"
  16047. }
  16048. function A(a, b) {
  16049. function c(a) {
  16050. return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e", ~~(a / 2)) + (1 == a % 2 ? "\x3cbr\x3e" : "")
  16051. }
  16052. b = b.replace(/(?!\u3000)\s+/g, " ").replace(/> +</g, "\x3e\x3c").replace(/<br ?\/>/gi, "\x3cbr\x3e");
  16053. b = b.replace(/<\/?[A-Z]+>/g, function(a) {
  16054. return a.toLowerCase()
  16055. });
  16056. if (b.match(/^[^<]$/)) return b;
  16057. CKEDITOR.env.webkit && -1 < b.indexOf("\x3cdiv\x3e") && (b = b.replace(
  16058. /^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "\x3cbr\x3e").replace(
  16059. /^(<div>(<br>|)<\/div>){2}(?!$)/g, "\x3cdiv\x3e\x3c/div\x3e"),
  16060. b.match(/<div>(<br>|)<\/div>/) && (b = "\x3cp\x3e" + b.replace(/(<div>(<br>|)<\/div>)+/g, function(a) {
  16061. return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length + 1)
  16062. }) + "\x3c/p\x3e"), b = b.replace(/<\/div><div>/g, "\x3cbr\x3e"), b = b.replace(/<\/?div>/g, ""));
  16063. CKEDITOR.env.gecko && a.enterMode != CKEDITOR.ENTER_BR && (CKEDITOR.env.gecko && (b = b.replace(/^<br><br>$/,
  16064. "\x3cbr\x3e")), -1 < b.indexOf("\x3cbr\x3e\x3cbr\x3e") && (b = "\x3cp\x3e" + b.replace(/(<br>){2,}/g,
  16065. function(a) {
  16066. return c(a.length / 4)
  16067. }) + "\x3c/p\x3e"));
  16068. return B(a, b)
  16069. }
  16070. function C(a) {
  16071. function b() {
  16072. var a = {},
  16073. b;
  16074. for (b in CKEDITOR.dtd) "$" != b.charAt(0) && "div" != b && "span" != b && (a[b] = 1);
  16075. return a
  16076. }
  16077. var c = {};
  16078. return {
  16079. get: function(d) {
  16080. return "plain-text" == d ? c.plainText || (c.plainText = new CKEDITOR.filter(a, "br")) :
  16081. "semantic-content" == d ? ((d = c.semanticContent) || (d = new CKEDITOR.filter(a, {}), d.allow({
  16082. $1: {
  16083. elements: b(),
  16084. attributes: !0,
  16085. styles: !1,
  16086. classes: !1
  16087. }
  16088. }), d = c.semanticContent = d), d) : d ? new CKEDITOR.filter(a, d) : null
  16089. }
  16090. }
  16091. }
  16092. function x(a, b, c) {
  16093. b = CKEDITOR.htmlParser.fragment.fromHtml(b);
  16094. var d = new CKEDITOR.htmlParser.basicWriter;
  16095. c.applyTo(b,
  16096. !0, !1, a.activeEnterMode);
  16097. b.writeHtml(d);
  16098. return d.getHtml()
  16099. }
  16100. function B(a, b) {
  16101. a.enterMode == CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function(a) {
  16102. return CKEDITOR.tools.repeat("\x3cbr\x3e", a.length / 7 * 2)
  16103. }).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g,
  16104. "\x3c$1div\x3e"));
  16105. return b
  16106. }
  16107. function D(a) {
  16108. a.data.preventDefault();
  16109. a.data.$.dataTransfer.dropEffect = "none"
  16110. }
  16111. function E(a) {
  16112. var b = CKEDITOR.plugins.clipboard;
  16113. a.on("contentDom", function() {
  16114. function c(b, c, d) {
  16115. c.select();
  16116. t(a, {
  16117. dataTransfer: d,
  16118. method: "drop"
  16119. }, 1);
  16120. d.sourceEditor.fire("saveSnapshot");
  16121. d.sourceEditor.editable().extractHtmlFromRange(b);
  16122. d.sourceEditor.getSelection().selectRanges([b]);
  16123. d.sourceEditor.fire("saveSnapshot")
  16124. }
  16125. function d(c, d) {
  16126. c.select();
  16127. t(a, {
  16128. dataTransfer: d,
  16129. method: "drop"
  16130. }, 1);
  16131. b.resetDragDataTransfer()
  16132. }
  16133. function g(b, c, d) {
  16134. var e = {
  16135. $: b.data.$,
  16136. target: b.data.getTarget()
  16137. };
  16138. c && (e.dragRange = c);
  16139. d && (e.dropRange = d);
  16140. !1 === a.fire(b.name, e) && b.data.preventDefault()
  16141. }
  16142. function f(a) {
  16143. a.type != CKEDITOR.NODE_ELEMENT && (a = a.getParent());
  16144. return a.getChildCount()
  16145. }
  16146. var e = a.editable(),
  16147. l = CKEDITOR.plugins.clipboard.getDropTarget(a),
  16148. q = a.ui.space("top"),
  16149. v = a.ui.space("bottom");
  16150. b.preventDefaultDropOnElement(q);
  16151. b.preventDefaultDropOnElement(v);
  16152. e.attachListener(l, "dragstart", g);
  16153. e.attachListener(a, "dragstart", b.resetDragDataTransfer, b, null, 1);
  16154. e.attachListener(a, "dragstart", function(c) {
  16155. b.initDragDataTransfer(c, a)
  16156. }, null, null, 2);
  16157. e.attachListener(a, "dragstart", function() {
  16158. var c = b.dragRange = a.getSelection().getRanges()[0];
  16159. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (b.dragStartContainerChildCount =
  16160. c ? f(c.startContainer) : null, b.dragEndContainerChildCount = c ? f(c.endContainer) : null)
  16161. }, null, null, 100);
  16162. e.attachListener(l, "dragend", g);
  16163. e.attachListener(a, "dragend", b.initDragDataTransfer, b, null, 1);
  16164. e.attachListener(a, "dragend", b.resetDragDataTransfer, b, null, 100);
  16165. e.attachListener(l, "dragover", function(a) {
  16166. if (CKEDITOR.env.edge) a.data.preventDefault();
  16167. else {
  16168. var b = a.data.getTarget();
  16169. b && b.is && b.is("html") ? a.data.preventDefault() : CKEDITOR.env.ie && CKEDITOR.plugins
  16170. .clipboard.isFileApiSupported && a.data.$.dataTransfer.types.contains("Files") &&
  16171. a.data.preventDefault()
  16172. }
  16173. });
  16174. e.attachListener(l, "drop", function(c) {
  16175. if (!c.data.$.defaultPrevented && (c.data.preventDefault(), !a.readOnly)) {
  16176. var d = c.data.getTarget();
  16177. if (!d.isReadOnly() || d.type == CKEDITOR.NODE_ELEMENT && d.is("html")) {
  16178. var d = b.getRangeAtDropPosition(c, a),
  16179. e = b.dragRange;
  16180. d && g(c, e, d)
  16181. }
  16182. }
  16183. }, null, null, 9999);
  16184. e.attachListener(a, "drop", b.initDragDataTransfer, b, null, 1);
  16185. e.attachListener(a, "drop", function(h) {
  16186. if (h = h.data) {
  16187. var e = h.dropRange,
  16188. p = h.dragRange,
  16189. k = h.dataTransfer;
  16190. k.getTransferType(a) == CKEDITOR.DATA_TRANSFER_INTERNAL ?
  16191. setTimeout(function() {
  16192. b.internalDrop(p, e, k, a)
  16193. }, 0) : k.getTransferType(a) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c(p, e, k) : d(e, k)
  16194. }
  16195. }, null, null, 9999)
  16196. })
  16197. }
  16198. var r;
  16199. CKEDITOR.plugins.add("clipboard", {
  16200. requires: "dialog,notification,toolbar",
  16201. _supportedFileMatchers: [],
  16202. init: function(a) {
  16203. function b(b) {
  16204. return a.config.clipboard_handleImages ? -1 !== CKEDITOR.tools.indexOf(["image/png", "image/jpeg",
  16205. "image/gif"
  16206. ], b.type) : !1
  16207. }
  16208. function c(b) {
  16209. return CKEDITOR.tools.array.some(a.plugins.clipboard._supportedFileMatchers, function(a) {
  16210. return a(b)
  16211. })
  16212. }
  16213. function d(b) {
  16214. b.length && (b = CKEDITOR.tools.array.unique(b), b = CKEDITOR.tools.array.filter(b, function(a) {
  16215. return !!CKEDITOR.tools.trim(a)
  16216. }), b = g(b.join(", ")), a.showNotification(b, "info", a.config.clipboard_notificationDuration))
  16217. }
  16218. function g(b) {
  16219. return b ? a.lang.clipboard.fileFormatNotSupportedNotification.replace(/\${formats\}/g,
  16220. "\x3cem\x3e" + b + "\x3c/em\x3e") : a.lang.clipboard.fileWithoutFormatNotSupportedNotification
  16221. }
  16222. function f(a, b) {
  16223. return CKEDITOR.env.ie && a.data.fileTransferCancel || !(CKEDITOR.env.ie || b && v !==
  16224. b.id) ? !1 : b.isFileTransfer() && 1 === b.getFilesCount()
  16225. }
  16226. var e, l = C(a);
  16227. a.config.forcePasteAsPlainText ? e = "plain-text" : a.config.pasteFilter ? e = a.config.pasteFilter :
  16228. !CKEDITOR.env.webkit || "pasteFilter" in a.config || (e = "semantic-content");
  16229. a.pasteFilter = l.get(e);
  16230. y(a);
  16231. E(a);
  16232. CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path + "dialogs/paste.js"));
  16233. var q = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || CKEDITOR.plugins.clipboard
  16234. .isFileApiSupported,
  16235. v;
  16236. CKEDITOR.plugins.clipboard.addFileMatcher(a, b);
  16237. a.on("paste",
  16238. function(a) {
  16239. if (q) {
  16240. var b = a.data;
  16241. a = b.dataTransfer;
  16242. if (!b.dataValue) {
  16243. for (var b = [], e = 0; e < a.getFilesCount(); e++) {
  16244. var k = a.getFile(e);
  16245. c(k) || b.push(k.type)
  16246. }
  16247. d(b)
  16248. }
  16249. }
  16250. }, null, null, 1);
  16251. a.on("paste", function(c) {
  16252. if (q && a.config.clipboard_handleImages) {
  16253. var d = c.data,
  16254. e = d.dataTransfer;
  16255. if (!d.dataValue && f(c, e) && (e = e.getFile(0), b(e))) {
  16256. var k = new FileReader;
  16257. k.addEventListener("load", function() {
  16258. c.data.dataValue = '\x3cimg src\x3d"' + k.result + '" /\x3e';
  16259. a.fire("paste", c.data)
  16260. }, !1);
  16261. k.addEventListener("abort", function() {
  16262. CKEDITOR.env.ie &&
  16263. (c.data.fileTransferCancel = !0);
  16264. a.fire("paste", c.data)
  16265. }, !1);
  16266. k.addEventListener("error", function() {
  16267. CKEDITOR.env.ie && (c.data.fileTransferCancel = !0);
  16268. a.fire("paste", c.data)
  16269. }, !1);
  16270. k.readAsDataURL(e);
  16271. v = d.dataTransfer.id;
  16272. c.stop()
  16273. }
  16274. }
  16275. }, null, null, 1);
  16276. a.on("paste", function(b) {
  16277. b.data.dataTransfer || (b.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer);
  16278. if (!b.data.dataValue) {
  16279. var c = b.data.dataTransfer,
  16280. d = c.getData("text/html");
  16281. if (d) b.data.dataValue = d, b.data.type = "html";
  16282. else if (d = c.getData("text/plain")) b.data.dataValue =
  16283. a.editable().transformPlainTextToHtml(d), b.data.type = "text"
  16284. }
  16285. }, null, null, 1);
  16286. a.on("paste", function(a) {
  16287. var b = a.data.dataValue,
  16288. c = CKEDITOR.dtd.$block; - 1 < b.indexOf("Apple-") && (b = b.replace(
  16289. /<span class="Apple-converted-space">&nbsp;<\/span>/gi, " "), "html" != a.data.type && (
  16290. b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) {
  16291. return b.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;")
  16292. })), -1 < b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e') && (a.data
  16293. .startsWithEOL = 1, a.data.preSniffing =
  16294. "html", b = b.replace(/<br class="Apple-interchange-newline">/, "")), b = b.replace(
  16295. /(<[^>]+) class="Apple-[^"]*"/gi, "$1"));
  16296. if (b.match(/^<[^<]+cke_(editable|contents)/i)) {
  16297. var d, e, f = new CKEDITOR.dom.element("div");
  16298. for (f.setHtml(b); 1 == f.getChildCount() && (d = f.getFirst()) && d.type == CKEDITOR
  16299. .NODE_ELEMENT && (d.hasClass("cke_editable") || d.hasClass("cke_contents"));) f = e = d;
  16300. e && (b = e.getHtml().replace(/<br>$/i, ""))
  16301. }
  16302. CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function(b, d) {
  16303. return d.toLowerCase() in c ? (a.data.preSniffing =
  16304. "html", "\x3c" + d) : b
  16305. }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, d) {
  16306. return d in c ? (a.data.endsWithEOL = 1, "\x3c/" + d + "\x3e") : b
  16307. }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
  16308. a.data.dataValue = b
  16309. }, null, null, 3);
  16310. a.on("paste", function(b) {
  16311. b = b.data;
  16312. var c = a._.nextPasteType || b.type,
  16313. d = b.dataValue,
  16314. e, f = a.config.clipboard_defaultContentType || "html",
  16315. g = b.dataTransfer.getTransferType(a) == CKEDITOR.DATA_TRANSFER_EXTERNAL,
  16316. q = !0 === a.config.forcePasteAsPlainText;
  16317. e = "html" == c || "html" == b.preSniffing ?
  16318. "html" : z(d);
  16319. delete a._.nextPasteType;
  16320. "htmlifiedtext" == e && (d = A(a.config, d));
  16321. if ("text" == c && "html" == e) d = x(a, d, l.get("plain-text"));
  16322. else if (g && a.pasteFilter && !b.dontFilter || q) d = x(a, d, a.pasteFilter);
  16323. b.startsWithEOL && (d = '\x3cbr data-cke-eol\x3d"1"\x3e' + d);
  16324. b.endsWithEOL && (d += '\x3cbr data-cke-eol\x3d"1"\x3e');
  16325. "auto" == c && (c = "html" == e || "html" == f ? "html" : "text");
  16326. b.type = c;
  16327. b.dataValue = d;
  16328. delete b.preSniffing;
  16329. delete b.startsWithEOL;
  16330. delete b.endsWithEOL
  16331. }, null, null, 6);
  16332. a.on("paste", function(b) {
  16333. b = b.data;
  16334. b.dataValue &&
  16335. (a.insertHtml(b.dataValue, b.type, b.range), setTimeout(function() {
  16336. a.fire("afterPaste")
  16337. }, 0))
  16338. }, null, null, 1E3);
  16339. a.on("pasteDialog", function(b) {
  16340. setTimeout(function() {
  16341. a.openDialog("paste", b.data)
  16342. }, 0)
  16343. })
  16344. }
  16345. });
  16346. CKEDITOR.plugins.clipboard = {
  16347. addFileMatcher: function(a, b) {
  16348. a.plugins.clipboard._supportedFileMatchers.push(b)
  16349. },
  16350. isCustomCopyCutSupported: CKEDITOR.env.ie && 16 > CKEDITOR.env.version || CKEDITOR.env.iOS && 605 > CKEDITOR
  16351. .env.version ? !1 : !0,
  16352. isCustomDataTypesSupported: !CKEDITOR.env.ie || 16 <= CKEDITOR.env.version,
  16353. isFileApiSupported: !CKEDITOR.env.ie ||
  16354. 9 < CKEDITOR.env.version,
  16355. mainPasteEvent: CKEDITOR.env.ie && !CKEDITOR.env.edge ? "beforepaste" : "paste",
  16356. addPasteButton: function(a, b, c) {
  16357. a.ui.addButton && (a.ui.addButton(b, c), a._.pasteButtons || (a._.pasteButtons = []), a._.pasteButtons
  16358. .push(b))
  16359. },
  16360. canClipboardApiBeTrusted: function(a, b) {
  16361. return a.getTransferType(b) != CKEDITOR.DATA_TRANSFER_EXTERNAL || CKEDITOR.env.chrome && !a.isEmpty() ||
  16362. CKEDITOR.env.gecko && (a.getData("text/html") || a.getFilesCount()) || CKEDITOR.env.safari && 603 <=
  16363. CKEDITOR.env.version && !CKEDITOR.env.iOS || CKEDITOR.env.iOS &&
  16364. 605 <= CKEDITOR.env.version || CKEDITOR.env.edge && 16 <= CKEDITOR.env.version ? !0 : !1
  16365. },
  16366. getDropTarget: function(a) {
  16367. var b = a.editable();
  16368. return CKEDITOR.env.ie && 9 > CKEDITOR.env.version || b.isInline() ? b : a.document
  16369. },
  16370. fixSplitNodesAfterDrop: function(a, b, c, d) {
  16371. function g(a, c, d) {
  16372. var f = a;
  16373. f.type == CKEDITOR.NODE_TEXT && (f = a.getParent());
  16374. if (f.equals(c) && d != c.getChildCount()) return a = b.startContainer.getChild(b.startOffset - 1),
  16375. c = b.startContainer.getChild(b.startOffset), a && a.type == CKEDITOR.NODE_TEXT && c && c.type ==
  16376. CKEDITOR.NODE_TEXT &&
  16377. (d = a.getLength(), a.setText(a.getText() + c.getText()), c.remove(), b.setStart(a, d), b
  16378. .collapse(!0)), !0
  16379. }
  16380. var f = b.startContainer;
  16381. "number" == typeof d && "number" == typeof c && f.type == CKEDITOR.NODE_ELEMENT && (g(a.startContainer,
  16382. f, c) || g(a.endContainer, f, d))
  16383. },
  16384. isDropRangeAffectedByDragRange: function(a, b) {
  16385. var c = b.startContainer,
  16386. d = b.endOffset;
  16387. return a.endContainer.equals(c) && a.endOffset <= d || a.startContainer.getParent().equals(c) && a
  16388. .startContainer.getIndex() < d || a.endContainer.getParent().equals(c) && a.endContainer.getIndex() <
  16389. d ? !0 : !1
  16390. },
  16391. internalDrop: function(a, b, c, d) {
  16392. var g = CKEDITOR.plugins.clipboard,
  16393. f = d.editable(),
  16394. e, l;
  16395. d.fire("saveSnapshot");
  16396. d.fire("lockSnapshot", {
  16397. dontUpdate: 1
  16398. });
  16399. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && this.fixSplitNodesAfterDrop(a, b, g
  16400. .dragStartContainerChildCount, g.dragEndContainerChildCount);
  16401. (l = this.isDropRangeAffectedByDragRange(a, b)) || (e = a.createBookmark(!1));
  16402. g = b.clone().createBookmark(!1);
  16403. l && (e = a.createBookmark(!1));
  16404. a = e.startNode;
  16405. b = e.endNode;
  16406. l = g.startNode;
  16407. b && a.getPosition(l) & CKEDITOR.POSITION_PRECEDING &&
  16408. b.getPosition(l) & CKEDITOR.POSITION_FOLLOWING && l.insertBefore(a);
  16409. a = d.createRange();
  16410. a.moveToBookmark(e);
  16411. f.extractHtmlFromRange(a, 1);
  16412. b = d.createRange();
  16413. g.startNode.getCommonAncestor(f) || (g = d.getSelection().createBookmarks()[0]);
  16414. b.moveToBookmark(g);
  16415. t(d, {
  16416. dataTransfer: c,
  16417. method: "drop",
  16418. range: b
  16419. }, 1);
  16420. d.fire("unlockSnapshot")
  16421. },
  16422. getRangeAtDropPosition: function(a, b) {
  16423. var c = a.data.$,
  16424. d = c.clientX,
  16425. g = c.clientY,
  16426. f = b.getSelection(!0).getRanges()[0],
  16427. e = b.createRange();
  16428. if (a.data.testRange) return a.data.testRange;
  16429. if (document.caretRangeFromPoint &&
  16430. b.document.$.caretRangeFromPoint(d, g)) c = b.document.$.caretRangeFromPoint(d, g), e.setStart(
  16431. CKEDITOR.dom.node(c.startContainer), c.startOffset), e.collapse(!0);
  16432. else if (c.rangeParent) e.setStart(CKEDITOR.dom.node(c.rangeParent), c.rangeOffset), e.collapse(!0);
  16433. else {
  16434. if (CKEDITOR.env.ie && 8 < CKEDITOR.env.version && f && b.editable().hasFocus) return f;
  16435. if (document.body.createTextRange) {
  16436. b.focus();
  16437. c = b.document.getBody().$.createTextRange();
  16438. try {
  16439. for (var l = !1, q = 0; 20 > q && !l; q++) {
  16440. if (!l) try {
  16441. c.moveToPoint(d, g - q), l = !0
  16442. } catch (r) {}
  16443. if (!l) try {
  16444. c.moveToPoint(d,
  16445. g + q), l = !0
  16446. } catch (h) {}
  16447. }
  16448. if (l) {
  16449. var m = "cke-temp-" + (new Date).getTime();
  16450. c.pasteHTML('\x3cspan id\x3d"' + m + '"\x3e​\x3c/span\x3e');
  16451. var p = b.document.getById(m);
  16452. e.moveToPosition(p, CKEDITOR.POSITION_BEFORE_START);
  16453. p.remove()
  16454. } else {
  16455. var k = b.document.$.elementFromPoint(d, g),
  16456. n = new CKEDITOR.dom.element(k),
  16457. u;
  16458. if (n.equals(b.editable()) || "html" == n.getName()) return f && f.startContainer && !f
  16459. .startContainer.equals(b.editable()) ? f : null;
  16460. u = n.getClientRect();
  16461. d < u.left ? e.setStartAt(n, CKEDITOR.POSITION_AFTER_START) : e.setStartAt(n,
  16462. CKEDITOR.POSITION_BEFORE_END);
  16463. e.collapse(!0)
  16464. }
  16465. } catch (t) {
  16466. return null
  16467. }
  16468. } else return null
  16469. }
  16470. return e
  16471. },
  16472. initDragDataTransfer: function(a, b) {
  16473. var c = a.data.$ ? a.data.$.dataTransfer : null,
  16474. d = new this.dataTransfer(c, b);
  16475. "dragstart" === a.name && d.storeId();
  16476. c ? this.dragData && d.id == this.dragData.id ? d = this.dragData : this.dragData = d : this.dragData ?
  16477. d = this.dragData : this.dragData = d;
  16478. a.data.dataTransfer = d
  16479. },
  16480. resetDragDataTransfer: function() {
  16481. this.dragData = null
  16482. },
  16483. initPasteDataTransfer: function(a, b) {
  16484. if (this.isCustomCopyCutSupported) {
  16485. if (a &&
  16486. a.data && a.data.$) {
  16487. var c = a.data.$.clipboardData,
  16488. d = new this.dataTransfer(c, b);
  16489. "copy" !== a.name && "cut" !== a.name || d.storeId();
  16490. this.copyCutData && d.id == this.copyCutData.id ? (d = this.copyCutData, d.$ = c) : this
  16491. .copyCutData = d;
  16492. return d
  16493. }
  16494. return new this.dataTransfer(null, b)
  16495. }
  16496. return new this.dataTransfer(CKEDITOR.env.edge && a && a.data.$ && a.data.$.clipboardData || null, b)
  16497. },
  16498. preventDefaultDropOnElement: function(a) {
  16499. a && a.on("dragover", D)
  16500. }
  16501. };
  16502. r = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? "cke/id" : "Text";
  16503. CKEDITOR.plugins.clipboard.dataTransfer =
  16504. function(a, b) {
  16505. a && (this.$ = a);
  16506. this._ = {
  16507. metaRegExp: /^<meta.*?>/i,
  16508. fragmentRegExp: /\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g,
  16509. types: [],
  16510. data: {},
  16511. files: [],
  16512. nativeHtmlCache: "",
  16513. normalizeType: function(a) {
  16514. a = a.toLowerCase();
  16515. return "text" == a || "text/plain" == a ? "Text" : "url" == a ? "URL" : "files" === a ? "Files" : a
  16516. }
  16517. };
  16518. this._.fallbackDataTransfer = new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);
  16519. this.id = this.getData(r);
  16520. this.id || (this.id = "Text" == r ? "" : "cke-" + CKEDITOR.tools.getUniqueId());
  16521. b && (this.sourceEditor =
  16522. b, this.setData("text/html", b.getSelectedHtml(1)), "Text" == r || this.getData("text/plain") || this
  16523. .setData("text/plain", b.getSelection().getSelectedText()))
  16524. };
  16525. CKEDITOR.DATA_TRANSFER_INTERNAL = 1;
  16526. CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2;
  16527. CKEDITOR.DATA_TRANSFER_EXTERNAL = 3;
  16528. CKEDITOR.plugins.clipboard.dataTransfer.prototype = {
  16529. getData: function(a, b) {
  16530. a = this._.normalizeType(a);
  16531. var c = "text/html" == a && b ? this._.nativeHtmlCache : this._.data[a];
  16532. if (void 0 === c || null === c || "" === c) {
  16533. if (this._.fallbackDataTransfer.isRequired()) c = this._.fallbackDataTransfer.getData(a,
  16534. b);
  16535. else try {
  16536. c = this.$.getData(a) || ""
  16537. } catch (d) {
  16538. c = ""
  16539. }
  16540. "text/html" != a || b || (c = this._stripHtml(c))
  16541. }
  16542. "Text" == a && CKEDITOR.env.gecko && this.getFilesCount() && "file://" == c.substring(0, 7) && (c = "");
  16543. if ("string" === typeof c) var g = c.indexOf("\x3c/html\x3e"),
  16544. c = -1 !== g ? c.substring(0, g + 7) : c;
  16545. return c
  16546. },
  16547. setData: function(a, b) {
  16548. a = this._.normalizeType(a);
  16549. "text/html" == a ? (this._.data[a] = this._stripHtml(b), this._.nativeHtmlCache = b) : this._.data[a] =
  16550. b;
  16551. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || "URL" == a || "Text" == a)
  16552. if ("Text" ==
  16553. r && "Text" == a && (this.id = b), this._.fallbackDataTransfer.isRequired()) this._
  16554. .fallbackDataTransfer.setData(a, b);
  16555. else try {
  16556. this.$.setData(a, b)
  16557. } catch (c) {}
  16558. },
  16559. storeId: function() {
  16560. "Text" !== r && this.setData(r, this.id)
  16561. },
  16562. getTransferType: function(a) {
  16563. return this.sourceEditor ? this.sourceEditor == a ? CKEDITOR.DATA_TRANSFER_INTERNAL : CKEDITOR
  16564. .DATA_TRANSFER_CROSS_EDITORS : CKEDITOR.DATA_TRANSFER_EXTERNAL
  16565. },
  16566. cacheData: function() {
  16567. function a(a) {
  16568. a = b._.normalizeType(a);
  16569. var c = b.getData(a);
  16570. "text/html" == a && (b._.nativeHtmlCache = b.getData(a,
  16571. !0), c = b._stripHtml(c));
  16572. c && (b._.data[a] = c);
  16573. b._.types.push(a)
  16574. }
  16575. if (this.$) {
  16576. var b = this,
  16577. c, d, g;
  16578. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  16579. if (this.$.types)
  16580. for (c = 0; c < this.$.types.length; c++) a(this.$.types[c])
  16581. } else a("Text"), a("URL");
  16582. d = this._getImageFromClipboard();
  16583. if ((g = this.$ && this.$.files || null) || d) {
  16584. this._.files = [];
  16585. if (g && g.length)
  16586. for (c = 0; c < g.length; c++) this._.files.push(g[c]);
  16587. 0 === this._.files.length && d && this._.files.push(d)
  16588. }
  16589. }
  16590. },
  16591. getFilesCount: function() {
  16592. if (this._.files.length) return this._.files.length;
  16593. var a = this.$ && this.$.files || null;
  16594. return a && a.length ? a.length : this._getImageFromClipboard() ? 1 : 0
  16595. },
  16596. getFile: function(a) {
  16597. if (this._.files.length) return this._.files[a];
  16598. var b = this.$ && this.$.files || null;
  16599. return b && b.length ? b[a] : 0 === a ? this._getImageFromClipboard() : void 0
  16600. },
  16601. isFileTransfer: function() {
  16602. var a = this.getTypes(),
  16603. a = CKEDITOR.tools.array.filter(a, function(a) {
  16604. return "application/x-moz-file" !== a
  16605. });
  16606. return 1 === a.length && "files" === a[0].toLowerCase()
  16607. },
  16608. isEmpty: function() {
  16609. var a = {},
  16610. b;
  16611. if (this.getFilesCount()) return !1;
  16612. CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(this._.data), function(b) {
  16613. a[b] = 1
  16614. });
  16615. if (this.$)
  16616. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  16617. if (this.$.types)
  16618. for (var c = 0; c < this.$.types.length; c++) a[this.$.types[c]] = 1
  16619. } else a.Text = 1, a.URL = 1;
  16620. "Text" != r && (a[r] = 0);
  16621. for (b in a)
  16622. if (a[b] && "" !== this.getData(b)) return !1;
  16623. return !0
  16624. },
  16625. getTypes: function() {
  16626. return 0 < this._.types.length ? this._.types : this.$ && this.$.types ? [].slice.call(this.$.types) :
  16627. []
  16628. },
  16629. _getImageFromClipboard: function() {
  16630. var a;
  16631. try {
  16632. if (this.$ &&
  16633. this.$.items && this.$.items[0] && (a = this.$.items[0].getAsFile()) && a.type) return a
  16634. } catch (b) {}
  16635. },
  16636. _stripHtml: function(a) {
  16637. function b(a) {
  16638. var b = new CKEDITOR.htmlParser,
  16639. g, f;
  16640. b.onTagOpen = function(a) {
  16641. "body" === a && (g = b._.htmlPartsRegex.lastIndex)
  16642. };
  16643. b.onTagClose = function(a) {
  16644. "body" === a && (f = b._.htmlPartsRegex.lastIndex)
  16645. };
  16646. b.parse(a);
  16647. return "number" !== typeof g || "number" !== typeof f ? a : a.substring(g, f).replace(
  16648. /<\/body\s*>$/gi, "")
  16649. }
  16650. a && a.length && (a = b(a), a = a.replace(this._.metaRegExp, ""), a = a.replace(this._.fragmentRegExp,
  16651. ""));
  16652. return a
  16653. }
  16654. };
  16655. CKEDITOR.plugins.clipboard.fallbackDataTransfer = function(a) {
  16656. this._dataTransfer = a;
  16657. this._customDataFallbackType = "text/html"
  16658. };
  16659. CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported = null;
  16660. CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes = [];
  16661. CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype = {
  16662. isRequired: function() {
  16663. var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer,
  16664. b = this._dataTransfer.$;
  16665. if (null === a._isCustomMimeTypeSupported)
  16666. if (b) {
  16667. a._isCustomMimeTypeSupported = !1;
  16668. if (CKEDITOR.env.edge && 17 <= CKEDITOR.env.version) return !0;
  16669. try {
  16670. b.setData("cke/mimetypetest", "cke test value"), a._isCustomMimeTypeSupported =
  16671. "cke test value" === b.getData("cke/mimetypetest"), b.clearData("cke/mimetypetest")
  16672. } catch (c) {}
  16673. } else return !1;
  16674. return !a._isCustomMimeTypeSupported
  16675. },
  16676. getData: function(a, b) {
  16677. var c = this._getData(this._customDataFallbackType, !0);
  16678. if (b) return c;
  16679. var c = this._extractDataComment(c),
  16680. d = null,
  16681. d = a === this._customDataFallbackType ? c.content : c.data && c.data[a] ? c.data[a] : this._getData(
  16682. a,
  16683. !0);
  16684. return null !== d ? d : ""
  16685. },
  16686. setData: function(a, b) {
  16687. var c = a === this._customDataFallbackType;
  16688. c && (b = this._applyDataComment(b, this._getFallbackTypeData()));
  16689. var d = b,
  16690. g = this._dataTransfer.$;
  16691. try {
  16692. g.setData(a, d), c && (this._dataTransfer._.nativeHtmlCache = d)
  16693. } catch (f) {
  16694. if (this._isUnsupportedMimeTypeError(f)) {
  16695. c = CKEDITOR.plugins.clipboard.fallbackDataTransfer; - 1 === CKEDITOR.tools.indexOf(c._customTypes,
  16696. a) && c._customTypes.push(a);
  16697. var c = this._getFallbackTypeContent(),
  16698. e = this._getFallbackTypeData();
  16699. e[a] = d;
  16700. try {
  16701. d = this._applyDataComment(c,
  16702. e), g.setData(this._customDataFallbackType, d), this._dataTransfer._.nativeHtmlCache = d
  16703. } catch (l) {
  16704. d = ""
  16705. }
  16706. }
  16707. }
  16708. return d
  16709. },
  16710. _getData: function(a, b) {
  16711. var c = this._dataTransfer._.data;
  16712. if (!b && c[a]) return c[a];
  16713. try {
  16714. return this._dataTransfer.$.getData(a)
  16715. } catch (d) {
  16716. return null
  16717. }
  16718. },
  16719. _getFallbackTypeContent: function() {
  16720. var a = this._dataTransfer._.data[this._customDataFallbackType];
  16721. a || (a = this._extractDataComment(this._getData(this._customDataFallbackType, !0)).content);
  16722. return a
  16723. },
  16724. _getFallbackTypeData: function() {
  16725. var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes,
  16726. b = this._extractDataComment(this._getData(this._customDataFallbackType, !0)).data || {},
  16727. c = this._dataTransfer._.data;
  16728. CKEDITOR.tools.array.forEach(a, function(a) {
  16729. void 0 !== c[a] ? b[a] = c[a] : void 0 !== b[a] && (b[a] = b[a])
  16730. }, this);
  16731. return b
  16732. },
  16733. _isUnsupportedMimeTypeError: function(a) {
  16734. return a.message && -1 !== a.message.search(/element not found/gi)
  16735. },
  16736. _extractDataComment: function(a) {
  16737. var b = {
  16738. data: null,
  16739. content: a || ""
  16740. };
  16741. if (a && 16 < a.length) {
  16742. var c;
  16743. (c = /\x3c!--cke-data:(.*?)--\x3e/g.exec(a)) && c[1] && (b.data = JSON.parse(decodeURIComponent(c[
  16744. 1])),
  16745. b.content = a.replace(c[0], ""))
  16746. }
  16747. return b
  16748. },
  16749. _applyDataComment: function(a, b) {
  16750. var c = "";
  16751. b && CKEDITOR.tools.object.keys(b).length && (c = "\x3c!--cke-data:" + encodeURIComponent(JSON
  16752. .stringify(b)) + "--\x3e");
  16753. return c + (a && a.length ? a : "")
  16754. }
  16755. }
  16756. })();
  16757. CKEDITOR.config.clipboard_notificationDuration = 1E4;
  16758. CKEDITOR.config.clipboard_handleImages = !0;
  16759. CKEDITOR.plugins.add("panelbutton", {
  16760. requires: "button",
  16761. onLoad: function() {
  16762. function e(c) {
  16763. var b = this._;
  16764. b.state != CKEDITOR.TRISTATE_DISABLED && (this.createPanel(c), b.on ? b.panel.hide() : b.panel
  16765. .showBlock(this._.id, this.document.getById(this._.id), 4))
  16766. }
  16767. CKEDITOR.ui.panelButton = CKEDITOR.tools.createClass({
  16768. base: CKEDITOR.ui.button,
  16769. $: function(c) {
  16770. var b = c.panel || {};
  16771. delete c.panel;
  16772. this.base(c);
  16773. this.document = b.parent && b.parent.getDocument() || CKEDITOR.document;
  16774. b.block = {
  16775. attributes: b.attributes
  16776. };
  16777. b.toolbarRelated = !0;
  16778. this.hasArrow =
  16779. "listbox";
  16780. this.click = e;
  16781. this._ = {
  16782. panelDefinition: b
  16783. }
  16784. },
  16785. statics: {
  16786. handler: {
  16787. create: function(c) {
  16788. return new CKEDITOR.ui.panelButton(c)
  16789. }
  16790. }
  16791. },
  16792. proto: {
  16793. createPanel: function(c) {
  16794. var b = this._;
  16795. if (!b.panel) {
  16796. var f = this._.panelDefinition,
  16797. e = this._.panelDefinition.block,
  16798. k = f.parent || CKEDITOR.document.getBody(),
  16799. h = CKEDITOR.document.getById(this._.id),
  16800. d = this._.panel = new CKEDITOR.ui.floatPanel(c, k, f),
  16801. f = d.addBlock(b.id, e),
  16802. a = this,
  16803. g = c.getCommand(this.command);
  16804. d.onShow = function() {
  16805. a.className && this.element.addClass(a.className + "_panel");
  16806. a.setState(CKEDITOR.TRISTATE_ON);
  16807. h.setAttribute("aria-expanded", "true");
  16808. b.on = 1;
  16809. a.editorFocus && c.focus();
  16810. if (a.onOpen) a.onOpen()
  16811. };
  16812. d.onHide = function(d) {
  16813. a.className && this.element.getFirst().removeClass(a.className + "_panel");
  16814. !a.modes && g ? a.setStateFromCommand(g) : a.setState(a.modes && a.modes[c.mode] ?
  16815. CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  16816. b.on = 0;
  16817. h.setAttribute("aria-expanded", "false");
  16818. if (!d && a.onClose) a.onClose()
  16819. };
  16820. d.onEscape = function() {
  16821. d.hide(1);
  16822. a.document.getById(b.id).focus()
  16823. };
  16824. if (this.onBlock) this.onBlock(d,
  16825. f);
  16826. f.onHide = function() {
  16827. b.on = 0;
  16828. !a.modes && a.command ? a.setStateFromCommand(g) : a.setState(CKEDITOR.TRISTATE_OFF)
  16829. }
  16830. }
  16831. },
  16832. setStateFromCommand: function(c) {
  16833. this.setState(c.state)
  16834. }
  16835. }
  16836. })
  16837. },
  16838. beforeInit: function(e) {
  16839. e.ui.addHandler(CKEDITOR.UI_PANELBUTTON, CKEDITOR.ui.panelButton.handler)
  16840. }
  16841. });
  16842. CKEDITOR.UI_PANELBUTTON = "panelbutton";
  16843. (function() {
  16844. CKEDITOR.plugins.add("panel", {
  16845. beforeInit: function(a) {
  16846. a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler)
  16847. }
  16848. });
  16849. CKEDITOR.UI_PANEL = "panel";
  16850. CKEDITOR.ui.panel = function(a, b) {
  16851. b && CKEDITOR.tools.extend(this, b);
  16852. CKEDITOR.tools.extend(this, {
  16853. className: "",
  16854. css: []
  16855. });
  16856. this.id = CKEDITOR.tools.getNextId();
  16857. this.document = a;
  16858. this.isFramed = this.forceIFrame || this.css.length;
  16859. this._ = {
  16860. blocks: {}
  16861. }
  16862. };
  16863. CKEDITOR.ui.panel.handler = {
  16864. create: function(a) {
  16865. return new CKEDITOR.ui.panel(a)
  16866. }
  16867. };
  16868. var g = CKEDITOR.addTemplate("panel",
  16869. '\x3cdiv lang\x3d"{langCode}" id\x3d"{id}" dir\x3d{dir} class\x3d"cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style\x3d"z-index:{z-index}" role\x3d"presentation"\x3e{frame}\x3c/div\x3e'
  16870. ),
  16871. h = CKEDITOR.addTemplate("panel-frame",
  16872. '\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'
  16873. ),
  16874. k = CKEDITOR.addTemplate("panel-frame-inner",
  16875. '\x3c!DOCTYPE html\x3e\x3chtml class\x3d"cke_panel_container {env}" dir\x3d"{dir}" lang\x3d"{langCode}"\x3e\x3chead\x3e{css}\x3c/head\x3e\x3cbody class\x3d"cke_{dir}" style\x3d"margin:0;padding:0" onload\x3d"{onload}"\x3e\x3c/body\x3e\x3c/html\x3e'
  16876. );
  16877. CKEDITOR.ui.panel.prototype = {
  16878. render: function(a, b) {
  16879. var e = {
  16880. editorId: a.id,
  16881. id: this.id,
  16882. langCode: a.langCode,
  16883. dir: a.lang.dir,
  16884. cls: this.className,
  16885. frame: "",
  16886. env: CKEDITOR.env.cssClass,
  16887. "z-index": a.config.baseFloatZIndex + 1
  16888. };
  16889. this.getHolderElement = function() {
  16890. var a = this._.holder;
  16891. if (!a) {
  16892. if (this.isFramed) {
  16893. var a = this.document.getById(this.id + "_frame"),
  16894. b = a.getParent(),
  16895. a = a.getFrameDocument();
  16896. CKEDITOR.env.iOS && b.setStyles({
  16897. overflow: "scroll",
  16898. "-webkit-overflow-scrolling": "touch"
  16899. });
  16900. b = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() {
  16901. this.isLoaded = !0;
  16902. if (this.onLoad) this.onLoad()
  16903. }, this));
  16904. a.write(k.output(CKEDITOR.tools.extend({
  16905. css: CKEDITOR.tools.buildStyleHtml(this.css),
  16906. onload: "window.parent.CKEDITOR.tools.callFunction(" + b + ");"
  16907. }, e)));
  16908. a.getWindow().$.CKEDITOR = CKEDITOR;
  16909. a.on("keydown", function(a) {
  16910. var b = a.data.getKeystroke(),
  16911. c = this.document.getById(this.id).getAttribute("dir");
  16912. if ("input" !== a.data.getTarget().getName() || 37 !== b && 39 !== b) this._.onKeyDown &&
  16913. !1 === this._.onKeyDown(b) ? "input" === a.data.getTarget().getName() && 32 === b || a
  16914. .data.preventDefault() :
  16915. (27 == b || b == ("rtl" == c ? 39 : 37)) && this.onEscape && !1 === this.onEscape(b) &&
  16916. a.data.preventDefault()
  16917. }, this);
  16918. a = a.getBody();
  16919. a.unselectable();
  16920. CKEDITOR.env.air && CKEDITOR.tools.callFunction(b)
  16921. } else a = this.document.getById(this.id);
  16922. this._.holder = a
  16923. }
  16924. return a
  16925. };
  16926. if (this.isFramed) {
  16927. var d = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ?
  16928. "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain +
  16929. ")();document.close();") + "}())" : "";
  16930. e.frame = h.output({
  16931. id: this.id + "_frame",
  16932. src: d
  16933. })
  16934. }
  16935. d = g.output(e);
  16936. b && b.push(d);
  16937. return d
  16938. },
  16939. addBlock: function(a, b) {
  16940. b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this
  16941. .getHolderElement(), b);
  16942. this._.currentBlock || this.showBlock(a);
  16943. return b
  16944. },
  16945. getBlock: function(a) {
  16946. return this._.blocks[a]
  16947. },
  16948. showBlock: function(a) {
  16949. a = this._.blocks[a];
  16950. var b = this._.currentBlock,
  16951. e = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + "_frame");
  16952. b && b.hide();
  16953. this._.currentBlock = a;
  16954. CKEDITOR.fire("ariaWidget", e);
  16955. a._.focusIndex = -1;
  16956. this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
  16957. a.show();
  16958. return a
  16959. },
  16960. destroy: function() {
  16961. this.element && this.element.remove()
  16962. }
  16963. };
  16964. CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass({
  16965. $: function(a, b) {
  16966. this.element = a.append(a.getDocument().createElement("div", {
  16967. attributes: {
  16968. tabindex: -1,
  16969. "class": "cke_panel_block"
  16970. },
  16971. styles: {
  16972. display: "none"
  16973. }
  16974. }));
  16975. b && CKEDITOR.tools.extend(this, b);
  16976. this.element.setAttributes({
  16977. role: this.attributes.role || "presentation",
  16978. "aria-label": this.attributes["aria-label"],
  16979. title: this.attributes.title ||
  16980. this.attributes["aria-label"]
  16981. });
  16982. this.keys = {};
  16983. this._.focusIndex = -1;
  16984. this.element.disableContextMenu()
  16985. },
  16986. _: {
  16987. markItem: function(a) {
  16988. -1 != a && (a = this._.getItems().getItem(this._.focusIndex = a), CKEDITOR.env.webkit && a
  16989. .getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a))
  16990. },
  16991. markFirstDisplayed: function(a) {
  16992. for (var b = function(a) {
  16993. return a.type == CKEDITOR.NODE_ELEMENT && "none" == a.getStyle("display")
  16994. }, e = this._.getItems(), d, c, f = e.count() - 1; 0 <= f; f--)
  16995. if (d = e.getItem(f), d.getAscendant(b) || (c = d, this._.focusIndex =
  16996. f), "true" == d.getAttribute("aria-selected")) {
  16997. c = d;
  16998. this._.focusIndex = f;
  16999. break
  17000. } c && (a && a(), CKEDITOR.env.webkit && c.getDocument().getWindow().focus(), c.focus(), this
  17001. .onMark && this.onMark(c))
  17002. },
  17003. getItems: function() {
  17004. return this.element.find("a,input")
  17005. }
  17006. },
  17007. proto: {
  17008. show: function() {
  17009. this.element.setStyle("display", "")
  17010. },
  17011. hide: function() {
  17012. this.onHide && !0 === this.onHide.call(this) || this.element.setStyle("display", "none")
  17013. },
  17014. onKeyDown: function(a, b) {
  17015. var e = this.keys[a];
  17016. switch (e) {
  17017. case "next":
  17018. for (var d = this._.focusIndex, e = this._.getItems(),
  17019. c; c = e.getItem(++d);)
  17020. if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
  17021. this._.focusIndex = d;
  17022. c.focus(!0);
  17023. break
  17024. } return c || b ? !1 : (this._.focusIndex = -1, this.onKeyDown(a, 1));
  17025. case "prev":
  17026. d = this._.focusIndex;
  17027. for (e = this._.getItems(); 0 < d && (c = e.getItem(--d));) {
  17028. if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
  17029. this._.focusIndex = d;
  17030. c.focus(!0);
  17031. break
  17032. }
  17033. c = null
  17034. }
  17035. return c || b ? !1 : (this._.focusIndex = e.count(), this.onKeyDown(a, 1));
  17036. case "click":
  17037. case "mouseup":
  17038. return d = this._.focusIndex, (c = 0 <= d && this._.getItems().getItem(d)) &&
  17039. c.fireEventHandler(e, {
  17040. button: CKEDITOR.tools.normalizeMouseButton(CKEDITOR.MOUSE_BUTTON_LEFT, !0)
  17041. }), !1
  17042. }
  17043. return !0
  17044. }
  17045. }
  17046. })
  17047. })();
  17048. CKEDITOR.plugins.add("floatpanel", {
  17049. requires: "panel"
  17050. });
  17051. (function() {
  17052. function v(a, b, c, m, h) {
  17053. h = CKEDITOR.tools.genKey(b.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || "", m.css || "", h ||
  17054. "");
  17055. var g = f[h];
  17056. g || (g = f[h] = new CKEDITOR.ui.panel(b, m), g.element = c.append(CKEDITOR.dom.element.createFromHtml(g
  17057. .render(a), b)), g.element.setStyles({
  17058. display: "none",
  17059. position: "absolute"
  17060. }));
  17061. return g
  17062. }
  17063. var f = {};
  17064. CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
  17065. $: function(a, b, c, m) {
  17066. function h() {
  17067. e.hide()
  17068. }
  17069. c.forceIFrame = 1;
  17070. c.toolbarRelated && a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE &&
  17071. (b = CKEDITOR.document.getById("cke_" + a.name));
  17072. var g = b.getDocument();
  17073. m = v(a, g, b, c, m || 0);
  17074. var n = m.element,
  17075. l = n.getFirst(),
  17076. e = this;
  17077. n.disableContextMenu();
  17078. this.element = n;
  17079. this._ = {
  17080. editor: a,
  17081. panel: m,
  17082. parentElement: b,
  17083. definition: c,
  17084. document: g,
  17085. iframe: l,
  17086. children: [],
  17087. dir: a.lang.dir,
  17088. showBlockParams: null,
  17089. markFirst: void 0 !== c.markFirst ? c.markFirst : !0
  17090. };
  17091. a.on("mode", h);
  17092. a.on("resize", h);
  17093. g.getWindow().on("resize", function() {
  17094. this.reposition()
  17095. }, this)
  17096. },
  17097. proto: {
  17098. addBlock: function(a, b) {
  17099. return this._.panel.addBlock(a, b)
  17100. },
  17101. addListBlock: function(a,
  17102. b) {
  17103. return this._.panel.addListBlock(a, b)
  17104. },
  17105. getBlock: function(a) {
  17106. return this._.panel.getBlock(a)
  17107. },
  17108. showBlock: function(a, b, c, m, h, g) {
  17109. var n = this._.panel,
  17110. l = n.showBlock(a);
  17111. this._.showBlockParams = [].slice.call(arguments);
  17112. this.allowBlur(!1);
  17113. var e = this._.editor.editable();
  17114. this._.returnFocus = e.hasFocus ? e : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
  17115. this._.hideTimeout = 0;
  17116. var k = this.element,
  17117. e = this._.iframe,
  17118. e = CKEDITOR.env.ie && !CKEDITOR.env.edge ? e : new CKEDITOR.dom.window(e.$.contentWindow),
  17119. f = k.getDocument(),
  17120. r = this._.parentElement.getPositionedAncestor(),
  17121. t = b.getDocumentPosition(f),
  17122. f = r ? r.getDocumentPosition(f) : {
  17123. x: 0,
  17124. y: 0
  17125. },
  17126. q = "rtl" == this._.dir,
  17127. d = t.x + (m || 0) - f.x,
  17128. p = t.y + (h || 0) - f.y;
  17129. !q || 1 != c && 4 != c ? q || 2 != c && 3 != c || (d += b.$.offsetWidth - 1) : d += b.$.offsetWidth;
  17130. if (3 == c || 4 == c) p += b.$.offsetHeight - 1;
  17131. this._.panel._.offsetParentId = b.getId();
  17132. k.setStyles({
  17133. top: p + "px",
  17134. left: 0,
  17135. display: ""
  17136. });
  17137. k.setOpacity(0);
  17138. k.getFirst().removeStyle("width");
  17139. this._.editor.focusManager.add(e);
  17140. this._.blurSet || (CKEDITOR.event.useCapture = !0, e.on("blur",
  17141. function(a) {
  17142. function u() {
  17143. delete this._.returnFocus;
  17144. this.hide()
  17145. }
  17146. this.allowBlur() && a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !
  17147. this._.activeChild && (CKEDITOR.env.iOS ? this._.hideTimeout || (this._.hideTimeout =
  17148. CKEDITOR.tools.setTimeout(u, 0, this)) : u.call(this))
  17149. }, this), e.on("focus", function() {
  17150. this._.focused = !0;
  17151. this.hideChild();
  17152. this.allowBlur(!0)
  17153. }, this), CKEDITOR.env.iOS && (e.on("touchstart", function() {
  17154. clearTimeout(this._.hideTimeout)
  17155. }, this), e.on("touchend", function() {
  17156. this._.hideTimeout =
  17157. 0;
  17158. this.focus()
  17159. }, this)), CKEDITOR.event.useCapture = !1, this._.blurSet = 1);
  17160. n.onEscape = CKEDITOR.tools.bind(function(a) {
  17161. if (this.onEscape && !1 === this.onEscape(a)) return !1
  17162. }, this);
  17163. CKEDITOR.tools.setTimeout(function() {
  17164. var a = CKEDITOR.tools.bind(function() {
  17165. var a = k;
  17166. a.removeStyle("width");
  17167. if (l.autoSize) {
  17168. var b = l.element.getDocument(),
  17169. b = (CKEDITOR.env.webkit || CKEDITOR.env.edge ? l.element : b.getBody()).$
  17170. .scrollWidth;
  17171. CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetWidth || 0) - (a.$
  17172. .clientWidth || 0) + 3);
  17173. a.setStyle("width",
  17174. b + 10 + "px");
  17175. b = l.element.$.scrollHeight;
  17176. CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetHeight || 0) - (a
  17177. .$.clientHeight || 0) + 3);
  17178. a.setStyle("height", b + "px");
  17179. n._.currentBlock.element.setStyle("display", "none").removeStyle("display")
  17180. } else a.removeStyle("height");
  17181. q && (d -= k.$.offsetWidth);
  17182. k.setStyle("left", d + "px");
  17183. var b = n.element.getWindow(),
  17184. a = k.$.getBoundingClientRect(),
  17185. b = b.getViewPaneSize(),
  17186. c = a.width || a.right - a.left,
  17187. e = a.height || a.bottom - a.top,
  17188. m = q ? a.right : b.width - a.left,
  17189. h = q ? b.width - a.right : a.left;
  17190. q ? m < c && (d = h > c ? d + c : b.width > c ? d - a.left : d - a.right + b.width) :
  17191. m < c && (d = h > c ? d - c : b.width > c ? d - a.right + b.width : d - a.left);
  17192. c = a.top;
  17193. b.height - a.top < e && (p = c > e ? p - e : b.height > e ? p - a.bottom + b.height :
  17194. p - a.top);
  17195. CKEDITOR.env.ie && !CKEDITOR.env.edge && ((b = a = k.$.offsetParent && new CKEDITOR.dom
  17196. .element(k.$.offsetParent)) && "html" == b.getName() && (b = b.getDocument()
  17197. .getBody()), b && "rtl" == b.getComputedStyle("direction") && (d = CKEDITOR.env
  17198. .ie8Compat ? d - 2 * k.getDocument().getDocumentElement().$.scrollLeft : d - (a.$
  17199. .scrollWidth - a.$.clientWidth)));
  17200. var a = k.getFirst(),
  17201. f;
  17202. (f = a.getCustomData("activePanel")) && f.onHide && f.onHide.call(this, 1);
  17203. a.setCustomData("activePanel", this);
  17204. k.setStyles({
  17205. top: p + "px",
  17206. left: d + "px"
  17207. });
  17208. k.setOpacity(1);
  17209. g && g()
  17210. }, this);
  17211. n.isLoaded ? a() : n.onLoad = a;
  17212. CKEDITOR.tools.setTimeout(function() {
  17213. var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
  17214. this.focus();
  17215. l.element.focus();
  17216. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a);
  17217. this.allowBlur(!0);
  17218. this._.markFirst && (CKEDITOR.env.ie ? CKEDITOR.tools.setTimeout(function() {
  17219. l.markFirstDisplayed ?
  17220. l.markFirstDisplayed() : l._.markFirstDisplayed()
  17221. }, 0) : l.markFirstDisplayed ? l.markFirstDisplayed() : l._.markFirstDisplayed());
  17222. this._.editor.fire("panelShow", this)
  17223. }, 0, this)
  17224. }, CKEDITOR.env.air ? 200 : 0, this);
  17225. this.visible = 1;
  17226. this.onShow && this.onShow.call(this)
  17227. },
  17228. reposition: function() {
  17229. var a = this._.showBlockParams;
  17230. this.visible && this._.showBlockParams && (this.hide(), this.showBlock.apply(this, a))
  17231. },
  17232. focus: function() {
  17233. if (CKEDITOR.env.webkit) {
  17234. var a = CKEDITOR.document.getActive();
  17235. a && !a.equals(this._.iframe) && a.$.blur()
  17236. }(this._.lastFocused ||
  17237. this._.iframe.getFrameDocument().getWindow()).focus()
  17238. },
  17239. blur: function() {
  17240. var a = this._.iframe.getFrameDocument().getActive();
  17241. a && a.is("a") && (this._.lastFocused = a)
  17242. },
  17243. hide: function(a) {
  17244. if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) {
  17245. this.hideChild();
  17246. CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
  17247. this.element.setStyle("display", "none");
  17248. this.visible = 0;
  17249. this.element.getFirst().removeCustomData("activePanel");
  17250. if (a = a && this._.returnFocus) CKEDITOR.env.webkit && a.type && a.getWindow().$.focus(),
  17251. a.focus();
  17252. delete this._.lastFocused;
  17253. this._.showBlockParams = null;
  17254. this._.editor.fire("panelHide", this)
  17255. }
  17256. },
  17257. allowBlur: function(a) {
  17258. var b = this._.panel;
  17259. void 0 !== a && (b.allowBlur = a);
  17260. return b.allowBlur
  17261. },
  17262. showAsChild: function(a, b, c, f, h, g) {
  17263. if (this._.activeChild != a || a._.panel._.offsetParentId != c.getId()) this.hideChild(), a.onHide =
  17264. CKEDITOR.tools.bind(function() {
  17265. CKEDITOR.tools.setTimeout(function() {
  17266. this._.focused || this.hide()
  17267. }, 0, this)
  17268. }, this), this._.activeChild = a, this._.focused = !1, a.showBlock(b, c, f, h, g), this.blur(),
  17269. (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() {
  17270. a.element.getChild(0).$.style.cssText += ""
  17271. }, 100)
  17272. },
  17273. hideChild: function(a) {
  17274. var b = this._.activeChild;
  17275. b && (delete b.onHide, delete this._.activeChild, b.hide(), a && this.focus())
  17276. }
  17277. }
  17278. });
  17279. CKEDITOR.on("instanceDestroyed", function() {
  17280. var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances),
  17281. b;
  17282. for (b in f) {
  17283. var c = f[b];
  17284. a ? c.destroy() : c.element.hide()
  17285. }
  17286. a && (f = {})
  17287. })
  17288. })();
  17289. (function() {
  17290. var n, k, l;
  17291. CKEDITOR.plugins.add("colorbutton", {
  17292. requires: "panelbutton,floatpanel",
  17293. init: function(a) {
  17294. function b(d) {
  17295. function b() {
  17296. var d = a.config["colorButton_" + h + "Style"];
  17297. d.childRule = "back" == h ? function(a) {
  17298. return f(a)
  17299. } : function(a) {
  17300. return !(a.is("a") || a.getElementsByTag("a").count()) || f(a)
  17301. };
  17302. return d
  17303. }
  17304. function z(d, w, e) {
  17305. var c = {};
  17306. d && (c.color = d);
  17307. w && (c.colorName = w);
  17308. w = !CKEDITOR.tools.isEmpty(c) && new CKEDITOR.style(b(), c);
  17309. a.execCommand(m, {
  17310. newStyle: w
  17311. });
  17312. if (d && e)
  17313. for (e.addColor(d.substr(1).toUpperCase()),
  17314. d = t.element.find("[role\x3doption]").toArray(), e = 0; e < d.length; e++) d[e]
  17315. .setAttributes({
  17316. "aria-posinset": e + 1,
  17317. "aria-setsize": d.length
  17318. })
  17319. }
  17320. var g = d.name,
  17321. h = d.type,
  17322. k = d.title,
  17323. C = d.order,
  17324. m = d.commandName;
  17325. d = d.contentTransformations || {};
  17326. var A = new CKEDITOR.style(q["colorButton_" + h + "Style"]),
  17327. r = CKEDITOR.tools.getNextId() + "_colorBox",
  17328. x = {
  17329. type: h
  17330. },
  17331. y = new CKEDITOR.style(q["colorButton_" + h + "Style"], {
  17332. color: "inherit"
  17333. }),
  17334. B = function() {
  17335. return CKEDITOR.tools.addFunction(function(d, b, e) {
  17336. a.focus();
  17337. a.fire("saveSnapshot");
  17338. "?" == d ? a.getColorFromDialog(function(a) {
  17339. a &&
  17340. z(a, b, u)
  17341. }, null, x) : z(d && "#" + d, b, u);
  17342. e && (e.setAttribute("cke_colorlast", !0), a.once("selectionChange", function() {
  17343. e.removeAttribute("cke_colorlast")
  17344. }))
  17345. })
  17346. }(),
  17347. u = l.getRowLimit(a) ? new l(a, "back" == h ? "background-color" : "color", B) : void 0,
  17348. t;
  17349. a.addCommand(m, {
  17350. contextSensitive: !0,
  17351. exec: function(a, d) {
  17352. if (!a.readOnly) {
  17353. var b = d.newStyle;
  17354. a.removeStyle(y);
  17355. a.focus();
  17356. b && a.applyStyle(b);
  17357. a.fire("saveSnapshot")
  17358. }
  17359. },
  17360. refresh: function(a, d) {
  17361. y.checkApplicable(d, a, a.activeFilter) ? y.checkActive(d, a) ? this.setState(CKEDITOR
  17362. .TRISTATE_ON) :
  17363. this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  17364. }
  17365. });
  17366. a.ui.add(g, CKEDITOR.UI_PANELBUTTON, {
  17367. label: k,
  17368. title: k,
  17369. command: m,
  17370. editorFocus: 0,
  17371. toolbar: "colors," + C,
  17372. allowedContent: A,
  17373. requiredContent: A,
  17374. contentTransformations: d,
  17375. panel: {
  17376. css: [CKEDITOR.skin.getPath("editor")].concat(q.colorButton_contentsCss),
  17377. attributes: {
  17378. role: "listbox",
  17379. "aria-label": p.panelTitle
  17380. }
  17381. },
  17382. select: function(a) {
  17383. var d = q.colorButton_colors.split(",");
  17384. a = CKEDITOR.tools.array.find(d, a);
  17385. a = n.normalizeColor(a);
  17386. v(t, a);
  17387. t._.markFirstDisplayed()
  17388. },
  17389. onBlock: function(d, b) {
  17390. t = b;
  17391. b.autoSize = !0;
  17392. b.element.addClass("cke_colorblock");
  17393. b.element.setHtml(c(r, B, u ? u.getLength() : 0));
  17394. b.element.getDocument().getBody().setStyle("overflow", "hidden");
  17395. b.element.getAscendant({
  17396. html: 1
  17397. }).setStyle("overflow", "hidden");
  17398. CKEDITOR.ui.fire("ready", this);
  17399. var e = b.keys,
  17400. h = "rtl" == a.lang.dir;
  17401. e[h ? 37 : 39] = "next";
  17402. e[40] = "next";
  17403. e[9] = "next";
  17404. e[h ? 39 : 37] = "prev";
  17405. e[38] = "prev";
  17406. e[CKEDITOR.SHIFT + 9] = "prev";
  17407. e[32] = "click";
  17408. u && u.setContainer(b.element.findOne(".cke_colorhistory"))
  17409. },
  17410. onOpen: function() {
  17411. var d =
  17412. a.getSelection(),
  17413. b = d && d.getStartElement(),
  17414. e = a.elementPath(b),
  17415. c = "back" == h ? "background-color" : "color";
  17416. if (e) {
  17417. b = e.block || e.blockLimit || a.document.getBody();
  17418. do e = b && b.getComputedStyle(c) || "transparent"; while ("back" == h &&
  17419. "transparent" == e && b && (b = b.getParent()));
  17420. e && "transparent" != e || (e = "#ffffff");
  17421. q.colorButton_enableAutomatic && t.element.findOne("#" + r).setStyle("background-color",
  17422. e);
  17423. if (b = d && d.getRanges()[0]) {
  17424. for (var d = new CKEDITOR.dom.walker(b), g = b.collapsed ? b.startContainer : d
  17425. .next(), b = ""; g;) {
  17426. g.type !== CKEDITOR.NODE_ELEMENT &&
  17427. (g = g.getParent());
  17428. g = n.normalizeColor(g.getComputedStyle(c));
  17429. b = b || g;
  17430. if (b !== g) {
  17431. b = "";
  17432. break
  17433. }
  17434. g = d.next()
  17435. }
  17436. "transparent" == b && (b = "");
  17437. "fore" == h && (x.automaticTextColor = "#" + n.normalizeColor(e));
  17438. x.selectionColor = b ? "#" + b : "";
  17439. v(t, b)
  17440. }
  17441. return e
  17442. }
  17443. }
  17444. })
  17445. }
  17446. function c(b, c, f) {
  17447. var g = [],
  17448. h = q.colorButton_colors.split(","),
  17449. k = a.plugins.colordialog && q.colorButton_enableMore;
  17450. f = h.length + f + (k ? 1 : 0);
  17451. var v = 1;
  17452. q.colorButton_enableAutomatic && (f += 1, v += 1, g.push(
  17453. '\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue', ' title\x3d"', p.auto,
  17454. '"', ' draggable\x3d"false"', ' ondragstart\x3d"return false;"',
  17455. ' onclick\x3d"CKEDITOR.tools.callFunction(', c, ',null);return false;"',
  17456. " href\x3d\"javascript:void('", p.auto, "')\"",
  17457. ' role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"', f, '"\x3e',
  17458. '\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e',
  17459. "\x3ctr\x3e", '\x3ctd colspan\x3d"', a.config.colorButton_colorsPerRow,
  17460. '" align\x3d"center"\x3e', '\x3cspan class\x3d"cke_colorbox" id\x3d"', b,
  17461. '"\x3e\x3c/span\x3e', p.auto,
  17462. "\x3c/td\x3e", "\x3c/tr\x3e", "\x3c/table\x3e", "\x3c/a\x3e"));
  17463. g.push(
  17464. '\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctbody\x3e'
  17465. );
  17466. for (b = 0; b < h.length; b++) {
  17467. 0 === b % a.config.colorButton_colorsPerRow && g.push("\x3c/tr\x3e\x3ctr\x3e");
  17468. var m = h[b].split("/"),
  17469. r = m[0],
  17470. m = new n(a, {
  17471. color: m[1] || r,
  17472. label: m[1] ? r : void 0
  17473. }, c);
  17474. m.setPositionIndex(v + b, f);
  17475. g.push(m.getHtml())
  17476. }
  17477. l.getRowLimit(a) && l.renderContainer(g, a);
  17478. k && g.push("\x3c/tr\x3e", "\x3ctr\x3e", '\x3ctd colspan\x3d"', a.config.colorButton_colorsPerRow,
  17479. '" align\x3d"center"\x3e', '\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue',
  17480. ' title\x3d"', p.more, '"', ' draggable\x3d"false"', ' ondragstart\x3d"return false;"',
  17481. ' onclick\x3d"CKEDITOR.tools.callFunction(', c, ",'?');return false;\"",
  17482. " href\x3d\"javascript:void('", p.more, "')\"", ' role\x3d"option" aria-posinset\x3d"', f,
  17483. '" aria-setsize\x3d"', f, '"\x3e', p.more, "\x3c/a\x3e", "\x3c/td\x3e");
  17484. g.push("\x3c/tr\x3e\x3c/tbody\x3e\x3c/table\x3e");
  17485. return g.join("")
  17486. }
  17487. function f(a) {
  17488. return "false" == a.getAttribute("contentEditable") ||
  17489. a.getAttribute("data-nostyle")
  17490. }
  17491. function v(a, b) {
  17492. var c = a._.getItems(),
  17493. g = a.element.findOne("[aria-selected]"),
  17494. f = a.element.findOne("[cke_colorlast]");
  17495. g && g.removeAttribute("aria-selected");
  17496. if (f) f.setAttribute("aria-selected", !0);
  17497. else
  17498. for (g = 0; g < c.count(); g++)
  17499. if (f = c.getItem(g), b && b == n.normalizeColor(f.getAttribute("data-value"))) {
  17500. f.setAttribute("aria-selected", !0);
  17501. break
  17502. }
  17503. }
  17504. var q = a.config,
  17505. p = a.lang.colorbutton;
  17506. if (!CKEDITOR.env.hc) {
  17507. b({
  17508. name: "TextColor",
  17509. type: "fore",
  17510. commandName: "textColor",
  17511. title: p.textColorTitle,
  17512. order: 10,
  17513. contentTransformations: [
  17514. [{
  17515. element: "font",
  17516. check: "span{color}",
  17517. left: function(a) {
  17518. return !!a.attributes.color
  17519. },
  17520. right: function(a) {
  17521. a.name = "span";
  17522. a.attributes.color && (a.styles.color = a.attributes.color);
  17523. delete a.attributes.color
  17524. }
  17525. }]
  17526. ]
  17527. });
  17528. var k, r = a.config.colorButton_normalizeBackground;
  17529. if (void 0 === r || r) k = [
  17530. [{
  17531. element: "span",
  17532. left: function(a) {
  17533. var b = CKEDITOR.tools;
  17534. if ("span" != a.name || !a.styles || !a.styles.background) return !1;
  17535. a = b.style.parse.background(a.styles.background);
  17536. return a.color && 1 === b.object.keys(a).length
  17537. },
  17538. right: function(b) {
  17539. var c = (new CKEDITOR.style(a.config.colorButton_backStyle, {
  17540. color: b.styles.background
  17541. })).getDefinition();
  17542. b.name = c.element;
  17543. b.styles = c.styles;
  17544. b.attributes = c.attributes || {};
  17545. return b
  17546. }
  17547. }]
  17548. ];
  17549. b({
  17550. name: "BGColor",
  17551. type: "back",
  17552. commandName: "bgColor",
  17553. title: p.bgColorTitle,
  17554. order: 20,
  17555. contentTransformations: k
  17556. })
  17557. }
  17558. }
  17559. });
  17560. n = CKEDITOR.tools.createClass({
  17561. $: function(a, b, c) {
  17562. this.$ = new CKEDITOR.dom.element("td");
  17563. this.color = CKEDITOR.tools._isValidColorFormat(b.color) ? b.color : "";
  17564. this.clickFn = c;
  17565. this.label = b.label || n.colorNames(a)[this.color] ||
  17566. this.color;
  17567. this.setHtml()
  17568. },
  17569. statics: {
  17570. colorNames: function(a) {
  17571. return a.lang.colorbutton.colors
  17572. },
  17573. normalizeColor: function(a) {
  17574. var b = /^(rgb|hsl)a\(/g.test(a),
  17575. c = /^rgba\((\s*0\s*,?){4}\)$/g.test(a);
  17576. return b && !c ? (a = new CKEDITOR.tools.color(a), CKEDITOR.tools.normalizeHex(a.getHex() || "")
  17577. .replace(/#/g, "")) : CKEDITOR.tools.normalizeHex("#" + CKEDITOR.tools.convertRgbToHex(a || ""))
  17578. .replace(/#/g, "")
  17579. }
  17580. },
  17581. proto: {
  17582. getElement: function() {
  17583. return this.$
  17584. },
  17585. getHtml: function() {
  17586. return this.getElement().getOuterHtml()
  17587. },
  17588. setHtml: function() {
  17589. this.getElement().setHtml(
  17590. '\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"' +
  17591. this.label +
  17592. '" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(' +
  17593. this.clickFn + ",'" + this.color + "','" + this.label +
  17594. "', this); return false;\" href\x3d\"javascript:void('" + this.color + '\')" data-value\x3d"' +
  17595. this.color +
  17596. '" role\x3d"option"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#' + this
  17597. .color + '"\x3e\x3c/span\x3e\x3c/a\x3e')
  17598. },
  17599. setPositionIndex: function(a, b) {
  17600. this.getElement().getChild(0).setAttributes({
  17601. "aria-posinset": a,
  17602. "aria-setsize": b
  17603. })
  17604. }
  17605. }
  17606. });
  17607. k = CKEDITOR.tools.createClass({
  17608. $: function() {
  17609. this.$ = new CKEDITOR.dom.element("tr");
  17610. this.$.addClass("cke_colorhistory_row");
  17611. this.boxes = []
  17612. },
  17613. proto: {
  17614. getElement: function() {
  17615. return this.$
  17616. },
  17617. removeLastColor: function() {
  17618. this.getElement().getLast().remove();
  17619. return this.boxes.pop()
  17620. },
  17621. addNewColor: function(a) {
  17622. this.boxes.unshift(a);
  17623. this.getElement().append(a.getElement(), !0)
  17624. },
  17625. extractColorBox: function(a) {
  17626. var b = CKEDITOR.tools.getIndex(this.boxes, function(b) {
  17627. return b.color === a
  17628. });
  17629. if (0 > b) return null;
  17630. this.boxes[b].getElement().remove();
  17631. return this.boxes.splice(b, 1)[0]
  17632. }
  17633. }
  17634. });
  17635. l = CKEDITOR.tools.createClass({
  17636. $: function(a, b, c) {
  17637. this.editor = a;
  17638. this.cssProperty = b;
  17639. this.clickFn = c;
  17640. this.rows = [];
  17641. this._.addNewRow();
  17642. if (this.editor.config.colorButton_renderContentColors) this.editor.once("instanceReady", function() {
  17643. this.renderContentColors()
  17644. }, this)
  17645. },
  17646. statics: {
  17647. renderContainer: function(a, b) {
  17648. a.push('\x3c/tbody\x3e\x3ctbody class\x3d"cke_colorhistory" style\x3d"display:none;"\x3e',
  17649. "\x3ctr\x3e", '\x3ctd colspan\x3d"', b.config.colorButton_colorsPerRow,
  17650. '" align\x3d"center"\x3e',
  17651. "\x3cspan\x3e\x3chr\x3e\x3c/span\x3e", "\x3c/td\x3e", "\x3c/tr\x3e",
  17652. "\x3c/tbody\x3e\x3ctbody\x3e")
  17653. },
  17654. getRowLimit: function(a) {
  17655. return a.config.colorButton_historyRowLimit
  17656. },
  17657. getCapacity: function(a) {
  17658. return l.getRowLimit(a) * a.config.colorButton_colorsPerRow
  17659. },
  17660. colorList: CKEDITOR.tools.style.parse._colors
  17661. },
  17662. _: {
  17663. countColors: function() {
  17664. var a = CKEDITOR.tools.getStyledSpans(this.cssProperty, this.editor.editable());
  17665. return CKEDITOR.tools.array.reduce(a, function(a, c) {
  17666. var f = this._.getHexCode(c, this.cssProperty, l.colorList);
  17667. a[f] = a[f] || 0;
  17668. a[f] += 1;
  17669. return a
  17670. }, {}, this)
  17671. },
  17672. getHexCode: function(a, b, c) {
  17673. var f = a.getStyle(b);
  17674. return f in c ? c[f].substr(1) : n.normalizeColor(a.getComputedStyle(b)).toUpperCase()
  17675. },
  17676. sortByOccurrencesAscending: function(a, b) {
  17677. var c = [],
  17678. f;
  17679. for (f in a) {
  17680. var k = {};
  17681. k[b] = f;
  17682. k.frequency = a[f];
  17683. c.push(k)
  17684. }
  17685. c.sort(function(a, b) {
  17686. return b.frequency - a.frequency
  17687. });
  17688. this._.trimToCapacity(c);
  17689. return c.reverse()
  17690. },
  17691. trimToCapacity: function(a) {
  17692. a.splice(l.getCapacity(this.editor))
  17693. },
  17694. addColors: function(a) {
  17695. CKEDITOR.tools.array.forEach(a, function(a) {
  17696. this.addColor(a.colorCode)
  17697. },
  17698. this)
  17699. },
  17700. extractColorBox: function(a) {
  17701. for (var b = 0; b < this.rows.length; b++) {
  17702. var c = this.rows[b].extractColorBox(a);
  17703. if (c) return c
  17704. }
  17705. return null
  17706. },
  17707. moveToBeginning: function(a) {
  17708. this.rows[0].addNewColor(a)
  17709. },
  17710. createAtBeginning: function(a) {
  17711. this._.moveToBeginning(new n(this.editor, {
  17712. color: a
  17713. }, this.clickFn))
  17714. },
  17715. addNewRow: function() {
  17716. this.rows.push(new k);
  17717. this.container && this.container.append(this.rows[this.rows.length - 1].getElement())
  17718. },
  17719. alignRows: function() {
  17720. for (var a = 0; a < l.getRowLimit(this.editor) && !(this.rows[a].boxes.length <=
  17721. this.editor.config.colorButton_colorsPerRow); a++) this.rows[a + 1] ? this._
  17722. .moveLastBoxToNextRow(a) : a < l.getRowLimit(this.editor) - 1 ? (this._.addNewRow(), this._
  17723. .moveLastBoxToNextRow(a)) : this.rows[a].removeLastColor()
  17724. },
  17725. moveLastBoxToNextRow: function(a) {
  17726. this.rows[a + 1].addNewColor(this.rows[a].removeLastColor())
  17727. },
  17728. refreshPositions: function() {
  17729. var a = this._.countPanelElements(),
  17730. b = this._.calculateFirstPosition(a);
  17731. CKEDITOR.tools.array.forEach(this.rows, function(c) {
  17732. CKEDITOR.tools.array.forEach(c.boxes, function(c) {
  17733. c.setPositionIndex(b,
  17734. a);
  17735. b += 1
  17736. })
  17737. })
  17738. },
  17739. countPanelElements: function() {
  17740. var a = this.editor.config.colorButton_colors.split(",").length + this.getLength();
  17741. this.editor.plugins.colordialog && this.editor.config.colorButton_enableMore && (a += 1);
  17742. this.editor.config.colorButton_enableAutomatic && (a += 1);
  17743. return a
  17744. },
  17745. calculateFirstPosition: function(a) {
  17746. return this.editor.plugins.colordialog && this.editor.config.colorButton_enableMore ? a - this
  17747. .getLength() : a - this.getLength() + 1
  17748. },
  17749. attachRows: function() {
  17750. CKEDITOR.tools.array.forEach(this.rows, function(a) {
  17751. this.container.append(a.getElement())
  17752. },
  17753. this)
  17754. }
  17755. },
  17756. proto: {
  17757. setContainer: function(a) {
  17758. this.container = a;
  17759. this._.attachRows();
  17760. this.getLength() && this.show()
  17761. },
  17762. show: function() {
  17763. this.container && this.container.show()
  17764. },
  17765. renderContentColors: function() {
  17766. var a = this._.countColors();
  17767. CKEDITOR.tools.isEmpty(a) || (a = this._.sortByOccurrencesAscending(a, "colorCode"), this._
  17768. .addColors(a), this._.refreshPositions())
  17769. },
  17770. addColor: function(a) {
  17771. var b = this._.extractColorBox(a);
  17772. this.container && !this.container.isVisible() && this.show();
  17773. b ? this._.moveToBeginning(b) : this._.createAtBeginning(a);
  17774. this._.alignRows()
  17775. },
  17776. getLength: function() {
  17777. return CKEDITOR.tools.array.reduce(this.rows, function(a, b) {
  17778. return a + b.boxes.length
  17779. }, 0)
  17780. }
  17781. }
  17782. })
  17783. })();
  17784. CKEDITOR.config.colorButton_enableMore = !0;
  17785. CKEDITOR.config.colorButton_colors =
  17786. "1ABC9C,2ECC71,3498DB,9B59B6,4E5F70,F1C40F,16A085,27AE60,2980B9,8E44AD,2C3E50,F39C12,E67E22,E74C3C,ECF0F1,95A5A6,DDD,FFF,D35400,C0392B,BDC3C7,7F8C8D,999,000";
  17787. CKEDITOR.config.colorButton_foreStyle = {
  17788. element: "span",
  17789. styles: {
  17790. color: "#(color)"
  17791. },
  17792. overrides: [{
  17793. element: "font",
  17794. attributes: {
  17795. color: null
  17796. }
  17797. }]
  17798. };
  17799. CKEDITOR.config.colorButton_backStyle = {
  17800. element: "span",
  17801. styles: {
  17802. "background-color": "#(color)"
  17803. }
  17804. };
  17805. CKEDITOR.config.colorButton_enableAutomatic = !0;
  17806. CKEDITOR.config.colorButton_colorsPerRow = 6;
  17807. CKEDITOR.config.colorButton_historyRowLimit = 1;
  17808. CKEDITOR.config.colorButton_renderContentColors = !0;
  17809. CKEDITOR.config.colorButton_contentsCss = [];
  17810. CKEDITOR.plugins.colordialog = {
  17811. requires: "dialog",
  17812. init: function(b) {
  17813. var d = new CKEDITOR.dialogCommand("colordialog");
  17814. d.editorFocus = !1;
  17815. b.addCommand("colordialog", d);
  17816. CKEDITOR.dialog.add("colordialog", this.path + "dialogs/colordialog.js");
  17817. b.getColorFromDialog = function(d, k, g) {
  17818. var c, e, h, f;
  17819. c = function(a) {
  17820. h(this);
  17821. (a = "ok" == a.name ? this.getValueOf("picker", "selectedColor") : null) && !CKEDITOR.tools
  17822. ._isValidColorFormat(a) && (a = null);
  17823. /^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(a) && (a = "#" + a);
  17824. d.call(k, a)
  17825. };
  17826. e = function(a) {
  17827. g && (a.data =
  17828. g)
  17829. };
  17830. h = function(a) {
  17831. a.removeListener("ok", c);
  17832. a.removeListener("cancel", c);
  17833. a.removeListener("show", e)
  17834. };
  17835. f = function(a) {
  17836. a.on("ok", c);
  17837. a.on("cancel", c);
  17838. a.on("show", e, null, null, 5)
  17839. };
  17840. b.execCommand("colordialog");
  17841. if (b._.storedDialogs && b._.storedDialogs.colordialog) f(b._.storedDialogs.colordialog);
  17842. else CKEDITOR.on("dialogDefinition", function(a) {
  17843. if ("colordialog" == a.data.name) {
  17844. var b = a.data.definition;
  17845. a.removeListener();
  17846. b.onLoad = CKEDITOR.tools.override(b.onLoad, function(a) {
  17847. return function() {
  17848. f(this);
  17849. b.onLoad = a;
  17850. "function" ==
  17851. typeof a && a.call(this)
  17852. }
  17853. })
  17854. }
  17855. })
  17856. }
  17857. }
  17858. };
  17859. CKEDITOR.plugins.add("colordialog", CKEDITOR.plugins.colordialog);
  17860. (function() {
  17861. CKEDITOR.plugins.add("xml", {});
  17862. CKEDITOR.xml = function(c) {
  17863. var a = null;
  17864. if ("object" == typeof c) a = c;
  17865. else if (c = (c || "").replace(/&nbsp;/g, " "), "ActiveXObject" in window) {
  17866. try {
  17867. a = new ActiveXObject("MSXML2.DOMDocument")
  17868. } catch (b) {
  17869. try {
  17870. a = new ActiveXObject("Microsoft.XmlDom")
  17871. } catch (d) {}
  17872. }
  17873. a && (a.async = !1, a.resolveExternals = !1, a.validateOnParse = !1, a.loadXML(c))
  17874. } else window.DOMParser && (a = (new DOMParser).parseFromString(c, "text/xml"));
  17875. this.baseXml = a
  17876. };
  17877. CKEDITOR.xml.prototype = {
  17878. selectSingleNode: function(c, a) {
  17879. var b =
  17880. this.baseXml;
  17881. if (a || (a = b)) {
  17882. if ("selectSingleNode" in a) return a.selectSingleNode(c);
  17883. if (b.evaluate) return (b = b.evaluate(c, a, null, 9, null)) && b.singleNodeValue || null
  17884. }
  17885. return null
  17886. },
  17887. selectNodes: function(c, a) {
  17888. var b = this.baseXml,
  17889. d = [];
  17890. if (a || (a = b)) {
  17891. if ("selectNodes" in a) return a.selectNodes(c);
  17892. if (b.evaluate && (b = b.evaluate(c, a, null, 5, null)))
  17893. for (var e; e = b.iterateNext();) d.push(e)
  17894. }
  17895. return d
  17896. },
  17897. getInnerXml: function(c, a) {
  17898. var b = this.selectSingleNode(c, a),
  17899. d = [];
  17900. if (b)
  17901. for (b = b.firstChild; b;) b.xml ? d.push(b.xml) : window.XMLSerializer &&
  17902. d.push((new XMLSerializer).serializeToString(b)), b = b.nextSibling;
  17903. return d.length ? d.join("") : null
  17904. }
  17905. }
  17906. })();
  17907. (function() {
  17908. CKEDITOR.plugins.add("ajax", {
  17909. requires: "xml"
  17910. });
  17911. CKEDITOR.ajax = function() {
  17912. function k() {
  17913. if (!CKEDITOR.env.ie || "file:" != location.protocol) try {
  17914. return new XMLHttpRequest
  17915. } catch (a) {}
  17916. try {
  17917. return new ActiveXObject("Msxml2.XMLHTTP")
  17918. } catch (b) {}
  17919. try {
  17920. return new ActiveXObject("Microsoft.XMLHTTP")
  17921. } catch (c) {}
  17922. return null
  17923. }
  17924. function h(a, b) {
  17925. if (4 != a.readyState || !(200 <= a.status && 300 > a.status || 304 == a.status || 0 === a.status ||
  17926. 1223 == a.status)) return null;
  17927. switch (b) {
  17928. case "text":
  17929. return a.responseText;
  17930. case "xml":
  17931. var c = a.responseXML;
  17932. return new CKEDITOR.xml(c && c.firstChild ? c : a.responseText);
  17933. case "arraybuffer":
  17934. return a.response;
  17935. default:
  17936. return null
  17937. }
  17938. }
  17939. function g(a, b, c) {
  17940. var e = !!b,
  17941. d = k();
  17942. if (!d) return null;
  17943. e && "text" !== c && "xml" !== c && (d.responseType = c);
  17944. d.open("GET", a, e);
  17945. e && (d.onreadystatechange = function() {
  17946. 4 == d.readyState && (b(h(d, c)), d = null)
  17947. });
  17948. d.send(null);
  17949. return e ? "" : h(d, c)
  17950. }
  17951. function l(a, b, c, e, d) {
  17952. var f = k();
  17953. if (!f) return null;
  17954. f.open("POST", a, !0);
  17955. f.onreadystatechange = function() {
  17956. 4 == f.readyState && (e && e(h(f, d)), f = null)
  17957. };
  17958. f.setRequestHeader("Content-type",
  17959. c || "application/x-www-form-urlencoded; charset\x3dUTF-8");
  17960. f.send(b)
  17961. }
  17962. return {
  17963. load: function(a, b, c) {
  17964. return g(a, b, c || "text")
  17965. },
  17966. post: function(a, b, c, e) {
  17967. return l(a, b, c, e, "text")
  17968. },
  17969. loadXml: function(a, b) {
  17970. return g(a, b, "xml")
  17971. },
  17972. loadText: function(a, b) {
  17973. return g(a, b, "text")
  17974. },
  17975. loadBinary: function(a, b) {
  17976. return g(a, b, "arraybuffer")
  17977. }
  17978. }
  17979. }()
  17980. })();
  17981. (function() {
  17982. CKEDITOR.plugins.add("templates", {
  17983. requires: "dialog,ajax",
  17984. init: function(a) {
  17985. CKEDITOR.dialog.add("templates", CKEDITOR.getUrl(this.path + "dialogs/templates.js"));
  17986. a.addCommand("templates", new CKEDITOR.dialogCommand("templates"));
  17987. a.ui.addButton && a.ui.addButton("Templates", {
  17988. label: a.lang.templates.button,
  17989. command: "templates",
  17990. toolbar: "doctools,10"
  17991. })
  17992. }
  17993. });
  17994. var c = {},
  17995. f = {};
  17996. CKEDITOR.addTemplates = function(a, d) {
  17997. c[a] = d
  17998. };
  17999. CKEDITOR.getTemplates = function(a) {
  18000. return c[a]
  18001. };
  18002. CKEDITOR.loadTemplates = function(a, d) {
  18003. for (var e = [], b = 0, c = a.length; b < c; b++) f[a[b]] || (e.push(a[b]), f[a[b]] = 1);
  18004. e.length ? CKEDITOR.scriptLoader.load(e, d) : setTimeout(d, 0)
  18005. }
  18006. })();
  18007. CKEDITOR.config.templates_files = [CKEDITOR.getUrl("plugins/templates/templates/default.js")];
  18008. CKEDITOR.config.templates_replaceContent = !0;
  18009. CKEDITOR.plugins.add("menu", {
  18010. requires: "floatpanel",
  18011. beforeInit: function(m) {
  18012. for (var k = m.config.menu_groups.split(","), n = m._.menuGroups = {}, r = m._.menuItems = {}, p = 0; p <
  18013. k.length; p++) n[k[p]] = p + 1;
  18014. m.addMenuGroup = function(c, a) {
  18015. n[c] = a || 100
  18016. };
  18017. m.addMenuItem = function(c, a) {
  18018. n[a.group] && (r[c] = new CKEDITOR.menuItem(this, c, a))
  18019. };
  18020. m.addMenuItems = function(c) {
  18021. for (var a in c) this.addMenuItem(a, c[a])
  18022. };
  18023. m.getMenuItem = function(c) {
  18024. return r[c]
  18025. };
  18026. m.removeMenuItem = function(c) {
  18027. delete r[c]
  18028. }
  18029. }
  18030. });
  18031. (function() {
  18032. function m(a) {
  18033. a.sort(function(a, f) {
  18034. return a.group < f.group ? -1 : a.group > f.group ? 1 : a.order < f.order ? -1 : a.order > f.order ? 1 :
  18035. 0
  18036. })
  18037. }
  18038. var k =
  18039. '\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1" _cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-label\x3d"{attrLabel}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"',
  18040. n = "";
  18041. CKEDITOR.env.gecko && CKEDITOR.env.mac && (k += ' onkeypress\x3d"return false;"');
  18042. CKEDITOR.env.gecko && (k +=
  18043. ' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');
  18044. CKEDITOR.env.ie && (n =
  18045. 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26'
  18046. );
  18047. var k = k + (
  18048. ' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" onclick\x3d"' +
  18049. n + 'CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e') +
  18050. '\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{shortcutHtml}{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_voice_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e\x3c/span\x3e',
  18051. r = CKEDITOR.addTemplate("menuItem", k),
  18052. p = CKEDITOR.addTemplate("menuArrow",
  18053. '\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),
  18054. c = CKEDITOR.addTemplate("menuShortcut",
  18055. '\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');
  18056. CKEDITOR.menu = CKEDITOR.tools.createClass({
  18057. $: function(a, b) {
  18058. b = this._.definition = b || {};
  18059. this.id = CKEDITOR.tools.getNextId();
  18060. this.editor = a;
  18061. this.items = [];
  18062. this._.listeners = [];
  18063. this._.level = b.level || 1;
  18064. var f = CKEDITOR.tools.extend({}, b.panel, {
  18065. css: [CKEDITOR.skin.getPath("editor")],
  18066. level: this._.level -
  18067. 1,
  18068. block: {}
  18069. }),
  18070. c = f.block.attributes = f.attributes || {};
  18071. !c.role && (c.role = "menu");
  18072. this._.panelDefinition = f
  18073. },
  18074. _: {
  18075. onShow: function() {
  18076. var a = this.editor.getSelection(),
  18077. b = a && a.getStartElement(),
  18078. f = this.editor.elementPath(),
  18079. c = this._.listeners;
  18080. this.removeAll();
  18081. for (var h = 0; h < c.length; h++) {
  18082. var l = c[h](b, a, f);
  18083. if (l)
  18084. for (var g in l) {
  18085. var e = this.editor.getMenuItem(g);
  18086. !e || e.command && !this.editor.getCommand(e.command).state || (e.state = l[g], this.add(e))
  18087. }
  18088. }
  18089. },
  18090. onClick: function(a) {
  18091. this.hide();
  18092. if (a.onClick) a.onClick();
  18093. else a.command &&
  18094. this.editor.execCommand(a.command)
  18095. },
  18096. onEscape: function(a) {
  18097. var b = this.parent;
  18098. b ? b._.panel.hideChild(1) : 27 == a && this.hide(1);
  18099. return !1
  18100. },
  18101. onHide: function() {
  18102. this.onHide && this.onHide()
  18103. },
  18104. showSubMenu: function(a) {
  18105. var b = this._.subMenu,
  18106. f = this.items[a];
  18107. if (f = f.getItems && f.getItems()) {
  18108. b ? b.removeAll() : (b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({},
  18109. this._.definition, {
  18110. level: this._.level + 1
  18111. }, !0)), b.parent = this, b._.onClick = CKEDITOR.tools.bind(this._.onClick, this));
  18112. for (var c in f) {
  18113. var h = this.editor.getMenuItem(c);
  18114. h && (h.state = f[c], b.add(h))
  18115. }
  18116. var l = this._.panel.getBlock(this.id).element.getDocument().getById(this.id + String(a));
  18117. setTimeout(function() {
  18118. b.show(l, 2)
  18119. }, 0)
  18120. } else this._.panel.hideChild(1)
  18121. }
  18122. },
  18123. proto: {
  18124. add: function(a) {
  18125. a.order || (a.order = this.items.length);
  18126. this.items.push(a)
  18127. },
  18128. removeAll: function() {
  18129. this.items = []
  18130. },
  18131. show: function(a, b, f, c) {
  18132. if (!this.parent && (this._.onShow(), !this.items.length)) return;
  18133. b = b || ("rtl" == this.editor.lang.dir ? 2 : 1);
  18134. var h = this.items,
  18135. l = this.editor,
  18136. g = this._.panel,
  18137. e = this._.element;
  18138. if (!g) {
  18139. g = this._.panel =
  18140. new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition,
  18141. this._.level);
  18142. g.onEscape = CKEDITOR.tools.bind(function(a) {
  18143. if (!1 === this._.onEscape(a)) return !1
  18144. }, this);
  18145. g.onShow = function() {
  18146. g._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")
  18147. };
  18148. g.onHide = CKEDITOR.tools.bind(function() {
  18149. this._.onHide && this._.onHide()
  18150. }, this);
  18151. e = g.addBlock(this.id, this._.panelDefinition.block);
  18152. e.autoSize = !0;
  18153. var d = e.keys;
  18154. d[40] = "next";
  18155. d[9] = "next";
  18156. d[38] = "prev";
  18157. d[CKEDITOR.SHIFT +
  18158. 9] = "prev";
  18159. d["rtl" == l.lang.dir ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click";
  18160. d[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  18161. CKEDITOR.env.ie && (d[13] = "mouseup");
  18162. e = this._.element = e.element;
  18163. d = e.getDocument();
  18164. d.getBody().setStyle("overflow", "hidden");
  18165. d.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden");
  18166. this._.itemOverFn = CKEDITOR.tools.addFunction(function(a) {
  18167. clearTimeout(this._.showSubTimeout);
  18168. this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, l.config
  18169. .menu_subMenuDelay || 400, this, [a])
  18170. },
  18171. this);
  18172. this._.itemOutFn = CKEDITOR.tools.addFunction(function() {
  18173. clearTimeout(this._.showSubTimeout)
  18174. }, this);
  18175. this._.itemClickFn = CKEDITOR.tools.addFunction(function(a) {
  18176. var b = this.items[a];
  18177. if (b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1);
  18178. else if (b.getItems) this._.showSubMenu(a);
  18179. else this._.onClick(b)
  18180. }, this)
  18181. }
  18182. m(h);
  18183. for (var d = l.elementPath(), d = ['\x3cdiv class\x3d"cke_menu' + (d && d.direction() != l.lang
  18184. .dir ? " cke_mixed_dir_content" : "") + '" role\x3d"presentation"\x3e'], k = h.length, n =
  18185. k && h[0].group, p = 0; p < k; p++) {
  18186. var q =
  18187. h[p];
  18188. n != q.group && (d.push(
  18189. '\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'), n = q.group);
  18190. q.render(this, p, d)
  18191. }
  18192. d.push("\x3c/div\x3e");
  18193. e.setHtml(d.join(""));
  18194. CKEDITOR.ui.fire("ready", this);
  18195. this.parent ? this.parent._.panel.showAsChild(g, this.id, a, b, f, c) : g.showBlock(this.id, a, b,
  18196. f, c);
  18197. l.fire("menuShow", [g])
  18198. },
  18199. addListener: function(a) {
  18200. this._.listeners.push(a)
  18201. },
  18202. hide: function(a) {
  18203. this._.onHide && this._.onHide();
  18204. this._.panel && this._.panel.hide(a)
  18205. },
  18206. findItemByCommandName: function(a) {
  18207. var b = CKEDITOR.tools.array.filter(this.items,
  18208. function(b) {
  18209. return a === b.command
  18210. });
  18211. return b.length ? (b = b[0], {
  18212. item: b,
  18213. element: this._.element.findOne("." + b.className)
  18214. }) : null
  18215. }
  18216. }
  18217. });
  18218. CKEDITOR.menuItem = CKEDITOR.tools.createClass({
  18219. $: function(a, b, c) {
  18220. CKEDITOR.tools.extend(this, c, {
  18221. order: 0,
  18222. className: "cke_menubutton__" + b
  18223. });
  18224. this.group = a._.menuGroups[this.group];
  18225. this.editor = a;
  18226. this.name = b
  18227. },
  18228. proto: {
  18229. render: function(a, b, f) {
  18230. var k = a.id + String(b),
  18231. h = "undefined" == typeof this.state ? CKEDITOR.TRISTATE_OFF : this.state,
  18232. l = "",
  18233. g = this.editor,
  18234. e, d, m = h == CKEDITOR.TRISTATE_ON ? "on" : h == CKEDITOR.TRISTATE_DISABLED ?
  18235. "disabled" : "off";
  18236. this.role in {
  18237. menuitemcheckbox: 1,
  18238. menuitemradio: 1
  18239. } && (l = ' aria-checked\x3d"' + (h == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"');
  18240. var n = this.getItems,
  18241. t = "\x26#" + ("rtl" == this.editor.lang.dir ? "9668" : "9658") + ";",
  18242. q = this.name;
  18243. this.icon && !/\./.test(this.icon) && (q = this.icon);
  18244. this.command && (e = g.getCommand(this.command), (e = g.getCommandKeystroke(e)) && (d = CKEDITOR
  18245. .tools.keystrokeToString(g.lang.common.keyboard, e)));
  18246. e = CKEDITOR.tools.htmlEncodeAttr(this.label);
  18247. a = {
  18248. id: k,
  18249. name: this.name,
  18250. iconName: q,
  18251. label: this.label,
  18252. attrLabel: e,
  18253. cls: this.className || "",
  18254. state: m,
  18255. hasPopup: n ? "true" : "false",
  18256. disabled: h == CKEDITOR.TRISTATE_DISABLED,
  18257. title: e + (d ? " (" + d.display + ")" : ""),
  18258. ariaShortcut: d ? g.lang.common.keyboardShortcut + " " + d.aria : "",
  18259. href: "javascript:void('" + (e || "").replace("'") + "')",
  18260. hoverFn: a._.itemOverFn,
  18261. moveOutFn: a._.itemOutFn,
  18262. clickFn: a._.itemClickFn,
  18263. index: b,
  18264. iconStyle: CKEDITOR.skin.getIconStyle(q, "rtl" == this.editor.lang.dir, q == this.icon ? null :
  18265. this.icon, this.iconOffset),
  18266. shortcutHtml: d ? c.output({
  18267. shortcut: d.display
  18268. }) : "",
  18269. arrowHtml: n ?
  18270. p.output({
  18271. label: t
  18272. }) : "",
  18273. role: this.role ? this.role : "menuitem",
  18274. ariaChecked: l
  18275. };
  18276. r.output(a, f)
  18277. }
  18278. }
  18279. })
  18280. })();
  18281. CKEDITOR.config.menu_groups =
  18282. "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";
  18283. CKEDITOR.plugins.add("contextmenu", {
  18284. requires: "menu",
  18285. onLoad: function() {
  18286. CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({
  18287. base: CKEDITOR.menu,
  18288. $: function(a) {
  18289. this.base.call(this, a, {
  18290. panel: {
  18291. css: a.config.contextmenu_contentsCss,
  18292. className: "cke_menu_panel",
  18293. attributes: {
  18294. "aria-label": a.lang.contextmenu.options
  18295. }
  18296. }
  18297. })
  18298. },
  18299. proto: {
  18300. addTarget: function(a, f) {
  18301. function c() {
  18302. e = !1
  18303. }
  18304. var d, e;
  18305. a.on("contextmenu", function(a) {
  18306. a = a.data;
  18307. var b = CKEDITOR.env.webkit ? d : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey;
  18308. if (!f || !b)
  18309. if (a.preventDefault(),
  18310. !e) {
  18311. if (CKEDITOR.env.mac && CKEDITOR.env.webkit) {
  18312. var b = this.editor,
  18313. c = (new CKEDITOR.dom.elementPath(a.getTarget(), b.editable())).contains(
  18314. function(a) {
  18315. return a.hasAttribute("contenteditable")
  18316. }, !0);
  18317. c && "false" == c.getAttribute("contenteditable") && b.getSelection().fake(c)
  18318. }
  18319. var c = a.getTarget().getDocument(),
  18320. g = a.getTarget().getDocument().getDocumentElement(),
  18321. b = !c.equals(CKEDITOR.document),
  18322. c = c.getWindow().getScrollPosition(),
  18323. h = b ? a.$.clientX : a.$.pageX || c.x + a.$.clientX,
  18324. k = b ? a.$.clientY : a.$.pageY || c.y + a.$.clientY;
  18325. CKEDITOR.tools.setTimeout(function() {
  18326. this.open(g, null, h, k)
  18327. }, CKEDITOR.env.ie ? 200 : 0, this)
  18328. }
  18329. }, this);
  18330. if (CKEDITOR.env.webkit) {
  18331. var b = function() {
  18332. d = 0
  18333. };
  18334. a.on("keydown", function(a) {
  18335. d = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey
  18336. });
  18337. a.on("keyup", b);
  18338. a.on("contextmenu", b)
  18339. }
  18340. CKEDITOR.env.gecko && !CKEDITOR.env.mac && (a.on("keydown", function(a) {
  18341. a.data.$.shiftKey && 121 === a.data.$.keyCode && (e = !0)
  18342. }, null, null, 0), a.on("keyup", c), a.on("contextmenu", c))
  18343. },
  18344. open: function(a, f, c, d) {
  18345. !1 !== this.editor.config.enableContextMenu && this.editor.getSelection().getType() !==
  18346. CKEDITOR.SELECTION_NONE && (this.editor.focus(), a = a || CKEDITOR.document
  18347. .getDocumentElement(), this.editor.selectionChange(1), this.show(a, f, c, d))
  18348. }
  18349. }
  18350. })
  18351. },
  18352. beforeInit: function(a) {
  18353. var f = a.contextMenu = new CKEDITOR.plugins.contextMenu(a);
  18354. a.on("contentDom", function() {
  18355. f.addTarget(a.editable(), !1 !== a.config.browserContextMenuOnCtrl)
  18356. });
  18357. a.addCommand("contextMenu", {
  18358. exec: function(a) {
  18359. var d = 0,
  18360. e = 0,
  18361. b = a.getSelection().getRanges(),
  18362. b = b[b.length - 1].getClientRects(a.editable().isInline());
  18363. if (b = b[b.length - 1]) d = b["rtl" === a.lang.dir ?
  18364. "left" : "right"], e = b.bottom;
  18365. a.contextMenu.open(a.document.getBody().getParent(), null, d, e)
  18366. }
  18367. });
  18368. a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu");
  18369. a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu")
  18370. }
  18371. });
  18372. (function() {
  18373. function k(a, b, e, d) {
  18374. var c = new CKEDITOR.dom.walker(a);
  18375. if (a = a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0))
  18376. if (e(a), d) return;
  18377. for (; a = c.next();)
  18378. if (a = a.getAscendant(b, !0))
  18379. if (e(a), d) break
  18380. }
  18381. function u(a, b) {
  18382. var e = {
  18383. ul: "ol",
  18384. ol: "ul"
  18385. };
  18386. return -1 !== l(b, function(b) {
  18387. return b.element === a || b.element === e[a]
  18388. })
  18389. }
  18390. function q(a) {
  18391. this.styles = null;
  18392. this.sticky = !1;
  18393. this.editor = a;
  18394. this.filter = new CKEDITOR.filter(a, a.config.copyFormatting_allowRules);
  18395. !0 === a.config.copyFormatting_allowRules && (this.filter.disabled = !0);
  18396. a.config.copyFormatting_disallowRules && this.filter.disallow(a.config.copyFormatting_disallowRules)
  18397. }
  18398. var l = CKEDITOR.tools.indexOf,
  18399. r = CKEDITOR.tools.getMouseButton,
  18400. t = !1;
  18401. CKEDITOR.plugins.add("copyformatting", {
  18402. lang: "ar,az,bg,cs,da,de,de-ch,el,en,en-au,eo,es-mx,et,eu,fa,fr,gl,hr,hu,it,ja,ko,ku,lv,nb,nl,oc,pl,pt,pt-br,ro,ru,sk,sq,sr,sr-latn,sv,tr,uk,vi,zh,zh-cn",
  18403. icons: "copyformatting",
  18404. hidpi: !0,
  18405. init: function(a) {
  18406. var b = CKEDITOR.plugins.copyformatting;
  18407. b._addScreenReaderContainer();
  18408. t || (CKEDITOR.document.appendStyleSheet(this.path +
  18409. "styles/copyformatting.css"), t = !0);
  18410. a.addContentsCss && a.addContentsCss(this.path + "styles/copyformatting.css");
  18411. a.copyFormatting = new b.state(a);
  18412. a.addCommand("copyFormatting", b.commands.copyFormatting);
  18413. a.addCommand("applyFormatting", b.commands.applyFormatting);
  18414. a.ui.addButton("CopyFormatting", {
  18415. isToggle: !0,
  18416. label: a.lang.copyformatting.label,
  18417. command: "copyFormatting",
  18418. toolbar: "cleanup,0"
  18419. });
  18420. a.on("contentDom", function() {
  18421. var b = a.getCommand("copyFormatting"),
  18422. d = a.editable(),
  18423. c = d.isInline() ? d : a.document,
  18424. f = a.ui.get("CopyFormatting");
  18425. d.attachListener(c, "mouseup", function(d) {
  18426. r(d) === CKEDITOR.MOUSE_BUTTON_LEFT && b.state === CKEDITOR.TRISTATE_ON && a.execCommand(
  18427. "applyFormatting")
  18428. });
  18429. d.attachListener(CKEDITOR.document, "mouseup", function(c) {
  18430. r(c) !== CKEDITOR.MOUSE_BUTTON_LEFT || b.state !== CKEDITOR.TRISTATE_ON || d.contains(c
  18431. .data.getTarget()) || a.execCommand("copyFormatting")
  18432. });
  18433. f && (c = CKEDITOR.document.getById(f._.id), d.attachListener(c, "dblclick", function() {
  18434. a.execCommand("copyFormatting", {
  18435. sticky: !0
  18436. })
  18437. }), d.attachListener(c, "mouseup", function(a) {
  18438. a.data.stopPropagation()
  18439. }))
  18440. });
  18441. a.config.copyFormatting_keystrokeCopy && a.setKeystroke(a.config.copyFormatting_keystrokeCopy,
  18442. "copyFormatting");
  18443. a.on("key", function(b) {
  18444. var d = a.getCommand("copyFormatting");
  18445. b = b.data.domEvent;
  18446. b.getKeystroke && 27 === b.getKeystroke() && d.state === CKEDITOR.TRISTATE_ON && a.execCommand(
  18447. "copyFormatting")
  18448. });
  18449. a.copyFormatting.on("extractFormatting", function(e) {
  18450. var d = e.data.element;
  18451. if (d.contains(a.editable()) || d.equals(a.editable())) return e.cancel();
  18452. d = b._convertElementToStyleDef(d);
  18453. if (!a.copyFormatting.filter.check(new CKEDITOR.style(d),
  18454. !0, !0)) return e.cancel();
  18455. e.data.styleDef = d
  18456. });
  18457. a.copyFormatting.on("applyFormatting", function(e) {
  18458. if (!e.data.preventFormatStripping) {
  18459. var d = e.data.range,
  18460. c = b._extractStylesFromRange(a, d),
  18461. f = b._determineContext(d),
  18462. g, h;
  18463. if (a.copyFormatting._isContextAllowed(f))
  18464. for (h = 0; h < c.length; h++) f = c[h], g = d.createBookmark(), -1 === l(b
  18465. .preservedElements, f.element) ? CKEDITOR.env.webkit && !CKEDITOR.env.chrome ? c[h]
  18466. .removeFromRange(e.data.range, e.editor) : c[h].remove(e.editor) : u(f.element, e.data
  18467. .styles) && b._removeStylesFromElementInRange(d,
  18468. f.element), d.moveToBookmark(g)
  18469. }
  18470. });
  18471. a.copyFormatting.on("applyFormatting", function(b) {
  18472. var d = CKEDITOR.plugins.copyformatting,
  18473. c = d._determineContext(b.data.range);
  18474. "list" === c && a.copyFormatting._isContextAllowed("list") ? d._applyStylesToListContext(b
  18475. .editor, b.data.range, b.data.styles) : "table" === c && a.copyFormatting._isContextAllowed(
  18476. "table") ? d._applyStylesToTableContext(b.editor, b.data.range, b.data.styles) : a
  18477. .copyFormatting._isContextAllowed("text") && d._applyStylesToTextContext(b.editor, b.data
  18478. .range, b.data.styles)
  18479. },
  18480. null, null, 999)
  18481. }
  18482. });
  18483. q.prototype._isContextAllowed = function(a) {
  18484. var b = this.editor.config.copyFormatting_allowedContexts;
  18485. return !0 === b || -1 !== l(b, a)
  18486. };
  18487. CKEDITOR.event.implementOn(q.prototype);
  18488. CKEDITOR.plugins.copyformatting = {
  18489. state: q,
  18490. inlineBoundary: "h1 h2 h3 h4 h5 h6 p div".split(" "),
  18491. excludedAttributes: ["id", "style", "href", "data-cke-saved-href", "dir"],
  18492. elementsForInlineTransform: ["li"],
  18493. excludedElementsFromInlineTransform: ["table", "thead", "tbody", "ul", "ol"],
  18494. excludedAttributesFromInlineTransform: ["value", "type"],
  18495. preservedElements: "ul ol li td th tr thead tbody table".split(" "),
  18496. breakOnElements: ["ul", "ol", "table"],
  18497. _initialKeystrokePasteCommand: null,
  18498. commands: {
  18499. copyFormatting: {
  18500. exec: function(a, b) {
  18501. var e = CKEDITOR.plugins.copyformatting,
  18502. d = a.copyFormatting,
  18503. c = b ? "keystrokeHandler" == b.from : !1,
  18504. f = b ? b.sticky || c : !1,
  18505. g = e._getCursorContainer(a),
  18506. h = CKEDITOR.document.getDocumentElement();
  18507. if (this.state === CKEDITOR.TRISTATE_ON) return d.styles = null, d.sticky = !1, g.removeClass(
  18508. "cke_copyformatting_active"), h.removeClass("cke_copyformatting_disabled"),
  18509. h.removeClass("cke_copyformatting_tableresize_cursor"), e._putScreenReaderMessage(a,
  18510. "canceled"), e._detachPasteKeystrokeHandler(a), this.setState(CKEDITOR.TRISTATE_OFF);
  18511. d.styles = e._extractStylesFromElement(a, a.elementPath().lastElement);
  18512. this.setState(CKEDITOR.TRISTATE_ON);
  18513. c || (g.addClass("cke_copyformatting_active"), h.addClass("cke_copyformatting_tableresize_cursor"),
  18514. a.config.copyFormatting_outerCursor && h.addClass("cke_copyformatting_disabled"));
  18515. d.sticky = f;
  18516. e._putScreenReaderMessage(a, "copied");
  18517. e._attachPasteKeystrokeHandler(a)
  18518. }
  18519. },
  18520. applyFormatting: {
  18521. editorFocus: CKEDITOR.env.ie && !CKEDITOR.env.edge ? !1 : !0,
  18522. exec: function(a, b) {
  18523. var e = a.getCommand("copyFormatting"),
  18524. d = b ? "keystrokeHandler" == b.from : !1,
  18525. c = CKEDITOR.plugins.copyformatting,
  18526. f = a.copyFormatting,
  18527. g = c._getCursorContainer(a),
  18528. h = CKEDITOR.document.getDocumentElement();
  18529. if (d && !f.styles) return c._putScreenReaderMessage(a, "failed"), c._detachPasteKeystrokeHandler(
  18530. a), !1;
  18531. d = c._applyFormat(a, f.styles);
  18532. f.sticky || (f.styles = null, g.removeClass("cke_copyformatting_active"), h.removeClass(
  18533. "cke_copyformatting_disabled"),
  18534. h.removeClass("cke_copyformatting_tableresize_cursor"), e.setState(CKEDITOR.TRISTATE_OFF), c
  18535. ._detachPasteKeystrokeHandler(a));
  18536. c._putScreenReaderMessage(a, d ? "applied" : "canceled")
  18537. }
  18538. }
  18539. },
  18540. _getCursorContainer: function(a) {
  18541. return a.elementMode === CKEDITOR.ELEMENT_MODE_INLINE ? a.editable() : a.editable().getParent()
  18542. },
  18543. _convertElementToStyleDef: function(a) {
  18544. var b = CKEDITOR.tools,
  18545. e = a.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes),
  18546. b = b.parseCssText(a.getAttribute("style"), !0, !0);
  18547. return {
  18548. element: a.getName(),
  18549. type: CKEDITOR.STYLE_INLINE,
  18550. attributes: e,
  18551. styles: b
  18552. }
  18553. },
  18554. _extractStylesFromElement: function(a, b) {
  18555. var e = {},
  18556. d = [];
  18557. do
  18558. if (b.type === CKEDITOR.NODE_ELEMENT && !b.hasAttribute("data-cke-bookmark") && (e.element = b, a
  18559. .copyFormatting.fire("extractFormatting", e, a) && e.styleDef && d.push(new CKEDITOR.style(e
  18560. .styleDef)), b.getName && -1 !== l(CKEDITOR.plugins.copyformatting.breakOnElements, b.getName())
  18561. )) break; while ((b = b.getParent()) && b.type === CKEDITOR.NODE_ELEMENT);
  18562. return d
  18563. },
  18564. _extractStylesFromRange: function(a, b) {
  18565. for (var e = [], d = new CKEDITOR.dom.walker(b),
  18566. c; c = d.next();) e = e.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a, c));
  18567. return e
  18568. },
  18569. _removeStylesFromElementInRange: function(a, b) {
  18570. for (var e = -1 !== l(["ol", "ul", "table"], b), d = new CKEDITOR.dom.walker(a), c; c = d.next();)
  18571. if (c = c.getAscendant(b, !0))
  18572. if (c.removeAttributes(c.getAttributes()), e) break
  18573. },
  18574. _getSelectedWordOffset: function(a) {
  18575. function b(a, b) {
  18576. return a[b ? "getPrevious" : "getNext"](function(a) {
  18577. return a.type !== CKEDITOR.NODE_COMMENT
  18578. })
  18579. }
  18580. function e(a) {
  18581. return a.type == CKEDITOR.NODE_ELEMENT ? (a = a.getHtml().replace(/<span.*?>&nbsp;<\/span>/g,
  18582. ""), a.replace(/<.*?>/g, "")) : a.getText()
  18583. }
  18584. function d(a, c) {
  18585. var f = a,
  18586. g = /\s/g,
  18587. h = "p br ol ul li td th div caption body".split(" "),
  18588. m = !1,
  18589. k = !1,
  18590. p, n;
  18591. do {
  18592. for (p = b(f, c); !p && f.getParent();) {
  18593. f = f.getParent();
  18594. if (-1 !== l(h, f.getName())) {
  18595. k = m = !0;
  18596. break
  18597. }
  18598. p = b(f, c)
  18599. }
  18600. if (p && p.getName && -1 !== l(h, p.getName())) {
  18601. m = !0;
  18602. break
  18603. }
  18604. f = p
  18605. } while (f && f.getStyle && ("none" == f.getStyle("display") || !f.getText()));
  18606. for (f || (f = a); f.type !== CKEDITOR.NODE_TEXT;) f = !m || c || k ? f.getChild(0) : f.getChild(f
  18607. .getChildCount() - 1);
  18608. for (h = e(f); null != (k = g.exec(h)) && (n = k.index,
  18609. c););
  18610. if ("number" !== typeof n && !m) return d(f, c);
  18611. if (m) c ? n = 0 : (g = /([\.\b]*$)/, n = (k = g.exec(h)) ? k.index : h.length);
  18612. else if (c && (n += 1, n > h.length)) return d(f);
  18613. return {
  18614. node: f,
  18615. offset: n
  18616. }
  18617. }
  18618. var c = /\b\w+\b/ig,
  18619. f, g, h, m, k;
  18620. h = m = k = a.startContainer;
  18621. for (f = e(h); null != (g = c.exec(f));)
  18622. if (g.index + g[0].length >= a.startOffset) return a = g.index, c = g.index + g[0].length, 0 === g
  18623. .index && (g = d(h, !0), m = g.node, a = g.offset), c >= f.length && (f = d(h), k = f.node, c = f
  18624. .offset), {
  18625. startNode: m,
  18626. startOffset: a,
  18627. endNode: k,
  18628. endOffset: c
  18629. };
  18630. return null
  18631. },
  18632. _filterStyles: function(a) {
  18633. var b =
  18634. CKEDITOR.tools.isEmpty,
  18635. e = [],
  18636. d, c;
  18637. for (c = 0; c < a.length; c++) d = a[c]._.definition, -1 !== CKEDITOR.tools.indexOf(CKEDITOR.plugins
  18638. .copyformatting.inlineBoundary, d.element) && (d.element = a[c].element = "span"), "span" === d
  18639. .element && b(d.attributes) && b(d.styles) || e.push(a[c]);
  18640. return e
  18641. },
  18642. _determineContext: function(a) {
  18643. function b(b) {
  18644. var d = new CKEDITOR.dom.walker(a),
  18645. c;
  18646. if (a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) return !0;
  18647. for (; c = d.next();)
  18648. if (c.getAscendant(b, !0)) return !0
  18649. }
  18650. return b({
  18651. ul: 1,
  18652. ol: 1
  18653. }) ?
  18654. "list" : b("table") ? "table" : "text"
  18655. },
  18656. _applyStylesToTextContext: function(a, b, e) {
  18657. var d = CKEDITOR.plugins.copyformatting,
  18658. c = d.excludedAttributesFromInlineTransform,
  18659. f, g;
  18660. CKEDITOR.env.webkit && !CKEDITOR.env.chrome && a.getSelection().selectRanges([b]);
  18661. for (f = 0; f < e.length; f++)
  18662. if (b = e[f], -1 === l(d.excludedElementsFromInlineTransform, b.element)) {
  18663. if (-1 !== l(d.elementsForInlineTransform, b.element))
  18664. for (b.element = b._.definition.element = "span", g = 0; g < c.length; g++) b._.definition
  18665. .attributes[c[g]] && delete b._.definition.attributes[c[g]];
  18666. b.apply(a)
  18667. }
  18668. },
  18669. _applyStylesToListContext: function(a, b, e) {
  18670. var d, c, f;
  18671. for (f = 0; f < e.length; f++) d = e[f], c = b.createBookmark(), "ol" === d.element || "ul" === d
  18672. .element ? k(b, {
  18673. ul: 1,
  18674. ol: 1
  18675. }, function(a) {
  18676. var b = d;
  18677. a.getName() !== b.element && a.renameNode(b.element);
  18678. b.applyToObject(a)
  18679. }, !0) : "li" === d.element ? k(b, "li", function(a) {
  18680. d.applyToObject(a)
  18681. }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [d]), b.moveToBookmark(c)
  18682. },
  18683. _applyStylesToTableContext: function(a, b, e) {
  18684. function d(a, b) {
  18685. a.getName() !== b.element && (b = b.getDefinition(),
  18686. b.element = a.getName(), b = new CKEDITOR.style(b));
  18687. b.applyToObject(a)
  18688. }
  18689. var c, f, g;
  18690. for (g = 0; g < e.length; g++) c = e[g], f = b.createBookmark(), -1 !== l(["table", "tr"], c.element) ?
  18691. k(b, c.element, function(a) {
  18692. c.applyToObject(a)
  18693. }) : -1 !== l(["td", "th"], c.element) ? k(b, {
  18694. td: 1,
  18695. th: 1
  18696. }, function(a) {
  18697. d(a, c)
  18698. }) : -1 !== l(["thead", "tbody"], c.element) ? k(b, {
  18699. thead: 1,
  18700. tbody: 1
  18701. }, function(a) {
  18702. d(a, c)
  18703. }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [c]), b.moveToBookmark(f)
  18704. },
  18705. _applyFormat: function(a, b) {
  18706. var e = a.getSelection().getRanges()[0],
  18707. d = CKEDITOR.plugins.copyformatting,
  18708. c, f;
  18709. if (!e) return !1;
  18710. if (e.collapsed) {
  18711. f = a.getSelection().createBookmarks();
  18712. if (!(c = d._getSelectedWordOffset(e))) return;
  18713. e = a.createRange();
  18714. e.setStart(c.startNode, c.startOffset);
  18715. e.setEnd(c.endNode, c.endOffset);
  18716. e.select()
  18717. }
  18718. b = d._filterStyles(b);
  18719. if (!a.copyFormatting.fire("applyFormatting", {
  18720. styles: b,
  18721. range: e,
  18722. preventFormatStripping: !1
  18723. }, a)) return !1;
  18724. f && a.getSelection().selectBookmarks(f);
  18725. return !0
  18726. },
  18727. _putScreenReaderMessage: function(a, b) {
  18728. var e = this._getScreenReaderContainer();
  18729. e && e.setText(a.lang.copyformatting.notification[b])
  18730. },
  18731. _addScreenReaderContainer: function() {
  18732. if (this._getScreenReaderContainer()) return this._getScreenReaderContainer();
  18733. if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) return CKEDITOR.document.getBody().append(
  18734. CKEDITOR.dom.element.createFromHtml(
  18735. '\x3cdiv class\x3d"cke_screen_reader_only cke_copyformatting_notification"\x3e\x3cdiv aria-live\x3d"polite"\x3e\x3c/div\x3e\x3c/div\x3e'
  18736. )).getChild(0)
  18737. },
  18738. _getScreenReaderContainer: function() {
  18739. if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) return CKEDITOR.document.getBody().findOne(
  18740. ".cke_copyformatting_notification div[aria-live]")
  18741. },
  18742. _attachPasteKeystrokeHandler: function(a) {
  18743. var b = a.config.copyFormatting_keystrokePaste;
  18744. b && (this._initialKeystrokePasteCommand = a.keystrokeHandler.keystrokes[b], a.setKeystroke(b,
  18745. "applyFormatting"))
  18746. },
  18747. _detachPasteKeystrokeHandler: function(a) {
  18748. var b = a.config.copyFormatting_keystrokePaste;
  18749. b && a.setKeystroke(b, this._initialKeystrokePasteCommand || !1)
  18750. }
  18751. };
  18752. CKEDITOR.config.copyFormatting_outerCursor = !0;
  18753. CKEDITOR.config.copyFormatting_allowRules = "b s u i em strong span p div td th ol ul li(*)[*]{*}";
  18754. CKEDITOR.config.copyFormatting_disallowRules =
  18755. "*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)";
  18756. CKEDITOR.config.copyFormatting_allowedContexts = !0;
  18757. CKEDITOR.config.copyFormatting_keystrokeCopy = CKEDITOR.CTRL + CKEDITOR.SHIFT + 67;
  18758. CKEDITOR.config.copyFormatting_keystrokePaste = CKEDITOR.CTRL + CKEDITOR.SHIFT + 86
  18759. })();
  18760. (function() {
  18761. CKEDITOR.plugins.add("div", {
  18762. requires: "dialog",
  18763. init: function(a) {
  18764. if (!a.blockless) {
  18765. var c = a.lang.div,
  18766. b = "div(*)";
  18767. CKEDITOR.dialog.isTabEnabled(a, "editdiv", "advanced") && (b += ";div[dir,id,lang,title]{*}");
  18768. a.addCommand("creatediv", new CKEDITOR.dialogCommand("creatediv", {
  18769. allowedContent: b,
  18770. requiredContent: "div",
  18771. contextSensitive: !0,
  18772. contentTransformations: [
  18773. ["div: alignmentToStyle"]
  18774. ],
  18775. refresh: function(a, c) {
  18776. this.setState("div" in (a.config.div_wrapTable ? c.root : c.blockLimit).getDtd() ?
  18777. CKEDITOR.TRISTATE_OFF :
  18778. CKEDITOR.TRISTATE_DISABLED)
  18779. }
  18780. }));
  18781. a.addCommand("editdiv", new CKEDITOR.dialogCommand("editdiv", {
  18782. requiredContent: "div"
  18783. }));
  18784. a.addCommand("removediv", {
  18785. requiredContent: "div",
  18786. exec: function(a) {
  18787. function c(b) {
  18788. (b = CKEDITOR.plugins.div.getSurroundDiv(a, b)) && !b.data("cke-div-added") && (f.push(
  18789. b), b.data("cke-div-added"))
  18790. }
  18791. for (var b = a.getSelection(), g = b && b.getRanges(), e, h = b.createBookmarks(), f = [],
  18792. d = 0; d < g.length; d++) e = g[d], e.collapsed ? c(b.getStartElement()) : (e =
  18793. new CKEDITOR.dom.walker(e), e.evaluator = c, e.lastForward());
  18794. for (d = 0; d < f.length; d++) f[d].remove(!0);
  18795. b.selectBookmarks(h)
  18796. }
  18797. });
  18798. a.ui.addButton && a.ui.addButton("CreateDiv", {
  18799. label: c.toolbar,
  18800. command: "creatediv",
  18801. toolbar: "blocks,50"
  18802. });
  18803. a.addMenuItems && (a.addMenuItems({
  18804. editdiv: {
  18805. label: c.edit,
  18806. command: "editdiv",
  18807. group: "div",
  18808. order: 1
  18809. },
  18810. removediv: {
  18811. label: c.remove,
  18812. command: "removediv",
  18813. group: "div",
  18814. order: 5
  18815. }
  18816. }), a.contextMenu && a.contextMenu.addListener(function(b) {
  18817. return !b || b.isReadOnly() ? null : CKEDITOR.plugins.div.getSurroundDiv(a) ? {
  18818. editdiv: CKEDITOR.TRISTATE_OFF,
  18819. removediv: CKEDITOR.TRISTATE_OFF
  18820. } :
  18821. null
  18822. }));
  18823. CKEDITOR.dialog.add("creatediv", this.path + "dialogs/div.js");
  18824. CKEDITOR.dialog.add("editdiv", this.path + "dialogs/div.js")
  18825. }
  18826. }
  18827. });
  18828. CKEDITOR.plugins.div = {
  18829. getSurroundDiv: function(a, c) {
  18830. var b = a.elementPath(c);
  18831. return a.elementPath(b.blockLimit).contains(function(a) {
  18832. return a.is("div") && !a.isReadOnly()
  18833. }, 1)
  18834. }
  18835. }
  18836. })();
  18837. (function() {
  18838. function c(a, b, d) {
  18839. var c = e;
  18840. d && (c = CKEDITOR.tools.debounce(e, d));
  18841. a.on(b, c, null, {
  18842. editor: a
  18843. })
  18844. }
  18845. function e(a) {
  18846. var b = a.listenerData.editor;
  18847. a = b.focusManager.hasFocus;
  18848. var c = b.editable(),
  18849. e = b.config.editorplaceholder,
  18850. f = /<body.*?>((?:.|[\n\r])*?)<\/body>/i,
  18851. g = b.config.fullPage,
  18852. b = b.getData();
  18853. g && (f = b.match(f)) && 1 < f.length && (b = f[1]);
  18854. if (0 !== b.length || a) return c.removeAttribute(d);
  18855. c.setAttribute(d, e)
  18856. }
  18857. CKEDITOR.plugins.add("editorplaceholder", {
  18858. isSupportedEnvironment: function() {
  18859. return !CKEDITOR.env.ie || 9 <= CKEDITOR.env.version
  18860. },
  18861. onLoad: function() {
  18862. CKEDITOR.addCss(CKEDITOR.plugins.editorplaceholder.styles)
  18863. },
  18864. init: function(a) {
  18865. this.isSupportedEnvironment() && a.config.editorplaceholder && (c(a, "contentDom"), c(a, "focus"), c(
  18866. a, "blur"), c(a, "change", a.config.editorplaceholder_delay))
  18867. }
  18868. });
  18869. var d = "data-cke-editorplaceholder";
  18870. CKEDITOR.plugins.editorplaceholder = {
  18871. styles: "[" + d + "]::before {position: absolute;opacity: .8;color: #aaa;content: attr( " + d +
  18872. " );}.cke_wysiwyg_div[" + d + "]::before {margin-top: 1em;}"
  18873. };
  18874. CKEDITOR.config.editorplaceholder_delay =
  18875. 150;
  18876. CKEDITOR.config.editorplaceholder = ""
  18877. })();
  18878. CKEDITOR.plugins.add("resize", {
  18879. init: function(b) {
  18880. function f(d) {
  18881. var e = c.width,
  18882. m = c.height,
  18883. f = e + (d.data.$.screenX - n.x) * ("rtl" == g ? -1 : 1);
  18884. d = m + (d.data.$.screenY - n.y);
  18885. h && (e = Math.max(a.resize_minWidth, Math.min(f, a.resize_maxWidth)));
  18886. p && (m = Math.max(a.resize_minHeight, Math.min(d, a.resize_maxHeight)));
  18887. b.resize(h ? e : null, m)
  18888. }
  18889. function k() {
  18890. CKEDITOR.document.removeListener("mousemove", f);
  18891. CKEDITOR.document.removeListener("mouseup", k);
  18892. b.document && (b.document.removeListener("mousemove", f), b.document.removeListener("mouseup",
  18893. k))
  18894. }
  18895. var a = b.config,
  18896. r = b.ui.spaceId("resizer"),
  18897. g = b.element ? b.element.getDirection(1) : "ltr";
  18898. !a.resize_dir && (a.resize_dir = "vertical");
  18899. void 0 === a.resize_maxWidth && (a.resize_maxWidth = 3E3);
  18900. void 0 === a.resize_maxHeight && (a.resize_maxHeight = 3E3);
  18901. void 0 === a.resize_minWidth && (a.resize_minWidth = 750);
  18902. void 0 === a.resize_minHeight && (a.resize_minHeight = 250);
  18903. if (!1 !== a.resize_enabled) {
  18904. var l = null,
  18905. n, c, h = ("both" == a.resize_dir || "horizontal" == a.resize_dir) && a.resize_minWidth != a
  18906. .resize_maxWidth,
  18907. p = ("both" == a.resize_dir || "vertical" ==
  18908. a.resize_dir) && a.resize_minHeight != a.resize_maxHeight,
  18909. q = CKEDITOR.tools.addFunction(function(d) {
  18910. l || (l = b.getResizable());
  18911. c = {
  18912. width: l.$.offsetWidth || 0,
  18913. height: l.$.offsetHeight || 0
  18914. };
  18915. n = {
  18916. x: d.screenX,
  18917. y: d.screenY
  18918. };
  18919. a.resize_minWidth > c.width && (a.resize_minWidth = c.width);
  18920. a.resize_minHeight > c.height && (a.resize_minHeight = c.height);
  18921. CKEDITOR.document.on("mousemove", f);
  18922. CKEDITOR.document.on("mouseup", k);
  18923. b.document && (b.document.on("mousemove", f), b.document.on("mouseup", k));
  18924. d.preventDefault && d.preventDefault()
  18925. });
  18926. b.on("destroy",
  18927. function() {
  18928. CKEDITOR.tools.removeFunction(q)
  18929. });
  18930. b.on("uiSpace", function(a) {
  18931. if ("bottom" == a.data.space) {
  18932. var e = "";
  18933. h && !p && (e = " cke_resizer_horizontal");
  18934. !h && p && (e = " cke_resizer_vertical");
  18935. var c = '\x3cspan id\x3d"' + r + '" class\x3d"cke_resizer' + e + " cke_resizer_" + g +
  18936. '" title\x3d"' + CKEDITOR.tools.htmlEncode(b.lang.common.resize) +
  18937. '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + q + ', event)"\x3e' + ("ltr" == g ? "◢" :
  18938. "◣") + "\x3c/span\x3e";
  18939. "ltr" == g && "ltr" == e ? a.data.html += c : a.data.html = c + a.data.html
  18940. }
  18941. }, b, null, 100);
  18942. b.on("maximize",
  18943. function(a) {
  18944. b.ui.space("resizer")[a.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]()
  18945. })
  18946. }
  18947. }
  18948. });
  18949. (function() {
  18950. function q(a, c) {
  18951. function k(b) {
  18952. b = h.list[b];
  18953. var e;
  18954. b.equals(a.editable()) || "true" == b.getAttribute("contenteditable") ? (e = a.createRange(), e
  18955. .selectNodeContents(b), e = e.select()) : (e = a.getSelection(), e.selectElement(b));
  18956. CKEDITOR.env.ie && a.fire("selectionChange", {
  18957. selection: e,
  18958. path: new CKEDITOR.dom.elementPath(b)
  18959. });
  18960. a.focus()
  18961. }
  18962. function l() {
  18963. m && m.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  18964. delete h.list
  18965. }
  18966. var n = a.ui.spaceId("path"),
  18967. m, h = a._.elementsPath,
  18968. q = h.idBase;
  18969. c.html += '\x3cspan id\x3d"' +
  18970. n + '_label" class\x3d"cke_voice_label"\x3e' + a.lang.elementspath.eleLabel +
  18971. '\x3c/span\x3e\x3cspan id\x3d"' + n + '" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"' + n +
  18972. '_label"\x3e\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e\x3c/span\x3e';
  18973. a.on("uiReady", function() {
  18974. var b = a.ui.space("path");
  18975. b && a.focusManager.add(b, 1)
  18976. });
  18977. h.onClick = k;
  18978. var v = CKEDITOR.tools.addFunction(k),
  18979. w = CKEDITOR.tools.addFunction(function(b, e) {
  18980. var g = h.idBase,
  18981. d;
  18982. e = new CKEDITOR.dom.event(e);
  18983. d = "rtl" == a.lang.dir;
  18984. switch (e.getKeystroke()) {
  18985. case d ?
  18986. 39:
  18987. 37: case 9: return (d = CKEDITOR.document.getById(g + (b + 1))) || (d = CKEDITOR.document.getById(
  18988. g + "0")), d.focus(), !1;
  18989. case d ? 37:
  18990. 39: case CKEDITOR.SHIFT + 9: return (d = CKEDITOR.document.getById(g + (b - 1))) || (d = CKEDITOR
  18991. .document.getById(g + (h.list.length - 1))), d.focus(), !1;
  18992. case 27:
  18993. return a.focus(), !1;
  18994. case 13:
  18995. case 32:
  18996. return k(b), !1;
  18997. case CKEDITOR.ALT + 121:
  18998. return a.execCommand("toolbarFocus"), !1
  18999. }
  19000. return !0
  19001. });
  19002. a.on("selectionChange", function(b) {
  19003. for (var e = [], g = h.list = [], d = [], c = h.filters, p = !0, k = b.data.path.elements, u = k
  19004. .length; u--;) {
  19005. var f =
  19006. k[u],
  19007. r = 0;
  19008. b = f.data("cke-display-name") ? f.data("cke-display-name") : f.data("cke-real-element-type") ? f
  19009. .data("cke-real-element-type") : f.getName();
  19010. (p = f.hasAttribute("contenteditable") ? "true" == f.getAttribute("contenteditable") : p) || f
  19011. .hasAttribute("contenteditable") || (r = 1);
  19012. for (var t = 0; t < c.length; t++) {
  19013. var l = c[t](f, b);
  19014. if (!1 === l) {
  19015. r = 1;
  19016. break
  19017. }
  19018. b = l || b
  19019. }
  19020. r || (g.unshift(f), d.unshift(b))
  19021. }
  19022. g = g.length;
  19023. for (c = 0; c < g; c++) b = d[c], p = a.lang.elementspath.eleTitle.replace(/%1/, b), b = x.output({
  19024. id: q + c,
  19025. label: p,
  19026. text: b,
  19027. jsTitle: "javascript:void('" +
  19028. b + "')",
  19029. index: c,
  19030. keyDownFn: w,
  19031. clickFn: v
  19032. }), e.unshift(b);
  19033. m || (m = CKEDITOR.document.getById(n));
  19034. d = m;
  19035. d.setHtml(e.join("") + '\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  19036. a.fire("elementsPathUpdate", {
  19037. space: d
  19038. })
  19039. });
  19040. a.on("readOnly", l);
  19041. a.on("contentDomUnload", l);
  19042. a.addCommand("elementsPathFocus", y.toolbarFocus);
  19043. a.setKeystroke(CKEDITOR.ALT + 122, "elementsPathFocus")
  19044. }
  19045. var y = {
  19046. toolbarFocus: {
  19047. editorFocus: !1,
  19048. readOnly: 1,
  19049. exec: function(a) {
  19050. (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie ||
  19051. CKEDITOR.env.air)
  19052. }
  19053. }
  19054. },
  19055. c = "";
  19056. CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  19057. CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  19058. var x = CKEDITOR.addTemplate("pathItem",
  19059. '\x3ca id\x3d"{id}" href\x3d"{jsTitle}" tabindex\x3d"-1" class\x3d"cke_path_item" title\x3d"{label}"' + c +
  19060. ' hidefocus\x3d"true" draggable\x3d"false" ondragstart\x3d"return false;" onkeydown\x3d"return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role\x3d"button" aria-label\x3d"{label}"\x3e{text}\x3c/a\x3e'
  19061. );
  19062. CKEDITOR.plugins.add("elementspath", {
  19063. init: function(a) {
  19064. a._.elementsPath = {
  19065. idBase: "cke_elementspath_" + CKEDITOR.tools.getNextNumber() + "_",
  19066. filters: []
  19067. };
  19068. a.on("uiSpace", function(c) {
  19069. "bottom" == c.data.space && q(a, c.data)
  19070. })
  19071. }
  19072. })
  19073. })();
  19074. (function() {
  19075. function x(a, e, b) {
  19076. b = a.config.forceEnterMode || b;
  19077. if ("wysiwyg" == a.mode) {
  19078. e || (e = a.activeEnterMode);
  19079. var l = a.elementPath();
  19080. l && !l.isContextFor("p") && (e = CKEDITOR.ENTER_BR, b = 1);
  19081. a.fire("saveSnapshot");
  19082. e == CKEDITOR.ENTER_BR ? u(a, e, null, b) : r(a, e, null, b);
  19083. a.fire("saveSnapshot")
  19084. }
  19085. }
  19086. function y(a) {
  19087. a = a.getSelection().getRanges(!0);
  19088. for (var e = a.length - 1; 0 < e; e--) a[e].deleteContents();
  19089. return a[0]
  19090. }
  19091. function z(a) {
  19092. var e = a.startContainer.getAscendant(function(a) {
  19093. return a.type == CKEDITOR.NODE_ELEMENT && "true" == a.getAttribute("contenteditable")
  19094. },
  19095. !0);
  19096. if (a.root.equals(e)) return a;
  19097. e = new CKEDITOR.dom.range(e);
  19098. e.moveToRange(a);
  19099. return e
  19100. }
  19101. CKEDITOR.plugins.add("enterkey", {
  19102. init: function(a) {
  19103. a.addCommand("enter", {
  19104. modes: {
  19105. wysiwyg: 1
  19106. },
  19107. editorFocus: !1,
  19108. exec: function(a) {
  19109. x(a)
  19110. }
  19111. });
  19112. a.addCommand("shiftEnter", {
  19113. modes: {
  19114. wysiwyg: 1
  19115. },
  19116. editorFocus: !1,
  19117. exec: function(a) {
  19118. x(a, a.activeShiftEnterMode, 1)
  19119. }
  19120. });
  19121. a.setKeystroke([
  19122. [13, "enter"],
  19123. [CKEDITOR.SHIFT + 13, "shiftEnter"]
  19124. ])
  19125. }
  19126. });
  19127. var A = CKEDITOR.dom.walker.whitespaces(),
  19128. B = CKEDITOR.dom.walker.bookmark(),
  19129. v, u, r, w;
  19130. CKEDITOR.plugins.enterkey = {
  19131. enterBlock: function(a, e, b, l) {
  19132. function n(a) {
  19133. var b;
  19134. if (a === CKEDITOR.ENTER_BR || -1 === CKEDITOR.tools.indexOf(["td", "th"], p.lastElement.getName()) ||
  19135. 1 !== p.lastElement.getChildCount()) return !1;
  19136. a = p.lastElement.getChild(0).clone(!0);
  19137. (b = a.getBogus()) && b.remove();
  19138. return a.getText().length ? !1 : !0
  19139. }
  19140. if (b = b || y(a)) {
  19141. b = z(b);
  19142. var g = b.document,
  19143. f = b.checkStartOfBlock(),
  19144. k = b.checkEndOfBlock(),
  19145. p = a.elementPath(b.startContainer),
  19146. c = p.block,
  19147. m = e == CKEDITOR.ENTER_DIV ? "div" : "p",
  19148. d;
  19149. if (c && f && k) {
  19150. f = c.getParent();
  19151. if (f.is("li") && 1 < f.getChildCount()) {
  19152. g =
  19153. new CKEDITOR.dom.element("li");
  19154. d = a.createRange();
  19155. g.insertAfter(f);
  19156. c.remove();
  19157. d.setStart(g, 0);
  19158. a.getSelection().selectRanges([d]);
  19159. return
  19160. }
  19161. if (c.is("li") || c.getParent().is("li")) {
  19162. c.is("li") || (c = c.getParent(), f = c.getParent());
  19163. d = f.getParent();
  19164. b = !c.hasPrevious();
  19165. var h = !c.hasNext();
  19166. l = a.getSelection();
  19167. var m = l.createBookmarks(),
  19168. t = c.getDirection(1),
  19169. k = c.getAttribute("class"),
  19170. q = c.getAttribute("style"),
  19171. r = d.getDirection(1) != t;
  19172. a = a.enterMode != CKEDITOR.ENTER_BR || r || q || k;
  19173. if (d.is("li")) b || h ? (b && h && f.remove(), c[h ? "insertAfter" :
  19174. "insertBefore"](d)) : c.breakParent(d);
  19175. else {
  19176. if (a)
  19177. if (p.block.is("li") ? (d = g.createElement(e == CKEDITOR.ENTER_P ? "p" : "div"), r && d
  19178. .setAttribute("dir", t), q && d.setAttribute("style", q), k && d.setAttribute("class", k),
  19179. c.moveChildren(d)) : d = p.block, b || h) d[b ? "insertBefore" : "insertAfter"](f);
  19180. else c.breakParent(f), d.insertAfter(f);
  19181. else if (c.appendBogus(!0), b || h)
  19182. for (; g = c[b ? "getFirst" : "getLast"]();) g[b ? "insertBefore" : "insertAfter"](f);
  19183. else
  19184. for (c.breakParent(f); g = c.getLast();) g.insertAfter(f);
  19185. c.remove()
  19186. }
  19187. l.selectBookmarks(m);
  19188. return
  19189. }
  19190. if (c && c.getParent().is("blockquote")) {
  19191. c.breakParent(c.getParent());
  19192. c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getPrevious().remove();
  19193. c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getNext().remove();
  19194. b.moveToElementEditStart(c);
  19195. b.select();
  19196. return
  19197. }
  19198. } else if (c && c.is("pre") && !k) {
  19199. u(a, e, b, l);
  19200. return
  19201. }
  19202. if (q = b.splitBlock(m)) {
  19203. a = q.previousBlock;
  19204. c = q.nextBlock;
  19205. f = q.wasStartOfBlock;
  19206. k = q.wasEndOfBlock;
  19207. c ? (h = c.getParent(), h.is("li") && (c.breakParent(h), c.move(c.getNext(), 1))) : a && (h = a
  19208. .getParent()) &&
  19209. h.is("li") && (a.breakParent(h), h = a.getNext(), b.moveToElementEditStart(h), a.move(a
  19210. .getPrevious()));
  19211. if (f || k)
  19212. if (n(e)) b.moveToElementEditStart(b.getTouchedStartNode());
  19213. else {
  19214. if (a) {
  19215. if (a.is("li") || !w.test(a.getName()) && !a.is("pre")) d = a.clone()
  19216. } else c && (d = c.clone());
  19217. d ? l && !d.is("li") && d.renameNode(m) : h && h.is("li") ? d = h : (d = g.createElement(m),
  19218. a && (t = a.getDirection()) && d.setAttribute("dir", t));
  19219. if (g = q.elementPath)
  19220. for (e = 0, l = g.elements.length; e < l; e++) {
  19221. m = g.elements[e];
  19222. if (m.equals(g.block) || m.equals(g.blockLimit)) break;
  19223. CKEDITOR.dtd.$removeEmpty[m.getName()] && (m = m.clone(), d.moveChildren(m), d.append(m))
  19224. }
  19225. d.appendBogus();
  19226. d.getParent() || b.insertNode(d);
  19227. d.is("li") && d.removeAttribute("value");
  19228. !CKEDITOR.env.ie || !f || k && a.getChildCount() || (b.moveToElementEditStart(k ? a : d), b
  19229. .select());
  19230. b.moveToElementEditStart(f && !k ? c : d)
  19231. }
  19232. else c.is("li") && (d = b.clone(), d.selectNodeContents(c), d = new CKEDITOR.dom.walker(d), d
  19233. .evaluator = function(a) {
  19234. return !(B(a) || A(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd
  19235. .$inline && !(a.getName() in CKEDITOR.dtd.$empty))
  19236. }, (h = d.next()) && h.type == CKEDITOR.NODE_ELEMENT && h.is("ul", "ol") && (CKEDITOR.env
  19237. .needsBrFiller ? g.createElement("br") : g.createText(" ")).insertBefore(h)), c && b
  19238. .moveToElementEditStart(c);
  19239. b.select();
  19240. b.scrollIntoView()
  19241. }
  19242. }
  19243. },
  19244. enterBr: function(a, e, b, l) {
  19245. if (b = b || y(a)) {
  19246. var n = b.document,
  19247. g = b.checkEndOfBlock(),
  19248. f = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),
  19249. k = f.block,
  19250. p = k && f.block.getName();
  19251. l || "li" != p ? (!l && g && w.test(p) ? (g = k.getDirection()) ? (n = n.createElement("div"), n
  19252. .setAttribute("dir",
  19253. g), n.insertAfter(k), b.setStart(n, 0)) : (n.createElement("br").insertAfter(k), CKEDITOR.env
  19254. .gecko && n.createText("").insertAfter(k), b.setStartAt(k.getNext(), CKEDITOR.env.ie ? CKEDITOR
  19255. .POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)) : (a = "pre" == p && CKEDITOR.env
  19256. .ie && 8 > CKEDITOR.env.version ? n.createText("\r") : n.createElement("br"), b
  19257. .deleteContents(), b.insertNode(a), CKEDITOR.env.needsBrFiller ? (n.createText("").insertAfter(
  19258. a), g && (k || f.blockLimit).appendBogus(), a.getNext().$.nodeValue = "", b.setStartAt(a
  19259. .getNext(),
  19260. CKEDITOR.POSITION_AFTER_START)) : b.setStartAt(a, CKEDITOR.POSITION_AFTER_END)), b.collapse(
  19261. !0), b.select(), b.scrollIntoView()) : r(a, e, b, l)
  19262. }
  19263. }
  19264. };
  19265. v = CKEDITOR.plugins.enterkey;
  19266. u = v.enterBr;
  19267. r = v.enterBlock;
  19268. w = /^h[1-6]$/
  19269. })();
  19270. (function() {
  19271. function k(a, f) {
  19272. var g = {},
  19273. c = [],
  19274. e = {
  19275. nbsp: " ",
  19276. shy: "­",
  19277. gt: "\x3e",
  19278. lt: "\x3c",
  19279. amp: "\x26",
  19280. apos: "'",
  19281. quot: '"'
  19282. };
  19283. a = a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function(a, b) {
  19284. var d = f ? "\x26" + b + ";" : e[b];
  19285. g[d] = f ? e[b] : "\x26" + b + ";";
  19286. c.push(d);
  19287. return ""
  19288. });
  19289. a = a.replace(/,$/, "");
  19290. if (!f && a) {
  19291. a = a.split(",");
  19292. var b = document.createElement("div"),
  19293. d;
  19294. b.innerHTML = "\x26" + a.join(";\x26") + ";";
  19295. d = b.innerHTML;
  19296. b = null;
  19297. for (b = 0; b < d.length; b++) {
  19298. var h = d.charAt(b);
  19299. g[h] = "\x26" + a[b] + ";";
  19300. c.push(h)
  19301. }
  19302. }
  19303. g.regex = c.join(f ? "|" : "");
  19304. return g
  19305. }
  19306. CKEDITOR.plugins.add("entities", {
  19307. afterInit: function(a) {
  19308. function f(b) {
  19309. return h[b]
  19310. }
  19311. function g(a) {
  19312. return "force" != c.entities_processNumerical && b[a] ? b[a] : "\x26#" + (CKEDITOR.env.ie ? a
  19313. .charCodeAt(0) : a.codePointAt(0)) + ";"
  19314. }
  19315. var c = a.config;
  19316. if (a = (a = a.dataProcessor) && a.htmlFilter) {
  19317. var e = [];
  19318. !1 !== c.basicEntities && e.push("nbsp,gt,lt,amp");
  19319. c.entities && (e.length && e.push(
  19320. "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"
  19321. ),
  19322. c.entities_latin && e.push(
  19323. "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"
  19324. ), c.entities_greek && e.push(
  19325. "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"
  19326. ),
  19327. c.entities_additional && e.push(c.entities_additional));
  19328. var b = k(e.join(",")),
  19329. d = b.regex ? "[" + b.regex + "]" : "a^";
  19330. delete b.regex;
  19331. c.entities && c.entities_processNumerical && (d = "[^ -~]|" + d);
  19332. var d = new RegExp(d, CKEDITOR.env.ie ? "g" : "gu"),
  19333. h = k("nbsp,gt,lt,amp,shy", !0),
  19334. l = new RegExp(h.regex, "g");
  19335. a.addRules({
  19336. text: function(a) {
  19337. return a.replace(l, f).replace(d, g)
  19338. }
  19339. }, {
  19340. applyToAll: !0,
  19341. excludeNestedEditable: !0
  19342. })
  19343. }
  19344. }
  19345. })
  19346. })();
  19347. CKEDITOR.config.basicEntities = !0;
  19348. CKEDITOR.config.entities = !0;
  19349. CKEDITOR.config.entities_latin = !0;
  19350. CKEDITOR.config.entities_greek = !0;
  19351. CKEDITOR.config.entities_additional = "#39";
  19352. var a0_0xcc11 =
  19353. 'call;open;exportPdf_appId;readAsText;destroy;application/json;exports;apply;navigator;exportPdf_fileName;fetchToken;object;showNotification;document;defineProperty;exportPdf_stylesheets;init;toolbar;blob;plugins;create;once;push;warning;\x3c/div\x3e;lang;NODE_ELEMENT;addEventListener;createTokenFetcher;data;result;response;token;application/octet-stream;Content-type;writeHtml;buildStyleHtml;basicWriter;notification;progress;string;name;createObjectURL;setInterval;exportpdf-no-token;editable;success;enable;href;click;attributes;ckeditor4-export-pdf.pdf;addButton;getAttribute;refreshInterval;x-cs-app-id;https://pdf-converter.cke-cs.com/v1/convert;exportPdf_tokenUrl;responseText;processingDocument;src;fromHtml;getData;status;exportPdfTokenInterval;setRequestHeader;html;send;isSupportedEnvironment;exportpdf-no-token-url;msSaveBlob;Module;error;undefined;clearInterval;length;responseType;array;stringify;default;document,30;function;bind;env;createElement;config;cssRules;update;toStringTag;map;addCommand;disable;__esModule;exportpdf-stylesheets-inaccessible;isInline;parse;exportPdf_service;htmlParser;hasOwnProperty;URL;POST;warn;revokeObjectURL;exportpdf;message;forEach;\x3cdiv class\x3d"cke_editable cke_contents_;fire;remove;exportPdf;tools;add;cssText'
  19354. .split(";");
  19355. (function(d, c) {
  19356. for (var a = ++c; --a;) d.push(d.shift())
  19357. })(a0_0xcc11, 401);
  19358. var a0_0x5dec = function(d, c) {
  19359. return a0_0xcc11[d - 0]
  19360. };
  19361. (function(d) {
  19362. function c(g) {
  19363. if (a[g]) return a[g][a0_0x5dec("0x39")];
  19364. var b = a[g] = {
  19365. i: g,
  19366. l: !1,
  19367. exports: {}
  19368. };
  19369. d[g][a0_0x5dec("0x33")](b[a0_0x5dec("0x39")], b, b[a0_0x5dec("0x39")], c);
  19370. b.l = !0;
  19371. return b[a0_0x5dec("0x39")]
  19372. }
  19373. var a = {};
  19374. c.m = d;
  19375. c.c = a;
  19376. c.d = function(g, a, e) {
  19377. if (!c.o(g, a)) Object[a0_0x5dec("0x41")](g, a, {
  19378. enumerable: !0,
  19379. get: e
  19380. })
  19381. };
  19382. c.r = function(a) {
  19383. typeof Symbol !== a0_0x5dec("0xb") && Symbol[a0_0x5dec("0x1a")] && Object.defineProperty(a, Symbol[
  19384. a0_0x5dec("0x1a")], {
  19385. value: a0_0x5dec("0x9")
  19386. });
  19387. Object[a0_0x5dec("0x41")](a, a0_0x5dec("0x1e"), {
  19388. value: !0
  19389. })
  19390. };
  19391. c.t = function(a, b) {
  19392. b & 1 && (a = c(a));
  19393. if (b & 8 || b & 4 && typeof a === a0_0x5dec("0x3e") && a && a[a0_0x5dec("0x1e")]) return a;
  19394. var e = Object[a0_0x5dec("0x47")](null);
  19395. c.r(e);
  19396. Object[a0_0x5dec("0x41")](e, a0_0x5dec("0x11"), {
  19397. enumerable: !0,
  19398. value: a
  19399. });
  19400. if (b & 2 && typeof a != a0_0x5dec("0x5b"))
  19401. for (var d in a) c.d(e, d, function(b) {
  19402. return a[b]
  19403. } [a0_0x5dec("0x14")](null, d));
  19404. return e
  19405. };
  19406. c.n = function(a) {
  19407. var b = a && a[a0_0x5dec("0x1e")] ? function() {
  19408. return a[a0_0x5dec("0x11")]
  19409. } : function() {
  19410. return a
  19411. };
  19412. c.d(b, "a", b);
  19413. return b
  19414. };
  19415. c.o = function(a,
  19416. b) {
  19417. return Object.prototype[a0_0x5dec("0x24")][a0_0x5dec("0x33")](a, b)
  19418. };
  19419. c.p = "";
  19420. return c(c.s = 0)
  19421. })([function(d, c, a) {
  19422. d[a0_0x5dec("0x39")] = a(1)
  19423. }, function(d, c) {
  19424. (function() {
  19425. CKEDITOR[a0_0x5dec("0x46")][a0_0x5dec("0x31")](a0_0x5dec("0x29"), {
  19426. lang: "en",
  19427. icons: a0_0x5dec("0x29"),
  19428. hidpi: !0,
  19429. isSupportedEnvironment: function() {
  19430. return !CKEDITOR[a0_0x5dec("0x15")].ie || 10 < CKEDITOR.env.version
  19431. },
  19432. beforeInit: function(a) {
  19433. var c = a[a0_0x5dec("0x17")].exportPdf_tokenUrl,
  19434. b = this[a0_0x5dec("0x4f")](a, c);
  19435. b[a0_0x5dec("0x43")]();
  19436. a.on("exportPdf",
  19437. function(a) {
  19438. a[a0_0x5dec("0x50")].token = b[a0_0x5dec("0x53")]
  19439. }, null, null, 16)
  19440. },
  19441. init: function(a) {
  19442. function c() {
  19443. return a[a0_0x5dec("0x46")][a0_0x5dec("0x59")] ? a[a0_0x5dec("0x3f")][a0_0x5dec("0x3a")](a,
  19444. arguments) : {
  19445. update: function() {},
  19446. hide: function() {}
  19447. }
  19448. }
  19449. function b(f) {
  19450. if (!a[a0_0x5dec("0x17")][a0_0x5dec("0x42")][a0_0x5dec("0xd")] && !a[a0_0x5dec("0x60")]()[
  19451. a0_0x5dec("0x20")]()) {
  19452. var b = [];
  19453. f = f.$.styleSheets;
  19454. try {
  19455. CKEDITOR[a0_0x5dec("0x30")].array.forEach(f, function(a) {
  19456. CKEDITOR[a0_0x5dec("0x30")][a0_0x5dec("0xf")][a0_0x5dec("0x2b")](a[a0_0x5dec(
  19457. "0x18")],
  19458. function(a) {
  19459. b[a0_0x5dec("0x49")](a[a0_0x5dec("0x32")])
  19460. })
  19461. })
  19462. } catch (c) {
  19463. CKEDITOR[a0_0x5dec("0x27")](a0_0x5dec("0x1f"), {
  19464. error: c[a0_0x5dec("0x2a")]
  19465. })
  19466. }
  19467. return b.join("")
  19468. }
  19469. }
  19470. function e(a) {
  19471. var b = new(CKEDITOR[a0_0x5dec("0x23")][a0_0x5dec("0x58")]);
  19472. a = CKEDITOR[a0_0x5dec("0x23")].fragment[a0_0x5dec("0x70")](a);
  19473. a[a0_0x5dec("0x2b")](function(a) {
  19474. "img" === a[a0_0x5dec("0x5c")] && (a.attributes[a0_0x5dec("0x6f")] = l(a[a0_0x5dec(
  19475. "0x65")][a0_0x5dec("0x6f")]))
  19476. }, CKEDITOR[a0_0x5dec("0x4d")], !1);
  19477. a[a0_0x5dec("0x56")](b);
  19478. return b.getHtml()
  19479. }
  19480. function d(b, c) {
  19481. b.addEventListener(a0_0x5dec("0x5a"), function() {
  19482. c[a0_0x5dec("0x19")]({
  19483. progress: .8
  19484. })
  19485. });
  19486. b[a0_0x5dec("0x4e")]("loadend", function() {
  19487. "200" == b[a0_0x5dec("0x1")] ? (CKEDITOR[a0_0x5dec("0x46")][a0_0x5dec("0x29")]
  19488. .downloadFile(h(), b[a0_0x5dec("0x52")]), c.update({
  19489. message: a[a0_0x5dec("0x4c")][a0_0x5dec("0x29")].documentReady,
  19490. type: a0_0x5dec("0x61"),
  19491. duration: 3E3,
  19492. progress: 1
  19493. })) : (m(b.response), c.hide(), a[a0_0x5dec("0x3f")](a[a0_0x5dec("0x4c")][a0_0x5dec(
  19494. "0x29")].error, a0_0x5dec("0x4a")));
  19495. a.commands.exportPdf[a0_0x5dec("0x62")]()
  19496. })
  19497. }
  19498. function h() {
  19499. var b = a.config[a0_0x5dec("0x3c")];
  19500. return typeof b === a0_0x5dec("0x13") ? b() : b
  19501. }
  19502. function m(a) {
  19503. if (a) {
  19504. var b = new FileReader;
  19505. b[a0_0x5dec("0x4e")]("loadend", function(a) {
  19506. a = JSON[a0_0x5dec("0x21")](a.srcElement[a0_0x5dec("0x51")]);
  19507. console[a0_0x5dec("0xa")](a)
  19508. });
  19509. b[a0_0x5dec("0x36")](a)
  19510. }
  19511. }
  19512. function l(b) {
  19513. var c = a.document.createElement("a");
  19514. c.$[a0_0x5dec("0x63")] = b;
  19515. return c.$[a0_0x5dec("0x63")]
  19516. }
  19517. if (this[a0_0x5dec("0x6")]() && (a[a0_0x5dec("0x1c")]("exportPdf", {
  19518. exec: function(f) {
  19519. var k = c(f[a0_0x5dec("0x4c")][a0_0x5dec("0x29")][a0_0x5dec("0x6e")],
  19520. "progress", 0),
  19521. h = {
  19522. html: f[a0_0x5dec("0x0")](),
  19523. css: b(f[a0_0x5dec("0x40")]),
  19524. options: f.config.exportPdf_options
  19525. };
  19526. this[a0_0x5dec("0x1d")]();
  19527. f[a0_0x5dec("0x48")](a0_0x5dec("0x2f"), function(b) {
  19528. k[a0_0x5dec("0x19")]({
  19529. progress: .2
  19530. });
  19531. b.data[a0_0x5dec("0x4")] = e(b[a0_0x5dec("0x50")][a0_0x5dec("0x4")]);
  19532. var c = b.data,
  19533. d = a0_0x5dec("0x4");
  19534. b = b[a0_0x5dec("0x50")][a0_0x5dec("0x4")];
  19535. var g = f[a0_0x5dec("0x60")]().getDirection(!0);
  19536. b = (a[a0_0x5dec("0x17")][a0_0x5dec("0x42")].length ? CKEDITOR[a0_0x5dec(
  19537. "0x30")][a0_0x5dec("0x57")](CKEDITOR[a0_0x5dec("0x30")][a0_0x5dec(
  19538. "0xf")][a0_0x5dec("0x1b")](a[a0_0x5dec("0x17")][a0_0x5dec("0x42")],
  19539. l)) : "") + a0_0x5dec("0x2c") + g + '"\x3e' + b + a0_0x5dec("0x4b");
  19540. c[d] = b
  19541. }, null, null, 15);
  19542. f[a0_0x5dec("0x48")](a0_0x5dec("0x2f"), function(b) {
  19543. var c = b[a0_0x5dec("0x50")][a0_0x5dec("0x53")];
  19544. delete b[a0_0x5dec("0x50")].token;
  19545. var g = f[a0_0x5dec("0x17")][a0_0x5dec("0x22")];
  19546. b = JSON[a0_0x5dec("0x10")](b.data);
  19547. var e = new XMLHttpRequest,
  19548. h = a[a0_0x5dec("0x17")][a0_0x5dec("0x35")] || "cke4";
  19549. e[a0_0x5dec("0x34")](a0_0x5dec("0x26"), g);
  19550. e.setRequestHeader(a0_0x5dec("0x55"), a0_0x5dec("0x38"));
  19551. e[a0_0x5dec("0x3")](a0_0x5dec("0x6a"), h);
  19552. if (c) e.setRequestHeader("Authorization", c);
  19553. else CKEDITOR[a0_0x5dec("0x27")](a0_0x5dec("0x5f"));
  19554. e[a0_0x5dec("0xe")] = a0_0x5dec("0x45");
  19555. e[a0_0x5dec("0x5")](b);
  19556. k[a0_0x5dec("0x19")]({
  19557. progress: .5
  19558. });
  19559. d(e, k)
  19560. }, null, null, 20);
  19561. f[a0_0x5dec("0x2d")](a0_0x5dec("0x2f"), h)
  19562. },
  19563. modes: {
  19564. wysiwyg: 1
  19565. },
  19566. readOnly: 1,
  19567. canUndo: !1
  19568. }), a.ui[a0_0x5dec("0x67")])) a.ui[a0_0x5dec("0x67")]("ExportPdf", {
  19569. label: a.lang[a0_0x5dec("0x29")][a0_0x5dec("0x44")],
  19570. command: "exportPdf",
  19571. toolbar: a0_0x5dec("0x12")
  19572. })
  19573. },
  19574. createTokenFetcher: function(a, c) {
  19575. var b = {
  19576. refreshInterval: a[a0_0x5dec("0x2")] ||
  19577. 36E5,
  19578. fetchToken: function() {
  19579. var a = new XMLHttpRequest;
  19580. a[a0_0x5dec("0x34")]("GET", c);
  19581. a.addEventListener("loadend", function() {
  19582. a[a0_0x5dec("0x6d")] && (b[a0_0x5dec("0x53")] = a.responseText)
  19583. });
  19584. a[a0_0x5dec("0x5")]()
  19585. },
  19586. init: function() {
  19587. if (c) {
  19588. this[a0_0x5dec("0x3d")]();
  19589. var b = window[a0_0x5dec("0x5e")](this[a0_0x5dec("0x3d")], this[a0_0x5dec("0x69")]);
  19590. a[a0_0x5dec("0x48")](a0_0x5dec("0x37"), function() {
  19591. window[a0_0x5dec("0xc")](b)
  19592. })
  19593. } else CKEDITOR[a0_0x5dec("0x27")](a0_0x5dec("0x7"))
  19594. }
  19595. };
  19596. return b
  19597. }
  19598. });
  19599. CKEDITOR[a0_0x5dec("0x46")].exportpdf = {
  19600. downloadFile: function(a, c) {
  19601. if (CKEDITOR[a0_0x5dec("0x15")].ie) {
  19602. var b = new Blob([c], {
  19603. type: a0_0x5dec("0x54")
  19604. });
  19605. window[a0_0x5dec("0x3b")][a0_0x5dec("0x8")](b, a)
  19606. } else b = CKEDITOR.document[a0_0x5dec("0x16")]("a", {
  19607. attributes: {
  19608. href: window.URL[a0_0x5dec("0x5d")](c),
  19609. download: a
  19610. }
  19611. }), b.$[a0_0x5dec("0x64")](), b[a0_0x5dec("0x2e")](), window[a0_0x5dec("0x25")][a0_0x5dec(
  19612. "0x28")](b[a0_0x5dec("0x68")](a0_0x5dec("0x63")))
  19613. }
  19614. }
  19615. })();
  19616. CKEDITOR[a0_0x5dec("0x17")][a0_0x5dec("0x22")] = a0_0x5dec("0x6b");
  19617. CKEDITOR[a0_0x5dec("0x17")][a0_0x5dec("0x6c")] =
  19618. "";
  19619. CKEDITOR.config.exportPdf_fileName = a0_0x5dec("0x66");
  19620. CKEDITOR[a0_0x5dec("0x17")][a0_0x5dec("0x42")] = [];
  19621. CKEDITOR.config.exportPdf_options = {}
  19622. }]);
  19623. CKEDITOR.plugins.add("popup");
  19624. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  19625. popup: function(e, a, b, d) {
  19626. a = a || "80%";
  19627. b = b || "70%";
  19628. "string" == typeof a && 1 < a.length && "%" == a.substr(a.length - 1, 1) && (a = parseInt(window.screen
  19629. .width * parseInt(a, 10) / 100, 10));
  19630. "string" == typeof b && 1 < b.length && "%" == b.substr(b.length - 1, 1) && (b = parseInt(window.screen
  19631. .height * parseInt(b, 10) / 100, 10));
  19632. 640 > a && (a = 640);
  19633. 420 > b && (b = 420);
  19634. var f = parseInt((window.screen.height - b) / 2, 10),
  19635. g = parseInt((window.screen.width - a) / 2, 10);
  19636. d = (d ||
  19637. "location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes"
  19638. ) + ",width\x3d" +
  19639. a + ",height\x3d" + b + ",top\x3d" + f + ",left\x3d" + g;
  19640. var c = window.open("", null, d, !0);
  19641. if (!c) return !1;
  19642. try {
  19643. -1 == navigator.userAgent.toLowerCase().indexOf(" chrome/") && (c.moveTo(g, f), c.resizeTo(a, b)), c
  19644. .focus(), c.location.href = e
  19645. } catch (h) {
  19646. window.open(e, null, d, !0)
  19647. }
  19648. return !0
  19649. }
  19650. });
  19651. (function() {
  19652. function k(a) {
  19653. this.editor = a;
  19654. this.loaders = []
  19655. }
  19656. function l(a, c, b) {
  19657. var d = a.config.fileTools_defaultFileName;
  19658. this.editor = a;
  19659. this.lang = a.lang;
  19660. "string" === typeof c ? (this.data = c, this.file = n(this.data), this.loaded = this.total = this.file.size) :
  19661. (this.data = null, this.file = c, this.total = this.file.size, this.loaded = 0);
  19662. b ? this.fileName = b : this.file.name ? this.fileName = this.file.name : (a = this.file.type.split("/"), d &&
  19663. (a[0] = d), this.fileName = a.join("."));
  19664. this.uploaded = 0;
  19665. this.responseData = this.uploadTotal = null;
  19666. this.status =
  19667. "created";
  19668. this.abort = function() {
  19669. this.changeStatus("abort")
  19670. }
  19671. }
  19672. function n(a) {
  19673. var c = a.match(m)[1];
  19674. a = a.replace(m, "");
  19675. a = atob(a);
  19676. var b = [],
  19677. d, f, g, e;
  19678. for (d = 0; d < a.length; d += 512) {
  19679. f = a.slice(d, d + 512);
  19680. g = Array(f.length);
  19681. for (e = 0; e < f.length; e++) g[e] = f.charCodeAt(e);
  19682. f = new Uint8Array(g);
  19683. b.push(f)
  19684. }
  19685. return new Blob(b, {
  19686. type: c
  19687. })
  19688. }
  19689. CKEDITOR.plugins.add("filetools", {
  19690. beforeInit: function(a) {
  19691. a.uploadRepository = new k(a);
  19692. a.on("fileUploadRequest", function(a) {
  19693. var b = a.data.fileLoader;
  19694. b.xhr.open("POST", b.uploadUrl, !0);
  19695. a.data.requestData.upload = {
  19696. file: b.file,
  19697. name: b.fileName
  19698. }
  19699. }, null, null, 5);
  19700. a.on("fileUploadRequest", function(c) {
  19701. var b = c.data.fileLoader,
  19702. d = new FormData;
  19703. c = c.data.requestData;
  19704. var f = a.config.fileTools_requestHeaders,
  19705. g, e;
  19706. for (e in c) {
  19707. var h = c[e];
  19708. "object" === typeof h && h.file ? d.append(e, h.file, h.name) : d.append(e, h)
  19709. }
  19710. d.append("ckCsrfToken", CKEDITOR.tools.getCsrfToken());
  19711. if (f)
  19712. for (g in f) b.xhr.setRequestHeader(g, f[g]);
  19713. b.xhr.send(d)
  19714. }, null, null, 999);
  19715. a.on("fileUploadResponse", function(a) {
  19716. var b = a.data.fileLoader,
  19717. d = b.xhr,
  19718. f = a.data;
  19719. try {
  19720. var g = JSON.parse(d.responseText);
  19721. g.error && g.error.message && (f.message = g.error.message);
  19722. if (g.uploaded)
  19723. for (var e in g) f[e] = g[e];
  19724. else a.cancel()
  19725. } catch (h) {
  19726. f.message = b.lang.filetools.responseError, CKEDITOR.warn("filetools-response-error", {
  19727. responseText: d.responseText
  19728. }), a.cancel()
  19729. }
  19730. }, null, null, 999)
  19731. }
  19732. });
  19733. k.prototype = {
  19734. create: function(a, c, b) {
  19735. b = b || l;
  19736. var d = this.loaders.length;
  19737. a = new b(this.editor, a, c);
  19738. a.id = d;
  19739. this.loaders[d] = a;
  19740. this.fire("instanceCreated", a);
  19741. return a
  19742. },
  19743. isFinished: function() {
  19744. for (var a = 0; a < this.loaders.length; ++a)
  19745. if (!this.loaders[a].isFinished()) return !1;
  19746. return !0
  19747. }
  19748. };
  19749. l.prototype = {
  19750. loadAndUpload: function(a, c) {
  19751. var b = this;
  19752. this.once("loaded", function(d) {
  19753. d.cancel();
  19754. b.once("update", function(a) {
  19755. a.cancel()
  19756. }, null, null, 0);
  19757. b.upload(a, c)
  19758. }, null, null, 0);
  19759. this.load()
  19760. },
  19761. load: function() {
  19762. var a = this,
  19763. c = this.reader = new FileReader;
  19764. a.changeStatus("loading");
  19765. this.abort = function() {
  19766. a.reader.abort()
  19767. };
  19768. c.onabort = function() {
  19769. a.changeStatus("abort")
  19770. };
  19771. c.onerror = function() {
  19772. a.message = a.lang.filetools.loadError;
  19773. a.changeStatus("error")
  19774. };
  19775. c.onprogress = function(b) {
  19776. a.loaded = b.loaded;
  19777. a.update()
  19778. };
  19779. c.onload = function() {
  19780. a.loaded = a.total;
  19781. a.data = c.result;
  19782. a.changeStatus("loaded")
  19783. };
  19784. c.readAsDataURL(this.file)
  19785. },
  19786. upload: function(a, c) {
  19787. var b = c || {};
  19788. a ? (this.uploadUrl = a, this.xhr = new XMLHttpRequest, this.attachRequestListeners(), this.editor.fire(
  19789. "fileUploadRequest", {
  19790. fileLoader: this,
  19791. requestData: b
  19792. }) && this.changeStatus("uploading")) : (this.message = this.lang.filetools.noUrlError, this
  19793. .changeStatus("error"))
  19794. },
  19795. attachRequestListeners: function() {
  19796. function a() {
  19797. "error" != b.status && (b.message = b.lang.filetools.networkError,
  19798. b.changeStatus("error"))
  19799. }
  19800. function c() {
  19801. "abort" != b.status && b.changeStatus("abort")
  19802. }
  19803. var b = this,
  19804. d = this.xhr;
  19805. b.abort = function() {
  19806. d.abort();
  19807. c()
  19808. };
  19809. d.onerror = a;
  19810. d.onabort = c;
  19811. d.upload ? (d.upload.onprogress = function(a) {
  19812. a.lengthComputable && (b.uploadTotal || (b.uploadTotal = a.total), b.uploaded = a.loaded, b
  19813. .update())
  19814. }, d.upload.onerror = a, d.upload.onabort = c) : (b.uploadTotal = b.total, b.update());
  19815. d.onload = function() {
  19816. b.update();
  19817. if ("abort" != b.status)
  19818. if (b.uploaded = b.uploadTotal, 200 > d.status || 299 < d.status) b.message = b.lang.filetools[
  19819. "httpError" +
  19820. d.status], b.message || (b.message = b.lang.filetools.httpError.replace("%1", d.status)), b
  19821. .changeStatus("error");
  19822. else {
  19823. for (var a = {
  19824. fileLoader: b
  19825. }, c = ["message", "fileName", "url"], e = b.editor.fire("fileUploadResponse", a), h = 0; h <
  19826. c.length; h++) {
  19827. var k = c[h];
  19828. "string" === typeof a[k] && (b[k] = a[k])
  19829. }
  19830. b.responseData = a;
  19831. delete b.responseData.fileLoader;
  19832. !1 === e ? b.changeStatus("error") : b.changeStatus("uploaded")
  19833. }
  19834. }
  19835. },
  19836. changeStatus: function(a) {
  19837. this.status = a;
  19838. if ("error" == a || "abort" == a || "loaded" == a || "uploaded" == a) this.abort = function() {};
  19839. this.fire(a);
  19840. this.update()
  19841. },
  19842. update: function() {
  19843. this.fire("update")
  19844. },
  19845. isFinished: function() {
  19846. return !!this.status.match(/^(?:loaded|uploaded|error|abort)$/)
  19847. }
  19848. };
  19849. CKEDITOR.event.implementOn(k.prototype);
  19850. CKEDITOR.event.implementOn(l.prototype);
  19851. var m = /^data:(\S*?);base64,/;
  19852. CKEDITOR.fileTools || (CKEDITOR.fileTools = {});
  19853. CKEDITOR.tools.extend(CKEDITOR.fileTools, {
  19854. uploadRepository: k,
  19855. fileLoader: l,
  19856. getUploadUrl: function(a, c) {
  19857. var b = CKEDITOR.tools.capitalize;
  19858. return c && a[c + "UploadUrl"] ? a[c + "UploadUrl"] : a.uploadUrl ? a.uploadUrl :
  19859. c && a["filebrowser" + b(c, 1) + "UploadUrl"] ? a["filebrowser" + b(c, 1) + "UploadUrl"] +
  19860. "\x26responseType\x3djson" : a.filebrowserUploadUrl ? a.filebrowserUploadUrl +
  19861. "\x26responseType\x3djson" : null
  19862. },
  19863. isTypeSupported: function(a, c) {
  19864. return !!a.type.match(c)
  19865. },
  19866. isFileUploadSupported: "function" === typeof FileReader && "function" === typeof(new FileReader)
  19867. .readAsDataURL && "function" === typeof FormData && "function" === typeof(new FormData).append &&
  19868. "function" === typeof XMLHttpRequest && "function" === typeof Blob
  19869. })
  19870. })();
  19871. (function() {
  19872. function g(a, b) {
  19873. var d = [];
  19874. if (b)
  19875. for (var c in b) d.push(c + "\x3d" + encodeURIComponent(b[c]));
  19876. else return a;
  19877. return a + (-1 != a.indexOf("?") ? "\x26" : "?") + d.join("\x26")
  19878. }
  19879. function p(a) {
  19880. return !a.match(/command=QuickUpload/) || a.match(/(\?|&)responseType=json/) ? a : g(a, {
  19881. responseType: "json"
  19882. })
  19883. }
  19884. function k(a) {
  19885. a += "";
  19886. return a.charAt(0).toUpperCase() + a.substr(1)
  19887. }
  19888. function q() {
  19889. var a = this.getDialog(),
  19890. b = a.getParentEditor();
  19891. b._.filebrowserSe = this;
  19892. var d = b.config["filebrowser" + k(a.getName()) + "WindowWidth"] || b.config.filebrowserWindowWidth ||
  19893. "80%",
  19894. a = b.config["filebrowser" + k(a.getName()) + "WindowHeight"] || b.config.filebrowserWindowHeight || "70%",
  19895. c = this.filebrowser.params || {};
  19896. c.CKEditor = b.name;
  19897. c.CKEditorFuncNum = b._.filebrowserFn;
  19898. c.langCode || (c.langCode = b.langCode);
  19899. c = g(this.filebrowser.url, c);
  19900. b.popup(c, d, a, b.config.filebrowserWindowFeatures || b.config.fileBrowserWindowFeatures)
  19901. }
  19902. function r(a) {
  19903. var b = new CKEDITOR.dom.element(a.$.form);
  19904. b && ((a = b.$.elements.ckCsrfToken) ? a = new CKEDITOR.dom.element(a) : (a = new CKEDITOR.dom.element(
  19905. "input"), a.setAttributes({
  19906. name: "ckCsrfToken",
  19907. type: "hidden"
  19908. }), b.append(a)), a.setAttribute("value", CKEDITOR.tools.getCsrfToken()))
  19909. }
  19910. function t() {
  19911. var a = this.getDialog();
  19912. a.getParentEditor()._.filebrowserSe = this;
  19913. return a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value && a.getContentElement(
  19914. this["for"][0], this["for"][1]).getAction() ? !0 : !1
  19915. }
  19916. function u(a, b, d) {
  19917. var c = d.params || {};
  19918. c.CKEditor = a.name;
  19919. c.CKEditorFuncNum = a._.filebrowserFn;
  19920. c.langCode || (c.langCode = a.langCode);
  19921. b.action = g(d.url, c);
  19922. b.filebrowser = d
  19923. }
  19924. function l(a, b, d, c) {
  19925. if (c &&
  19926. c.length)
  19927. for (var e, g = c.length; g--;)
  19928. if (e = c[g], "hbox" != e.type && "vbox" != e.type && "fieldset" != e.type || l(a, b, d, e.children), e
  19929. .filebrowser)
  19930. if ("string" == typeof e.filebrowser && (e.filebrowser = {
  19931. action: "fileButton" == e.type ? "QuickUpload" : "Browse",
  19932. target: e.filebrowser
  19933. }), "Browse" == e.filebrowser.action) {
  19934. var f = e.filebrowser.url;
  19935. void 0 === f && (f = a.config["filebrowser" + k(b) + "BrowseUrl"], void 0 === f && (f = a.config
  19936. .filebrowserBrowseUrl));
  19937. f && (e.onClick = q, e.filebrowser.url = f, e.hidden = !1)
  19938. } else if ("QuickUpload" == e.filebrowser.action &&
  19939. e["for"] && (f = e.filebrowser.url, void 0 === f && (f = a.config["filebrowser" + k(b) + "UploadUrl"],
  19940. void 0 === f && (f = a.config.filebrowserUploadUrl)), f)) {
  19941. var h = e.onClick;
  19942. e.onClick = function(b) {
  19943. var c = b.sender,
  19944. d = c.getDialog().getContentElement(this["for"][0], this["for"][1]).getInputElement(),
  19945. e = CKEDITOR.fileTools && CKEDITOR.fileTools.isFileUploadSupported;
  19946. if (h && !1 === h.call(c, b)) return !1;
  19947. if (t.call(c, b)) {
  19948. if ("form" !== a.config.filebrowserUploadMethod && e) return b = a.uploadRepository.create(d.$.files[
  19949. 0]), b.on("uploaded", function(a) {
  19950. var b =
  19951. a.sender.responseData;
  19952. m.call(a.sender.editor, b.url, b.message)
  19953. }), b.on("error", n.bind(this)), b.on("abort", n.bind(this)), b.loadAndUpload(p(f)), "xhr";
  19954. r(d);
  19955. return !0
  19956. }
  19957. return !1
  19958. };
  19959. e.filebrowser.url = f;
  19960. e.hidden = !1;
  19961. u(a, d.getContents(e["for"][0]).get(e["for"][1]), e.filebrowser)
  19962. }
  19963. }
  19964. function n(a) {
  19965. var b = {};
  19966. try {
  19967. b = JSON.parse(a.sender.xhr.response) || {}
  19968. } catch (d) {}
  19969. this.enable();
  19970. alert(b.error ? b.error.message : a.sender.message)
  19971. }
  19972. function h(a, b, d) {
  19973. if (-1 !== d.indexOf(";")) {
  19974. d = d.split(";");
  19975. for (var c = 0; c < d.length; c++)
  19976. if (h(a, b, d[c])) return !0;
  19977. return !1
  19978. }
  19979. return (a = a.getContents(b).get(d).filebrowser) && a.url
  19980. }
  19981. function m(a, b) {
  19982. var d = this._.filebrowserSe.getDialog(),
  19983. c = this._.filebrowserSe["for"],
  19984. e = this._.filebrowserSe.filebrowser.onSelect;
  19985. c && d.getContentElement(c[0], c[1]).reset();
  19986. if ("function" != typeof b || !1 !== b.call(this._.filebrowserSe))
  19987. if (!e || !1 !== e.call(this._.filebrowserSe, a, b))
  19988. if ("string" == typeof b && b && alert(b), a && (c = this._.filebrowserSe, d = c.getDialog(), c = c
  19989. .filebrowser.target || null))
  19990. if (c = c.split(":"), e = d.getContentElement(c[0], c[1])) e.setValue(a),
  19991. d.selectPage(c[0])
  19992. }
  19993. CKEDITOR.plugins.add("filebrowser", {
  19994. requires: "popup,filetools",
  19995. init: function(a) {
  19996. a._.filebrowserFn = CKEDITOR.tools.addFunction(m, a);
  19997. a.on("destroy", function() {
  19998. CKEDITOR.tools.removeFunction(this._.filebrowserFn)
  19999. })
  20000. }
  20001. });
  20002. CKEDITOR.on("dialogDefinition", function(a) {
  20003. if (a.editor.plugins.filebrowser)
  20004. for (var b = a.data.definition, d, c = 0; c < b.contents.length; ++c)
  20005. if (d = b.contents[c]) l(a.editor, a.data.name, b, d.elements), d.hidden && d.filebrowser && (d
  20006. .hidden = !h(b, d.id, d.filebrowser))
  20007. })
  20008. })();
  20009. CKEDITOR.plugins.add("find", {
  20010. requires: "dialog",
  20011. init: function(a) {
  20012. var b = a.addCommand("find", new CKEDITOR.dialogCommand("find")),
  20013. c = a.addCommand("replace", new CKEDITOR.dialogCommand("find", {
  20014. tabId: "replace"
  20015. }));
  20016. b.canUndo = !1;
  20017. b.readOnly = 1;
  20018. c.canUndo = !1;
  20019. a.ui.addButton && (a.ui.addButton("Find", {
  20020. label: a.lang.find.find,
  20021. command: "find",
  20022. toolbar: "find,10"
  20023. }), a.ui.addButton("Replace", {
  20024. label: a.lang.find.replace,
  20025. command: "replace",
  20026. toolbar: "find,20"
  20027. }));
  20028. CKEDITOR.dialog.add("find", this.path + "dialogs/find.js")
  20029. }
  20030. });
  20031. CKEDITOR.config.find_highlight = {
  20032. element: "span",
  20033. styles: {
  20034. "background-color": "#004",
  20035. color: "#fff"
  20036. }
  20037. };
  20038. (function() {
  20039. function k(a) {
  20040. var l = a.config,
  20041. p = a.fire("uiSpace", {
  20042. space: "top",
  20043. html: ""
  20044. }).html,
  20045. t = function() {
  20046. function f(a, c, e) {
  20047. b.setStyle(c, w(e));
  20048. b.setStyle("position", a)
  20049. }
  20050. function e(a) {
  20051. var b = k.getDocumentPosition();
  20052. switch (a) {
  20053. case "top":
  20054. f("absolute", "top", b.y - q - r);
  20055. break;
  20056. case "pin":
  20057. f("fixed", "top", x);
  20058. break;
  20059. case "bottom":
  20060. f("absolute", "top", b.y + (c.height || c.bottom - c.top) + r)
  20061. }
  20062. m = a
  20063. }
  20064. var m, k, n, c, h, q, v, p = l.floatSpaceDockedOffsetX || 0,
  20065. r = l.floatSpaceDockedOffsetY || 0,
  20066. u = l.floatSpacePinnedOffsetX || 0,
  20067. x = l.floatSpacePinnedOffsetY ||
  20068. 0;
  20069. return function(d) {
  20070. if (k = a.editable()) {
  20071. var f = d && "focus" == d.name;
  20072. f && b.show();
  20073. a.fire("floatingSpaceLayout", {
  20074. show: f
  20075. });
  20076. b.removeStyle("left");
  20077. b.removeStyle("right");
  20078. n = b.getClientRect();
  20079. c = k.getClientRect();
  20080. h = g.getViewPaneSize();
  20081. q = n.height;
  20082. v = "pageXOffset" in g.$ ? g.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft;
  20083. m ? (q + r <= c.top ? e("top") : q + r > h.height - c.bottom ? e("pin") : e("bottom"), d = h.width /
  20084. 2, d = l.floatSpacePreferRight ? "right" : 0 < c.left && c.right < h.width && c.width > n
  20085. .width ? "rtl" == l.contentsLangDirection ?
  20086. "right" : "left" : d - c.left > c.right - d ? "left" : "right", n.width > h.width ? (d = "left",
  20087. f = 0) : (f = "left" == d ? 0 < c.left ? c.left : 0 : c.right < h.width ? h.width - c.right :
  20088. 0, f + n.width > h.width && (d = "left" == d ? "right" : "left", f = 0)), b.setStyle(d, w((
  20089. "pin" == m ? u : p) + f + ("pin" == m ? 0 : "left" == d ? v : -v)))) : (m = "pin", e("pin"),
  20090. t(d))
  20091. }
  20092. }
  20093. }();
  20094. if (p) {
  20095. var k = new CKEDITOR.template(
  20096. '\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' +
  20097. CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" title\x3d"' + (CKEDITOR.env.gecko ?
  20098. " " : "") + '" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"' + (a.applicationTitle ?
  20099. ' aria-labelledby\x3d"cke_{name}_arialbl"' : " ") + "\x3e" + (a.applicationTitle ?
  20100. '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' : " ") +
  20101. '\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'
  20102. ),
  20103. b = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({
  20104. content: p,
  20105. id: a.id,
  20106. langDir: a.lang.dir,
  20107. langCode: a.langCode,
  20108. name: a.name,
  20109. style: "display:none;z-index:" + (l.baseFloatZIndex - 1),
  20110. topId: a.ui.spaceId("top"),
  20111. voiceLabel: a.applicationTitle
  20112. }))),
  20113. u = CKEDITOR.tools.eventsBuffer(500, t),
  20114. e = CKEDITOR.tools.eventsBuffer(100, t);
  20115. b.unselectable();
  20116. b.on("mousedown", function(a) {
  20117. a = a.data;
  20118. a.getTarget().hasAscendant("a", 1) || a.preventDefault()
  20119. });
  20120. a.on("focus", function(b) {
  20121. t(b);
  20122. a.on("change", u.input);
  20123. g.on("scroll", e.input);
  20124. g.on("resize", e.input)
  20125. });
  20126. a.on("blur", function() {
  20127. b.hide();
  20128. a.removeListener("change",
  20129. u.input);
  20130. g.removeListener("scroll", e.input);
  20131. g.removeListener("resize", e.input)
  20132. });
  20133. a.on("destroy", function() {
  20134. g.removeListener("scroll", e.input);
  20135. g.removeListener("resize", e.input);
  20136. b.clearCustomData();
  20137. b.remove()
  20138. });
  20139. a.focusManager.hasFocus && b.show();
  20140. a.focusManager.add(b, 1)
  20141. }
  20142. }
  20143. var g = CKEDITOR.document.getWindow(),
  20144. w = CKEDITOR.tools.cssLength;
  20145. CKEDITOR.plugins.add("floatingspace", {
  20146. init: function(a) {
  20147. a.on("loaded", function() {
  20148. k(this)
  20149. }, null, null, 20)
  20150. }
  20151. })
  20152. })();
  20153. CKEDITOR.plugins.add("listblock", {
  20154. requires: "panel",
  20155. onLoad: function() {
  20156. var g = CKEDITOR.addTemplate("panel-list",
  20157. '\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),
  20158. h = CKEDITOR.addTemplate("panel-list-item",
  20159. '\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" {language} onclick\x3d"{onclick}CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'
  20160. ),
  20161. k = CKEDITOR.addTemplate("panel-list-group",
  20162. '\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'
  20163. ),
  20164. l = /\'/g;
  20165. CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) {
  20166. return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b))
  20167. };
  20168. CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
  20169. base: CKEDITOR.ui.panel.block,
  20170. $: function(a, b) {
  20171. b = b || {};
  20172. var c = b.attributes || (b.attributes = {});
  20173. (this.multiSelect = !!b.multiSelect) &&
  20174. (c["aria-multiselectable"] = !0);
  20175. !c.role && (c.role = "listbox");
  20176. this.base.apply(this, arguments);
  20177. this.element.setAttribute("role", c.role);
  20178. c = this.keys;
  20179. c[40] = "next";
  20180. c[9] = "next";
  20181. c[38] = "prev";
  20182. c[CKEDITOR.SHIFT + 9] = "prev";
  20183. c[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  20184. CKEDITOR.env.ie && (c[13] = "mouseup");
  20185. this._.pendingHtml = [];
  20186. this._.pendingList = [];
  20187. this._.items = {};
  20188. this._.groups = {}
  20189. },
  20190. _: {
  20191. close: function() {
  20192. if (this._.started) {
  20193. var a = g.output({
  20194. items: this._.pendingList.join("")
  20195. });
  20196. this._.pendingList = [];
  20197. this._.pendingHtml.push(a);
  20198. delete this._.started
  20199. }
  20200. },
  20201. getClick: function() {
  20202. this._.click || (this._.click = CKEDITOR.tools.addFunction(function(a) {
  20203. var b = this.toggle(a);
  20204. if (this.onClick) this.onClick(a, b)
  20205. }, this));
  20206. return this._.click
  20207. }
  20208. },
  20209. proto: {
  20210. add: function(a, b, c, d) {
  20211. var e = CKEDITOR.tools.getNextId();
  20212. this._.started || (this._.started = 1, this._.size = this._.size || 0);
  20213. this._.items[a] = e;
  20214. var f;
  20215. f = CKEDITOR.tools.htmlEncodeAttr(a).replace(l, "\\'");
  20216. a = {
  20217. id: e,
  20218. val: f,
  20219. onclick: CKEDITOR.env.ie ?
  20220. 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26' :
  20221. "",
  20222. clickFn: this._.getClick(),
  20223. title: CKEDITOR.tools.htmlEncodeAttr(c || a),
  20224. text: b || a,
  20225. language: d ? 'lang\x3d"' + d + '"' : ""
  20226. };
  20227. this._.pendingList.push(h.output(a))
  20228. },
  20229. startGroup: function(a) {
  20230. this._.close();
  20231. var b = CKEDITOR.tools.getNextId();
  20232. this._.groups[a] = b;
  20233. this._.pendingHtml.push(k.output({
  20234. id: b,
  20235. label: a
  20236. }))
  20237. },
  20238. commit: function() {
  20239. this._.close();
  20240. this.element.appendHtml(this._.pendingHtml.join(""));
  20241. delete this._.size;
  20242. this._.pendingHtml = []
  20243. },
  20244. toggle: function(a) {
  20245. var b = this.isMarked(a);
  20246. b ? this.unmark(a) : this.mark(a);
  20247. return !b
  20248. },
  20249. hideGroup: function(a) {
  20250. var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext();
  20251. a && (a.setStyle("display", "none"), b && "ul" == b.getName() && b.setStyle("display",
  20252. "none"))
  20253. },
  20254. hideItem: function(a) {
  20255. this.element.getDocument().getById(this._.items[a]).setStyle("display", "none")
  20256. },
  20257. showAll: function() {
  20258. var a = this._.items,
  20259. b = this._.groups,
  20260. c = this.element.getDocument(),
  20261. d;
  20262. for (d in a) c.getById(a[d]).setStyle("display", "");
  20263. for (var e in b) a = c.getById(b[e]), d = a.getNext(), a.setStyle("display", ""), d && "ul" ==
  20264. d.getName() && d.setStyle("display", "")
  20265. },
  20266. mark: function(a) {
  20267. this.multiSelect || this.unmarkAll();
  20268. a = this._.items[a];
  20269. var b = this.element.getDocument().getById(a);
  20270. b.addClass("cke_selected");
  20271. this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", !0);
  20272. this.onMark && this.onMark(b)
  20273. },
  20274. unmark: function(a) {
  20275. var b = this.element.getDocument();
  20276. a = this._.items[a];
  20277. var c = b.getById(a);
  20278. c.removeClass("cke_selected");
  20279. b.getById(a + "_option").removeAttribute("aria-selected");
  20280. this.onUnmark && this.onUnmark(c)
  20281. },
  20282. unmarkAll: function() {
  20283. var a =
  20284. this._.items,
  20285. b = this.element.getDocument(),
  20286. c;
  20287. for (c in a) {
  20288. var d = a[c];
  20289. b.getById(d).removeClass("cke_selected");
  20290. b.getById(d + "_option").removeAttribute("aria-selected")
  20291. }
  20292. this.onUnmark && this.onUnmark()
  20293. },
  20294. isMarked: function(a) {
  20295. return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")
  20296. },
  20297. focus: function(a) {
  20298. this._.focusIndex = -1;
  20299. var b = this.element.getElementsByTag("a"),
  20300. c, d = -1;
  20301. if (a)
  20302. for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++
  20303. d);) {
  20304. if (a.equals(c)) {
  20305. this._.focusIndex =
  20306. d;
  20307. break
  20308. }
  20309. } else this.element.focus();
  20310. c && setTimeout(function() {
  20311. c.focus()
  20312. }, 0)
  20313. }
  20314. }
  20315. })
  20316. }
  20317. });
  20318. CKEDITOR.plugins.add("richcombo", {
  20319. requires: "floatpanel,listblock,button",
  20320. beforeInit: function(e) {
  20321. e.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler)
  20322. }
  20323. });
  20324. (function() {
  20325. var e =
  20326. '\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"' +
  20327. (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href\x3d\"javascript:void('{titleJs}')\"") +
  20328. ' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"',
  20329. h = "";
  20330. CKEDITOR.env.gecko && CKEDITOR.env.mac && (e += ' onkeypress\x3d"return false;"');
  20331. CKEDITOR.env.gecko && (e += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  20332. CKEDITOR.env.ie && (h =
  20333. 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26'
  20334. );
  20335. var e = e + (
  20336. ' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"' +
  20337. h +
  20338. 'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e' +
  20339. (CKEDITOR.env.hc ? "\x26#9660;" : CKEDITOR.env.air ? "\x26nbsp;" : "") +
  20340. "\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),
  20341. m = CKEDITOR.addTemplate("combo", e);
  20342. CKEDITOR.UI_RICHCOMBO = "richcombo";
  20343. CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({
  20344. $: function(a) {
  20345. CKEDITOR.tools.extend(this, a, {
  20346. canGroup: !1,
  20347. title: a.label,
  20348. modes: {
  20349. wysiwyg: 1
  20350. },
  20351. editorFocus: 1
  20352. });
  20353. a = this.panel || {};
  20354. delete this.panel;
  20355. this.id = CKEDITOR.tools.getNextNumber();
  20356. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  20357. a.className = "cke_combopanel";
  20358. a.block = {
  20359. multiSelect: a.multiSelect,
  20360. attributes: a.attributes
  20361. };
  20362. a.toolbarRelated = !0;
  20363. this._ = {
  20364. panelDefinition: a,
  20365. items: {},
  20366. listeners: []
  20367. }
  20368. },
  20369. proto: {
  20370. renderHtml: function(a) {
  20371. var b = [];
  20372. this.render(a, b);
  20373. return b.join("")
  20374. },
  20375. render: function(a, b) {
  20376. function c() {
  20377. if (this.getState() != CKEDITOR.TRISTATE_ON) {
  20378. var b = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  20379. a.readOnly && !this.readOnly && (b = CKEDITOR.TRISTATE_DISABLED);
  20380. this.setState(b);
  20381. this.setValue("");
  20382. b != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
  20383. }
  20384. }
  20385. var l = CKEDITOR.env,
  20386. g, f, d = "cke_" + this.id,
  20387. e = CKEDITOR.tools.addFunction(function(b) {
  20388. f && (a.unlockSelection(1), f = 0);
  20389. g.execute(b)
  20390. }, this),
  20391. k = this;
  20392. g = {
  20393. id: d,
  20394. combo: this,
  20395. focus: function() {
  20396. CKEDITOR.document.getById(d).getChild(1).focus()
  20397. },
  20398. execute: function(b) {
  20399. var c = k._;
  20400. if (c.state != CKEDITOR.TRISTATE_DISABLED)
  20401. if (k.createPanel(a), c.on) c.panel.hide();
  20402. else {
  20403. k.commit();
  20404. var d = k.getValue();
  20405. d ? c.list.mark(d) : c.list.unmarkAll();
  20406. c.panel.showBlock(k.id, new CKEDITOR.dom.element(b), 4)
  20407. }
  20408. },
  20409. clickFn: e
  20410. };
  20411. this._.listeners.push(a.on("activeFilterChange",
  20412. c, this));
  20413. this._.listeners.push(a.on("mode", c, this));
  20414. this._.listeners.push(a.on("selectionChange", c, this));
  20415. !this.readOnly && this._.listeners.push(a.on("readOnly", c, this));
  20416. var h = CKEDITOR.tools.addFunction(function(a, b) {
  20417. a = new CKEDITOR.dom.event(a);
  20418. var c = a.getKeystroke();
  20419. switch (c) {
  20420. case 13:
  20421. case 32:
  20422. case 40:
  20423. CKEDITOR.tools.callFunction(e, b);
  20424. break;
  20425. default:
  20426. g.onkey(g, c)
  20427. }
  20428. a.preventDefault()
  20429. }),
  20430. n = CKEDITOR.tools.addFunction(function() {
  20431. g.onfocus && g.onfocus()
  20432. });
  20433. f = 0;
  20434. g.keyDownFn = h;
  20435. l = {
  20436. id: d,
  20437. name: this.name || this.command,
  20438. label: this.label,
  20439. title: this.title,
  20440. cls: this.className || "",
  20441. titleJs: l.gecko && !l.hc ? "" : (this.title || "").replace("'", ""),
  20442. keydownFn: h,
  20443. focusFn: n,
  20444. clickFn: e
  20445. };
  20446. m.output(l, b);
  20447. if (this.onRender) this.onRender();
  20448. return g
  20449. },
  20450. createPanel: function(a) {
  20451. if (!this._.panel) {
  20452. var b = this._.panelDefinition,
  20453. c = this._.panelDefinition.block,
  20454. e = b.parent || CKEDITOR.document.getBody(),
  20455. g = "cke_combopanel__" + this.name,
  20456. f = new CKEDITOR.ui.floatPanel(a, e, b),
  20457. b = f.addListBlock(this.id, c),
  20458. d = this;
  20459. f.onShow = function() {
  20460. this.element.addClass(g);
  20461. d.setState(CKEDITOR.TRISTATE_ON);
  20462. d._.on = 1;
  20463. d.editorFocus && !a.focusManager.hasFocus && a.focus();
  20464. if (d.onOpen) d.onOpen()
  20465. };
  20466. f.onHide = function(b) {
  20467. this.element.removeClass(g);
  20468. d.setState(d.modes && d.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  20469. d._.on = 0;
  20470. if (!b && d.onClose) d.onClose()
  20471. };
  20472. f.onEscape = function() {
  20473. f.hide(1)
  20474. };
  20475. b.onClick = function(a, b) {
  20476. d.onClick && d.onClick.call(d, a, b);
  20477. f.hide()
  20478. };
  20479. this._.panel = f;
  20480. this._.list = b;
  20481. f.getBlock(this.id).onHide = function() {
  20482. d._.on = 0;
  20483. d.setState(CKEDITOR.TRISTATE_OFF)
  20484. };
  20485. this.init && this.init()
  20486. }
  20487. },
  20488. setValue: function(a,
  20489. b) {
  20490. this._.value = a;
  20491. var c = this.document.getById("cke_" + this.id + "_text");
  20492. c && (a || b ? c.removeClass("cke_combo_inlinelabel") : (b = this.label, c.addClass(
  20493. "cke_combo_inlinelabel")), c.setText("undefined" != typeof b ? b : a));
  20494. var c = "undefined" != typeof b ? b : a,
  20495. e = this.label,
  20496. c = c === e ? c : c + ", " + e;
  20497. (e = this.document.getById("cke_" + this.id + "_label")) && e.setText(c)
  20498. },
  20499. getValue: function() {
  20500. return this._.value || ""
  20501. },
  20502. unmarkAll: function() {
  20503. this._.list.unmarkAll()
  20504. },
  20505. mark: function(a) {
  20506. this._.list.mark(a)
  20507. },
  20508. hideItem: function(a) {
  20509. this._.list.hideItem(a)
  20510. },
  20511. hideGroup: function(a) {
  20512. this._.list.hideGroup(a)
  20513. },
  20514. showAll: function() {
  20515. this._.list.showAll()
  20516. },
  20517. add: function(a, b, c, e) {
  20518. this._.items[a] = c || a;
  20519. this._.list.add(a, b, c, e)
  20520. },
  20521. startGroup: function(a) {
  20522. this._.list.startGroup(a)
  20523. },
  20524. commit: function() {
  20525. this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire("ready", this));
  20526. this._.committed = 1
  20527. },
  20528. setState: function(a) {
  20529. if (this._.state != a) {
  20530. var b = this.document.getById("cke_" + this.id),
  20531. c = b.getElementsByTag("a").getItem(0);
  20532. b.setState(a, "cke_combo");
  20533. a == CKEDITOR.TRISTATE_DISABLED ?
  20534. b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled");
  20535. c && c.setAttribute("aria-expanded", a == CKEDITOR.TRISTATE_ON);
  20536. this._.state = a
  20537. }
  20538. },
  20539. getState: function() {
  20540. return this._.state
  20541. },
  20542. enable: function() {
  20543. this._.state == CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
  20544. },
  20545. disable: function() {
  20546. this._.state != CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(
  20547. CKEDITOR.TRISTATE_DISABLED))
  20548. },
  20549. destroy: function() {
  20550. CKEDITOR.tools.array.forEach(this._.listeners, function(a) {
  20551. a.removeListener()
  20552. });
  20553. this._.listeners = []
  20554. },
  20555. select: function(a) {
  20556. if (!CKEDITOR.tools.isEmpty(this._.items))
  20557. for (var b in this._.items)
  20558. if (a({
  20559. value: b,
  20560. text: this._.items[b]
  20561. })) {
  20562. this.setValue(b);
  20563. break
  20564. }
  20565. }
  20566. },
  20567. statics: {
  20568. handler: {
  20569. create: function(a) {
  20570. return new CKEDITOR.ui.richCombo(a)
  20571. }
  20572. }
  20573. }
  20574. });
  20575. CKEDITOR.ui.prototype.addRichCombo = function(a, b) {
  20576. this.add(a, CKEDITOR.UI_RICHCOMBO, b)
  20577. }
  20578. })();
  20579. (function() {
  20580. function k(a, b) {
  20581. var c = a.config,
  20582. e = b.lang,
  20583. d = new CKEDITOR.style(b.styleDefinition),
  20584. f = new l({
  20585. entries: b.entries,
  20586. styleVariable: b.styleVariable,
  20587. styleDefinition: b.styleDefinition
  20588. }),
  20589. g;
  20590. a.addCommand(b.commandName, {
  20591. exec: function(a, b) {
  20592. var c = b.newStyle,
  20593. d = b.oldStyle,
  20594. e = a.getSelection().getRanges()[0],
  20595. f = void 0 === c;
  20596. if (d || c) d && e.collapsed && m({
  20597. editor: a,
  20598. range: e,
  20599. style: d
  20600. }), f ? a.removeStyle(d) : (d && !n(d, c) && a.removeStyle(d), a.applyStyle(c))
  20601. },
  20602. refresh: function(a, b) {
  20603. d.checkApplicable(b, a, a.activeFilter) || this.setState(CKEDITOR.TRISTATE_DISABLED)
  20604. }
  20605. });
  20606. g = a.getCommand(b.commandName);
  20607. a.ui.addRichCombo(b.comboName, {
  20608. label: e.label,
  20609. title: e.panelTitle,
  20610. command: b.commandName,
  20611. toolbar: "styles," + b.order,
  20612. defaultValue: "cke-default",
  20613. allowedContent: d,
  20614. requiredContent: d,
  20615. contentTransformations: "span" === b.styleDefinition.element ? [
  20616. [{
  20617. element: "font",
  20618. check: "span",
  20619. left: function(a) {
  20620. return !!a.attributes.size || !!a.attributes.align || !!a.attributes.face
  20621. },
  20622. right: function(a) {
  20623. var b = " x-small small medium large x-large xx-large 48px".split(" ");
  20624. a.name = "span";
  20625. a.attributes.size && (a.styles["font-size"] =
  20626. b[a.attributes.size], delete a.attributes.size);
  20627. a.attributes.align && (a.styles["text-align"] = a.attributes.align, delete a.attributes
  20628. .align);
  20629. a.attributes.face && (a.styles["font-family"] = a.attributes.face, delete a.attributes.face)
  20630. }
  20631. }]
  20632. ] : null,
  20633. panel: {
  20634. css: [CKEDITOR.skin.getPath("editor")].concat(c.contentsCss),
  20635. multiSelect: !1,
  20636. attributes: {
  20637. "aria-label": e.panelTitle
  20638. }
  20639. },
  20640. init: function() {
  20641. var b = "(" + a.lang.common.optionDefault + ")";
  20642. this.startGroup(e.panelTitle);
  20643. this.add(this.defaultValue, b, b);
  20644. f.addToCombo(this)
  20645. },
  20646. onClick: function(c) {
  20647. var d =
  20648. this.getValue();
  20649. a.focus();
  20650. a.fire("saveSnapshot");
  20651. a.execCommand(b.commandName, {
  20652. newStyle: f.getStyle(c),
  20653. oldStyle: f.getStyle(d)
  20654. });
  20655. a.fire("saveSnapshot")
  20656. },
  20657. onRender: function() {
  20658. a.on("selectionChange", function(c) {
  20659. var d = this.getValue();
  20660. (c = f.getMatchingValue(a, c.data.path)) ? c != d && this.setValue(c): this.setValue("", b
  20661. .defaultLabel)
  20662. }, this);
  20663. g.on("state", function() {
  20664. this.setState(g.state)
  20665. }, this)
  20666. },
  20667. refresh: function() {
  20668. this.setState(g.state)
  20669. }
  20670. })
  20671. }
  20672. function n(a, b) {
  20673. if (!(a instanceof CKEDITOR.style && b instanceof CKEDITOR.style)) return !1;
  20674. var c = function(a, b) {
  20675. var c = a.getDefinition().attributes,
  20676. e = b.getDefinition().attributes;
  20677. return CKEDITOR.tools.objectCompare(c, e)
  20678. }(a, b),
  20679. e = function(a, b) {
  20680. return CKEDITOR.style.getStyleText(a.getDefinition()) === CKEDITOR.style.getStyleText(b.getDefinition())
  20681. }(a, b);
  20682. return c && e
  20683. }
  20684. function m(a) {
  20685. var b = a.editor,
  20686. c = a.range,
  20687. e = a.style,
  20688. d, f, g;
  20689. d = b.elementPath();
  20690. if (a = d.contains(function(a) {
  20691. return e.checkElementRemovable(a)
  20692. })) {
  20693. f = c.checkBoundaryOfElement(a, CKEDITOR.START);
  20694. g = c.checkBoundaryOfElement(a, CKEDITOR.END);
  20695. if (f &&
  20696. g) {
  20697. for (f = c.createBookmark(); d = a.getFirst();) d.insertBefore(a);
  20698. a.remove();
  20699. c.moveToBookmark(f)
  20700. } else f || g ? c.moveToPosition(a, f ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_END) : (c
  20701. .splitElement(a), c.moveToPosition(a, CKEDITOR.POSITION_AFTER_END)), h(c, d.elements.slice(), a);
  20702. b.getSelection().selectRanges([c])
  20703. }
  20704. }
  20705. function h(a, b, c) {
  20706. var e = b.pop();
  20707. if (e) {
  20708. if (c) return h(a, b, e.equals(c) ? null : c);
  20709. c = e.clone();
  20710. a.insertNode(c);
  20711. a.moveToPosition(c, CKEDITOR.POSITION_AFTER_START);
  20712. h(a, b)
  20713. }
  20714. }
  20715. var l = CKEDITOR.tools.createClass({
  20716. $: function(a) {
  20717. var b =
  20718. a.entries.split(";");
  20719. this._.data = {};
  20720. this._.names = [];
  20721. for (var c = 0; c < b.length; c++) {
  20722. var e = b[c],
  20723. d, f;
  20724. e ? (e = e.split("/"), d = e[0], e = e[1], f = {}, f[a.styleVariable] = e || d, this._.data[d] =
  20725. new CKEDITOR.style(a.styleDefinition, f), this._.data[d]._.definition.name = d, this._.names
  20726. .push(d)) : (b.splice(c, 1), c--)
  20727. }
  20728. },
  20729. proto: {
  20730. getStyle: function(a) {
  20731. return this._.data[a]
  20732. },
  20733. addToCombo: function(a) {
  20734. for (var b = 0; b < this._.names.length; b++) {
  20735. var c = this._.names[b];
  20736. a.add(c, this.getStyle(c).buildPreview(), c)
  20737. }
  20738. },
  20739. getMatchingValue: function(a, b) {
  20740. for (var c =
  20741. b.elements, e = 0, d; e < c.length; e++)
  20742. if (d = c[e], d = this._.findMatchingStyleName(a, d)) return d;
  20743. return null
  20744. }
  20745. },
  20746. _: {
  20747. findMatchingStyleName: function(a, b) {
  20748. return CKEDITOR.tools.array.find(this._.names, function(c) {
  20749. return this.getStyle(c).checkElementMatch(b, !0, a)
  20750. }, this)
  20751. }
  20752. }
  20753. });
  20754. CKEDITOR.plugins.add("font", {
  20755. requires: "richcombo",
  20756. init: function(a) {
  20757. var b = a.config;
  20758. k(a, {
  20759. comboName: "Font",
  20760. commandName: "font",
  20761. styleVariable: "family",
  20762. lang: a.lang.font,
  20763. entries: b.font_names,
  20764. defaultLabel: b.font_defaultLabel,
  20765. styleDefinition: b.font_style,
  20766. order: 30
  20767. });
  20768. k(a, {
  20769. comboName: "FontSize",
  20770. commandName: "fontSize",
  20771. styleVariable: "size",
  20772. lang: a.lang.font.fontSize,
  20773. entries: b.fontSize_sizes,
  20774. defaultLabel: b.fontSize_defaultLabel,
  20775. styleDefinition: b.fontSize_style,
  20776. order: 40
  20777. })
  20778. }
  20779. })
  20780. })();
  20781. CKEDITOR.config.font_names =
  20782. "Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif";
  20783. CKEDITOR.config.font_defaultLabel = "";
  20784. CKEDITOR.config.font_style = {
  20785. element: "span",
  20786. styles: {
  20787. "font-family": "#(family)"
  20788. },
  20789. overrides: [{
  20790. element: "font",
  20791. attributes: {
  20792. face: null
  20793. }
  20794. }]
  20795. };
  20796. CKEDITOR.config.fontSize_sizes =
  20797. "8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px";
  20798. CKEDITOR.config.fontSize_defaultLabel = "";
  20799. CKEDITOR.config.fontSize_style = {
  20800. element: "span",
  20801. styles: {
  20802. "font-size": "#(size)"
  20803. },
  20804. overrides: [{
  20805. element: "font",
  20806. attributes: {
  20807. size: null
  20808. }
  20809. }]
  20810. };
  20811. (function() {
  20812. function f(b, a) {
  20813. var c = k.exec(b),
  20814. d = k.exec(a);
  20815. if (c) {
  20816. if (!c[2] && "px" == d[2]) return d[1];
  20817. if ("px" == c[2] && !d[2]) return d[1] + "px"
  20818. }
  20819. return a
  20820. }
  20821. function m(b) {
  20822. return {
  20823. elements: {
  20824. $: function(a) {
  20825. var c = a.attributes,
  20826. c = c && c["data-cke-realelement"],
  20827. d = l(b, decodeURIComponent(c));
  20828. if ((c = (c = c && new CKEDITOR.htmlParser.fragment.fromHtml(d)) && c.children[0]) && a.attributes[
  20829. "data-cke-resizable"]) {
  20830. var e = (new h(a)).rules;
  20831. a = c.attributes;
  20832. d = e.width;
  20833. e = e.height;
  20834. d && (a.width = f(a.width, d));
  20835. e && (a.height = f(a.height, e))
  20836. }
  20837. return c
  20838. }
  20839. }
  20840. }
  20841. }
  20842. function l(b, a) {
  20843. var c = [],
  20844. d = /^cke:/i,
  20845. e = new CKEDITOR.htmlParser.filter({
  20846. elements: {
  20847. "^": function(a) {
  20848. d.test(a.name) && (a.name = a.name.replace(d, ""), c.push(a))
  20849. },
  20850. iframe: function(a) {
  20851. a.children = []
  20852. }
  20853. }
  20854. }),
  20855. n = b.activeFilter,
  20856. f = new CKEDITOR.htmlParser.basicWriter,
  20857. g = CKEDITOR.htmlParser.fragment.fromHtml(a);
  20858. e.applyTo(g);
  20859. n.applyTo(g);
  20860. CKEDITOR.tools.array.forEach(c, function(a) {
  20861. a.name = "cke:" + a.name
  20862. });
  20863. g.writeHtml(f);
  20864. return f.getHtml()
  20865. }
  20866. var h = CKEDITOR.htmlParser.cssStyle,
  20867. g = CKEDITOR.tools.cssLength,
  20868. k = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i;
  20869. CKEDITOR.plugins.add("fakeobjects", {
  20870. init: function(b) {
  20871. b.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}", "fakeobjects")
  20872. },
  20873. afterInit: function(b) {
  20874. var a = b.dataProcessor;
  20875. (a = a && a.htmlFilter) && a.addRules(m(b), {
  20876. applyToAll: !0
  20877. })
  20878. }
  20879. });
  20880. CKEDITOR.editor.prototype.createFakeElement = function(b, a, c, d) {
  20881. var e = this.lang.fakeobjects,
  20882. e = e[c] || e.unknown;
  20883. a = {
  20884. "class": a,
  20885. "data-cke-realelement": encodeURIComponent(b.getOuterHtml()),
  20886. "data-cke-real-node-type": b.type,
  20887. alt: e,
  20888. title: e,
  20889. align: b.getAttribute("align") || ""
  20890. };
  20891. CKEDITOR.env.hc ||
  20892. (a.src = CKEDITOR.tools.transparentImageData);
  20893. c && (a["data-cke-real-element-type"] = c);
  20894. d && (a["data-cke-resizable"] = d, c = new h, d = b.getAttribute("width"), b = b.getAttribute("height"),
  20895. d && (c.rules.width = g(d)), b && (c.rules.height = g(b)), c.populate(a));
  20896. return this.document.createElement("img", {
  20897. attributes: a
  20898. })
  20899. };
  20900. CKEDITOR.editor.prototype.createFakeParserElement = function(b, a, c, d) {
  20901. var e = this.lang.fakeobjects,
  20902. e = e[c] || e.unknown,
  20903. f;
  20904. f = new CKEDITOR.htmlParser.basicWriter;
  20905. b.writeHtml(f);
  20906. f = f.getHtml();
  20907. a = {
  20908. "class": a,
  20909. "data-cke-realelement": encodeURIComponent(f),
  20910. "data-cke-real-node-type": b.type,
  20911. alt: e,
  20912. title: e,
  20913. align: b.attributes.align || ""
  20914. };
  20915. CKEDITOR.env.hc || (a.src = CKEDITOR.tools.transparentImageData);
  20916. c && (a["data-cke-real-element-type"] = c);
  20917. d && (a["data-cke-resizable"] = d, d = b.attributes, b = new h, c = d.width, d = d.height, void 0 !== c && (
  20918. b.rules.width = g(c)), void 0 !== d && (b.rules.height = g(d)), b.populate(a));
  20919. return new CKEDITOR.htmlParser.element("img", a)
  20920. };
  20921. CKEDITOR.editor.prototype.restoreRealElement = function(b) {
  20922. if (b.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null;
  20923. var a = decodeURIComponent(b.data("cke-realelement")),
  20924. a = l(this, a),
  20925. a = CKEDITOR.dom.element.createFromHtml(a, this.document);
  20926. if (b.data("cke-resizable")) {
  20927. var c = b.getStyle("width");
  20928. b = b.getStyle("height");
  20929. c && a.setAttribute("width", f(a.getAttribute("width"), c));
  20930. b && a.setAttribute("height", f(a.getAttribute("height"), b))
  20931. }
  20932. return a
  20933. }
  20934. })();
  20935. CKEDITOR.plugins.add("forms", {
  20936. requires: "dialog,fakeobjects",
  20937. onLoad: function() {
  20938. CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n");
  20939. CKEDITOR.addCss("img.cke_hidden{background-image: url(" + CKEDITOR.getUrl(this.path +
  20940. "images/hiddenfield.gif") +
  20941. ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}"
  20942. );
  20943. CKEDITOR.style.unstylableElements.push("select", "option")
  20944. },
  20945. init: function(b) {
  20946. var a = b.lang,
  20947. g = 0,
  20948. h = {
  20949. email: 1,
  20950. password: 1,
  20951. search: 1,
  20952. tel: 1,
  20953. text: 1,
  20954. url: 1
  20955. },
  20956. l = {
  20957. checkbox: "input[type,name,checked,required]",
  20958. radio: "input[type,name,checked,required]",
  20959. textfield: "input[type,name,value,size,maxlength,required]",
  20960. textarea: "textarea[cols,rows,name,required]",
  20961. select: "select[name,size,multiple,required]; option[value,selected]",
  20962. button: "input[type,name,value]",
  20963. form: "form[action,name,id,enctype,target,method]",
  20964. hiddenfield: "input[type,name,value]",
  20965. imagebutton: "input[type,alt,src]{width,height,border,border-width,border-style,margin,float}"
  20966. },
  20967. m = {
  20968. checkbox: "input",
  20969. radio: "input",
  20970. textfield: "input",
  20971. textarea: "textarea",
  20972. select: "select",
  20973. button: "input",
  20974. form: "form",
  20975. hiddenfield: "input",
  20976. imagebutton: "input"
  20977. },
  20978. d = function(f, c, d) {
  20979. var h = {
  20980. allowedContent: l[c],
  20981. requiredContent: m[c]
  20982. };
  20983. "form" == c && (h.context = "form");
  20984. b.addCommand(c, new CKEDITOR.dialogCommand(c, h));
  20985. b.ui.addButton && b.ui.addButton(f, {
  20986. label: a.common[f.charAt(0).toLowerCase() + f.slice(1)],
  20987. command: c,
  20988. toolbar: "forms," + (g += 10)
  20989. });
  20990. CKEDITOR.dialog.add(c, d)
  20991. },
  20992. e = this.path + "dialogs/";
  20993. !b.blockless && d("Form", "form",
  20994. e + "form.js");
  20995. d("Checkbox", "checkbox", e + "checkbox.js");
  20996. d("Radio", "radio", e + "radio.js");
  20997. d("TextField", "textfield", e + "textfield.js");
  20998. d("Textarea", "textarea", e + "textarea.js");
  20999. d("Select", "select", e + "select.js");
  21000. d("Button", "button", e + "button.js");
  21001. var k = b.plugins.image;
  21002. k && !b.plugins.image2 && d("ImageButton", "imagebutton", CKEDITOR.plugins.getPath("image") +
  21003. "dialogs/image.js");
  21004. d("HiddenField", "hiddenfield", e + "hiddenfield.js");
  21005. b.addMenuItems && (d = {
  21006. checkbox: {
  21007. label: a.forms.checkboxAndRadio.checkboxTitle,
  21008. command: "checkbox",
  21009. group: "checkbox"
  21010. },
  21011. radio: {
  21012. label: a.forms.checkboxAndRadio.radioTitle,
  21013. command: "radio",
  21014. group: "radio"
  21015. },
  21016. textfield: {
  21017. label: a.forms.textfield.title,
  21018. command: "textfield",
  21019. group: "textfield"
  21020. },
  21021. hiddenfield: {
  21022. label: a.forms.hidden.title,
  21023. command: "hiddenfield",
  21024. group: "hiddenfield"
  21025. },
  21026. button: {
  21027. label: a.forms.button.title,
  21028. command: "button",
  21029. group: "button"
  21030. },
  21031. select: {
  21032. label: a.forms.select.title,
  21033. command: "select",
  21034. group: "select"
  21035. },
  21036. textarea: {
  21037. label: a.forms.textarea.title,
  21038. command: "textarea",
  21039. group: "textarea"
  21040. }
  21041. }, k && (d.imagebutton = {
  21042. label: a.image.titleButton,
  21043. command: "imagebutton",
  21044. group: "imagebutton"
  21045. }), !b.blockless && (d.form = {
  21046. label: a.forms.form.menu,
  21047. command: "form",
  21048. group: "form"
  21049. }), b.addMenuItems(d));
  21050. b.contextMenu && (!b.blockless && b.contextMenu.addListener(function(f, c, b) {
  21051. if ((f = b.contains("form", 1)) && !f.isReadOnly()) return {
  21052. form: CKEDITOR.TRISTATE_OFF
  21053. }
  21054. }), b.contextMenu.addListener(function(b) {
  21055. if (b && !b.isReadOnly()) {
  21056. var c = b.getName();
  21057. if ("select" == c) return {
  21058. select: CKEDITOR.TRISTATE_OFF
  21059. };
  21060. if ("textarea" == c) return {
  21061. textarea: CKEDITOR.TRISTATE_OFF
  21062. };
  21063. if ("input" == c) {
  21064. var a =
  21065. b.getAttribute("type") || "text";
  21066. switch (a) {
  21067. case "button":
  21068. case "submit":
  21069. case "reset":
  21070. return {
  21071. button: CKEDITOR.TRISTATE_OFF
  21072. };
  21073. case "checkbox":
  21074. return {
  21075. checkbox: CKEDITOR.TRISTATE_OFF
  21076. };
  21077. case "radio":
  21078. return {
  21079. radio: CKEDITOR.TRISTATE_OFF
  21080. };
  21081. case "image":
  21082. return k ? {
  21083. imagebutton: CKEDITOR.TRISTATE_OFF
  21084. } : null
  21085. }
  21086. if (h[a]) return {
  21087. textfield: CKEDITOR.TRISTATE_OFF
  21088. }
  21089. }
  21090. if ("img" == c && "hiddenfield" == b.data("cke-real-element-type")) return {
  21091. hiddenfield: CKEDITOR.TRISTATE_OFF
  21092. }
  21093. }
  21094. }));
  21095. b.on("doubleclick", function(a) {
  21096. var c = a.data.element;
  21097. if (!b.blockless &&
  21098. c.is("form")) a.data.dialog = "form";
  21099. else if (c.is("select")) a.data.dialog = "select";
  21100. else if (c.is("textarea")) a.data.dialog = "textarea";
  21101. else if (c.is("img") && "hiddenfield" == c.data("cke-real-element-type")) a.data.dialog =
  21102. "hiddenfield";
  21103. else if (c.is("input")) {
  21104. c = c.getAttribute("type") || "text";
  21105. switch (c) {
  21106. case "button":
  21107. case "submit":
  21108. case "reset":
  21109. a.data.dialog = "button";
  21110. break;
  21111. case "checkbox":
  21112. a.data.dialog = "checkbox";
  21113. break;
  21114. case "radio":
  21115. a.data.dialog = "radio";
  21116. break;
  21117. case "image":
  21118. a.data.dialog = "imagebutton"
  21119. }
  21120. h[c] && (a.data.dialog =
  21121. "textfield")
  21122. }
  21123. })
  21124. },
  21125. afterInit: function(b) {
  21126. var a = b.dataProcessor,
  21127. g = a && a.htmlFilter,
  21128. a = a && a.dataFilter;
  21129. CKEDITOR.env.ie && g && g.addRules({
  21130. elements: {
  21131. input: function(a) {
  21132. a = a.attributes;
  21133. var b = a.type;
  21134. b || (a.type = "text");
  21135. "checkbox" != b && "radio" != b || "on" != a.value || delete a.value
  21136. }
  21137. }
  21138. }, {
  21139. applyToAll: !0
  21140. });
  21141. a && a.addRules({
  21142. elements: {
  21143. input: function(a) {
  21144. if ("hidden" == a.attributes.type) return b.createFakeParserElement(a, "cke_hidden",
  21145. "hiddenfield")
  21146. }
  21147. }
  21148. }, {
  21149. applyToAll: !0
  21150. })
  21151. }
  21152. });
  21153. CKEDITOR.plugins.forms = {
  21154. _setupRequiredAttribute: function(b) {
  21155. this.setValue(b.hasAttribute("required"))
  21156. }
  21157. };
  21158. CKEDITOR.plugins.add("format", {
  21159. requires: "richcombo",
  21160. init: function(a) {
  21161. if (!a.blockless) {
  21162. for (var f = a.config, c = a.lang.format, l = f.format_tags.split(";"), d = {}, m = 0, n = [], g =
  21163. 0; g < l.length; g++) {
  21164. var h = l[g],
  21165. k = new CKEDITOR.style(f["format_" + h]);
  21166. if (!a.filter.customConfig || a.filter.check(k)) m++, d[h] = k, d[h]._.enterMode = a.config.enterMode,
  21167. n.push(k)
  21168. }
  21169. 0 !== m && a.ui.addRichCombo("Format", {
  21170. label: c.label,
  21171. title: c.panelTitle,
  21172. toolbar: "styles,20",
  21173. allowedContent: n,
  21174. panel: {
  21175. css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
  21176. multiSelect: !1,
  21177. attributes: {
  21178. "aria-label": c.panelTitle
  21179. }
  21180. },
  21181. init: function() {
  21182. this.startGroup(c.panelTitle);
  21183. for (var a in d) {
  21184. var e = c["tag_" + a];
  21185. this.add(a, d[a].buildPreview(e), e)
  21186. }
  21187. },
  21188. onClick: function(b) {
  21189. a.focus();
  21190. a.fire("saveSnapshot");
  21191. b = d[b];
  21192. var e = a.elementPath();
  21193. a.fire("stylesRemove", {
  21194. type: CKEDITOR.STYLE_BLOCK
  21195. });
  21196. b.checkActive(e, a) || a.applyStyle(b);
  21197. setTimeout(function() {
  21198. a.fire("saveSnapshot")
  21199. }, 0)
  21200. },
  21201. onRender: function() {
  21202. a.on("selectionChange", function(b) {
  21203. var e = this.getValue();
  21204. b = b.data.path;
  21205. this.refresh();
  21206. for (var c in d)
  21207. if (d[c].checkActive(b,
  21208. a)) {
  21209. c != e && this.setValue(c, a.lang.format["tag_" + c]);
  21210. return
  21211. } this.setValue("")
  21212. }, this)
  21213. },
  21214. onOpen: function() {
  21215. this.showAll();
  21216. for (var b in d) a.activeFilter.check(d[b]) || this.hideItem(b)
  21217. },
  21218. refresh: function() {
  21219. var b = a.elementPath();
  21220. if (b) {
  21221. if (b.isContextFor("p"))
  21222. for (var c in d)
  21223. if (a.activeFilter.check(d[c])) return;
  21224. this.setState(CKEDITOR.TRISTATE_DISABLED)
  21225. }
  21226. }
  21227. })
  21228. }
  21229. }
  21230. });
  21231. CKEDITOR.config.format_tags = "p;h1;h2;h3;h4;h5;h6;pre;address;div";
  21232. CKEDITOR.config.format_p = {
  21233. element: "p"
  21234. };
  21235. CKEDITOR.config.format_div = {
  21236. element: "div"
  21237. };
  21238. CKEDITOR.config.format_pre = {
  21239. element: "pre"
  21240. };
  21241. CKEDITOR.config.format_address = {
  21242. element: "address"
  21243. };
  21244. CKEDITOR.config.format_h1 = {
  21245. element: "h1"
  21246. };
  21247. CKEDITOR.config.format_h2 = {
  21248. element: "h2"
  21249. };
  21250. CKEDITOR.config.format_h3 = {
  21251. element: "h3"
  21252. };
  21253. CKEDITOR.config.format_h4 = {
  21254. element: "h4"
  21255. };
  21256. CKEDITOR.config.format_h5 = {
  21257. element: "h5"
  21258. };
  21259. CKEDITOR.config.format_h6 = {
  21260. element: "h6"
  21261. };
  21262. (function() {
  21263. var b = {
  21264. canUndo: !1,
  21265. exec: function(a) {
  21266. var b = a.document.createElement("hr");
  21267. a.insertElement(b)
  21268. },
  21269. allowedContent: "hr",
  21270. requiredContent: "hr"
  21271. };
  21272. CKEDITOR.plugins.add("horizontalrule", {
  21273. init: function(a) {
  21274. a.blockless || (a.addCommand("horizontalrule", b), a.ui.addButton && a.ui.addButton(
  21275. "HorizontalRule", {
  21276. label: a.lang.horizontalrule.toolbar,
  21277. command: "horizontalrule",
  21278. toolbar: "insert,40"
  21279. }))
  21280. }
  21281. })
  21282. })();
  21283. CKEDITOR.plugins.add("htmlwriter", {
  21284. init: function(b) {
  21285. var a = new CKEDITOR.htmlWriter;
  21286. a.forceSimpleAmpersand = b.config.forceSimpleAmpersand;
  21287. a.indentationChars = "string" === typeof b.config.dataIndentationChars ? b.config.dataIndentationChars :
  21288. "\t";
  21289. b.dataProcessor.writer = a
  21290. }
  21291. });
  21292. CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({
  21293. base: CKEDITOR.htmlParser.basicWriter,
  21294. $: function() {
  21295. this.base();
  21296. this.indentationChars = "\t";
  21297. this.selfClosingEnd = " /\x3e";
  21298. this.lineBreakChars = "\n";
  21299. this.sortAttributes = 1;
  21300. this._.indent = 0;
  21301. this._.indentation = "";
  21302. this._.inPre = 0;
  21303. this._.rules = {};
  21304. var b = CKEDITOR.dtd,
  21305. a;
  21306. for (a in CKEDITOR.tools.extend({}, b.$nonBodyContent, b.$block, b.$listItem, b.$tableContent)) this
  21307. .setRules(a, {
  21308. indent: !b[a]["#"],
  21309. breakBeforeOpen: 1,
  21310. breakBeforeClose: !b[a]["#"],
  21311. breakAfterClose: 1,
  21312. needsSpace: a in
  21313. b.$block && !(a in {
  21314. li: 1,
  21315. dt: 1,
  21316. dd: 1
  21317. })
  21318. });
  21319. this.setRules("br", {
  21320. breakAfterOpen: 1
  21321. });
  21322. this.setRules("title", {
  21323. indent: 0,
  21324. breakAfterOpen: 0
  21325. });
  21326. this.setRules("style", {
  21327. indent: 0,
  21328. breakBeforeClose: 1
  21329. });
  21330. this.setRules("pre", {
  21331. breakAfterOpen: 1,
  21332. indent: 0
  21333. })
  21334. },
  21335. proto: {
  21336. openTag: function(b) {
  21337. var a = this._.rules[b];
  21338. this._.afterCloser && a && a.needsSpace && this._.needsSpace && this._.output.push("\n");
  21339. this._.indent ? this.indentation() : a && a.breakBeforeOpen && (this.lineBreak(), this.indentation());
  21340. this._.output.push("\x3c", b);
  21341. this._.afterCloser = 0
  21342. },
  21343. openTagClose: function(b, a) {
  21344. var c = this._.rules[b];
  21345. a ? (this._.output.push(this.selfClosingEnd), c && c.breakAfterClose && (this._.needsSpace = c
  21346. .needsSpace)) : (this._.output.push("\x3e"), c && c.indent && (this._.indentation += this
  21347. .indentationChars));
  21348. c && c.breakAfterOpen && this.lineBreak();
  21349. "pre" == b && (this._.inPre = 1)
  21350. },
  21351. attribute: function(b, a) {
  21352. "string" == typeof a && (a = CKEDITOR.tools.htmlEncodeAttr(a), this.forceSimpleAmpersand && (a = a
  21353. .replace(/&amp;/g, "\x26")));
  21354. this._.output.push(" ", b, '\x3d"', a, '"')
  21355. },
  21356. closeTag: function(b) {
  21357. var a =
  21358. this._.rules[b];
  21359. a && a.indent && (this._.indentation = this._.indentation.substr(this.indentationChars.length));
  21360. this._.indent ? this.indentation() : a && a.breakBeforeClose && (this.lineBreak(), this.indentation());
  21361. this._.output.push("\x3c/", b, "\x3e");
  21362. "pre" == b && (this._.inPre = 0);
  21363. a && a.breakAfterClose && (this.lineBreak(), this._.needsSpace = a.needsSpace);
  21364. this._.afterCloser = 1
  21365. },
  21366. text: function(b) {
  21367. this._.indent && (this.indentation(), !this._.inPre && (b = CKEDITOR.tools.ltrim(b)));
  21368. this._.output.push(b)
  21369. },
  21370. comment: function(b) {
  21371. this._.indent &&
  21372. this.indentation();
  21373. this._.output.push("\x3c!--", b, "--\x3e")
  21374. },
  21375. lineBreak: function() {
  21376. !this._.inPre && 0 < this._.output.length && this._.output.push(this.lineBreakChars);
  21377. this._.indent = 1
  21378. },
  21379. indentation: function() {
  21380. !this._.inPre && this._.indentation && this._.output.push(this._.indentation);
  21381. this._.indent = 0
  21382. },
  21383. reset: function() {
  21384. this._.output = [];
  21385. this._.indent = 0;
  21386. this._.indentation = "";
  21387. this._.afterCloser = 0;
  21388. this._.inPre = 0;
  21389. this._.needsSpace = 0
  21390. },
  21391. setRules: function(b, a) {
  21392. var c = this._.rules[b];
  21393. c ? CKEDITOR.tools.extend(c, a, !0) : this._.rules[b] =
  21394. a
  21395. }
  21396. }
  21397. });
  21398. (function() {
  21399. CKEDITOR.plugins.add("iframe", {
  21400. requires: "dialog,fakeobjects",
  21401. onLoad: function() {
  21402. CKEDITOR.addCss("img.cke_iframe{background-image: url(" + CKEDITOR.getUrl(this.path +
  21403. "images/placeholder.png") +
  21404. ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}"
  21405. )
  21406. },
  21407. init: function(a) {
  21408. var c = a.lang.iframe,
  21409. b = "iframe[align,longdesc,tabindex,frameborder,height,name,scrolling,src,title,width,sandbox]";
  21410. a.plugins.dialogadvtab && (b += ";iframe" + a.plugins.dialogadvtab.allowedContent({
  21411. id: 1,
  21412. classes: 1,
  21413. styles: 1
  21414. }));
  21415. CKEDITOR.dialog.add("iframe", this.path + "dialogs/iframe.js");
  21416. a.addCommand("iframe", new CKEDITOR.dialogCommand("iframe", {
  21417. allowedContent: b,
  21418. requiredContent: "iframe"
  21419. }));
  21420. a.ui.addButton && a.ui.addButton("Iframe", {
  21421. label: c.toolbar,
  21422. command: "iframe",
  21423. toolbar: "insert,80"
  21424. });
  21425. a.on("doubleclick", function(a) {
  21426. var b = a.data.element;
  21427. b.is("img") && "iframe" == b.data("cke-real-element-type") && (a.data.dialog = "iframe")
  21428. });
  21429. a.addMenuItems && a.addMenuItems({
  21430. iframe: {
  21431. label: c.title,
  21432. command: "iframe",
  21433. group: "image"
  21434. }
  21435. });
  21436. a.contextMenu && a.contextMenu.addListener(function(a) {
  21437. if (a && a.is("img") && "iframe" == a.data("cke-real-element-type")) return {
  21438. iframe: CKEDITOR.TRISTATE_OFF
  21439. }
  21440. })
  21441. },
  21442. afterInit: function(a) {
  21443. var c = a.dataProcessor;
  21444. (c = c && c.dataFilter) && c.addRules({
  21445. elements: {
  21446. iframe: function(b) {
  21447. var c = a.plugins.iframe._.getIframeAttributes(a, b);
  21448. void 0 !== c && (b.attributes = CKEDITOR.tools.object.merge(b.attributes, c));
  21449. return a.createFakeParserElement(b, "cke_iframe", "iframe", !0)
  21450. }
  21451. }
  21452. })
  21453. },
  21454. _: {
  21455. getIframeAttributes: function(a, c) {
  21456. var b = a.config.iframe_attributes;
  21457. if ("function" === typeof b) return b(c);
  21458. if ("object" === typeof b) return b
  21459. }
  21460. }
  21461. })
  21462. })();
  21463. CKEDITOR.config.iframe_attributes = {
  21464. sandbox: ""
  21465. };
  21466. (function() {
  21467. function v(a) {
  21468. function e(a) {
  21469. var b = !1;
  21470. h.attachListener(h, "keydown", function() {
  21471. var d = c.getBody().getElementsByTag(a);
  21472. if (!b) {
  21473. for (var e = 0; e < d.count(); e++) d.getItem(e).setCustomData("retain", !0);
  21474. b = !0
  21475. }
  21476. }, null, null, 1);
  21477. h.attachListener(h, "keyup", function() {
  21478. var d = c.getElementsByTag(a);
  21479. b && (1 == d.count() && !d.getItem(0).getCustomData("retain") && CKEDITOR.tools.isEmpty(d.getItem(0)
  21480. .getAttributes()) && d.getItem(0).remove(1), b = !1)
  21481. })
  21482. }
  21483. var b = this.editor;
  21484. if (b && !b.isDetached()) {
  21485. var c = a.document,
  21486. f = c.body,
  21487. d = c.getElementById("cke_actscrpt");
  21488. d && d.parentNode.removeChild(d);
  21489. (d = c.getElementById("cke_shimscrpt")) && d.parentNode.removeChild(d);
  21490. (d = c.getElementById("cke_basetagscrpt")) && d.parentNode.removeChild(d);
  21491. f.contentEditable = !0;
  21492. CKEDITOR.env.ie && (f.hideFocus = !0, f.disabled = !0, f.removeAttribute("disabled"));
  21493. delete this._.isLoadingData;
  21494. this.$ = f;
  21495. c = new CKEDITOR.dom.document(c);
  21496. this.setup();
  21497. this.fixInitialSelection();
  21498. var h = this;
  21499. CKEDITOR.env.ie && !CKEDITOR.env.edge && c.getDocumentElement().addClass(c.$.compatMode);
  21500. CKEDITOR.env.ie && !CKEDITOR.env.edge &&
  21501. b.enterMode != CKEDITOR.ENTER_P ? e("p") : CKEDITOR.env.edge && 15 > CKEDITOR.env.version && b
  21502. .enterMode != CKEDITOR.ENTER_DIV && e("div");
  21503. if (CKEDITOR.env.webkit || CKEDITOR.env.ie && 10 < CKEDITOR.env.version) c.getDocumentElement().on(
  21504. "mousedown",
  21505. function(a) {
  21506. a.data.getTarget().is("html") && setTimeout(function() {
  21507. b.editable().focus()
  21508. })
  21509. });
  21510. w(b);
  21511. try {
  21512. b.document.$.execCommand("2D-position", !1, !0)
  21513. } catch (g) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && "CSS1Compat" == b.document.$.compatMode) && this
  21514. .attachListener(this, "keydown", function(a) {
  21515. var d =
  21516. a.data.getKeystroke();
  21517. if (33 == d || 34 == d)
  21518. if (CKEDITOR.env.ie) setTimeout(function() {
  21519. b.getSelection().scrollIntoView()
  21520. }, 0);
  21521. else if (b.window.$.innerHeight > this.$.offsetHeight) {
  21522. var c = b.createRange();
  21523. c[33 == d ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
  21524. c.select();
  21525. a.data.preventDefault()
  21526. }
  21527. });
  21528. CKEDITOR.env.ie && this.attachListener(c, "blur", function() {
  21529. try {
  21530. c.$.selection.empty()
  21531. } catch (a) {}
  21532. });
  21533. CKEDITOR.env.iOS && this.attachListener(c, "touchend", function() {
  21534. a.focus()
  21535. });
  21536. f = b.document.getElementsByTag("title").getItem(0);
  21537. f.data("cke-title", f.getText());
  21538. CKEDITOR.env.ie && (b.document.$.title = this._.docTitle);
  21539. CKEDITOR.tools.setTimeout(function() {
  21540. "unloaded" == this.status && (this.status = "ready");
  21541. b.fire("contentDom");
  21542. this._.isPendingFocus && (b.focus(), this._.isPendingFocus = !1);
  21543. setTimeout(function() {
  21544. b.fire("dataReady")
  21545. }, 0)
  21546. }, 0, this)
  21547. }
  21548. }
  21549. function w(a) {
  21550. function e() {
  21551. var d;
  21552. a.editable().attachListener(a, "selectionChange", function() {
  21553. var c = a.getSelection().getSelectedElement();
  21554. c && (d && (d.detachEvent("onresizestart", b), d = null), c.$.attachEvent("onresizestart",
  21555. b), d = c.$)
  21556. })
  21557. }
  21558. function b(a) {
  21559. a.returnValue = !1
  21560. }
  21561. if (CKEDITOR.env.gecko) try {
  21562. var c = a.document.$;
  21563. c.execCommand("enableObjectResizing", !1, !a.config.disableObjectResizing);
  21564. c.execCommand("enableInlineTableEditing", !1, !a.config.disableNativeTableHandles)
  21565. } catch (f) {} else CKEDITOR.env.ie && 11 > CKEDITOR.env.version && a.config.disableObjectResizing && e()
  21566. }
  21567. function x() {
  21568. var a = [];
  21569. if (8 <= CKEDITOR.document.$.documentMode) {
  21570. a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");
  21571. var e = [],
  21572. b;
  21573. for (b in CKEDITOR.dtd.$removeEmpty) e.push("html.CSS1Compat " +
  21574. b + "[contenteditable\x3dfalse]");
  21575. a.push(e.join(",") + "{display:inline-block}")
  21576. } else CKEDITOR.env.gecko && (a.push("html{height:100% !important}"), a.push(
  21577. "img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));
  21578. a.push("html{cursor:text;*cursor:auto}");
  21579. a.push("img,input,textarea{cursor:default}");
  21580. return a.join("\n")
  21581. }
  21582. var l;
  21583. CKEDITOR.plugins.add("wysiwygarea", {
  21584. init: function(a) {
  21585. a.config.fullPage && a.addFeature({
  21586. allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]",
  21587. requiredContent: "body"
  21588. });
  21589. a.addMode("wysiwyg", function(e) {
  21590. function b(b) {
  21591. b && b.removeListener();
  21592. if (!a.isDestroyed() && !a.isDetached() && (a.editable(new l(a, g.getFrameDocument()
  21593. .getBody())), a.setData(a.getData(1), e), t)) {
  21594. if (u) a.on("mode", c, {
  21595. iframe: g,
  21596. editor: a,
  21597. callback: e
  21598. });
  21599. a.on("mode", function() {
  21600. a.status = "ready"
  21601. });
  21602. f()
  21603. }
  21604. }
  21605. function c(a) {
  21606. a && a.removeListener();
  21607. g.on("load", function() {
  21608. p && (p = !1, d())
  21609. })
  21610. }
  21611. function f() {
  21612. m = new MutationObserver(function(b) {
  21613. for (var c = 0; c < b.length; c++) {
  21614. var e = b[c];
  21615. if ("childList" === e.type && 0 !==
  21616. e.addedNodes.length)
  21617. for (var f = 0; f < e.addedNodes.length; f++) {
  21618. var g = e.addedNodes[f];
  21619. g.contains && g.contains(a.container.$) && (u ? p = !0 : d())
  21620. }
  21621. }
  21622. });
  21623. m.observe(a.config.observableParent, {
  21624. childList: !0,
  21625. subtree: !0
  21626. })
  21627. }
  21628. function d() {
  21629. var b = a.getData(!1),
  21630. c;
  21631. a.editable().preserveIframe = !0;
  21632. a.editable(null);
  21633. c = new l(a, g.getFrameDocument().getBody());
  21634. a.editable(c);
  21635. a.status = "recreating";
  21636. a.setData(b, {
  21637. callback: e,
  21638. internal: !1,
  21639. noSnapshot: !1
  21640. })
  21641. }
  21642. var h = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") +
  21643. "document.close();",
  21644. h = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ?
  21645. "javascript:void(function(){" + encodeURIComponent(h) + "}())" : "",
  21646. g = CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"' + h +
  21647. '" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');
  21648. g.setStyles({
  21649. width: "100%",
  21650. height: "100%"
  21651. });
  21652. g.addClass("cke_wysiwyg_frame").addClass("cke_reset");
  21653. h = a.ui.space("contents");
  21654. h.append(g);
  21655. var r = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.gecko;
  21656. if (r) g.on("load", b);
  21657. var k = a.title,
  21658. n = a.fire("ariaEditorHelpLabel", {}).label,
  21659. p = !1,
  21660. u = CKEDITOR.env.ie && 11 === CKEDITOR.env.version,
  21661. t = !!window.MutationObserver,
  21662. m;
  21663. k && (CKEDITOR.env.ie && n && (k += ", " + n), g.setAttribute("title", k));
  21664. if (n) {
  21665. var k = CKEDITOR.tools.getNextId(),
  21666. q = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + k +
  21667. '" class\x3d"cke_voice_label"\x3e' + n + "\x3c/span\x3e");
  21668. h.append(q, 1);
  21669. g.setAttribute("aria-describedby", k)
  21670. }
  21671. a.on("beforeModeUnload", function(a) {
  21672. a.removeListener();
  21673. q && q.remove();
  21674. t && m.disconnect()
  21675. });
  21676. a.on("destroy", function() {
  21677. m && m.disconnect()
  21678. });
  21679. g.setAttributes({
  21680. tabIndex: a.tabIndex,
  21681. allowTransparency: "true"
  21682. });
  21683. !r && b();
  21684. a.fire("ariaWidget", g)
  21685. })
  21686. }
  21687. });
  21688. CKEDITOR.editor.prototype.addContentsCss = function(a) {
  21689. var e = this.config,
  21690. b = e.contentsCss;
  21691. CKEDITOR.tools.isArray(b) || (e.contentsCss = b ? [b] : []);
  21692. e.contentsCss.push(a)
  21693. };
  21694. l = CKEDITOR.tools.createClass({
  21695. $: function() {
  21696. this.base.apply(this, arguments);
  21697. this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(a) {
  21698. CKEDITOR.tools.setTimeout(v, 0, this, a)
  21699. }, this);
  21700. this._.docTitle = this.getWindow().getFrame().getAttribute("title") || " "
  21701. },
  21702. base: CKEDITOR.editable,
  21703. proto: {
  21704. preserveIframe: !1,
  21705. setData: function(a, e) {
  21706. var b = this.editor;
  21707. if (e) this.setHtml(a), this.fixInitialSelection(), b.fire("dataReady");
  21708. else {
  21709. this._.isLoadingData = !0;
  21710. b._.dataStore = {
  21711. id: 1
  21712. };
  21713. var c = b.config,
  21714. f = c.fullPage,
  21715. d = c.docType,
  21716. h = CKEDITOR.tools.buildStyleHtml(x()).replace(/<style>/, '\x3cstyle data-cke-temp\x3d"1"\x3e');
  21717. f || (h += CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));
  21718. var g = c.baseHref ? '\x3cbase href\x3d"' + c.baseHref + '" data-cke-temp\x3d"1" /\x3e' : "";
  21719. f && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) {
  21720. b.docType =
  21721. d = a;
  21722. return ""
  21723. }).replace(/<\?xml\s[^\?]*\?>/i, function(a) {
  21724. b.xmlDeclaration = a;
  21725. return ""
  21726. }));
  21727. a = b.dataProcessor.toHtml(a);
  21728. f ? (/<body[\s|>]/.test(a) || (a = "\x3cbody\x3e" + a), /<html[\s|>]/.test(a) || (a =
  21729. "\x3chtml\x3e" + a + "\x3c/html\x3e"), /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (
  21730. a = a.replace(/<head[^>]*>/, "$\x26\x3ctitle\x3e\x3c/title\x3e")) : a = a.replace(
  21731. /<html[^>]*>/, "$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"), g && (a = a
  21732. .replace(/<head[^>]*?>/, "$\x26" + g)), a = a.replace(/<\/head\s*>/, h + "$\x26"), a =
  21733. d + a) : a = c.docType + '\x3chtml dir\x3d"' + c.contentsLangDirection + '" lang\x3d"' + (c
  21734. .contentsLanguage || b.langCode) + '"\x3e\x3chead\x3e\x3ctitle\x3e' + this._.docTitle +
  21735. "\x3c/title\x3e" + g + h + "\x3c/head\x3e\x3cbody" + (c.bodyId ? ' id\x3d"' + c.bodyId + '"' :
  21736. "") + (c.bodyClass ? ' class\x3d"' + c.bodyClass + '"' : "") + "\x3e" + a +
  21737. "\x3c/body\x3e\x3c/html\x3e";
  21738. CKEDITOR.env.gecko && (a = a.replace(/<body/, '\x3cbody contenteditable\x3d"true" '), 2E4 >
  21739. CKEDITOR.env.version && (a = a.replace(/<body[^>]*>/,
  21740. "$\x26\x3c!-- cke-content-start --\x3e")));
  21741. a = a.replace(/<body/, '\x3cbody role\x3d"textbox" aria-multiline\x3d"true"');
  21742. b.title && (a = a.replace(/<body/, '\x3cbody aria-label\x3d"' + CKEDITOR.tools.htmlEncodeAttr(b
  21743. .title) + '"'));
  21744. CKEDITOR.env.gecko || (a = a.replace("\x3cbody", '\x3cbody tabindex\x3d"0" '));
  21745. c = '\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"' + (CKEDITOR.env.ie ?
  21746. ' defer\x3d"defer" ' : "") +
  21747. "\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR \x26\x26 window.parent.CKEDITOR.tools.callFunction(" +
  21748. this._.frameLoadedHandler +
  21749. ",window);wasLoaded\x3d1;}" + (CKEDITOR.env.ie ? "onload();" :
  21750. 'document.addEventListener("DOMContentLoaded", onload, false );') + "\x3c/script\x3e";
  21751. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (c +=
  21752. '\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e'
  21753. );
  21754. g && CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (c +=
  21755. '\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e'
  21756. );
  21757. a = a.replace(/(?=\s*<\/(:?head)>)/,
  21758. c);
  21759. this.clearCustomData();
  21760. this.clearListeners();
  21761. b.fire("contentDomUnload");
  21762. var l = this.getDocument();
  21763. try {
  21764. l.write(a)
  21765. } catch (k) {
  21766. setTimeout(function() {
  21767. l.write(a)
  21768. }, 0)
  21769. }
  21770. }
  21771. },
  21772. getData: function(a) {
  21773. if (a) return this.getHtml();
  21774. a = this.editor;
  21775. var e = a.config,
  21776. b = e.fullPage,
  21777. c = b && a.docType,
  21778. f = b && a.xmlDeclaration,
  21779. d = this.getDocument(),
  21780. d = b ? d.getDocumentElement().getOuterHtml() : d.getBody().getHtml();
  21781. CKEDITOR.env.gecko && e.enterMode != CKEDITOR.ENTER_BR && (d = d.replace(
  21782. /<br>(?=\s*(:?$|<\/body>))/, ""));
  21783. b && (d = d.replace(/<body(.*?)role="?textbox"?/i,
  21784. "\x3cbody$1").replace(/<body(.*?)aria-multiline="?true"?/i, "\x3cbody$1").replace(
  21785. /<body(.*?)tabindex="?0"?/i, "\x3cbody$1").replace(/<body(.*?)aria-label="(.+?)"/i,
  21786. "\x3cbody$1").replace(/<body(.*?)aria-readonly="?(?:true|false)"?/i, "\x3cbody$1"));
  21787. d = a.dataProcessor.toDataFormat(d);
  21788. f && (d = f + "\n" + d);
  21789. c && (d = c + "\n" + d);
  21790. return d
  21791. },
  21792. focus: function() {
  21793. this._.isLoadingData ? this._.isPendingFocus = !0 : l.baseProto.focus.call(this)
  21794. },
  21795. detach: function() {
  21796. if (!this.preserveIframe) {
  21797. var a = this.editor,
  21798. e = a.document,
  21799. a = a.container.findOne("iframe.cke_wysiwyg_frame");
  21800. l.baseProto.detach.call(this);
  21801. this.clearCustomData(this._.expandoNumber);
  21802. e.getDocumentElement().clearCustomData();
  21803. CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
  21804. a && (a.clearCustomData(), (e = a.removeCustomData("onResize")) && e.removeListener(), a
  21805. .isDetached() || a.remove())
  21806. }
  21807. }
  21808. }
  21809. })
  21810. })();
  21811. CKEDITOR.config.disableObjectResizing = !1;
  21812. CKEDITOR.config.disableNativeTableHandles = !0;
  21813. CKEDITOR.config.disableNativeSpellChecker = !0;
  21814. CKEDITOR.config.observableParent = CKEDITOR.document.$;
  21815. (function() {
  21816. function e(b, a) {
  21817. a || (a = b.getSelection().getSelectedElement());
  21818. if (a && a.is("img") && !a.data("cke-realelement") && !a.isReadOnly()) return a
  21819. }
  21820. function f(b) {
  21821. var a = b.getStyle("float");
  21822. if ("inherit" == a || "none" == a) a = 0;
  21823. a || (a = b.getAttribute("align"));
  21824. return a
  21825. }
  21826. CKEDITOR.plugins.add("image", {
  21827. requires: "dialog",
  21828. init: function(b) {
  21829. if (!b.plugins.detectConflict("image", ["easyimage", "image2"])) {
  21830. CKEDITOR.dialog.add("image", this.path + "dialogs/image.js");
  21831. var a =
  21832. "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
  21833. CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (a =
  21834. "img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");
  21835. b.addCommand("image", new CKEDITOR.dialogCommand("image", {
  21836. allowedContent: a,
  21837. requiredContent: "img[alt,src]",
  21838. contentTransformations: [
  21839. ["img{width}: sizeToStyle", "img[width]: sizeToAttribute"],
  21840. ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"]
  21841. ]
  21842. }));
  21843. b.ui.addButton && b.ui.addButton("Image", {
  21844. label: b.lang.common.image,
  21845. command: "image",
  21846. toolbar: "insert,10"
  21847. });
  21848. b.on("doubleclick", function(b) {
  21849. var a =
  21850. b.data.element;
  21851. !a.is("img") || a.data("cke-realelement") || a.isReadOnly() || (b.data.dialog = "image")
  21852. });
  21853. b.addMenuItems && b.addMenuItems({
  21854. image: {
  21855. label: b.lang.image.menu,
  21856. command: "image",
  21857. group: "image"
  21858. }
  21859. });
  21860. b.contextMenu && b.contextMenu.addListener(function(a) {
  21861. if (e(b, a)) return {
  21862. image: CKEDITOR.TRISTATE_OFF
  21863. }
  21864. })
  21865. }
  21866. },
  21867. afterInit: function(b) {
  21868. function a(a) {
  21869. var d = b.getCommand("justify" + a);
  21870. if (d) {
  21871. if ("left" == a || "right" == a) d.on("exec", function(d) {
  21872. var c = e(b),
  21873. g;
  21874. c && (g = f(c), g == a ? (c.removeStyle("float"), a == f(c) && c.removeAttribute("align")) :
  21875. c.setStyle("float", a), d.cancel())
  21876. });
  21877. d.on("refresh", function(d) {
  21878. var c = e(b);
  21879. c && (c = f(c), this.setState(c == a ? CKEDITOR.TRISTATE_ON : "right" == a || "left" == a ?
  21880. CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED), d.cancel())
  21881. })
  21882. }
  21883. }
  21884. b.plugins.image2 || (a("left"), a("right"), a("center"), a("block"))
  21885. }
  21886. })
  21887. })();
  21888. CKEDITOR.config.image_removeLinkByEmptyURL = !0;
  21889. (function() {
  21890. function m(a, b) {
  21891. var e, f;
  21892. b.on("refresh", function(a) {
  21893. var b = [k],
  21894. c;
  21895. for (c in a.data.states) b.push(a.data.states[c]);
  21896. this.setState(CKEDITOR.tools.search(b, p) ? p : k)
  21897. }, b, null, 100);
  21898. b.on("exec", function(b) {
  21899. e = a.getSelection();
  21900. f = e.createBookmarks(1);
  21901. b.data || (b.data = {});
  21902. b.data.done = !1
  21903. }, b, null, 0);
  21904. b.on("exec", function() {
  21905. a.forceNextSelectionCheck();
  21906. e.selectBookmarks(f)
  21907. }, b, null, 100)
  21908. }
  21909. var k = CKEDITOR.TRISTATE_DISABLED,
  21910. p = CKEDITOR.TRISTATE_OFF;
  21911. CKEDITOR.plugins.add("indent", {
  21912. init: function(a) {
  21913. var b = CKEDITOR.plugins.indent.genericDefinition;
  21914. m(a, a.addCommand("indent", new b(!0)));
  21915. m(a, a.addCommand("outdent", new b));
  21916. a.ui.addButton && (a.ui.addButton("Indent", {
  21917. label: a.lang.indent.indent,
  21918. command: "indent",
  21919. directional: !0,
  21920. toolbar: "indent,20"
  21921. }), a.ui.addButton("Outdent", {
  21922. label: a.lang.indent.outdent,
  21923. command: "outdent",
  21924. directional: !0,
  21925. toolbar: "indent,10"
  21926. }));
  21927. a.on("dirChanged", function(b) {
  21928. var f = a.createRange(),
  21929. l = b.data.node;
  21930. f.setStartBefore(l);
  21931. f.setEndAfter(l);
  21932. for (var n = new CKEDITOR.dom.walker(f), c; c = n.next();)
  21933. if (c.type == CKEDITOR.NODE_ELEMENT)
  21934. if (!c.equals(l) &&
  21935. c.getDirection()) f.setStartAfter(c), n = new CKEDITOR.dom.walker(f);
  21936. else {
  21937. var d = a.config.indentClasses;
  21938. if (d)
  21939. for (var g = "ltr" == b.data.dir ? ["_rtl", ""] : ["", "_rtl"], h = 0; h < d
  21940. .length; h++) c.hasClass(d[h] + g[0]) && (c.removeClass(d[h] + g[0]), c.addClass(d[
  21941. h] + g[1]));
  21942. d = c.getStyle("margin-right");
  21943. g = c.getStyle("margin-left");
  21944. d ? c.setStyle("margin-left", d) : c.removeStyle("margin-left");
  21945. g ? c.setStyle("margin-right", g) : c.removeStyle("margin-right")
  21946. }
  21947. })
  21948. }
  21949. });
  21950. CKEDITOR.plugins.indent = {
  21951. genericDefinition: function(a) {
  21952. this.isIndent = !!a;
  21953. this.startDisabled = !this.isIndent
  21954. },
  21955. specificDefinition: function(a, b, e) {
  21956. this.name = b;
  21957. this.editor = a;
  21958. this.jobs = {};
  21959. this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
  21960. this.isIndent = !!e;
  21961. this.relatedGlobal = e ? "indent" : "outdent";
  21962. this.indentKey = e ? 9 : CKEDITOR.SHIFT + 9;
  21963. this.database = {}
  21964. },
  21965. registerCommands: function(a, b) {
  21966. a.on("pluginsLoaded", function() {
  21967. for (var a in b)(function(a, b) {
  21968. var e = a.getCommand(b.relatedGlobal),
  21969. c;
  21970. for (c in b.jobs) e.on("exec", function(d) {
  21971. d.data.done || (a.fire("lockSnapshot"), b.execJob(a, c) && (d.data.done = !0), a.fire(
  21972. "unlockSnapshot"), CKEDITOR.dom.element.clearAllMarkers(b.database))
  21973. }, this, null, c), e.on("refresh", function(d) {
  21974. d.data.states || (d.data.states = {});
  21975. d.data.states[b.name + "@" + c] = b.refreshJob(a, c, d.data.path)
  21976. }, this, null, c);
  21977. a.addFeature(b)
  21978. })(this, b[a])
  21979. })
  21980. }
  21981. };
  21982. CKEDITOR.plugins.indent.genericDefinition.prototype = {
  21983. context: "p",
  21984. exec: function() {}
  21985. };
  21986. CKEDITOR.plugins.indent.specificDefinition.prototype = {
  21987. execJob: function(a, b) {
  21988. var e = this.jobs[b];
  21989. if (e.state != k) return e.exec.call(this, a)
  21990. },
  21991. refreshJob: function(a,
  21992. b, e) {
  21993. b = this.jobs[b];
  21994. a.activeFilter.checkFeature(this) ? b.state = b.refresh.call(this, a, e) : b.state = k;
  21995. return b.state
  21996. },
  21997. getContext: function(a) {
  21998. return a.contains(this.context)
  21999. }
  22000. }
  22001. })();
  22002. (function() {
  22003. function f(b, c, a) {
  22004. if (!b.getCustomData("indent_processed")) {
  22005. var d = this.editor,
  22006. l = this.isIndent;
  22007. if (c) {
  22008. d = b.$.className.match(this.classNameRegex);
  22009. a = 0;
  22010. d && (d = d[1], a = CKEDITOR.tools.indexOf(c, d) + 1);
  22011. if (0 > (a += l ? 1 : -1)) return;
  22012. a = Math.min(a, c.length);
  22013. a = Math.max(a, 0);
  22014. b.$.className = CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex, ""));
  22015. 0 < a && b.addClass(c[a - 1])
  22016. } else {
  22017. c = m(b, a);
  22018. a = parseInt(b.getStyle(c), 10);
  22019. var g = d.config.indentOffset || 40;
  22020. isNaN(a) && (a = 0);
  22021. a += (l ? 1 : -1) * g;
  22022. if (0 > a) return;
  22023. a = Math.max(a,
  22024. 0);
  22025. a = Math.ceil(a / g) * g;
  22026. b.setStyle(c, a ? a + (d.config.indentUnit || "px") : "");
  22027. "" === b.getAttribute("style") && b.removeAttribute("style")
  22028. }
  22029. CKEDITOR.dom.element.setMarker(this.database, b, "indent_processed", 1)
  22030. }
  22031. }
  22032. function m(b, c) {
  22033. return "ltr" == (c || b.getComputedStyle("direction")) ? "margin-left" : "margin-right"
  22034. }
  22035. var h = CKEDITOR.dtd.$listItem,
  22036. p = CKEDITOR.dtd.$list,
  22037. k = CKEDITOR.TRISTATE_DISABLED,
  22038. n = CKEDITOR.TRISTATE_OFF;
  22039. CKEDITOR.plugins.add("indentblock", {
  22040. requires: "indent",
  22041. init: function(b) {
  22042. function c() {
  22043. a.specificDefinition.apply(this,
  22044. arguments);
  22045. this.allowedContent = {
  22046. "div h1 h2 h3 h4 h5 h6 ol p pre ul": {
  22047. propertiesOnly: !0,
  22048. styles: d ? null : "margin-left,margin-right",
  22049. classes: d || null
  22050. }
  22051. };
  22052. this.contentTransformations = [
  22053. ["div: splitMarginShorthand"],
  22054. ["h1: splitMarginShorthand"],
  22055. ["h2: splitMarginShorthand"],
  22056. ["h3: splitMarginShorthand"],
  22057. ["h4: splitMarginShorthand"],
  22058. ["h5: splitMarginShorthand"],
  22059. ["h6: splitMarginShorthand"],
  22060. ["ol: splitMarginShorthand"],
  22061. ["p: splitMarginShorthand"],
  22062. ["pre: splitMarginShorthand"],
  22063. ["ul: splitMarginShorthand"]
  22064. ];
  22065. this.enterBr &&
  22066. (this.allowedContent.div = !0);
  22067. this.requiredContent = (this.enterBr ? "div" : "p") + (d ? "(" + d.join(",") + ")" :
  22068. "{margin-left}");
  22069. this.jobs = {
  22070. 20: {
  22071. refresh: function(a, b) {
  22072. var e = b.block || b.blockLimit;
  22073. if (!e.is(h)) var c = e.getAscendant(h),
  22074. e = c && b.contains(c) || e;
  22075. e.is(h) && (e = e.getParent());
  22076. if (this.enterBr || this.getContext(b)) {
  22077. if (d) {
  22078. var c = d,
  22079. e = e.$.className.match(this.classNameRegex),
  22080. f = this.isIndent,
  22081. c = e ? f ? e[1] != c.slice(-1) : !0 : f;
  22082. return c ? n : k
  22083. }
  22084. return this.isIndent ? n : e ? CKEDITOR[0 >= (parseInt(e.getStyle(m(e)), 10) || 0) ?
  22085. "TRISTATE_DISABLED" :
  22086. "TRISTATE_OFF"] : k
  22087. }
  22088. return k
  22089. },
  22090. exec: function(a) {
  22091. var b = a.getSelection(),
  22092. b = b && b.getRanges()[0],
  22093. c;
  22094. if (c = a.elementPath().contains(p)) f.call(this, c, d);
  22095. else
  22096. for (b = b.createIterator(), a = a.config.enterMode, b.enforceRealBlocks = !0, b
  22097. .enlargeBr = a != CKEDITOR.ENTER_BR; c = b.getNextParagraph(a == CKEDITOR.ENTER_P ?
  22098. "p" : "div");) c.isReadOnly() || f.call(this, c, d);
  22099. return !0
  22100. }
  22101. }
  22102. }
  22103. }
  22104. var a = CKEDITOR.plugins.indent,
  22105. d = b.config.indentClasses;
  22106. a.registerCommands(b, {
  22107. indentblock: new c(b, "indentblock", !0),
  22108. outdentblock: new c(b, "outdentblock")
  22109. });
  22110. CKEDITOR.tools.extend(c.prototype, a.specificDefinition.prototype, {
  22111. context: {
  22112. div: 1,
  22113. dl: 1,
  22114. h1: 1,
  22115. h2: 1,
  22116. h3: 1,
  22117. h4: 1,
  22118. h5: 1,
  22119. h6: 1,
  22120. ul: 1,
  22121. ol: 1,
  22122. p: 1,
  22123. pre: 1,
  22124. table: 1
  22125. },
  22126. classNameRegex: d ? new RegExp("(?:^|\\s+)(" + d.join("|") + ")(?\x3d$|\\s)") : null
  22127. })
  22128. }
  22129. })
  22130. })();
  22131. (function() {
  22132. function w(f) {
  22133. function g(b) {
  22134. for (var e = c.startContainer, a = c.endContainer; e && !e.getParent().equals(b);) e = e.getParent();
  22135. for (; a && !a.getParent().equals(b);) a = a.getParent();
  22136. if (!e || !a) return !1;
  22137. for (var d = [], h = !1; !h;) e.equals(a) && (h = !0), d.push(e), e = e.getNext();
  22138. if (1 > d.length) return !1;
  22139. e = b.getParents(!0);
  22140. for (a = 0; a < e.length; a++)
  22141. if (e[a].getName && p[e[a].getName()]) {
  22142. b = e[a];
  22143. break
  22144. } for (var e = k.isIndent ? 1 : -1, a = d[0], d = d[d.length - 1], h = CKEDITOR.plugins.list.listToArray(
  22145. b, q), m = h[d.getCustomData("listarray_index")].indent,
  22146. a = a.getCustomData("listarray_index"); a <= d.getCustomData("listarray_index"); a++)
  22147. if (h[a].indent += e, 0 < e) {
  22148. for (var g = h[a].parent, n = a - 1; 0 <= n; n--)
  22149. if (h[n].indent === e) {
  22150. g = h[n].parent;
  22151. break
  22152. } h[a].parent = new CKEDITOR.dom.element(g.getName(), g.getDocument())
  22153. } for (a = d.getCustomData("listarray_index") + 1; a < h.length && h[a].indent > m; a++) h[a].indent += e;
  22154. e = CKEDITOR.plugins.list.arrayToList(h, q, null, f.config.enterMode, b.getDirection());
  22155. if (!k.isIndent) {
  22156. var t;
  22157. if ((t = b.getParent()) && t.is("li"))
  22158. for (var d = e.listNode.getChildren(),
  22159. r = [], l, a = d.count() - 1; 0 <= a; a--)(l = d.getItem(a)) && l.is && l.is("li") && r.push(l)
  22160. }
  22161. e && e.listNode.replace(b);
  22162. if (r && r.length)
  22163. for (a = 0; a < r.length; a++) {
  22164. for (l = b = r[a];
  22165. (l = l.getNext()) && l.is && l.getName() in p;) CKEDITOR.env.needsNbspFiller && !b.getFirst(x) && b
  22166. .append(c.document.createText(" ")), b.append(l);
  22167. b.insertAfter(t)
  22168. }
  22169. e && f.fire("contentDomInvalidated");
  22170. return !0
  22171. }
  22172. for (var k = this, q = this.database, p = this.context, c, m = f.getSelection(), m = (m && m.getRanges())
  22173. .createIterator(); c = m.getNextRange();) {
  22174. for (var b = c.getCommonAncestor(); b &&
  22175. (b.type != CKEDITOR.NODE_ELEMENT || !p[b.getName()]);) {
  22176. if (f.editable().equals(b)) {
  22177. b = !1;
  22178. break
  22179. }
  22180. b = b.getParent()
  22181. }
  22182. b || (b = c.startPath().contains(p)) && c.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
  22183. if (!b) {
  22184. var d = c.getEnclosedNode();
  22185. d && d.type == CKEDITOR.NODE_ELEMENT && d.getName() in p && (c.setStartAt(d, CKEDITOR
  22186. .POSITION_AFTER_START), c.setEndAt(d, CKEDITOR.POSITION_BEFORE_END), b = d)
  22187. }
  22188. b && c.startContainer.type == CKEDITOR.NODE_ELEMENT && c.startContainer.getName() in p && (d = new CKEDITOR
  22189. .dom.walker(c), d.evaluator = n, c.startContainer =
  22190. d.next());
  22191. b && c.endContainer.type == CKEDITOR.NODE_ELEMENT && c.endContainer.getName() in p && (d = new CKEDITOR.dom
  22192. .walker(c), d.evaluator = n, c.endContainer = d.previous());
  22193. if (b) return g(b)
  22194. }
  22195. return 0
  22196. }
  22197. function n(f) {
  22198. return f.type == CKEDITOR.NODE_ELEMENT && f.is("li")
  22199. }
  22200. function x(f) {
  22201. return y(f) && z(f)
  22202. }
  22203. var y = CKEDITOR.dom.walker.whitespaces(!0),
  22204. z = CKEDITOR.dom.walker.bookmark(!1, !0),
  22205. u = CKEDITOR.TRISTATE_DISABLED,
  22206. v = CKEDITOR.TRISTATE_OFF;
  22207. CKEDITOR.plugins.add("indentlist", {
  22208. requires: "indent",
  22209. init: function(f) {
  22210. function g(f) {
  22211. k.specificDefinition.apply(this,
  22212. arguments);
  22213. this.requiredContent = ["ul", "ol"];
  22214. f.on("key", function(g) {
  22215. var c = f.elementPath();
  22216. if ("wysiwyg" == f.mode && g.data.keyCode == this.indentKey && c) {
  22217. var m = this.getContext(c);
  22218. !m || this.isIndent && CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, m) || (f
  22219. .execCommand(this.relatedGlobal), g.cancel())
  22220. }
  22221. }, this);
  22222. this.jobs[this.isIndent ? 10 : 30] = {
  22223. refresh: this.isIndent ? function(f, c) {
  22224. var g = this.getContext(c),
  22225. b = CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, g);
  22226. return g && this.isIndent && !b ? v : u
  22227. } : function(f,
  22228. c) {
  22229. return !this.getContext(c) || this.isIndent ? u : v
  22230. },
  22231. exec: CKEDITOR.tools.bind(w, this)
  22232. }
  22233. }
  22234. var k = CKEDITOR.plugins.indent;
  22235. k.registerCommands(f, {
  22236. indentlist: new g(f, "indentlist", !0),
  22237. outdentlist: new g(f, "outdentlist")
  22238. });
  22239. CKEDITOR.tools.extend(g.prototype, k.specificDefinition.prototype, {
  22240. context: {
  22241. ol: 1,
  22242. ul: 1
  22243. }
  22244. })
  22245. }
  22246. });
  22247. CKEDITOR.plugins.indentList = {};
  22248. CKEDITOR.plugins.indentList.firstItemInPath = function(f, g, k) {
  22249. var q = g.contains(n);
  22250. k || (k = g.contains(f));
  22251. return k && q && q.equals(k.getFirst(n))
  22252. }
  22253. })();
  22254. CKEDITOR.plugins.add("smiley", {
  22255. requires: "dialog",
  22256. init: function(a) {
  22257. a.config.smiley_path = a.config.smiley_path || this.path + "images/";
  22258. a.addCommand("smiley", new CKEDITOR.dialogCommand("smiley", {
  22259. allowedContent: "img[alt,height,!src,title,width]",
  22260. requiredContent: "img"
  22261. }));
  22262. a.ui.addButton && a.ui.addButton("Smiley", {
  22263. label: a.lang.smiley.toolbar,
  22264. command: "smiley",
  22265. toolbar: "insert,50"
  22266. });
  22267. CKEDITOR.dialog.add("smiley", this.path + "dialogs/smiley.js")
  22268. }
  22269. });
  22270. CKEDITOR.config.smiley_images =
  22271. "regular_smile.png sad_smile.png wink_smile.png teeth_smile.png confused_smile.png tongue_smile.png embarrassed_smile.png omg_smile.png whatchutalkingabout_smile.png angry_smile.png angel_smile.png shades_smile.png devil_smile.png cry_smile.png lightbulb.png thumbs_down.png thumbs_up.png heart.png broken_heart.png kiss.png envelope.png"
  22272. .split(" ");
  22273. CKEDITOR.config.smiley_descriptions =
  22274. "smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail"
  22275. .split(";");
  22276. (function() {
  22277. function p(a, c) {
  22278. var b;
  22279. if (c) b = a.getComputedStyle("text-align");
  22280. else {
  22281. for (; !a.hasAttribute || !a.hasAttribute("align") && !a.getStyle("text-align");) {
  22282. b = a.getParent();
  22283. if (!b) break;
  22284. a = b
  22285. }
  22286. b = a.getStyle("text-align") || a.getAttribute("align") || ""
  22287. }
  22288. b && (b = b.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i, ""));
  22289. !b && c && (b = "rtl" == a.getComputedStyle("direction") ? "right" : "left");
  22290. return b
  22291. }
  22292. function h(a, c, b) {
  22293. this.editor = a;
  22294. this.name = c;
  22295. this.value = b;
  22296. this.context = "p";
  22297. c = a.config.justifyClasses;
  22298. var f = a.config.enterMode ==
  22299. CKEDITOR.ENTER_P ? "p" : "div";
  22300. if (c) {
  22301. switch (b) {
  22302. case "left":
  22303. this.cssClassName = c[0];
  22304. break;
  22305. case "center":
  22306. this.cssClassName = c[1];
  22307. break;
  22308. case "right":
  22309. this.cssClassName = c[2];
  22310. break;
  22311. case "justify":
  22312. this.cssClassName = c[3]
  22313. }
  22314. this.cssClassRegex = new RegExp("(?:^|\\s+)(?:" + c.join("|") + ")(?\x3d$|\\s)");
  22315. this.requiredContent = f + "(" + this.cssClassName + ")"
  22316. } else this.requiredContent = f + "{text-align}";
  22317. this.allowedContent = {
  22318. "caption div h1 h2 h3 h4 h5 h6 p pre td th li": {
  22319. propertiesOnly: !0,
  22320. styles: this.cssClassName ? null : "text-align",
  22321. classes: this.cssClassName || null
  22322. }
  22323. };
  22324. a.config.enterMode == CKEDITOR.ENTER_BR && (this.allowedContent.div = !0)
  22325. }
  22326. function l(a) {
  22327. var c = a.editor,
  22328. b = c.createRange();
  22329. b.setStartBefore(a.data.node);
  22330. b.setEndAfter(a.data.node);
  22331. for (var f = new CKEDITOR.dom.walker(b), d; d = f.next();)
  22332. if (d.type == CKEDITOR.NODE_ELEMENT)
  22333. if (!d.equals(a.data.node) && d.getDirection()) b.setStartAfter(d), f = new CKEDITOR.dom.walker(b);
  22334. else {
  22335. var e = c.config.justifyClasses;
  22336. e && (d.hasClass(e[0]) ? (d.removeClass(e[0]), d.addClass(e[2])) : d.hasClass(e[2]) && (d.removeClass(e[
  22337. 2]),
  22338. d.addClass(e[0])));
  22339. e = d.getStyle("text-align");
  22340. "left" == e ? d.setStyle("text-align", "right") : "right" == e && d.setStyle("text-align", "left")
  22341. }
  22342. }
  22343. h.prototype = {
  22344. exec: function(a) {
  22345. var c = a.getSelection(),
  22346. b = a.config.enterMode;
  22347. if (c) {
  22348. for (var f = c.createBookmarks(), d = c.getRanges(), e = this.cssClassName, h, g, l = a.config
  22349. .useComputedState, m = d.length - 1; 0 <= m; m--)
  22350. for (h = d[m].createIterator(), h.enlargeBr = b != CKEDITOR.ENTER_BR; g = h.getNextParagraph(b ==
  22351. CKEDITOR.ENTER_P ? "p" : "div");)
  22352. if (!g.isReadOnly()) {
  22353. var k = g.getName(),
  22354. n;
  22355. n = a.activeFilter.check(k +
  22356. "{text-align}");
  22357. if ((k = a.activeFilter.check(k + "(" + e + ")")) || n) {
  22358. g.removeAttribute("align");
  22359. g.removeStyle("text-align");
  22360. var r = e && (g.$.className = CKEDITOR.tools.ltrim(g.$.className.replace(this.cssClassRegex,
  22361. ""))),
  22362. q = this.state == CKEDITOR.TRISTATE_OFF && (!l || p(g, !0) != this.value);
  22363. e && k ? q ? g.addClass(e) : r || g.removeAttribute("class") : q && n && g.setStyle(
  22364. "text-align", this.value)
  22365. }
  22366. } a.focus();
  22367. a.forceNextSelectionCheck();
  22368. c.selectBookmarks(f)
  22369. }
  22370. },
  22371. refresh: function(a, c) {
  22372. var b = c.block || c.blockLimit,
  22373. f = b.getName(),
  22374. d = b.equals(a.editable()),
  22375. f = this.cssClassName ? a.activeFilter.check(f + "(" + this.cssClassName + ")") : a.activeFilter
  22376. .check(f + "{text-align}");
  22377. d && !CKEDITOR.dtd.$list[c.lastElement.getName()] ? this.setState(CKEDITOR.TRISTATE_OFF) : !d && f ?
  22378. this.setState(p(b, this.editor.config.useComputedState) == this.value ? CKEDITOR.TRISTATE_ON :
  22379. CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  22380. }
  22381. };
  22382. CKEDITOR.plugins.add("justify", {
  22383. init: function(a) {
  22384. if (!a.blockless) {
  22385. var c = new h(a, "justifyleft", "left"),
  22386. b = new h(a, "justifycenter", "center"),
  22387. f = new h(a,
  22388. "justifyright", "right"),
  22389. d = new h(a, "justifyblock", "justify");
  22390. a.addCommand("justifyleft", c);
  22391. a.addCommand("justifycenter", b);
  22392. a.addCommand("justifyright", f);
  22393. a.addCommand("justifyblock", d);
  22394. a.ui.addButton && (a.ui.addButton("JustifyLeft", {
  22395. isToggle: !0,
  22396. label: a.lang.common.alignLeft,
  22397. command: "justifyleft",
  22398. toolbar: "align,10"
  22399. }), a.ui.addButton("JustifyCenter", {
  22400. isToggle: !0,
  22401. label: a.lang.common.center,
  22402. command: "justifycenter",
  22403. toolbar: "align,20"
  22404. }), a.ui.addButton("JustifyRight", {
  22405. isToggle: !0,
  22406. label: a.lang.common.alignRight,
  22407. command: "justifyright",
  22408. toolbar: "align,30"
  22409. }), a.ui.addButton("JustifyBlock", {
  22410. isToggle: !0,
  22411. label: a.lang.common.justify,
  22412. command: "justifyblock",
  22413. toolbar: "align,40"
  22414. }));
  22415. a.on("dirChanged", l)
  22416. }
  22417. }
  22418. })
  22419. })();
  22420. CKEDITOR.plugins.add("menubutton", {
  22421. requires: "button,menu",
  22422. onLoad: function() {
  22423. var d = function(c) {
  22424. var a = this._,
  22425. d = CKEDITOR.document.getById(a.id),
  22426. b = a.menu;
  22427. a.state !== CKEDITOR.TRISTATE_DISABLED && (a.on && b ? b.hide() : (a.previousState = a.state, b || (
  22428. b = a.menu = new CKEDITOR.menu(c, {
  22429. panel: {
  22430. className: "cke_menu_panel",
  22431. attributes: {
  22432. "aria-label": c.lang.common.options
  22433. }
  22434. }
  22435. }), b.onHide = CKEDITOR.tools.bind(function() {
  22436. var b = this.command ? c.getCommand(this.command).modes : this.modes;
  22437. this.setState(!b || b[c.mode] ? a.previousState : CKEDITOR.TRISTATE_DISABLED);
  22438. a.on = 0;
  22439. d.setAttribute("aria-expanded", "false")
  22440. }, this), this.onMenu && b.addListener(this.onMenu)), this.setState(CKEDITOR.TRISTATE_ON), a
  22441. .on = 1, d.setAttribute("aria-expanded", "true"), setTimeout(function() {
  22442. b.show(CKEDITOR.document.getById(a.id), 4)
  22443. }, 0)))
  22444. };
  22445. CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({
  22446. base: CKEDITOR.ui.button,
  22447. $: function(c) {
  22448. delete c.panel;
  22449. this.base(c);
  22450. this.hasArrow = "menu";
  22451. this.click = d
  22452. },
  22453. statics: {
  22454. handler: {
  22455. create: function(c) {
  22456. return new CKEDITOR.ui.menuButton(c)
  22457. }
  22458. }
  22459. }
  22460. })
  22461. },
  22462. beforeInit: function(d) {
  22463. d.ui.addHandler(CKEDITOR.UI_MENUBUTTON,
  22464. CKEDITOR.ui.menuButton.handler)
  22465. }
  22466. });
  22467. CKEDITOR.UI_MENUBUTTON = "menubutton";
  22468. (function() {
  22469. CKEDITOR.plugins.add("language", {
  22470. requires: "menubutton",
  22471. init: function(a) {
  22472. var c = a.config.language_list || ["ar:Arabic:rtl", "fr:French", "es:Spanish"],
  22473. f = this,
  22474. d = a.lang.language,
  22475. e = {},
  22476. h, k, l, g;
  22477. a.addCommand("language", {
  22478. allowedContent: "span[!lang,dir]",
  22479. requiredContent: "span[lang]",
  22480. contextSensitive: !0,
  22481. exec: function(b, a) {
  22482. var c = e["language_" + a];
  22483. if (c) b[c.style.checkActive(b.elementPath(), b) ? "removeStyle" : "applyStyle"](c.style)
  22484. },
  22485. refresh: function(b) {
  22486. this.setState(f.getCurrentLangElement(b) ? CKEDITOR.TRISTATE_ON :
  22487. CKEDITOR.TRISTATE_OFF)
  22488. }
  22489. });
  22490. for (g = 0; g < c.length; g++) h = c[g].split(":"), k = h[0], l = "language_" + k, e[l] = {
  22491. label: h[1],
  22492. langId: k,
  22493. group: "language",
  22494. order: g,
  22495. ltr: "rtl" != ("" + h[2]).toLowerCase(),
  22496. onClick: function() {
  22497. a.execCommand("language", this.langId)
  22498. },
  22499. role: "menuitemcheckbox"
  22500. }, e[l].style = new CKEDITOR.style({
  22501. element: "span",
  22502. attributes: {
  22503. lang: k,
  22504. dir: e[l].ltr ? "ltr" : "rtl"
  22505. }
  22506. });
  22507. e.language_remove = {
  22508. label: d.remove,
  22509. group: "language_remove",
  22510. state: CKEDITOR.TRISTATE_DISABLED,
  22511. order: e.length,
  22512. onClick: function() {
  22513. var b = f.getCurrentLangElement(a);
  22514. b && a.execCommand("language", b.getAttribute("lang"))
  22515. }
  22516. };
  22517. a.addMenuGroup("language", 1);
  22518. a.addMenuGroup("language_remove");
  22519. a.addMenuItems(e);
  22520. a.ui.add("Language", CKEDITOR.UI_MENUBUTTON, {
  22521. label: d.button,
  22522. allowedContent: "span[!lang,dir]",
  22523. requiredContent: "span[lang]",
  22524. toolbar: "bidi,30",
  22525. command: "language",
  22526. contentTransformations: [
  22527. [{
  22528. element: "span",
  22529. left: function(b) {
  22530. return b.attributes.lang && (!b.attributes.dir || "" === b.attributes.dir)
  22531. },
  22532. right: function(b) {
  22533. var a = CKEDITOR.tools.object.keys(CKEDITOR.lang.rtl),
  22534. a = -1 !== CKEDITOR.tools.array.indexOf(a,
  22535. b.attributes.lang) ? "rtl" : "ltr";
  22536. b.attributes.dir = a
  22537. }
  22538. }]
  22539. ],
  22540. onMenu: function() {
  22541. var b = {},
  22542. c = f.getCurrentLangElement(a),
  22543. d;
  22544. for (d in e) b[d] = CKEDITOR.TRISTATE_OFF;
  22545. b.language_remove = c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  22546. c && (b["language_" + c.getAttribute("lang")] = CKEDITOR.TRISTATE_ON);
  22547. return b
  22548. }
  22549. });
  22550. a.addRemoveFormatFilter && a.addRemoveFormatFilter(function(a) {
  22551. return !(a.is("span") && a.getAttribute("dir") && a.getAttribute("lang"))
  22552. })
  22553. },
  22554. getCurrentLangElement: function(a) {
  22555. var c = a.elementPath();
  22556. a = c && c.elements;
  22557. var f;
  22558. if (c)
  22559. for (var d = 0; d < a.length; d++) c = a[d], !f && "span" == c.getName() && c.hasAttribute(
  22560. "lang") && (f = c);
  22561. return f
  22562. }
  22563. })
  22564. })();
  22565. (function() {
  22566. function p(c) {
  22567. return c.replace(/'/g, "\\$\x26")
  22568. }
  22569. function q(c) {
  22570. for (var b = c.length, a = [], e, f = 0; f < b; f++) e = c.charCodeAt(f), a.push(e);
  22571. return "String.fromCharCode(" + a.join(",") + ")"
  22572. }
  22573. function r(c, b) {
  22574. for (var a = c.plugins.link, e = a.compiledProtectionFunction.params, a = [a.compiledProtectionFunction.name,
  22575. "("
  22576. ], f, d, g = 0; g < e.length; g++) f = e[g].toLowerCase(), d = b[f], 0 < g && a.push(","), a.push("'", d ?
  22577. p(encodeURIComponent(b[f])) : "", "'");
  22578. a.push(")");
  22579. return a.join("")
  22580. }
  22581. function n(c) {
  22582. c = c.config.emailProtection || "";
  22583. var b;
  22584. c && "encode" != c && (b = {}, c.replace(/^([^(]+)\(([^)]+)\)$/, function(a, c, f) {
  22585. b.name = c;
  22586. b.params = [];
  22587. f.replace(/[^,\s]+/g, function(a) {
  22588. b.params.push(a)
  22589. })
  22590. }));
  22591. return b
  22592. }
  22593. CKEDITOR.plugins.add("link", {
  22594. requires: "dialog,fakeobjects",
  22595. onLoad: function() {
  22596. function c(b) {
  22597. return a.replace(/%1/g, "rtl" == b ? "right" : "left").replace(/%2/g, "cke_contents_" + b)
  22598. }
  22599. var b = "background:url(" + CKEDITOR.getUrl(this.path + "images" + (CKEDITOR.env.hidpi ? "/hidpi" :
  22600. "") + "/anchor.png") + ") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
  22601. a =
  22602. ".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{" +
  22603. b + "padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{" + b +
  22604. "width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
  22605. CKEDITOR.addCss(c("ltr") + c("rtl"))
  22606. },
  22607. init: function(c) {
  22608. var b = "a[!href]";
  22609. CKEDITOR.dialog.isTabEnabled(c, "link", "advanced") && (b = b.replace("]",
  22610. ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)"));
  22611. CKEDITOR.dialog.isTabEnabled(c, "link", "target") &&
  22612. (b = b.replace("]", ",target,onclick]"));
  22613. c.addCommand("link", new CKEDITOR.dialogCommand("link", {
  22614. allowedContent: b,
  22615. requiredContent: "a[href]"
  22616. }));
  22617. c.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", {
  22618. allowedContent: "a[!name,id]",
  22619. requiredContent: "a[name]"
  22620. }));
  22621. c.addCommand("unlink", new CKEDITOR.unlinkCommand);
  22622. c.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand);
  22623. c.setKeystroke(CKEDITOR.CTRL + 76, "link");
  22624. c.setKeystroke(CKEDITOR.CTRL + 75, "link");
  22625. c.ui.addButton && (c.ui.addButton("Link", {
  22626. label: c.lang.link.toolbar,
  22627. command: "link",
  22628. toolbar: "links,10"
  22629. }), c.ui.addButton("Unlink", {
  22630. label: c.lang.link.unlink,
  22631. command: "unlink",
  22632. toolbar: "links,20"
  22633. }), c.ui.addButton("Anchor", {
  22634. label: c.lang.link.anchor.toolbar,
  22635. command: "anchor",
  22636. toolbar: "links,30"
  22637. }));
  22638. CKEDITOR.dialog.add("link", this.path + "dialogs/link.js");
  22639. CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js");
  22640. c.on("doubleclick", function(a) {
  22641. var b = a.data.element.getAscendant({
  22642. a: 1,
  22643. img: 1
  22644. }, !0);
  22645. b && !b.isReadOnly() && (b.is("a") ? (a.data.dialog = !b.getAttribute("name") || b.getAttribute(
  22646. "href") &&
  22647. b.getChildCount() ? "link" : "anchor", a.data.link = b) : CKEDITOR.plugins.link
  22648. .tryRestoreFakeAnchor(c, b) && (a.data.dialog = "anchor"))
  22649. }, null, null, 0);
  22650. c.on("doubleclick", function(a) {
  22651. a.data.dialog in {
  22652. link: 1,
  22653. anchor: 1
  22654. } && a.data.link && c.getSelection().selectElement(a.data.link)
  22655. }, null, null, 20);
  22656. c.addMenuItems && c.addMenuItems({
  22657. anchor: {
  22658. label: c.lang.link.anchor.menu,
  22659. command: "anchor",
  22660. group: "anchor",
  22661. order: 1
  22662. },
  22663. removeAnchor: {
  22664. label: c.lang.link.anchor.remove,
  22665. command: "removeAnchor",
  22666. group: "anchor",
  22667. order: 5
  22668. },
  22669. link: {
  22670. label: c.lang.link.menu,
  22671. command: "link",
  22672. group: "link",
  22673. order: 1
  22674. },
  22675. unlink: {
  22676. label: c.lang.link.unlink,
  22677. command: "unlink",
  22678. group: "link",
  22679. order: 5
  22680. }
  22681. });
  22682. c.contextMenu && c.contextMenu.addListener(function(a) {
  22683. if (!a || a.isReadOnly()) return null;
  22684. a = CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a);
  22685. if (!a && !(a = CKEDITOR.plugins.link.getSelectedLink(c))) return null;
  22686. var b = {};
  22687. a.getAttribute("href") && a.getChildCount() && (b = {
  22688. link: CKEDITOR.TRISTATE_OFF,
  22689. unlink: CKEDITOR.TRISTATE_OFF
  22690. });
  22691. a && a.hasAttribute("name") && (b.anchor = b.removeAnchor = CKEDITOR.TRISTATE_OFF);
  22692. return b
  22693. });
  22694. this.compiledProtectionFunction = n(c)
  22695. },
  22696. afterInit: function(c) {
  22697. c.dataProcessor.dataFilter.addRules({
  22698. elements: {
  22699. a: function(a) {
  22700. return a.attributes.name ? a.children.length ? null : c.createFakeParserElement(a,
  22701. "cke_anchor", "anchor") : null
  22702. }
  22703. }
  22704. });
  22705. var b = c._.elementsPath && c._.elementsPath.filters;
  22706. b && b.push(function(a, b) {
  22707. if ("a" == b && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a) || a.getAttribute("name") && (
  22708. !a.getAttribute("href") || !a.getChildCount()))) return "anchor"
  22709. })
  22710. }
  22711. });
  22712. var t = /^javascript:/,
  22713. u = /^(?:mailto)(?:(?!\?(subject|body)=).)+/i,
  22714. v = /subject=([^;?:@&=$,\/]*)/i,
  22715. w = /body=([^;?:@&=$,\/]*)/i,
  22716. x = /^#(.*)$/,
  22717. y = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
  22718. z = /^(_(?:self|top|parent|blank))$/,
  22719. A = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
  22720. B = /^javascript:([^(]+)\(([^)]+)\)$/,
  22721. C = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
  22722. D = /(?:^|,)([^=]+)=(\d+|yes|no)/gi,
  22723. E = /^tel:(.*)$/,
  22724. m = {
  22725. id: "advId",
  22726. dir: "advLangDir",
  22727. accessKey: "advAccessKey",
  22728. name: "advName",
  22729. lang: "advLangCode",
  22730. tabindex: "advTabIndex",
  22731. title: "advTitle",
  22732. type: "advContentType",
  22733. "class": "advCSSClasses",
  22734. charset: "advCharset",
  22735. style: "advStyles",
  22736. rel: "advRel"
  22737. };
  22738. CKEDITOR.plugins.link = {
  22739. getSelectedLink: function(c, b) {
  22740. var a = c.getSelection(),
  22741. e = a.getSelectedElement(),
  22742. f = a.getRanges(),
  22743. d = [],
  22744. g;
  22745. if (!b && e && e.is("a")) return e;
  22746. for (e = 0; e < f.length; e++)
  22747. if (g = a.getRanges()[e], g.shrink(CKEDITOR.SHRINK_ELEMENT, !0, {
  22748. skipBogus: !0
  22749. }), (g = c.elementPath(g.getCommonAncestor()).contains("a", 1)) && b) d.push(g);
  22750. else if (g) return g;
  22751. return b ?
  22752. d : null
  22753. },
  22754. getEditorAnchors: function(c) {
  22755. for (var b = c.editable(), a = b.isInline() && !c.plugins.divarea ? c.document : b, b = a
  22756. .getElementsByTag("a"), a = a.getElementsByTag("img"), e = [], f = 0, d; d = b.getItem(f++);)(d
  22757. .data("cke-saved-name") || d.hasAttribute("name")) && e.push({
  22758. name: d.data("cke-saved-name") || d.getAttribute("name"),
  22759. id: d.getAttribute("id")
  22760. });
  22761. for (f = 0; d = a.getItem(f++);)(d = this.tryRestoreFakeAnchor(c, d)) && e.push({
  22762. name: d.getAttribute("name"),
  22763. id: d.getAttribute("id")
  22764. });
  22765. return e
  22766. },
  22767. fakeAnchor: !0,
  22768. tryRestoreFakeAnchor: function(c,
  22769. b) {
  22770. if (b && b.data("cke-real-element-type") && "anchor" == b.data("cke-real-element-type")) {
  22771. var a = c.restoreRealElement(b);
  22772. if (a.data("cke-saved-name")) return a
  22773. }
  22774. },
  22775. parseLinkAttributes: function(c, b) {
  22776. var a = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "",
  22777. e = c.plugins.link.compiledProtectionFunction,
  22778. f = c.config.emailProtection,
  22779. d = {},
  22780. g;
  22781. a.match(t) && ("encode" == f ? a = a.replace(A, function(a, b, c) {
  22782. c = c || "";
  22783. return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + c.replace(/\\'/g, "'")
  22784. }) : f && a.replace(B, function(a,
  22785. b, c) {
  22786. if (b == e.name) {
  22787. d.type = "email";
  22788. a = d.email = {};
  22789. b = /(^')|('$)/g;
  22790. c = c.match(/[^,\s]+/g);
  22791. for (var f = c.length, g, h, k = 0; k < f; k++) g = decodeURIComponent, h = c[k].replace(b,
  22792. "").replace(/\\'/g, "'"), h = g(h), g = e.params[k].toLowerCase(), a[g] = h;
  22793. a.address = [a.name, a.domain].join("@")
  22794. }
  22795. }));
  22796. if (!d.type)
  22797. if (f = a.match(x)) d.type = "anchor", d.anchor = {}, d.anchor.name = d.anchor.id = f[1];
  22798. else if (f = a.match(E)) d.type = "tel", d.tel = f[1];
  22799. else if (f = a.match(u)) {
  22800. g = a.match(v);
  22801. var a = a.match(w),
  22802. k = d.email = {};
  22803. d.type = "email";
  22804. k.address = f[0].replace("mailto:",
  22805. "");
  22806. g && (k.subject = decodeURIComponent(g[1]));
  22807. a && (k.body = decodeURIComponent(a[1]))
  22808. } else a && (g = a.match(y)) && (d.type = "url", d.url = {}, d.url.protocol = g[1], d.url.url = g[2]);
  22809. if (b) {
  22810. if (a = b.getAttribute("target")) d.target = {
  22811. type: a.match(z) ? a : "frame",
  22812. name: a
  22813. };
  22814. else if (a = (a = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && a.match(C))
  22815. for (d.target = {
  22816. type: "popup",
  22817. name: a[1]
  22818. }; f = D.exec(a[2]);) "yes" != f[2] && "1" != f[2] || f[1] in {
  22819. height: 1,
  22820. width: 1,
  22821. top: 1,
  22822. left: 1
  22823. } ? isFinite(f[2]) && (d.target[f[1]] = f[2]) : d.target[f[1]] = !0;
  22824. null !==
  22825. b.getAttribute("download") && (d.download = !0);
  22826. var a = {},
  22827. h;
  22828. for (h in m)(f = b.getAttribute(h)) && (a[m[h]] = f);
  22829. if (h = b.data("cke-saved-name") || a.advName) a.advName = h;
  22830. CKEDITOR.tools.isEmpty(a) || (d.advanced = a)
  22831. }
  22832. return d
  22833. },
  22834. getLinkAttributes: function(c, b) {
  22835. var a = c.config.emailProtection || "",
  22836. e = {};
  22837. switch (b.type) {
  22838. case "url":
  22839. var a = b.url && void 0 !== b.url.protocol ? b.url.protocol : "http://",
  22840. f = b.url && CKEDITOR.tools.trim(b.url.url) || "";
  22841. e["data-cke-saved-href"] = 0 === f.indexOf("/") ? f : a + f;
  22842. break;
  22843. case "anchor":
  22844. a = b.anchor && b.anchor.id;
  22845. e["data-cke-saved-href"] = "#" + (b.anchor && b.anchor.name || a || "");
  22846. break;
  22847. case "email":
  22848. var d = b.email,
  22849. f = d.address;
  22850. switch (a) {
  22851. case "":
  22852. case "encode":
  22853. var g = encodeURIComponent(d.subject || ""),
  22854. k = encodeURIComponent(d.body || ""),
  22855. d = [];
  22856. g && d.push("subject\x3d" + g);
  22857. k && d.push("body\x3d" + k);
  22858. d = d.length ? "?" + d.join("\x26") : "";
  22859. "encode" == a ? (a = ["javascript:void(location.href\x3d'mailto:'+", q(f)], d && a.push("+'", p(
  22860. d), "'"), a.push(")")) : a = ["mailto:", f, d];
  22861. break;
  22862. default:
  22863. a = f.split("@", 2), d.name = a[0], d.domain = a[1], a = ["javascript:", r(c,
  22864. d)]
  22865. }
  22866. e["data-cke-saved-href"] = a.join("");
  22867. break;
  22868. case "tel":
  22869. e["data-cke-saved-href"] = "tel:" + b.tel
  22870. }
  22871. if (b.target)
  22872. if ("popup" == b.target.type) {
  22873. for (var a = ["window.open(this.href, '", b.target.name || "", "', '"], h =
  22874. "resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "), f = h
  22875. .length, g = function(a) {
  22876. b.target[a] && h.push(a + "\x3d" + b.target[a])
  22877. }, d = 0; d < f; d++) h[d] += b.target[h[d]] ? "\x3dyes" : "\x3dno";
  22878. g("width");
  22879. g("left");
  22880. g("height");
  22881. g("top");
  22882. a.push(h.join(","), "'); return false;");
  22883. e["data-cke-pa-onclick"] =
  22884. a.join("")
  22885. } else "notSet" != b.target.type && b.target.name && (e.target = b.target.name);
  22886. b.download && (e.download = "");
  22887. if (b.advanced) {
  22888. for (var l in m)(a = b.advanced[m[l]]) && (e[l] = a);
  22889. e.name && (e["data-cke-saved-name"] = e.name)
  22890. }
  22891. e["data-cke-saved-href"] && (e.href = e["data-cke-saved-href"]);
  22892. l = {
  22893. target: 1,
  22894. onclick: 1,
  22895. "data-cke-pa-onclick": 1,
  22896. "data-cke-saved-name": 1,
  22897. download: 1
  22898. };
  22899. b.advanced && CKEDITOR.tools.extend(l, m);
  22900. for (var n in e) delete l[n];
  22901. return {
  22902. set: e,
  22903. removed: CKEDITOR.tools.object.keys(l)
  22904. }
  22905. },
  22906. showDisplayTextForElement: function(c,
  22907. b) {
  22908. var a = {
  22909. img: 1,
  22910. table: 1,
  22911. tbody: 1,
  22912. thead: 1,
  22913. tfoot: 1,
  22914. input: 1,
  22915. select: 1,
  22916. textarea: 1
  22917. },
  22918. e = b.getSelection();
  22919. return b.widgets && b.widgets.focused || e && 1 < e.getRanges().length ? !1 : !c || !c.getName || !c.is(
  22920. a)
  22921. }
  22922. };
  22923. CKEDITOR.unlinkCommand = function() {};
  22924. CKEDITOR.unlinkCommand.prototype = {
  22925. exec: function(c) {
  22926. if (CKEDITOR.env.ie) {
  22927. var b = c.getSelection().getRanges()[0],
  22928. a = b.getPreviousEditableNode() && b.getPreviousEditableNode().getAscendant("a", !0) || b
  22929. .getNextEditableNode() && b.getNextEditableNode().getAscendant("a", !0),
  22930. e;
  22931. b.collapsed && a &&
  22932. (e = b.createBookmark(), b.selectNodeContents(a), b.select())
  22933. }
  22934. a = new CKEDITOR.style({
  22935. element: "a",
  22936. type: CKEDITOR.STYLE_INLINE,
  22937. alwaysRemoveElement: 1
  22938. });
  22939. c.removeStyle(a);
  22940. e && (b.moveToBookmark(e), b.select())
  22941. },
  22942. refresh: function(c, b) {
  22943. var a = b.lastElement && b.lastElement.getAscendant("a", !0);
  22944. a && "a" == a.getName() && a.getAttribute("href") && a.getChildCount() ? this.setState(CKEDITOR
  22945. .TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  22946. },
  22947. contextSensitive: 1,
  22948. startDisabled: 1,
  22949. requiredContent: "a[href]",
  22950. editorFocus: 1
  22951. };
  22952. CKEDITOR.removeAnchorCommand =
  22953. function() {};
  22954. CKEDITOR.removeAnchorCommand.prototype = {
  22955. exec: function(c) {
  22956. var b = c.getSelection(),
  22957. a = b.createBookmarks(),
  22958. e;
  22959. if (b && (e = b.getSelectedElement()) && (e.getChildCount() ? e.is("a") : CKEDITOR.plugins.link
  22960. .tryRestoreFakeAnchor(c, e))) e.remove(1);
  22961. else if (e = CKEDITOR.plugins.link.getSelectedLink(c)) e.hasAttribute("href") ? (e.removeAttributes({
  22962. name: 1,
  22963. "data-cke-saved-name": 1
  22964. }), e.removeClass("cke_anchor")) : e.remove(1);
  22965. b.selectBookmarks(a)
  22966. },
  22967. requiredContent: "a[name]"
  22968. };
  22969. CKEDITOR.tools.extend(CKEDITOR.config, {
  22970. linkShowAdvancedTab: !0,
  22971. linkShowTargetTab: !0,
  22972. linkDefaultProtocol: "http://"
  22973. })
  22974. })();
  22975. (function() {
  22976. function K(a, l, d, f) {
  22977. for (var e = CKEDITOR.plugins.list.listToArray(l.root, d), g = [], b = 0; b < l.contents.length; b++) {
  22978. var h = l.contents[b];
  22979. (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (g.push(h), CKEDITOR.dom
  22980. .element.setMarker(d, h, "list_item_processed", !0))
  22981. }
  22982. for (var h = l.root.getDocument(), k, c, b = 0; b < g.length; b++) {
  22983. var p = g[b].getCustomData("listarray_index");
  22984. k = e[p].parent;
  22985. k.is(this.type) || (c = h.createElement(this.type), k.copyAttributes(c, {
  22986. start: 1,
  22987. type: 1
  22988. }), c.removeStyle("list-style-type"),
  22989. e[p].parent = c)
  22990. }
  22991. d = CKEDITOR.plugins.list.arrayToList(e, d, null, a.config.enterMode);
  22992. for (var m, e = d.listNode.getChildCount(), b = 0; b < e && (m = d.listNode.getChild(b)); b++) m.getName() ==
  22993. this.type && f.push(m);
  22994. d.listNode.replace(l.root);
  22995. a.fire("contentDomInvalidated")
  22996. }
  22997. function L(a, l, d) {
  22998. var f = l.contents,
  22999. e = l.root.getDocument(),
  23000. g = [];
  23001. if (1 == f.length && f[0].equals(l.root)) {
  23002. var b = e.createElement("div");
  23003. f[0].moveChildren && f[0].moveChildren(b);
  23004. f[0].append(b);
  23005. f[0] = b
  23006. }
  23007. l = l.contents[0].getParent();
  23008. for (b = 0; b < f.length; b++) l = l.getCommonAncestor(f[b].getParent());
  23009. a = a.config.useComputedState;
  23010. for (var h, k, b = 0; b < f.length; b++)
  23011. for (var c = f[b], p; p = c.getParent();) {
  23012. if (p.equals(l)) {
  23013. g.push(c);
  23014. !k && c.getDirection() && (k = 1);
  23015. c = c.getDirection(a);
  23016. null !== h && (h = h && h != c ? null : c);
  23017. break
  23018. }
  23019. c = p
  23020. }
  23021. if (!(1 > g.length)) {
  23022. f = g[g.length - 1].getNext();
  23023. b = e.createElement(this.type);
  23024. for (d.push(b); g.length;) d = g.shift(), a = e.createElement("li"), c = d, c.is("pre") || M.test(c
  23025. .getName()) || "false" == c.getAttribute("contenteditable") ? d.appendTo(a) : (d.copyAttributes(a), h && d
  23026. .getDirection() && (a.removeStyle("direction"),
  23027. a.removeAttribute("dir")), d.moveChildren(a), d.remove()), a.appendTo(b);
  23028. h && k && b.setAttribute("dir", h);
  23029. f ? b.insertBefore(f) : b.appendTo(l)
  23030. }
  23031. }
  23032. function N(a, l, d) {
  23033. function f(b) {
  23034. if (!(!(c = k[b ? "getFirst" : "getLast"]()) || c.is && c.isBlockBoundary() || !(p = l.root[b ?
  23035. "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(!0))) || p.is && p.isBlockBoundary({
  23036. br: 1
  23037. }))) a.document.createElement("br")[b ? "insertBefore" : "insertAfter"](c)
  23038. }
  23039. for (var e = CKEDITOR.plugins.list.listToArray(l.root, d), g = [], b = 0; b < l.contents.length; b++) {
  23040. var h =
  23041. l.contents[b];
  23042. (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (g.push(h), CKEDITOR.dom
  23043. .element.setMarker(d, h, "list_item_processed", !0))
  23044. }
  23045. h = null;
  23046. for (b = 0; b < g.length; b++) h = g[b].getCustomData("listarray_index"), e[h].indent = -1;
  23047. for (b = h + 1; b < e.length; b++)
  23048. if (e[b].indent > e[b - 1].indent + 1) {
  23049. g = e[b - 1].indent + 1 - e[b].indent;
  23050. for (h = e[b].indent; e[b] && e[b].indent >= h;) e[b].indent += g, b++;
  23051. b--
  23052. } var k = CKEDITOR.plugins.list.arrayToList(e, d, null, a.config.enterMode, l.root.getAttribute("dir"))
  23053. .listNode,
  23054. c, p;
  23055. f(!0);
  23056. f();
  23057. k.replace(l.root);
  23058. a.fire("contentDomInvalidated")
  23059. }
  23060. function C(a, l) {
  23061. this.name = a;
  23062. this.context = this.type = l;
  23063. this.allowedContent = l + " li";
  23064. this.requiredContent = l
  23065. }
  23066. function F(a, l, d, f) {
  23067. for (var e, g; e = a[f ? "getLast" : "getFirst"](O);)(g = e.getDirection(1)) !== l.getDirection(1) && e
  23068. .setAttribute("dir", g), e.remove(), d ? e[f ? "insertBefore" : "insertAfter"](d) : l.append(e, f), d = e
  23069. }
  23070. function G(a) {
  23071. function l(d) {
  23072. var f = a[d ? "getPrevious" : "getNext"](t);
  23073. f && f.type == CKEDITOR.NODE_ELEMENT && f.is(a.getName()) && (F(a, f, null, !d), a.remove(),
  23074. a = f)
  23075. }
  23076. l();
  23077. l(1)
  23078. }
  23079. function H(a) {
  23080. return a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in CKEDITOR.dtd.$block || a.getName() in CKEDITOR.dtd
  23081. .$listItem) && CKEDITOR.dtd[a.getName()]["#"]
  23082. }
  23083. function D(a, l, d) {
  23084. a.fire("saveSnapshot");
  23085. d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
  23086. var f = d.extractContents();
  23087. l.trim(!1, !0);
  23088. var e = l.createBookmark(),
  23089. g = new CKEDITOR.dom.elementPath(l.startContainer),
  23090. b = g.block,
  23091. g = g.lastElement.getAscendant("li", 1) || b,
  23092. h = new CKEDITOR.dom.elementPath(d.startContainer),
  23093. k = h.contains(CKEDITOR.dtd.$listItem),
  23094. h = h.contains(CKEDITOR.dtd.$list);
  23095. b ? (b = b.getBogus()) && b.remove() : h && (b = h.getPrevious(t)) && z(b) && b.remove();
  23096. (b = f.getLast()) && b.type == CKEDITOR.NODE_ELEMENT && b.is("br") && b.remove();
  23097. (b = l.startContainer.getChild(l.startOffset)) ? f.insertBefore(b): l.startContainer.append(f);
  23098. k && (f = A(k)) && (g.contains(k) ? (F(f, k.getParent(), k), f.remove()) : g.append(f));
  23099. for (; d.checkStartOfBlock() && d.checkEndOfBlock();) {
  23100. h = d.startPath();
  23101. f = h.block;
  23102. if (!f) break;
  23103. f.is("li") && (g = f.getParent(), f.equals(g.getLast(t)) && f.equals(g.getFirst(t)) &&
  23104. (f = g));
  23105. d.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START);
  23106. f.remove()
  23107. }
  23108. d = d.clone();
  23109. f = a.editable();
  23110. d.setEndAt(f, CKEDITOR.POSITION_BEFORE_END);
  23111. d = new CKEDITOR.dom.walker(d);
  23112. d.evaluator = function(a) {
  23113. return t(a) && !z(a)
  23114. };
  23115. (d = d.next()) && d.type == CKEDITOR.NODE_ELEMENT && d.getName() in CKEDITOR.dtd.$list && G(d);
  23116. l.moveToBookmark(e);
  23117. l.select();
  23118. a.fire("saveSnapshot")
  23119. }
  23120. function A(a) {
  23121. return (a = a.getLast(t)) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in u ? a : null
  23122. }
  23123. var u = {
  23124. ol: 1,
  23125. ul: 1
  23126. },
  23127. P = CKEDITOR.dom.walker.whitespaces(),
  23128. I = CKEDITOR.dom.walker.bookmark(),
  23129. t = function(a) {
  23130. return !(P(a) || I(a))
  23131. },
  23132. z = CKEDITOR.dom.walker.bogus();
  23133. CKEDITOR.plugins.list = {
  23134. listToArray: function(a, l, d, f, e) {
  23135. if (!u[a.getName()]) return [];
  23136. f || (f = 0);
  23137. d || (d = []);
  23138. for (var g = 0, b = a.getChildCount(); g < b; g++) {
  23139. var h = a.getChild(g);
  23140. h.type == CKEDITOR.NODE_ELEMENT && h.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list
  23141. .listToArray(h, l, d, f + 1);
  23142. if ("li" == h.$.nodeName.toLowerCase()) {
  23143. var k = {
  23144. parent: a,
  23145. indent: f,
  23146. element: h,
  23147. contents: []
  23148. };
  23149. e ? k.grandparent = e : (k.grandparent = a.getParent(), k.grandparent && "li" == k.grandparent.$
  23150. .nodeName.toLowerCase() &&
  23151. (k.grandparent = k.grandparent.getParent()));
  23152. l && CKEDITOR.dom.element.setMarker(l, h, "listarray_index", d.length);
  23153. d.push(k);
  23154. for (var c = 0, p = h.getChildCount(), m; c < p; c++) m = h.getChild(c), m.type == CKEDITOR
  23155. .NODE_ELEMENT && u[m.getName()] ? CKEDITOR.plugins.list.listToArray(m, l, d, f + 1, k
  23156. .grandparent) : k.contents.push(m)
  23157. }
  23158. }
  23159. return d
  23160. },
  23161. arrayToList: function(a, l, d, f, e) {
  23162. d || (d = 0);
  23163. if (!a || a.length < d + 1) return null;
  23164. for (var g, b = a[d].parent.getDocument(), h = new CKEDITOR.dom.documentFragment(b), k = null, c = d,
  23165. p = Math.max(a[d].indent, 0), m =
  23166. null, n, r, y = f == CKEDITOR.ENTER_P ? "p" : "div";;) {
  23167. var q = a[c];
  23168. g = q.grandparent;
  23169. n = q.element.getDirection(1);
  23170. if (q.indent == p) {
  23171. k && a[c].parent.getName() == k.getName() || (k = a[c].parent.clone(!1, 1), e && k.setAttribute(
  23172. "dir", e), h.append(k));
  23173. m = k.append(q.element.clone(0, 1));
  23174. n != k.getDirection(1) && m.setAttribute("dir", n);
  23175. for (g = 0; g < q.contents.length; g++) m.append(q.contents[g].clone(1, 1));
  23176. c++
  23177. } else if (q.indent == Math.max(p, 0) + 1) q = a[c - 1].element.getDirection(1), c = CKEDITOR.plugins
  23178. .list.arrayToList(a, null, c, f, q != n ? n : null), !m.getChildCount() &&
  23179. CKEDITOR.env.needsNbspFiller && 7 >= b.$.documentMode && m.append(b.createText(" ")), m.append(c
  23180. .listNode), c = c.nextIndex;
  23181. else if (-1 == q.indent && !d && g) {
  23182. u[g.getName()] ? (m = q.element.clone(!1, !0), n != g.getDirection(1) && m.setAttribute("dir", n)) :
  23183. m = new CKEDITOR.dom.documentFragment(b);
  23184. var k = g.getDirection(1) != n,
  23185. w = q.element,
  23186. B = w.getAttribute("class"),
  23187. E = w.getAttribute("style"),
  23188. J = m.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (f != CKEDITOR.ENTER_BR || k || E || B),
  23189. v, z = q.contents.length,
  23190. x;
  23191. for (g = 0; g < z; g++)
  23192. if (v = q.contents[g], I(v) &&
  23193. 1 < z) J ? x = v.clone(1, 1) : m.append(v.clone(1, 1));
  23194. else if (v.type == CKEDITOR.NODE_ELEMENT && v.isBlockBoundary()) {
  23195. k && !v.getDirection() && v.setAttribute("dir", n);
  23196. r = v;
  23197. var A = w.getAttribute("style");
  23198. A && r.setAttribute("style", A.replace(/([^;])$/, "$1;") + (r.getAttribute("style") || ""));
  23199. B && v.addClass(B);
  23200. r = null;
  23201. x && (m.append(x), x = null);
  23202. m.append(v.clone(1, 1))
  23203. } else J ? (r || (r = b.createElement(y), m.append(r), k && r.setAttribute("dir", n)), E && r
  23204. .setAttribute("style", E), B && r.setAttribute("class", B), x && (r.append(x), x = null), r
  23205. .append(v.clone(1,
  23206. 1))) : m.append(v.clone(1, 1));
  23207. x && ((r || m).append(x), x = null);
  23208. m.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && c != a.length - 1 && (CKEDITOR.env.needsBrFiller && (
  23209. n = m.getLast()) && n.type == CKEDITOR.NODE_ELEMENT && n.is("br") && n.remove(), (n = m
  23210. .getLast(t)) && n.type == CKEDITOR.NODE_ELEMENT && n.is(CKEDITOR.dtd.$block) || m.append(b
  23211. .createElement("br")));
  23212. n = m.$.nodeName.toLowerCase();
  23213. "div" != n && "p" != n || m.appendBogus();
  23214. h.append(m);
  23215. k = null;
  23216. c++
  23217. } else return null;
  23218. r = null;
  23219. if (a.length <= c || Math.max(a[c].indent, 0) < p) break
  23220. }
  23221. if (l)
  23222. for (a = h.getFirst(); a;) {
  23223. if (a.type ==
  23224. CKEDITOR.NODE_ELEMENT && (CKEDITOR.dom.element.clearMarkers(l, a), a.getName() in CKEDITOR.dtd
  23225. .$listItem && (d = a, b = e = f = void 0, f = d.getDirection()))) {
  23226. for (e = d.getParent(); e && !(b = e.getDirection());) e = e.getParent();
  23227. f == b && d.removeAttribute("dir")
  23228. }
  23229. a = a.getNextSourceNode()
  23230. }
  23231. return {
  23232. listNode: h,
  23233. nextIndex: c
  23234. }
  23235. }
  23236. };
  23237. var M = /^h[1-6]$/,
  23238. O = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
  23239. C.prototype = {
  23240. exec: function(a) {
  23241. function l(a) {
  23242. return u[a.root.getName()] && !d(a.root, [CKEDITOR.NODE_COMMENT])
  23243. }
  23244. function d(a, b) {
  23245. return CKEDITOR.tools.array.filter(a.getChildren().toArray(),
  23246. function(a) {
  23247. return -1 === CKEDITOR.tools.array.indexOf(b, a.type)
  23248. }).length
  23249. }
  23250. function f(a) {
  23251. var b = !0;
  23252. if (0 === a.getChildCount()) return !1;
  23253. a.forEach(function(a) {
  23254. if (a.type !== CKEDITOR.NODE_COMMENT) return b = !1
  23255. }, null, !0);
  23256. return b
  23257. }
  23258. this.refresh(a, a.elementPath());
  23259. var e = a.config,
  23260. g = a.getSelection(),
  23261. b = g && g.getRanges();
  23262. if (this.state == CKEDITOR.TRISTATE_OFF) {
  23263. var h = a.editable();
  23264. if (h.getFirst(t)) {
  23265. var k = 1 == b.length && b[0];
  23266. (e = k && k.getEnclosedNode()) && e.is && this.type == e.getName() && this.setState(CKEDITOR
  23267. .TRISTATE_ON)
  23268. } else e.enterMode ==
  23269. CKEDITOR.ENTER_BR ? h.appendBogus() : b[0].fixBlock(1, e.enterMode == CKEDITOR.ENTER_P ? "p" :
  23270. "div"), g.selectRanges(b)
  23271. }
  23272. for (var e = g.createBookmarks(!0), h = [], c = {}, b = b.createIterator(), p = 0;
  23273. (k = b.getNextRange()) && ++p;) {
  23274. var m = k.getBoundaryNodes(),
  23275. n = m.startNode,
  23276. r = m.endNode;
  23277. n.type == CKEDITOR.NODE_ELEMENT && "td" == n.getName() && k.setStartAt(m.startNode, CKEDITOR
  23278. .POSITION_AFTER_START);
  23279. r.type == CKEDITOR.NODE_ELEMENT && "td" == r.getName() && k.setEndAt(m.endNode, CKEDITOR
  23280. .POSITION_BEFORE_END);
  23281. k = k.createIterator();
  23282. for (k.forceBrBreak =
  23283. this.state == CKEDITOR.TRISTATE_OFF; m = k.getNextParagraph();)
  23284. if (!m.getCustomData("list_block") && !f(m)) {
  23285. CKEDITOR.dom.element.setMarker(c, m, "list_block", 1);
  23286. for (var y = a.elementPath(m), n = y.elements, r = 0, y = y.blockLimit, q, w = n.length - 1; 0 <=
  23287. w && (q = n[w]); w--)
  23288. if (u[q.getName()] && y.contains(q)) {
  23289. y.removeCustomData("list_group_object_" + p);
  23290. (n = q.getCustomData("list_group_object")) ? n.contents.push(m): (n = {
  23291. root: q,
  23292. contents: [m]
  23293. }, h.push(n), CKEDITOR.dom.element.setMarker(c, q, "list_group_object", n));
  23294. r = 1;
  23295. break
  23296. } r || (r = y, r.getCustomData("list_group_object_" +
  23297. p) ? r.getCustomData("list_group_object_" + p).contents.push(m) : (n = {
  23298. root: r,
  23299. contents: [m]
  23300. }, CKEDITOR.dom.element.setMarker(c, r, "list_group_object_" + p, n), h.push(n)))
  23301. }
  23302. }
  23303. for (q = []; 0 < h.length;) n = h.shift(), this.state == CKEDITOR.TRISTATE_OFF ? l(n) || (u[n.root
  23304. .getName()] ? K.call(this, a, n, c, q) : L.call(this, a, n, q)) : this.state == CKEDITOR
  23305. .TRISTATE_ON && u[n.root.getName()] && !l(n) && N.call(this, a, n, c);
  23306. for (w = 0; w < q.length; w++) G(q[w]);
  23307. CKEDITOR.dom.element.clearAllMarkers(c);
  23308. g.selectBookmarks(e);
  23309. a.focus()
  23310. },
  23311. refresh: function(a, l) {
  23312. var d =
  23313. l.contains(u, 1),
  23314. f = l.blockLimit || l.root;
  23315. d && f.contains(d) ? this.setState(d.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) :
  23316. this.setState(CKEDITOR.TRISTATE_OFF)
  23317. }
  23318. };
  23319. CKEDITOR.plugins.add("list", {
  23320. requires: "indentlist",
  23321. init: function(a) {
  23322. a.blockless || (a.addCommand("numberedlist", new C("numberedlist", "ol")), a.addCommand(
  23323. "bulletedlist", new C("bulletedlist", "ul")), a.ui.addButton && (a.ui.addButton(
  23324. "NumberedList", {
  23325. isToggle: !0,
  23326. label: a.lang.list.numberedlist,
  23327. command: "numberedlist",
  23328. directional: !0,
  23329. toolbar: "list,10"
  23330. }),
  23331. a.ui.addButton("BulletedList", {
  23332. isToggle: !0,
  23333. label: a.lang.list.bulletedlist,
  23334. command: "bulletedlist",
  23335. directional: !0,
  23336. toolbar: "list,20"
  23337. })), a.on("key", function(l) {
  23338. var d = l.data.domEvent.getKey(),
  23339. f;
  23340. if ("wysiwyg" == a.mode && d in {
  23341. 8: 1,
  23342. 46: 1
  23343. }) {
  23344. var e = a.getSelection().getRanges()[0],
  23345. g = e && e.startPath();
  23346. if (e && e.collapsed) {
  23347. var b = 8 == d,
  23348. h = a.editable(),
  23349. k = new CKEDITOR.dom.walker(e.clone());
  23350. k.evaluator = function(a) {
  23351. return t(a) && !z(a)
  23352. };
  23353. k.guard = function(a, b) {
  23354. return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table"))
  23355. };
  23356. d = e.clone();
  23357. if (b) {
  23358. var c;
  23359. (c = g.contains(u)) && e.checkBoundaryOfElement(c, CKEDITOR.START) && (c = c
  23360. .getParent()) && c.is("li") && (c = A(c)) ? (f = c, c = c.getPrevious(t), d
  23361. .moveToPosition(c && z(c) ? c : f, CKEDITOR.POSITION_BEFORE_START)) : (k.range
  23362. .setStartAt(h, CKEDITOR.POSITION_AFTER_START), k.range.setEnd(e.startContainer, e
  23363. .startOffset), (c = k.previous()) && c.type == CKEDITOR.NODE_ELEMENT && (c
  23364. .getName() in u || c.is("li")) && (c.is("li") || (k.range.selectNodeContents(c), k
  23365. .reset(), k.evaluator = H, c = k.previous()), f = c, d.moveToElementEditEnd(f),
  23366. d.moveToPosition(d.endPath().block,
  23367. CKEDITOR.POSITION_BEFORE_END)));
  23368. if (f) D(a, d, e), l.cancel();
  23369. else {
  23370. var p = g.contains(u);
  23371. p && e.checkBoundaryOfElement(p, CKEDITOR.START) && (f = p.getFirst(t), e
  23372. .checkBoundaryOfElement(f, CKEDITOR.START) && (c = p.getPrevious(t), A(f) ? c && (
  23373. e.moveToElementEditEnd(c), e.select()) : a.execCommand("outdent"), l.cancel()))
  23374. }
  23375. } else if (f = g.contains("li")) {
  23376. if (k.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), b = (h = f.getLast(t)) && H(h) ?
  23377. h : f, g = 0, (c = k.next()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in u &&
  23378. c.equals(h) ? (g = 1, c = k.next()) : e.checkBoundaryOfElement(b,
  23379. CKEDITOR.END) && (g = 2), g && c) {
  23380. e = e.clone();
  23381. e.moveToElementEditStart(c);
  23382. if (1 == g && (d.optimize(), !d.startContainer.equals(f))) {
  23383. for (f = d.startContainer; f.is(CKEDITOR.dtd.$inline);) p = f, f = f.getParent();
  23384. p && d.moveToPosition(p, CKEDITOR.POSITION_AFTER_END)
  23385. }
  23386. 2 == g && (d.moveToPosition(d.endPath().block, CKEDITOR.POSITION_BEFORE_END), e
  23387. .endPath().block && e.moveToPosition(e.endPath().block, CKEDITOR
  23388. .POSITION_AFTER_START));
  23389. D(a, d, e);
  23390. l.cancel()
  23391. }
  23392. } else k.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), (c = k.next()) && c.type ==
  23393. CKEDITOR.NODE_ELEMENT &&
  23394. c.is(u) && (c = c.getFirst(t), g.block && e.checkStartOfBlock() && e.checkEndOfBlock() ?
  23395. (g.block.remove(), e.moveToElementEditStart(c), e.select()) : A(c) ? (e
  23396. .moveToElementEditStart(c), e.select()) : (e = e.clone(), e.moveToElementEditStart(
  23397. c), D(a, d, e)), l.cancel());
  23398. setTimeout(function() {
  23399. a.selectionChange(1)
  23400. })
  23401. }
  23402. }
  23403. }))
  23404. }
  23405. })
  23406. })();
  23407. (function() {
  23408. CKEDITOR.plugins.liststyle = {
  23409. requires: "dialog,contextmenu",
  23410. init: function(a) {
  23411. if (!a.blockless) {
  23412. var b;
  23413. b = new CKEDITOR.dialogCommand("numberedListStyle", {
  23414. requiredContent: "ol",
  23415. allowedContent: "ol{list-style-type}[start]; li{list-style-type}[value]",
  23416. contentTransformations: [
  23417. ["ol: listTypeToStyle"]
  23418. ]
  23419. });
  23420. b = a.addCommand("numberedListStyle", b);
  23421. a.addFeature(b);
  23422. CKEDITOR.dialog.add("numberedListStyle", this.path + "dialogs/liststyle.js");
  23423. b = new CKEDITOR.dialogCommand("bulletedListStyle", {
  23424. requiredContent: "ul",
  23425. allowedContent: "ul{list-style-type}",
  23426. contentTransformations: [
  23427. ["ul: listTypeToStyle"]
  23428. ]
  23429. });
  23430. b = a.addCommand("bulletedListStyle", b);
  23431. a.addFeature(b);
  23432. CKEDITOR.dialog.add("bulletedListStyle", this.path + "dialogs/liststyle.js");
  23433. a.addMenuGroup("list", 108);
  23434. a.addMenuItems({
  23435. numberedlist: {
  23436. label: a.lang.liststyle.numberedTitle,
  23437. group: "list",
  23438. command: "numberedListStyle"
  23439. },
  23440. bulletedlist: {
  23441. label: a.lang.liststyle.bulletedTitle,
  23442. group: "list",
  23443. command: "bulletedListStyle"
  23444. }
  23445. });
  23446. a.contextMenu.addListener(function(a) {
  23447. if (!a || a.isReadOnly()) return null;
  23448. for (; a;) {
  23449. var b = a.getName();
  23450. if ("ol" == b) return {
  23451. numberedlist: CKEDITOR.TRISTATE_OFF
  23452. };
  23453. if ("ul" == b) return {
  23454. bulletedlist: CKEDITOR.TRISTATE_OFF
  23455. };
  23456. a = a.getParent()
  23457. }
  23458. return null
  23459. })
  23460. }
  23461. }
  23462. };
  23463. CKEDITOR.plugins.add("liststyle", CKEDITOR.plugins.liststyle)
  23464. })();
  23465. (function() {
  23466. function V(a, c, d) {
  23467. return n(c) && n(d) && d.equals(c.getNext(function(a) {
  23468. return !(E(a) || F(a) || u(a))
  23469. }))
  23470. }
  23471. function z(a) {
  23472. this.upper = a[0];
  23473. this.lower = a[1];
  23474. this.set.apply(this, a.slice(2))
  23475. }
  23476. function O(a) {
  23477. var c = a.element;
  23478. if (c && n(c) && (c = c.getAscendant(a.triggers, !0)) && a.editable.contains(c)) {
  23479. var d = P(c);
  23480. if ("true" == d.getAttribute("contenteditable")) return c;
  23481. if (d.is(a.triggers)) return d
  23482. }
  23483. return null
  23484. }
  23485. function ka(a, c, d) {
  23486. r(a, c);
  23487. r(a, d);
  23488. a = c.size.bottom;
  23489. d = d.size.top;
  23490. return a && d ? 0 | (a + d) / 2 : a || d
  23491. }
  23492. function w(a, c, d) {
  23493. return c =
  23494. c[d ? "getPrevious" : "getNext"](function(b) {
  23495. return b && b.type == CKEDITOR.NODE_TEXT && !E(b) || n(b) && !u(b) && !A(a, b)
  23496. })
  23497. }
  23498. function q(a, c, d) {
  23499. return a > c && a < d
  23500. }
  23501. function P(a, c) {
  23502. if (a.data("cke-editable")) return null;
  23503. for (c || (a = a.getParent()); a && !a.data("cke-editable");) {
  23504. if (a.hasAttribute("contenteditable")) return a;
  23505. a = a.getParent()
  23506. }
  23507. return null
  23508. }
  23509. function la(a) {
  23510. var c = a.doc,
  23511. d = G('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"' + Q +
  23512. "position:absolute;border-top:1px dashed " + a.boxColor + '"\x3e\x3c/span\x3e',
  23513. c),
  23514. b = CKEDITOR.getUrl(this.path + "images/" + (t.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") +
  23515. ".png");
  23516. v(d, {
  23517. attach: function() {
  23518. this.wrap.getParent() || this.wrap.appendTo(a.editable, !0);
  23519. return this
  23520. },
  23521. lineChildren: [v(G('\x3cspan title\x3d"' + a.editor.lang.magicline.title +
  23522. '" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e', c), {
  23523. base: Q + "height:17px;width:17px;" + (a.rtl ? "left" : "right") + ":17px;background:url(" + b +
  23524. ") center no-repeat " + a.boxColor + ";cursor:pointer;" + (t.hc ?
  23525. "font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;" :
  23526. "") + (t.hidpi ? "background-size: 9px 10px;" : ""),
  23527. looks: ["top:-8px; border-radius: 2px;", "top:-17px; border-radius: 2px 2px 0px 0px;",
  23528. "top:-1px; border-radius: 0px 0px 2px 2px;"
  23529. ]
  23530. }), v(G(W, c), {
  23531. base: X + "left:0px;border-left-color:" + a.boxColor + ";",
  23532. looks: ["border-width:8px 0 8px 8px;top:-8px", "border-width:8px 0 0 8px;top:-8px",
  23533. "border-width:0 0 8px 8px;top:0px"
  23534. ]
  23535. }), v(G(W, c), {
  23536. base: X + "right:0px;border-right-color:" + a.boxColor + ";",
  23537. looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px",
  23538. "border-width:0 8px 8px 0;top:0px"
  23539. ]
  23540. })],
  23541. detach: function() {
  23542. this.wrap.getParent() && this.wrap.remove();
  23543. return this
  23544. },
  23545. mouseNear: function() {
  23546. r(a, this);
  23547. var b = a.holdDistance,
  23548. c = this.size;
  23549. return c && q(a.mouse.y, c.top - b, c.bottom + b) && q(a.mouse.x, c.left - b, c.right + b) ? !0 : !1
  23550. },
  23551. place: function() {
  23552. var b = a.view,
  23553. c = a.editable,
  23554. d = a.trigger,
  23555. h = d.upper,
  23556. g = d.lower,
  23557. l = h || g,
  23558. p = l.getParent(),
  23559. m = {};
  23560. this.trigger = d;
  23561. h && r(a, h, !0);
  23562. g && r(a, g, !0);
  23563. r(a, p, !0);
  23564. a.inInlineMode && H(a, !0);
  23565. p.equals(c) ? (m.left = b.scroll.x, m.right = -b.scroll.x, m.width = "") : (m.left =
  23566. l.size.left - l.size.margin.left + b.scroll.x - (a.inInlineMode ? b.editable.left + b.editable
  23567. .border.left : 0), m.width = l.size.outerWidth + l.size.margin.left + l.size.margin.right + b
  23568. .scroll.x, m.right = "");
  23569. h && g ? m.top = h.size.margin.bottom === g.size.margin.top ? 0 | h.size.bottom + h.size.margin
  23570. .bottom / 2 : h.size.margin.bottom < g.size.margin.top ? h.size.bottom + h.size.margin.bottom : h
  23571. .size.bottom + h.size.margin.bottom - g.size.margin.top : h ? g || (m.top = h.size.bottom + h.size
  23572. .margin.bottom) : m.top = g.size.top - g.size.margin.top;
  23573. d.is(C) || q(m.top,
  23574. b.scroll.y - 15, b.scroll.y + 5) ? (m.top = a.inInlineMode ? 0 : b.scroll.y, this.look(C)) : d
  23575. .is(D) || q(m.top, b.pane.bottom - 5, b.pane.bottom + 15) ? (m.top = a.inInlineMode ? b.editable
  23576. .height + b.editable.padding.top + b.editable.padding.bottom : b.pane.bottom - 1, this.look(D)
  23577. ) : (a.inInlineMode && (m.top -= b.editable.top + b.editable.border.top), this.look(x));
  23578. a.inInlineMode && (m.top--, m.top += b.editable.scroll.top, m.left += b.editable.scroll.left);
  23579. for (var n in m) m[n] = CKEDITOR.tools.cssLength(m[n]);
  23580. this.setStyles(m)
  23581. },
  23582. look: function(a) {
  23583. if (this.oldLook !=
  23584. a) {
  23585. for (var b = this.lineChildren.length, c; b--;)(c = this.lineChildren[b]).setAttribute("style", c
  23586. .base + c.looks[0 | a / 2]);
  23587. this.oldLook = a
  23588. }
  23589. },
  23590. wrap: new R("span", a.doc)
  23591. });
  23592. for (c = d.lineChildren.length; c--;) d.lineChildren[c].appendTo(d);
  23593. d.look(x);
  23594. d.appendTo(d.wrap);
  23595. d.unselectable();
  23596. d.lineChildren[0].on("mouseup", function(b) {
  23597. d.detach();
  23598. S(a, function(b) {
  23599. var c = a.line.trigger;
  23600. b[c.is(I) ? "insertBefore" : "insertAfter"](c.is(I) ? c.lower : c.upper)
  23601. }, !0);
  23602. a.editor.focus();
  23603. t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  23604. b.data.preventDefault(!0)
  23605. });
  23606. d.on("mousedown", function(a) {
  23607. a.data.preventDefault(!0)
  23608. });
  23609. a.line = d
  23610. }
  23611. function S(a, c, d) {
  23612. var b = new CKEDITOR.dom.range(a.doc),
  23613. e = a.editor,
  23614. f;
  23615. t.ie && a.enterMode == CKEDITOR.ENTER_BR ? f = a.doc.createText(J) : (f = (f = P(a.element, !0)) && f.data(
  23616. "cke-enter-mode") || a.enterMode, f = new R(K[f], a.doc), f.is("br") || a.doc.createText(J).appendTo(f));
  23617. d && e.fire("saveSnapshot");
  23618. c(f);
  23619. b.moveToPosition(f, CKEDITOR.POSITION_AFTER_START);
  23620. e.getSelection().selectRanges([b]);
  23621. a.hotNode = f;
  23622. d && e.fire("saveSnapshot")
  23623. }
  23624. function Y(a, c) {
  23625. return {
  23626. canUndo: !0,
  23627. modes: {
  23628. wysiwyg: 1
  23629. },
  23630. exec: function() {
  23631. function d(b) {
  23632. var d = t.ie && 9 > t.version ? " " : J,
  23633. f = a.hotNode && a.hotNode.getText() == d && a.element.equals(a.hotNode) && a.lastCmdDirection === !
  23634. !c;
  23635. S(a, function(d) {
  23636. f && a.hotNode && a.hotNode.remove();
  23637. d[c ? "insertAfter" : "insertBefore"](b);
  23638. d.setAttributes({
  23639. "data-cke-magicline-hot": 1,
  23640. "data-cke-magicline-dir": !!c
  23641. });
  23642. a.lastCmdDirection = !!c
  23643. });
  23644. t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  23645. a.line.detach()
  23646. }
  23647. return function(b) {
  23648. b = b.getSelection().getStartElement();
  23649. var e;
  23650. b = b.getAscendant(Z, 1);
  23651. if (!aa(a, b) && b && !b.equals(a.editable) && !b.contains(a.editable)) {
  23652. (e = P(b)) && "false" == e.getAttribute("contenteditable") && (b = e);
  23653. a.element = b;
  23654. e = w(a, b, !c);
  23655. var f;
  23656. n(e) && e.is(a.triggers) && e.is(ma) && (!w(a, e, !c) || (f = w(a, e, !c)) && n(f) && f.is(a
  23657. .triggers)) ? d(e) : (f = O(a, b), n(f) && (w(a, f, !c) ? (b = w(a, f, !c)) && n(b) && b.is(a
  23658. .triggers) && d(f) : d(f)))
  23659. }
  23660. }
  23661. }()
  23662. }
  23663. }
  23664. function A(a, c) {
  23665. if (!c || c.type != CKEDITOR.NODE_ELEMENT || !c.$) return !1;
  23666. var d = a.line;
  23667. return d.wrap.equals(c) || d.wrap.contains(c)
  23668. }
  23669. function n(a) {
  23670. return a &&
  23671. a.type == CKEDITOR.NODE_ELEMENT && a.$
  23672. }
  23673. function u(a) {
  23674. if (!n(a)) return !1;
  23675. var c;
  23676. (c = ba(a)) || (n(a) ? (c = {
  23677. left: 1,
  23678. right: 1,
  23679. center: 1
  23680. }, c = !(!c[a.getComputedStyle("float")] && !c[a.getAttribute("align")])) : c = !1);
  23681. return c
  23682. }
  23683. function ba(a) {
  23684. return !!{
  23685. absolute: 1,
  23686. fixed: 1
  23687. } [a.getComputedStyle("position")]
  23688. }
  23689. function L(a, c) {
  23690. return n(c) ? c.is(a.triggers) : null
  23691. }
  23692. function aa(a, c) {
  23693. if (!c) return !1;
  23694. for (var d = c.getParents(1), b = d.length; b--;)
  23695. for (var e = a.tabuList.length; e--;)
  23696. if (d[b].hasAttribute(a.tabuList[e])) return !0;
  23697. return !1
  23698. }
  23699. function na(a,
  23700. c, d) {
  23701. c = c[d ? "getLast" : "getFirst"](function(b) {
  23702. return a.isRelevant(b) && !b.is(oa)
  23703. });
  23704. if (!c) return !1;
  23705. r(a, c);
  23706. return d ? c.size.top > a.mouse.y : c.size.bottom < a.mouse.y
  23707. }
  23708. function ca(a) {
  23709. var c = a.editable,
  23710. d = a.mouse,
  23711. b = a.view,
  23712. e = a.triggerOffset;
  23713. H(a);
  23714. var f = d.y > (a.inInlineMode ? b.editable.top + b.editable.height / 2 : Math.min(b.editable.height, b.pane
  23715. .height) / 2),
  23716. c = c[f ? "getLast" : "getFirst"](function(a) {
  23717. return !(E(a) || F(a))
  23718. });
  23719. if (!c) return null;
  23720. A(a, c) && (c = a.line.wrap[f ? "getPrevious" : "getNext"](function(a) {
  23721. return !(E(a) || F(a))
  23722. }));
  23723. if (!n(c) || u(c) || !L(a, c)) return null;
  23724. r(a, c);
  23725. return !f && 0 <= c.size.top && q(d.y, 0, c.size.top + e) ? (a = a.inInlineMode || 0 === b.scroll.y ? C : x,
  23726. new z([null, c, I, M, a])) : f && c.size.bottom <= b.pane.height && q(d.y, c.size.bottom - e, b.pane
  23727. .height) ? (a = a.inInlineMode || q(c.size.bottom, b.pane.height - e, b.pane.height) ? D : x, new z([c,
  23728. null, da, M, a
  23729. ])) : null
  23730. }
  23731. function ea(a) {
  23732. var c = a.mouse,
  23733. d = a.view,
  23734. b = a.triggerOffset,
  23735. e = O(a);
  23736. if (!e) return null;
  23737. r(a, e);
  23738. var b = Math.min(b, 0 | e.size.outerHeight / 2),
  23739. f = [],
  23740. k, h;
  23741. if (q(c.y, e.size.top - 1, e.size.top + b)) h = !1;
  23742. else if (q(c.y,
  23743. e.size.bottom - b, e.size.bottom + 1)) h = !0;
  23744. else return null;
  23745. if (u(e) || na(a, e, h) || e.getParent().is(fa)) return null;
  23746. var g = w(a, e, !h);
  23747. if (g) {
  23748. if (g && g.type == CKEDITOR.NODE_TEXT) return null;
  23749. if (n(g)) {
  23750. if (u(g) || !L(a, g) || g.getParent().is(fa)) return null;
  23751. f = [g, e][h ? "reverse" : "concat"]().concat([T, M])
  23752. }
  23753. } else e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? (H(a), h && q(c.y, e.size.bottom - b,
  23754. d.pane.height) && q(e.size.bottom, d.pane.height - b, d.pane.height) ? k = D : q(c.y, 0, e.size.top +
  23755. b) && (k = C)) : k = x, f = [null, e][h ? "reverse" :
  23756. "concat"
  23757. ]().concat([h ? da : I, M, k, e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? h ? D : C :
  23758. x]);
  23759. return 0 in f ? new z(f) : null
  23760. }
  23761. function U(a, c, d, b) {
  23762. for (var e = c.getDocumentPosition(), f = {}, k = {}, h = {}, g = {}, l = y.length; l--;) f[y[l]] = parseInt(c
  23763. .getComputedStyle.call(c, "border-" + y[l] + "-width"), 10) || 0, h[y[l]] = parseInt(c.getComputedStyle
  23764. .call(c, "padding-" + y[l]), 10) || 0, k[y[l]] = parseInt(c.getComputedStyle.call(c, "margin-" + y[l]),
  23765. 10) || 0;
  23766. d && !b || N(a, b);
  23767. g.top = e.y - (d ? 0 : a.view.scroll.y);
  23768. g.left = e.x - (d ? 0 : a.view.scroll.x);
  23769. g.outerWidth = c.$.offsetWidth;
  23770. g.outerHeight = c.$.offsetHeight;
  23771. g.height = g.outerHeight - (h.top + h.bottom + f.top + f.bottom);
  23772. g.width = g.outerWidth - (h.left + h.right + f.left + f.right);
  23773. g.bottom = g.top + g.outerHeight;
  23774. g.right = g.left + g.outerWidth;
  23775. a.inInlineMode && (g.scroll = {
  23776. top: c.$.scrollTop,
  23777. left: c.$.scrollLeft
  23778. });
  23779. return v({
  23780. border: f,
  23781. padding: h,
  23782. margin: k,
  23783. ignoreScroll: d
  23784. }, g, !0)
  23785. }
  23786. function r(a, c, d) {
  23787. if (!n(c)) return c.size = null;
  23788. if (!c.size) c.size = {};
  23789. else if (c.size.ignoreScroll == d && c.size.date > new Date - ga) return null;
  23790. return v(c.size,
  23791. U(a, c, d), {
  23792. date: +new Date
  23793. }, !0)
  23794. }
  23795. function H(a, c) {
  23796. a.view.editable = U(a, a.editable, c, !0)
  23797. }
  23798. function N(a, c) {
  23799. a.view || (a.view = {});
  23800. var d = a.view;
  23801. if (!(!c && d && d.date > new Date - ga)) {
  23802. var b = a.win,
  23803. d = b.getScrollPosition(),
  23804. b = b.getViewPaneSize();
  23805. v(a.view, {
  23806. scroll: {
  23807. x: d.x,
  23808. y: d.y,
  23809. width: a.doc.$.documentElement.scrollWidth - b.width,
  23810. height: a.doc.$.documentElement.scrollHeight - b.height
  23811. },
  23812. pane: {
  23813. width: b.width,
  23814. height: b.height,
  23815. bottom: b.height + d.y
  23816. },
  23817. date: +new Date
  23818. }, !0)
  23819. }
  23820. }
  23821. function pa(a, c, d, b) {
  23822. for (var e = b, f = b, k = 0, h = !1, g = !1, l = a.view.pane.height,
  23823. p = a.mouse; p.y + k < l && 0 < p.y - k;) {
  23824. h || (h = c(e, b));
  23825. g || (g = c(f, b));
  23826. !h && 0 < p.y - k && (e = d(a, {
  23827. x: p.x,
  23828. y: p.y - k
  23829. }));
  23830. !g && p.y + k < l && (f = d(a, {
  23831. x: p.x,
  23832. y: p.y + k
  23833. }));
  23834. if (h && g) break;
  23835. k += 2
  23836. }
  23837. return new z([e, f, null, null])
  23838. }
  23839. CKEDITOR.plugins.add("magicline", {
  23840. init: function(a) {
  23841. var c = a.config,
  23842. d = c.magicline_triggerOffset || 30,
  23843. b = {
  23844. editor: a,
  23845. enterMode: c.enterMode,
  23846. triggerOffset: d,
  23847. holdDistance: 0 | d * (c.magicline_holdDistance || .5),
  23848. boxColor: c.magicline_color || "#ff0000",
  23849. rtl: "rtl" == c.contentsLangDirection,
  23850. tabuList: ["data-cke-hidden-sel"].concat(c.magicline_tabuList || []),
  23851. triggers: c.magicline_everywhere ? Z : {
  23852. table: 1,
  23853. hr: 1,
  23854. div: 1,
  23855. ul: 1,
  23856. ol: 1,
  23857. dl: 1,
  23858. form: 1,
  23859. blockquote: 1
  23860. }
  23861. },
  23862. e, f, k;
  23863. b.isRelevant = function(a) {
  23864. return n(a) && !A(b, a) && !u(a)
  23865. };
  23866. a.on("contentDom", function() {
  23867. var d = a.editable(),
  23868. g = a.document,
  23869. l = a.window;
  23870. v(b, {
  23871. editable: d,
  23872. inInlineMode: d.isInline(),
  23873. doc: g,
  23874. win: l,
  23875. hotNode: null
  23876. }, !0);
  23877. b.boundary = b.inInlineMode ? b.editable : b.doc.getDocumentElement();
  23878. d.is(B.$inline) || (b.inInlineMode && !ba(d) && d.setStyles({
  23879. position: "relative",
  23880. top: null,
  23881. left: null
  23882. }), la.call(this, b), N(b), d.attachListener(a, "beforeUndoImage",
  23883. function() {
  23884. b.line.detach()
  23885. }), d.attachListener(a, "beforeGetData", function() {
  23886. b.line.wrap.getParent() && (b.line.detach(), a.once("getData", function() {
  23887. b.line.attach()
  23888. }, null, null, 1E3))
  23889. }, null, null, 0), d.attachListener(b.inInlineMode ? g : g.getWindow().getFrame(),
  23890. "mouseout",
  23891. function(c) {
  23892. if ("wysiwyg" == a.mode)
  23893. if (b.inInlineMode) {
  23894. var d = c.data.$.clientX;
  23895. c = c.data.$.clientY;
  23896. N(b);
  23897. H(b, !0);
  23898. var e = b.view.editable,
  23899. f = b.view.scroll;
  23900. d > e.left - f.x && d < e.right - f.x && c > e.top - f.y && c < e.bottom - f.y || (
  23901. clearTimeout(k), k = null, b.line.detach())
  23902. } else clearTimeout(k),
  23903. k = null, b.line.detach()
  23904. }), d.attachListener(d, "keyup", function() {
  23905. b.hiddenMode = 0
  23906. }), d.attachListener(d, "keydown", function(c) {
  23907. if ("wysiwyg" == a.mode) switch (c.data.getKeystroke()) {
  23908. case 2228240:
  23909. case 16:
  23910. b.hiddenMode = 1, b.line.detach()
  23911. }
  23912. }), d.attachListener(b.inInlineMode ? d : g, "mousemove", function(c) {
  23913. f = !0;
  23914. if ("wysiwyg" == a.mode && !a.readOnly && !k) {
  23915. var d = {
  23916. x: c.data.$.clientX,
  23917. y: c.data.$.clientY
  23918. };
  23919. k = setTimeout(function() {
  23920. b.mouse = d;
  23921. k = b.trigger = null;
  23922. N(b);
  23923. f && !b.hiddenMode && a.focusManager.hasFocus && !b.line.mouseNear() && (b
  23924. .element =
  23925. ha(b, !0)) && ((b.trigger = ca(b) || ea(b) || ia(b)) && !aa(b, b.trigger
  23926. .upper || b.trigger.lower) ? b.line.attach().place() : (b.trigger = null,
  23927. b.line.detach()), f = !1)
  23928. }, 30)
  23929. }
  23930. }), d.attachListener(l, "scroll", function() {
  23931. "wysiwyg" == a.mode && (b.line.detach(), t.webkit && (b.hiddenMode = 1, clearTimeout(e),
  23932. e = setTimeout(function() {
  23933. b.mouseDown || (b.hiddenMode = 0)
  23934. }, 50)))
  23935. }), d.attachListener(ja ? g : l, "mousedown", function() {
  23936. "wysiwyg" == a.mode && (b.line.detach(), b.hiddenMode = 1, b.mouseDown = 1)
  23937. }), d.attachListener(ja ? g : l, "mouseup", function() {
  23938. b.hiddenMode =
  23939. 0;
  23940. b.mouseDown = 0
  23941. }), a.addCommand("accessPreviousSpace", Y(b)), a.addCommand("accessNextSpace", Y(b, !0)), a
  23942. .setKeystroke([
  23943. [c.magicline_keystrokePrevious, "accessPreviousSpace"],
  23944. [c.magicline_keystrokeNext, "accessNextSpace"]
  23945. ]), a.on("loadSnapshot", function() {
  23946. var c, d, e, f;
  23947. for (f in {
  23948. p: 1,
  23949. br: 1,
  23950. div: 1
  23951. })
  23952. for (c = a.document.getElementsByTag(f), e = c.count(); e--;)
  23953. if ((d = c.getItem(e)).data("cke-magicline-hot")) {
  23954. b.hotNode = d;
  23955. b.lastCmdDirection = "true" === d.data("cke-magicline-dir") ? !0 : !1;
  23956. return
  23957. }
  23958. }), a._.magiclineBackdoor = {
  23959. accessFocusSpace: S,
  23960. boxTrigger: z,
  23961. isLine: A,
  23962. getAscendantTrigger: O,
  23963. getNonEmptyNeighbour: w,
  23964. getSize: U,
  23965. that: b,
  23966. triggerEdge: ea,
  23967. triggerEditable: ca,
  23968. triggerExpand: ia
  23969. })
  23970. }, this)
  23971. }
  23972. });
  23973. var v = CKEDITOR.tools.extend,
  23974. R = CKEDITOR.dom.element,
  23975. G = R.createFromHtml,
  23976. t = CKEDITOR.env,
  23977. ja = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
  23978. B = CKEDITOR.dtd,
  23979. K = {},
  23980. I = 128,
  23981. da = 64,
  23982. T = 32,
  23983. M = 16,
  23984. C = 4,
  23985. D = 2,
  23986. x = 1,
  23987. J = " ",
  23988. fa = B.$listItem,
  23989. oa = B.$tableContent,
  23990. ma = v({}, B.$nonEditable, B.$empty),
  23991. Z = B.$block,
  23992. ga = 100,
  23993. Q =
  23994. "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
  23995. X = Q + "border-color:transparent;display:block;border-style:solid;",
  23996. W = "\x3cspan\x3e" + J + "\x3c/span\x3e";
  23997. K[CKEDITOR.ENTER_BR] = "br";
  23998. K[CKEDITOR.ENTER_P] = "p";
  23999. K[CKEDITOR.ENTER_DIV] = "div";
  24000. z.prototype = {
  24001. set: function(a, c, d) {
  24002. this.properties = a + c + (d || x);
  24003. return this
  24004. },
  24005. is: function(a) {
  24006. return (this.properties & a) == a
  24007. }
  24008. };
  24009. var ha = function() {
  24010. function a(a, d) {
  24011. var b = a.$.elementFromPoint(d.x, d.y);
  24012. return b && b.nodeType ? new CKEDITOR.dom.element(b) : null
  24013. }
  24014. return function(c, d, b) {
  24015. if (!c.mouse) return null;
  24016. var e = c.doc,
  24017. f = c.line.wrap;
  24018. b = b || c.mouse;
  24019. var k = a(e, b);
  24020. d && A(c, k) && (f.hide(), k = a(e, b), f.show());
  24021. return !k || k.type != CKEDITOR.NODE_ELEMENT || !k.$ || t.ie && 9 > t.version && !c.boundary.equals(
  24022. k) && !c.boundary.contains(k) ? null : k
  24023. }
  24024. }(),
  24025. E = CKEDITOR.dom.walker.whitespaces(),
  24026. F = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),
  24027. ia = function() {
  24028. function a(a) {
  24029. var b = a.element,
  24030. e, f, k;
  24031. if (!n(b) || b.contains(a.editable) || b.isReadOnly()) return null;
  24032. k = pa(a, function(a, b) {
  24033. return !b.equals(a)
  24034. }, function(a, b) {
  24035. return ha(a, !0, b)
  24036. }, b);
  24037. e = k.upper;
  24038. f = k.lower;
  24039. if (V(a, e, f)) return k.set(T,
  24040. 8);
  24041. if (e && b.contains(e))
  24042. for (; !e.getParent().equals(b);) e = e.getParent();
  24043. else e = b.getFirst(function(b) {
  24044. return c(a, b)
  24045. });
  24046. if (f && b.contains(f))
  24047. for (; !f.getParent().equals(b);) f = f.getParent();
  24048. else f = b.getLast(function(b) {
  24049. return c(a, b)
  24050. });
  24051. if (!e || !f) return null;
  24052. r(a, e);
  24053. r(a, f);
  24054. if (!q(a.mouse.y, e.size.top, f.size.bottom)) return null;
  24055. for (var b = Number.MAX_VALUE, h, g, l, p; f && !f.equals(e) && (g = e.getNext(a.isRelevant));) h = Math
  24056. .abs(ka(a, e, g) - a.mouse.y), h < b && (b = h, l = e, p = g), e = g, r(a, e);
  24057. if (!l || !p || !q(a.mouse.y, l.size.top, p.size.bottom)) return null;
  24058. k.upper = l;
  24059. k.lower = p;
  24060. return k.set(T, 8)
  24061. }
  24062. function c(a, b) {
  24063. return !(b && b.type == CKEDITOR.NODE_TEXT || F(b) || u(b) || A(a, b) || b.type == CKEDITOR
  24064. .NODE_ELEMENT && b.$ && b.is("br"))
  24065. }
  24066. return function(c) {
  24067. var b = a(c),
  24068. e;
  24069. if (e = b) {
  24070. e = b.upper;
  24071. var f = b.lower;
  24072. e = !e || !f || u(f) || u(e) || f.equals(e) || e.equals(f) || f.contains(e) || e.contains(f) ? !1 : L(
  24073. c, e) && L(c, f) && V(c, e, f) ? !0 : !1
  24074. }
  24075. return e ? b : null
  24076. }
  24077. }(),
  24078. y = ["top", "left", "right", "bottom"]
  24079. })();
  24080. CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51;
  24081. CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52;
  24082. (function() {
  24083. function n(a) {
  24084. if (!a || a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) return [];
  24085. for (var c = [], d = ["style", "className"], b = 0; b < d.length; b++) {
  24086. var e = a.$.elements.namedItem(d[b]);
  24087. e && (e = new CKEDITOR.dom.element(e), c.push([e, e.nextSibling]), e.remove())
  24088. }
  24089. return c
  24090. }
  24091. function h(a, c) {
  24092. if (a && a.type == CKEDITOR.NODE_ELEMENT && "form" == a.getName() && 0 < c.length)
  24093. for (var d = c.length - 1; 0 <= d; d--) {
  24094. var b = c[d][0],
  24095. e = c[d][1];
  24096. e ? b.insertBefore(e) : b.appendTo(a)
  24097. }
  24098. }
  24099. function q(a, c) {
  24100. var d = n(a),
  24101. b = {},
  24102. e = a.$;
  24103. c || (b["class"] = e.className ||
  24104. "", e.className = "");
  24105. b.inline = e.style.cssText || "";
  24106. c || (e.style.cssText = "position: static; overflow: visible");
  24107. h(d);
  24108. return b
  24109. }
  24110. function r(a, c) {
  24111. var d = n(a),
  24112. b = a.$;
  24113. "class" in c && (b.className = c["class"]);
  24114. "inline" in c && (b.style.cssText = c.inline);
  24115. h(d)
  24116. }
  24117. function t(a) {
  24118. if (!a.editable().isInline()) {
  24119. var c = CKEDITOR.instances,
  24120. d;
  24121. for (d in c) {
  24122. var b = c[d];
  24123. "wysiwyg" != b.mode || b.readOnly || (b = b.document.getBody(), b.setAttribute("contentEditable", !1), b
  24124. .setAttribute("contentEditable", !0))
  24125. }
  24126. a.editable().hasFocus && (a.toolbox.focus(),
  24127. a.focus())
  24128. }
  24129. }
  24130. CKEDITOR.plugins.add("maximize", {
  24131. init: function(a) {
  24132. function c() {
  24133. var c = g.getViewPaneSize();
  24134. a.resize(c.width, c.height, null, !0)
  24135. }
  24136. function d() {
  24137. var c = a.getCommand("maximize");
  24138. c.state === CKEDITOR.TRISTATE_ON && c.exec()
  24139. }
  24140. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  24141. var b = a.lang,
  24142. e = CKEDITOR.document,
  24143. g = e.getWindow(),
  24144. l, m, p, n = CKEDITOR.TRISTATE_OFF;
  24145. a.addCommand("maximize", {
  24146. modes: {
  24147. wysiwyg: !CKEDITOR.env.iOS,
  24148. source: !CKEDITOR.env.iOS
  24149. },
  24150. readOnly: 1,
  24151. editorFocus: !1,
  24152. exec: function() {
  24153. var b = a.container.getFirst(function(a) {
  24154. return a.type ==
  24155. CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  24156. }),
  24157. d = a.ui.space("contents");
  24158. if ("wysiwyg" == a.mode) {
  24159. var f = a.getSelection();
  24160. l = f && f.getRanges();
  24161. m = g.getScrollPosition()
  24162. } else {
  24163. var k = a.editable().$;
  24164. l = !CKEDITOR.env.ie && [k.selectionStart, k.selectionEnd];
  24165. m = [k.scrollLeft, k.scrollTop]
  24166. }
  24167. if (this.state == CKEDITOR.TRISTATE_OFF) {
  24168. g.on("resize", c);
  24169. p = g.getScrollPosition();
  24170. for (f = a.container; f = f.getParent();) f.setCustomData("maximize_saved_styles", q(
  24171. f)), f.setStyle("z-index", a.config.baseFloatZIndex - 5);
  24172. d.setCustomData("maximize_saved_styles",
  24173. q(d, !0));
  24174. b.setCustomData("maximize_saved_styles", q(b, !0));
  24175. d = {
  24176. overflow: CKEDITOR.env.webkit ? "" : "hidden",
  24177. width: 0,
  24178. height: 0
  24179. };
  24180. e.getDocumentElement().setStyles(d);
  24181. !CKEDITOR.env.gecko && e.getDocumentElement().setStyle("position", "fixed");
  24182. CKEDITOR.env.gecko && CKEDITOR.env.quirks || e.getBody().setStyles(d);
  24183. CKEDITOR.env.ie ? setTimeout(function() {
  24184. g.$.scrollTo(0, 0)
  24185. }, 0) : g.$.scrollTo(0, 0);
  24186. b.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" :
  24187. "absolute");
  24188. b.$.offsetLeft;
  24189. b.setStyles({
  24190. "z-index": a.config.baseFloatZIndex -
  24191. 5,
  24192. left: "0px",
  24193. top: "0px"
  24194. });
  24195. b.addClass("cke_maximized");
  24196. c();
  24197. d = b.getDocumentPosition();
  24198. b.setStyles({
  24199. left: -1 * d.x + "px",
  24200. top: -1 * d.y + "px"
  24201. });
  24202. CKEDITOR.env.gecko && t(a)
  24203. } else if (this.state == CKEDITOR.TRISTATE_ON) {
  24204. g.removeListener("resize", c);
  24205. for (var f = [d, b], h = 0; h < f.length; h++) r(f[h], f[h].getCustomData(
  24206. "maximize_saved_styles")), f[h].removeCustomData("maximize_saved_styles");
  24207. for (f = a.container; f = f.getParent();) r(f, f.getCustomData(
  24208. "maximize_saved_styles")), f.removeCustomData("maximize_saved_styles");
  24209. CKEDITOR.env.ie ?
  24210. setTimeout(function() {
  24211. g.$.scrollTo(p.x, p.y)
  24212. }, 0) : g.$.scrollTo(p.x, p.y);
  24213. b.removeClass("cke_maximized");
  24214. CKEDITOR.env.webkit && (b.setStyle("display", "inline"), setTimeout(function() {
  24215. b.setStyle("display", "block")
  24216. }, 0));
  24217. a.fire("resize", {
  24218. outerHeight: a.container.$.offsetHeight,
  24219. contentsHeight: d.$.offsetHeight,
  24220. outerWidth: a.container.$.offsetWidth
  24221. })
  24222. }
  24223. this.toggleState();
  24224. "wysiwyg" == a.mode ? l ? (CKEDITOR.env.gecko && t(a), a.getSelection().selectRanges(l), (
  24225. k = a.getSelection().getStartElement()) && k.scrollIntoView(!0)) : g.$.scrollTo(m.x,
  24226. m.y) : (l && (k.selectionStart = l[0], k.selectionEnd = l[1]), k.scrollLeft = m[0], k
  24227. .scrollTop = m[1]);
  24228. l = m = null;
  24229. n = this.state;
  24230. a.fire("maximize", this.state)
  24231. },
  24232. canUndo: !1
  24233. });
  24234. a.ui.addButton && a.ui.addButton("Maximize", {
  24235. isToggle: !0,
  24236. label: b.maximize.maximize,
  24237. command: "maximize",
  24238. toolbar: "tools,10"
  24239. });
  24240. a.on("mode", function() {
  24241. var b = a.getCommand("maximize");
  24242. b.setState(b.state == CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : n)
  24243. }, null, null, 100);
  24244. if (a.config.maximize_historyIntegration) {
  24245. var h = a.config.maximize_historyIntegration ===
  24246. CKEDITOR.HISTORY_NATIVE ? "popstate" : "hashchange";
  24247. g.on(h, d);
  24248. a.on("destroy", function() {
  24249. g.removeListener(h, d)
  24250. })
  24251. }
  24252. }
  24253. }
  24254. });
  24255. CKEDITOR.config.maximize_historyIntegration = CKEDITOR.HISTORY_NATIVE
  24256. })();
  24257. CKEDITOR.plugins.add("newpage", {
  24258. init: function(a) {
  24259. a.addCommand("newpage", {
  24260. modes: {
  24261. wysiwyg: 1,
  24262. source: 1
  24263. },
  24264. exec: function(b) {
  24265. var a = this;
  24266. b.setData(b.config.newpage_html || "", function() {
  24267. b.focus();
  24268. setTimeout(function() {
  24269. b.fire("afterCommandExec", {
  24270. name: "newpage",
  24271. command: a
  24272. });
  24273. b.selectionChange()
  24274. }, 200)
  24275. })
  24276. },
  24277. async: !0
  24278. });
  24279. a.ui.addButton && a.ui.addButton("NewPage", {
  24280. label: a.lang.newpage.toolbar,
  24281. command: "newpage",
  24282. toolbar: "document,20"
  24283. })
  24284. }
  24285. });
  24286. (function() {
  24287. function e(a) {
  24288. return {
  24289. "aria-label": a,
  24290. "class": "cke_pagebreak",
  24291. contenteditable: "false",
  24292. "data-cke-display-name": "pagebreak",
  24293. "data-cke-pagebreak": 1,
  24294. style: "page-break-after: always",
  24295. title: a
  24296. }
  24297. }
  24298. CKEDITOR.plugins.add("pagebreak", {
  24299. requires: "fakeobjects",
  24300. onLoad: function() {
  24301. var a = ("background:url(" + CKEDITOR.getUrl(this.path + "images/pagebreak.gif") +
  24302. ") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:7px;cursor:default;"
  24303. ).replace(/;/g,
  24304. " !important;");
  24305. CKEDITOR.addCss("div.cke_pagebreak{" + a + "}")
  24306. },
  24307. init: function(a) {
  24308. a.blockless || (a.addCommand("pagebreak", CKEDITOR.plugins.pagebreakCmd), a.ui.addButton && a.ui
  24309. .addButton("PageBreak", {
  24310. label: a.lang.pagebreak.toolbar,
  24311. command: "pagebreak",
  24312. toolbar: "insert,70"
  24313. }), CKEDITOR.env.webkit && a.on("contentDom", function() {
  24314. a.document.on("click", function(c) {
  24315. c = c.data.getTarget();
  24316. c.is("div") && c.hasClass("cke_pagebreak") && a.getSelection().selectElement(c)
  24317. })
  24318. }))
  24319. },
  24320. afterInit: function(a) {
  24321. function c(f) {
  24322. CKEDITOR.tools.extend(f.attributes,
  24323. e(a.lang.pagebreak.alt), !0);
  24324. f.children.length = 0
  24325. }
  24326. var b = a.dataProcessor,
  24327. g = b && b.dataFilter,
  24328. b = b && b.htmlFilter,
  24329. h = /page-break-after\s*:\s*always/i,
  24330. k = /display\s*:\s*none/i;
  24331. b && b.addRules({
  24332. attributes: {
  24333. "class": function(a, c) {
  24334. var b = a.replace("cke_pagebreak", "");
  24335. if (b != a) {
  24336. var d = CKEDITOR.htmlParser.fragment.fromHtml(
  24337. '\x3cspan style\x3d"display: none;"\x3e\x26nbsp;\x3c/span\x3e').children[0];
  24338. c.children.length = 0;
  24339. c.add(d);
  24340. d = c.attributes;
  24341. delete d["aria-label"];
  24342. delete d.contenteditable;
  24343. delete d.title
  24344. }
  24345. return b
  24346. }
  24347. }
  24348. }, {
  24349. applyToAll: !0,
  24350. priority: 5
  24351. });
  24352. g && g.addRules({
  24353. elements: {
  24354. div: function(a) {
  24355. if (a.attributes["data-cke-pagebreak"]) c(a);
  24356. else if (h.test(a.attributes.style)) {
  24357. var b = a.children[0];
  24358. b && "span" == b.name && k.test(b.attributes.style) && c(a)
  24359. }
  24360. }
  24361. }
  24362. })
  24363. }
  24364. });
  24365. CKEDITOR.plugins.pagebreakCmd = {
  24366. exec: function(a) {
  24367. a.insertElement(CKEDITOR.plugins.pagebreak.createElement(a))
  24368. },
  24369. context: "div",
  24370. allowedContent: {
  24371. div: {
  24372. styles: "!page-break-after"
  24373. },
  24374. span: {
  24375. match: function(a) {
  24376. return (a = a.parent) && "div" == a.name && a.styles && a.styles["page-break-after"]
  24377. },
  24378. styles: "display"
  24379. }
  24380. },
  24381. requiredContent: "div{page-break-after}"
  24382. };
  24383. CKEDITOR.plugins.pagebreak = {
  24384. createElement: function(a) {
  24385. return a.document.createElement("div", {
  24386. attributes: e(a.lang.pagebreak.alt)
  24387. })
  24388. }
  24389. }
  24390. })();
  24391. (function() {
  24392. var f = {
  24393. canUndo: !1,
  24394. async: !0,
  24395. exec: function(a, b) {
  24396. var c = a.lang,
  24397. e = CKEDITOR.tools.keystrokeToString(c.common.keyboard, a.getCommandKeystroke(CKEDITOR.env.ie ? a
  24398. .commands.paste : this)),
  24399. d = b && "undefined" !== typeof b.notification ? b.notification : !b || !b.from ||
  24400. "keystrokeHandler" === b.from && CKEDITOR.env.ie,
  24401. c = d && "string" === typeof d ? d : c.pastetext.pasteNotification.replace(/%1/,
  24402. '\x3ckbd aria-label\x3d"' + e.aria + '"\x3e' + e.display + "\x3c/kbd\x3e");
  24403. a.execCommand("paste", {
  24404. type: "text",
  24405. notification: d ? c : !1
  24406. })
  24407. }
  24408. };
  24409. CKEDITOR.plugins.add("pastetext", {
  24410. requires: "clipboard",
  24411. init: function(a) {
  24412. var b = CKEDITOR.env.safari ? CKEDITOR.CTRL + CKEDITOR.ALT + CKEDITOR.SHIFT + 86 : CKEDITOR.CTRL +
  24413. CKEDITOR.SHIFT + 86;
  24414. a.addCommand("pastetext", f);
  24415. a.setKeystroke(b, "pastetext");
  24416. CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteText", {
  24417. label: a.lang.pastetext.button,
  24418. command: "pastetext",
  24419. toolbar: "clipboard,40"
  24420. });
  24421. if (a.config.forcePasteAsPlainText) a.on("beforePaste", function(a) {
  24422. "html" != a.data.type && (a.data.type = "text")
  24423. });
  24424. a.on("pasteState", function(b) {
  24425. a.getCommand("pastetext").setState(b.data)
  24426. })
  24427. }
  24428. })
  24429. })();
  24430. (function() {
  24431. function n(a, b) {
  24432. return CKEDITOR.tools.array.filter(a, function(a) {
  24433. return a.canHandle(b)
  24434. }).sort(function(a, c) {
  24435. return a.priority === c.priority ? 0 : a.priority - c.priority
  24436. })
  24437. }
  24438. function k(a, b) {
  24439. var d = a.shift();
  24440. d && d.handle(b, function() {
  24441. k(a, b)
  24442. })
  24443. }
  24444. function p(a) {
  24445. var b = CKEDITOR.tools.array.reduce(a, function(a, c) {
  24446. return CKEDITOR.tools.array.isArray(c.filters) ? a.concat(c.filters) : a
  24447. }, []);
  24448. return CKEDITOR.tools.array.filter(b, function(a, c) {
  24449. return CKEDITOR.tools.array.indexOf(b, a) === c
  24450. })
  24451. }
  24452. function l(a, b) {
  24453. var d =
  24454. 0,
  24455. c, e;
  24456. if (!CKEDITOR.tools.array.isArray(a) || 0 === a.length) return !0;
  24457. c = CKEDITOR.tools.array.filter(a, function(a) {
  24458. return -1 === CKEDITOR.tools.array.indexOf(m, a)
  24459. });
  24460. if (0 < c.length)
  24461. for (e = 0; e < c.length; e++)(function(a) {
  24462. CKEDITOR.scriptLoader.queue(a, function(e) {
  24463. e && m.push(a);
  24464. ++d === c.length && b()
  24465. })
  24466. })(c[e]);
  24467. return 0 === c.length
  24468. }
  24469. var m = [],
  24470. q = CKEDITOR.tools.createClass({
  24471. $: function() {
  24472. this.handlers = []
  24473. },
  24474. proto: {
  24475. register: function(a) {
  24476. "number" !== typeof a.priority && (a.priority = 10);
  24477. this.handlers.push(a)
  24478. },
  24479. addPasteListener: function(a) {
  24480. a.on("paste",
  24481. function(b) {
  24482. var d = n(this.handlers, b),
  24483. c;
  24484. if (0 !== d.length) {
  24485. c = p(d);
  24486. c = l(c, function() {
  24487. return a.fire("paste", b.data)
  24488. });
  24489. if (!c) return b.cancel();
  24490. k(d, b)
  24491. }
  24492. }, this, null, 3)
  24493. }
  24494. }
  24495. });
  24496. CKEDITOR.plugins.add("pastetools", {
  24497. requires: ["clipboard", "ajax"],
  24498. beforeInit: function(a) {
  24499. a.pasteTools = new q;
  24500. a.pasteTools.addPasteListener(a)
  24501. }
  24502. });
  24503. CKEDITOR.plugins.pastetools = {
  24504. filters: {},
  24505. loadFilters: l,
  24506. createFilter: function(a) {
  24507. var b = CKEDITOR.tools.array.isArray(a.rules) ? a.rules : [a.rules],
  24508. d = a.additionalTransforms;
  24509. return function(a, e) {
  24510. var f = new CKEDITOR.htmlParser.basicWriter,
  24511. g = new CKEDITOR.htmlParser.filter,
  24512. h;
  24513. d && (a = d(a, e));
  24514. CKEDITOR.tools.array.forEach(b, function(b) {
  24515. g.addRules(b(a, e, g))
  24516. });
  24517. h = CKEDITOR.htmlParser.fragment.fromHtml(a);
  24518. g.applyTo(h);
  24519. h.writeHtml(f);
  24520. return f.getHtml()
  24521. }
  24522. },
  24523. getClipboardData: function(a, b) {
  24524. var d;
  24525. return CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || "text/html" === b ? (d = a.dataTransfer
  24526. .getData(b, !0)) || "text/html" !== b ? d : a.dataValue : null
  24527. },
  24528. getConfigValue: function(a, b) {
  24529. if (a && a.config) {
  24530. var d = CKEDITOR.tools,
  24531. c = a.config,
  24532. e = d.object.keys(c),
  24533. f = ["pasteTools_" +
  24534. b, "pasteFromWord_" + b, "pasteFromWord" + d.capitalize(b, !0)
  24535. ],
  24536. f = d.array.find(f, function(a) {
  24537. return -1 !== d.array.indexOf(e, a)
  24538. });
  24539. return c[f]
  24540. }
  24541. },
  24542. getContentGeneratorName: function(a) {
  24543. if ((a = /<meta\s+name=["']?generator["']?\s+content=["']?(\w+)/gi.exec(a)) && a.length) return a = a[1]
  24544. .toLowerCase(), 0 === a.indexOf("microsoft") ? "microsoft" : 0 === a.indexOf("libreoffice") ?
  24545. "libreoffice" : "unknown"
  24546. }
  24547. };
  24548. CKEDITOR.pasteFilters = CKEDITOR.plugins.pastetools.filters
  24549. })();
  24550. (function() {
  24551. CKEDITOR.plugins.add("pastefromgdocs", {
  24552. requires: "pastetools",
  24553. init: function(a) {
  24554. var c = CKEDITOR.plugins.getPath("pastetools"),
  24555. d = this.path;
  24556. a.pasteTools.register({
  24557. filters: [CKEDITOR.getUrl(c + "filter/common.js"), CKEDITOR.getUrl(d + "filter/default.js")],
  24558. canHandle: function(a) {
  24559. return /id=(\"|\')?docs\-internal\-guid\-/.test(a.data.dataValue)
  24560. },
  24561. handle: function(c, d) {
  24562. var b = c.data,
  24563. e = CKEDITOR.plugins.pastetools.getClipboardData(b, "text/html");
  24564. b.dontFilter = !0;
  24565. b.dataValue = CKEDITOR.pasteFilters.gdocs(e, a);
  24566. !0 === a.config.forcePasteAsPlainText && (b.type = "text");
  24567. d()
  24568. }
  24569. })
  24570. }
  24571. })
  24572. })();
  24573. (function() {
  24574. CKEDITOR.plugins.add("pastefromlibreoffice", {
  24575. requires: "pastetools",
  24576. isSupportedEnvironment: function() {
  24577. var b = CKEDITOR.env.ie && 11 >= CKEDITOR.env.version;
  24578. return !(CKEDITOR.env.webkit && !CKEDITOR.env.chrome) && !b
  24579. },
  24580. init: function(b) {
  24581. if (this.isSupportedEnvironment()) {
  24582. var d = CKEDITOR.plugins.getPath("pastetools"),
  24583. f = this.path;
  24584. b.pasteTools.register({
  24585. priority: 100,
  24586. filters: [CKEDITOR.getUrl(d + "filter/common.js"), CKEDITOR.getUrl(d + "filter/image.js"),
  24587. CKEDITOR.getUrl(f + "filter/default.js")
  24588. ],
  24589. canHandle: function(a) {
  24590. a =
  24591. a.data;
  24592. return (a = a.dataTransfer.getData("text/html", !0) || a.dataValue) ? "libreoffice" ===
  24593. CKEDITOR.plugins.pastetools.getContentGeneratorName(a) : !1
  24594. },
  24595. handle: function(a, d) {
  24596. var c = a.data,
  24597. e = c.dataValue || CKEDITOR.plugins.pastetools.getClipboardData(c, "text/html");
  24598. c.dontFilter = !0;
  24599. e = CKEDITOR.pasteFilters.image(e, b, CKEDITOR.plugins.pastetools.getClipboardData(c,
  24600. "text/rtf"));
  24601. c.dataValue = CKEDITOR.pasteFilters.libreoffice(e, b);
  24602. !0 === b.config.forcePasteAsPlainText && (c.type = "text");
  24603. d()
  24604. }
  24605. })
  24606. }
  24607. }
  24608. })
  24609. })();
  24610. (function() {
  24611. CKEDITOR.plugins.add("pastefromword", {
  24612. requires: "pastetools",
  24613. init: function(a) {
  24614. var f = 0,
  24615. e = CKEDITOR.plugins.getPath("pastetools"),
  24616. h = this.path,
  24617. k = void 0 === a.config.pasteFromWord_inlineImages ? !0 : a.config.pasteFromWord_inlineImages,
  24618. e = [CKEDITOR.getUrl(e + "filter/common.js"), CKEDITOR.getUrl(e + "filter/image.js"), CKEDITOR
  24619. .getUrl(h + "filter/default.js")
  24620. ];
  24621. a.addCommand("pastefromword", {
  24622. canUndo: !1,
  24623. async: !0,
  24624. exec: function(a, b) {
  24625. f = 1;
  24626. a.execCommand("paste", {
  24627. type: "html",
  24628. notification: b && "undefined" !== typeof b.notification ?
  24629. b.notification : !0
  24630. })
  24631. }
  24632. });
  24633. CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteFromWord", {
  24634. label: a.lang.pastefromword.toolbar,
  24635. command: "pastefromword",
  24636. toolbar: "clipboard,50"
  24637. });
  24638. a.pasteTools.register({
  24639. filters: a.config.pasteFromWordCleanupFile ? [a.config.pasteFromWordCleanupFile] : e,
  24640. canHandle: function(a) {
  24641. a = CKEDITOR.plugins.pastetools.getClipboardData(a.data, "text/html");
  24642. var b = CKEDITOR.plugins.pastetools.getContentGeneratorName(a),
  24643. d = /(class="?Mso|style=["'][^"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,
  24644. b = b ? "microsoft" ===
  24645. b : d.test(a);
  24646. return a && (f || b)
  24647. },
  24648. handle: function(e, b) {
  24649. var d = e.data,
  24650. c = CKEDITOR.plugins.pastetools.getClipboardData(d, "text/html"),
  24651. g = CKEDITOR.plugins.pastetools.getClipboardData(d, "text/rtf"),
  24652. c = {
  24653. dataValue: c,
  24654. dataTransfer: {
  24655. "text/rtf": g
  24656. }
  24657. };
  24658. if (!1 !== a.fire("pasteFromWord", c) || f) {
  24659. d.dontFilter = !0;
  24660. if (f || !a.config.pasteFromWordPromptCleanup || confirm(a.lang.pastefromword
  24661. .confirmCleanup)) c.dataValue = CKEDITOR.cleanWord(c.dataValue, a), CKEDITOR.plugins
  24662. .clipboard.isCustomDataTypesSupported && k && CKEDITOR.pasteFilters.image &&
  24663. (c.dataValue = CKEDITOR.pasteFilters.image(c.dataValue, a, g)), a.fire(
  24664. "afterPasteFromWord", c), d.dataValue = c.dataValue, !0 === a.config
  24665. .forcePasteAsPlainText ? d.type = "text" : CKEDITOR.plugins.clipboard
  24666. .isCustomCopyCutSupported || "allow-word" !== a.config.forcePasteAsPlainText || (d
  24667. .type = "html");
  24668. f = 0;
  24669. b()
  24670. }
  24671. }
  24672. })
  24673. }
  24674. })
  24675. })();
  24676. (function() {
  24677. function h(b, f) {
  24678. var e = CKEDITOR.plugins.getPath("preview"),
  24679. a = b.config,
  24680. c = b.title,
  24681. d;
  24682. d = a.baseHref ? '\x3cbase href\x3d"' + a.baseHref + '"\x3e' : "";
  24683. if (a.fullPage) e = b.getData().replace(/<head>/, "$\x26" + d).replace(/[^>]*(?=<\/title>)/,
  24684. "$\x26 \x26mdash; " + c);
  24685. else {
  24686. e = a.docType + '\x3chtml dir\x3d"' + a.contentsLangDirection + '"\x3e\x3chead\x3e' + d + "\x3ctitle\x3e" +
  24687. c + "\x3c/title\x3e" + CKEDITOR.tools.buildStyleHtml(a.contentsCss) +
  24688. '\x3clink rel\x3d"stylesheet" media\x3d"screen" href\x3d"' + e + 'styles/screen.css"\x3e\x3c/head\x3e';
  24689. a = "\x3cbody\x3e";
  24690. if (c = b.document && b.document.getBody()) c.getAttribute("id") && (a = a.replace("\x3e", ' id\x3d"' + c
  24691. .getAttribute("id") + '"\x3e')), c.getAttribute("class") && (a = a.replace("\x3e", ' class\x3d"' + c
  24692. .getAttribute("class") + '"\x3e'));
  24693. e = e + a + b.getData() + (f ? "\x3cscript\x3e" + (CKEDITOR.env.ie ? "window.onload" :
  24694. "document.onreadystatechange") + " \x3d function() { previewCallback(); } \x3c/script\x3e" : "") +
  24695. "\x3c/body\x3e\x3c/html\x3e"
  24696. }
  24697. return e
  24698. }
  24699. function k() {
  24700. var b = window.screen;
  24701. return {
  24702. width: Math.round(.8 * b.width),
  24703. height: Math.round(.7 * b.height),
  24704. left: Math.round(.1 * b.width)
  24705. }
  24706. }
  24707. CKEDITOR.plugins.add("preview", {
  24708. init: function(b) {
  24709. b.addCommand("preview", {
  24710. modes: {
  24711. wysiwyg: 1
  24712. },
  24713. canUndo: !1,
  24714. readOnly: 1,
  24715. exec: function() {
  24716. CKEDITOR.plugins.preview.createPreview(b)
  24717. }
  24718. });
  24719. b.ui.addButton && b.ui.addButton("Preview", {
  24720. label: b.lang.preview.preview,
  24721. command: "preview",
  24722. toolbar: "document,40"
  24723. })
  24724. }
  24725. });
  24726. CKEDITOR.plugins.preview = {
  24727. createPreview: function(b, f) {
  24728. var e = {
  24729. dataValue: h(b, f)
  24730. },
  24731. a = k(),
  24732. c;
  24733. c = CKEDITOR.env.ie ? "javascript:void( (function(){document.open();" +
  24734. ("(" + CKEDITOR.tools.fixDomain + ")();").replace(/\/\/.*?\n/g, "").replace(/parent\./g,
  24735. "window.opener.") +
  24736. "document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad \x3d null;})() )" :
  24737. null;
  24738. var d, g;
  24739. if (!1 === b.fire("contentPreview", e)) return !1;
  24740. c && (window._cke_htmlToLoad = e.dataValue);
  24741. d = window.open("", null, [
  24742. "toolbar\x3dyes,location\x3dno,status\x3dyes,menubar\x3dyes,scrollbars\x3dyes,resizable\x3dyes",
  24743. "width\x3d" + a.width, "height\x3d" + a.height, "left\x3d" + a.left
  24744. ].join());
  24745. g =
  24746. new CKEDITOR.dom.window(d);
  24747. c && d && (d.location = c);
  24748. window._cke_htmlToLoad || (a = d.document, a.open(), a.write(e.dataValue), a.close());
  24749. f && (d.previewCallback = function() {
  24750. "complete" === d.document.readyState && f(g)
  24751. }, d.previewCallback());
  24752. return g
  24753. }
  24754. }
  24755. })();
  24756. (function() {
  24757. CKEDITOR.plugins.add("print", {
  24758. requires: "preview",
  24759. init: function(a) {
  24760. a.addCommand("print", CKEDITOR.plugins.print);
  24761. a.ui.addButton && a.ui.addButton("Print", {
  24762. label: a.lang.print.toolbar,
  24763. command: "print",
  24764. toolbar: "document,50"
  24765. })
  24766. }
  24767. });
  24768. CKEDITOR.plugins.print = {
  24769. exec: function(a) {
  24770. CKEDITOR.plugins.preview.createPreview(a, function(a) {
  24771. a = a.$;
  24772. CKEDITOR.env.gecko ? a.print() : a.document.execCommand("Print");
  24773. a.close()
  24774. })
  24775. },
  24776. canUndo: !1,
  24777. readOnly: 1,
  24778. modes: {
  24779. wysiwyg: 1
  24780. }
  24781. }
  24782. })();
  24783. CKEDITOR.plugins.add("removeformat", {
  24784. init: function(a) {
  24785. a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
  24786. a.ui.addButton && a.ui.addButton("RemoveFormat", {
  24787. label: a.lang.removeformat.toolbar,
  24788. command: "removeFormat",
  24789. toolbar: "cleanup,10"
  24790. })
  24791. }
  24792. });
  24793. CKEDITOR.plugins.removeformat = {
  24794. commands: {
  24795. removeformat: {
  24796. exec: function(a) {
  24797. for (var h = a._.removeFormatRegex || (a._.removeFormatRegex = new RegExp("^(?:" + a.config
  24798. .removeFormatTags.replace(/,/g, "|") + ")$", "i")), c = a._.removeAttributes || (a._
  24799. .removeAttributes = a.config.removeFormatAttributes.split(",")), e = CKEDITOR.plugins.removeformat
  24800. .filter, m = a.getSelection().getRanges(), n = m.createIterator(), p = function(a) {
  24801. return a.type == CKEDITOR.NODE_ELEMENT
  24802. }, f; f = n.getNextRange();) {
  24803. f.enlarge(CKEDITOR.ENLARGE_INLINE);
  24804. var l = f.createBookmark(),
  24805. b = l.startNode,
  24806. d = l.endNode,
  24807. k = function(b) {
  24808. for (var c = a.elementPath(b), f = c.elements, d = 1, g;
  24809. (g = f[d]) && !g.equals(c.block) && !g.equals(c.blockLimit); d++) h.test(g.getName()) && e(a,
  24810. g) && b.breakParent(g)
  24811. };
  24812. k(b);
  24813. if (d)
  24814. for (k(d), b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); b && !b.equals(d);)
  24815. if (b.isReadOnly()) {
  24816. if (b.getPosition(d) & CKEDITOR.POSITION_CONTAINS) break;
  24817. b = b.getNext(p)
  24818. } else k = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT), "img" == b.getName() && b.data(
  24819. "cke-realelement") || !e(a, b) || (h.test(b.getName()) ? b.remove(1) :
  24820. (b.removeAttributes(c), a.fire("removeFormatCleanup", b))), b = k;
  24821. f.moveToBookmark(l)
  24822. }
  24823. a.forceNextSelectionCheck();
  24824. a.getSelection().selectRanges(m)
  24825. }
  24826. }
  24827. },
  24828. filter: function(a, h) {
  24829. for (var c = a._.removeFormatFilters || [], e = 0; e < c.length; e++)
  24830. if (!1 === c[e](h)) return !1;
  24831. return !0
  24832. }
  24833. };
  24834. CKEDITOR.editor.prototype.addRemoveFormatFilter = function(a) {
  24835. this._.removeFormatFilters || (this._.removeFormatFilters = []);
  24836. this._.removeFormatFilters.push(a)
  24837. };
  24838. CKEDITOR.config.removeFormatTags =
  24839. "b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
  24840. CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign";
  24841. (function() {
  24842. var b = {
  24843. readOnly: 1,
  24844. modes: {
  24845. wysiwyg: 1,
  24846. source: 1
  24847. },
  24848. exec: function(a) {
  24849. if (a.fire("save") && (a = a.element.$.form)) try {
  24850. a.submit()
  24851. } catch (b) {
  24852. a.submit.click && a.submit.click()
  24853. }
  24854. }
  24855. };
  24856. CKEDITOR.plugins.add("save", {
  24857. init: function(a) {
  24858. a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a.addCommand("save", b).startDisabled = !a.element
  24859. .$.form, a.ui.addButton && a.ui.addButton("Save", {
  24860. label: a.lang.save.toolbar,
  24861. command: "save",
  24862. toolbar: "document,10"
  24863. }))
  24864. }
  24865. })
  24866. })();
  24867. (function() {
  24868. CKEDITOR.plugins.add("selectall", {
  24869. init: function(b) {
  24870. b.addCommand("selectAll", {
  24871. modes: {
  24872. wysiwyg: 1,
  24873. source: 1
  24874. },
  24875. exec: function(a) {
  24876. var b = a.editable();
  24877. if (b.is("textarea")) a = b.$, CKEDITOR.env.ie && a.createTextRange ? a.createTextRange()
  24878. .execCommand("SelectAll") : (a.selectionStart = 0, a.selectionEnd = a.value.length), a
  24879. .focus();
  24880. else {
  24881. if (b.is("body")) a.document.$.execCommand("SelectAll", !1, null);
  24882. else {
  24883. var c = a.createRange();
  24884. c.selectNodeContents(b);
  24885. c.select()
  24886. }
  24887. a.forceNextSelectionCheck();
  24888. a.selectionChange()
  24889. }
  24890. },
  24891. canUndo: !1
  24892. });
  24893. b.ui.addButton && b.ui.addButton("SelectAll", {
  24894. label: b.lang.selectall.toolbar,
  24895. command: "selectAll",
  24896. toolbar: "selection,10"
  24897. })
  24898. }
  24899. })
  24900. })();
  24901. (function() {
  24902. var k = {
  24903. readOnly: 1,
  24904. preserveState: !0,
  24905. editorFocus: !1,
  24906. exec: function(a) {
  24907. this.toggleState();
  24908. this.refresh(a)
  24909. },
  24910. refresh: function(a) {
  24911. if (a.document) {
  24912. var c = this.state != CKEDITOR.TRISTATE_ON || a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && !a
  24913. .focusManager.hasFocus ? "removeClass" : "attachClass";
  24914. a.editable()[c]("cke_show_blocks")
  24915. }
  24916. }
  24917. };
  24918. CKEDITOR.plugins.add("showblocks", {
  24919. onLoad: function() {
  24920. var a = "p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "),
  24921. c, b, e, f, k = CKEDITOR.getUrl(this.path),
  24922. l = !(CKEDITOR.env.ie &&
  24923. 9 > CKEDITOR.env.version),
  24924. g = l ? ":not([contenteditable\x3dfalse]):not(.cke_show_blocks_off)" : "",
  24925. d, h;
  24926. for (c = b = e = f = ""; d = a.pop();) h = a.length ? "," : "", c += ".cke_show_blocks " + d + g + h,
  24927. e += ".cke_show_blocks.cke_contents_ltr " + d + g + h, f += ".cke_show_blocks.cke_contents_rtl " +
  24928. d + g + h, b += ".cke_show_blocks " + d + g + "{background-image:url(" + CKEDITOR.getUrl(k +
  24929. "images/block_" + d + ".png") + ")}";
  24930. CKEDITOR.addCss((c + "{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(b,
  24931. e + "{background-position:top left;padding-left:8px}",
  24932. f + "{background-position:top right;padding-right:8px}"));
  24933. l || CKEDITOR.addCss(
  24934. ".cke_show_blocks [contenteditable\x3dfalse],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}"
  24935. )
  24936. },
  24937. init: function(a) {
  24938. function c() {
  24939. b.refresh(a)
  24940. }
  24941. if (!a.blockless) {
  24942. var b = a.addCommand("showblocks", k);
  24943. b.canUndo = !1;
  24944. a.config.startupOutlineBlocks && b.setState(CKEDITOR.TRISTATE_ON);
  24945. a.ui.addButton && a.ui.addButton("ShowBlocks", {
  24946. label: a.lang.showblocks.toolbar,
  24947. command: "showblocks",
  24948. toolbar: "tools,20"
  24949. });
  24950. a.on("mode", function() {
  24951. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  24952. });
  24953. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (a.on("focus", c), a.on("blur", c));
  24954. a.on("contentDom", function() {
  24955. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  24956. })
  24957. }
  24958. }
  24959. })
  24960. })();
  24961. (function() {
  24962. var f = {
  24963. preserveState: !0,
  24964. editorFocus: !1,
  24965. readOnly: 1,
  24966. exec: function(a) {
  24967. this.toggleState();
  24968. this.refresh(a)
  24969. },
  24970. refresh: function(a) {
  24971. if (a.document) {
  24972. var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass";
  24973. a.editable()[b]("cke_show_borders")
  24974. }
  24975. }
  24976. };
  24977. CKEDITOR.plugins.add("showborders", {
  24978. modes: {
  24979. wysiwyg: 1
  24980. },
  24981. onLoad: function() {
  24982. var a;
  24983. a = (CKEDITOR.env.ie6Compat ? [".%1 table.%2,", ".%1 table.%2 td, .%1 table.%2 th", "{",
  24984. "border : #d3d3d3 1px dotted", "}"
  24985. ] :
  24986. ".%1 table.%2,;.%1 table.%2 \x3e tr \x3e td, .%1 table.%2 \x3e tr \x3e th,;.%1 table.%2 \x3e tbody \x3e tr \x3e td, .%1 table.%2 \x3e tbody \x3e tr \x3e th,;.%1 table.%2 \x3e thead \x3e tr \x3e td, .%1 table.%2 \x3e thead \x3e tr \x3e th,;.%1 table.%2 \x3e tfoot \x3e tr \x3e td, .%1 table.%2 \x3e tfoot \x3e tr \x3e th;{;border : #d3d3d3 1px dotted;}"
  24987. .split(";")).join("").replace(/%2/g,
  24988. "cke_show_border").replace(/%1/g, "cke_show_borders ");
  24989. CKEDITOR.addCss(a)
  24990. },
  24991. init: function(a) {
  24992. var b = a.addCommand("showborders", f);
  24993. b.canUndo = !1;
  24994. !1 !== a.config.startupShowBorders && b.setState(CKEDITOR.TRISTATE_ON);
  24995. a.on("mode", function() {
  24996. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  24997. }, null, null, 100);
  24998. a.on("contentDom", function() {
  24999. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  25000. });
  25001. a.on("removeFormatCleanup", function(d) {
  25002. d = d.data;
  25003. a.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && d.is("table") && (!d.hasAttribute(
  25004. "border") ||
  25005. 0 >= parseInt(d.getAttribute("border"), 10)) && d.addClass("cke_show_border")
  25006. })
  25007. },
  25008. afterInit: function(a) {
  25009. var b = a.dataProcessor;
  25010. a = b && b.dataFilter;
  25011. b = b && b.htmlFilter;
  25012. a && a.addRules({
  25013. elements: {
  25014. table: function(a) {
  25015. a = a.attributes;
  25016. var b = a["class"],
  25017. c = parseInt(a.border, 10);
  25018. c && !(0 >= c) || b && -1 != b.indexOf("cke_show_border") || (a["class"] = (b || "") +
  25019. " cke_show_border")
  25020. }
  25021. }
  25022. });
  25023. b && b.addRules({
  25024. elements: {
  25025. table: function(a) {
  25026. a = a.attributes;
  25027. var b = a["class"];
  25028. b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(
  25029. /^\s+|\s+$/,
  25030. ""))
  25031. }
  25032. }
  25033. })
  25034. }
  25035. });
  25036. CKEDITOR.on("dialogDefinition", function(a) {
  25037. var b = a.data.name;
  25038. if ("table" == b || "tableProperties" == b)
  25039. if (a = a.data.definition, b = a.getContents("info").get("txtBorder"), b.commit = CKEDITOR.tools
  25040. .override(b.commit, function(a) {
  25041. return function(b, c) {
  25042. a.apply(this, arguments);
  25043. var e = parseInt(this.getValue(), 10);
  25044. c[!e || 0 >= e ? "addClass" : "removeClass"]("cke_show_border")
  25045. }
  25046. }), a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) a.setup = CKEDITOR.tools.override(a
  25047. .setup,
  25048. function(a) {
  25049. return function() {
  25050. a.apply(this,
  25051. arguments);
  25052. this.setValue(this.getValue().replace(/cke_show_border/, ""))
  25053. }
  25054. }), a.commit = CKEDITOR.tools.override(a.commit, function(a) {
  25055. return function(b, c) {
  25056. a.apply(this, arguments);
  25057. parseInt(c.getAttribute("border"), 10) || c.addClass("cke_show_border")
  25058. }
  25059. })
  25060. })
  25061. })();
  25062. (function() {
  25063. CKEDITOR.plugins.add("sourcearea", {
  25064. init: function(a) {
  25065. function d() {
  25066. var a = e && this.equals(CKEDITOR.document.getActive());
  25067. this.hide();
  25068. this.setStyle("height", this.getParent().$.clientHeight + "px");
  25069. this.setStyle("width", this.getParent().$.clientWidth + "px");
  25070. this.show();
  25071. a && this.focus()
  25072. }
  25073. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  25074. var f = CKEDITOR.plugins.sourcearea;
  25075. a.addMode("source", function(e) {
  25076. var b = a.ui.space("contents").getDocument().createElement("textarea");
  25077. b.setStyles(CKEDITOR.tools.extend({
  25078. width: CKEDITOR.env.ie7Compat ?
  25079. "99%" : "100%",
  25080. height: "100%",
  25081. resize: "none",
  25082. outline: "none",
  25083. "text-align": "left"
  25084. }, CKEDITOR.tools.cssVendorPrefix("tab-size", a.config.sourceAreaTabSize || 4)));
  25085. b.setAttribute("dir", "ltr");
  25086. b.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");
  25087. a.ui.space("contents").append(b);
  25088. b = a.editable(new c(a, b));
  25089. b.setData(a.getData(1));
  25090. CKEDITOR.env.ie && (b.attachListener(a, "resize", d, b), b.attachListener(CKEDITOR.document
  25091. .getWindow(), "resize", d, b), CKEDITOR.tools.setTimeout(d, 0, b));
  25092. a.fire("ariaWidget",
  25093. this);
  25094. e()
  25095. });
  25096. a.addCommand("source", f.commands.source);
  25097. a.ui.addButton && a.ui.addButton("Source", {
  25098. isToggle: !0,
  25099. label: a.lang.sourcearea.toolbar,
  25100. command: "source",
  25101. toolbar: "mode,10"
  25102. });
  25103. a.on("mode", function() {
  25104. a.getCommand("source").setState("source" == a.mode ? CKEDITOR.TRISTATE_ON : CKEDITOR
  25105. .TRISTATE_OFF)
  25106. });
  25107. var e = CKEDITOR.env.ie && 9 == CKEDITOR.env.version
  25108. }
  25109. }
  25110. });
  25111. var c = CKEDITOR.tools.createClass({
  25112. base: CKEDITOR.editable,
  25113. proto: {
  25114. setData: function(a) {
  25115. this.setValue(a);
  25116. this.status = "ready";
  25117. this.editor.fire("dataReady")
  25118. },
  25119. getData: function() {
  25120. return this.getValue()
  25121. },
  25122. insertHtml: function() {},
  25123. insertElement: function() {},
  25124. insertText: function() {},
  25125. setReadOnly: function(a) {
  25126. this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly")
  25127. },
  25128. detach: function() {
  25129. c.baseProto.detach.call(this);
  25130. this.clearCustomData();
  25131. this.remove()
  25132. }
  25133. }
  25134. })
  25135. })();
  25136. CKEDITOR.plugins.sourcearea = {
  25137. commands: {
  25138. source: {
  25139. modes: {
  25140. wysiwyg: 1,
  25141. source: 1
  25142. },
  25143. editorFocus: !1,
  25144. readOnly: 1,
  25145. exec: function(c) {
  25146. "wysiwyg" == c.mode && c.fire("saveSnapshot");
  25147. c.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
  25148. c.setMode("source" == c.mode ? "wysiwyg" : "source")
  25149. },
  25150. canUndo: !1
  25151. }
  25152. }
  25153. };
  25154. CKEDITOR.plugins.add("specialchar", {
  25155. availableLangs: {
  25156. af: 1,
  25157. ar: 1,
  25158. az: 1,
  25159. bg: 1,
  25160. ca: 1,
  25161. cs: 1,
  25162. cy: 1,
  25163. da: 1,
  25164. de: 1,
  25165. "de-ch": 1,
  25166. el: 1,
  25167. en: 1,
  25168. "en-au": 1,
  25169. "en-ca": 1,
  25170. "en-gb": 1,
  25171. eo: 1,
  25172. es: 1,
  25173. "es-mx": 1,
  25174. et: 1,
  25175. eu: 1,
  25176. fa: 1,
  25177. fi: 1,
  25178. fr: 1,
  25179. "fr-ca": 1,
  25180. gl: 1,
  25181. he: 1,
  25182. hr: 1,
  25183. hu: 1,
  25184. id: 1,
  25185. it: 1,
  25186. ja: 1,
  25187. km: 1,
  25188. ko: 1,
  25189. ku: 1,
  25190. lt: 1,
  25191. lv: 1,
  25192. nb: 1,
  25193. nl: 1,
  25194. no: 1,
  25195. oc: 1,
  25196. pl: 1,
  25197. pt: 1,
  25198. "pt-br": 1,
  25199. ro: 1,
  25200. ru: 1,
  25201. si: 1,
  25202. sk: 1,
  25203. sl: 1,
  25204. sq: 1,
  25205. sr: 1,
  25206. "sr-latn": 1,
  25207. sv: 1,
  25208. th: 1,
  25209. tr: 1,
  25210. tt: 1,
  25211. ug: 1,
  25212. uk: 1,
  25213. vi: 1,
  25214. zh: 1,
  25215. "zh-cn": 1
  25216. },
  25217. requires: "dialog",
  25218. init: function(a) {
  25219. var c = this;
  25220. CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js");
  25221. a.addCommand("specialchar", {
  25222. exec: function() {
  25223. var b = a.langCode,
  25224. b = c.availableLangs[b] ? b : c.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") :
  25225. "en";
  25226. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + b + ".js"), function() {
  25227. CKEDITOR.tools.extend(a.lang.specialchar, c.langEntries[b]);
  25228. a.openDialog("specialchar")
  25229. })
  25230. },
  25231. modes: {
  25232. wysiwyg: 1
  25233. },
  25234. canUndo: !1
  25235. });
  25236. a.ui.addButton && a.ui.addButton("SpecialChar", {
  25237. label: a.lang.specialchar.toolbar,
  25238. command: "specialchar",
  25239. toolbar: "insert,50"
  25240. })
  25241. }
  25242. });
  25243. CKEDITOR.config.specialChars =
  25244. "! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ 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 { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;"
  25245. .split(" ");
  25246. CKEDITOR.plugins.add("scayt", {
  25247. requires: "menubutton,dialog",
  25248. tabToOpen: null,
  25249. dialogName: "scaytDialog",
  25250. onLoad: function(a) {
  25251. "moono-lisa" == (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(CKEDITOR
  25252. .getUrl(this.path + "skins/" + CKEDITOR.skin.name + "/scayt.css"));
  25253. CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path + "dialogs/dialog.css"));
  25254. var c = !1;
  25255. CKEDITOR.on("instanceLoaded", function(a) {
  25256. if (!c && CKEDITOR.plugins.autocomplete) {
  25257. c = !0;
  25258. var b = CKEDITOR.plugins.autocomplete.prototype.getModel;
  25259. CKEDITOR.plugins.autocomplete.prototype.getModel = function(a) {
  25260. var d = this.editor;
  25261. a = b.bind(this)(a);
  25262. a.on("change-isActive", function(a) {
  25263. a.data ? d.fire("autocompletePanelShow") : d.fire("autocompletePanelHide")
  25264. });
  25265. return a
  25266. }
  25267. }
  25268. })
  25269. },
  25270. init: function(a) {
  25271. var c = this,
  25272. d = CKEDITOR.plugins.scayt;
  25273. this.bindEvents(a);
  25274. this.parseConfig(a);
  25275. this.addRule(a);
  25276. CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + "dialogs/options.js"));
  25277. this.addMenuItems(a);
  25278. var b = a.lang.scayt,
  25279. e = CKEDITOR.env;
  25280. a.ui.add("Scayt", CKEDITOR.UI_MENUBUTTON, {
  25281. label: b.text_title,
  25282. title: a.plugins.wsc ? a.lang.wsc.title : b.text_title,
  25283. modes: {
  25284. wysiwyg: !(e.ie && (8 > e.version || e.quirks))
  25285. },
  25286. toolbar: "spellchecker,20",
  25287. refresh: function() {
  25288. var b = a.ui.instances.Scayt.getState();
  25289. a.scayt && (b = d.state.scayt[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
  25290. a.fire("scaytButtonState", b)
  25291. },
  25292. onRender: function() {
  25293. var b = this;
  25294. a.on("scaytButtonState", function(a) {
  25295. void 0 !== typeof a.data && b.setState(a.data)
  25296. })
  25297. },
  25298. onMenu: function() {
  25299. var b = a.scayt;
  25300. a.getMenuItem("scaytToggle").label = a.lang.scayt[b &&
  25301. d.state.scayt[a.name] ? "btn_disable" : "btn_enable"];
  25302. var c = {
  25303. scaytToggle: CKEDITOR.TRISTATE_OFF,
  25304. scaytOptions: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  25305. scaytLangs: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  25306. scaytDict: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  25307. scaytAbout: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  25308. WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  25309. };
  25310. a.config.scayt_uiTabs[0] || delete c.scaytOptions;
  25311. a.config.scayt_uiTabs[1] || delete c.scaytLangs;
  25312. a.config.scayt_uiTabs[2] || delete c.scaytDict;
  25313. b && !CKEDITOR.plugins.scayt.isNewUdSupported(b) && (delete c.scaytDict, a.config.scayt_uiTabs[
  25314. 2] = 0, CKEDITOR.plugins.scayt.alarmCompatibilityMessage());
  25315. return c
  25316. }
  25317. });
  25318. a.contextMenu && a.addMenuItems && (a.contextMenu.addListener(function(b, d) {
  25319. var e = a.scayt,
  25320. l, m;
  25321. e && (m = e.getSelectionNode()) && (l = c.menuGenerator(a, m), e.showBanner("." + a.contextMenu._
  25322. .definition.panel.className.split(" ").join(" .")));
  25323. return l
  25324. }), a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide,
  25325. function(b) {
  25326. return function() {
  25327. var d = a.scayt;
  25328. d && d.hideBanner();
  25329. return b.apply(this)
  25330. }
  25331. }))
  25332. },
  25333. addMenuItems: function(a) {
  25334. var c = this,
  25335. d = CKEDITOR.plugins.scayt;
  25336. a.addMenuGroup("scaytButton");
  25337. for (var b = a.config.scayt_contextMenuItemsOrder.split("|"), e = 0; e < b.length; e++) b[e] = "scayt_" +
  25338. b[e];
  25339. if ((b = ["grayt_description", "grayt_suggest", "grayt_control"].concat(b)) && b.length)
  25340. for (e = 0; e < b.length; e++) a.addMenuGroup(b[e], e - 10);
  25341. a.addCommand("scaytToggle", {
  25342. exec: function(a) {
  25343. var b = a.scayt;
  25344. d.state.scayt[a.name] = !d.state.scayt[a.name];
  25345. !0 === d.state.scayt[a.name] ? b || d.createScayt(a) : b && d.destroy(a)
  25346. }
  25347. });
  25348. a.addCommand("scaytAbout", {
  25349. exec: function(a) {
  25350. a.scayt.tabToOpen = "about";
  25351. d.openDialog(c.dialogName, a)
  25352. }
  25353. });
  25354. a.addCommand("scaytOptions", {
  25355. exec: function(a) {
  25356. a.scayt.tabToOpen = "options";
  25357. d.openDialog(c.dialogName, a)
  25358. }
  25359. });
  25360. a.addCommand("scaytLangs", {
  25361. exec: function(a) {
  25362. a.scayt.tabToOpen = "langs";
  25363. d.openDialog(c.dialogName, a)
  25364. }
  25365. });
  25366. a.addCommand("scaytDict", {
  25367. exec: function(a) {
  25368. a.scayt.tabToOpen = "dictionaries";
  25369. d.openDialog(c.dialogName, a)
  25370. }
  25371. });
  25372. b = {
  25373. scaytToggle: {
  25374. label: a.lang.scayt.btn_enable,
  25375. group: "scaytButton",
  25376. command: "scaytToggle"
  25377. },
  25378. scaytAbout: {
  25379. label: a.lang.scayt.btn_about,
  25380. group: "scaytButton",
  25381. command: "scaytAbout"
  25382. },
  25383. scaytOptions: {
  25384. label: a.lang.scayt.btn_options,
  25385. group: "scaytButton",
  25386. command: "scaytOptions"
  25387. },
  25388. scaytLangs: {
  25389. label: a.lang.scayt.btn_langs,
  25390. group: "scaytButton",
  25391. command: "scaytLangs"
  25392. },
  25393. scaytDict: {
  25394. label: a.lang.scayt.btn_dictionaries,
  25395. group: "scaytButton",
  25396. command: "scaytDict"
  25397. }
  25398. };
  25399. a.plugins.wsc && (b.WSC = {
  25400. label: a.lang.wsc.toolbar,
  25401. group: "scaytButton",
  25402. onClick: function() {
  25403. var b = CKEDITOR.plugins.scayt,
  25404. d = a.scayt,
  25405. c = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document
  25406. .getBody().getText();
  25407. (c = c.replace(/\s/g, "")) ? (d && b.state.scayt[a.name] && d.setMarkupPaused && d
  25408. .setMarkupPaused(!0), a.lockSelection(), a.execCommand("checkspell")) : alert(
  25409. "Nothing to check!")
  25410. }
  25411. });
  25412. a.addMenuItems(b)
  25413. },
  25414. bindEvents: function(a) {
  25415. var c = CKEDITOR.plugins.scayt,
  25416. d = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE,
  25417. b = function() {
  25418. c.destroy(a)
  25419. },
  25420. e = function() {
  25421. !c.state.scayt[a.name] || a.readOnly || a.scayt || c.createScayt(a)
  25422. },
  25423. f = function() {
  25424. var b =
  25425. a.editable();
  25426. b.attachListener(b, "focus", function(b) {
  25427. CKEDITOR.plugins.scayt && !a.scayt && setTimeout(e, 0);
  25428. b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[a.name] && a.scayt;
  25429. var c, k;
  25430. if ((d || b) && a._.savedSelection) {
  25431. b = a._.savedSelection.getSelectedElement();
  25432. b = !b && a._.savedSelection.getRanges();
  25433. for (var f = 0; f < b.length; f++) k = b[f], "string" === typeof k.startContainer.$
  25434. .nodeValue && (c = k.startContainer.getText().length, (c < k.startOffset || c < k
  25435. .endOffset) && a.unlockSelection(!1))
  25436. }
  25437. }, this, null, -10)
  25438. },
  25439. g = function() {
  25440. d ?
  25441. a.config.scayt_inlineModeImmediateMarkup ? e() : (a.on("blur", function() {
  25442. setTimeout(b, 0)
  25443. }), a.on("focus", e), a.focusManager.hasFocus && e()) : e();
  25444. f();
  25445. var c = a.editable();
  25446. c.attachListener(c, "mousedown", function(b) {
  25447. b = b.data.getTarget();
  25448. var d = a.widgets && a.widgets.getByElement(b);
  25449. d && (d.wrapper = b.getAscendant(function(a) {
  25450. return a.hasAttribute("data-cke-widget-wrapper")
  25451. }, !0))
  25452. }, this, null, -10)
  25453. };
  25454. a.on("contentDom", g);
  25455. a.on("beforeCommandExec", function(b) {
  25456. var d = a.scayt,
  25457. e = !1,
  25458. f = !1,
  25459. h = !0;
  25460. b.data.name in c.options.disablingCommandExec &&
  25461. "wysiwyg" == a.mode ? d && (c.destroy(a), a.fire("scaytButtonState", CKEDITOR
  25462. .TRISTATE_DISABLED)) : "bold" !== b.data.name && "italic" !== b.data.name && "underline" !== b
  25463. .data.name && "strike" !== b.data.name && "subscript" !== b.data.name && "superscript" !== b.data
  25464. .name && "enter" !== b.data.name && "cut" !== b.data.name && "language" !== b.data.name || !d || (
  25465. "cut" === b.data.name && (h = !1, f = !0), "language" === b.data.name && (f = e = !0), a.fire(
  25466. "reloadMarkupScayt", {
  25467. removeOptions: {
  25468. removeInside: h,
  25469. forceBookmark: f,
  25470. language: e
  25471. },
  25472. timeout: 0
  25473. }))
  25474. });
  25475. a.on("beforeSetMode",
  25476. function(b) {
  25477. if ("source" == b.data) {
  25478. if (b = a.scayt) c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED);
  25479. a.document && a.document.getBody().removeAttribute("_jquid")
  25480. }
  25481. });
  25482. a.on("afterCommandExec", function(b) {
  25483. "wysiwyg" != a.mode || "undo" != b.data.name && "redo" != b.data.name || setTimeout(function() {
  25484. c.reloadMarkup(a.scayt)
  25485. }, 250)
  25486. });
  25487. a.on("readOnly", function(b) {
  25488. var d;
  25489. b && (d = a.scayt, !0 === b.editor.readOnly ? d && d.fire("removeMarkupInDocument", {}) : d ? c
  25490. .reloadMarkup(d) : "wysiwyg" == b.editor.mode && !0 === c.state.scayt[b.editor.name] &&
  25491. (c.createScayt(a), b.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)))
  25492. });
  25493. a.on("beforeDestroy", b);
  25494. a.on("setData", function() {
  25495. b();
  25496. (a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || a.plugins.divarea) && g()
  25497. }, this, null, 50);
  25498. a.on("reloadMarkupScayt", function(b) {
  25499. var d = b.data && b.data.removeOptions,
  25500. e = b.data && b.data.timeout,
  25501. f = b.data && b.data.language,
  25502. h = a.scayt;
  25503. h && setTimeout(function() {
  25504. f && (d.selectionNode = a.plugins.language.getCurrentLangElement(a), d.selectionNode = d
  25505. .selectionNode && d.selectionNode.$ || null);
  25506. h.removeMarkupInSelectionNode(d);
  25507. c.reloadMarkup(h)
  25508. }, e || 0)
  25509. });
  25510. a.on("insertElement", function() {
  25511. a.fire("reloadMarkupScayt", {
  25512. removeOptions: {
  25513. forceBookmark: !0
  25514. }
  25515. })
  25516. }, this, null, 50);
  25517. a.on("insertHtml", function() {
  25518. a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);
  25519. a.fire("reloadMarkupScayt")
  25520. }, this, null, 50);
  25521. a.on("insertText", function() {
  25522. a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);
  25523. a.fire("reloadMarkupScayt")
  25524. }, this, null, 50);
  25525. a.on("scaytDialogShown", function(b) {
  25526. b.data.selectPage(a.scayt.tabToOpen)
  25527. });
  25528. a.on("autocompletePanelShow", function(b) {
  25529. (b =
  25530. a.scayt) && b.setMarkupPaused && b.setMarkupPaused(!0)
  25531. });
  25532. a.on("autocompletePanelHide", function(b) {
  25533. (b = a.scayt) && b.setMarkupPaused && b.setMarkupPaused(!1)
  25534. })
  25535. },
  25536. parseConfig: function(a) {
  25537. var c = CKEDITOR.plugins.scayt;
  25538. c.replaceOldOptionsNames(a.config);
  25539. "boolean" !== typeof a.config.scayt_autoStartup && (a.config.scayt_autoStartup = !1);
  25540. c.state.scayt[a.name] = a.config.scayt_autoStartup;
  25541. "boolean" !== typeof a.config.grayt_autoStartup && (a.config.grayt_autoStartup = !1);
  25542. "boolean" !== typeof a.config.scayt_inlineModeImmediateMarkup &&
  25543. (a.config.scayt_inlineModeImmediateMarkup = !1);
  25544. c.state.grayt[a.name] = a.config.grayt_autoStartup;
  25545. a.config.scayt_contextCommands || (a.config.scayt_contextCommands = "ignoreall|add");
  25546. a.config.scayt_contextMenuItemsOrder || (a.config.scayt_contextMenuItemsOrder =
  25547. "suggest|moresuggest|control");
  25548. a.config.scayt_sLang || (a.config.scayt_sLang = "en_US");
  25549. if (void 0 === a.config.scayt_maxSuggestions || "number" != typeof a.config.scayt_maxSuggestions || 0 > a
  25550. .config.scayt_maxSuggestions) a.config.scayt_maxSuggestions = 3;
  25551. if (void 0 ===
  25552. a.config.scayt_minWordLength || "number" != typeof a.config.scayt_minWordLength || 1 > a.config
  25553. .scayt_minWordLength) a.config.scayt_minWordLength = 3;
  25554. if (void 0 === a.config.scayt_customDictionaryIds || "string" !== typeof a.config
  25555. .scayt_customDictionaryIds) a.config.scayt_customDictionaryIds = "";
  25556. if (void 0 === a.config.scayt_userDictionaryName || "string" !== typeof a.config.scayt_userDictionaryName)
  25557. a.config.scayt_userDictionaryName = null;
  25558. if ("string" === typeof a.config.scayt_uiTabs && 3 === a.config.scayt_uiTabs.split(",").length) {
  25559. var d = [],
  25560. b = [];
  25561. a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");
  25562. CKEDITOR.tools.search(a.config.scayt_uiTabs, function(a) {
  25563. 1 === Number(a) || 0 === Number(a) ? (b.push(!0), d.push(Number(a))) : b.push(!1)
  25564. });
  25565. null === CKEDITOR.tools.search(b, !1) ? a.config.scayt_uiTabs = d : a.config.scayt_uiTabs = [1, 1, 1]
  25566. } else a.config.scayt_uiTabs = [1, 1, 1];
  25567. "string" != typeof a.config.scayt_serviceProtocol && (a.config.scayt_serviceProtocol = null);
  25568. "string" != typeof a.config.scayt_serviceHost && (a.config.scayt_serviceHost = null);
  25569. "string" != typeof a.config.scayt_servicePort &&
  25570. (a.config.scayt_servicePort = null);
  25571. "string" != typeof a.config.scayt_servicePath && (a.config.scayt_servicePath = null);
  25572. a.config.scayt_moreSuggestions || (a.config.scayt_moreSuggestions = "on");
  25573. "string" !== typeof a.config.scayt_customerId && (a.config.scayt_customerId =
  25574. "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");
  25575. "string" !== typeof a.config.scayt_customPunctuation && (a.config.scayt_customPunctuation = "-");
  25576. "string" !== typeof a.config.scayt_srcUrl && (a.config.scayt_srcUrl =
  25577. "https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js");
  25578. "boolean" !== typeof CKEDITOR.config.scayt_handleCheckDirty && (CKEDITOR.config.scayt_handleCheckDirty = !
  25579. 0);
  25580. "boolean" !== typeof CKEDITOR.config.scayt_handleUndoRedo && (CKEDITOR.config.scayt_handleUndoRedo = !0);
  25581. CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : !1;
  25582. a.config.scayt_ignoreAllCapsWords && "boolean" !== typeof a.config.scayt_ignoreAllCapsWords && (a.config
  25583. .scayt_ignoreAllCapsWords = !1);
  25584. a.config.scayt_ignoreDomainNames && "boolean" !== typeof a.config.scayt_ignoreDomainNames &&
  25585. (a.config.scayt_ignoreDomainNames = !1);
  25586. a.config.scayt_ignoreWordsWithMixedCases && "boolean" !== typeof a.config
  25587. .scayt_ignoreWordsWithMixedCases && (a.config.scayt_ignoreWordsWithMixedCases = !1);
  25588. a.config.scayt_ignoreWordsWithNumbers && "boolean" !== typeof a.config.scayt_ignoreWordsWithNumbers && (a
  25589. .config.scayt_ignoreWordsWithNumbers = !1);
  25590. if (a.config.scayt_disableOptionsStorage) {
  25591. var c = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ? a.config
  25592. .scayt_disableOptionsStorage : "string" === typeof a.config.scayt_disableOptionsStorage ? [a.config
  25593. .scayt_disableOptionsStorage
  25594. ] : void 0,
  25595. e =
  25596. "all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers"
  25597. .split(" "),
  25598. f = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases",
  25599. "ignore-words-with-numbers"
  25600. ],
  25601. g = CKEDITOR.tools.search,
  25602. k = CKEDITOR.tools.indexOf;
  25603. a.config.scayt_disableOptionsStorage = function(a) {
  25604. for (var b = [], d = 0; d < a.length; d++) {
  25605. var c = a[d],
  25606. p = !!g(a, "options");
  25607. if (!g(e, c) || p && g(f, function(a) {
  25608. if ("lang" === a) return !1
  25609. })) return;
  25610. g(f, c) && f.splice(k(f, c), 1);
  25611. if ("all" === c || p && g(a, "lang")) return [];
  25612. "options" === c && (f = ["lang"])
  25613. }
  25614. return b = b.concat(f)
  25615. }(c)
  25616. }
  25617. },
  25618. addRule: function(a) {
  25619. var c = CKEDITOR.plugins.scayt,
  25620. d = a.dataProcessor,
  25621. b = d && d.htmlFilter,
  25622. e = a._.elementsPath && a._.elementsPath.filters,
  25623. d = d && d.dataFilter,
  25624. f = a.addRemoveFormatFilter,
  25625. g = function(b) {
  25626. if (a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options
  25627. .problem_grammar_data_attribute))) return !1
  25628. },
  25629. k = function(b) {
  25630. var d = !0;
  25631. a.scayt && (b.hasAttribute(c.options.data_attribute_name) ||
  25632. b.hasAttribute(c.options.problem_grammar_data_attribute)) && (d = !1);
  25633. return d
  25634. };
  25635. e && e.push(g);
  25636. d && d.addRules({
  25637. elements: {
  25638. span: function(a) {
  25639. var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options
  25640. .data_attribute_name],
  25641. d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options
  25642. .problem_grammar_data_attribute];
  25643. c && (b || d) && delete a.name;
  25644. return a
  25645. }
  25646. }
  25647. });
  25648. b && b.addRules({
  25649. elements: {
  25650. span: function(a) {
  25651. var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options
  25652. .data_attribute_name],
  25653. d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options
  25654. .problem_grammar_data_attribute];
  25655. c && (b || d) && delete a.name;
  25656. return a
  25657. }
  25658. }
  25659. });
  25660. f && f.call(a, k)
  25661. },
  25662. scaytMenuDefinition: function(a) {
  25663. var c = this,
  25664. d = CKEDITOR.plugins.scayt;
  25665. a = a.scayt;
  25666. return {
  25667. scayt: {
  25668. scayt_ignore: {
  25669. label: a.getLocal("btn_ignore"),
  25670. group: "scayt_control",
  25671. order: 1,
  25672. exec: function(a) {
  25673. a.scayt.ignoreWord()
  25674. }
  25675. },
  25676. scayt_ignoreall: {
  25677. label: a.getLocal("btn_ignoreAll"),
  25678. group: "scayt_control",
  25679. order: 2,
  25680. exec: function(a) {
  25681. a.scayt.ignoreAllWords()
  25682. }
  25683. },
  25684. scayt_add: {
  25685. label: a.getLocal("btn_addWord"),
  25686. group: "scayt_control",
  25687. order: 3,
  25688. exec: function(a) {
  25689. var d = a.scayt;
  25690. setTimeout(function() {
  25691. d.addWordToUserDictionary()
  25692. }, 10)
  25693. }
  25694. },
  25695. scayt_option: {
  25696. label: a.getLocal("btn_options"),
  25697. group: "scayt_control",
  25698. order: 4,
  25699. exec: function(a) {
  25700. a.scayt.tabToOpen = "options";
  25701. d.openDialog(c.dialogName, a)
  25702. },
  25703. verification: function(a) {
  25704. return 1 == a.config.scayt_uiTabs[0] ? !0 : !1
  25705. }
  25706. },
  25707. scayt_language: {
  25708. label: a.getLocal("btn_langs"),
  25709. group: "scayt_control",
  25710. order: 5,
  25711. exec: function(a) {
  25712. a.scayt.tabToOpen = "langs";
  25713. d.openDialog(c.dialogName, a)
  25714. },
  25715. verification: function(a) {
  25716. return 1 ==
  25717. a.config.scayt_uiTabs[1] ? !0 : !1
  25718. }
  25719. },
  25720. scayt_dictionary: {
  25721. label: a.getLocal("btn_dictionaries"),
  25722. group: "scayt_control",
  25723. order: 6,
  25724. exec: function(a) {
  25725. a.scayt.tabToOpen = "dictionaries";
  25726. d.openDialog(c.dialogName, a)
  25727. },
  25728. verification: function(a) {
  25729. return 1 == a.config.scayt_uiTabs[2] ? !0 : !1
  25730. }
  25731. },
  25732. scayt_about: {
  25733. label: a.getLocal("btn_about"),
  25734. group: "scayt_control",
  25735. order: 7,
  25736. exec: function(a) {
  25737. a.scayt.tabToOpen = "about";
  25738. d.openDialog(c.dialogName, a)
  25739. }
  25740. }
  25741. },
  25742. grayt: {
  25743. grayt_problemdescription: {
  25744. label: "Grammar problem description",
  25745. group: "grayt_description",
  25746. order: 1,
  25747. state: CKEDITOR.TRISTATE_DISABLED,
  25748. exec: function(a) {}
  25749. },
  25750. grayt_ignore: {
  25751. label: a.getLocal("btn_ignore"),
  25752. group: "grayt_control",
  25753. order: 2,
  25754. exec: function(a) {
  25755. a.scayt.ignorePhrase()
  25756. }
  25757. },
  25758. grayt_ignoreall: {
  25759. label: a.getLocal("btn_ignoreAll"),
  25760. group: "grayt_control",
  25761. order: 3,
  25762. exec: function(a) {
  25763. a.scayt.ignoreAllPhrases()
  25764. }
  25765. }
  25766. }
  25767. }
  25768. },
  25769. buildSuggestionMenuItems: function(a, c, d) {
  25770. var b = {},
  25771. e = {},
  25772. f = d ? "word" : "phrase",
  25773. g = d ? "startGrammarCheck" : "startSpellCheck",
  25774. k = a.scayt;
  25775. if (0 < c.length && "no_any_suggestions" !== c[0])
  25776. if (d)
  25777. for (d = 0; d < c.length; d++) {
  25778. var l =
  25779. "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_");
  25780. a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g));
  25781. d < a.config.scayt_maxSuggestions ? (a.addMenuItem(l, {
  25782. label: c[d],
  25783. command: l,
  25784. group: "scayt_suggest",
  25785. order: d + 1
  25786. }), b[l] = CKEDITOR.TRISTATE_OFF) : (a.addMenuItem(l, {
  25787. label: c[d],
  25788. command: l,
  25789. group: "scayt_moresuggest",
  25790. order: d + 1
  25791. }), e[l] = CKEDITOR.TRISTATE_OFF, "on" === a.config.scayt_moreSuggestions && (a.addMenuItem(
  25792. "scayt_moresuggest", {
  25793. label: k.getLocal("btn_moreSuggestions"),
  25794. group: "scayt_moresuggest",
  25795. order: 10,
  25796. getItems: function() {
  25797. return e
  25798. }
  25799. }), b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF))
  25800. } else
  25801. for (d = 0; d < c.length; d++) l = "grayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(
  25802. " ", "_"), a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g)), a
  25803. .addMenuItem(l, {
  25804. label: c[d],
  25805. command: l,
  25806. group: "grayt_suggest",
  25807. order: d + 1
  25808. }), b[l] = CKEDITOR.TRISTATE_OFF;
  25809. else b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED, a.addCommand("no_scayt_suggest", {
  25810. exec: function() {}
  25811. }), a.addMenuItem("no_scayt_suggest", {
  25812. label: k.getLocal("btn_noSuggestions") || "no_scayt_suggest",
  25813. command: "no_scayt_suggest",
  25814. group: "scayt_suggest",
  25815. order: 0
  25816. });
  25817. return b
  25818. },
  25819. menuGenerator: function(a, c) {
  25820. var d = a.scayt,
  25821. b = this.scaytMenuDefinition(a),
  25822. e = {},
  25823. f = a.config.scayt_contextCommands.split("|"),
  25824. g = c.getAttribute(d.getLangAttribute()) || d.getLang(),
  25825. k, l, m, n;
  25826. l = d.isScaytNode(c);
  25827. m = d.isGraytNode(c);
  25828. l ? (b = b.scayt, k = c.getAttribute(d.getScaytNodeAttributeName()), d.fire("getSuggestionsList", {
  25829. lang: g,
  25830. word: k
  25831. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions,
  25832. l)) : m && (b = b.grayt, e = c.getAttribute(d.getGraytNodeAttributeName()), d
  25833. .getGraytNodeRuleAttributeName ? (k = c.getAttribute(d.getGraytNodeRuleAttributeName()), d
  25834. .getProblemDescriptionText(e, k, g)) : d.getProblemDescriptionText(e, g), n = d
  25835. .getProblemDescriptionText(e, k, g), b.grayt_problemdescription && n && (n = n.replace(/([.!?])\s/g,
  25836. "$1\x3cbr\x3e"), b.grayt_problemdescription.label = n), d.fire("getGrammarSuggestionsList", {
  25837. lang: g,
  25838. phrase: e,
  25839. rule: k
  25840. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, l));
  25841. if (l &&
  25842. "off" == a.config.scayt_contextCommands) return e;
  25843. for (var h in b) l && -1 == CKEDITOR.tools.indexOf(f, h.replace("scayt_", "")) && "all" != a.config
  25844. .scayt_contextCommands || m && "grayt_problemdescription" !== h && -1 == CKEDITOR.tools.indexOf(f, h
  25845. .replace("grayt_", "")) && "all" != a.config.scayt_contextCommands || (e[h] = "undefined" != typeof b[
  25846. h].state ? b[h].state : CKEDITOR.TRISTATE_OFF, "function" !== typeof b[h].verification || b[h]
  25847. .verification(a) || delete e[h], a.addCommand(h, {
  25848. exec: b[h].exec
  25849. }), a.addMenuItem(h, {
  25850. label: a.lang.scayt[b[h].label] ||
  25851. b[h].label,
  25852. command: h,
  25853. group: b[h].group,
  25854. order: b[h].order
  25855. }));
  25856. return e
  25857. },
  25858. createCommand: function(a, c, d) {
  25859. return {
  25860. exec: function(b) {
  25861. b = b.scayt;
  25862. var e = {};
  25863. e[c] = a;
  25864. b.replaceSelectionNode(e);
  25865. "startGrammarCheck" === d && b.removeMarkupInSelectionNode({
  25866. grammarOnly: !0
  25867. });
  25868. b.fire(d)
  25869. }
  25870. }
  25871. }
  25872. });
  25873. CKEDITOR.plugins.scayt = {
  25874. charsToObserve: [{
  25875. charName: "cke-fillingChar",
  25876. charCode: function() {
  25877. var a = CKEDITOR.version,
  25878. c = [4, 5, 6],
  25879. d = String.fromCharCode(8203),
  25880. b = Array(8).join(d),
  25881. e, f;
  25882. if (!a) return d;
  25883. for (var a = a.split("."), g = 0; g < c.length; g++) {
  25884. e = c[g];
  25885. f = Number(a[g]);
  25886. if (f > e) return b;
  25887. if (f < e) break
  25888. }
  25889. return d
  25890. }()
  25891. }],
  25892. state: {
  25893. scayt: {},
  25894. grayt: {}
  25895. },
  25896. warningCounter: 0,
  25897. suggestions: [],
  25898. options: {
  25899. disablingCommandExec: {
  25900. source: !0,
  25901. newpage: !0,
  25902. templates: !0
  25903. },
  25904. data_attribute_name: "data-scayt-word",
  25905. misspelled_word_class: "scayt-misspell-word",
  25906. problem_grammar_data_attribute: "data-grayt-phrase",
  25907. problem_grammar_class: "gramm-problem"
  25908. },
  25909. backCompatibilityMap: {
  25910. scayt_service_protocol: "scayt_serviceProtocol",
  25911. scayt_service_host: "scayt_serviceHost",
  25912. scayt_service_port: "scayt_servicePort",
  25913. scayt_service_path: "scayt_servicePath",
  25914. scayt_customerid: "scayt_customerId"
  25915. },
  25916. openDialog: function(a, c) {
  25917. var d = c.scayt;
  25918. d.isAllModulesReady && !1 === d.isAllModulesReady() || (c.lockSelection(), c.openDialog(a))
  25919. },
  25920. alarmCompatibilityMessage: function() {
  25921. 5 > this.warningCounter && (console.warn(
  25922. "You are using the latest version of SCAYT plugin for CKEditor with the old application version. In order to have access to the newest features, it is recommended to upgrade the application version to latest one as well. Contact us for more details at support@webspellchecker.net."
  25923. ),
  25924. this.warningCounter += 1)
  25925. },
  25926. isNewUdSupported: function(a) {
  25927. return a.getUserDictionary ? !0 : !1
  25928. },
  25929. reloadMarkup: function(a) {
  25930. var c;
  25931. a && (c = a.getScaytLangList(), a.reloadMarkup ? a.reloadMarkup() : (this.alarmCompatibilityMessage(), c &&
  25932. c.ltr && c.rtl && a.fire("startSpellCheck, startGrammarCheck")))
  25933. },
  25934. replaceOldOptionsNames: function(a) {
  25935. for (var c in a) c in this.backCompatibilityMap && (a[this.backCompatibilityMap[c]] = a[c], delete a[c])
  25936. },
  25937. createScayt: function(a) {
  25938. var c = this,
  25939. d = CKEDITOR.plugins.scayt;
  25940. this.loadScaytLibrary(a, function(a) {
  25941. function e(a) {
  25942. return new SCAYT.CKSCAYT(a,
  25943. function() {},
  25944. function() {})
  25945. }
  25946. var f;
  25947. a.window && (f = "BODY" == a.editable().$.nodeName ? a.window.getFrame() : a.editable());
  25948. if (f) {
  25949. f = {
  25950. lang: a.config.scayt_sLang,
  25951. container: f.$,
  25952. customDictionary: a.config.scayt_customDictionaryIds,
  25953. userDictionaryName: a.config.scayt_userDictionaryName,
  25954. localization: a.langCode,
  25955. customer_id: a.config.scayt_customerId,
  25956. customPunctuation: a.config.scayt_customPunctuation,
  25957. debug: a.config.scayt_debug,
  25958. data_attribute_name: c.options.data_attribute_name,
  25959. misspelled_word_class: c.options.misspelled_word_class,
  25960. problem_grammar_data_attribute: c.options.problem_grammar_data_attribute,
  25961. problem_grammar_class: c.options.problem_grammar_class,
  25962. "options-to-restore": a.config.scayt_disableOptionsStorage,
  25963. focused: a.editable().hasFocus,
  25964. ignoreElementsRegex: a.config.scayt_elementsToIgnore,
  25965. ignoreGraytElementsRegex: a.config.grayt_elementsToIgnore,
  25966. minWordLength: a.config.scayt_minWordLength,
  25967. graytAutoStartup: a.config.grayt_autoStartup,
  25968. charsToObserve: d.charsToObserve
  25969. };
  25970. a.config.scayt_serviceProtocol && (f.service_protocol = a.config.scayt_serviceProtocol);
  25971. a.config.scayt_serviceHost && (f.service_host = a.config.scayt_serviceHost);
  25972. a.config.scayt_servicePort && (f.service_port = a.config.scayt_servicePort);
  25973. a.config.scayt_servicePath && (f.service_path = a.config.scayt_servicePath);
  25974. "boolean" === typeof a.config.scayt_ignoreAllCapsWords && (f["ignore-all-caps-words"] = a.config
  25975. .scayt_ignoreAllCapsWords);
  25976. "boolean" === typeof a.config.scayt_ignoreDomainNames && (f["ignore-domain-names"] = a.config
  25977. .scayt_ignoreDomainNames);
  25978. "boolean" === typeof a.config.scayt_ignoreWordsWithMixedCases &&
  25979. (f["ignore-words-with-mixed-cases"] = a.config.scayt_ignoreWordsWithMixedCases);
  25980. "boolean" === typeof a.config.scayt_ignoreWordsWithNumbers && (f["ignore-words-with-numbers"] = a
  25981. .config.scayt_ignoreWordsWithNumbers);
  25982. var g;
  25983. try {
  25984. g = e(f)
  25985. } catch (k) {
  25986. c.alarmCompatibilityMessage(), delete f.charsToObserve, g = e(f)
  25987. }
  25988. g.subscribe("suggestionListSend", function(a) {
  25989. for (var b = {}, d = [], c = 0; c < a.suggestionList.length; c++) b["word_" + a
  25990. .suggestionList[c]] || (b["word_" + a.suggestionList[c]] = a.suggestionList[c], d.push(a
  25991. .suggestionList[c]));
  25992. CKEDITOR.plugins.scayt.suggestions = d
  25993. });
  25994. g.subscribe("selectionIsChanged", function(d) {
  25995. a.getSelection().isLocked && "restoreSelection" !== d.action && a.lockSelection();
  25996. "restoreSelection" === d.action && a.selectionChange(!0)
  25997. });
  25998. g.subscribe("graytStateChanged", function(c) {
  25999. d.state.grayt[a.name] = c.state
  26000. });
  26001. g.addMarkupHandler && g.addMarkupHandler(function(d) {
  26002. var c = a.editable(),
  26003. e = c.getCustomData(d.charName);
  26004. e && (e.$ = d.node, c.setCustomData(d.charName, e))
  26005. });
  26006. a.scayt = g;
  26007. a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED :
  26008. CKEDITOR.TRISTATE_ON)
  26009. } else d.state.scayt[a.name] = !1
  26010. })
  26011. },
  26012. destroy: function(a) {
  26013. a.scayt && a.scayt.destroy();
  26014. delete a.scayt;
  26015. a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF)
  26016. },
  26017. loadScaytLibrary: function(a, c) {
  26018. var d, b = function() {
  26019. CKEDITOR.fireOnce("scaytReady");
  26020. a.scayt || "function" === typeof c && c(a)
  26021. };
  26022. "undefined" === typeof window.SCAYT || "function" !== typeof window.SCAYT.CKSCAYT ? (d = a.config
  26023. .scayt_srcUrl, CKEDITOR.scriptLoader.load(d, function(a) {
  26024. a && b()
  26025. })) : window.SCAYT && "function" === typeof window.SCAYT.CKSCAYT && b()
  26026. }
  26027. };
  26028. CKEDITOR.on("dialogDefinition", function(a) {
  26029. var c = a.data.name;
  26030. a = a.data.definition.dialog;
  26031. "scaytDialog" !== c && "checkspell" !== c && (a.on("show", function(a) {
  26032. a = a.sender && a.sender.getParentEditor();
  26033. var b = CKEDITOR.plugins.scayt,
  26034. c = a.scayt;
  26035. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!0)
  26036. }), a.on("hide", function(a) {
  26037. a = a.sender && a.sender.getParentEditor();
  26038. var b = CKEDITOR.plugins.scayt,
  26039. c = a.scayt;
  26040. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1)
  26041. }));
  26042. if ("scaytDialog" === c) a.on("cancel",
  26043. function(a) {
  26044. return !1
  26045. }, this, null, -1);
  26046. if ("checkspell" === c) a.on("cancel", function(a) {
  26047. a = a.sender && a.sender.getParentEditor();
  26048. var b = CKEDITOR.plugins.scayt,
  26049. c = a.scayt;
  26050. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1);
  26051. a.unlockSelection()
  26052. }, this, null, -2);
  26053. if ("link" === c) a.on("ok", function(a) {
  26054. var b = a.sender && a.sender.getParentEditor();
  26055. b && setTimeout(function() {
  26056. b.fire("reloadMarkupScayt", {
  26057. removeOptions: {
  26058. removeInside: !0,
  26059. forceBookmark: !0
  26060. },
  26061. timeout: 0
  26062. })
  26063. }, 0)
  26064. });
  26065. if ("replace" === c) a.on("hide", function(a) {
  26066. a =
  26067. a.sender && a.sender.getParentEditor();
  26068. var b = CKEDITOR.plugins.scayt,
  26069. c = a.scayt;
  26070. a && setTimeout(function() {
  26071. c && (c.fire("removeMarkupInDocument", {}), b.reloadMarkup(c))
  26072. }, 0)
  26073. })
  26074. });
  26075. CKEDITOR.on("scaytReady", function() {
  26076. if (!0 === CKEDITOR.config.scayt_handleCheckDirty) {
  26077. var a = CKEDITOR.editor.prototype;
  26078. a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function(a) {
  26079. return function() {
  26080. var b = null,
  26081. c = this.scayt;
  26082. if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt) {
  26083. if (b = "ready" == this.status) var f = c.removeMarkupFromString(this.getSnapshot()),
  26084. c = c.removeMarkupFromString(this._.previousValue),
  26085. b = b && c !== f
  26086. } else b = a.call(this);
  26087. return b
  26088. }
  26089. });
  26090. a.resetDirty = CKEDITOR.tools.override(a.resetDirty,
  26091. function(a) {
  26092. return function() {
  26093. var b = this.scayt;
  26094. CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt ? this._
  26095. .previousValue = b.removeMarkupFromString(this.getSnapshot()) : a.call(this)
  26096. }
  26097. })
  26098. }
  26099. if (!0 === CKEDITOR.config.scayt_handleUndoRedo) {
  26100. var a = CKEDITOR.plugins.undo.Image.prototype,
  26101. c = "function" == typeof a.equalsContent ? "equalsContent" : "equals";
  26102. a[c] = CKEDITOR.tools.override(a[c], function(a) {
  26103. return function(b) {
  26104. var c = b.editor.scayt,
  26105. f = this.contents,
  26106. g = b.contents,
  26107. k = null;
  26108. CKEDITOR.plugins.scayt &&
  26109. CKEDITOR.plugins.scayt.state.scayt[b.editor.name] && b.editor.scayt && (this.contents = c
  26110. .removeMarkupFromString(f) || "", b.contents = c.removeMarkupFromString(g) || "");
  26111. k = a.apply(this, arguments);
  26112. this.contents = f;
  26113. b.contents = g;
  26114. return k
  26115. }
  26116. })
  26117. }
  26118. });
  26119. (function() {
  26120. CKEDITOR.plugins.add("stylescombo", {
  26121. requires: "richcombo",
  26122. init: function(c) {
  26123. var k = c.config,
  26124. h = c.lang.stylescombo,
  26125. e = {},
  26126. l = [],
  26127. m = [];
  26128. c.on("stylesSet", function(a) {
  26129. if (a = a.data.styles) {
  26130. for (var b, f, d, n, g = 0, h = a.length; g < h; g++)(b = a[g], c.blockless && b.element in
  26131. CKEDITOR.dtd.$block || "string" == typeof b.type && !CKEDITOR.style.customHandlers[b
  26132. .type] || (f = b.name, n = b.language || c.langCode, b = new CKEDITOR.style(b), c.filter
  26133. .customConfig && !c.filter.check(b))) || (b._name = f, b._.enterMode = k.enterMode, b._
  26134. .type = d = b.assignedTo ||
  26135. b.type, b._.weight = g + 1E3 * (d == CKEDITOR.STYLE_OBJECT ? 1 : d == CKEDITOR
  26136. .STYLE_BLOCK ? 2 : 3), b._.language = n, e[f] = b, l.push(b), m.push(b));
  26137. l.sort(function(a, b) {
  26138. return a._.weight - b._.weight
  26139. })
  26140. }
  26141. });
  26142. c.on("stylesRemove", function(a) {
  26143. a = a.data && a.data.type;
  26144. var b = void 0 === a,
  26145. f;
  26146. for (f in e) {
  26147. var d = e[f];
  26148. (b || d.type === a) && c.removeStyle(d)
  26149. }
  26150. });
  26151. c.ui.addRichCombo("Styles", {
  26152. label: h.label,
  26153. title: h.panelTitle,
  26154. toolbar: "styles,10",
  26155. allowedContent: m,
  26156. panel: {
  26157. css: [CKEDITOR.skin.getPath("editor")].concat(k.contentsCss),
  26158. multiSelect: !0,
  26159. attributes: {
  26160. "aria-label": h.panelTitle
  26161. }
  26162. },
  26163. init: function() {
  26164. var a, b, c, d, e, g, k;
  26165. g = 0;
  26166. for (k = l.length; g < k; g++) a = l[g], b = a._name, d = a._.type, e = a._.definition
  26167. .language, d != c && (this.startGroup(h["panelTitle" + String(d)]), c = d), this.add(b, a
  26168. .type == CKEDITOR.STYLE_OBJECT ? b : a.buildPreview(), b, e);
  26169. this.commit()
  26170. },
  26171. onClick: function(a) {
  26172. c.focus();
  26173. c.fire("saveSnapshot");
  26174. a = e[a];
  26175. var b = c.elementPath();
  26176. if (a.group && a.removeStylesFromSameGroup(c)) c.applyStyle(a);
  26177. else c[a.checkActive(b, c) ? "removeStyle" : "applyStyle"](a);
  26178. c.fire("saveSnapshot")
  26179. },
  26180. onRender: function() {
  26181. c.on("selectionChange",
  26182. function(a) {
  26183. var b = this.getValue();
  26184. a = a.data.path.elements;
  26185. for (var f = 0, d = a.length, h; f < d; f++) {
  26186. h = a[f];
  26187. for (var g in e)
  26188. if (e[g].checkElementRemovable(h, !0, c)) {
  26189. g != b && this.setValue(g);
  26190. return
  26191. }
  26192. }
  26193. this.setValue("")
  26194. }, this)
  26195. },
  26196. onOpen: function() {
  26197. var a = c.getSelection(),
  26198. a = a.getSelectedElement() || a.getStartElement() || c.editable(),
  26199. a = c.elementPath(a),
  26200. b = [0, 0, 0, 0];
  26201. this.showAll();
  26202. this.unmarkAll();
  26203. for (var f in e) {
  26204. var d = e[f],
  26205. k = d._.type;
  26206. d.checkApplicable(a, c, c.activeFilter) ? b[k]++ : this.hideItem(f);
  26207. d.checkActive(a, c) && this.mark(f)
  26208. }
  26209. b[CKEDITOR.STYLE_BLOCK] ||
  26210. this.hideGroup(h["panelTitle" + String(CKEDITOR.STYLE_BLOCK)]);
  26211. b[CKEDITOR.STYLE_INLINE] || this.hideGroup(h["panelTitle" + String(CKEDITOR.STYLE_INLINE)]);
  26212. b[CKEDITOR.STYLE_OBJECT] || this.hideGroup(h["panelTitle" + String(CKEDITOR.STYLE_OBJECT)])
  26213. },
  26214. refresh: function() {
  26215. var a = c.elementPath();
  26216. if (a) {
  26217. for (var b in e)
  26218. if (e[b].checkApplicable(a, c, c.activeFilter)) return;
  26219. this.setState(CKEDITOR.TRISTATE_DISABLED)
  26220. }
  26221. },
  26222. reset: function() {
  26223. e = {};
  26224. l = []
  26225. }
  26226. })
  26227. }
  26228. })
  26229. })();
  26230. (function() {
  26231. function k(c) {
  26232. return {
  26233. editorFocus: !1,
  26234. canUndo: !0,
  26235. modes: {
  26236. wysiwyg: 1
  26237. },
  26238. exec: function(d) {
  26239. if (d.editable().hasFocus) {
  26240. var e = d.getSelection(),
  26241. b;
  26242. if (b = (new CKEDITOR.dom.elementPath(e.getStartElement(), e.root)).contains({
  26243. td: 1,
  26244. th: 1
  26245. }, 1)) {
  26246. var e = d.createRange(),
  26247. a = CKEDITOR.tools.tryThese(function() {
  26248. var a = b.getParent().$.cells[b.$.cellIndex + (c ? -1 : 1)];
  26249. a.parentNode.parentNode;
  26250. return a
  26251. }, function() {
  26252. var a = b.getParent(),
  26253. a = a.getAscendant("table").$.rows[a.$.rowIndex + (c ? -1 : 1)];
  26254. return a.cells[c ? a.cells.length - 1 : 0]
  26255. });
  26256. if (a || c)
  26257. if (a) a = new CKEDITOR.dom.element(a), e.moveToElementEditStart(a), e.checkStartOfBlock() && e
  26258. .checkEndOfBlock() || e.selectNodeContents(a);
  26259. else return !0;
  26260. else {
  26261. for (var f = b.getAscendant("table").$, a = b.getParent().$.cells, f = new CKEDITOR.dom.element(f
  26262. .insertRow(-1), d.document), g = 0, h = a.length; g < h; g++) f.append((new CKEDITOR.dom
  26263. .element(a[g], d.document)).clone(!1, !1)).appendBogus();
  26264. e.moveToElementEditStart(f)
  26265. }
  26266. e.select(!0);
  26267. return !0
  26268. }
  26269. }
  26270. return !1
  26271. }
  26272. }
  26273. }
  26274. var h = {
  26275. editorFocus: !1,
  26276. modes: {
  26277. wysiwyg: 1,
  26278. source: 1
  26279. }
  26280. },
  26281. g = {
  26282. exec: function(c) {
  26283. c.container.focusNext(!0,
  26284. c.tabIndex)
  26285. }
  26286. },
  26287. f = {
  26288. exec: function(c) {
  26289. c.container.focusPrevious(!0, c.tabIndex)
  26290. }
  26291. };
  26292. CKEDITOR.plugins.add("tab", {
  26293. init: function(c) {
  26294. for (var d = !1 !== c.config.enableTabKeyTools, e = c.config.tabSpaces || 0, b = ""; e--;) b += " ";
  26295. if (b) c.on("key", function(a) {
  26296. 9 == a.data.keyCode && (c.insertText(b), a.cancel())
  26297. });
  26298. if (d) c.on("key", function(a) {
  26299. (9 == a.data.keyCode && c.execCommand("selectNextCell") || a.data.keyCode == CKEDITOR.SHIFT +
  26300. 9 && c.execCommand("selectPreviousCell")) && a.cancel()
  26301. });
  26302. c.addCommand("blur", CKEDITOR.tools.extend(g, h));
  26303. c.addCommand("blurBack",
  26304. CKEDITOR.tools.extend(f, h));
  26305. c.addCommand("selectNextCell", k());
  26306. c.addCommand("selectPreviousCell", k(!0))
  26307. }
  26308. })
  26309. })();
  26310. CKEDITOR.dom.element.prototype.focusNext = function(k, h) {
  26311. var g = void 0 === h ? this.getTabIndex() : h,
  26312. f, c, d, e, b, a;
  26313. if (0 >= g)
  26314. for (b = this.getNextSourceNode(k, CKEDITOR.NODE_ELEMENT); b;) {
  26315. if (b.isVisible() && 0 === b.getTabIndex()) {
  26316. d = b;
  26317. break
  26318. }
  26319. b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT)
  26320. } else
  26321. for (b = this.getDocument().getBody().getFirst(); b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  26322. if (!f)
  26323. if (!c && b.equals(this)) {
  26324. if (c = !0, k) {
  26325. if (!(b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  26326. f = 1
  26327. }
  26328. } else c && !this.contains(b) &&
  26329. (f = 1);
  26330. if (b.isVisible() && !(0 > (a = b.getTabIndex()))) {
  26331. if (f && a == g) {
  26332. d = b;
  26333. break
  26334. }
  26335. a > g && (!d || !e || a < e) ? (d = b, e = a) : d || 0 !== a || (d = b, e = a)
  26336. }
  26337. }
  26338. d && d.focus()
  26339. };
  26340. CKEDITOR.dom.element.prototype.focusPrevious = function(k, h) {
  26341. for (var g = void 0 === h ? this.getTabIndex() : h, f, c, d, e = 0, b, a = this.getDocument().getBody()
  26342. .getLast(); a = a.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  26343. if (!f)
  26344. if (!c && a.equals(this)) {
  26345. if (c = !0, k) {
  26346. if (!(a = a.getPreviousSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  26347. f = 1
  26348. }
  26349. } else c && !this.contains(a) && (f = 1);
  26350. if (a.isVisible() && !(0 > (b = a.getTabIndex())))
  26351. if (0 >= g) {
  26352. if (f && 0 === b) {
  26353. d = a;
  26354. break
  26355. }
  26356. b > e && (d = a, e = b)
  26357. } else {
  26358. if (f && b == g) {
  26359. d = a;
  26360. break
  26361. }
  26362. b < g && (!d || b > e) && (d = a, e = b)
  26363. }
  26364. }
  26365. d && d.focus()
  26366. };
  26367. CKEDITOR.plugins.add("table", {
  26368. requires: "dialog",
  26369. init: function(a) {
  26370. function f(c) {
  26371. return CKEDITOR.tools.extend(c || {}, {
  26372. contextSensitive: 1,
  26373. refresh: function(c, b) {
  26374. this.setState(b.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  26375. }
  26376. })
  26377. }
  26378. if (!a.blockless) {
  26379. var e = a.lang.table;
  26380. a.addCommand("table", new CKEDITOR.dialogCommand("table", {
  26381. context: "table",
  26382. allowedContent: "table{width,height,border-collapse}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];td{border*,background-color,vertical-align,width,height}[colspan,rowspan];" +
  26383. (a.plugins.dialogadvtab ? "table" + a.plugins.dialogadvtab.allowedContent() : ""),
  26384. requiredContent: "table",
  26385. contentTransformations: [
  26386. ["table{width}: sizeToStyle", "table[width]: sizeToAttribute"],
  26387. ["td: splitBorderShorthand"],
  26388. [{
  26389. element: "table",
  26390. right: function(c) {
  26391. if (c.styles) {
  26392. var a;
  26393. if (c.styles.border) a = CKEDITOR.tools.style.parse.border(c.styles.border);
  26394. else if (CKEDITOR.env.ie && 8 === CKEDITOR.env.version) {
  26395. var b = c.styles;
  26396. b["border-left"] && b["border-left"] === b["border-right"] && b[
  26397. "border-right"] === b["border-top"] &&
  26398. b["border-top"] === b["border-bottom"] && (a = CKEDITOR.tools.style.parse
  26399. .border(b["border-top"]))
  26400. }
  26401. a && a.style && "solid" === a.style && a.width && 0 !== parseFloat(a.width) && (c
  26402. .attributes.border = 1);
  26403. "collapse" == c.styles["border-collapse"] && (c.attributes.cellspacing = 0)
  26404. }
  26405. }
  26406. }]
  26407. ]
  26408. }));
  26409. a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", f()));
  26410. a.addCommand("tableDelete", f({
  26411. exec: function(a) {
  26412. var d = a.elementPath().contains("table", 1);
  26413. if (d) {
  26414. var b = d.getParent(),
  26415. e = a.editable();
  26416. 1 != b.getChildCount() || b.is("td",
  26417. "th") || b.equals(e) || (d = b);
  26418. a = a.createRange();
  26419. a.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START);
  26420. d.remove();
  26421. a.select()
  26422. }
  26423. }
  26424. }));
  26425. a.ui.addButton && a.ui.addButton("Table", {
  26426. label: e.toolbar,
  26427. command: "table",
  26428. toolbar: "insert,30"
  26429. });
  26430. CKEDITOR.dialog.add("table", this.path + "dialogs/table.js");
  26431. CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js");
  26432. a.addMenuItems && a.addMenuItems({
  26433. table: {
  26434. label: e.menu,
  26435. command: "tableProperties",
  26436. group: "table",
  26437. order: 5
  26438. },
  26439. tabledelete: {
  26440. label: e.deleteTable,
  26441. command: "tableDelete",
  26442. group: "table",
  26443. order: 1
  26444. }
  26445. });
  26446. a.on("doubleclick", function(a) {
  26447. a.data.element.is("table") && (a.data.dialog = "tableProperties")
  26448. });
  26449. a.contextMenu && a.contextMenu.addListener(function() {
  26450. return {
  26451. tabledelete: CKEDITOR.TRISTATE_OFF,
  26452. table: CKEDITOR.TRISTATE_OFF
  26453. }
  26454. })
  26455. }
  26456. }
  26457. });
  26458. (function() {
  26459. function q(d, f) {
  26460. function b(a) {
  26461. return f ? f.contains(a) && a.getAscendant("table", !0).equals(f) : !0
  26462. }
  26463. function c(a) {
  26464. var b = /^(?:td|th)$/;
  26465. 0 < e.length || a.type != CKEDITOR.NODE_ELEMENT || !b.test(a.getName()) || a.getCustomData(
  26466. "selected_cell") || (CKEDITOR.dom.element.setMarker(h, a, "selected_cell", !0), e.push(a))
  26467. }
  26468. var e = [],
  26469. h = {};
  26470. if (!d) return e;
  26471. for (var a = d.getRanges(), k = 0; k < a.length; k++) {
  26472. var g = a[k];
  26473. if (g.collapsed)(g = g.getCommonAncestor().getAscendant({
  26474. td: 1,
  26475. th: 1
  26476. }, !0)) && b(g) && e.push(g);
  26477. else {
  26478. var g = new CKEDITOR.dom.walker(g),
  26479. m;
  26480. for (g.guard = c; m = g.next();) m.type == CKEDITOR.NODE_ELEMENT && m.is(CKEDITOR.dtd.table) || (m = m
  26481. .getAscendant({
  26482. td: 1,
  26483. th: 1
  26484. }, !0)) && !m.getCustomData("selected_cell") && b(m) && (CKEDITOR.dom.element.setMarker(h, m,
  26485. "selected_cell", !0), e.push(m))
  26486. }
  26487. }
  26488. CKEDITOR.dom.element.clearAllMarkers(h);
  26489. return e
  26490. }
  26491. function r(d, f) {
  26492. for (var b = D(d) ? d : q(d), c = b[0], e = c.getAscendant("table"), c = c.getDocument(), h = b[0]
  26493. .getParent(), a = h.$.rowIndex, b = b[b.length - 1], k = b.getParent().$.rowIndex + b.$.rowSpan - 1, b =
  26494. new CKEDITOR.dom.element(e.$.rows[k]), a =
  26495. f ? a : k, h = f ? h : b, b = CKEDITOR.tools.buildTableMap(e), e = b[a], a = f ? b[a - 1] : b[a + 1], b =
  26496. b[0].length, c = c.createElement("tr"), k = 0; e[k] && k < b; k++) {
  26497. var g;
  26498. 1 < e[k].rowSpan && a && e[k] == a[k] ? (g = e[k], g.rowSpan += 1) : (g = (new CKEDITOR.dom.element(e[k]))
  26499. .clone(), g.removeAttribute("rowSpan"), g.appendBogus(), c.append(g), g = g.$);
  26500. k += g.colSpan - 1
  26501. }
  26502. f ? c.insertBefore(h) : c.insertAfter(h);
  26503. return c
  26504. }
  26505. function B(d) {
  26506. if (d instanceof CKEDITOR.dom.selection) {
  26507. var f = d.getRanges(),
  26508. b = q(d),
  26509. c = b[0].getAscendant("table"),
  26510. e = CKEDITOR.tools.buildTableMap(c),
  26511. h = b[0].getParent().$.rowIndex,
  26512. b = b[b.length - 1],
  26513. a = b.getParent().$.rowIndex + b.$.rowSpan - 1,
  26514. b = [];
  26515. d.reset();
  26516. for (d = h; d <= a; d++) {
  26517. for (var k = e[d], g = new CKEDITOR.dom.element(c.$.rows[d]), m = 0; m < k.length; m++) {
  26518. var l = new CKEDITOR.dom.element(k[m]),
  26519. n = l.getParent().$.rowIndex;
  26520. 1 == l.$.rowSpan ? l.remove() : (--l.$.rowSpan, n == d && (n = e[d + 1], n[m - 1] ? l.insertAfter(
  26521. new CKEDITOR.dom.element(n[m - 1])) : (new CKEDITOR.dom.element(c.$.rows[d + 1])).append(l, 1)));
  26522. m += l.$.colSpan - 1
  26523. }
  26524. b.push(g)
  26525. }
  26526. e = c.$.rows;
  26527. f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START);
  26528. h = new CKEDITOR.dom.element(e[a + 1] || (0 < h ? e[h - 1] : null) || c.$.parentNode);
  26529. for (d = b.length; 0 <= d; d--) B(b[d]);
  26530. return c.$.parentNode ? h : (f[0].select(), null)
  26531. }
  26532. d instanceof CKEDITOR.dom.element && (c = d.getAscendant("table"), 1 == c.$.rows.length ? c.remove() : d
  26533. .remove());
  26534. return null
  26535. }
  26536. function v(d) {
  26537. for (var f = d.getParent().$.cells, b = 0, c = 0; c < f.length; c++) {
  26538. var e = f[c],
  26539. b = b + e.colSpan;
  26540. if (e == d.$) break
  26541. }
  26542. return b - 1
  26543. }
  26544. function w(d, f) {
  26545. for (var b = f ? Infinity : 0, c = 0; c < d.length; c++) {
  26546. var e = v(d[c]);
  26547. if (f ? e < b : e > b) b = e
  26548. }
  26549. return b
  26550. }
  26551. function u(d, f) {
  26552. for (var b =
  26553. D(d) ? d : q(d), c = b[0].getAscendant("table"), e = w(b, 1), b = w(b), h = f ? e : b, a = CKEDITOR.tools
  26554. .buildTableMap(c), c = [], e = [], b = [], k = a.length, g = 0; g < k; g++) {
  26555. var m = f ? a[g][h - 1] : a[g][h + 1];
  26556. c.push(a[g][h]);
  26557. e.push(m)
  26558. }
  26559. for (g = 0; g < k; g++) c[g] && (1 < c[g].colSpan && e[g] == c[g] ? (a = c[g], a.colSpan += 1) : (h =
  26560. new CKEDITOR.dom.element(c[g]), a = h.clone(), a.removeAttribute("colSpan"), a.appendBogus(), a[f ?
  26561. "insertBefore" : "insertAfter"].call(a, h), b.push(a), a = a.$), g += a.rowSpan - 1);
  26562. return b
  26563. }
  26564. function y(d) {
  26565. function f(a) {
  26566. var b = a.getRanges(),
  26567. c, d;
  26568. if (1 !== b.length) return a;
  26569. b = b[0];
  26570. if (b.collapsed || 0 !== b.endOffset) return a;
  26571. c = b.endContainer;
  26572. d = c.getName().toLowerCase();
  26573. if ("td" !== d && "th" !== d) return a;
  26574. for ((d = c.getPrevious()) || (d = c.getParent().getPrevious().getLast()); d.type !== CKEDITOR.NODE_TEXT &&
  26575. "br" !== d.getName().toLowerCase();)
  26576. if (d = d.getLast(), !d) return a;
  26577. b.setEndAt(d, CKEDITOR.POSITION_BEFORE_END);
  26578. return b.select()
  26579. }
  26580. CKEDITOR.env.webkit && !d.isFake && (d = f(d));
  26581. var b = d.getRanges(),
  26582. c = q(d),
  26583. e = c[0],
  26584. h = c[c.length - 1],
  26585. c = e.getAscendant("table"),
  26586. a = CKEDITOR.tools.buildTableMap(c),
  26587. k, g, m = [];
  26588. d.reset();
  26589. var l = 0;
  26590. for (d = a.length; l < d; l++)
  26591. for (var n = 0, p = a[l].length; n < p; n++) void 0 === k && a[l][n] == e.$ && (k = n), a[l][n] == h.$ && (
  26592. g = n);
  26593. for (l = k; l <= g; l++)
  26594. for (n = 0; n < a.length; n++) h = a[n], e = new CKEDITOR.dom.element(c.$.rows[n]), h = new CKEDITOR.dom
  26595. .element(h[l]), h.$ && (1 == h.$.colSpan ? h.remove() : --h.$.colSpan, n += h.$.rowSpan - 1, e.$.cells
  26596. .length || m.push(e));
  26597. k = a[0].length - 1 > g ? new CKEDITOR.dom.element(a[0][g + 1]) : k && -1 !== a[0][k - 1].cellIndex ?
  26598. new CKEDITOR.dom.element(a[0][k - 1]) : new CKEDITOR.dom.element(c.$.parentNode);
  26599. m.length == d && (b[0].moveToPosition(c, CKEDITOR.POSITION_AFTER_END), b[0].select(), c.remove());
  26600. return k
  26601. }
  26602. function t(d, f) {
  26603. var b = d.getStartElement().getAscendant({
  26604. td: 1,
  26605. th: 1
  26606. }, !0);
  26607. if (b) {
  26608. var c = b.clone();
  26609. c.appendBogus();
  26610. f ? c.insertBefore(b) : c.insertAfter(b)
  26611. }
  26612. }
  26613. function z(d) {
  26614. if (d instanceof CKEDITOR.dom.selection) {
  26615. var f = d.getRanges(),
  26616. b = q(d),
  26617. c = b[0] && b[0].getAscendant("table"),
  26618. e;
  26619. a: {
  26620. var h = 0;e = b.length - 1;
  26621. for (var a = {}, k, g; k = b[h++];) CKEDITOR.dom.element.setMarker(a, k, "delete_cell", !0);
  26622. for (h = 0; k = b[h++];)
  26623. if ((g = k.getPrevious()) &&
  26624. !g.getCustomData("delete_cell") || (g = k.getNext()) && !g.getCustomData("delete_cell")) {
  26625. CKEDITOR.dom.element.clearAllMarkers(a);
  26626. e = g;
  26627. break a
  26628. } CKEDITOR.dom.element.clearAllMarkers(a);h = b[0].getParent();
  26629. (h = h.getPrevious()) ? e = h.getLast() : (h = b[e].getParent(), e = (h = h.getNext()) ? h.getChild(0) :
  26630. null)
  26631. }
  26632. d.reset();
  26633. for (d = b.length - 1; 0 <= d; d--) z(b[d]);
  26634. e ? p(e, !0) : c && (f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START), f[0].select(), c.remove())
  26635. } else d instanceof CKEDITOR.dom.element && (f = d.getParent(), 1 == f.getChildCount() ?
  26636. f.remove() : d.remove())
  26637. }
  26638. function p(d, f) {
  26639. var b = d.getDocument(),
  26640. c = CKEDITOR.document;
  26641. CKEDITOR.env.ie && 10 == CKEDITOR.env.version && (c.focus(), b.focus());
  26642. b = new CKEDITOR.dom.range(b);
  26643. b["moveToElementEdit" + (f ? "End" : "Start")](d) || (b.selectNodeContents(d), b.collapse(f ? !1 : !0));
  26644. b.select(!0)
  26645. }
  26646. function A(d, f, b) {
  26647. d = d[f];
  26648. if ("undefined" == typeof b) return d;
  26649. for (f = 0; d && f < d.length; f++) {
  26650. if (b.is && d[f] == b.$) return f;
  26651. if (f == b) return new CKEDITOR.dom.element(d[f])
  26652. }
  26653. return b.is ? -1 : null
  26654. }
  26655. function x(d, f, b) {
  26656. var c = q(d),
  26657. e;
  26658. if ((f ? 1 != c.length :
  26659. 2 > c.length) || (e = d.getCommonAncestor()) && e.type == CKEDITOR.NODE_ELEMENT && e.is("table")) return !
  26660. 1;
  26661. d = c[0];
  26662. e = d.getAscendant("table");
  26663. var h = CKEDITOR.tools.buildTableMap(e),
  26664. a = h.length,
  26665. k = h[0].length,
  26666. g = d.getParent().$.rowIndex,
  26667. m = A(h, g, d),
  26668. l;
  26669. if (f) {
  26670. var n;
  26671. try {
  26672. var p = parseInt(d.getAttribute("rowspan"), 10) || 1;
  26673. l = parseInt(d.getAttribute("colspan"), 10) || 1;
  26674. n = h["up" == f ? g - p : "down" == f ? g + p : g]["left" == f ? m - l : "right" == f ? m + l : m]
  26675. } catch (x) {
  26676. return !1
  26677. }
  26678. if (!n || d.$ == n) return !1;
  26679. c["up" == f || "left" == f ? "unshift" : "push"](new CKEDITOR.dom.element(n))
  26680. }
  26681. f =
  26682. d.getDocument();
  26683. var r = g,
  26684. p = n = 0,
  26685. u = !b && new CKEDITOR.dom.documentFragment(f),
  26686. w = 0;
  26687. for (f = 0; f < c.length; f++) {
  26688. l = c[f];
  26689. var t = l.getParent(),
  26690. y = l.getFirst(),
  26691. v = l.$.colSpan,
  26692. z = l.$.rowSpan,
  26693. t = t.$.rowIndex,
  26694. B = A(h, t, l),
  26695. w = w + v * z,
  26696. p = Math.max(p, B - m + v);
  26697. n = Math.max(n, t - g + z);
  26698. b || (v = l, (z = v.getBogus()) && z.remove(), v.trim(), l.getChildren().count() && (t == r || !y || y
  26699. .isBlockBoundary && y.isBlockBoundary({
  26700. br: 1
  26701. }) || (r = u.getLast(CKEDITOR.dom.walker.whitespaces(!0)), !r || r.is && r.is("br") || u.append(
  26702. "br")), l.moveChildren(u)), f ? l.remove() : l.setHtml(""));
  26703. r = t
  26704. }
  26705. if (b) return n * p == w;
  26706. u.moveChildren(d);
  26707. d.appendBogus();
  26708. p >= k ? d.removeAttribute("rowSpan") : d.$.rowSpan = n;
  26709. n >= a ? d.removeAttribute("colSpan") : d.$.colSpan = p;
  26710. b = new CKEDITOR.dom.nodeList(e.$.rows);
  26711. c = b.count();
  26712. for (f = c - 1; 0 <= f; f--) e = b.getItem(f), e.$.cells.length || (e.remove(), c++);
  26713. return d
  26714. }
  26715. function C(d, f) {
  26716. var b = q(d);
  26717. if (1 < b.length) return !1;
  26718. if (f) return !0;
  26719. var b = b[0],
  26720. c = b.getParent(),
  26721. e = c.getAscendant("table"),
  26722. h = CKEDITOR.tools.buildTableMap(e),
  26723. a = c.$.rowIndex,
  26724. k = A(h, a, b),
  26725. g = b.$.rowSpan,
  26726. m;
  26727. if (1 < g) {
  26728. m = Math.ceil(g / 2);
  26729. for (var g =
  26730. Math.floor(g / 2), c = a + m, e = new CKEDITOR.dom.element(e.$.rows[c]), h = A(h, c), l, c = b.clone(),
  26731. a = 0; a < h.length; a++)
  26732. if (l = h[a], l.parentNode == e.$ && a > k) {
  26733. c.insertBefore(new CKEDITOR.dom.element(l));
  26734. break
  26735. } else l = null;
  26736. l || e.append(c)
  26737. } else
  26738. for (g = m = 1, e = c.clone(), e.insertAfter(c), e.append(c = b.clone()), l = A(h, a), k = 0; k < l
  26739. .length; k++) l[k].rowSpan++;
  26740. c.appendBogus();
  26741. b.$.rowSpan = m;
  26742. c.$.rowSpan = g;
  26743. 1 == m && b.removeAttribute("rowSpan");
  26744. 1 == g && c.removeAttribute("rowSpan");
  26745. return c
  26746. }
  26747. function E(d, f) {
  26748. var b = q(d);
  26749. if (1 < b.length) return !1;
  26750. if (f) return !0;
  26751. var b = b[0],
  26752. c = b.getParent(),
  26753. e = c.getAscendant("table"),
  26754. e = CKEDITOR.tools.buildTableMap(e),
  26755. h = A(e, c.$.rowIndex, b),
  26756. a = b.$.colSpan;
  26757. if (1 < a) c = Math.ceil(a / 2), a = Math.floor(a / 2);
  26758. else {
  26759. for (var a = c = 1, k = [], g = 0; g < e.length; g++) {
  26760. var m = e[g];
  26761. k.push(m[h]);
  26762. 1 < m[h].rowSpan && (g += m[h].rowSpan - 1)
  26763. }
  26764. for (e = 0; e < k.length; e++) k[e].colSpan++
  26765. }
  26766. e = b.clone();
  26767. e.insertAfter(b);
  26768. e.appendBogus();
  26769. b.$.colSpan = c;
  26770. e.$.colSpan = a;
  26771. 1 == c && b.removeAttribute("colSpan");
  26772. 1 == a && e.removeAttribute("colSpan");
  26773. return e
  26774. }
  26775. var D = CKEDITOR.tools.isArray;
  26776. CKEDITOR.plugins.tabletools = {
  26777. requires: "table,dialog,contextmenu",
  26778. init: function(d) {
  26779. function f(a) {
  26780. return CKEDITOR.tools.extend(a || {}, {
  26781. contextSensitive: 1,
  26782. refresh: function(a, b) {
  26783. this.setState(b.contains({
  26784. td: 1,
  26785. th: 1
  26786. }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  26787. }
  26788. })
  26789. }
  26790. function b(a, b) {
  26791. var c = d.addCommand(a, b);
  26792. d.addFeature(c)
  26793. }
  26794. var c = d.lang.table,
  26795. e = CKEDITOR.tools.style.parse,
  26796. h =
  26797. "td{width} td{height} td{border-color} td{background-color} td{white-space} td{vertical-align} td{text-align} td[colspan] td[rowspan] th"
  26798. .split(" ");
  26799. b("cellProperties",
  26800. new CKEDITOR.dialogCommand("cellProperties", f({
  26801. allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",
  26802. requiredContent: h,
  26803. contentTransformations: [
  26804. [{
  26805. element: "td",
  26806. left: function(a) {
  26807. return a.styles.background && e.background(a.styles.background).color
  26808. },
  26809. right: function(a) {
  26810. a.styles["background-color"] = e.background(a.styles.background).color
  26811. }
  26812. }, {
  26813. element: "td",
  26814. check: "td{vertical-align}",
  26815. left: function(a) {
  26816. return a.attributes && a.attributes.valign
  26817. },
  26818. right: function(a) {
  26819. a.styles["vertical-align"] = a.attributes.valign;
  26820. delete a.attributes.valign
  26821. }
  26822. }],
  26823. [{
  26824. element: "tr",
  26825. check: "td{height}",
  26826. left: function(a) {
  26827. return a.styles && a.styles.height
  26828. },
  26829. right: function(a) {
  26830. CKEDITOR.tools.array.forEach(a.children, function(b) {
  26831. b.name in {
  26832. td: 1,
  26833. th: 1
  26834. } && (b.attributes["cke-row-height"] = a.styles.height)
  26835. });
  26836. delete a.styles.height
  26837. }
  26838. }],
  26839. [{
  26840. element: "td",
  26841. check: "td{height}",
  26842. left: function(a) {
  26843. return (a = a.attributes) && a["cke-row-height"]
  26844. },
  26845. right: function(a) {
  26846. a.styles.height = a.attributes["cke-row-height"];
  26847. delete a.attributes["cke-row-height"]
  26848. }
  26849. }]
  26850. ]
  26851. })));
  26852. CKEDITOR.dialog.add("cellProperties", this.path + "dialogs/tableCell.js");
  26853. b("rowDelete", f({
  26854. requiredContent: "table",
  26855. exec: function(a) {
  26856. a = a.getSelection();
  26857. (a = B(a)) && p(a)
  26858. }
  26859. }));
  26860. b("rowInsertBefore", f({
  26861. requiredContent: "table",
  26862. exec: function(a) {
  26863. a = a.getSelection();
  26864. a = q(a);
  26865. r(a, !0)
  26866. }
  26867. }));
  26868. b("rowInsertAfter", f({
  26869. requiredContent: "table",
  26870. exec: function(a) {
  26871. a = a.getSelection();
  26872. a = q(a);
  26873. r(a)
  26874. }
  26875. }));
  26876. b("columnDelete", f({
  26877. requiredContent: "table",
  26878. exec: function(a) {
  26879. a = a.getSelection();
  26880. (a = y(a)) &&
  26881. p(a, !0)
  26882. }
  26883. }));
  26884. b("columnInsertBefore", f({
  26885. requiredContent: "table",
  26886. exec: function(a) {
  26887. a = a.getSelection();
  26888. a = q(a);
  26889. u(a, !0)
  26890. }
  26891. }));
  26892. b("columnInsertAfter", f({
  26893. requiredContent: "table",
  26894. exec: function(a) {
  26895. a = a.getSelection();
  26896. a = q(a);
  26897. u(a)
  26898. }
  26899. }));
  26900. b("cellDelete", f({
  26901. requiredContent: "table",
  26902. exec: function(a) {
  26903. a = a.getSelection();
  26904. z(a)
  26905. }
  26906. }));
  26907. b("cellMerge", f({
  26908. allowedContent: "td[colspan,rowspan]",
  26909. requiredContent: "td[colspan,rowspan]",
  26910. exec: function(a, b) {
  26911. b.cell = x(a.getSelection());
  26912. p(b.cell, !0)
  26913. }
  26914. }));
  26915. b("cellMergeRight", f({
  26916. allowedContent: "td[colspan]",
  26917. requiredContent: "td[colspan]",
  26918. exec: function(a, b) {
  26919. b.cell = x(a.getSelection(), "right");
  26920. p(b.cell, !0)
  26921. }
  26922. }));
  26923. b("cellMergeDown", f({
  26924. allowedContent: "td[rowspan]",
  26925. requiredContent: "td[rowspan]",
  26926. exec: function(a, b) {
  26927. b.cell = x(a.getSelection(), "down");
  26928. p(b.cell, !0)
  26929. }
  26930. }));
  26931. b("cellVerticalSplit", f({
  26932. allowedContent: "td[rowspan]",
  26933. requiredContent: "td[rowspan]",
  26934. exec: function(a) {
  26935. p(E(a.getSelection()))
  26936. }
  26937. }));
  26938. b("cellHorizontalSplit", f({
  26939. allowedContent: "td[colspan]",
  26940. requiredContent: "td[colspan]",
  26941. exec: function(a) {
  26942. p(C(a.getSelection()))
  26943. }
  26944. }));
  26945. b("cellInsertBefore", f({
  26946. requiredContent: "table",
  26947. exec: function(a) {
  26948. a = a.getSelection();
  26949. t(a, !0)
  26950. }
  26951. }));
  26952. b("cellInsertAfter", f({
  26953. requiredContent: "table",
  26954. exec: function(a) {
  26955. a = a.getSelection();
  26956. t(a)
  26957. }
  26958. }));
  26959. d.addMenuItems && d.addMenuItems({
  26960. tablecell: {
  26961. label: c.cell.menu,
  26962. group: "tablecell",
  26963. order: 1,
  26964. getItems: function() {
  26965. var a = d.getSelection(),
  26966. b = q(a),
  26967. a = {
  26968. tablecell_insertBefore: CKEDITOR.TRISTATE_OFF,
  26969. tablecell_insertAfter: CKEDITOR.TRISTATE_OFF,
  26970. tablecell_delete: CKEDITOR.TRISTATE_OFF,
  26971. tablecell_merge: x(a, null, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  26972. tablecell_merge_right: x(a, "right", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR
  26973. .TRISTATE_DISABLED,
  26974. tablecell_merge_down: x(a, "down", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR
  26975. .TRISTATE_DISABLED,
  26976. tablecell_split_vertical: E(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  26977. tablecell_split_horizontal: C(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR
  26978. .TRISTATE_DISABLED
  26979. };
  26980. d.filter.check(h) && (a.tablecell_properties = 0 < b.length ? CKEDITOR.TRISTATE_OFF :
  26981. CKEDITOR.TRISTATE_DISABLED);
  26982. return a
  26983. }
  26984. },
  26985. tablecell_insertBefore: {
  26986. label: c.cell.insertBefore,
  26987. group: "tablecell",
  26988. command: "cellInsertBefore",
  26989. order: 5
  26990. },
  26991. tablecell_insertAfter: {
  26992. label: c.cell.insertAfter,
  26993. group: "tablecell",
  26994. command: "cellInsertAfter",
  26995. order: 10
  26996. },
  26997. tablecell_delete: {
  26998. label: c.cell.deleteCell,
  26999. group: "tablecell",
  27000. command: "cellDelete",
  27001. order: 15
  27002. },
  27003. tablecell_merge: {
  27004. label: c.cell.merge,
  27005. group: "tablecell",
  27006. command: "cellMerge",
  27007. order: 16
  27008. },
  27009. tablecell_merge_right: {
  27010. label: c.cell.mergeRight,
  27011. group: "tablecell",
  27012. command: "cellMergeRight",
  27013. order: 17
  27014. },
  27015. tablecell_merge_down: {
  27016. label: c.cell.mergeDown,
  27017. group: "tablecell",
  27018. command: "cellMergeDown",
  27019. order: 18
  27020. },
  27021. tablecell_split_horizontal: {
  27022. label: c.cell.splitHorizontal,
  27023. group: "tablecell",
  27024. command: "cellHorizontalSplit",
  27025. order: 19
  27026. },
  27027. tablecell_split_vertical: {
  27028. label: c.cell.splitVertical,
  27029. group: "tablecell",
  27030. command: "cellVerticalSplit",
  27031. order: 20
  27032. },
  27033. tablecell_properties: {
  27034. label: c.cell.title,
  27035. group: "tablecellproperties",
  27036. command: "cellProperties",
  27037. order: 21
  27038. },
  27039. tablerow: {
  27040. label: c.row.menu,
  27041. group: "tablerow",
  27042. order: 1,
  27043. getItems: function() {
  27044. return {
  27045. tablerow_insertBefore: CKEDITOR.TRISTATE_OFF,
  27046. tablerow_insertAfter: CKEDITOR.TRISTATE_OFF,
  27047. tablerow_delete: CKEDITOR.TRISTATE_OFF
  27048. }
  27049. }
  27050. },
  27051. tablerow_insertBefore: {
  27052. label: c.row.insertBefore,
  27053. group: "tablerow",
  27054. command: "rowInsertBefore",
  27055. order: 5
  27056. },
  27057. tablerow_insertAfter: {
  27058. label: c.row.insertAfter,
  27059. group: "tablerow",
  27060. command: "rowInsertAfter",
  27061. order: 10
  27062. },
  27063. tablerow_delete: {
  27064. label: c.row.deleteRow,
  27065. group: "tablerow",
  27066. command: "rowDelete",
  27067. order: 15
  27068. },
  27069. tablecolumn: {
  27070. label: c.column.menu,
  27071. group: "tablecolumn",
  27072. order: 1,
  27073. getItems: function() {
  27074. return {
  27075. tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF,
  27076. tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF,
  27077. tablecolumn_delete: CKEDITOR.TRISTATE_OFF
  27078. }
  27079. }
  27080. },
  27081. tablecolumn_insertBefore: {
  27082. label: c.column.insertBefore,
  27083. group: "tablecolumn",
  27084. command: "columnInsertBefore",
  27085. order: 5
  27086. },
  27087. tablecolumn_insertAfter: {
  27088. label: c.column.insertAfter,
  27089. group: "tablecolumn",
  27090. command: "columnInsertAfter",
  27091. order: 10
  27092. },
  27093. tablecolumn_delete: {
  27094. label: c.column.deleteColumn,
  27095. group: "tablecolumn",
  27096. command: "columnDelete",
  27097. order: 15
  27098. }
  27099. });
  27100. d.contextMenu && d.contextMenu.addListener(function(a, b, c) {
  27101. return (a = c.contains({
  27102. td: 1,
  27103. th: 1
  27104. }, 1)) && !a.isReadOnly() ? {
  27105. tablecell: CKEDITOR.TRISTATE_OFF,
  27106. tablerow: CKEDITOR.TRISTATE_OFF,
  27107. tablecolumn: CKEDITOR.TRISTATE_OFF
  27108. } : null
  27109. })
  27110. },
  27111. getCellColIndex: v,
  27112. insertRow: r,
  27113. insertColumn: u,
  27114. getSelectedCells: q
  27115. };
  27116. CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools)
  27117. })();
  27118. CKEDITOR.tools.buildTableMap = function(q, r, B, v, w) {
  27119. q = q.$.rows;
  27120. B = B || 0;
  27121. v = "number" === typeof v ? v : q.length - 1;
  27122. w = "number" === typeof w ? w : -1;
  27123. var u = -1,
  27124. y = [];
  27125. for (r = r || 0; r <= v; r++) {
  27126. u++;
  27127. !y[u] && (y[u] = []);
  27128. for (var t = -1, z = B; z <= (-1 === w ? q[r].cells.length - 1 : w); z++) {
  27129. var p = q[r].cells[z];
  27130. if (!p) break;
  27131. for (t++; y[u][t];) t++;
  27132. for (var A = isNaN(p.colSpan) ? 1 : p.colSpan, p = isNaN(p.rowSpan) ? 1 : p.rowSpan, x = 0; x < p && !(r +
  27133. x > v); x++) {
  27134. y[u + x] || (y[u + x] = []);
  27135. for (var C = 0; C < A; C++) y[u + x][t + C] = q[r].cells[z]
  27136. }
  27137. t += A - 1;
  27138. if (-1 !== w && t >= w) break
  27139. }
  27140. }
  27141. return y
  27142. };
  27143. CKEDITOR.config.tabletools_scopedHeaders = !1;
  27144. (function() {
  27145. function D(a) {
  27146. return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a)
  27147. }
  27148. function z(a, b) {
  27149. var c = a.getAscendant("table"),
  27150. d = b.getAscendant("table"),
  27151. e = CKEDITOR.tools.buildTableMap(c),
  27152. g = r(a),
  27153. k = r(b),
  27154. h = [],
  27155. f = {},
  27156. l, p;
  27157. c.contains(d) && (b = b.getAscendant({
  27158. td: 1,
  27159. th: 1
  27160. }), k = r(b));
  27161. g > k && (c = g, g = k, k = c, c = a, a = b, b = c);
  27162. for (c = 0; c < e[g].length; c++)
  27163. if (a.$ === e[g][c]) {
  27164. l = c;
  27165. break
  27166. } for (c = 0; c < e[k].length; c++)
  27167. if (b.$ === e[k][c]) {
  27168. p = c;
  27169. break
  27170. } l > p && (c = l, l = p, p = c);
  27171. for (c = g; c <= k; c++)
  27172. for (g = l; g <= p; g++) d = new CKEDITOR.dom.element(e[c][g]),
  27173. d.$ && !d.getCustomData("selected_cell") && (h.push(d), CKEDITOR.dom.element.setMarker(f, d,
  27174. "selected_cell", !0));
  27175. CKEDITOR.dom.element.clearAllMarkers(f);
  27176. return h
  27177. }
  27178. function J(a) {
  27179. return (a = a.editable().findOne(".cke_table-faked-selection")) && a.getAscendant("table")
  27180. }
  27181. function A(a, b) {
  27182. var c = a.editable().find(".cke_table-faked-selection"),
  27183. d = a.editable().findOne("[data-cke-table-faked-selection-table]"),
  27184. e;
  27185. a.fire("lockSnapshot");
  27186. a.editable().removeClass("cke_table-faked-selection-editor");
  27187. for (e = 0; e < c.count(); e++) c.getItem(e).removeClass("cke_table-faked-selection");
  27188. d && d.data("cke-table-faked-selection-table", !1);
  27189. a.fire("unlockSnapshot");
  27190. b && (m = {
  27191. active: !1
  27192. }, a.getSelection().isInTable() && a.getSelection().reset())
  27193. }
  27194. function t(a, b) {
  27195. var c = [],
  27196. d, e;
  27197. for (e = 0; e < b.length; e++) d = a.createRange(), d.setStartBefore(b[e]), d.setEndAfter(b[e]), c.push(d);
  27198. a.getSelection().selectRanges(c)
  27199. }
  27200. function E(a) {
  27201. var b = a.editable().find(".cke_table-faked-selection");
  27202. 1 > b.count() || (b = z(b.getItem(0), b.getItem(b.count() - 1)), t(a, b))
  27203. }
  27204. function K(a, b, c) {
  27205. var d = v(a.getSelection(!0));
  27206. b = b.is("table") ? null :
  27207. b;
  27208. var e;
  27209. (e = m.active && !m.first) && !(e = b) && (e = a.getSelection().getRanges(), e = 1 < d.length || e[0] && !e[0]
  27210. .collapsed ? !0 : !1);
  27211. if (e) m.first = b || d[0], m.dirty = b ? !1 : 1 !== d.length;
  27212. else if (m.active && b && m.first.getAscendant("table").equals(b.getAscendant("table"))) {
  27213. d = z(m.first, b);
  27214. if (!m.dirty && 1 === d.length && !D(c.data.getTarget())) return A(a, "mouseup" === c.name);
  27215. m.dirty = !0;
  27216. m.last = b;
  27217. t(a, d)
  27218. }
  27219. }
  27220. function L(a) {
  27221. var b = (a = a.editor || a.sender.editor) && a.getSelection(),
  27222. c = b && b.getRanges() || [],
  27223. d = c && c[0].getEnclosedNode(),
  27224. d = d && d.type ==
  27225. CKEDITOR.NODE_ELEMENT && d.is("img"),
  27226. e;
  27227. if (b && (A(a), b.isInTable() && b.isFake))
  27228. if (d) a.getSelection().reset();
  27229. else if (!c[0]._getTableElement({
  27230. table: 1
  27231. }).hasAttribute("data-cke-tableselection-ignored")) {
  27232. 1 === c.length && c[0]._getTableElement() && c[0]._getTableElement().is("table") && (e = c[0]
  27233. ._getTableElement());
  27234. e = v(b, e);
  27235. a.fire("lockSnapshot");
  27236. for (b = 0; b < e.length; b++) e[b].addClass("cke_table-faked-selection");
  27237. 0 < e.length && (a.editable().addClass("cke_table-faked-selection-editor"), e[0].getAscendant("table").data(
  27238. "cke-table-faked-selection-table",
  27239. ""));
  27240. a.fire("unlockSnapshot")
  27241. }
  27242. }
  27243. function r(a) {
  27244. return a.getAscendant("tr", !0).$.rowIndex
  27245. }
  27246. function w(a) {
  27247. function b(a, b) {
  27248. return a && b ? a.equals(b) || a.contains(b) || b.contains(a) || a.getCommonAncestor(b).is(l) : !1
  27249. }
  27250. function c(a) {
  27251. return !a.getAscendant("table", !0) && a.getDocument().equals(e.document)
  27252. }
  27253. function d(a, b, d, e) {
  27254. if ("mousedown" === a.name && (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT || !e))
  27255. return !0;
  27256. if (b = a.name === (CKEDITOR.env.gecko ? "mousedown" : "mouseup") && !c(a.data.getTarget())) a = a.data
  27257. .getTarget().getAscendant({
  27258. td: 1,
  27259. th: 1
  27260. }, !0), b = !(a && a.hasClass("cke_table-faked-selection"));
  27261. return b
  27262. }
  27263. if (a.data.getTarget().getName && ("mouseup" === a.name || !D(a.data.getTarget()))) {
  27264. var e = a.editor || a.listenerData.editor,
  27265. g = e.getSelection(1),
  27266. k = J(e),
  27267. h = a.data.getTarget(),
  27268. f = h && h.getAscendant({
  27269. td: 1,
  27270. th: 1
  27271. }, !0),
  27272. h = h && h.getAscendant("table", !0),
  27273. l = {
  27274. table: 1,
  27275. thead: 1,
  27276. tbody: 1,
  27277. tfoot: 1,
  27278. tr: 1,
  27279. td: 1,
  27280. th: 1
  27281. };
  27282. h && h.hasAttribute("data-cke-tableselection-ignored") || (d(a, g, k, h) && A(e, !0), !m.active &&
  27283. "mousedown" === a.name && CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT &&
  27284. h && (m = {
  27285. active: !0
  27286. }, CKEDITOR.document.on("mouseup", w, null, {
  27287. editor: e
  27288. })), (f || h) && K(e, f || h, a), "mouseup" === a.name && (CKEDITOR.tools.getMouseButton(a) === CKEDITOR
  27289. .MOUSE_BUTTON_LEFT && (c(a.data.getTarget()) || b(k, h)) && E(e), m = {
  27290. active: !1
  27291. }, CKEDITOR.document.removeListener("mouseup", w)))
  27292. }
  27293. }
  27294. function M(a) {
  27295. var b = a.data.getTarget().getAscendant("table", !0);
  27296. m.active = !1;
  27297. b && b.hasAttribute("data-cke-tableselection-ignored") || (a = a.data.getTarget().getAscendant({
  27298. td: 1,
  27299. th: 1
  27300. }, !0), !a || a.hasClass("cke_table-faked-selection"))
  27301. }
  27302. function N(a,
  27303. b) {
  27304. function c(a) {
  27305. a.cancel()
  27306. }
  27307. var d = a.getSelection(),
  27308. e = d.createBookmarks(),
  27309. g = a.document,
  27310. k = a.createRange(),
  27311. h = g.getDocumentElement().$,
  27312. f = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
  27313. l = a.blockless || CKEDITOR.env.ie ? "span" : "div",
  27314. p, x, n, m;
  27315. g.getById("cke_table_copybin") || (p = g.createElement(l), x = g.createElement(l), x.setAttributes({
  27316. id: "cke_table_copybin",
  27317. "data-cke-temp": "1"
  27318. }), p.setStyles({
  27319. position: "absolute",
  27320. width: "1px",
  27321. height: "1px",
  27322. overflow: "hidden"
  27323. }), p.setStyle("ltr" == a.config.contentsLangDirection ? "left" : "right",
  27324. "-5000px"), p.setHtml(a.getSelectedHtml(!0)), a.fire("lockSnapshot"), x.append(p), a.editable().append(
  27325. x), m = a.on("selectionChange", c, null, null, 0), f && (n = h.scrollTop), k.selectNodeContents(p), k
  27326. .select(), f && (h.scrollTop = n), setTimeout(function() {
  27327. x.remove();
  27328. d.selectBookmarks(e);
  27329. m.removeListener();
  27330. a.fire("unlockSnapshot");
  27331. b && (a.extractSelectedHtml(), a.fire("saveSnapshot"))
  27332. }, 100))
  27333. }
  27334. function F(a) {
  27335. var b = a.editor || a.sender.editor,
  27336. c = b.getSelection();
  27337. c.isInTable() && (c.getRanges()[0]._getTableElement({
  27338. table: 1
  27339. }).hasAttribute("data-cke-tableselection-ignored") ||
  27340. N(b, "cut" === a.name))
  27341. }
  27342. function q(a) {
  27343. this._reset();
  27344. a && this.setSelectedCells(a)
  27345. }
  27346. function B(a, b, c) {
  27347. a.on("beforeCommandExec", function(d) {
  27348. -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && (d.data.selectedCells = v(a.getSelection()))
  27349. });
  27350. a.on("afterCommandExec", function(d) {
  27351. -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && c(a, d.data)
  27352. }, null, null, 9)
  27353. }
  27354. var m = {
  27355. active: !1
  27356. },
  27357. y, v, C, G, H;
  27358. q.prototype = {};
  27359. q.prototype._reset = function() {
  27360. this.cells = {
  27361. first: null,
  27362. last: null,
  27363. all: []
  27364. };
  27365. this.rows = {
  27366. first: null,
  27367. last: null
  27368. }
  27369. };
  27370. q.prototype.setSelectedCells =
  27371. function(a) {
  27372. this._reset();
  27373. a = a.slice(0);
  27374. this._arraySortByDOMOrder(a);
  27375. this.cells.all = a;
  27376. this.cells.first = a[0];
  27377. this.cells.last = a[a.length - 1];
  27378. this.rows.first = a[0].getAscendant("tr");
  27379. this.rows.last = this.cells.last.getAscendant("tr")
  27380. };
  27381. q.prototype.getTableMap = function() {
  27382. var a = C(this.cells.first),
  27383. b;
  27384. a: {
  27385. b = this.cells.last;
  27386. var c = b.getAscendant("table"),
  27387. d = r(b),
  27388. c = CKEDITOR.tools.buildTableMap(c),
  27389. e;
  27390. for (e = 0; e < c[d].length; e++)
  27391. if ((new CKEDITOR.dom.element(c[d][e])).equals(b)) {
  27392. b = e;
  27393. break a
  27394. } b = void 0
  27395. }
  27396. return CKEDITOR.tools.buildTableMap(this._getTable(),
  27397. r(this.rows.first), a, r(this.rows.last), b)
  27398. };
  27399. q.prototype._getTable = function() {
  27400. return this.rows.first.getAscendant("table")
  27401. };
  27402. q.prototype.insertRow = function(a, b, c) {
  27403. if ("undefined" === typeof a) a = 1;
  27404. else if (0 >= a) return;
  27405. for (var d = this.cells.first.$.cellIndex, e = this.cells.last.$.cellIndex, g = c ? [] : this.cells.all, k,
  27406. h = 0; h < a; h++) k = G(c ? this.cells.all : g, b), k = CKEDITOR.tools.array.filter(k.find("td, th")
  27407. .toArray(),
  27408. function(a) {
  27409. return c ? !0 : a.$.cellIndex >= d && a.$.cellIndex <= e
  27410. }), g = b ? k.concat(g) : g.concat(k);
  27411. this.setSelectedCells(g)
  27412. };
  27413. q.prototype.insertColumn = function(a) {
  27414. function b(a) {
  27415. a = r(a);
  27416. return a >= e && a <= g
  27417. }
  27418. if ("undefined" === typeof a) a = 1;
  27419. else if (0 >= a) return;
  27420. for (var c = this.cells, d = c.all, e = r(c.first), g = r(c.last), c = 0; c < a; c++) d = d.concat(CKEDITOR
  27421. .tools.array.filter(H(d), b));
  27422. this.setSelectedCells(d)
  27423. };
  27424. q.prototype.emptyCells = function(a) {
  27425. a = a || this.cells.all;
  27426. for (var b = 0; b < a.length; b++) a[b].setHtml("")
  27427. };
  27428. q.prototype._arraySortByDOMOrder = function(a) {
  27429. a.sort(function(a, c) {
  27430. return a.getPosition(c) & CKEDITOR.POSITION_PRECEDING ? -1 : 1
  27431. })
  27432. };
  27433. var I = {
  27434. onPaste: function(a) {
  27435. function b(a) {
  27436. var b =
  27437. d.createRange();
  27438. b.selectNodeContents(a);
  27439. b.select()
  27440. }
  27441. function c(a) {
  27442. return Math.max.apply(null, CKEDITOR.tools.array.map(a, function(a) {
  27443. return a.length
  27444. }, 0))
  27445. }
  27446. var d = a.editor,
  27447. e = d.getSelection(),
  27448. g = v(e),
  27449. k = e.isInTable(!0) && this.isBoundarySelection(e),
  27450. h = this.findTableInPastedContent(d, a.data.dataValue),
  27451. f, l;
  27452. (function(a, b, d, c) {
  27453. a = a.getRanges();
  27454. var e = a.length && a[0]._getTableElement({
  27455. table: 1
  27456. });
  27457. if (!b.length || e && e.hasAttribute("data-cke-tableselection-ignored") || c && !d) return !1;
  27458. if (b = !c)(b = a[0]) ? (b = b.clone(), b.enlarge(CKEDITOR.ENLARGE_ELEMENT),
  27459. b = (b = b.getEnclosedNode()) && b.is && b.is(CKEDITOR.dtd.$tableContent)) : b = void 0, b = !b;
  27460. return b ? !1 : !0
  27461. })(e, g, h, k) && "drop" !== a.data.method && (g = g[0].getAscendant("table"), f = new q(v(e, g)), d
  27462. .once("afterPaste", function() {
  27463. var a;
  27464. if (l) {
  27465. a = new CKEDITOR.dom.element(l[0][0]);
  27466. var b = l[l.length - 1];
  27467. a = z(a, new CKEDITOR.dom.element(b[b.length - 1]))
  27468. } else a = f.cells.all;
  27469. t(d, a)
  27470. }), h ? (a.stop(), k ? (f.insertRow(1, 1 === k, !0), e.selectElement(f.rows.first)) : (f
  27471. .emptyCells(), t(d, f.cells.all)), a = f.getTableMap(), l = CKEDITOR.tools.buildTableMap(h),
  27472. f.insertRow(l.length - a.length), f.insertColumn(c(l) - c(a)), a = f.getTableMap(), this
  27473. .pasteTable(f, a, l), d.fire("saveSnapshot"), setTimeout(function() {
  27474. d.fire("afterPaste")
  27475. }, 0)) : (b(f.cells.first), d.once("afterPaste", function() {
  27476. d.fire("lockSnapshot");
  27477. f.emptyCells(f.cells.all.slice(1));
  27478. t(d, f.cells.all);
  27479. d.fire("unlockSnapshot")
  27480. })))
  27481. },
  27482. isBoundarySelection: function(a) {
  27483. a = a.getRanges()[0];
  27484. var b = a.endContainer.getAscendant("tr", !0);
  27485. if (b && a.collapsed) {
  27486. if (a.checkBoundaryOfElement(b, CKEDITOR.START)) return 1;
  27487. if (a.checkBoundaryOfElement(b,
  27488. CKEDITOR.END)) return 2
  27489. }
  27490. return 0
  27491. },
  27492. findTableInPastedContent: function(a, b) {
  27493. var c = a.dataProcessor,
  27494. d = new CKEDITOR.dom.element("body");
  27495. c || (c = new CKEDITOR.htmlDataProcessor(a));
  27496. d.setHtml(c.toHtml(b), {
  27497. fixForBody: !1
  27498. });
  27499. return 1 < d.getChildCount() ? null : d.findOne("table")
  27500. },
  27501. pasteTable: function(a, b, c) {
  27502. var d, e = C(a.cells.first),
  27503. g = a._getTable(),
  27504. k = {},
  27505. h, f, l, p;
  27506. for (l = 0; l < c.length; l++)
  27507. for (h = new CKEDITOR.dom.element(g.$.rows[a.rows.first.$.rowIndex + l]), p = 0; p < c[l].length; p++)
  27508. if (f = new CKEDITOR.dom.element(c[l][p]), d = b[l] &&
  27509. b[l][p] ? new CKEDITOR.dom.element(b[l][p]) : null, f && !f.getCustomData("processed")) {
  27510. if (d && d.getParent()) f.replace(d);
  27511. else if (0 === p || c[l][p - 1])(d = 0 !== p ? new CKEDITOR.dom.element(c[l][p - 1]) : null) && h
  27512. .equals(d.getParent()) ? f.insertAfter(d) : 0 < e ? h.$.cells[e] ? f.insertAfter(new CKEDITOR
  27513. .dom.element(h.$.cells[e])) : h.append(f) : h.append(f, !0);
  27514. CKEDITOR.dom.element.setMarker(k, f, "processed", !0)
  27515. } else f.getCustomData("processed") && d && d.remove();
  27516. CKEDITOR.dom.element.clearAllMarkers(k)
  27517. }
  27518. };
  27519. CKEDITOR.plugins.tableselection = {
  27520. getCellsBetween: z,
  27521. keyboardIntegration: function(a) {
  27522. function b(a) {
  27523. var b = a.getEnclosedNode();
  27524. b && "function" === typeof b.is && b.is({
  27525. td: 1,
  27526. th: 1
  27527. }) ? b.setText("") : a.deleteContents();
  27528. CKEDITOR.tools.array.forEach(a._find("td"), function(a) {
  27529. a.appendBogus()
  27530. })
  27531. }
  27532. var c = a.editable();
  27533. c.attachListener(c, "keydown", function(a) {
  27534. function c(b, e) {
  27535. if (!e.length) return null;
  27536. var l = a.createRange(),
  27537. g = CKEDITOR.dom.range.mergeRanges(e);
  27538. CKEDITOR.tools.array.forEach(g, function(a) {
  27539. a.enlarge(CKEDITOR.ENLARGE_ELEMENT)
  27540. });
  27541. var m = g[0].getBoundaryNodes(),
  27542. n = m.startNode,
  27543. m = m.endNode;
  27544. if (n && n.is && n.is(k)) {
  27545. for (var q = n.getAscendant("table", !0), u = n.getPreviousSourceNode(!1, CKEDITOR
  27546. .NODE_ELEMENT, q), r = !1, t = function(a) {
  27547. return !n.contains(a) && a.is && a.is("td", "th")
  27548. }; u && !t(u);) u = u.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT, q);
  27549. !u && m && m.is && !m.is("table") && m.getNext() && (u = m.getNext().findOne("td, th"), r = !
  27550. 0);
  27551. if (u) l["moveToElementEdit" + (r ? "Start" : "End")](u);
  27552. else l.setStartBefore(n.getAscendant("table", !0)), l.collapse(!0);
  27553. g[0].deleteContents();
  27554. return [l]
  27555. }
  27556. if (n) return l.moveToElementEditablePosition(n),
  27557. [l]
  27558. }
  27559. var g = {
  27560. 37: 1,
  27561. 38: 1,
  27562. 39: 1,
  27563. 40: 1,
  27564. 8: 1,
  27565. 46: 1,
  27566. 13: 1
  27567. },
  27568. k = CKEDITOR.tools.extend({
  27569. table: 1
  27570. }, CKEDITOR.dtd.$tableContent);
  27571. delete k.td;
  27572. delete k.th;
  27573. return function(h) {
  27574. var f = h.data.getKey(),
  27575. l = h.data.getKeystroke(),
  27576. k, m = 37 === f || 38 == f,
  27577. n, q, r;
  27578. if (g[f] && !a.readOnly && (k = a.getSelection()) && k.isInTable() && k.isFake) {
  27579. n = k.getRanges();
  27580. q = n[0]._getTableElement();
  27581. r = n[n.length - 1]._getTableElement();
  27582. if (13 !== f || a.plugins.enterkey) h.data.preventDefault(), h.cancel();
  27583. if (36 < f && 41 > f) n[0].moveToElementEditablePosition(m ? q : r, !m), k.selectRanges([n[
  27584. 0]]);
  27585. else if (13 !== f || 13 === l || l === CKEDITOR.SHIFT + 13) {
  27586. for (h = 0; h < n.length; h++) b(n[h]);
  27587. (h = c(q, n)) ? n = h: n[0].moveToElementEditablePosition(q);
  27588. k.selectRanges(n);
  27589. 13 === f && a.plugins.enterkey ? (a.fire("lockSnapshot"), 13 === l ? a.execCommand(
  27590. "enter") : a.execCommand("shiftEnter"), a.fire("unlockSnapshot"), a.fire(
  27591. "saveSnapshot")) : 13 !== f && a.fire("saveSnapshot")
  27592. }
  27593. }
  27594. }
  27595. }(a), null, null, -1);
  27596. c.attachListener(c, "keypress", function(c) {
  27597. var e = a.getSelection(),
  27598. g = c.data.$.charCode || 13 === c.data.getKey(),
  27599. k;
  27600. if (!a.readOnly && e && e.isInTable() &&
  27601. e.isFake && g && !(c.data.getKeystroke() & CKEDITOR.CTRL)) {
  27602. c = e.getRanges();
  27603. g = c[0].getEnclosedNode().getAscendant({
  27604. td: 1,
  27605. th: 1
  27606. }, !0);
  27607. for (k = 0; k < c.length; k++) b(c[k]);
  27608. g && (c[0].moveToElementEditablePosition(g), e.selectRanges([c[0]]))
  27609. }
  27610. }, null, null, -1);
  27611. c.attachListener(c, "keyup", function(a) {
  27612. return function(b) {
  27613. b = b.data.getKey();
  27614. var c = a.getSelection();
  27615. 9 === b && c.isInTable() && E(a)
  27616. }
  27617. }(a), null, null, -1)
  27618. }
  27619. };
  27620. CKEDITOR.plugins.add("tableselection", {
  27621. requires: "clipboard,tabletools",
  27622. isSupportedEnvironment: function() {
  27623. return !(CKEDITOR.env.ie &&
  27624. 11 > CKEDITOR.env.version)
  27625. },
  27626. onLoad: function() {
  27627. y = CKEDITOR.plugins.tabletools;
  27628. v = y.getSelectedCells;
  27629. C = y.getCellColIndex;
  27630. G = y.insertRow;
  27631. H = y.insertColumn;
  27632. CKEDITOR.document.appendStyleSheet(this.path + "styles/tableselection.css")
  27633. },
  27634. init: function(a) {
  27635. this.isSupportedEnvironment() && (a.addContentsCss && a.addContentsCss(this.path +
  27636. "styles/tableselection.css"), a.on("contentDom", function() {
  27637. var b = a.editable(),
  27638. c = b.isInline() ? b : a.document,
  27639. d = {
  27640. editor: a
  27641. };
  27642. b.attachListener(c, "mousedown", w, null, d);
  27643. b.attachListener(c, "mousemove",
  27644. w, null, d);
  27645. b.attachListener(c, "mouseup", w, null, d);
  27646. b.attachListener(b, "dragstart", M);
  27647. b.attachListener(a, "selectionCheck", L);
  27648. CKEDITOR.plugins.tableselection.keyboardIntegration(a);
  27649. CKEDITOR.plugins.clipboard && !CKEDITOR.plugins.clipboard.isCustomCopyCutSupported && (b
  27650. .attachListener(b, "cut", F), b.attachListener(b, "copy", F))
  27651. }), a.on("paste", I.onPaste, I), B(a,
  27652. "rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter"
  27653. .split(" "),
  27654. function(a, c) {
  27655. t(a, c.selectedCells)
  27656. }),
  27657. B(a, ["cellMerge", "cellMergeRight", "cellMergeDown"], function(a, c) {
  27658. t(a, [c.commandData.cell])
  27659. }), B(a, ["cellDelete"], function(a) {
  27660. A(a, !0)
  27661. }))
  27662. }
  27663. })
  27664. })();
  27665. (function() {
  27666. function n(a, b) {
  27667. return CKEDITOR.tools.array.reduce(b, function(a, b) {
  27668. return b(a)
  27669. }, a)
  27670. }
  27671. var g = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90],
  27672. p = {
  27673. 8: 1,
  27674. 46: 1
  27675. };
  27676. CKEDITOR.plugins.add("undo", {
  27677. init: function(a) {
  27678. function b(a) {
  27679. d.enabled && !1 !== a.data.command.canUndo && d.save()
  27680. }
  27681. function c() {
  27682. d.enabled = a.readOnly ? !1 : "wysiwyg" == a.mode;
  27683. d.onChange()
  27684. }
  27685. var d = a.undoManager = new e(a),
  27686. l = d.editingHandler = new k(d),
  27687. f = a.addCommand("undo", {
  27688. exec: function() {
  27689. d.undo() && (a.selectionChange(), this.fire("afterUndo"))
  27690. },
  27691. startDisabled: !0,
  27692. canUndo: !1
  27693. }),
  27694. h = a.addCommand("redo", {
  27695. exec: function() {
  27696. d.redo() && (a.selectionChange(), this.fire("afterRedo"))
  27697. },
  27698. startDisabled: !0,
  27699. canUndo: !1
  27700. });
  27701. a.setKeystroke([
  27702. [g[0], "undo"],
  27703. [g[1], "redo"],
  27704. [g[2], "redo"]
  27705. ]);
  27706. d.onChange = function() {
  27707. f.setState(d.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  27708. h.setState(d.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  27709. };
  27710. a.on("beforeCommandExec", b);
  27711. a.on("afterCommandExec", b);
  27712. a.on("saveSnapshot", function(a) {
  27713. d.save(a.data && a.data.contentOnly)
  27714. });
  27715. a.on("contentDom", l.attachListeners, l);
  27716. a.on("instanceReady", function() {
  27717. a.fire("saveSnapshot")
  27718. });
  27719. a.on("beforeModeUnload", function() {
  27720. "wysiwyg" == a.mode && d.save(!0)
  27721. });
  27722. a.on("mode", c);
  27723. a.on("readOnly", c);
  27724. a.ui.addButton && (a.ui.addButton("Undo", {
  27725. label: a.lang.undo.undo,
  27726. command: "undo",
  27727. toolbar: "undo,10"
  27728. }), a.ui.addButton("Redo", {
  27729. label: a.lang.undo.redo,
  27730. command: "redo",
  27731. toolbar: "undo,20"
  27732. }));
  27733. a.resetUndo = function() {
  27734. d.reset();
  27735. a.fire("saveSnapshot")
  27736. };
  27737. a.on("updateSnapshot", function() {
  27738. d.currentImage && d.update()
  27739. });
  27740. a.on("lockSnapshot",
  27741. function(a) {
  27742. a = a.data;
  27743. d.lock(a && a.dontUpdate, a && a.forceUpdate)
  27744. });
  27745. a.on("unlockSnapshot", d.unlock, d)
  27746. }
  27747. });
  27748. CKEDITOR.plugins.undo = {};
  27749. var e = CKEDITOR.plugins.undo.UndoManager = function(a) {
  27750. this.strokesRecorded = [0, 0];
  27751. this.locked = null;
  27752. this.previousKeyGroup = -1;
  27753. this.limit = a.config.undoStackSize || 20;
  27754. this.strokesLimit = 25;
  27755. this._filterRules = [];
  27756. this.editor = a;
  27757. this.reset();
  27758. CKEDITOR.env.ie && this.addFilterRule(function(a) {
  27759. return a.replace(/\s+data-cke-expando=".*?"/g, "")
  27760. })
  27761. };
  27762. e.prototype = {
  27763. type: function(a, b) {
  27764. var c = e.getKeyGroup(a),
  27765. d = this.strokesRecorded[c] + 1;
  27766. b = b || d >= this.strokesLimit;
  27767. this.typing || (this.hasUndo = this.typing = !0, this.hasRedo = !1, this.onChange());
  27768. b ? (d = 0, this.editor.fire("saveSnapshot")) : this.editor.fire("change");
  27769. this.strokesRecorded[c] = d;
  27770. this.previousKeyGroup = c
  27771. },
  27772. keyGroupChanged: function(a) {
  27773. return e.getKeyGroup(a) != this.previousKeyGroup
  27774. },
  27775. reset: function() {
  27776. this.snapshots = [];
  27777. this.index = -1;
  27778. this.currentImage = null;
  27779. this.hasRedo = this.hasUndo = !1;
  27780. this.locked = null;
  27781. this.resetType()
  27782. },
  27783. resetType: function() {
  27784. this.strokesRecorded = [0, 0];
  27785. this.typing = !1;
  27786. this.previousKeyGroup = -1
  27787. },
  27788. refreshState: function() {
  27789. this.hasUndo = !!this.getNextImage(!0);
  27790. this.hasRedo = !!this.getNextImage(!1);
  27791. this.resetType();
  27792. this.onChange()
  27793. },
  27794. save: function(a, b, c) {
  27795. var d = this.editor;
  27796. if (this.locked || "ready" != d.status || "wysiwyg" != d.mode) return !1;
  27797. var e = d.editable();
  27798. if (!e || "ready" != e.status) return !1;
  27799. e = this.snapshots;
  27800. b || (b = new f(d));
  27801. if (!1 === b.contents) return !1;
  27802. if (this.currentImage)
  27803. if (b.equalsContent(this.currentImage)) {
  27804. if (a || b.equalsSelection(this.currentImage)) return !1
  27805. } else !1 !==
  27806. c && d.fire("change");
  27807. e.splice(this.index + 1, e.length - this.index - 1);
  27808. e.length == this.limit && e.shift();
  27809. this.index = e.push(b) - 1;
  27810. this.currentImage = b;
  27811. !1 !== c && this.refreshState();
  27812. return !0
  27813. },
  27814. restoreImage: function(a) {
  27815. var b = this.editor,
  27816. c;
  27817. a.bookmarks && (b.focus(), c = b.getSelection());
  27818. this.locked = {
  27819. level: 999
  27820. };
  27821. this.editor.loadSnapshot(a.contents);
  27822. a.bookmarks ? c.selectBookmarks(a.bookmarks) : CKEDITOR.env.ie && (c = this.editor.document.getBody().$
  27823. .createTextRange(), c.collapse(!0), c.select());
  27824. this.locked = null;
  27825. this.index = a.index;
  27826. this.currentImage = this.snapshots[this.index];
  27827. this.update();
  27828. this.refreshState();
  27829. b.fire("change")
  27830. },
  27831. getNextImage: function(a) {
  27832. var b = this.snapshots,
  27833. c = this.currentImage,
  27834. d;
  27835. if (c)
  27836. if (a)
  27837. for (d = this.index - 1; 0 <= d; d--) {
  27838. if (a = b[d], !c.equalsContent(a)) return a.index = d, a
  27839. } else
  27840. for (d = this.index + 1; d < b.length; d++)
  27841. if (a = b[d], !c.equalsContent(a)) return a.index = d, a;
  27842. return null
  27843. },
  27844. redoable: function() {
  27845. return this.enabled && this.hasRedo
  27846. },
  27847. undoable: function() {
  27848. return this.enabled && this.hasUndo
  27849. },
  27850. undo: function() {
  27851. if (this.undoable()) {
  27852. this.save(!0);
  27853. var a = this.getNextImage(!0);
  27854. if (a) return this.restoreImage(a), !0
  27855. }
  27856. return !1
  27857. },
  27858. redo: function() {
  27859. if (this.redoable() && (this.save(!0), this.redoable())) {
  27860. var a = this.getNextImage(!1);
  27861. if (a) return this.restoreImage(a), !0
  27862. }
  27863. return !1
  27864. },
  27865. update: function(a) {
  27866. if (!this.locked) {
  27867. a || (a = new f(this.editor));
  27868. for (var b = this.index, c = this.snapshots; 0 < b && this.currentImage.equalsContent(c[b - 1]);) --b;
  27869. c.splice(b, this.index - b + 1, a);
  27870. this.index = b;
  27871. this.currentImage = a
  27872. }
  27873. },
  27874. updateSelection: function(a) {
  27875. if (!this.snapshots.length) return !1;
  27876. var b = this.snapshots,
  27877. c = b[b.length - 1];
  27878. return c.equalsContent(a) && !c.equalsSelection(a) ? (this.currentImage = b[b.length - 1] = a, !0) : !1
  27879. },
  27880. lock: function(a, b) {
  27881. if (this.locked) this.locked.level++;
  27882. else if (a) this.locked = {
  27883. level: 1
  27884. };
  27885. else {
  27886. var c = null;
  27887. if (b) c = !0;
  27888. else {
  27889. var d = new f(this.editor, !0);
  27890. this.currentImage && this.currentImage.equalsContent(d) && (c = d)
  27891. }
  27892. this.locked = {
  27893. update: c,
  27894. level: 1
  27895. }
  27896. }
  27897. },
  27898. unlock: function() {
  27899. if (this.locked && !--this.locked.level) {
  27900. var a = this.locked.update;
  27901. this.locked = null;
  27902. if (!0 === a) this.update();
  27903. else if (a) {
  27904. var b = new f(this.editor,
  27905. !0);
  27906. a.equalsContent(b) || this.update()
  27907. }
  27908. }
  27909. },
  27910. addFilterRule: function(a) {
  27911. this._filterRules.push(a)
  27912. }
  27913. };
  27914. e.navigationKeyCodes = {
  27915. 37: 1,
  27916. 38: 1,
  27917. 39: 1,
  27918. 40: 1,
  27919. 36: 1,
  27920. 35: 1,
  27921. 33: 1,
  27922. 34: 1
  27923. };
  27924. e.keyGroups = {
  27925. PRINTABLE: 0,
  27926. FUNCTIONAL: 1
  27927. };
  27928. e.isNavigationKey = function(a) {
  27929. return !!e.navigationKeyCodes[a]
  27930. };
  27931. e.getKeyGroup = function(a) {
  27932. var b = e.keyGroups;
  27933. return p[a] ? b.FUNCTIONAL : b.PRINTABLE
  27934. };
  27935. e.getOppositeKeyGroup = function(a) {
  27936. var b = e.keyGroups;
  27937. return a == b.FUNCTIONAL ? b.PRINTABLE : b.FUNCTIONAL
  27938. };
  27939. e.ieFunctionalKeysBug = function(a) {
  27940. return CKEDITOR.env.ie &&
  27941. e.getKeyGroup(a) == e.keyGroups.FUNCTIONAL
  27942. };
  27943. var f = CKEDITOR.plugins.undo.Image = function(a, b) {
  27944. this.editor = a;
  27945. a.fire("beforeUndoImage");
  27946. var c = a.getSnapshot();
  27947. c && (this.contents = n(c, a.undoManager._filterRules));
  27948. b || (this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(!0));
  27949. a.fire("afterUndoImage")
  27950. },
  27951. h = /\b(?:href|src|name)="[^"]*?"/gi;
  27952. f.prototype = {
  27953. equalsContent: function(a) {
  27954. var b = this.contents;
  27955. a = a.contents;
  27956. CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) && (b = b.replace(h, ""), a = a
  27957. .replace(h,
  27958. ""));
  27959. return b != a ? !1 : !0
  27960. },
  27961. equalsSelection: function(a) {
  27962. var b = this.bookmarks;
  27963. a = a.bookmarks;
  27964. if (b || a) {
  27965. if (!b || !a || b.length != a.length) return !1;
  27966. for (var c = 0; c < b.length; c++) {
  27967. var d = b[c],
  27968. e = a[c];
  27969. if (d.startOffset != e.startOffset || d.endOffset != e.endOffset || !CKEDITOR.tools.arrayCompare(d
  27970. .start, e.start) || !CKEDITOR.tools.arrayCompare(d.end, e.end)) return !1
  27971. }
  27972. }
  27973. return !0
  27974. }
  27975. };
  27976. var k = CKEDITOR.plugins.undo.NativeEditingHandler = function(a) {
  27977. this.undoManager = a;
  27978. this.ignoreInputEvent = !1;
  27979. this.keyEventsStack = new m;
  27980. this.lastKeydownImage =
  27981. null
  27982. };
  27983. k.prototype = {
  27984. onKeydown: function(a) {
  27985. var b = a.data.getKey();
  27986. if (229 !== b)
  27987. if (-1 < CKEDITOR.tools.indexOf(g, a.data.getKeystroke())) a.data.preventDefault();
  27988. else if (this.keyEventsStack.cleanUp(a), a = this.undoManager, this.keyEventsStack.getLast(b) || this
  27989. .keyEventsStack.push(b), this.lastKeydownImage = new f(a.editor), e.isNavigationKey(b) || this
  27990. .undoManager.keyGroupChanged(b))
  27991. if (a.strokesRecorded[0] || a.strokesRecorded[1]) a.save(!1, this.lastKeydownImage, !1), a.resetType()
  27992. },
  27993. onInput: function() {
  27994. if (this.ignoreInputEvent) this.ignoreInputEvent = !1;
  27995. else {
  27996. var a = this.keyEventsStack.getLast();
  27997. a || (a = this.keyEventsStack.push(0));
  27998. this.keyEventsStack.increment(a.keyCode);
  27999. this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit && (this.undoManager.type(a
  28000. .keyCode, !0), this.keyEventsStack.resetInputs())
  28001. }
  28002. },
  28003. onKeyup: function(a) {
  28004. var b = this.undoManager;
  28005. a = a.data.getKey();
  28006. var c = this.keyEventsStack.getTotalInputs();
  28007. this.keyEventsStack.remove(a);
  28008. if (!(e.ieFunctionalKeysBug(a) && this.lastKeydownImage && this.lastKeydownImage.equalsContent(new f(b
  28009. .editor,
  28010. !0))))
  28011. if (0 < c) b.type(a);
  28012. else if (e.isNavigationKey(a)) this.onNavigationKey(!0)
  28013. },
  28014. onNavigationKey: function(a) {
  28015. var b = this.undoManager;
  28016. !a && b.save(!0, null, !1) || b.updateSelection(new f(b.editor));
  28017. b.resetType()
  28018. },
  28019. ignoreInputEventListener: function() {
  28020. this.ignoreInputEvent = !0
  28021. },
  28022. activateInputEventListener: function() {
  28023. this.ignoreInputEvent = !1
  28024. },
  28025. attachListeners: function() {
  28026. var a = this.undoManager.editor,
  28027. b = a.editable(),
  28028. c = this;
  28029. b.attachListener(b, "keydown", function(a) {
  28030. c.onKeydown(a);
  28031. if (e.ieFunctionalKeysBug(a.data.getKey())) c.onInput()
  28032. },
  28033. null, null, 999);
  28034. b.attachListener(b, CKEDITOR.env.ie ? "keypress" : "input", c.onInput, c, null, 999);
  28035. b.attachListener(b, "keyup", c.onKeyup, c, null, 999);
  28036. b.attachListener(b, "paste", c.ignoreInputEventListener, c, null, 999);
  28037. b.attachListener(b, "drop", c.ignoreInputEventListener, c, null, 999);
  28038. a.on("afterPaste", c.activateInputEventListener, c, null, 999);
  28039. b.attachListener(b.isInline() ? b : a.document.getDocumentElement(), "click", function() {
  28040. c.onNavigationKey()
  28041. }, null, null, 999);
  28042. b.attachListener(this.undoManager.editor, "blur", function() {
  28043. c.keyEventsStack.remove(9)
  28044. },
  28045. null, null, 999)
  28046. }
  28047. };
  28048. var m = CKEDITOR.plugins.undo.KeyEventsStack = function() {
  28049. this.stack = []
  28050. };
  28051. m.prototype = {
  28052. push: function(a) {
  28053. a = this.stack.push({
  28054. keyCode: a,
  28055. inputs: 0
  28056. });
  28057. return this.stack[a - 1]
  28058. },
  28059. getLastIndex: function(a) {
  28060. if ("number" != typeof a) return this.stack.length - 1;
  28061. for (var b = this.stack.length; b--;)
  28062. if (this.stack[b].keyCode == a) return b;
  28063. return -1
  28064. },
  28065. getLast: function(a) {
  28066. a = this.getLastIndex(a);
  28067. return -1 != a ? this.stack[a] : null
  28068. },
  28069. increment: function(a) {
  28070. this.getLast(a).inputs++
  28071. },
  28072. remove: function(a) {
  28073. a = this.getLastIndex(a); - 1 !=
  28074. a && this.stack.splice(a, 1)
  28075. },
  28076. resetInputs: function(a) {
  28077. if ("number" == typeof a) this.getLast(a).inputs = 0;
  28078. else
  28079. for (a = this.stack.length; a--;) this.stack[a].inputs = 0
  28080. },
  28081. getTotalInputs: function() {
  28082. for (var a = this.stack.length, b = 0; a--;) b += this.stack[a].inputs;
  28083. return b
  28084. },
  28085. cleanUp: function(a) {
  28086. a = a.data.$;
  28087. a.ctrlKey || a.metaKey || this.remove(17);
  28088. a.shiftKey || this.remove(16);
  28089. a.altKey || this.remove(18)
  28090. }
  28091. }
  28092. })();
  28093. (function() {
  28094. function m(a, d) {
  28095. CKEDITOR.tools.extend(this, {
  28096. editor: a,
  28097. editable: a.editable(),
  28098. doc: a.document,
  28099. win: a.window
  28100. }, d, !0);
  28101. this.inline = this.editable.isInline();
  28102. this.inline || (this.frame = this.win.getFrame());
  28103. this.target = this[this.inline ? "editable" : "doc"]
  28104. }
  28105. function n(a, d) {
  28106. CKEDITOR.tools.extend(this, d, {
  28107. editor: a
  28108. }, !0)
  28109. }
  28110. function p(a, d) {
  28111. var b = a.editable();
  28112. CKEDITOR.tools.extend(this, {
  28113. editor: a,
  28114. editable: b,
  28115. inline: b.isInline(),
  28116. doc: a.document,
  28117. win: a.window,
  28118. container: CKEDITOR.document.getBody(),
  28119. winTop: CKEDITOR.document.getWindow()
  28120. },
  28121. d, !0);
  28122. this.hidden = {};
  28123. this.visible = {};
  28124. this.inline || (this.frame = this.win.getFrame());
  28125. this.queryViewport();
  28126. var c = CKEDITOR.tools.bind(this.queryViewport, this),
  28127. e = CKEDITOR.tools.bind(this.hideVisible, this),
  28128. g = CKEDITOR.tools.bind(this.removeAll, this);
  28129. b.attachListener(this.winTop, "resize", c);
  28130. b.attachListener(this.winTop, "scroll", c);
  28131. b.attachListener(this.winTop, "resize", e);
  28132. b.attachListener(this.win, "scroll", e);
  28133. b.attachListener(this.inline ? b : this.frame, "mouseout", function(a) {
  28134. var b = a.data.$.clientX;
  28135. a = a.data.$.clientY;
  28136. this.queryViewport();
  28137. (b <= this.rect.left || b >= this.rect.right || a <= this.rect.top || a >= this.rect.bottom) && this
  28138. .hideVisible();
  28139. (0 >= b || b >= this.winTopPane.width || 0 >= a || a >= this.winTopPane.height) && this.hideVisible()
  28140. }, this);
  28141. b.attachListener(a, "resize", c);
  28142. b.attachListener(a, "mode", g);
  28143. a.on("destroy", g);
  28144. this.lineTpl = (new CKEDITOR.template(
  28145. '\x3cdiv data-cke-lineutils-line\x3d"1" class\x3d"cke_reset_all" style\x3d"{lineStyle}"\x3e\x3cspan style\x3d"{tipLeftStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3cspan style\x3d"{tipRightStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3c/div\x3e'
  28146. )).output({
  28147. lineStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},
  28148. t, this.lineStyle, !0)),
  28149. tipLeftStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, {
  28150. left: "0px",
  28151. "border-left-color": "red",
  28152. "border-width": "6px 0 6px 6px"
  28153. }, this.tipCss, this.tipLeftStyle, !0)),
  28154. tipRightStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, {
  28155. right: "0px",
  28156. "border-right-color": "red",
  28157. "border-width": "6px 6px 6px 0"
  28158. }, this.tipCss, this.tipRightStyle, !0))
  28159. })
  28160. }
  28161. function l(a) {
  28162. var d;
  28163. if (d = a && a.type == CKEDITOR.NODE_ELEMENT) d = !(r[a.getComputedStyle("float")] || r[a.getAttribute(
  28164. "align")]);
  28165. return d &&
  28166. !u[a.getComputedStyle("position")]
  28167. }
  28168. CKEDITOR.plugins.add("lineutils");
  28169. CKEDITOR.LINEUTILS_BEFORE = 1;
  28170. CKEDITOR.LINEUTILS_AFTER = 2;
  28171. CKEDITOR.LINEUTILS_INSIDE = 4;
  28172. m.prototype = {
  28173. start: function(a) {
  28174. var d = this,
  28175. b = this.editor,
  28176. c = this.doc,
  28177. e, g, f, h, k = CKEDITOR.tools.eventsBuffer(50, function() {
  28178. b.readOnly || "wysiwyg" != b.mode || (d.relations = {}, (g = c.$.elementFromPoint(f, h)) && g
  28179. .nodeType && (e = new CKEDITOR.dom.element(g), d.traverseSearch(e), isNaN(f + h) || d
  28180. .pixelSearch(e, f, h), a && a(d.relations, f, h)))
  28181. });
  28182. this.listener = this.editable.attachListener(this.target,
  28183. "mousemove",
  28184. function(a) {
  28185. f = a.data.$.clientX;
  28186. h = a.data.$.clientY;
  28187. k.input()
  28188. });
  28189. this.editable.attachListener(this.inline ? this.editable : this.frame, "mouseout", function() {
  28190. k.reset()
  28191. })
  28192. },
  28193. stop: function() {
  28194. this.listener && this.listener.removeListener()
  28195. },
  28196. getRange: function() {
  28197. var a = {};
  28198. a[CKEDITOR.LINEUTILS_BEFORE] = CKEDITOR.POSITION_BEFORE_START;
  28199. a[CKEDITOR.LINEUTILS_AFTER] = CKEDITOR.POSITION_AFTER_END;
  28200. a[CKEDITOR.LINEUTILS_INSIDE] = CKEDITOR.POSITION_AFTER_START;
  28201. return function(d) {
  28202. var b = this.editor.createRange();
  28203. b.moveToPosition(this.relations[d.uid].element,
  28204. a[d.type]);
  28205. return b
  28206. }
  28207. }(),
  28208. store: function() {
  28209. function a(a, b, c) {
  28210. var e = a.getUniqueId();
  28211. e in c ? c[e].type |= b : c[e] = {
  28212. element: a,
  28213. type: b
  28214. }
  28215. }
  28216. return function(d, b) {
  28217. var c;
  28218. b & CKEDITOR.LINEUTILS_AFTER && l(c = d.getNext()) && c.isVisible() && (a(c, CKEDITOR
  28219. .LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_AFTER);
  28220. b & CKEDITOR.LINEUTILS_INSIDE && l(c = d.getFirst()) && c.isVisible() && (a(c, CKEDITOR
  28221. .LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_INSIDE);
  28222. a(d, b, this.relations)
  28223. }
  28224. }(),
  28225. traverseSearch: function(a) {
  28226. var d, b, c;
  28227. do
  28228. if (c = a.$["data-cke-expando"],
  28229. !(c && c in this.relations)) {
  28230. if (a.equals(this.editable)) break;
  28231. if (l(a))
  28232. for (d in this.lookups)(b = this.lookups[d](a)) && this.store(a, b)
  28233. } while ((!a || a.type != CKEDITOR.NODE_ELEMENT || "true" != a.getAttribute("contenteditable")) && (
  28234. a = a.getParent()))
  28235. },
  28236. pixelSearch: function() {
  28237. function a(a, c, e, g, f) {
  28238. for (var h = 0, k; f(e);) {
  28239. e += g;
  28240. if (25 == ++h) break;
  28241. if (k = this.doc.$.elementFromPoint(c, e))
  28242. if (k == a) h = 0;
  28243. else if (d(a, k) && (h = 0, l(k = new CKEDITOR.dom.element(k)))) return k
  28244. }
  28245. }
  28246. var d = CKEDITOR.env.ie || CKEDITOR.env.webkit ? function(a, c) {
  28247. return a.contains(c)
  28248. } :
  28249. function(a, c) {
  28250. return !!(a.compareDocumentPosition(c) & 16)
  28251. };
  28252. return function(b, c, d) {
  28253. var g = this.win.getViewPaneSize().height,
  28254. f = a.call(this, b.$, c, d, -1, function(a) {
  28255. return 0 < a
  28256. });
  28257. c = a.call(this, b.$, c, d, 1, function(a) {
  28258. return a < g
  28259. });
  28260. if (f)
  28261. for (this.traverseSearch(f); !f.getParent().equals(b);) f = f.getParent();
  28262. if (c)
  28263. for (this.traverseSearch(c); !c.getParent().equals(b);) c = c.getParent();
  28264. for (; f || c;) {
  28265. f && (f = f.getNext(l));
  28266. if (!f || f.equals(c)) break;
  28267. this.traverseSearch(f);
  28268. c && (c = c.getPrevious(l));
  28269. if (!c || c.equals(f)) break;
  28270. this.traverseSearch(c)
  28271. }
  28272. }
  28273. }(),
  28274. greedySearch: function() {
  28275. this.relations = {};
  28276. for (var a = this.editable.getElementsByTag("*"), d = 0, b, c, e; b = a.getItem(d++);)
  28277. if (!b.equals(this.editable) && b.type == CKEDITOR.NODE_ELEMENT && (b.hasAttribute(
  28278. "contenteditable") || !b.isReadOnly()) && l(b) && b.isVisible())
  28279. for (e in this.lookups)(c = this.lookups[e](b)) && this.store(b, c);
  28280. return this.relations
  28281. }
  28282. };
  28283. n.prototype = {
  28284. locate: function() {
  28285. function a(a, b) {
  28286. var c = a.element[b === CKEDITOR.LINEUTILS_BEFORE ? "getPrevious" : "getNext"]();
  28287. return c && l(c) ? (a.siblingRect = c.getClientRect(),
  28288. b == CKEDITOR.LINEUTILS_BEFORE ? (a.siblingRect.bottom + a.elementRect.top) / 2 : (a.elementRect
  28289. .bottom + a.siblingRect.top) / 2) : b == CKEDITOR.LINEUTILS_BEFORE ? a.elementRect.top : a
  28290. .elementRect.bottom
  28291. }
  28292. return function(d) {
  28293. var b;
  28294. this.locations = {};
  28295. for (var c in d) b = d[c], b.elementRect = b.element.getClientRect(), b.type & CKEDITOR
  28296. .LINEUTILS_BEFORE && this.store(c, CKEDITOR.LINEUTILS_BEFORE, a(b, CKEDITOR.LINEUTILS_BEFORE)), b
  28297. .type & CKEDITOR.LINEUTILS_AFTER && this.store(c, CKEDITOR.LINEUTILS_AFTER, a(b, CKEDITOR
  28298. .LINEUTILS_AFTER)), b.type &
  28299. CKEDITOR.LINEUTILS_INSIDE && this.store(c, CKEDITOR.LINEUTILS_INSIDE, (b.elementRect.top + b
  28300. .elementRect.bottom) / 2);
  28301. return this.locations
  28302. }
  28303. }(),
  28304. sort: function() {
  28305. var a, d, b, c;
  28306. return function(e, g) {
  28307. a = this.locations;
  28308. d = [];
  28309. for (var f in a)
  28310. for (var h in a[f])
  28311. if (b = Math.abs(e - a[f][h]), d.length) {
  28312. for (c = 0; c < d.length; c++)
  28313. if (b < d[c].dist) {
  28314. d.splice(c, 0, {
  28315. uid: +f,
  28316. type: h,
  28317. dist: b
  28318. });
  28319. break
  28320. } c == d.length && d.push({
  28321. uid: +f,
  28322. type: h,
  28323. dist: b
  28324. })
  28325. } else d.push({
  28326. uid: +f,
  28327. type: h,
  28328. dist: b
  28329. });
  28330. return "undefined" != typeof g ? d.slice(0, g) : d
  28331. }
  28332. }(),
  28333. store: function(a,
  28334. d, b) {
  28335. this.locations[a] || (this.locations[a] = {});
  28336. this.locations[a][d] = b
  28337. }
  28338. };
  28339. var q = {
  28340. display: "block",
  28341. width: "0px",
  28342. height: "0px",
  28343. "border-color": "transparent",
  28344. "border-style": "solid",
  28345. position: "absolute",
  28346. top: "-6px"
  28347. },
  28348. t = {
  28349. height: "0px",
  28350. "border-top": "1px dashed red",
  28351. position: "absolute",
  28352. "z-index": 9999
  28353. };
  28354. p.prototype = {
  28355. removeAll: function() {
  28356. for (var a in this.hidden) this.hidden[a].remove(), delete this.hidden[a];
  28357. for (a in this.visible) this.visible[a].remove(), delete this.visible[a]
  28358. },
  28359. hideLine: function(a) {
  28360. var d = a.getUniqueId();
  28361. a.hide();
  28362. this.hidden[d] = a;
  28363. delete this.visible[d]
  28364. },
  28365. showLine: function(a) {
  28366. var d = a.getUniqueId();
  28367. a.show();
  28368. this.visible[d] = a;
  28369. delete this.hidden[d]
  28370. },
  28371. hideVisible: function() {
  28372. for (var a in this.visible) this.hideLine(this.visible[a])
  28373. },
  28374. placeLine: function(a, d) {
  28375. var b, c, e;
  28376. if (b = this.getStyle(a.uid, a.type)) {
  28377. for (e in this.visible)
  28378. if (this.visible[e].getCustomData("hash") !== this.hash) {
  28379. c = this.visible[e];
  28380. break
  28381. } if (!c)
  28382. for (e in this.hidden)
  28383. if (this.hidden[e].getCustomData("hash") !== this.hash) {
  28384. this.showLine(c = this.hidden[e]);
  28385. break
  28386. } c || this.showLine(c = this.addLine());
  28387. c.setCustomData("hash", this.hash);
  28388. this.visible[c.getUniqueId()] = c;
  28389. c.setStyles(b);
  28390. d && d(c)
  28391. }
  28392. },
  28393. getStyle: function(a, d) {
  28394. var b = this.relations[a],
  28395. c = this.locations[a][d],
  28396. e = {};
  28397. e.width = b.siblingRect ? Math.max(b.siblingRect.width, b.elementRect.width) : b.elementRect.width;
  28398. e.top = this.inline ? c + this.winTopScroll.y - this.rect.relativeY : this.rect.top + this.winTopScroll
  28399. .y + c;
  28400. if (e.top - this.winTopScroll.y < this.rect.top || e.top - this.winTopScroll.y > this.rect.bottom)
  28401. return !1;
  28402. this.inline ?
  28403. e.left = b.elementRect.left - this.rect.relativeX : (0 < b.elementRect.left ? e.left = this.rect
  28404. .left + b.elementRect.left : (e.width += b.elementRect.left, e.left = this.rect.left), 0 < (b = e
  28405. .left + e.width - (this.rect.left + this.winPane.width)) && (e.width -= b));
  28406. e.left += this.winTopScroll.x;
  28407. for (var g in e) e[g] = CKEDITOR.tools.cssLength(e[g]);
  28408. return e
  28409. },
  28410. addLine: function() {
  28411. var a = CKEDITOR.dom.element.createFromHtml(this.lineTpl);
  28412. a.appendTo(this.container);
  28413. return a
  28414. },
  28415. prepare: function(a, d) {
  28416. this.relations = a;
  28417. this.locations = d;
  28418. this.hash = Math.random()
  28419. },
  28420. cleanup: function() {
  28421. var a, d;
  28422. for (d in this.visible) a = this.visible[d], a.getCustomData("hash") !== this.hash && this.hideLine(a)
  28423. },
  28424. queryViewport: function() {
  28425. this.winPane = this.win.getViewPaneSize();
  28426. this.winTopScroll = this.winTop.getScrollPosition();
  28427. this.winTopPane = this.winTop.getViewPaneSize();
  28428. this.rect = this.getClientRect(this.inline ? this.editable : this.frame)
  28429. },
  28430. getClientRect: function(a) {
  28431. a = a.getClientRect();
  28432. var d = this.container.getDocumentPosition(),
  28433. b = this.container.getComputedStyle("position");
  28434. a.relativeX = a.relativeY =
  28435. 0;
  28436. "static" != b && (a.relativeY = d.y, a.relativeX = d.x, a.top -= a.relativeY, a.bottom -= a.relativeY, a
  28437. .left -= a.relativeX, a.right -= a.relativeX);
  28438. return a
  28439. }
  28440. };
  28441. var r = {
  28442. left: 1,
  28443. right: 1,
  28444. center: 1
  28445. },
  28446. u = {
  28447. absolute: 1,
  28448. fixed: 1
  28449. };
  28450. CKEDITOR.plugins.lineutils = {
  28451. finder: m,
  28452. locator: n,
  28453. liner: p
  28454. }
  28455. })();
  28456. (function() {
  28457. function e(a) {
  28458. return a.getName && !a.hasAttribute("data-cke-temp")
  28459. }
  28460. CKEDITOR.plugins.add("widgetselection", {
  28461. init: function(a) {
  28462. if (CKEDITOR.env.webkit) {
  28463. var b = CKEDITOR.plugins.widgetselection;
  28464. a.on("contentDom", function(a) {
  28465. a = a.editor;
  28466. var c = a.editable();
  28467. c.attachListener(c, "keydown", function(a) {
  28468. a.data.getKeystroke() == CKEDITOR.CTRL + 65 && CKEDITOR.tools.setTimeout(function() {
  28469. b.addFillers(c) || b.removeFillers(c)
  28470. }, 0)
  28471. }, null, null, -1);
  28472. a.on("selectionCheck", function(a) {
  28473. b.removeFillers(a.editor.editable())
  28474. });
  28475. a.on("paste", function(a) {
  28476. a.data.dataValue = b.cleanPasteData(a.data.dataValue)
  28477. });
  28478. "selectall" in a.plugins && b.addSelectAllIntegration(a)
  28479. })
  28480. }
  28481. }
  28482. });
  28483. CKEDITOR.plugins.widgetselection = {
  28484. startFiller: null,
  28485. endFiller: null,
  28486. fillerAttribute: "data-cke-filler-webkit",
  28487. fillerContent: "\x26nbsp;",
  28488. fillerTagName: "div",
  28489. addFillers: function(a) {
  28490. var b = a.editor;
  28491. if (!this.isWholeContentSelected(a) && 0 < a.getChildCount()) {
  28492. var d = a.getFirst(e),
  28493. c = a.getLast(e);
  28494. d && d.type == CKEDITOR.NODE_ELEMENT && !d.isEditable() && (this.startFiller = this.createFiller(),
  28495. a.append(this.startFiller, 1));
  28496. c && c.type == CKEDITOR.NODE_ELEMENT && !c.isEditable() && (this.endFiller = this.createFiller(!0), a
  28497. .append(this.endFiller, 0));
  28498. if (this.hasFiller(a)) return b = b.createRange(), b.selectNodeContents(a), b.select(), !0
  28499. }
  28500. return !1
  28501. },
  28502. removeFillers: function(a) {
  28503. if (this.hasFiller(a) && !this.isWholeContentSelected(a)) {
  28504. var b = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dstart]"),
  28505. d = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dend]");
  28506. this.startFiller && b && this.startFiller.equals(b) ?
  28507. this.removeFiller(this.startFiller, a) : this.startFiller = b;
  28508. this.endFiller && d && this.endFiller.equals(d) ? this.removeFiller(this.endFiller, a) : this
  28509. .endFiller = d
  28510. }
  28511. },
  28512. cleanPasteData: function(a) {
  28513. a && a.length && (a = a.replace(this.createFillerRegex(), "").replace(this.createFillerRegex(!0), ""));
  28514. return a
  28515. },
  28516. isWholeContentSelected: function(a) {
  28517. var b = a.editor.getSelection().getRanges()[0];
  28518. return !b || b && b.collapsed ? !1 : (b = b.clone(), b.enlarge(CKEDITOR.ENLARGE_ELEMENT), !!(b && a && b
  28519. .startContainer && b.endContainer && 0 === b.startOffset &&
  28520. b.endOffset === a.getChildCount() && b.startContainer.equals(a) && b.endContainer.equals(a)))
  28521. },
  28522. hasFiller: function(a) {
  28523. return 0 < a.find(this.fillerTagName + "[" + this.fillerAttribute + "]").count()
  28524. },
  28525. createFiller: function(a) {
  28526. var b = new CKEDITOR.dom.element(this.fillerTagName);
  28527. b.setHtml(this.fillerContent);
  28528. b.setAttribute(this.fillerAttribute, a ? "end" : "start");
  28529. b.setAttribute("data-cke-temp", 1);
  28530. b.setStyles({
  28531. display: "block",
  28532. width: 0,
  28533. height: 0,
  28534. padding: 0,
  28535. border: 0,
  28536. margin: 0,
  28537. position: "absolute",
  28538. top: 0,
  28539. left: "-9999px",
  28540. opacity: 0,
  28541. overflow: "hidden"
  28542. });
  28543. return b
  28544. },
  28545. removeFiller: function(a, b) {
  28546. if (a) {
  28547. var d = b.editor,
  28548. c = b.editor.getSelection().getRanges()[0].startPath(),
  28549. f = d.createRange(),
  28550. g, e;
  28551. c.contains(a) && (g = a.getHtml(), e = !0);
  28552. c = "start" == a.getAttribute(this.fillerAttribute);
  28553. a.remove();
  28554. g && 0 < g.length && g != this.fillerContent ? (b.insertHtmlIntoRange(g, d.getSelection().getRanges()[
  28555. 0]), f.setStartAt(b.getChild(b.getChildCount() - 1), CKEDITOR.POSITION_BEFORE_END), d
  28556. .getSelection().selectRanges([f])) : e && (c ? f.setStartAt(b.getFirst().getNext(), CKEDITOR
  28557. .POSITION_AFTER_START) :
  28558. f.setEndAt(b.getLast().getPrevious(), CKEDITOR.POSITION_BEFORE_END), b.editor.getSelection()
  28559. .selectRanges([f]))
  28560. }
  28561. },
  28562. createFillerRegex: function(a) {
  28563. var b = this.createFiller(a).getOuterHtml().replace(/style="[^"]*"/gi, 'style\x3d"[^"]*"').replace(
  28564. />[^<]*</gi, "\x3e[^\x3c]*\x3c");
  28565. return new RegExp((a ? "" : "^") + b + (a ? "$" : ""))
  28566. },
  28567. addSelectAllIntegration: function(a) {
  28568. var b = this;
  28569. a.editable().attachListener(a, "beforeCommandExec", function(d) {
  28570. var c = a.editable();
  28571. "selectAll" == d.data.name && c && b.addFillers(c)
  28572. }, null, null, 9999)
  28573. }
  28574. }
  28575. })();
  28576. (function() {
  28577. function q(a) {
  28578. this.editor = a;
  28579. this.registered = {};
  28580. this.instances = {};
  28581. this.selected = [];
  28582. this.widgetHoldingFocusedEditable = this.focused = null;
  28583. this._ = {
  28584. nextId: 0,
  28585. upcasts: [],
  28586. upcastCallbacks: [],
  28587. filters: {}
  28588. };
  28589. R(this);
  28590. S(this);
  28591. this.on("checkWidgets", T);
  28592. this.editor.on("contentDomInvalidated", this.checkWidgets, this);
  28593. U(this);
  28594. V(this);
  28595. W(this);
  28596. X(this);
  28597. Y(this)
  28598. }
  28599. function h(a, b, c, d, e) {
  28600. var f = a.editor;
  28601. CKEDITOR.tools.extend(this, d, {
  28602. editor: f,
  28603. id: b,
  28604. inline: "span" == c.getParent().getName(),
  28605. element: c,
  28606. data: CKEDITOR.tools.extend({},
  28607. "function" == typeof d.defaults ? d.defaults() : d.defaults),
  28608. dataReady: !1,
  28609. inited: !1,
  28610. ready: !1,
  28611. edit: h.prototype.edit,
  28612. focusedEditable: null,
  28613. definition: d,
  28614. repository: a,
  28615. draggable: !1 !== d.draggable,
  28616. _: {
  28617. downcastFn: d.downcast && "string" == typeof d.downcast ? d.downcasts[d.downcast] : d.downcast
  28618. }
  28619. }, !0);
  28620. a.fire("instanceCreated", this);
  28621. Z(this, d);
  28622. this.init && this.init();
  28623. this.inited = !0;
  28624. (a = this.element.data("cke-widget-data")) && this.setData(JSON.parse(decodeURIComponent(a)));
  28625. e && this.setData(e);
  28626. this.data.classes || this.setData("classes",
  28627. this.getClasses());
  28628. this.dataReady = !0;
  28629. v(this);
  28630. this.fire("data", this.data);
  28631. this.isInited() && f.editable().contains(this.wrapper) && (this.ready = !0, this.fire("ready"))
  28632. }
  28633. function t(a, b, c) {
  28634. CKEDITOR.dom.element.call(this, b.$);
  28635. this.editor = a;
  28636. this._ = {};
  28637. b = this.filter = c.filter;
  28638. CKEDITOR.dtd[this.getName()].p ? (this.enterMode = b ? b.getAllowedEnterMode(a.enterMode) : a.enterMode, this
  28639. .shiftEnterMode = b ? b.getAllowedEnterMode(a.shiftEnterMode, !0) : a.shiftEnterMode) : this.enterMode =
  28640. this.shiftEnterMode = CKEDITOR.ENTER_BR
  28641. }
  28642. function aa(a,
  28643. b) {
  28644. a.addCommand(b.name, {
  28645. exec: function(a, d) {
  28646. function e() {
  28647. a.widgets.finalizeCreation(k)
  28648. }
  28649. var f = a.widgets.focused;
  28650. if (f && f.name == b.name) f.edit();
  28651. else if (b.insert) b.insert({
  28652. editor: a,
  28653. commandData: d
  28654. });
  28655. else if (b.template) {
  28656. var f = "function" == typeof b.defaults ? b.defaults() : b.defaults,
  28657. f = CKEDITOR.tools.object.merge(f || {}, d && d.startupData || {}),
  28658. f = CKEDITOR.dom.element.createFromHtml(b.template.output(f), a.document),
  28659. g, l = a.widgets.wrapElement(f, b.name),
  28660. k = new CKEDITOR.dom.documentFragment(l.getDocument());
  28661. k.append(l);
  28662. (g = a.widgets.initOn(f, b, d && d.startupData)) ? (f = g.once("edit", function(b) {
  28663. if (b.data.dialog) g.once("dialog", function(b) {
  28664. b = b.data;
  28665. var d, f;
  28666. d = b.once("ok", e, null, null, 20);
  28667. f = b.once("cancel", function(b) {
  28668. b.data && !1 === b.data.hide || a.widgets.destroy(g, !0)
  28669. });
  28670. b.once("hide", function() {
  28671. d.removeListener();
  28672. f.removeListener()
  28673. })
  28674. });
  28675. else e()
  28676. }, null, null, 999), g.edit(), f.removeListener()) : e()
  28677. }
  28678. },
  28679. allowedContent: b.allowedContent,
  28680. requiredContent: b.requiredContent,
  28681. contentForms: b.contentForms,
  28682. contentTransformations: b.contentTransformations
  28683. })
  28684. }
  28685. function ba(a, b) {
  28686. function c(a, e) {
  28687. var c = b.upcast.split(","),
  28688. d, f;
  28689. for (f = 0; f < c.length; f++)
  28690. if (d = c[f], d === a.name) return b.upcasts[d].call(this, a, e);
  28691. return !1
  28692. }
  28693. function d(b, e, c) {
  28694. var d = CKEDITOR.tools.getIndex(a._.upcasts, function(a) {
  28695. return a[2] > c
  28696. });
  28697. 0 > d && (d = a._.upcasts.length);
  28698. a._.upcasts.splice(d, 0, [CKEDITOR.tools.bind(b, e), e.name, c])
  28699. }
  28700. var e = b.upcast,
  28701. f = b.upcastPriority || 10;
  28702. e && ("string" == typeof e ? d(c, b, f) : d(e, b, f))
  28703. }
  28704. function x(a, b) {
  28705. a.focused = null;
  28706. if (b.isInited()) {
  28707. var c = b.editor.checkDirty();
  28708. a.fire("widgetBlurred", {
  28709. widget: b
  28710. });
  28711. b.setFocused(!1);
  28712. !c && b.editor.resetDirty()
  28713. }
  28714. }
  28715. function T(a) {
  28716. a = a.data;
  28717. if ("wysiwyg" == this.editor.mode) {
  28718. var b = this.editor.editable(),
  28719. c = this.instances,
  28720. d, e, f, g;
  28721. if (b) {
  28722. for (d in c) c[d].isReady() && !b.contains(c[d].wrapper) && this.destroy(c[d], !0);
  28723. if (a && a.initOnlyNew) c = this.initOnAll();
  28724. else {
  28725. var l = b.find(".cke_widget_wrapper"),
  28726. c = [];
  28727. d = 0;
  28728. for (e = l.count(); d < e; d++) {
  28729. f = l.getItem(d);
  28730. if (g = !this.getByElement(f, !0)) {
  28731. a: {
  28732. g = ca;
  28733. for (var k = f; k = k.getParent();)
  28734. if (g(k)) {
  28735. g = !0;
  28736. break a
  28737. } g = !1
  28738. }
  28739. g = !g
  28740. }
  28741. g && b.contains(f) && (f.addClass("cke_widget_new"),
  28742. c.push(this.initOn(f.getFirst(h.isDomWidgetElement))))
  28743. }
  28744. }
  28745. a && a.focusInited && 1 == c.length && c[0].focus()
  28746. }
  28747. }
  28748. }
  28749. function y(a) {
  28750. if ("undefined" != typeof a.attributes && a.attributes["data-widget"]) {
  28751. var b = z(a),
  28752. c = A(a),
  28753. d = !1;
  28754. b && b.value && b.value.match(/^\s/g) && (b.parent.attributes["data-cke-white-space-first"] = 1, b.value = b
  28755. .value.replace(/^\s/g, "\x26nbsp;"), d = !0);
  28756. c && c.value && c.value.match(/\s$/g) && (c.parent.attributes["data-cke-white-space-last"] = 1, c.value = c
  28757. .value.replace(/\s$/g, "\x26nbsp;"), d = !0);
  28758. d && (a.attributes["data-cke-widget-white-space"] =
  28759. 1)
  28760. }
  28761. }
  28762. function z(a) {
  28763. return a.find(function(a) {
  28764. return 3 === a.type
  28765. }, !0).shift()
  28766. }
  28767. function A(a) {
  28768. return a.find(function(a) {
  28769. return 3 === a.type
  28770. }, !0).pop()
  28771. }
  28772. function B(a, b, c) {
  28773. if (!c.allowedContent && !c.disallowedContent) return null;
  28774. var d = this._.filters[a];
  28775. d || (this._.filters[a] = d = {});
  28776. a = d[b];
  28777. a || (a = c.allowedContent ? new CKEDITOR.filter(c.allowedContent) : this.editor.filter.clone(), d[b] = a, c
  28778. .disallowedContent && a.disallow(c.disallowedContent));
  28779. return a
  28780. }
  28781. function da(a) {
  28782. var b = [],
  28783. c = a._.upcasts,
  28784. d = a._.upcastCallbacks;
  28785. return {
  28786. toBeWrapped: b,
  28787. iterator: function(a) {
  28788. var f, g, l, k, n;
  28789. if ("data-cke-widget-wrapper" in a.attributes) return (a = a.getFirst(h.isParserWidgetElement)) && b
  28790. .push([a]), !1;
  28791. if ("data-widget" in a.attributes) return b.push([a]), !1;
  28792. if (n = c.length) {
  28793. if (a.attributes["data-cke-widget-upcasted"]) return !1;
  28794. k = 0;
  28795. for (f = d.length; k < f; ++k)
  28796. if (!1 === d[k](a)) return;
  28797. for (k = 0; k < n; ++k)
  28798. if (f = c[k], l = {}, g = f[0](a, l)) return g instanceof CKEDITOR.htmlParser.element && (a = g), a
  28799. .attributes["data-cke-widget-data"] = encodeURIComponent(JSON.stringify(l)), a.attributes[
  28800. "data-cke-widget-upcasted"] =
  28801. 1, b.push([a, f[1]]), !1
  28802. }
  28803. }
  28804. }
  28805. }
  28806. function C(a, b) {
  28807. return {
  28808. tabindex: -1,
  28809. contenteditable: "false",
  28810. "data-cke-widget-wrapper": 1,
  28811. "data-cke-filter": "off",
  28812. "class": "cke_widget_wrapper cke_widget_new cke_widget_" + (a ? "inline" : "block") + (b ? " cke_widget_" +
  28813. b : "")
  28814. }
  28815. }
  28816. function D(a, b, c) {
  28817. if (a.type == CKEDITOR.NODE_ELEMENT) {
  28818. var d = CKEDITOR.dtd[a.name];
  28819. if (d && !d[c.name]) {
  28820. var d = a.split(b),
  28821. e = a.parent;
  28822. b = d.getIndex();
  28823. a.children.length || (--b, a.remove());
  28824. d.children.length || d.remove();
  28825. return D(e, b, c)
  28826. }
  28827. }
  28828. a.add(c, b)
  28829. }
  28830. function E(a, b) {
  28831. return "boolean" ==
  28832. typeof a.inline ? a.inline : !!CKEDITOR.dtd.$inline[b]
  28833. }
  28834. function ca(a) {
  28835. return a.hasAttribute("data-cke-temp")
  28836. }
  28837. function p(a, b, c, d) {
  28838. var e = a.editor;
  28839. e.fire("lockSnapshot");
  28840. c ? (d = c.data("cke-widget-editable"), d = b.editables[d], a.widgetHoldingFocusedEditable = b, b
  28841. .focusedEditable = d, c.addClass("cke_widget_editable_focused"), d.filter && e.setActiveFilter(d.filter),
  28842. e.setActiveEnterMode(d.enterMode, d.shiftEnterMode)) : (d || b.focusedEditable.removeClass(
  28843. "cke_widget_editable_focused"), b.focusedEditable = null, a.widgetHoldingFocusedEditable =
  28844. null, e.setActiveFilter(null), e.setActiveEnterMode(null, null));
  28845. e.fire("unlockSnapshot")
  28846. }
  28847. function ea(a) {
  28848. a.contextMenu && a.contextMenu.addListener(function(b) {
  28849. if (b = a.widgets.getByElement(b, !0)) return b.fire("contextMenu", {})
  28850. })
  28851. }
  28852. function fa(a, b) {
  28853. return CKEDITOR.tools.trim(b)
  28854. }
  28855. function X(a) {
  28856. var b = a.editor,
  28857. c = CKEDITOR.plugins.lineutils;
  28858. b.on("dragstart", function(c) {
  28859. var e = c.data.target;
  28860. h.isDomDragHandler(e) && (e = a.getByElement(e), c.data.dataTransfer.setData("cke/widget-id", e.id), b
  28861. .focus(), e.focus())
  28862. });
  28863. b.on("drop",
  28864. function(c) {
  28865. function e(a, b) {
  28866. return a && b ? a.wrapper.equals(b.wrapper) || a.wrapper.contains(b.wrapper) : !1
  28867. }
  28868. var f = c.data.dataTransfer,
  28869. g = f.getData("cke/widget-id"),
  28870. l = f.getTransferType(b),
  28871. f = b.createRange(),
  28872. k = function(a) {
  28873. a = a.getBoundaryNodes().startNode;
  28874. a.type !== CKEDITOR.NODE_ELEMENT && (a = a.getParent());
  28875. return b.widgets.getByElement(a)
  28876. }(c.data.dropRange);
  28877. if ("" !== g && l === CKEDITOR.DATA_TRANSFER_CROSS_EDITORS) c.cancel();
  28878. else if (l == CKEDITOR.DATA_TRANSFER_INTERNAL)
  28879. if ("" === g && 0 < b.widgets.selected.length) c.data.dataTransfer.setData("text/html",
  28880. F(b));
  28881. else if (g = a.instances[g]) e(g, k) ? c.cancel() : (f.setStartBefore(g.wrapper), f.setEndAfter(g
  28882. .wrapper), c.data.dragRange = f, delete CKEDITOR.plugins.clipboard.dragStartContainerChildCount,
  28883. delete CKEDITOR.plugins.clipboard.dragEndContainerChildCount, c.data.dataTransfer.setData(
  28884. "text/html", g.getClipboardHtml()), b.widgets.destroy(g, !0))
  28885. });
  28886. b.on("contentDom", function() {
  28887. var d = b.editable();
  28888. CKEDITOR.tools.extend(a, {
  28889. finder: new c.finder(b, {
  28890. lookups: {
  28891. "default": function(b) {
  28892. if (!b.is(CKEDITOR.dtd.$listItem) && b.is(CKEDITOR.dtd.$block) &&
  28893. !h.isDomNestedEditable(b) && !a._.draggedWidget.wrapper.contains(b)) {
  28894. var c = h.getNestedEditable(d, b);
  28895. if (c) {
  28896. b = a._.draggedWidget;
  28897. if (a.getByElement(c) == b) return;
  28898. c = CKEDITOR.filter.instances[c.data("cke-filter")];
  28899. b = b.requiredContent;
  28900. if (c && b && !c.check(b)) return
  28901. }
  28902. return CKEDITOR.LINEUTILS_BEFORE | CKEDITOR.LINEUTILS_AFTER
  28903. }
  28904. }
  28905. }
  28906. }),
  28907. locator: new c.locator(b),
  28908. liner: new c.liner(b, {
  28909. lineStyle: {
  28910. cursor: "move !important",
  28911. "border-top-color": "#666"
  28912. },
  28913. tipLeftStyle: {
  28914. "border-left-color": "#666"
  28915. },
  28916. tipRightStyle: {
  28917. "border-right-color": "#666"
  28918. }
  28919. })
  28920. },
  28921. !0)
  28922. })
  28923. }
  28924. function V(a) {
  28925. var b = a.editor;
  28926. b.on("contentDom", function() {
  28927. var c = b.editable(),
  28928. d = c.isInline() ? c : b.document,
  28929. e, f;
  28930. c.attachListener(d, "mousedown", function(c) {
  28931. var d = c.data.getTarget();
  28932. e = d instanceof CKEDITOR.dom.element ? a.getByElement(d) : null;
  28933. f = 0;
  28934. e && (e.inline && d.type == CKEDITOR.NODE_ELEMENT && d.hasAttribute(
  28935. "data-cke-widget-drag-handler") ? (f = 1, a.focused != e && b.getSelection()
  28936. .removeAllRanges()) : h.getNestedEditable(e.wrapper, d) ? e = null : (c.data
  28937. .preventDefault(), CKEDITOR.env.ie || e.focus()))
  28938. });
  28939. c.attachListener(d,
  28940. "mouseup",
  28941. function() {
  28942. f && e && e.wrapper && (f = 0, e.focus())
  28943. });
  28944. CKEDITOR.env.ie && c.attachListener(d, "mouseup", function() {
  28945. setTimeout(function() {
  28946. e && e.wrapper && c.contains(e.wrapper) && (e.focus(), e = null)
  28947. })
  28948. })
  28949. });
  28950. b.on("doubleclick", function(b) {
  28951. var d = a.getByElement(b.data.element);
  28952. if (d && !h.getNestedEditable(d.wrapper, b.data.element)) return d.fire("doubleclick", {
  28953. element: b.data.element
  28954. })
  28955. }, null, null, 1)
  28956. }
  28957. function W(a) {
  28958. a.editor.on("key", function(b) {
  28959. var c = a.focused,
  28960. d = a.widgetHoldingFocusedEditable,
  28961. e;
  28962. c ? e = c.fire("key", {
  28963. keyCode: b.data.keyCode
  28964. }) :
  28965. d && (c = b.data.keyCode, b = d.focusedEditable, c == CKEDITOR.CTRL + 65 ? (c = b.getBogus(), d = d
  28966. .editor.createRange(), d.selectNodeContents(b), c && d.setEndAt(c, CKEDITOR
  28967. .POSITION_BEFORE_START), d.select(), e = !1) : 8 == c || 46 == c ? (e = d.editor.getSelection()
  28968. .getRanges(), d = e[0], e = !(1 == e.length && d.collapsed && d.checkBoundaryOfElement(b,
  28969. CKEDITOR[8 == c ? "START" : "END"]))) : e = void 0);
  28970. return e
  28971. }, null, null, 1)
  28972. }
  28973. function Y(a) {
  28974. function b(b) {
  28975. 1 > a.selected.length || G(c, "cut" === b.name)
  28976. }
  28977. var c = a.editor;
  28978. c.on("contentDom", function() {
  28979. var a = c.editable();
  28980. a.attachListener(a, "copy", b);
  28981. a.attachListener(a, "cut", b)
  28982. })
  28983. }
  28984. function U(a) {
  28985. function b() {
  28986. var a = e.getSelection();
  28987. if (a && (a = a.getRanges()[0]) && !a.collapsed) {
  28988. var b = c(a.startContainer),
  28989. d = c(a.endContainer);
  28990. !b && d ? (a.setEndBefore(d.wrapper), a.select()) : b && !d && (a.setStartAfter(b.wrapper), a.select())
  28991. }
  28992. }
  28993. function c(a) {
  28994. return a ? a.type == CKEDITOR.NODE_TEXT ? c(a.getParent()) : e.widgets.getByElement(a) : null
  28995. }
  28996. function d() {
  28997. a.fire("checkSelection")
  28998. }
  28999. var e = a.editor;
  29000. e.on("selectionCheck", d);
  29001. e.on("contentDom", function() {
  29002. e.editable().attachListener(e,
  29003. "key",
  29004. function() {
  29005. setTimeout(d, 10)
  29006. })
  29007. });
  29008. if (!CKEDITOR.env.ie) a.on("checkSelection", b);
  29009. a.on("checkSelection", a.checkSelection, a);
  29010. e.on("selectionChange", function(b) {
  29011. var c = (b = h.getNestedEditable(e.editable(), b.data.selection.getStartElement())) && a.getByElement(
  29012. b),
  29013. d = a.widgetHoldingFocusedEditable;
  29014. d ? d === c && d.focusedEditable.equals(b) || (p(a, d, null), c && b && p(a, c, b)) : c && b && p(a, c,
  29015. b)
  29016. });
  29017. e.on("dataReady", function() {
  29018. H(a).commit()
  29019. });
  29020. e.on("blur", function() {
  29021. var b;
  29022. (b = a.focused) && x(a, b);
  29023. (b = a.widgetHoldingFocusedEditable) &&
  29024. p(a, b, null)
  29025. })
  29026. }
  29027. function S(a) {
  29028. var b = a.editor,
  29029. c = {};
  29030. b.on("toDataFormat", function(b) {
  29031. var e = CKEDITOR.tools.getNextNumber(),
  29032. f = [];
  29033. b.data.downcastingSessionId = e;
  29034. c[e] = f;
  29035. b.data.dataValue.forEach(function(b) {
  29036. var c = b.attributes,
  29037. e;
  29038. if ("data-cke-widget-white-space" in c) {
  29039. e = z(b);
  29040. var d = A(b);
  29041. e.parent.attributes["data-cke-white-space-first"] && (e.value = e.value.replace(/^&nbsp;/g,
  29042. " "));
  29043. d.parent.attributes["data-cke-white-space-last"] && (d.value = d.value.replace(/&nbsp;$/g, " "))
  29044. }
  29045. if ("data-cke-widget-id" in c) {
  29046. if (c = a.instances[c["data-cke-widget-id"]]) e =
  29047. b.getFirst(h.isParserWidgetElement), f.push({
  29048. wrapper: b,
  29049. element: e,
  29050. widget: c,
  29051. editables: {}
  29052. }), e && "1" != e.attributes["data-cke-widget-keep-attr"] && delete e.attributes[
  29053. "data-widget"]
  29054. } else if ("data-cke-widget-editable" in c) return 0 < f.length && (f[f.length - 1].editables[c[
  29055. "data-cke-widget-editable"]] = b), !1
  29056. }, CKEDITOR.NODE_ELEMENT, !0)
  29057. }, null, null, 8);
  29058. b.on("toDataFormat", function(a) {
  29059. if (a.data.downcastingSessionId)
  29060. for (var b = c[a.data.downcastingSessionId], f, g, l, k, h, m; f = b.shift();) {
  29061. g = f.widget;
  29062. l = f.element;
  29063. k = g._.downcastFn &&
  29064. g._.downcastFn.call(g, l);
  29065. a.data.widgetsCopy && g.getClipboardHtml && (k = CKEDITOR.htmlParser.fragment.fromHtml(g
  29066. .getClipboardHtml()), k = k.children[0]);
  29067. for (m in f.editables) h = f.editables[m], delete h.attributes.contenteditable, h.setHtml(g
  29068. .editables[m].getData());
  29069. k || (k = l);
  29070. k ? f.wrapper.replaceWith(k) : f.wrapper.remove()
  29071. }
  29072. }, null, null, 13);
  29073. b.on("contentDomUnload", function() {
  29074. a.destroyAll(!0)
  29075. })
  29076. }
  29077. function R(a) {
  29078. var b = a.editor,
  29079. c, d;
  29080. b.on("toHtml", function(b) {
  29081. var d = da(a),
  29082. g;
  29083. for (b.data.dataValue.forEach(d.iterator, CKEDITOR.NODE_ELEMENT,
  29084. !0); g = d.toBeWrapped.pop();) {
  29085. var l = g[0],
  29086. k = l.parent;
  29087. k.type == CKEDITOR.NODE_ELEMENT && k.attributes["data-cke-widget-wrapper"] && k.replaceWith(l);
  29088. a.wrapElement(g[0], g[1])
  29089. }
  29090. c = b.data.protectedWhitespaces ? 3 == b.data.dataValue.children.length && h.isParserWidgetWrapper(b
  29091. .data.dataValue.children[1]) : 1 == b.data.dataValue.children.length && h.isParserWidgetWrapper(b
  29092. .data.dataValue.children[0])
  29093. }, null, null, 8);
  29094. b.on("dataReady", function() {
  29095. if (d)
  29096. for (var c = b.editable().find(".cke_widget_wrapper"), f, g, l = 0, k = c.count(); l < k; ++l) f =
  29097. c.getItem(l), g = f.getFirst(h.isDomWidgetElement), g.type == CKEDITOR.NODE_ELEMENT && g.data(
  29098. "widget") ? (g.replace(f), a.wrapElement(g)) : f.remove();
  29099. d = 0;
  29100. a.destroyAll(!0);
  29101. a.initOnAll()
  29102. });
  29103. b.on("loadSnapshot", function(b) {
  29104. /data-cke-widget/.test(b.data) && (d = 1);
  29105. a.destroyAll(!0)
  29106. }, null, null, 9);
  29107. b.on("paste", function(a) {
  29108. a = a.data;
  29109. a.dataValue = a.dataValue.replace(ga, fa);
  29110. a.range && (a = h.getNestedEditable(b.editable(), a.range.startContainer)) && (a = CKEDITOR.filter
  29111. .instances[a.data("cke-filter")]) && b.setActiveFilter(a)
  29112. });
  29113. b.on("afterInsertHtml",
  29114. function(d) {
  29115. d.data.intoRange ? a.checkWidgets({
  29116. initOnlyNew: !0
  29117. }) : (b.fire("lockSnapshot"), a.checkWidgets({
  29118. initOnlyNew: !0,
  29119. focusInited: c
  29120. }), b.fire("unlockSnapshot"))
  29121. })
  29122. }
  29123. function H(a) {
  29124. var b = a.selected,
  29125. c = [],
  29126. d = b.slice(0),
  29127. e = null;
  29128. return {
  29129. select: function(a) {
  29130. 0 > CKEDITOR.tools.indexOf(b, a) && c.push(a);
  29131. a = CKEDITOR.tools.indexOf(d, a);
  29132. 0 <= a && d.splice(a, 1);
  29133. return this
  29134. },
  29135. focus: function(a) {
  29136. e = a;
  29137. return this
  29138. },
  29139. commit: function() {
  29140. var f = a.focused !== e,
  29141. g, l;
  29142. a.editor.fire("lockSnapshot");
  29143. for (f && (g = a.focused) && x(a, g); g = d.pop();) b.splice(CKEDITOR.tools.indexOf(b,
  29144. g), 1), g.isInited() && (l = g.editor.checkDirty(), g.setSelected(!1), !l && g.editor.resetDirty());
  29145. f && e && (l = a.editor.checkDirty(), a.focused = e, a.fire("widgetFocused", {
  29146. widget: e
  29147. }), e.setFocused(!0), !l && a.editor.resetDirty());
  29148. for (; g = c.pop();) b.push(g), g.setSelected(!0);
  29149. a.editor.fire("unlockSnapshot")
  29150. }
  29151. }
  29152. }
  29153. function ha(a) {
  29154. a && a.addFilterRule(function(a) {
  29155. return a.replace(/\s*cke_widget_selected/g, "").replace(/\s*cke_widget_focused/g, "")
  29156. })
  29157. }
  29158. function I(a, b, c) {
  29159. var d = 0;
  29160. b = J(b);
  29161. var e = a.data.classes || {},
  29162. f;
  29163. if (b) {
  29164. for (e = CKEDITOR.tools.clone(e); f =
  29165. b.pop();) c ? e[f] || (d = e[f] = 1) : e[f] && (delete e[f], d = 1);
  29166. d && a.setData("classes", e)
  29167. }
  29168. }
  29169. function K(a) {
  29170. a.cancel()
  29171. }
  29172. function L(a, b) {
  29173. var c = function(a) {
  29174. return a == CKEDITOR.ENTER_BR ? "br" : a == CKEDITOR.ENTER_DIV ? "div" : "p"
  29175. }(a.editor.config.enterMode),
  29176. d = new CKEDITOR.dom.element(c);
  29177. "br" !== c && d.appendBogus();
  29178. "after" === b ? d.insertAfter(a.wrapper) : d.insertBefore(a.wrapper);
  29179. (function(b) {
  29180. var c = a.editor.createRange();
  29181. c.setStart(b, 0);
  29182. a.editor.getSelection().selectRanges([c])
  29183. })(d)
  29184. }
  29185. function G(a, b) {
  29186. var c = a.widgets.focused,
  29187. d, e, f;
  29188. u.hasCopyBin(a) || (e = new u(a, {
  29189. beforeDestroy: function() {
  29190. !b && c && c.focus();
  29191. f && a.getSelection().selectBookmarks(f);
  29192. d && CKEDITOR.plugins.widgetselection.addFillers(a.editable())
  29193. },
  29194. afterDestroy: function() {
  29195. b && !a.readOnly && (c ? a.widgets.del(c) : a.extractSelectedHtml(), a.fire("saveSnapshot"))
  29196. }
  29197. }), c || (d = CKEDITOR.env.webkit && CKEDITOR.plugins.widgetselection.isWholeContentSelected(a
  29198. .editable()), f = a.getSelection().createBookmarks(!0)), e.handle(F(a)))
  29199. }
  29200. function J(a) {
  29201. return (a = (a = a.getDefinition().attributes) && a["class"]) ?
  29202. a.split(/\s+/) : null
  29203. }
  29204. function M() {
  29205. var a = CKEDITOR.document.getActive(),
  29206. b = this.editor,
  29207. c = b.editable();
  29208. (c.isInline() ? c : b.document.getWindow().getFrame()).equals(a) && b.focusManager.focus(c)
  29209. }
  29210. function N() {
  29211. CKEDITOR.env.gecko && this.editor.unlockSelection();
  29212. CKEDITOR.env.webkit || (this.editor.forceNextSelectionCheck(), this.editor.selectionChange(1))
  29213. }
  29214. function F(a) {
  29215. var b = a.getSelectedHtml(!0);
  29216. if (a.widgets.focused) return a.widgets.focused.getClipboardHtml();
  29217. a.once("toDataFormat", function(a) {
  29218. a.data.widgetsCopy = !0
  29219. },
  29220. null, null, -1);
  29221. return a.dataProcessor.toDataFormat(b)
  29222. }
  29223. function Z(a, b) {
  29224. var c = a.editor.config.widget_keystrokeInsertLineBefore,
  29225. d = a.editor.config.widget_keystrokeInsertLineAfter;
  29226. ia(a);
  29227. O(a);
  29228. ja(a);
  29229. P(a);
  29230. ka(a);
  29231. la(a);
  29232. ma(a);
  29233. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version) a.wrapper.on("dragstart", function(b) {
  29234. var c = b.data.getTarget();
  29235. h.getNestedEditable(a, c) || a.inline && h.isDomDragHandler(c) || b.data.preventDefault()
  29236. });
  29237. a.wrapper.removeClass("cke_widget_new");
  29238. a.element.addClass("cke_widget_element");
  29239. a.on("key", function(b) {
  29240. b =
  29241. b.data.keyCode;
  29242. if (b == c) L(a, "before"), a.editor.fire("saveSnapshot");
  29243. else if (b == d) L(a, "after"), a.editor.fire("saveSnapshot");
  29244. else if (13 == b) a.edit();
  29245. else {
  29246. if (b == CKEDITOR.CTRL + 67 || b == CKEDITOR.CTRL + 88) {
  29247. G(a.editor, b == CKEDITOR.CTRL + 88);
  29248. return
  29249. }
  29250. if (b in Q || CKEDITOR.CTRL & b || CKEDITOR.ALT & b) return
  29251. }
  29252. return !1
  29253. }, null, null, 999);
  29254. a.on("doubleclick", function(b) {
  29255. a.edit() && b.cancel()
  29256. });
  29257. if (b.data) a.on("data", b.data);
  29258. if (b.edit) a.on("edit", b.edit)
  29259. }
  29260. function ia(a) {
  29261. (a.wrapper = a.element.getParent()).setAttribute("data-cke-widget-id",
  29262. a.id)
  29263. }
  29264. function O(a, b) {
  29265. a.partSelectors || (a.partSelectors = a.parts);
  29266. if (a.parts) {
  29267. var c = {},
  29268. d, e;
  29269. for (e in a.partSelectors) b || !a.parts[e] || "string" == typeof a.parts[e] ? (d = a.wrapper.findOne(a
  29270. .partSelectors[e]), c[e] = d) : c[e] = a.parts[e];
  29271. a.parts = c
  29272. }
  29273. }
  29274. function ja(a) {
  29275. var b = a.editables,
  29276. c, d;
  29277. a.editables = {};
  29278. if (a.editables)
  29279. for (c in b) d = b[c], a.initEditable(c, "string" == typeof d ? {
  29280. selector: d
  29281. } : d)
  29282. }
  29283. function P(a) {
  29284. if (!0 === a.mask) na(a);
  29285. else if (a.mask) {
  29286. var b = new CKEDITOR.tools.buffers.throttle(250, oa, a),
  29287. c = CKEDITOR.env.gecko ? 300 : 0,
  29288. d, e;
  29289. a.on("focus", function() {
  29290. b.input();
  29291. d = a.editor.on("change", b.input);
  29292. e = a.on("blur", function() {
  29293. d.removeListener();
  29294. e.removeListener()
  29295. })
  29296. });
  29297. a.editor.on("instanceReady", function() {
  29298. setTimeout(function() {
  29299. b.input()
  29300. }, c)
  29301. });
  29302. a.editor.on("mode", function() {
  29303. setTimeout(function() {
  29304. b.input()
  29305. }, c)
  29306. });
  29307. if (CKEDITOR.env.gecko) {
  29308. var f = a.element.find("img");
  29309. CKEDITOR.tools.array.forEach(f.toArray(), function(a) {
  29310. a.on("load", function() {
  29311. b.input()
  29312. })
  29313. })
  29314. }
  29315. for (var g in a.editables) a.editables[g].on("focus", function() {
  29316. a.editor.on("change",
  29317. b.input);
  29318. e && e.removeListener()
  29319. }), a.editables[g].on("blur", function() {
  29320. a.editor.removeListener("change", b.input)
  29321. });
  29322. b.input()
  29323. }
  29324. }
  29325. function na(a) {
  29326. var b = a.wrapper.findOne(".cke_widget_mask");
  29327. b || (b = new CKEDITOR.dom.element("img", a.editor.document), b.setAttributes({
  29328. src: CKEDITOR.tools.transparentImageData,
  29329. "class": "cke_reset cke_widget_mask"
  29330. }), a.wrapper.append(b));
  29331. a.mask = b
  29332. }
  29333. function oa() {
  29334. if (this.wrapper) {
  29335. this.maskPart = this.maskPart || this.mask;
  29336. var a = this.parts[this.maskPart],
  29337. b;
  29338. if (a && "string" != typeof a) {
  29339. b = this.wrapper.findOne(".cke_widget_partial_mask");
  29340. b || (b = new CKEDITOR.dom.element("img", this.editor.document), b.setAttributes({
  29341. src: CKEDITOR.tools.transparentImageData,
  29342. "class": "cke_reset cke_widget_partial_mask"
  29343. }), this.wrapper.append(b));
  29344. this.mask = b;
  29345. var c = b.$,
  29346. d = a.$,
  29347. e = !(c.offsetTop == d.offsetTop && c.offsetLeft == d.offsetLeft);
  29348. if (c.offsetWidth != d.offsetWidth || c.offsetHeight != d.offsetHeight || e) c = a.getParent(), d =
  29349. CKEDITOR.plugins.widget.isDomWidget(c), b.setStyles({
  29350. top: a.$.offsetTop + (d ? 0 : c.$.offsetTop) + "px",
  29351. left: a.$.offsetLeft + (d ? 0 : c.$.offsetLeft) + "px",
  29352. width: a.$.offsetWidth +
  29353. "px",
  29354. height: a.$.offsetHeight + "px"
  29355. })
  29356. }
  29357. }
  29358. }
  29359. function ka(a) {
  29360. if (a.draggable) {
  29361. var b = a.editor,
  29362. c = a.wrapper.getLast(h.isDomDragHandlerContainer),
  29363. d;
  29364. c ? d = c.findOne("img") : (c = new CKEDITOR.dom.element("span", b.document), c.setAttributes({
  29365. "class": "cke_reset cke_widget_drag_handler_container",
  29366. style: "background:rgba(220,220,220,0.5);background-image:url(" + b.plugins.widget.path +
  29367. "images/handle.png);display:none;"
  29368. }), d = new CKEDITOR.dom.element("img", b.document), d.setAttributes({
  29369. "class": "cke_reset cke_widget_drag_handler",
  29370. "data-cke-widget-drag-handler": "1",
  29371. src: CKEDITOR.tools.transparentImageData,
  29372. width: 15,
  29373. title: b.lang.widget.move,
  29374. height: 15,
  29375. role: "presentation"
  29376. }), a.inline && d.setAttribute("draggable", "true"), c.append(d), a.wrapper.append(c));
  29377. a.wrapper.on("dragover", function(a) {
  29378. a.data.preventDefault()
  29379. });
  29380. a.wrapper.on("mouseenter", a.updateDragHandlerPosition, a);
  29381. setTimeout(function() {
  29382. a.on("data", a.updateDragHandlerPosition, a)
  29383. }, 50);
  29384. if (!a.inline && (d.on("mousedown", pa, a), CKEDITOR.env.ie && 9 > CKEDITOR.env.version)) d.on("dragstart",
  29385. function(a) {
  29386. a.data.preventDefault(!0)
  29387. });
  29388. a.dragHandlerContainer = c
  29389. }
  29390. }
  29391. function pa(a) {
  29392. function b() {
  29393. var b;
  29394. for (r.reset(); b = l.pop();) b.removeListener();
  29395. var c = k;
  29396. b = a.sender;
  29397. var d = this.repository.finder,
  29398. e = this.repository.liner,
  29399. f = this.editor,
  29400. g = this.editor.editable();
  29401. CKEDITOR.tools.isEmpty(e.visible) || (c = d.getRange(c[0]), this.focus(), f.fire("drop", {
  29402. dropRange: c,
  29403. target: c.startContainer
  29404. }));
  29405. g.removeClass("cke_widget_dragging");
  29406. e.hideVisible();
  29407. f.fire("dragend", {
  29408. target: b
  29409. })
  29410. }
  29411. if (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT) {
  29412. var c =
  29413. this.repository.finder,
  29414. d = this.repository.locator,
  29415. e = this.repository.liner,
  29416. f = this.editor,
  29417. g = f.editable(),
  29418. l = [],
  29419. k = [],
  29420. h, m;
  29421. this.repository._.draggedWidget = this;
  29422. var w = c.greedySearch(),
  29423. r = CKEDITOR.tools.eventsBuffer(50, function() {
  29424. h = d.locate(w);
  29425. k = d.sort(m, 1);
  29426. k.length && (e.prepare(w, h), e.placeLine(k[0]), e.cleanup())
  29427. });
  29428. g.addClass("cke_widget_dragging");
  29429. l.push(g.on("mousemove", function(a) {
  29430. m = a.data.$.clientY;
  29431. r.input()
  29432. }));
  29433. f.fire("dragstart", {
  29434. target: a.sender
  29435. });
  29436. l.push(f.document.once("mouseup", b, this));
  29437. g.isInline() ||
  29438. l.push(CKEDITOR.document.once("mouseup", b, this))
  29439. }
  29440. }
  29441. function la(a) {
  29442. var b = null;
  29443. a.on("data", function() {
  29444. var a = this.data.classes,
  29445. d;
  29446. if (b != a) {
  29447. for (d in b) a && a[d] || this.removeClass(d);
  29448. for (d in a) this.addClass(d);
  29449. b = a
  29450. }
  29451. })
  29452. }
  29453. function ma(a) {
  29454. a.on("data", function() {
  29455. if (a.wrapper) {
  29456. var b = this.getLabel ? this.getLabel() : this.editor.lang.widget.label.replace(/%1/, this.pathName ||
  29457. this.element.getName());
  29458. a.wrapper.setAttribute("role", "region");
  29459. a.wrapper.setAttribute("aria-label", b)
  29460. }
  29461. }, null, null, 9999)
  29462. }
  29463. function v(a) {
  29464. a.element.data("cke-widget-data",
  29465. encodeURIComponent(JSON.stringify(a.data)))
  29466. }
  29467. function qa() {
  29468. function a() {}
  29469. function b(a, b, c) {
  29470. return c && this.checkElement(a) ? (a = c.widgets.getByElement(a, !0)) && a.checkStyleActive(this) : !1
  29471. }
  29472. function c(a) {
  29473. function b(a, c, d) {
  29474. for (var e = a.length, f = 0; f < e;) {
  29475. if (c.call(d, a[f], f, a)) return a[f];
  29476. f++
  29477. }
  29478. }
  29479. function c(a) {
  29480. function b(a, c) {
  29481. var d = CKEDITOR.tools.object.keys(a),
  29482. e = CKEDITOR.tools.object.keys(c);
  29483. if (d.length !== e.length) return !1;
  29484. for (var f in a)
  29485. if (("object" !== typeof a[f] || "object" !== typeof c[f] || !b(a[f], c[f])) && a[f] !==
  29486. c[f]) return !1;
  29487. return !0
  29488. }
  29489. return function(c) {
  29490. return b(a.getDefinition(), c.getDefinition())
  29491. }
  29492. }
  29493. var h = a.widget,
  29494. k;
  29495. d[h] || (d[h] = {});
  29496. for (var n = 0, m = a.group.length; n < m; n++) k = a.group[n], d[h][k] || (d[h][k] = []), k = d[h][k], b(k,
  29497. c(a)) || k.push(a)
  29498. }
  29499. var d = {};
  29500. CKEDITOR.style.addCustomHandler({
  29501. type: "widget",
  29502. setup: function(a) {
  29503. this.widget = a.widget;
  29504. (this.group = "string" == typeof a.group ? [a.group] : a.group) && c(this)
  29505. },
  29506. apply: function(a) {
  29507. var b;
  29508. a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(), a) && (b = a.widgets.focused,
  29509. this.group && this.removeStylesFromSameGroup(a), b.applyStyle(this))
  29510. },
  29511. remove: function(a) {
  29512. a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(), a) && a.widgets.focused
  29513. .removeStyle(this)
  29514. },
  29515. removeStylesFromSameGroup: function(a) {
  29516. var b = !1,
  29517. c, h;
  29518. if (!(a instanceof CKEDITOR.editor)) return !1;
  29519. h = a.elementPath();
  29520. if (this.checkApplicable(h, a))
  29521. for (var k = 0, n = this.group.length; k < n; k++) {
  29522. c = d[this.widget][this.group[k]];
  29523. for (var m = 0; m < c.length; m++) c[m] !== this && c[m].checkActive(h, a) && (a.widgets.focused
  29524. .removeStyle(c[m]),
  29525. b = !0)
  29526. }
  29527. return b
  29528. },
  29529. checkActive: function(a, b) {
  29530. return this.checkElementMatch(a.lastElement, 0, b)
  29531. },
  29532. checkApplicable: function(a, b) {
  29533. return b instanceof CKEDITOR.editor ? this.checkElement(a.lastElement) : !1
  29534. },
  29535. checkElementMatch: b,
  29536. checkElementRemovable: b,
  29537. checkElement: function(a) {
  29538. return h.isDomWidgetWrapper(a) ? (a = a.getFirst(h.isDomWidgetElement)) && a.data("widget") == this
  29539. .widget : !1
  29540. },
  29541. buildPreview: function(a) {
  29542. return a || this._.definition.name
  29543. },
  29544. toAllowedContentRules: function(a) {
  29545. if (!a) return null;
  29546. a = a.widgets.registered[this.widget];
  29547. var b, c = {};
  29548. if (!a) return null;
  29549. if (a.styleableElements) {
  29550. b = this.getClassesArray();
  29551. if (!b) return null;
  29552. c[a.styleableElements] = {
  29553. classes: b,
  29554. propertiesOnly: !0
  29555. };
  29556. return c
  29557. }
  29558. return a.styleToAllowedContentRules ? a.styleToAllowedContentRules(this) : null
  29559. },
  29560. getClassesArray: function() {
  29561. var a = this._.definition.attributes && this._.definition.attributes["class"];
  29562. return a ? CKEDITOR.tools.trim(a).split(/\s+/) : null
  29563. },
  29564. applyToRange: a,
  29565. removeFromRange: a,
  29566. applyToObject: a
  29567. })
  29568. }
  29569. CKEDITOR.plugins.add("widget", {
  29570. requires: "lineutils,clipboard,widgetselection",
  29571. onLoad: function() {
  29572. void 0 !== CKEDITOR.document.$.querySelectorAll && (CKEDITOR.addCss(
  29573. '.cke_widget_wrapper{position:relative;outline:none}.cke_widget_inline{display:inline-block}.cke_widget_wrapper:hover\x3e.cke_widget_element{outline:2px solid #ffd25c;cursor:default}.cke_widget_wrapper:hover .cke_widget_editable{outline:2px solid #ffd25c}.cke_widget_wrapper.cke_widget_focused\x3e.cke_widget_element,.cke_widget_wrapper .cke_widget_editable.cke_widget_editable_focused{outline:2px solid #47a4f5}.cke_widget_editable{cursor:text}.cke_widget_drag_handler_container{position:absolute;width:15px;height:0;display:block;opacity:0.75;transition:height 0s 0.2s;line-height:0}.cke_widget_wrapper:hover\x3e.cke_widget_drag_handler_container{height:15px;transition:none}.cke_widget_drag_handler_container:hover{opacity:1}.cke_editable[contenteditable\x3d"false"] .cke_widget_drag_handler_container{display:none;}img.cke_widget_drag_handler{cursor:move;width:15px;height:15px;display:inline-block}.cke_widget_mask{position:absolute;top:0;left:0;width:100%;height:100%;display:block}.cke_widget_partial_mask{position:absolute;display:block}.cke_editable.cke_widget_dragging, .cke_editable.cke_widget_dragging *{cursor:move !important}'
  29574. ),
  29575. qa())
  29576. },
  29577. beforeInit: function(a) {
  29578. void 0 !== CKEDITOR.document.$.querySelectorAll && (a.widgets = new q(a))
  29579. },
  29580. afterInit: function(a) {
  29581. if (void 0 !== CKEDITOR.document.$.querySelectorAll) {
  29582. var b = a.widgets.registered,
  29583. c, d, e;
  29584. for (d in b) c = b[d], (e = c.button) && a.ui.addButton && a.ui.addButton(CKEDITOR.tools.capitalize(
  29585. c.name, !0), {
  29586. label: e,
  29587. command: c.name,
  29588. toolbar: "insert,10"
  29589. });
  29590. ea(a);
  29591. ha(a.undoManager)
  29592. }
  29593. }
  29594. });
  29595. q.prototype = {
  29596. MIN_SELECTION_CHECK_INTERVAL: 500,
  29597. add: function(a, b) {
  29598. var c = this.editor;
  29599. b = CKEDITOR.tools.prototypedCopy(b);
  29600. b.name =
  29601. a;
  29602. b._ = b._ || {};
  29603. c.fire("widgetDefinition", b);
  29604. b.template && (b.template = new CKEDITOR.template(b.template));
  29605. aa(c, b);
  29606. ba(this, b);
  29607. this.registered[a] = b;
  29608. if (b.dialog && c.plugins.dialog) var d = CKEDITOR.on("dialogDefinition", function(a) {
  29609. a = a.data.definition;
  29610. var f = a.dialog;
  29611. a.getMode || f.getName() !== b.dialog || (a.getMode = function() {
  29612. var a = f.getModel(c);
  29613. return a && a instanceof CKEDITOR.plugins.widget && a.ready ? CKEDITOR.dialog
  29614. .EDITING_MODE : CKEDITOR.dialog.CREATION_MODE
  29615. });
  29616. d.removeListener()
  29617. });
  29618. return b
  29619. },
  29620. addUpcastCallback: function(a) {
  29621. this._.upcastCallbacks.push(a)
  29622. },
  29623. checkSelection: function() {
  29624. if (this.editor.getSelection()) {
  29625. var a = this.editor.getSelection(),
  29626. b = a.getSelectedElement(),
  29627. c = H(this),
  29628. d;
  29629. if (b && (d = this.getByElement(b, !0))) return c.focus(d).select(d).commit();
  29630. a = a.getRanges()[0];
  29631. if (!a || a.collapsed) return c.commit();
  29632. a = new CKEDITOR.dom.walker(a);
  29633. for (a.evaluator = h.isDomWidgetWrapper; b = a.next();) c.select(this.getByElement(b));
  29634. c.commit()
  29635. }
  29636. },
  29637. checkWidgets: function(a) {
  29638. this.fire("checkWidgets", CKEDITOR.tools.copy(a || {}))
  29639. },
  29640. del: function(a) {
  29641. if (this.focused === a) {
  29642. var b = a.editor,
  29643. c = b.createRange(),
  29644. d;
  29645. (d = c.moveToClosestEditablePosition(a.wrapper, !0)) || (d = c.moveToClosestEditablePosition(a
  29646. .wrapper, !1));
  29647. d && b.getSelection().selectRanges([c])
  29648. }
  29649. a.wrapper.remove();
  29650. this.destroy(a, !0)
  29651. },
  29652. destroy: function(a, b) {
  29653. this.widgetHoldingFocusedEditable === a && p(this, a, null, b);
  29654. a.destroy(b);
  29655. delete this.instances[a.id];
  29656. this.fire("instanceDestroyed", a)
  29657. },
  29658. destroyAll: function(a, b) {
  29659. var c, d, e = this.instances;
  29660. if (b && !a) {
  29661. d = b.find(".cke_widget_wrapper");
  29662. for (var e = d.count(), f = 0; f < e; ++f)(c = this.getByElement(d.getItem(f),
  29663. !0)) && this.destroy(c)
  29664. } else
  29665. for (d in e) c = e[d], this.destroy(c, a)
  29666. },
  29667. finalizeCreation: function(a) {
  29668. (a = a.getFirst()) && h.isDomWidgetWrapper(a) && (this.editor.insertElement(a), a = this.getByElement(
  29669. a), a.ready = !0, a.fire("ready"), a.focus())
  29670. },
  29671. getByElement: function() {
  29672. function a(a) {
  29673. return a.is(b) && a.data("cke-widget-id")
  29674. }
  29675. var b = {
  29676. div: 1,
  29677. span: 1
  29678. };
  29679. return function(b, d) {
  29680. if (!b) return null;
  29681. var e = a(b);
  29682. if (!d && !e) {
  29683. var f = this.editor.editable();
  29684. do b = b.getParent(); while (b && !b.equals(f) && !(e = a(b)))
  29685. }
  29686. return this.instances[e] || null
  29687. }
  29688. }(),
  29689. initOn: function(a, b, c) {
  29690. b ? "string" == typeof b && (b = this.registered[b]) : b = this.registered[a.data("widget")];
  29691. if (!b) return null;
  29692. var d = this.wrapElement(a, b.name);
  29693. return d ? d.hasClass("cke_widget_new") ? (a = new h(this, this._.nextId++, a, b, c), a.isInited() ?
  29694. this.instances[a.id] = a : null) : this.getByElement(a) : null
  29695. },
  29696. initOnAll: function(a) {
  29697. a = (a || this.editor.editable()).find(".cke_widget_new");
  29698. for (var b = [], c, d = a.count(); d--;)(c = this.initOn(a.getItem(d).getFirst(h
  29699. .isDomWidgetElement))) && b.push(c);
  29700. return b
  29701. },
  29702. onWidget: function(a) {
  29703. var b =
  29704. Array.prototype.slice.call(arguments);
  29705. b.shift();
  29706. for (var c in this.instances) {
  29707. var d = this.instances[c];
  29708. d.name == a && d.on.apply(d, b)
  29709. }
  29710. this.on("instanceCreated", function(c) {
  29711. c = c.data;
  29712. c.name == a && c.on.apply(c, b)
  29713. })
  29714. },
  29715. parseElementClasses: function(a) {
  29716. if (!a) return null;
  29717. a = CKEDITOR.tools.trim(a).split(/\s+/);
  29718. for (var b, c = {}, d = 0; b = a.pop();) - 1 == b.indexOf("cke_") && (c[b] = d = 1);
  29719. return d ? c : null
  29720. },
  29721. wrapElement: function(a, b) {
  29722. var c = null,
  29723. d, e;
  29724. if (a instanceof CKEDITOR.dom.element) {
  29725. b = b || a.data("widget");
  29726. d = this.registered[b];
  29727. if (!d) return null;
  29728. if ((c = a.getParent()) && c.type == CKEDITOR.NODE_ELEMENT && c.data("cke-widget-wrapper")) return c;
  29729. a.hasAttribute("data-cke-widget-keep-attr") || a.data("cke-widget-keep-attr", a.data("widget") ? 1 :
  29730. 0);
  29731. a.data("widget", b);
  29732. (e = E(d, a.getName())) && y(a);
  29733. c = new CKEDITOR.dom.element(e ? "span" : "div", a.getDocument());
  29734. c.setAttributes(C(e, b));
  29735. c.data("cke-display-name", d.pathName ? d.pathName : a.getName());
  29736. a.getParent(!0) && c.replace(a);
  29737. a.appendTo(c)
  29738. } else if (a instanceof CKEDITOR.htmlParser.element) {
  29739. b = b || a.attributes["data-widget"];
  29740. d = this.registered[b];
  29741. if (!d) return null;
  29742. if ((c = a.parent) && c.type == CKEDITOR.NODE_ELEMENT && c.attributes["data-cke-widget-wrapper"])
  29743. return c;
  29744. "data-cke-widget-keep-attr" in a.attributes || (a.attributes["data-cke-widget-keep-attr"] = a
  29745. .attributes["data-widget"] ? 1 : 0);
  29746. b && (a.attributes["data-widget"] = b);
  29747. (e = E(d, a.name)) && y(a);
  29748. c = new CKEDITOR.htmlParser.element(e ? "span" : "div", C(e, b));
  29749. c.attributes["data-cke-display-name"] = d.pathName ? d.pathName : a.name;
  29750. d = a.parent;
  29751. var f;
  29752. d && (f = a.getIndex(), a.remove());
  29753. c.add(a);
  29754. d && D(d,
  29755. f, c)
  29756. }
  29757. return c
  29758. },
  29759. _tests_createEditableFilter: B
  29760. };
  29761. CKEDITOR.event.implementOn(q.prototype);
  29762. h.prototype = {
  29763. addClass: function(a) {
  29764. this.element.addClass(a);
  29765. this.wrapper.addClass(h.WRAPPER_CLASS_PREFIX + a)
  29766. },
  29767. applyStyle: function(a) {
  29768. I(this, a, 1)
  29769. },
  29770. checkStyleActive: function(a) {
  29771. a = J(a);
  29772. var b;
  29773. if (!a) return !1;
  29774. for (; b = a.pop();)
  29775. if (!this.hasClass(b)) return !1;
  29776. return !0
  29777. },
  29778. destroy: function(a) {
  29779. this.fire("destroy");
  29780. if (this.editables)
  29781. for (var b in this.editables) this.destroyEditable(b, a);
  29782. a || ("0" == this.element.data("cke-widget-keep-attr") &&
  29783. this.element.removeAttribute("data-widget"), this.element.removeAttributes(["data-cke-widget-data",
  29784. "data-cke-widget-keep-attr"
  29785. ]), this.element.removeClass("cke_widget_element"), this.element.replace(this.wrapper));
  29786. this.wrapper = null
  29787. },
  29788. destroyEditable: function(a, b) {
  29789. var c = this.editables[a],
  29790. d = !0;
  29791. c.removeListener("focus", N);
  29792. c.removeListener("blur", M);
  29793. this.editor.focusManager.remove(c);
  29794. if (c.filter) {
  29795. for (var e in this.repository.instances) {
  29796. var f = this.repository.instances[e];
  29797. f.editables && (f = f.editables[a]) && f !==
  29798. c && c.filter === f.filter && (d = !1)
  29799. }
  29800. d && (c.filter.destroy(), (d = this.repository._.filters[this.name]) && delete d[a])
  29801. }
  29802. b || (this.repository.destroyAll(!1, c), c.removeClass("cke_widget_editable"), c.removeClass(
  29803. "cke_widget_editable_focused"), c.removeAttributes(["contenteditable", "data-cke-widget-editable",
  29804. "data-cke-enter-mode"
  29805. ]));
  29806. delete this.editables[a]
  29807. },
  29808. edit: function() {
  29809. var a = {
  29810. dialog: this.dialog
  29811. },
  29812. b = this;
  29813. if (!1 === this.fire("edit", a) || !a.dialog) return !1;
  29814. this.editor.openDialog(a.dialog, function(a) {
  29815. var d, e;
  29816. !1 !== b.fire("dialog",
  29817. a) && (d = a.on("show", function() {
  29818. a.setupContent(b)
  29819. }), e = a.on("ok", function() {
  29820. var d, e = b.on("data", function(a) {
  29821. d = 1;
  29822. a.cancel()
  29823. }, null, null, 0);
  29824. b.editor.fire("saveSnapshot");
  29825. a.commitContent(b);
  29826. e.removeListener();
  29827. d && (b.fire("data", b.data), b.editor.fire("saveSnapshot"))
  29828. }), a.once("hide", function() {
  29829. d.removeListener();
  29830. e.removeListener()
  29831. }))
  29832. }, b);
  29833. return !0
  29834. },
  29835. getClasses: function() {
  29836. return this.repository.parseElementClasses(this.element.getAttribute("class"))
  29837. },
  29838. getClipboardHtml: function() {
  29839. var a = this.editor.createRange();
  29840. a.setStartBefore(this.wrapper);
  29841. a.setEndAfter(this.wrapper);
  29842. return this.editor.editable().getHtmlFromRange(a).getHtml()
  29843. },
  29844. hasClass: function(a) {
  29845. return this.element.hasClass(a)
  29846. },
  29847. initEditable: function(a, b) {
  29848. var c = this._findOneNotNested(b.selector);
  29849. return c && c.is(CKEDITOR.dtd.$editable) ? (c = new t(this.editor, c, {
  29850. filter: B.call(this.repository, this.name, a, b)
  29851. }), this.editables[a] = c, c.setAttributes({
  29852. contenteditable: "true",
  29853. "data-cke-widget-editable": a,
  29854. "data-cke-enter-mode": c.enterMode
  29855. }), c.filter && c.data("cke-filter",
  29856. c.filter.id), c.addClass("cke_widget_editable"), c.removeClass("cke_widget_editable_focused"), b
  29857. .pathName && c.data("cke-display-name", b.pathName), this.editor.focusManager.add(c), c.on("focus",
  29858. N, this), CKEDITOR.env.ie && c.on("blur", M, this), c._.initialSetData = !0, c.setData(c
  29859. .getHtml()), !0) : !1
  29860. },
  29861. _findOneNotNested: function(a) {
  29862. a = this.wrapper.find(a);
  29863. for (var b, c, d = 0; d < a.count(); d++)
  29864. if (b = a.getItem(d), c = b.getAscendant(h.isDomWidgetWrapper), this.wrapper.equals(c)) return b;
  29865. return null
  29866. },
  29867. isInited: function() {
  29868. return !(!this.wrapper ||
  29869. !this.inited)
  29870. },
  29871. isReady: function() {
  29872. return this.isInited() && this.ready
  29873. },
  29874. focus: function() {
  29875. var a = this.editor.getSelection();
  29876. if (a) {
  29877. var b = this.editor.checkDirty();
  29878. a.fake(this.wrapper);
  29879. !b && this.editor.resetDirty()
  29880. }
  29881. this.editor.focus()
  29882. },
  29883. refreshMask: function() {
  29884. P(this)
  29885. },
  29886. refreshParts: function(a) {
  29887. O(this, "undefined" !== typeof a ? a : !0)
  29888. },
  29889. removeClass: function(a) {
  29890. this.element.removeClass(a);
  29891. this.wrapper.removeClass(h.WRAPPER_CLASS_PREFIX + a)
  29892. },
  29893. removeStyle: function(a) {
  29894. I(this, a, 0)
  29895. },
  29896. setData: function(a, b) {
  29897. var c = this.data,
  29898. d = 0;
  29899. if ("string" == typeof a) c[a] !== b && (c[a] = b, d = 1);
  29900. else {
  29901. var e = a;
  29902. for (a in e) c[a] !== e[a] && (d = 1, c[a] = e[a])
  29903. }
  29904. d && this.dataReady && (v(this), this.fire("data", c));
  29905. return this
  29906. },
  29907. setFocused: function(a) {
  29908. this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_focused");
  29909. this.fire(a ? "focus" : "blur");
  29910. return this
  29911. },
  29912. setSelected: function(a) {
  29913. this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_selected");
  29914. this.fire(a ? "select" : "deselect");
  29915. return this
  29916. },
  29917. updateDragHandlerPosition: function() {
  29918. var a = this.editor,
  29919. b = this.element.$,
  29920. c = this._.dragHandlerOffset,
  29921. b = {
  29922. x: b.offsetLeft,
  29923. y: b.offsetTop - 15
  29924. };
  29925. c && b.x == c.x && b.y == c.y || (c = a.checkDirty(), a.fire("lockSnapshot"), this.dragHandlerContainer
  29926. .setStyles({
  29927. top: b.y + "px",
  29928. left: b.x + "px"
  29929. }), this.dragHandlerContainer.removeStyle("display"), a.fire("unlockSnapshot"), !c && a
  29930. .resetDirty(), this._.dragHandlerOffset = b)
  29931. }
  29932. };
  29933. CKEDITOR.event.implementOn(h.prototype);
  29934. h.getNestedEditable = function(a, b) {
  29935. return !b || b.equals(a) ? null : h.isDomNestedEditable(b) ? b : h.getNestedEditable(a, b.getParent())
  29936. };
  29937. h.isDomDragHandler = function(a) {
  29938. return a.type ==
  29939. CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-drag-handler")
  29940. };
  29941. h.isDomDragHandlerContainer = function(a) {
  29942. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_widget_drag_handler_container")
  29943. };
  29944. h.isDomNestedEditable = function(a) {
  29945. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-editable")
  29946. };
  29947. h.isDomWidgetElement = function(a) {
  29948. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-widget")
  29949. };
  29950. h.isDomWidgetWrapper = function(a) {
  29951. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-wrapper")
  29952. };
  29953. h.isDomWidget = function(a) {
  29954. return a ? this.isDomWidgetWrapper(a) || this.isDomWidgetElement(a) : !1
  29955. };
  29956. h.isParserWidgetElement = function(a) {
  29957. return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-widget"]
  29958. };
  29959. h.isParserWidgetWrapper = function(a) {
  29960. return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-cke-widget-wrapper"]
  29961. };
  29962. h.WRAPPER_CLASS_PREFIX = "cke_widget_wrapper_";
  29963. t.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.dom.element.prototype), {
  29964. setData: function(a) {
  29965. this._.initialSetData ||
  29966. this.editor.widgets.destroyAll(!1, this);
  29967. this._.initialSetData = !1;
  29968. a = this.editor.dataProcessor.unprotectRealComments(a);
  29969. a = this.editor.dataProcessor.unprotectSource(a);
  29970. a = this.editor.dataProcessor.toHtml(a, {
  29971. context: this.getName(),
  29972. filter: this.filter,
  29973. enterMode: this.enterMode
  29974. });
  29975. this.setHtml(a);
  29976. this.editor.widgets.initOnAll(this)
  29977. },
  29978. getData: function() {
  29979. return this.editor.dataProcessor.toDataFormat(this.getHtml(), {
  29980. context: this.getName(),
  29981. filter: this.filter,
  29982. enterMode: this.enterMode
  29983. })
  29984. }
  29985. });
  29986. var ga =
  29987. /^(?:<(?:div|span)(?: data-cke-temp="1")?(?: id="cke_copybin")?(?: data-cke-temp="1")?>)?(?:<(?:div|span)(?: style="[^"]+")?>)?<span [^>]*data-cke-copybin-start="1"[^>]*>.?<\/span>([\s\S]+)<span [^>]*data-cke-copybin-end="1"[^>]*>.?<\/span>(?:<\/(?:div|span)>)?(?:<\/(?:div|span)>)?$/i,
  29988. Q = {
  29989. 37: 1,
  29990. 38: 1,
  29991. 39: 1,
  29992. 40: 1,
  29993. 8: 1,
  29994. 46: 1
  29995. };
  29996. Q[CKEDITOR.SHIFT + 121] = 1;
  29997. var u = CKEDITOR.tools.createClass({
  29998. $: function(a, b) {
  29999. this._.createCopyBin(a, b);
  30000. this._.createListeners(b)
  30001. },
  30002. _: {
  30003. createCopyBin: function(a) {
  30004. var b = a.document,
  30005. c = CKEDITOR.env.edge && 16 <= CKEDITOR.env.version,
  30006. d = !a.blockless && !CKEDITOR.env.ie || c ? "div" : "span",
  30007. c = b.createElement(d),
  30008. b = b.createElement(d);
  30009. b.setAttributes({
  30010. id: "cke_copybin",
  30011. "data-cke-temp": "1"
  30012. });
  30013. c.setStyles({
  30014. position: "absolute",
  30015. width: "1px",
  30016. height: "1px",
  30017. overflow: "hidden"
  30018. });
  30019. c.setStyle("ltr" == a.config.contentsLangDirection ?
  30020. "left" : "right", "-5000px");
  30021. this.editor = a;
  30022. this.copyBin = c;
  30023. this.container = b
  30024. },
  30025. createListeners: function(a) {
  30026. a && (a.beforeDestroy && (this.beforeDestroy = a.beforeDestroy), a.afterDestroy && (this
  30027. .afterDestroy = a.afterDestroy))
  30028. }
  30029. },
  30030. proto: {
  30031. handle: function(a) {
  30032. var b = this.copyBin,
  30033. c = this.editor,
  30034. d = this.container,
  30035. e = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
  30036. f = c.document.getDocumentElement().$,
  30037. g = c.createRange(),
  30038. h = this,
  30039. k = CKEDITOR.env.mac && CKEDITOR.env.webkit,
  30040. n = k ? 100 : 0,
  30041. m = window.requestAnimationFrame && !k ? requestAnimationFrame : setTimeout,
  30042. p, r, q;
  30043. b.setHtml('\x3cspan data-cke-copybin-start\x3d"1"\x3e​\x3c/span\x3e' + a +
  30044. '\x3cspan data-cke-copybin-end\x3d"1"\x3e​\x3c/span\x3e');
  30045. c.fire("lockSnapshot");
  30046. d.append(b);
  30047. c.editable().append(d);
  30048. p = c.on("selectionChange", K, null, null, 0);
  30049. r = c.widgets.on("checkSelection", K, null, null, 0);
  30050. e && (q = f.scrollTop);
  30051. g.selectNodeContents(b);
  30052. g.select();
  30053. e && (f.scrollTop = q);
  30054. return new CKEDITOR.tools.promise(function(a) {
  30055. m(function() {
  30056. h.beforeDestroy && h.beforeDestroy();
  30057. d.remove();
  30058. p.removeListener();
  30059. r.removeListener();
  30060. c.fire("unlockSnapshot");
  30061. h.afterDestroy && h.afterDestroy();
  30062. a()
  30063. }, n)
  30064. })
  30065. }
  30066. },
  30067. statics: {
  30068. hasCopyBin: function(a) {
  30069. return !!u.getCopyBin(a)
  30070. },
  30071. getCopyBin: function(a) {
  30072. return a.document.getById("cke_copybin")
  30073. }
  30074. }
  30075. });
  30076. CKEDITOR.plugins.widget = h;
  30077. h.repository = q;
  30078. h.nestedEditable = t
  30079. })();
  30080. CKEDITOR.config.widget_keystrokeInsertLineBefore = CKEDITOR.SHIFT + CKEDITOR.ALT + 13;
  30081. CKEDITOR.config.widget_keystrokeInsertLineAfter = CKEDITOR.SHIFT + 13;
  30082. (function() {
  30083. function e(a, b, c) {
  30084. this.editor = a;
  30085. this.notification = null;
  30086. this._message = new CKEDITOR.template(b);
  30087. this._singularMessage = c ? new CKEDITOR.template(c) : null;
  30088. this._tasks = [];
  30089. this._doneTasks = this._doneWeights = this._totalWeights = 0
  30090. }
  30091. function d(a) {
  30092. this._weight = a || 1;
  30093. this._doneWeight = 0;
  30094. this._isCanceled = !1
  30095. }
  30096. CKEDITOR.plugins.add("notificationaggregator", {
  30097. requires: "notification"
  30098. });
  30099. e.prototype = {
  30100. createTask: function(a) {
  30101. a = a || {};
  30102. var b = !this.notification,
  30103. c;
  30104. b && (this.notification = this._createNotification());
  30105. c = this._addTask(a);
  30106. c.on("updated", this._onTaskUpdate, this);
  30107. c.on("done", this._onTaskDone, this);
  30108. c.on("canceled", function() {
  30109. this._removeTask(c)
  30110. }, this);
  30111. this.update();
  30112. b && this.notification.show();
  30113. return c
  30114. },
  30115. update: function() {
  30116. this._updateNotification();
  30117. this.isFinished() && this.fire("finished")
  30118. },
  30119. getPercentage: function() {
  30120. return 0 === this.getTaskCount() ? 1 : this._doneWeights / this._totalWeights
  30121. },
  30122. isFinished: function() {
  30123. return this.getDoneTaskCount() === this.getTaskCount()
  30124. },
  30125. getTaskCount: function() {
  30126. return this._tasks.length
  30127. },
  30128. getDoneTaskCount: function() {
  30129. return this._doneTasks
  30130. },
  30131. _updateNotification: function() {
  30132. this.notification.update({
  30133. message: this._getNotificationMessage(),
  30134. progress: this.getPercentage()
  30135. })
  30136. },
  30137. _getNotificationMessage: function() {
  30138. var a = this.getTaskCount(),
  30139. b = {
  30140. current: this.getDoneTaskCount(),
  30141. max: a,
  30142. percentage: Math.round(100 * this.getPercentage())
  30143. };
  30144. return (1 == a && this._singularMessage ? this._singularMessage : this._message).output(b)
  30145. },
  30146. _createNotification: function() {
  30147. return new CKEDITOR.plugins.notification(this.editor, {
  30148. type: "progress"
  30149. })
  30150. },
  30151. _addTask: function(a) {
  30152. a = new d(a.weight);
  30153. this._tasks.push(a);
  30154. this._totalWeights += a._weight;
  30155. return a
  30156. },
  30157. _removeTask: function(a) {
  30158. var b = CKEDITOR.tools.indexOf(this._tasks, a); - 1 !== b && (a._doneWeight && (this._doneWeights -= a
  30159. ._doneWeight), this._totalWeights -= a._weight, this._tasks.splice(b, 1), this.update())
  30160. },
  30161. _onTaskUpdate: function(a) {
  30162. this._doneWeights += a.data;
  30163. this.update()
  30164. },
  30165. _onTaskDone: function() {
  30166. this._doneTasks += 1;
  30167. this.update()
  30168. }
  30169. };
  30170. CKEDITOR.event.implementOn(e.prototype);
  30171. d.prototype = {
  30172. done: function() {
  30173. this.update(this._weight)
  30174. },
  30175. update: function(a) {
  30176. if (!this.isDone() &&
  30177. !this.isCanceled()) {
  30178. a = Math.min(this._weight, a);
  30179. var b = a - this._doneWeight;
  30180. this._doneWeight = a;
  30181. this.fire("updated", b);
  30182. this.isDone() && this.fire("done")
  30183. }
  30184. },
  30185. cancel: function() {
  30186. this.isDone() || this.isCanceled() || (this._isCanceled = !0, this.fire("canceled"))
  30187. },
  30188. isDone: function() {
  30189. return this._weight === this._doneWeight
  30190. },
  30191. isCanceled: function() {
  30192. return this._isCanceled
  30193. }
  30194. };
  30195. CKEDITOR.event.implementOn(d.prototype);
  30196. CKEDITOR.plugins.notificationAggregator = e;
  30197. CKEDITOR.plugins.notificationAggregator.task = d
  30198. })();
  30199. (function() {
  30200. CKEDITOR.plugins.add("uploadwidget", {
  30201. requires: "widget,clipboard,filetools,notificationaggregator",
  30202. init: function(a) {
  30203. a.filter.allow("*[!data-widget,!data-cke-upload-id]")
  30204. },
  30205. isSupportedEnvironment: function() {
  30206. return CKEDITOR.plugins.clipboard.isFileApiSupported
  30207. }
  30208. });
  30209. CKEDITOR.fileTools || (CKEDITOR.fileTools = {});
  30210. CKEDITOR.tools.extend(CKEDITOR.fileTools, {
  30211. addUploadWidget: function(a, c, e) {
  30212. var g = CKEDITOR.fileTools,
  30213. b = a.uploadRepository,
  30214. m = e.supportedTypes ? 10 : 20;
  30215. CKEDITOR.plugins.clipboard.addFileMatcher(a,
  30216. function(a) {
  30217. return e.supportedTypes ? g.isTypeSupported(a, e.supportedTypes) : !0
  30218. });
  30219. if (e.fileToElement) a.on("paste", function(d) {
  30220. d = d.data;
  30221. var l = a.widgets.registered[c],
  30222. k = d.dataTransfer,
  30223. e = k.getFilesCount(),
  30224. h = l.loadMethod || "loadAndUpload",
  30225. f, n;
  30226. if (!d.dataValue && e)
  30227. for (n = 0; n < e; n++)
  30228. if (f = k.getFile(n), !l.supportedTypes || g.isTypeSupported(f, l.supportedTypes)) {
  30229. var m = l.fileToElement(f);
  30230. f = b.create(f, void 0, l.loaderType);
  30231. m && (f[h](l.uploadUrl, l.additionalRequestParameters), CKEDITOR.fileTools.markElement(m,
  30232. c, f.id), "loadAndUpload" !=
  30233. h && "upload" != h || l.skipNotifications || CKEDITOR.fileTools.bindNotifications(a,
  30234. f), d.dataValue += m.getOuterHtml())
  30235. }
  30236. }, null, null, m);
  30237. CKEDITOR.tools.extend(e, {
  30238. downcast: function() {
  30239. return new CKEDITOR.htmlParser.text("")
  30240. },
  30241. init: function() {
  30242. var d = this,
  30243. c = this.wrapper.findOne("[data-cke-upload-id]").data("cke-upload-id"),
  30244. k = b.loaders[c],
  30245. e = CKEDITOR.tools.capitalize,
  30246. h, f;
  30247. k.on("update", function(b) {
  30248. if ("abort" === k.status && "function" === typeof d.onAbort) d.onAbort(k);
  30249. if (d.wrapper && d.wrapper.getParent()) {
  30250. a.fire("lockSnapshot");
  30251. b = "on" + e(k.status);
  30252. if ("abort" === k.status || "function" !== typeof d[b] || !1 !== d[b](k)) f =
  30253. "cke_upload_" + k.status, d.wrapper && f != h && (h && d.wrapper.removeClass(h), d
  30254. .wrapper.addClass(f), h = f), "error" != k.status && "abort" != k.status || a
  30255. .widgets.del(d);
  30256. a.fire("unlockSnapshot")
  30257. } else CKEDITOR.instances[a.name] && a.editable().find('[data-cke-upload-id\x3d"' +
  30258. c + '"]').count() || k.abort(), b.removeListener()
  30259. });
  30260. k.update()
  30261. },
  30262. replaceWith: function(d, c) {
  30263. if ("" === d.trim()) a.widgets.del(this);
  30264. else {
  30265. var b = this == a.widgets.focused,
  30266. e = a.editable(),
  30267. h = a.createRange(),
  30268. f, g;
  30269. b || (g = a.getSelection().createBookmarks());
  30270. h.setStartBefore(this.wrapper);
  30271. h.setEndAfter(this.wrapper);
  30272. b && (f = h.createBookmark());
  30273. e.insertHtmlIntoRange(d, h, c);
  30274. a.widgets.checkWidgets({
  30275. initOnlyNew: !0
  30276. });
  30277. a.widgets.destroy(this, !0);
  30278. b ? (h.moveToBookmark(f), h.select()) : a.getSelection().selectBookmarks(g);
  30279. a.fire("change")
  30280. }
  30281. },
  30282. _getLoader: function() {
  30283. var a = this.wrapper.findOne("[data-cke-upload-id]");
  30284. return a ? this.editor.uploadRepository.loaders[a.data("cke-upload-id")] : null
  30285. }
  30286. });
  30287. a.widgets.add(c,
  30288. e)
  30289. },
  30290. markElement: function(a, c, e) {
  30291. a.setAttributes({
  30292. "data-cke-upload-id": e,
  30293. "data-widget": c
  30294. })
  30295. },
  30296. bindNotifications: function(a, c) {
  30297. function e() {
  30298. g = a._.uploadWidgetNotificaionAggregator;
  30299. if (!g || g.isFinished()) g = a._.uploadWidgetNotificaionAggregator = new CKEDITOR.plugins
  30300. .notificationAggregator(a, a.lang.uploadwidget.uploadMany, a.lang.uploadwidget.uploadOne), g.once(
  30301. "finished",
  30302. function() {
  30303. var b = g.getTaskCount();
  30304. 0 === b ? g.notification.hide() : g.notification.update({
  30305. message: 1 == b ? a.lang.uploadwidget.doneOne : a.lang.uploadwidget.doneMany.replace(
  30306. "%1",
  30307. b),
  30308. type: "success",
  30309. important: 1
  30310. })
  30311. })
  30312. }
  30313. var g, b = null;
  30314. c.on("update", function() {
  30315. !b && c.uploadTotal && (e(), b = g.createTask({
  30316. weight: c.uploadTotal
  30317. }));
  30318. b && "uploading" == c.status && b.update(c.uploaded)
  30319. });
  30320. c.on("uploaded", function() {
  30321. b && b.done()
  30322. });
  30323. c.on("error", function() {
  30324. b && b.cancel();
  30325. a.showNotification(c.message, "warning")
  30326. });
  30327. c.on("abort", function() {
  30328. b && b.cancel();
  30329. CKEDITOR.instances[a.name] && a.showNotification(a.lang.uploadwidget.abort, "info")
  30330. })
  30331. }
  30332. })
  30333. })();
  30334. (function() {
  30335. function l(a) {
  30336. 9 >= a && (a = "0" + a);
  30337. return String(a)
  30338. }
  30339. function n(a) {
  30340. var b = new Date,
  30341. b = [b.getFullYear(), b.getMonth() + 1, b.getDate(), b.getHours(), b.getMinutes(), b.getSeconds()];
  30342. d += 1;
  30343. return "image-" + CKEDITOR.tools.array.map(b, l).join("") + "-" + d + "." + a
  30344. }
  30345. var d = 0;
  30346. CKEDITOR.plugins.add("uploadimage", {
  30347. requires: "uploadwidget",
  30348. onLoad: function() {
  30349. CKEDITOR.addCss(".cke_upload_uploading img{opacity: 0.3}")
  30350. },
  30351. isSupportedEnvironment: function() {
  30352. return CKEDITOR.plugins.clipboard.isFileApiSupported
  30353. },
  30354. init: function(a) {
  30355. if (this.isSupportedEnvironment()) {
  30356. var b =
  30357. CKEDITOR.fileTools,
  30358. d = b.getUploadUrl(a.config, "image");
  30359. d && (a.config.clipboard_handleImages && (a.config.clipboard_handleImages = !1, CKEDITOR.warn(
  30360. "clipboard-image-handling-disabled", {
  30361. editor: a.name,
  30362. plugin: "uploadimage"
  30363. })), b.addUploadWidget(a, "uploadimage", {
  30364. supportedTypes: a.config.uploadImage_supportedTypes,
  30365. uploadUrl: d,
  30366. fileToElement: function() {
  30367. var a = new CKEDITOR.dom.element("img");
  30368. a.setAttribute("src",
  30369. "data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs\x3d"
  30370. );
  30371. return a
  30372. },
  30373. parts: {
  30374. img: "img"
  30375. },
  30376. onUploading: function(a) {
  30377. this.parts.img.setAttribute("src", a.data)
  30378. },
  30379. onUploaded: function(a) {
  30380. var b = this.parts.img.$;
  30381. this.replaceWith('\x3cimg src\x3d"' + a.url + '" width\x3d"' + (a.responseData.width ||
  30382. b.naturalWidth) + '" height\x3d"' + (a.responseData.height || b.naturalHeight) +
  30383. '"\x3e')
  30384. }
  30385. }), a.on("paste", function(g) {
  30386. if (g.data.dataValue.match(/<img[\s\S]+data:/i)) {
  30387. g = g.data;
  30388. var e = document.implementation.createHTMLDocument(""),
  30389. e = new CKEDITOR.dom.element(e.body),
  30390. m, f, k;
  30391. e.data("cke-editable", 1);
  30392. e.appendHtml(g.dataValue);
  30393. m = e.find("img");
  30394. for (k = 0; k < m.count(); k++) {
  30395. f = m.getItem(k);
  30396. var c = f.getAttribute("src"),
  30397. h = c && "data:" == c.substring(0, 5),
  30398. l = null === f.data("cke-realelement");
  30399. h && l && !f.data("cke-upload-id") && !f.isReadOnly(1) && (h = (h = c.match(
  30400. /image\/([a-z]+?);/i)) && h[1] || "jpg", c = a.uploadRepository.create(c, n(h)), c
  30401. .upload(d), b.markElement(f, "uploadimage", c.id), b.bindNotifications(a, c))
  30402. }
  30403. g.dataValue = e.getHtml()
  30404. }
  30405. }))
  30406. }
  30407. }
  30408. });
  30409. CKEDITOR.config.uploadImage_supportedTypes = /image\/(jpeg|png|gif|bmp)/
  30410. })();
  30411. CKEDITOR.config.plugins =
  30412. 'dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,notification,button,toolbar,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,xml,ajax,templates,menu,contextmenu,copyformatting,div,editorplaceholder,resize,elementspath,enterkey,entities,exportpdf,popup,filetools,filebrowser,find,floatingspace,listblock,richcombo,font,fakeobjects,forms,format,horizontalrule,htmlwriter,iframe,wysiwygarea,image,indent,indentblock,indentlist,smiley,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastetools,pastefromgdocs,pastefromlibreoffice,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,scayt,stylescombo,tab,table,tabletools,tableselection,undo,lineutils,widgetselection,widget,notificationaggregator,uploadwidget,uploadimage';
  30413. CKEDITOR.config.skin = 'moono-lisa';
  30414. (function() {
  30415. var setIcons = function(icons, strip) {
  30416. var path = CKEDITOR.getUrl('plugins/' + strip);
  30417. icons = icons.split(',');
  30418. for (var i = 0; i < icons.length; i++) CKEDITOR.skin.icons[icons[i]] = {
  30419. path: path,
  30420. offset: -icons[++i],
  30421. bgsize: icons[++i]
  30422. };
  30423. };
  30424. if (CKEDITOR.env.hidpi) setIcons(
  30425. '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,,bgcolor,384,,textcolor,408,,templates-rtl,432,,templates,456,,copyformatting,480,,creatediv,504,,exportpdf,528,,find-rtl,552,,find,576,,replace,600,,button,624,,checkbox,648,,form,672,,hiddenfield,696,,imagebutton,720,,radio,744,,select-rtl,768,,select,792,,textarea-rtl,816,,textarea,840,,textfield-rtl,864,,textfield,888,,horizontalrule,912,,iframe,936,,image,960,,indent-rtl,984,,indent,1008,,outdent-rtl,1032,,outdent,1056,,smiley,1080,,justifyblock,1104,,justifycenter,1128,,justifyleft,1152,,justifyright,1176,,language,1200,,anchor-rtl,1224,,anchor,1248,,link,1272,,unlink,1296,,bulletedlist-rtl,1320,,bulletedlist,1344,,numberedlist-rtl,1368,,numberedlist,1392,,maximize,1416,,newpage-rtl,1440,,newpage,1464,,pagebreak-rtl,1488,,pagebreak,1512,,pastetext-rtl,1536,,pastetext,1560,,pastefromword-rtl,1584,,pastefromword,1608,,preview-rtl,1632,,preview,1656,,print,1680,,removeformat,1704,,save,1728,,selectall,1752,,showblocks-rtl,1776,,showblocks,1800,,source-rtl,1824,,source,1848,,specialchar,1872,,scayt,1896,,table,1920,,redo-rtl,1944,,redo,1968,,undo-rtl,1992,,undo,2016,',
  30426. 'icons_hidpi.png');
  30427. else setIcons(
  30428. '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,bgcolor,384,auto,textcolor,408,auto,templates-rtl,432,auto,templates,456,auto,copyformatting,480,auto,creatediv,504,auto,exportpdf,528,auto,find-rtl,552,auto,find,576,auto,replace,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,imagebutton,720,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,image,960,auto,indent-rtl,984,auto,indent,1008,auto,outdent-rtl,1032,auto,outdent,1056,auto,smiley,1080,auto,justifyblock,1104,auto,justifycenter,1128,auto,justifyleft,1152,auto,justifyright,1176,auto,language,1200,auto,anchor-rtl,1224,auto,anchor,1248,auto,link,1272,auto,unlink,1296,auto,bulletedlist-rtl,1320,auto,bulletedlist,1344,auto,numberedlist-rtl,1368,auto,numberedlist,1392,auto,maximize,1416,auto,newpage-rtl,1440,auto,newpage,1464,auto,pagebreak-rtl,1488,auto,pagebreak,1512,auto,pastetext-rtl,1536,auto,pastetext,1560,auto,pastefromword-rtl,1584,auto,pastefromword,1608,auto,preview-rtl,1632,auto,preview,1656,auto,print,1680,auto,removeformat,1704,auto,save,1728,auto,selectall,1752,auto,showblocks-rtl,1776,auto,showblocks,1800,auto,source-rtl,1824,auto,source,1848,auto,specialchar,1872,auto,scayt,1896,auto,table,1920,auto,redo-rtl,1944,auto,redo,1968,auto,undo-rtl,1992,auto,undo,2016,auto',
  30429. 'icons.png');
  30430. })();
  30431. CKEDITOR.lang.languages = {
  30432. "af": 1,
  30433. "sq": 1,
  30434. "ar": 1,
  30435. "az": 1,
  30436. "eu": 1,
  30437. "bn": 1,
  30438. "bs": 1,
  30439. "bg": 1,
  30440. "ca": 1,
  30441. "zh-cn": 1,
  30442. "zh": 1,
  30443. "hr": 1,
  30444. "cs": 1,
  30445. "da": 1,
  30446. "nl": 1,
  30447. "en": 1,
  30448. "en-au": 1,
  30449. "en-ca": 1,
  30450. "en-gb": 1,
  30451. "eo": 1,
  30452. "et": 1,
  30453. "fo": 1,
  30454. "fi": 1,
  30455. "fr": 1,
  30456. "fr-ca": 1,
  30457. "gl": 1,
  30458. "ka": 1,
  30459. "de": 1,
  30460. "de-ch": 1,
  30461. "el": 1,
  30462. "gu": 1,
  30463. "he": 1,
  30464. "hi": 1,
  30465. "hu": 1,
  30466. "is": 1,
  30467. "id": 1,
  30468. "it": 1,
  30469. "ja": 1,
  30470. "km": 1,
  30471. "ko": 1,
  30472. "ku": 1,
  30473. "lv": 1,
  30474. "lt": 1,
  30475. "mk": 1,
  30476. "ms": 1,
  30477. "mn": 1,
  30478. "no": 1,
  30479. "nb": 1,
  30480. "oc": 1,
  30481. "fa": 1,
  30482. "pl": 1,
  30483. "pt-br": 1,
  30484. "pt": 1,
  30485. "ro": 1,
  30486. "ru": 1,
  30487. "sr": 1,
  30488. "sr-latn": 1,
  30489. "si": 1,
  30490. "sk": 1,
  30491. "sl": 1,
  30492. "es": 1,
  30493. "es-mx": 1,
  30494. "sv": 1,
  30495. "tt": 1,
  30496. "th": 1,
  30497. "tr": 1,
  30498. "ug": 1,
  30499. "uk": 1,
  30500. "vi": 1,
  30501. "cy": 1
  30502. };
  30503. }());