ckeditor.js 1.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656
  1. /*
  2. Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. (function () {
  6. if (window.CKEDITOR && window.CKEDITOR.dom) return;
  7. window.CKEDITOR || (window.CKEDITOR = function () {
  8. var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i, d = {
  9. timestamp: "J39A",
  10. version: "4.11.4",
  11. revision: "e1836357e",
  12. rnd: Math.floor(900 * Math.random()) + 100,
  13. _: {pending: [], basePathSrcPattern: a},
  14. status: "unloaded",
  15. basePath: function () {
  16. var b = window.CKEDITOR_BASEPATH || "";
  17. if (!b) for (var c = document.getElementsByTagName("script"), d = 0; d < c.length; d++) {
  18. var h = c[d].src.match(a);
  19. if (h) {
  20. b = h[1];
  21. break
  22. }
  23. }
  24. -1 == b.indexOf(":/") && "//" != b.slice(0, 2) && (b = 0 === b.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] +
  25. b : location.href.match(/^[^\?]*\/(?:)/)[0] + b);
  26. if (!b) throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
  27. return b
  28. }(),
  29. getUrl: function (a) {
  30. -1 == a.indexOf(":/") && 0 !== a.indexOf("/") && (a = this.basePath + a);
  31. this.timestamp && "/" != a.charAt(a.length - 1) && !/[&?]t=/.test(a) && (a += (0 <= a.indexOf("?") ? "\x26" : "?") + "t\x3d" + this.timestamp);
  32. return a
  33. },
  34. domReady: function () {
  35. function a() {
  36. try {
  37. document.addEventListener ? (document.removeEventListener("DOMContentLoaded",
  38. a, !1), b()) : document.attachEvent && "complete" === document.readyState && (document.detachEvent("onreadystatechange", a), b())
  39. } catch (c) {
  40. }
  41. }
  42. function b() {
  43. for (var a; a = c.shift();) a()
  44. }
  45. var c = [];
  46. return function (b) {
  47. function p() {
  48. try {
  49. document.documentElement.doScroll("left")
  50. } catch (b) {
  51. setTimeout(p, 1);
  52. return
  53. }
  54. a()
  55. }
  56. c.push(b);
  57. "complete" === document.readyState && setTimeout(a, 1);
  58. if (1 == c.length) if (document.addEventListener) document.addEventListener("DOMContentLoaded", a, !1), window.addEventListener("load", a, !1); else if (document.attachEvent) {
  59. document.attachEvent("onreadystatechange",
  60. a);
  61. window.attachEvent("onload", a);
  62. b = !1;
  63. try {
  64. b = !window.frameElement
  65. } catch (d) {
  66. }
  67. document.documentElement.doScroll && b && p()
  68. }
  69. }
  70. }()
  71. }, b = window.CKEDITOR_GETURL;
  72. if (b) {
  73. var c = d.getUrl;
  74. d.getUrl = function (a) {
  75. return b.call(d, a) || c.call(d, a)
  76. }
  77. }
  78. return d
  79. }());
  80. CKEDITOR.event || (CKEDITOR.event = function () {
  81. }, CKEDITOR.event.implementOn = function (a) {
  82. var d = CKEDITOR.event.prototype, b;
  83. for (b in d) null == a[b] && (a[b] = d[b])
  84. }, CKEDITOR.event.prototype = function () {
  85. function a(a) {
  86. var f = d(this);
  87. return f[a] || (f[a] = new b(a))
  88. }
  89. var d = function (a) {
  90. a = a.getPrivate && a.getPrivate() || a._ || (a._ = {});
  91. return a.events || (a.events = {})
  92. }, b = function (a) {
  93. this.name = a;
  94. this.listeners = []
  95. };
  96. b.prototype = {
  97. getListenerIndex: function (a) {
  98. for (var b = 0, d = this.listeners; b < d.length; b++) if (d[b].fn == a) return b;
  99. return -1
  100. }
  101. };
  102. return {
  103. define: function (b, d) {
  104. var g = a.call(this, b);
  105. CKEDITOR.tools.extend(g, d, !0)
  106. }, on: function (b, d, g, k, h) {
  107. function p(a, y, v, e) {
  108. a = {
  109. name: b,
  110. sender: this,
  111. editor: a,
  112. data: y,
  113. listenerData: k,
  114. stop: v,
  115. cancel: e,
  116. removeListener: q
  117. };
  118. return !1 === d.call(g, a) ? !1 : a.data
  119. }
  120. function q() {
  121. y.removeListener(b, d)
  122. }
  123. var e = a.call(this, b);
  124. if (0 > e.getListenerIndex(d)) {
  125. e = e.listeners;
  126. g || (g = this);
  127. isNaN(h) && (h = 10);
  128. var y = this;
  129. p.fn = d;
  130. p.priority = h;
  131. for (var v = e.length - 1; 0 <= v; v--) if (e[v].priority <= h) return e.splice(v + 1, 0, p), {removeListener: q};
  132. e.unshift(p)
  133. }
  134. return {removeListener: q}
  135. },
  136. once: function () {
  137. var a = Array.prototype.slice.call(arguments), b = a[1];
  138. a[1] = function (a) {
  139. a.removeListener();
  140. return b.apply(this, arguments)
  141. };
  142. return this.on.apply(this, a)
  143. }, capture: function () {
  144. CKEDITOR.event.useCapture = 1;
  145. var a = this.on.apply(this, arguments);
  146. CKEDITOR.event.useCapture = 0;
  147. return a
  148. }, fire: function () {
  149. var a = 0, b = function () {
  150. a = 1
  151. }, g = 0, k = function () {
  152. g = 1
  153. };
  154. return function (h, p, q) {
  155. var e = d(this)[h];
  156. h = a;
  157. var y = g;
  158. a = g = 0;
  159. if (e) {
  160. var v = e.listeners;
  161. if (v.length) for (var v = v.slice(0), x, F = 0; F < v.length; F++) {
  162. if (e.errorProof) try {
  163. x =
  164. v[F].call(this, q, p, b, k)
  165. } catch (u) {
  166. } else x = v[F].call(this, q, p, b, k);
  167. !1 === x ? g = 1 : "undefined" != typeof x && (p = x);
  168. if (a || g) break
  169. }
  170. }
  171. p = g ? !1 : "undefined" == typeof p ? !0 : p;
  172. a = h;
  173. g = y;
  174. return p
  175. }
  176. }(), fireOnce: function (a, b, g) {
  177. b = this.fire(a, b, g);
  178. delete d(this)[a];
  179. return b
  180. }, removeListener: function (a, b) {
  181. var g = d(this)[a];
  182. if (g) {
  183. var k = g.getListenerIndex(b);
  184. 0 <= k && g.listeners.splice(k, 1)
  185. }
  186. }, removeAllListeners: function () {
  187. var a = d(this), b;
  188. for (b in a) delete a[b]
  189. }, hasListeners: function (a) {
  190. return (a = d(this)[a]) && 0 < a.listeners.length
  191. }
  192. }
  193. }());
  194. CKEDITOR.editor || (CKEDITOR.editor = function () {
  195. CKEDITOR._.pending.push([this, arguments]);
  196. CKEDITOR.event.call(this)
  197. }, CKEDITOR.editor.prototype.fire = function (a, d) {
  198. a in {instanceReady: 1, loaded: 1} && (this[a] = !0);
  199. return CKEDITOR.event.prototype.fire.call(this, a, d, this)
  200. }, CKEDITOR.editor.prototype.fireOnce = function (a, d) {
  201. a in {instanceReady: 1, loaded: 1} && (this[a] = !0);
  202. return CKEDITOR.event.prototype.fireOnce.call(this, a, d, this)
  203. }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
  204. CKEDITOR.env || (CKEDITOR.env = function () {
  205. var a = navigator.userAgent.toLowerCase(), d = a.match(/edge[ \/](\d+.?\d*)/), b = -1 < a.indexOf("trident/"),
  206. b = !(!d && !b), b = {
  207. ie: b,
  208. edge: !!d,
  209. webkit: !b && -1 < a.indexOf(" applewebkit/"),
  210. air: -1 < a.indexOf(" adobeair/"),
  211. mac: -1 < a.indexOf("macintosh"),
  212. quirks: "BackCompat" == document.compatMode && (!document.documentMode || 10 > document.documentMode),
  213. mobile: -1 < a.indexOf("mobile"),
  214. iOS: /(ipad|iphone|ipod)/.test(a),
  215. isCustomDomain: function () {
  216. if (!this.ie) return !1;
  217. var a = document.domain, b = window.location.hostname;
  218. return a != b && a != "[" + b + "]"
  219. },
  220. secure: "https:" == location.protocol
  221. };
  222. b.gecko = "Gecko" == navigator.product && !b.webkit && !b.ie;
  223. b.webkit && (-1 < a.indexOf("chrome") ? b.chrome = !0 : b.safari = !0);
  224. var c = 0;
  225. b.ie && (c = d ? parseFloat(d[1]) : b.quirks || !document.documentMode ? parseFloat(a.match(/msie (\d+)/)[1]) : document.documentMode, b.ie9Compat = 9 == c, b.ie8Compat = 8 == c, b.ie7Compat = 7 == c, b.ie6Compat = 7 > c || b.quirks);
  226. b.gecko && (d = a.match(/rv:([\d\.]+)/)) && (d = d[1].split("."), c = 1E4 * d[0] + 100 * (d[1] || 0) + 1 * (d[2] || 0));
  227. b.air && (c = parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
  228. b.webkit && (c = parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
  229. b.version = c;
  230. b.isCompatible = !(b.ie && 7 > c) && !(b.gecko && 4E4 > c) && !(b.webkit && 534 > c);
  231. b.hidpi = 2 <= window.devicePixelRatio;
  232. b.needsBrFiller = b.gecko || b.webkit || b.ie && 10 < c;
  233. b.needsNbspFiller = b.ie && 11 > c;
  234. b.cssClass = "cke_browser_" + (b.ie ? "ie" : b.gecko ? "gecko" : b.webkit ? "webkit" : "unknown");
  235. b.quirks && (b.cssClass += " cke_browser_quirks");
  236. b.ie && (b.cssClass += " cke_browser_ie" + (b.quirks ? "6 cke_browser_iequirks" : b.version));
  237. b.air && (b.cssClass += " cke_browser_air");
  238. b.iOS && (b.cssClass += " cke_browser_ios");
  239. b.hidpi && (b.cssClass += " cke_hidpi");
  240. return b
  241. }());
  242. "unloaded" == CKEDITOR.status && function () {
  243. CKEDITOR.event.implementOn(CKEDITOR);
  244. CKEDITOR.loadFullCore = function () {
  245. if ("basic_ready" != CKEDITOR.status) CKEDITOR.loadFullCore._load = 1; else {
  246. delete CKEDITOR.loadFullCore;
  247. var a = document.createElement("script");
  248. a.type = "text/javascript";
  249. a.src = CKEDITOR.basePath + "ckeditor.js";
  250. document.getElementsByTagName("head")[0].appendChild(a)
  251. }
  252. };
  253. CKEDITOR.loadFullCoreTimeout = 0;
  254. CKEDITOR.add = function (a) {
  255. (this._.pending || (this._.pending = [])).push(a)
  256. };
  257. (function () {
  258. CKEDITOR.domReady(function () {
  259. var a =
  260. CKEDITOR.loadFullCore, d = CKEDITOR.loadFullCoreTimeout;
  261. a && (CKEDITOR.status = "basic_ready", a && a._load ? a() : d && setTimeout(function () {
  262. CKEDITOR.loadFullCore && CKEDITOR.loadFullCore()
  263. }, 1E3 * d))
  264. })
  265. })();
  266. CKEDITOR.status = "basic_loaded"
  267. }();
  268. "use strict";
  269. CKEDITOR.VERBOSITY_WARN = 1;
  270. CKEDITOR.VERBOSITY_ERROR = 2;
  271. CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR;
  272. CKEDITOR.warn = function (a, d) {
  273. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN && CKEDITOR.fire("log", {
  274. type: "warn",
  275. errorCode: a,
  276. additionalData: d
  277. })
  278. };
  279. CKEDITOR.error = function (a, d) {
  280. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR && CKEDITOR.fire("log", {
  281. type: "error",
  282. errorCode: a,
  283. additionalData: d
  284. })
  285. };
  286. CKEDITOR.on("log", function (a) {
  287. if (window.console && window.console.log) {
  288. var d = console[a.data.type] ? a.data.type : "log", b = a.data.errorCode;
  289. if (a = a.data.additionalData) console[d]("[CKEDITOR] Error code: " + b + ".", a); else console[d]("[CKEDITOR] Error code: " + b + ".");
  290. console[d]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#" + b)
  291. }
  292. }, null, null, 999);
  293. CKEDITOR.dom = {};
  294. (function () {
  295. function a(a, b, e) {
  296. this._minInterval = a;
  297. this._context = e;
  298. this._lastOutput = this._scheduledTimer = 0;
  299. this._output = CKEDITOR.tools.bind(b, e || {});
  300. var c = this;
  301. this.input = function () {
  302. function a() {
  303. c._lastOutput = (new Date).getTime();
  304. c._scheduledTimer = 0;
  305. c._call()
  306. }
  307. if (!c._scheduledTimer || !1 !== c._reschedule()) {
  308. var y = (new Date).getTime() - c._lastOutput;
  309. y < c._minInterval ? c._scheduledTimer = setTimeout(a, c._minInterval - y) : a()
  310. }
  311. }
  312. }
  313. function d(y, b, e) {
  314. a.call(this, y, b, e);
  315. this._args = [];
  316. var c = this;
  317. this.input = CKEDITOR.tools.override(this.input,
  318. function (a) {
  319. return function () {
  320. c._args = Array.prototype.slice.call(arguments);
  321. a.call(this)
  322. }
  323. })
  324. }
  325. var b = [], c = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "",
  326. f = /&/g, g = />/g, k = /</g, h = /"/g, p = /&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,
  327. q = {lt: "\x3c", gt: "\x3e", amp: "\x26", quot: '"', nbsp: " ", shy: "­"}, e = function (a, b) {
  328. return "#" == b[0] ? String.fromCharCode(parseInt(b.slice(1), 10)) : q[b]
  329. };
  330. CKEDITOR.on("reset", function () {
  331. b = []
  332. });
  333. CKEDITOR.tools = {
  334. arrayCompare: function (a, b) {
  335. if (!a && !b) return !0;
  336. if (!a || !b || a.length != b.length) return !1;
  337. for (var e = 0; e < a.length; e++) if (a[e] != b[e]) return !1;
  338. return !0
  339. },
  340. getIndex: function (a, b) {
  341. for (var e = 0; e < a.length; ++e) if (b(a[e])) return e;
  342. return -1
  343. },
  344. clone: function (a) {
  345. var b;
  346. if (a && a instanceof Array) {
  347. b = [];
  348. for (var e = 0; e < a.length; e++) b[e] = CKEDITOR.tools.clone(a[e]);
  349. return b
  350. }
  351. if (null === a || "object" != typeof a || a instanceof String || a instanceof Number || a instanceof Boolean || a instanceof Date || a instanceof RegExp || a.nodeType || a.window === a) return a;
  352. b = new a.constructor;
  353. for (e in a) b[e] =
  354. CKEDITOR.tools.clone(a[e]);
  355. return b
  356. },
  357. capitalize: function (a, b) {
  358. return a.charAt(0).toUpperCase() + (b ? a.slice(1) : a.slice(1).toLowerCase())
  359. },
  360. extend: function (a) {
  361. var b = arguments.length, e, c;
  362. "boolean" == typeof (e = arguments[b - 1]) ? b-- : "boolean" == typeof (e = arguments[b - 2]) && (c = arguments[b - 1], b -= 2);
  363. for (var h = 1; h < b; h++) {
  364. var m = arguments[h], d;
  365. for (d in m) if (!0 === e || null == a[d]) if (!c || d in c) a[d] = m[d]
  366. }
  367. return a
  368. },
  369. prototypedCopy: function (a) {
  370. var b = function () {
  371. };
  372. b.prototype = a;
  373. return new b
  374. },
  375. copy: function (a) {
  376. var b = {}, e;
  377. for (e in a) b[e] =
  378. a[e];
  379. return b
  380. },
  381. isArray: function (a) {
  382. return "[object Array]" == Object.prototype.toString.call(a)
  383. },
  384. isEmpty: function (a) {
  385. for (var b in a) if (a.hasOwnProperty(b)) return !1;
  386. return !0
  387. },
  388. cssVendorPrefix: function (a, b, e) {
  389. if (e) return c + a + ":" + b + ";" + a + ":" + b;
  390. e = {};
  391. e[a] = b;
  392. e[c + a] = b;
  393. return e
  394. },
  395. cssStyleToDomStyle: function () {
  396. var a = document.createElement("div").style,
  397. b = "undefined" != typeof a.cssFloat ? "cssFloat" : "undefined" != typeof a.styleFloat ? "styleFloat" : "float";
  398. return function (a) {
  399. return "float" == a ? b : a.replace(/-./g, function (a) {
  400. return a.substr(1).toUpperCase()
  401. })
  402. }
  403. }(),
  404. buildStyleHtml: function (a) {
  405. a = [].concat(a);
  406. for (var b, e = [], c = 0; c < a.length; c++) if (b = a[c]) /@import|[{}]/.test(b) ? e.push("\x3cstyle\x3e" + b + "\x3c/style\x3e") : e.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"' + b + '"\x3e');
  407. return e.join("")
  408. },
  409. htmlEncode: function (a) {
  410. return void 0 === a || null === a ? "" : String(a).replace(f, "\x26amp;").replace(g, "\x26gt;").replace(k, "\x26lt;")
  411. },
  412. htmlDecode: function (a) {
  413. return a.replace(p, e)
  414. },
  415. htmlEncodeAttr: function (a) {
  416. return CKEDITOR.tools.htmlEncode(a).replace(h, "\x26quot;")
  417. },
  418. htmlDecodeAttr: function (a) {
  419. return CKEDITOR.tools.htmlDecode(a)
  420. },
  421. transformPlainTextToHtml: function (a, b) {
  422. var e = b == CKEDITOR.ENTER_BR, c = this.htmlEncode(a.replace(/\r\n/g, "\n")),
  423. c = c.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;"), h = b == CKEDITOR.ENTER_P ? "p" : "div";
  424. if (!e) {
  425. var m = /\n{2}/g;
  426. if (m.test(c)) var d = "\x3c" + h + "\x3e", p = "\x3c/" + h + "\x3e",
  427. c = d + c.replace(m, function () {
  428. return p + d
  429. }) + p
  430. }
  431. c = c.replace(/\n/g, "\x3cbr\x3e");
  432. e || (c = c.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/" + h + "\x3e)"), function (a) {
  433. return CKEDITOR.tools.repeat(a,
  434. 2)
  435. }));
  436. c = c.replace(/^ | $/g, "\x26nbsp;");
  437. return c = c.replace(/(>|\s) /g, function (a, b) {
  438. return b + "\x26nbsp;"
  439. }).replace(/ (?=<)/g, "\x26nbsp;")
  440. },
  441. getNextNumber: function () {
  442. var a = 0;
  443. return function () {
  444. return ++a
  445. }
  446. }(),
  447. getNextId: function () {
  448. return "cke_" + this.getNextNumber()
  449. },
  450. getUniqueId: function () {
  451. for (var a = "e", b = 0; 8 > b; b++) a += Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
  452. return a
  453. },
  454. override: function (a, b) {
  455. var e = b(a);
  456. e.prototype = a.prototype;
  457. return e
  458. },
  459. setTimeout: function (a, b, e, c, h) {
  460. h || (h = window);
  461. e || (e =
  462. h);
  463. return h.setTimeout(function () {
  464. c ? a.apply(e, [].concat(c)) : a.apply(e)
  465. }, b || 0)
  466. },
  467. throttle: function (a, b, e) {
  468. return new this.buffers.throttle(a, b, e)
  469. },
  470. trim: function () {
  471. var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
  472. return function (b) {
  473. return b.replace(a, "")
  474. }
  475. }(),
  476. ltrim: function () {
  477. var a = /^[ \t\n\r]+/g;
  478. return function (b) {
  479. return b.replace(a, "")
  480. }
  481. }(),
  482. rtrim: function () {
  483. var a = /[ \t\n\r]+$/g;
  484. return function (b) {
  485. return b.replace(a, "")
  486. }
  487. }(),
  488. indexOf: function (a, b) {
  489. if ("function" == typeof b) for (var e = 0, c = a.length; e < c; e++) {
  490. if (b(a[e])) return e
  491. } else {
  492. if (a.indexOf) return a.indexOf(b);
  493. e = 0;
  494. for (c = a.length; e < c; e++) if (a[e] === b) return e
  495. }
  496. return -1
  497. },
  498. search: function (a, b) {
  499. var e = CKEDITOR.tools.indexOf(a, b);
  500. return 0 <= e ? a[e] : null
  501. },
  502. bind: function (a, b) {
  503. return function () {
  504. return a.apply(b, arguments)
  505. }
  506. },
  507. createClass: function (a) {
  508. var b = a.$, e = a.base, c = a.privates || a._, h = a.proto;
  509. a = a.statics;
  510. !b && (b = function () {
  511. e && this.base.apply(this, arguments)
  512. });
  513. if (c) var m = b, b = function () {
  514. var a = this._ || (this._ = {}), b;
  515. for (b in c) {
  516. var e = c[b];
  517. a[b] = "function" == typeof e ? CKEDITOR.tools.bind(e, this) : e
  518. }
  519. m.apply(this, arguments)
  520. };
  521. e &&
  522. (b.prototype = this.prototypedCopy(e.prototype), b.prototype.constructor = b, b.base = e, b.baseProto = e.prototype, b.prototype.base = function () {
  523. this.base = e.prototype.base;
  524. e.apply(this, arguments);
  525. this.base = arguments.callee
  526. });
  527. h && this.extend(b.prototype, h, !0);
  528. a && this.extend(b, a, !0);
  529. return b
  530. },
  531. addFunction: function (a, e) {
  532. return b.push(function () {
  533. return a.apply(e || this, arguments)
  534. }) - 1
  535. },
  536. removeFunction: function (a) {
  537. b[a] = null
  538. },
  539. callFunction: function (a) {
  540. var e = b[a];
  541. return e && e.apply(window, Array.prototype.slice.call(arguments,
  542. 1))
  543. },
  544. cssLength: function () {
  545. var a = /^-?\d+\.?\d*px$/, b;
  546. return function (e) {
  547. b = CKEDITOR.tools.trim(e + "") + "px";
  548. return a.test(b) ? b : e || ""
  549. }
  550. }(),
  551. convertToPx: function () {
  552. var a;
  553. return function (b) {
  554. a || (a = CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"\x3e\x3c/div\x3e', CKEDITOR.document), CKEDITOR.document.getBody().append(a));
  555. if (!/%$/.test(b)) {
  556. var e = 0 > parseFloat(b);
  557. e && (b = b.replace("-", ""));
  558. a.setStyle("width", b);
  559. b = a.$.clientWidth;
  560. return e ? -b : b
  561. }
  562. return b
  563. }
  564. }(),
  565. repeat: function (a, b) {
  566. return Array(b + 1).join(a)
  567. },
  568. tryThese: function () {
  569. for (var a, b = 0, e = arguments.length; b < e; b++) {
  570. var c = arguments[b];
  571. try {
  572. a = c();
  573. break
  574. } catch (h) {
  575. }
  576. }
  577. return a
  578. },
  579. genKey: function () {
  580. return Array.prototype.slice.call(arguments).join("-")
  581. },
  582. defer: function (a) {
  583. return function () {
  584. var b = arguments, e = this;
  585. window.setTimeout(function () {
  586. a.apply(e, b)
  587. }, 0)
  588. }
  589. },
  590. normalizeCssText: function (a, b) {
  591. var e = [], c, h = CKEDITOR.tools.parseCssText(a, !0, b);
  592. for (c in h) e.push(c + ":" + h[c]);
  593. e.sort();
  594. return e.length ?
  595. e.join(";") + ";" : ""
  596. },
  597. convertRgbToHex: function (a) {
  598. return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function (a, b, e, c) {
  599. a = [b, e, c];
  600. for (b = 0; 3 > b; b++) a[b] = ("0" + parseInt(a[b], 10).toString(16)).slice(-2);
  601. return "#" + a.join("")
  602. })
  603. },
  604. normalizeHex: function (a) {
  605. return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi, function (a, b, e, c) {
  606. a = b.toLowerCase();
  607. 3 == a.length && (a = a.split(""), a = [a[0], a[0], a[1], a[1], a[2], a[2]].join(""));
  608. return "#" + a + c
  609. })
  610. },
  611. parseCssText: function (a, b, e) {
  612. var c = {};
  613. e && (a = (new CKEDITOR.dom.element("span")).setAttribute("style",
  614. a).getAttribute("style") || "");
  615. a && (a = CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));
  616. if (!a || ";" == a) return c;
  617. a.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function (a, e, y) {
  618. b && (e = e.toLowerCase(), "font-family" == e && (y = y.replace(/\s*,\s*/g, ",")), y = CKEDITOR.tools.trim(y));
  619. c[e] = y
  620. });
  621. return c
  622. },
  623. writeCssText: function (a, b) {
  624. var e, c = [];
  625. for (e in a) c.push(e + ":" + a[e]);
  626. b && c.sort();
  627. return c.join("; ")
  628. },
  629. objectCompare: function (a, b, e) {
  630. var c;
  631. if (!a && !b) return !0;
  632. if (!a || !b) return !1;
  633. for (c in a) if (a[c] != b[c]) return !1;
  634. if (!e) for (c in b) if (a[c] != b[c]) return !1;
  635. return !0
  636. },
  637. objectKeys: function (a) {
  638. var b = [], e;
  639. for (e in a) b.push(e);
  640. return b
  641. },
  642. convertArrayToObject: function (a, b) {
  643. var e = {};
  644. 1 == arguments.length && (b = !0);
  645. for (var c = 0, h = a.length; c < h; ++c) e[a[c]] = b;
  646. return e
  647. },
  648. fixDomain: function () {
  649. for (var a; ;) try {
  650. a = window.parent.document.domain;
  651. break
  652. } catch (b) {
  653. a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain;
  654. if (!a) break;
  655. document.domain = a
  656. }
  657. return !!a
  658. },
  659. eventsBuffer: function (a, b, e) {
  660. return new this.buffers.event(a,
  661. b, e)
  662. },
  663. enableHtml5Elements: function (a, b) {
  664. for (var e = "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "), c = e.length, h; c--;) h = a.createElement(e[c]), b && a.appendChild(h)
  665. },
  666. checkIfAnyArrayItemMatches: function (a, b) {
  667. for (var e = 0, c = a.length; e < c; ++e) if (a[e].match(b)) return !0;
  668. return !1
  669. },
  670. checkIfAnyObjectPropertyMatches: function (a, b) {
  671. for (var e in a) if (e.match(b)) return !0;
  672. return !1
  673. },
  674. keystrokeToString: function (a,
  675. b) {
  676. var e = this.keystrokeToArray(a, b);
  677. e.display = e.display.join("+");
  678. e.aria = e.aria.join("+");
  679. return e
  680. },
  681. keystrokeToArray: function (a, b) {
  682. var e = b & 16711680, c = b & 65535, h = CKEDITOR.env.mac, m = [], d = [];
  683. e & CKEDITOR.CTRL && (m.push(h ? "⌘" : a[17]), d.push(h ? a[224] : a[17]));
  684. e & CKEDITOR.ALT && (m.push(h ? "⌥" : a[18]), d.push(a[18]));
  685. e & CKEDITOR.SHIFT && (m.push(h ? "⇧" : a[16]), d.push(a[16]));
  686. c && (a[c] ? (m.push(a[c]), d.push(a[c])) : (m.push(String.fromCharCode(c)), d.push(String.fromCharCode(c))));
  687. return {display: m, aria: d}
  688. },
  689. transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",
  690. getCookie: function (a) {
  691. a = a.toLowerCase();
  692. for (var b = document.cookie.split(";"), e, c, h = 0; h < b.length; h++) if (e = b[h].split("\x3d"), c = decodeURIComponent(CKEDITOR.tools.trim(e[0]).toLowerCase()), c === a) return decodeURIComponent(1 < e.length ? e[1] : "");
  693. return null
  694. },
  695. setCookie: function (a, b) {
  696. document.cookie = encodeURIComponent(a) + "\x3d" + encodeURIComponent(b) + ";path\x3d/"
  697. },
  698. getCsrfToken: function () {
  699. var a = CKEDITOR.tools.getCookie("ckCsrfToken");
  700. if (!a || 40 != a.length) {
  701. var a = [], b = "";
  702. if (window.crypto && window.crypto.getRandomValues) a =
  703. new Uint8Array(40), window.crypto.getRandomValues(a); else for (var e = 0; 40 > e; e++) a.push(Math.floor(256 * Math.random()));
  704. for (e = 0; e < a.length; e++) var c = "abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[e] % 36), b = b + (.5 < Math.random() ? c.toUpperCase() : c);
  705. a = b;
  706. CKEDITOR.tools.setCookie("ckCsrfToken", a)
  707. }
  708. return a
  709. },
  710. escapeCss: function (a) {
  711. return a ? window.CSS && CSS.escape ? CSS.escape(a) : isNaN(parseInt(a.charAt(0), 10)) ? a : "\\3" + a.charAt(0) + " " + a.substring(1, a.length) : ""
  712. },
  713. getMouseButton: function (a) {
  714. return (a = a.data ? a.data.$ :
  715. a) ? CKEDITOR.env.ie && (9 > CKEDITOR.env.version || CKEDITOR.env.ie6Compat) ? 4 === a.button ? CKEDITOR.MOUSE_BUTTON_MIDDLE : 1 === a.button ? CKEDITOR.MOUSE_BUTTON_LEFT : CKEDITOR.MOUSE_BUTTON_RIGHT : a.button : !1
  716. },
  717. convertHexStringToBytes: function (a) {
  718. var b = [], e = a.length / 2, c;
  719. for (c = 0; c < e; c++) b.push(parseInt(a.substr(2 * c, 2), 16));
  720. return b
  721. },
  722. convertBytesToBase64: function (a) {
  723. var b = "", e = a.length, c;
  724. for (c = 0; c < e; c += 3) {
  725. var h = a.slice(c, c + 3), m = h.length, d = [], p;
  726. if (3 > m) for (p = m; 3 > p; p++) h[p] = 0;
  727. d[0] = (h[0] & 252) >> 2;
  728. d[1] = (h[0] & 3) << 4 | h[1] >> 4;
  729. d[2] = (h[1] & 15) << 2 | (h[2] & 192) >> 6;
  730. d[3] = h[2] & 63;
  731. for (p = 0; 4 > p; p++) b = p <= m ? b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d[p]) : b + "\x3d"
  732. }
  733. return b
  734. },
  735. style: {
  736. parse: {
  737. _colors: {
  738. aliceblue: "#F0F8FF",
  739. antiquewhite: "#FAEBD7",
  740. aqua: "#00FFFF",
  741. aquamarine: "#7FFFD4",
  742. azure: "#F0FFFF",
  743. beige: "#F5F5DC",
  744. bisque: "#FFE4C4",
  745. black: "#000000",
  746. blanchedalmond: "#FFEBCD",
  747. blue: "#0000FF",
  748. blueviolet: "#8A2BE2",
  749. brown: "#A52A2A",
  750. burlywood: "#DEB887",
  751. cadetblue: "#5F9EA0",
  752. chartreuse: "#7FFF00",
  753. chocolate: "#D2691E",
  754. coral: "#FF7F50",
  755. cornflowerblue: "#6495ED",
  756. cornsilk: "#FFF8DC",
  757. crimson: "#DC143C",
  758. cyan: "#00FFFF",
  759. darkblue: "#00008B",
  760. darkcyan: "#008B8B",
  761. darkgoldenrod: "#B8860B",
  762. darkgray: "#A9A9A9",
  763. darkgreen: "#006400",
  764. darkgrey: "#A9A9A9",
  765. darkkhaki: "#BDB76B",
  766. darkmagenta: "#8B008B",
  767. darkolivegreen: "#556B2F",
  768. darkorange: "#FF8C00",
  769. darkorchid: "#9932CC",
  770. darkred: "#8B0000",
  771. darksalmon: "#E9967A",
  772. darkseagreen: "#8FBC8F",
  773. darkslateblue: "#483D8B",
  774. darkslategray: "#2F4F4F",
  775. darkslategrey: "#2F4F4F",
  776. darkturquoise: "#00CED1",
  777. darkviolet: "#9400D3",
  778. deeppink: "#FF1493",
  779. deepskyblue: "#00BFFF",
  780. dimgray: "#696969",
  781. dimgrey: "#696969",
  782. dodgerblue: "#1E90FF",
  783. firebrick: "#B22222",
  784. floralwhite: "#FFFAF0",
  785. forestgreen: "#228B22",
  786. fuchsia: "#FF00FF",
  787. gainsboro: "#DCDCDC",
  788. ghostwhite: "#F8F8FF",
  789. gold: "#FFD700",
  790. goldenrod: "#DAA520",
  791. gray: "#808080",
  792. green: "#008000",
  793. greenyellow: "#ADFF2F",
  794. grey: "#808080",
  795. honeydew: "#F0FFF0",
  796. hotpink: "#FF69B4",
  797. indianred: "#CD5C5C",
  798. indigo: "#4B0082",
  799. ivory: "#FFFFF0",
  800. khaki: "#F0E68C",
  801. lavender: "#E6E6FA",
  802. lavenderblush: "#FFF0F5",
  803. lawngreen: "#7CFC00",
  804. lemonchiffon: "#FFFACD",
  805. lightblue: "#ADD8E6",
  806. lightcoral: "#F08080",
  807. lightcyan: "#E0FFFF",
  808. lightgoldenrodyellow: "#FAFAD2",
  809. lightgray: "#D3D3D3",
  810. lightgreen: "#90EE90",
  811. lightgrey: "#D3D3D3",
  812. lightpink: "#FFB6C1",
  813. lightsalmon: "#FFA07A",
  814. lightseagreen: "#20B2AA",
  815. lightskyblue: "#87CEFA",
  816. lightslategray: "#778899",
  817. lightslategrey: "#778899",
  818. lightsteelblue: "#B0C4DE",
  819. lightyellow: "#FFFFE0",
  820. lime: "#00FF00",
  821. limegreen: "#32CD32",
  822. linen: "#FAF0E6",
  823. magenta: "#FF00FF",
  824. maroon: "#800000",
  825. mediumaquamarine: "#66CDAA",
  826. mediumblue: "#0000CD",
  827. mediumorchid: "#BA55D3",
  828. mediumpurple: "#9370DB",
  829. mediumseagreen: "#3CB371",
  830. mediumslateblue: "#7B68EE",
  831. mediumspringgreen: "#00FA9A",
  832. mediumturquoise: "#48D1CC",
  833. mediumvioletred: "#C71585",
  834. midnightblue: "#191970",
  835. mintcream: "#F5FFFA",
  836. mistyrose: "#FFE4E1",
  837. moccasin: "#FFE4B5",
  838. navajowhite: "#FFDEAD",
  839. navy: "#000080",
  840. oldlace: "#FDF5E6",
  841. olive: "#808000",
  842. olivedrab: "#6B8E23",
  843. orange: "#FFA500",
  844. orangered: "#FF4500",
  845. orchid: "#DA70D6",
  846. palegoldenrod: "#EEE8AA",
  847. palegreen: "#98FB98",
  848. paleturquoise: "#AFEEEE",
  849. palevioletred: "#DB7093",
  850. papayawhip: "#FFEFD5",
  851. peachpuff: "#FFDAB9",
  852. peru: "#CD853F",
  853. pink: "#FFC0CB",
  854. plum: "#DDA0DD",
  855. powderblue: "#B0E0E6",
  856. purple: "#800080",
  857. rebeccapurple: "#663399",
  858. red: "#FF0000",
  859. rosybrown: "#BC8F8F",
  860. royalblue: "#4169E1",
  861. saddlebrown: "#8B4513",
  862. salmon: "#FA8072",
  863. sandybrown: "#F4A460",
  864. seagreen: "#2E8B57",
  865. seashell: "#FFF5EE",
  866. sienna: "#A0522D",
  867. silver: "#C0C0C0",
  868. skyblue: "#87CEEB",
  869. slateblue: "#6A5ACD",
  870. slategray: "#708090",
  871. slategrey: "#708090",
  872. snow: "#FFFAFA",
  873. springgreen: "#00FF7F",
  874. steelblue: "#4682B4",
  875. tan: "#D2B48C",
  876. teal: "#008080",
  877. thistle: "#D8BFD8",
  878. tomato: "#FF6347",
  879. turquoise: "#40E0D0",
  880. violet: "#EE82EE",
  881. wheat: "#F5DEB3",
  882. white: "#FFFFFF",
  883. whitesmoke: "#F5F5F5",
  884. yellow: "#FFFF00",
  885. yellowgreen: "#9ACD32"
  886. },
  887. _borderStyle: "none hidden dotted dashed solid double groove ridge inset outset".split(" "),
  888. _widthRegExp: /^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,
  889. _rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  890. _hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  891. background: function (a) {
  892. var b = {}, e = this._findColor(a);
  893. e.length && (b.color = e[0], CKEDITOR.tools.array.forEach(e,
  894. function (b) {
  895. a = a.replace(b, "")
  896. }));
  897. if (a = CKEDITOR.tools.trim(a)) b.unprocessed = a;
  898. return b
  899. },
  900. margin: function (a) {
  901. function b(a) {
  902. e.top = c[a[0]];
  903. e.right = c[a[1]];
  904. e.bottom = c[a[2]];
  905. e.left = c[a[3]]
  906. }
  907. var e = {}, c = a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset)/g) || ["0px"];
  908. switch (c.length) {
  909. case 1:
  910. b([0, 0, 0, 0]);
  911. break;
  912. case 2:
  913. b([0, 1, 0, 1]);
  914. break;
  915. case 3:
  916. b([0, 1, 2, 1]);
  917. break;
  918. case 4:
  919. b([0, 1, 2, 3])
  920. }
  921. return e
  922. },
  923. border: function (a) {
  924. var b = {}, e = a.split(/\s+/g);
  925. a = CKEDITOR.tools.style.parse._findColor(a);
  926. a.length && (b.color = a[0]);
  927. CKEDITOR.tools.array.forEach(e, function (a) {
  928. b.style || -1 === CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle, a) ? !b.width && CKEDITOR.tools.style.parse._widthRegExp.test(a) && (b.width = a) : b.style = a
  929. });
  930. return b
  931. },
  932. _findColor: function (a) {
  933. var b = [], e = CKEDITOR.tools.array, b = b.concat(a.match(this._rgbaRegExp) || []),
  934. b = b.concat(a.match(this._hslaRegExp) || []);
  935. return b = b.concat(e.filter(a.split(/\s+/), function (a) {
  936. return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi) ? !0 : a.toLowerCase() in CKEDITOR.tools.style.parse._colors
  937. }))
  938. }
  939. }
  940. },
  941. array: {
  942. filter: function (a, b, e) {
  943. var c = [];
  944. this.forEach(a, function (h, d) {
  945. b.call(e, h, d, a) && c.push(h)
  946. });
  947. return c
  948. }, forEach: function (a, b, e) {
  949. var c = a.length, h;
  950. for (h = 0; h < c; h++) b.call(e, a[h], h, a)
  951. }, map: function (a, b, e) {
  952. for (var c = [], h = 0; h < a.length; h++) c.push(b.call(e, a[h], h, a));
  953. return c
  954. }, reduce: function (a, b, e, c) {
  955. for (var h = 0; h < a.length; h++) e = b.call(c, e, a[h], h, a);
  956. return e
  957. }, every: function (a, b, e) {
  958. if (!a.length) return !0;
  959. b = this.filter(a, b, e);
  960. return a.length === b.length
  961. }
  962. },
  963. object: {
  964. findKey: function (a, b) {
  965. if ("object" !== typeof a) return null;
  966. for (var e in a) if (a[e] === b) return e;
  967. return null
  968. }, merge: function (a, b) {
  969. var e = CKEDITOR.tools, c = e.clone(a), h = e.clone(b);
  970. e.array.forEach(e.objectKeys(h), function (a) {
  971. c[a] = "object" === typeof h[a] && "object" === typeof c[a] ? e.object.merge(c[a], h[a]) : h[a]
  972. });
  973. return c
  974. }
  975. },
  976. getAbsoluteRectPosition: function (a, b) {
  977. function e(a) {
  978. if (a) {
  979. var b = a.getClientRect();
  980. c.top += b.top;
  981. c.left += b.left;
  982. "x" in c && "y" in c && (c.x += b.x, c.y += b.y);
  983. e(a.getWindow().getFrame())
  984. }
  985. }
  986. var c = CKEDITOR.tools.copy(b);
  987. e(a.getFrame());
  988. var h = CKEDITOR.document.getWindow().getScrollPosition();
  989. c.top += h.y;
  990. c.left += h.x;
  991. "x" in c && "y" in c && (c.y += h.y, c.x += h.x);
  992. c.right = c.left + c.width;
  993. c.bottom = c.top + c.height;
  994. return c
  995. }
  996. };
  997. a.prototype = {
  998. reset: function () {
  999. this._lastOutput = 0;
  1000. this._clearTimer()
  1001. }, _reschedule: function () {
  1002. return !1
  1003. }, _call: function () {
  1004. this._output()
  1005. }, _clearTimer: function () {
  1006. this._scheduledTimer && clearTimeout(this._scheduledTimer);
  1007. this._scheduledTimer = 0
  1008. }
  1009. };
  1010. d.prototype = CKEDITOR.tools.prototypedCopy(a.prototype);
  1011. d.prototype._reschedule = function () {
  1012. this._scheduledTimer && this._clearTimer()
  1013. };
  1014. d.prototype._call =
  1015. function () {
  1016. this._output.apply(this._context, this._args)
  1017. };
  1018. CKEDITOR.tools.buffers = {};
  1019. CKEDITOR.tools.buffers.event = a;
  1020. CKEDITOR.tools.buffers.throttle = d;
  1021. CKEDITOR.tools.array.indexOf = CKEDITOR.tools.indexOf;
  1022. CKEDITOR.tools.array.isArray = CKEDITOR.tools.isArray;
  1023. CKEDITOR.MOUSE_BUTTON_LEFT = 0;
  1024. CKEDITOR.MOUSE_BUTTON_MIDDLE = 1;
  1025. CKEDITOR.MOUSE_BUTTON_RIGHT = 2
  1026. })();
  1027. CKEDITOR.dtd = function () {
  1028. var a = CKEDITOR.tools.extend, d = function (a, b) {
  1029. for (var c = CKEDITOR.tools.clone(a), h = 1; h < arguments.length; h++) {
  1030. b = arguments[h];
  1031. for (var d in b) delete c[d]
  1032. }
  1033. return c
  1034. }, b = {}, c = {}, f = {
  1035. address: 1,
  1036. article: 1,
  1037. aside: 1,
  1038. blockquote: 1,
  1039. details: 1,
  1040. div: 1,
  1041. dl: 1,
  1042. fieldset: 1,
  1043. figure: 1,
  1044. footer: 1,
  1045. form: 1,
  1046. h1: 1,
  1047. h2: 1,
  1048. h3: 1,
  1049. h4: 1,
  1050. h5: 1,
  1051. h6: 1,
  1052. header: 1,
  1053. hgroup: 1,
  1054. hr: 1,
  1055. main: 1,
  1056. menu: 1,
  1057. nav: 1,
  1058. ol: 1,
  1059. p: 1,
  1060. pre: 1,
  1061. section: 1,
  1062. table: 1,
  1063. ul: 1
  1064. }, g = {command: 1, link: 1, meta: 1, noscript: 1, script: 1, style: 1}, k = {}, h = {"#": 1},
  1065. p = {center: 1, dir: 1, noframes: 1};
  1066. a(b, {
  1067. a: 1,
  1068. abbr: 1,
  1069. area: 1,
  1070. audio: 1,
  1071. b: 1,
  1072. bdi: 1,
  1073. bdo: 1,
  1074. br: 1,
  1075. button: 1,
  1076. canvas: 1,
  1077. cite: 1,
  1078. code: 1,
  1079. command: 1,
  1080. datalist: 1,
  1081. del: 1,
  1082. dfn: 1,
  1083. em: 1,
  1084. embed: 1,
  1085. i: 1,
  1086. iframe: 1,
  1087. img: 1,
  1088. input: 1,
  1089. ins: 1,
  1090. kbd: 1,
  1091. keygen: 1,
  1092. label: 1,
  1093. map: 1,
  1094. mark: 1,
  1095. meter: 1,
  1096. noscript: 1,
  1097. object: 1,
  1098. output: 1,
  1099. progress: 1,
  1100. q: 1,
  1101. ruby: 1,
  1102. s: 1,
  1103. samp: 1,
  1104. script: 1,
  1105. select: 1,
  1106. small: 1,
  1107. span: 1,
  1108. strong: 1,
  1109. sub: 1,
  1110. sup: 1,
  1111. textarea: 1,
  1112. time: 1,
  1113. u: 1,
  1114. "var": 1,
  1115. video: 1,
  1116. wbr: 1
  1117. }, h, {acronym: 1, applet: 1, basefont: 1, big: 1, font: 1, isindex: 1, strike: 1, style: 1, tt: 1});
  1118. a(c, f, b, p);
  1119. d = {
  1120. a: d(b, {a: 1, button: 1}),
  1121. abbr: b,
  1122. address: c,
  1123. area: k,
  1124. article: c,
  1125. aside: c,
  1126. audio: a({source: 1, track: 1}, c),
  1127. b: b,
  1128. base: k,
  1129. bdi: b,
  1130. bdo: b,
  1131. blockquote: c,
  1132. body: c,
  1133. br: k,
  1134. button: d(b, {a: 1, button: 1}),
  1135. canvas: b,
  1136. caption: c,
  1137. cite: b,
  1138. code: b,
  1139. col: k,
  1140. colgroup: {col: 1},
  1141. command: k,
  1142. datalist: a({option: 1}, b),
  1143. dd: c,
  1144. del: b,
  1145. details: a({summary: 1}, c),
  1146. dfn: b,
  1147. div: c,
  1148. dl: {dt: 1, dd: 1},
  1149. dt: c,
  1150. em: b,
  1151. embed: k,
  1152. fieldset: a({legend: 1}, c),
  1153. figcaption: c,
  1154. figure: a({figcaption: 1}, c),
  1155. footer: c,
  1156. form: c,
  1157. h1: b,
  1158. h2: b,
  1159. h3: b,
  1160. h4: b,
  1161. h5: b,
  1162. h6: b,
  1163. head: a({title: 1, base: 1}, g),
  1164. header: c,
  1165. hgroup: {h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1},
  1166. hr: k,
  1167. html: a({
  1168. head: 1,
  1169. body: 1
  1170. }, c, g),
  1171. i: b,
  1172. iframe: h,
  1173. img: k,
  1174. input: k,
  1175. ins: b,
  1176. kbd: b,
  1177. keygen: k,
  1178. label: b,
  1179. legend: b,
  1180. li: c,
  1181. link: k,
  1182. main: c,
  1183. map: c,
  1184. mark: b,
  1185. menu: a({li: 1}, c),
  1186. meta: k,
  1187. meter: d(b, {meter: 1}),
  1188. nav: c,
  1189. noscript: a({link: 1, meta: 1, style: 1}, b),
  1190. object: a({param: 1}, b),
  1191. ol: {li: 1},
  1192. optgroup: {option: 1},
  1193. option: h,
  1194. output: b,
  1195. p: b,
  1196. param: k,
  1197. pre: b,
  1198. progress: d(b, {progress: 1}),
  1199. q: b,
  1200. rp: b,
  1201. rt: b,
  1202. ruby: a({rp: 1, rt: 1}, b),
  1203. s: b,
  1204. samp: b,
  1205. script: h,
  1206. section: c,
  1207. select: {optgroup: 1, option: 1},
  1208. small: b,
  1209. source: k,
  1210. span: b,
  1211. strong: b,
  1212. style: h,
  1213. sub: b,
  1214. summary: a({h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1}, b),
  1215. sup: b,
  1216. table: {caption: 1, colgroup: 1, thead: 1, tfoot: 1, tbody: 1, tr: 1},
  1217. tbody: {tr: 1},
  1218. td: c,
  1219. textarea: h,
  1220. tfoot: {tr: 1},
  1221. th: c,
  1222. thead: {tr: 1},
  1223. time: d(b, {time: 1}),
  1224. title: h,
  1225. tr: {th: 1, td: 1},
  1226. track: k,
  1227. u: b,
  1228. ul: {li: 1},
  1229. "var": b,
  1230. video: a({source: 1, track: 1}, c),
  1231. wbr: k,
  1232. acronym: b,
  1233. applet: a({param: 1}, c),
  1234. basefont: k,
  1235. big: b,
  1236. center: c,
  1237. dialog: k,
  1238. dir: {li: 1},
  1239. font: b,
  1240. isindex: k,
  1241. noframes: c,
  1242. strike: b,
  1243. tt: b
  1244. };
  1245. a(d, {
  1246. $block: a({audio: 1, dd: 1, dt: 1, figcaption: 1, li: 1, video: 1}, f, p),
  1247. $blockLimit: {
  1248. article: 1,
  1249. aside: 1,
  1250. audio: 1,
  1251. body: 1,
  1252. caption: 1,
  1253. details: 1,
  1254. dir: 1,
  1255. div: 1,
  1256. dl: 1,
  1257. fieldset: 1,
  1258. figcaption: 1,
  1259. figure: 1,
  1260. footer: 1,
  1261. form: 1,
  1262. header: 1,
  1263. hgroup: 1,
  1264. main: 1,
  1265. menu: 1,
  1266. nav: 1,
  1267. ol: 1,
  1268. section: 1,
  1269. table: 1,
  1270. td: 1,
  1271. th: 1,
  1272. tr: 1,
  1273. ul: 1,
  1274. video: 1
  1275. },
  1276. $cdata: {script: 1, style: 1},
  1277. $editable: {
  1278. address: 1,
  1279. article: 1,
  1280. aside: 1,
  1281. blockquote: 1,
  1282. body: 1,
  1283. details: 1,
  1284. div: 1,
  1285. fieldset: 1,
  1286. figcaption: 1,
  1287. footer: 1,
  1288. form: 1,
  1289. h1: 1,
  1290. h2: 1,
  1291. h3: 1,
  1292. h4: 1,
  1293. h5: 1,
  1294. h6: 1,
  1295. header: 1,
  1296. hgroup: 1,
  1297. main: 1,
  1298. nav: 1,
  1299. p: 1,
  1300. pre: 1,
  1301. section: 1
  1302. },
  1303. $empty: {
  1304. area: 1,
  1305. base: 1,
  1306. basefont: 1,
  1307. br: 1,
  1308. col: 1,
  1309. command: 1,
  1310. dialog: 1,
  1311. embed: 1,
  1312. hr: 1,
  1313. img: 1,
  1314. input: 1,
  1315. isindex: 1,
  1316. keygen: 1,
  1317. link: 1,
  1318. meta: 1,
  1319. param: 1,
  1320. source: 1,
  1321. track: 1,
  1322. wbr: 1
  1323. },
  1324. $inline: b,
  1325. $list: {dl: 1, ol: 1, ul: 1},
  1326. $listItem: {dd: 1, dt: 1, li: 1},
  1327. $nonBodyContent: a({body: 1, head: 1, html: 1}, d.head),
  1328. $nonEditable: {
  1329. applet: 1,
  1330. audio: 1,
  1331. button: 1,
  1332. embed: 1,
  1333. iframe: 1,
  1334. map: 1,
  1335. object: 1,
  1336. option: 1,
  1337. param: 1,
  1338. script: 1,
  1339. textarea: 1,
  1340. video: 1
  1341. },
  1342. $object: {
  1343. applet: 1,
  1344. audio: 1,
  1345. button: 1,
  1346. hr: 1,
  1347. iframe: 1,
  1348. img: 1,
  1349. input: 1,
  1350. object: 1,
  1351. select: 1,
  1352. table: 1,
  1353. textarea: 1,
  1354. video: 1
  1355. },
  1356. $removeEmpty: {
  1357. abbr: 1,
  1358. acronym: 1,
  1359. b: 1,
  1360. bdi: 1,
  1361. bdo: 1,
  1362. big: 1,
  1363. cite: 1,
  1364. code: 1,
  1365. del: 1,
  1366. dfn: 1,
  1367. em: 1,
  1368. font: 1,
  1369. i: 1,
  1370. ins: 1,
  1371. label: 1,
  1372. kbd: 1,
  1373. mark: 1,
  1374. meter: 1,
  1375. output: 1,
  1376. q: 1,
  1377. ruby: 1,
  1378. s: 1,
  1379. samp: 1,
  1380. small: 1,
  1381. span: 1,
  1382. strike: 1,
  1383. strong: 1,
  1384. sub: 1,
  1385. sup: 1,
  1386. time: 1,
  1387. tt: 1,
  1388. u: 1,
  1389. "var": 1
  1390. },
  1391. $tabIndex: {a: 1, area: 1, button: 1, input: 1, object: 1, select: 1, textarea: 1},
  1392. $tableContent: {caption: 1, col: 1, colgroup: 1, tbody: 1, td: 1, tfoot: 1, th: 1, thead: 1, tr: 1},
  1393. $transparent: {a: 1, audio: 1, canvas: 1, del: 1, ins: 1, map: 1, noscript: 1, object: 1, video: 1},
  1394. $intermediate: {
  1395. caption: 1,
  1396. colgroup: 1,
  1397. dd: 1,
  1398. dt: 1,
  1399. figcaption: 1,
  1400. legend: 1,
  1401. li: 1,
  1402. optgroup: 1,
  1403. option: 1,
  1404. rp: 1,
  1405. rt: 1,
  1406. summary: 1,
  1407. tbody: 1,
  1408. td: 1,
  1409. tfoot: 1,
  1410. th: 1,
  1411. thead: 1,
  1412. tr: 1
  1413. }
  1414. });
  1415. return d
  1416. }();
  1417. CKEDITOR.dom.event = function (a) {
  1418. this.$ = a
  1419. };
  1420. CKEDITOR.dom.event.prototype = {
  1421. getKey: function () {
  1422. return this.$.keyCode || this.$.which
  1423. }, getKeystroke: function () {
  1424. var a = this.getKey();
  1425. if (this.$.ctrlKey || this.$.metaKey) a += CKEDITOR.CTRL;
  1426. this.$.shiftKey && (a += CKEDITOR.SHIFT);
  1427. this.$.altKey && (a += CKEDITOR.ALT);
  1428. return a
  1429. }, preventDefault: function (a) {
  1430. var d = this.$;
  1431. d.preventDefault ? d.preventDefault() : d.returnValue = !1;
  1432. a && this.stopPropagation()
  1433. }, stopPropagation: function () {
  1434. var a = this.$;
  1435. a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0
  1436. }, getTarget: function () {
  1437. var a =
  1438. this.$.target || this.$.srcElement;
  1439. return a ? new CKEDITOR.dom.node(a) : null
  1440. }, getPhase: function () {
  1441. return this.$.eventPhase || 2
  1442. }, getPageOffset: function () {
  1443. var a = this.getTarget().getDocument().$;
  1444. return {
  1445. x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft),
  1446. y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop)
  1447. }
  1448. }
  1449. };
  1450. CKEDITOR.CTRL = 1114112;
  1451. CKEDITOR.SHIFT = 2228224;
  1452. CKEDITOR.ALT = 4456448;
  1453. CKEDITOR.EVENT_PHASE_CAPTURING = 1;
  1454. CKEDITOR.EVENT_PHASE_AT_TARGET = 2;
  1455. CKEDITOR.EVENT_PHASE_BUBBLING = 3;
  1456. CKEDITOR.dom.domObject = function (a) {
  1457. a && (this.$ = a)
  1458. };
  1459. CKEDITOR.dom.domObject.prototype = function () {
  1460. var a = function (a, b) {
  1461. return function (c) {
  1462. "undefined" != typeof CKEDITOR && a.fire(b, new CKEDITOR.dom.event(c))
  1463. }
  1464. };
  1465. return {
  1466. getPrivate: function () {
  1467. var a;
  1468. (a = this.getCustomData("_")) || this.setCustomData("_", a = {});
  1469. return a
  1470. }, on: function (d) {
  1471. var b = this.getCustomData("_cke_nativeListeners");
  1472. b || (b = {}, this.setCustomData("_cke_nativeListeners", b));
  1473. b[d] || (b = b[d] = a(this, d), this.$.addEventListener ? this.$.addEventListener(d, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" +
  1474. d, b));
  1475. return CKEDITOR.event.prototype.on.apply(this, arguments)
  1476. }, removeListener: function (a) {
  1477. CKEDITOR.event.prototype.removeListener.apply(this, arguments);
  1478. if (!this.hasListeners(a)) {
  1479. var b = this.getCustomData("_cke_nativeListeners"), c = b && b[a];
  1480. c && (this.$.removeEventListener ? this.$.removeEventListener(a, c, !1) : this.$.detachEvent && this.$.detachEvent("on" + a, c), delete b[a])
  1481. }
  1482. }, removeAllListeners: function () {
  1483. var a = this.getCustomData("_cke_nativeListeners"), b;
  1484. for (b in a) {
  1485. var c = a[b];
  1486. this.$.detachEvent ? this.$.detachEvent("on" +
  1487. b, c) : this.$.removeEventListener && this.$.removeEventListener(b, c, !1);
  1488. delete a[b]
  1489. }
  1490. CKEDITOR.event.prototype.removeAllListeners.call(this)
  1491. }
  1492. }
  1493. }();
  1494. (function (a) {
  1495. var d = {};
  1496. CKEDITOR.on("reset", function () {
  1497. d = {}
  1498. });
  1499. a.equals = function (a) {
  1500. try {
  1501. return a && a.$ === this.$
  1502. } catch (c) {
  1503. return !1
  1504. }
  1505. };
  1506. a.setCustomData = function (a, c) {
  1507. var f = this.getUniqueId();
  1508. (d[f] || (d[f] = {}))[a] = c;
  1509. return this
  1510. };
  1511. a.getCustomData = function (a) {
  1512. var c = this.$["data-cke-expando"];
  1513. return (c = c && d[c]) && a in c ? c[a] : null
  1514. };
  1515. a.removeCustomData = function (a) {
  1516. var c = this.$["data-cke-expando"], c = c && d[c], f, g;
  1517. c && (f = c[a], g = a in c, delete c[a]);
  1518. return g ? f : null
  1519. };
  1520. a.clearCustomData = function () {
  1521. this.removeAllListeners();
  1522. var a =
  1523. this.$["data-cke-expando"];
  1524. a && delete d[a]
  1525. };
  1526. a.getUniqueId = function () {
  1527. return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber())
  1528. };
  1529. CKEDITOR.event.implementOn(a)
  1530. })(CKEDITOR.dom.domObject.prototype);
  1531. CKEDITOR.dom.node = function (a) {
  1532. return a ? new CKEDITOR.dom[a.nodeType == CKEDITOR.NODE_DOCUMENT ? "document" : a.nodeType == CKEDITOR.NODE_ELEMENT ? "element" : a.nodeType == CKEDITOR.NODE_TEXT ? "text" : a.nodeType == CKEDITOR.NODE_COMMENT ? "comment" : a.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ? "documentFragment" : "domObject"](a) : this
  1533. };
  1534. CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject;
  1535. CKEDITOR.NODE_ELEMENT = 1;
  1536. CKEDITOR.NODE_DOCUMENT = 9;
  1537. CKEDITOR.NODE_TEXT = 3;
  1538. CKEDITOR.NODE_COMMENT = 8;
  1539. CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11;
  1540. CKEDITOR.POSITION_IDENTICAL = 0;
  1541. CKEDITOR.POSITION_DISCONNECTED = 1;
  1542. CKEDITOR.POSITION_FOLLOWING = 2;
  1543. CKEDITOR.POSITION_PRECEDING = 4;
  1544. CKEDITOR.POSITION_IS_CONTAINED = 8;
  1545. CKEDITOR.POSITION_CONTAINS = 16;
  1546. CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, {
  1547. appendTo: function (a, d) {
  1548. a.append(this, d);
  1549. return a
  1550. }, clone: function (a, d) {
  1551. function b(c) {
  1552. c["data-cke-expando"] && (c["data-cke-expando"] = !1);
  1553. if (c.nodeType == CKEDITOR.NODE_ELEMENT || c.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) if (d || c.nodeType != CKEDITOR.NODE_ELEMENT || c.removeAttribute("id", !1), a) {
  1554. c = c.childNodes;
  1555. for (var f = 0; f < c.length; f++) b(c[f])
  1556. }
  1557. }
  1558. function c(b) {
  1559. if (b.type == CKEDITOR.NODE_ELEMENT || b.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1560. if (b.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1561. var d =
  1562. b.getName();
  1563. ":" == d[0] && b.renameNode(d.substring(1))
  1564. }
  1565. if (a) for (d = 0; d < b.getChildCount(); d++) c(b.getChild(d))
  1566. }
  1567. }
  1568. var f = this.$.cloneNode(a);
  1569. b(f);
  1570. f = new CKEDITOR.dom.node(f);
  1571. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (this.type == CKEDITOR.NODE_ELEMENT || this.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) && c(f);
  1572. return f
  1573. }, hasPrevious: function () {
  1574. return !!this.$.previousSibling
  1575. }, hasNext: function () {
  1576. return !!this.$.nextSibling
  1577. }, insertAfter: function (a) {
  1578. a.$.parentNode.insertBefore(this.$, a.$.nextSibling);
  1579. return a
  1580. }, insertBefore: function (a) {
  1581. a.$.parentNode.insertBefore(this.$,
  1582. a.$);
  1583. return a
  1584. }, insertBeforeMe: function (a) {
  1585. this.$.parentNode.insertBefore(a.$, this.$);
  1586. return a
  1587. }, getAddress: function (a) {
  1588. for (var d = [], b = this.getDocument().$.documentElement, c = this.$; c && c != b;) {
  1589. var f = c.parentNode;
  1590. f && d.unshift(this.getIndex.call({$: c}, a));
  1591. c = f
  1592. }
  1593. return d
  1594. }, getDocument: function () {
  1595. return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument)
  1596. }, getIndex: function (a) {
  1597. function d(a, c) {
  1598. var p = c ? a.nextSibling : a.previousSibling;
  1599. return p && p.nodeType == CKEDITOR.NODE_TEXT ? b(p) ? d(p,
  1600. c) : p : null
  1601. }
  1602. function b(a) {
  1603. return !a.nodeValue || a.nodeValue == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE
  1604. }
  1605. var c = this.$, f = -1, g;
  1606. if (!this.$.parentNode || a && c.nodeType == CKEDITOR.NODE_TEXT && b(c) && !d(c) && !d(c, !0)) return -1;
  1607. do a && c != this.$ && c.nodeType == CKEDITOR.NODE_TEXT && (g || b(c)) || (f++, g = c.nodeType == CKEDITOR.NODE_TEXT); while (c = c.previousSibling);
  1608. return f
  1609. }, getNextSourceNode: function (a, d, b) {
  1610. if (b && !b.call) {
  1611. var c = b;
  1612. b = function (a) {
  1613. return !a.equals(c)
  1614. }
  1615. }
  1616. a = !a && this.getFirst && this.getFirst();
  1617. var f;
  1618. if (!a) {
  1619. if (this.type ==
  1620. CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  1621. a = this.getNext()
  1622. }
  1623. for (; !a && (f = (f || this).getParent());) {
  1624. if (b && !1 === b(f, !0)) return null;
  1625. a = f.getNext()
  1626. }
  1627. return !a || b && !1 === b(a) ? null : d && d != a.type ? a.getNextSourceNode(!1, d, b) : a
  1628. }, getPreviousSourceNode: function (a, d, b) {
  1629. if (b && !b.call) {
  1630. var c = b;
  1631. b = function (a) {
  1632. return !a.equals(c)
  1633. }
  1634. }
  1635. a = !a && this.getLast && this.getLast();
  1636. var f;
  1637. if (!a) {
  1638. if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  1639. a = this.getPrevious()
  1640. }
  1641. for (; !a && (f = (f || this).getParent());) {
  1642. if (b && !1 ===
  1643. b(f, !0)) return null;
  1644. a = f.getPrevious()
  1645. }
  1646. return !a || b && !1 === b(a) ? null : d && a.type != d ? a.getPreviousSourceNode(!1, d, b) : a
  1647. }, getPrevious: function (a) {
  1648. var d = this.$, b;
  1649. do b = (d = d.previousSibling) && 10 != d.nodeType && new CKEDITOR.dom.node(d); while (b && a && !a(b));
  1650. return b
  1651. }, getNext: function (a) {
  1652. var d = this.$, b;
  1653. do b = (d = d.nextSibling) && new CKEDITOR.dom.node(d); while (b && a && !a(b));
  1654. return b
  1655. }, getParent: function (a) {
  1656. var d = this.$.parentNode;
  1657. return d && (d.nodeType == CKEDITOR.NODE_ELEMENT || a && d.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ?
  1658. new CKEDITOR.dom.node(d) : null
  1659. }, getParents: function (a) {
  1660. var d = this, b = [];
  1661. do b[a ? "push" : "unshift"](d); while (d = d.getParent());
  1662. return b
  1663. }, getCommonAncestor: function (a) {
  1664. if (a.equals(this)) return this;
  1665. if (a.contains && a.contains(this)) return a;
  1666. var d = this.contains ? this : this.getParent();
  1667. do if (d.contains(a)) return d; while (d = d.getParent());
  1668. return null
  1669. }, getPosition: function (a) {
  1670. var d = this.$, b = a.$;
  1671. if (d.compareDocumentPosition) return d.compareDocumentPosition(b);
  1672. if (d == b) return CKEDITOR.POSITION_IDENTICAL;
  1673. if (this.type ==
  1674. CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) {
  1675. if (d.contains) {
  1676. if (d.contains(b)) return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING;
  1677. if (b.contains(d)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1678. }
  1679. if ("sourceIndex" in d) return 0 > d.sourceIndex || 0 > b.sourceIndex ? CKEDITOR.POSITION_DISCONNECTED : d.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
  1680. }
  1681. d = this.getAddress();
  1682. a = a.getAddress();
  1683. for (var b = Math.min(d.length, a.length), c = 0; c < b; c++) if (d[c] !=
  1684. a[c]) return d[c] < a[c] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
  1685. return d.length < a.length ? CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1686. }, getAscendant: function (a, d) {
  1687. var b = this.$, c, f;
  1688. d || (b = b.parentNode);
  1689. "function" == typeof a ? (f = !0, c = a) : (f = !1, c = function (b) {
  1690. b = "string" == typeof b.nodeName ? b.nodeName.toLowerCase() : "";
  1691. return "string" == typeof a ? b == a : b in a
  1692. });
  1693. for (; b;) {
  1694. if (c(f ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b);
  1695. try {
  1696. b = b.parentNode
  1697. } catch (g) {
  1698. b = null
  1699. }
  1700. }
  1701. return null
  1702. }, hasAscendant: function (a, d) {
  1703. var b = this.$;
  1704. d || (b = b.parentNode);
  1705. for (; b;) {
  1706. if (b.nodeName && b.nodeName.toLowerCase() == a) return !0;
  1707. b = b.parentNode
  1708. }
  1709. return !1
  1710. }, move: function (a, d) {
  1711. a.append(this.remove(), d)
  1712. }, remove: function (a) {
  1713. var d = this.$, b = d.parentNode;
  1714. if (b) {
  1715. if (a) for (; a = d.firstChild;) b.insertBefore(d.removeChild(a), d);
  1716. b.removeChild(d)
  1717. }
  1718. return this
  1719. }, replace: function (a) {
  1720. this.insertBefore(a);
  1721. a.remove()
  1722. }, trim: function () {
  1723. this.ltrim();
  1724. this.rtrim()
  1725. }, ltrim: function () {
  1726. for (var a; this.getFirst &&
  1727. (a = this.getFirst());) {
  1728. if (a.type == CKEDITOR.NODE_TEXT) {
  1729. var d = CKEDITOR.tools.ltrim(a.getText()), b = a.getLength();
  1730. if (d) d.length < b && (a.split(b - d.length), this.$.removeChild(this.$.firstChild)); else {
  1731. a.remove();
  1732. continue
  1733. }
  1734. }
  1735. break
  1736. }
  1737. }, rtrim: function () {
  1738. for (var a; this.getLast && (a = this.getLast());) {
  1739. if (a.type == CKEDITOR.NODE_TEXT) {
  1740. var d = CKEDITOR.tools.rtrim(a.getText()), b = a.getLength();
  1741. if (d) d.length < b && (a.split(d.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild)); else {
  1742. a.remove();
  1743. continue
  1744. }
  1745. }
  1746. break
  1747. }
  1748. CKEDITOR.env.needsBrFiller &&
  1749. (a = this.$.lastChild) && 1 == a.type && "br" == a.nodeName.toLowerCase() && a.parentNode.removeChild(a)
  1750. }, isReadOnly: function (a) {
  1751. var d = this;
  1752. this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent());
  1753. CKEDITOR.env.edge && d && d.is("textarea", "input") && (a = !0);
  1754. if (!a && d && "undefined" != typeof d.$.isContentEditable) return !(d.$.isContentEditable || d.data("cke-editable"));
  1755. for (; d;) {
  1756. if (d.data("cke-editable")) return !1;
  1757. if (d.hasAttribute("contenteditable")) return "false" == d.getAttribute("contenteditable");
  1758. d = d.getParent()
  1759. }
  1760. return !0
  1761. }
  1762. });
  1763. CKEDITOR.dom.window = function (a) {
  1764. CKEDITOR.dom.domObject.call(this, a)
  1765. };
  1766. CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject;
  1767. CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
  1768. focus: function () {
  1769. this.$.focus()
  1770. }, getViewPaneSize: function () {
  1771. var a = this.$.document, d = "CSS1Compat" == a.compatMode;
  1772. return {
  1773. width: (d ? a.documentElement.clientWidth : a.body.clientWidth) || 0,
  1774. height: (d ? a.documentElement.clientHeight : a.body.clientHeight) || 0
  1775. }
  1776. }, getScrollPosition: function () {
  1777. var a = this.$;
  1778. if ("pageXOffset" in a) return {x: a.pageXOffset || 0, y: a.pageYOffset || 0};
  1779. a = a.document;
  1780. return {
  1781. x: a.documentElement.scrollLeft || a.body.scrollLeft || 0, y: a.documentElement.scrollTop ||
  1782. a.body.scrollTop || 0
  1783. }
  1784. }, getFrame: function () {
  1785. var a = this.$.frameElement;
  1786. return a ? new CKEDITOR.dom.element.get(a) : null
  1787. }
  1788. });
  1789. CKEDITOR.dom.document = function (a) {
  1790. CKEDITOR.dom.domObject.call(this, a)
  1791. };
  1792. CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject;
  1793. CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
  1794. type: CKEDITOR.NODE_DOCUMENT, appendStyleSheet: function (a) {
  1795. if (this.$.createStyleSheet) this.$.createStyleSheet(a); else {
  1796. var d = new CKEDITOR.dom.element("link");
  1797. d.setAttributes({rel: "stylesheet", type: "text/css", href: a});
  1798. this.getHead().append(d)
  1799. }
  1800. }, appendStyleText: function (a) {
  1801. if (this.$.createStyleSheet) {
  1802. var d = this.$.createStyleSheet("");
  1803. d.cssText = a
  1804. } else {
  1805. var b = new CKEDITOR.dom.element("style", this);
  1806. b.append(new CKEDITOR.dom.text(a, this));
  1807. this.getHead().append(b)
  1808. }
  1809. return d ||
  1810. b.$.sheet
  1811. }, createElement: function (a, d) {
  1812. var b = new CKEDITOR.dom.element(a, this);
  1813. d && (d.attributes && b.setAttributes(d.attributes), d.styles && b.setStyles(d.styles));
  1814. return b
  1815. }, createText: function (a) {
  1816. return new CKEDITOR.dom.text(a, this)
  1817. }, focus: function () {
  1818. this.getWindow().focus()
  1819. }, getActive: function () {
  1820. var a;
  1821. try {
  1822. a = this.$.activeElement
  1823. } catch (d) {
  1824. return null
  1825. }
  1826. return new CKEDITOR.dom.element(a)
  1827. }, getById: function (a) {
  1828. return (a = this.$.getElementById(a)) ? new CKEDITOR.dom.element(a) : null
  1829. }, getByAddress: function (a, d) {
  1830. for (var b =
  1831. this.$.documentElement, c = 0; b && c < a.length; c++) {
  1832. var f = a[c];
  1833. if (d) for (var g = -1, k = 0; k < b.childNodes.length; k++) {
  1834. var h = b.childNodes[k];
  1835. if (!0 !== d || 3 != h.nodeType || !h.previousSibling || 3 != h.previousSibling.nodeType) if (g++, g == f) {
  1836. b = h;
  1837. break
  1838. }
  1839. } else b = b.childNodes[f]
  1840. }
  1841. return b ? new CKEDITOR.dom.node(b) : null
  1842. }, getElementsByTag: function (a, d) {
  1843. CKEDITOR.env.ie && 8 >= document.documentMode || !d || (a = d + ":" + a);
  1844. return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))
  1845. }, getHead: function () {
  1846. var a = this.$.getElementsByTagName("head")[0];
  1847. return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), !0)
  1848. }, getBody: function () {
  1849. return new CKEDITOR.dom.element(this.$.body)
  1850. }, getDocumentElement: function () {
  1851. return new CKEDITOR.dom.element(this.$.documentElement)
  1852. }, getWindow: function () {
  1853. return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView)
  1854. }, write: function (a) {
  1855. this.$.open("text/html", "replace");
  1856. CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i, '$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e(' +
  1857. CKEDITOR.tools.fixDomain + ")();\x3c/script\x3e"));
  1858. this.$.write(a);
  1859. this.$.close()
  1860. }, find: function (a) {
  1861. return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))
  1862. }, findOne: function (a) {
  1863. return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null
  1864. }, _getHtml5ShivFrag: function () {
  1865. var a = this.getCustomData("html5ShivFrag");
  1866. a || (a = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(a, !0), this.setCustomData("html5ShivFrag", a));
  1867. return a
  1868. }
  1869. });
  1870. CKEDITOR.dom.nodeList = function (a) {
  1871. this.$ = a
  1872. };
  1873. CKEDITOR.dom.nodeList.prototype = {
  1874. count: function () {
  1875. return this.$.length
  1876. }, getItem: function (a) {
  1877. return 0 > a || a >= this.$.length ? null : (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null
  1878. }, toArray: function () {
  1879. return CKEDITOR.tools.array.map(this.$, function (a) {
  1880. return new CKEDITOR.dom.node(a)
  1881. })
  1882. }
  1883. };
  1884. CKEDITOR.dom.element = function (a, d) {
  1885. "string" == typeof a && (a = (d ? d.$ : document).createElement(a));
  1886. CKEDITOR.dom.domObject.call(this, a)
  1887. };
  1888. CKEDITOR.dom.element.get = function (a) {
  1889. return (a = "string" == typeof a ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a))
  1890. };
  1891. CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node;
  1892. CKEDITOR.dom.element.createFromHtml = function (a, d) {
  1893. var b = new CKEDITOR.dom.element("div", d);
  1894. b.setHtml(a);
  1895. return b.getFirst().remove()
  1896. };
  1897. CKEDITOR.dom.element.setMarker = function (a, d, b, c) {
  1898. var f = d.getCustomData("list_marker_id") || d.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
  1899. g = d.getCustomData("list_marker_names") || d.setCustomData("list_marker_names", {}).getCustomData("list_marker_names");
  1900. a[f] = d;
  1901. g[b] = 1;
  1902. return d.setCustomData(b, c)
  1903. };
  1904. CKEDITOR.dom.element.clearAllMarkers = function (a) {
  1905. for (var d in a) CKEDITOR.dom.element.clearMarkers(a, a[d], 1)
  1906. };
  1907. CKEDITOR.dom.element.clearMarkers = function (a, d, b) {
  1908. var c = d.getCustomData("list_marker_names"), f = d.getCustomData("list_marker_id"), g;
  1909. for (g in c) d.removeCustomData(g);
  1910. d.removeCustomData("list_marker_names");
  1911. b && (d.removeCustomData("list_marker_id"), delete a[f])
  1912. };
  1913. (function () {
  1914. function a(a, b) {
  1915. return -1 < (" " + a + " ").replace(g, " ").indexOf(" " + b + " ")
  1916. }
  1917. function d(a) {
  1918. var b = !0;
  1919. a.$.id || (a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber(), b = !1);
  1920. return function () {
  1921. b || a.removeAttribute("id")
  1922. }
  1923. }
  1924. function b(a, b) {
  1925. var c = CKEDITOR.tools.escapeCss(a.$.id);
  1926. return "#" + c + " " + b.split(/,\s*/).join(", #" + c + " ")
  1927. }
  1928. function c(a) {
  1929. for (var b = 0, c = 0, e = k[a].length; c < e; c++) b += parseFloat(this.getComputedStyle(k[a][c]) || 0, 10) || 0;
  1930. return b
  1931. }
  1932. var f = document.createElement("_").classList, f = "undefined" !== typeof f &&
  1933. null !== String(f.add).match(/\[Native code\]/gi), g = /[\n\t\r]/g;
  1934. CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
  1935. type: CKEDITOR.NODE_ELEMENT, addClass: f ? function (a) {
  1936. this.$.classList.add(a);
  1937. return this
  1938. } : function (b) {
  1939. var c = this.$.className;
  1940. c && (a(c, b) || (c += " " + b));
  1941. this.$.className = c || b;
  1942. return this
  1943. }, removeClass: f ? function (a) {
  1944. var b = this.$;
  1945. b.classList.remove(a);
  1946. b.className || b.removeAttribute("class");
  1947. return this
  1948. } : function (b) {
  1949. var c = this.getAttribute("class");
  1950. c && a(c, b) && ((c = c.replace(new RegExp("(?:^|\\s+)" +
  1951. b + "(?\x3d\\s|$)"), "").replace(/^\s+/, "")) ? this.setAttribute("class", c) : this.removeAttribute("class"));
  1952. return this
  1953. }, hasClass: function (b) {
  1954. return a(this.$.className, b)
  1955. }, append: function (a, b) {
  1956. "string" == typeof a && (a = this.getDocument().createElement(a));
  1957. b ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$);
  1958. return a
  1959. }, appendHtml: function (a) {
  1960. if (this.$.childNodes.length) {
  1961. var b = new CKEDITOR.dom.element("div", this.getDocument());
  1962. b.setHtml(a);
  1963. b.moveChildren(this)
  1964. } else this.setHtml(a)
  1965. }, appendText: function (a) {
  1966. null !=
  1967. this.$.text && CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? this.$.text += a : this.append(new CKEDITOR.dom.text(a))
  1968. }, appendBogus: function (a) {
  1969. if (a || CKEDITOR.env.needsBrFiller) {
  1970. for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) a = a.getPrevious();
  1971. a && a.is && a.is("br") || (a = this.getDocument().createElement("br"), CKEDITOR.env.gecko && a.setAttribute("type", "_moz"), this.append(a))
  1972. }
  1973. }, breakParent: function (a, b) {
  1974. var c = new CKEDITOR.dom.range(this.getDocument());
  1975. c.setStartAfter(this);
  1976. c.setEndAfter(a);
  1977. var e = c.extractContents(!1, b || !1), d;
  1978. c.insertNode(this.remove());
  1979. if (CKEDITOR.env.ie && !CKEDITOR.env.edge) {
  1980. for (c = new CKEDITOR.dom.element("div"); d = e.getFirst();) d.$.style.backgroundColor && (d.$.style.backgroundColor = d.$.style.backgroundColor), c.append(d);
  1981. c.insertAfter(this);
  1982. c.remove(!0)
  1983. } else e.insertAfterNode(this)
  1984. }, contains: document.compareDocumentPosition ? function (a) {
  1985. return !!(this.$.compareDocumentPosition(a.$) & 16)
  1986. } : function (a) {
  1987. var b = this.$;
  1988. return a.type != CKEDITOR.NODE_ELEMENT ? b.contains(a.getParent().$) :
  1989. b != a.$ && b.contains(a.$)
  1990. }, focus: function () {
  1991. function a() {
  1992. try {
  1993. this.$.focus()
  1994. } catch (b) {
  1995. }
  1996. }
  1997. return function (b) {
  1998. b ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this)
  1999. }
  2000. }(), getHtml: function () {
  2001. var a = this.$.innerHTML;
  2002. return CKEDITOR.env.ie ? a.replace(/<\?[^>]*>/g, "") : a
  2003. }, getOuterHtml: function () {
  2004. if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
  2005. var a = this.$.ownerDocument.createElement("div");
  2006. a.appendChild(this.$.cloneNode(!0));
  2007. return a.innerHTML
  2008. }, getClientRect: function (a) {
  2009. var b = CKEDITOR.tools.extend({},
  2010. this.$.getBoundingClientRect());
  2011. !b.width && (b.width = b.right - b.left);
  2012. !b.height && (b.height = b.bottom - b.top);
  2013. return a ? CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(), b) : b
  2014. }, setHtml: CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? function (a) {
  2015. try {
  2016. var b = this.$;
  2017. if (this.getParent()) return b.innerHTML = a;
  2018. var c = this.getDocument()._getHtml5ShivFrag();
  2019. c.appendChild(b);
  2020. b.innerHTML = a;
  2021. c.removeChild(b);
  2022. return a
  2023. } catch (e) {
  2024. this.$.innerHTML = "";
  2025. b = new CKEDITOR.dom.element("body", this.getDocument());
  2026. b.$.innerHTML = a;
  2027. for (b = b.getChildren(); b.count();) this.append(b.getItem(0));
  2028. return a
  2029. }
  2030. } : function (a) {
  2031. return this.$.innerHTML = a
  2032. }, setText: function () {
  2033. var a = document.createElement("p");
  2034. a.innerHTML = "x";
  2035. a = a.textContent;
  2036. return function (b) {
  2037. this.$[a ? "textContent" : "innerText"] = b
  2038. }
  2039. }(), getAttribute: function () {
  2040. var a = function (a) {
  2041. return this.$.getAttribute(a, 2)
  2042. };
  2043. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function (a) {
  2044. switch (a) {
  2045. case "class":
  2046. a = "className";
  2047. break;
  2048. case "http-equiv":
  2049. a = "httpEquiv";
  2050. break;
  2051. case "name":
  2052. return this.$.name;
  2053. case "tabindex":
  2054. return a = this.$.getAttribute(a,
  2055. 2), 0 !== a && 0 === this.$.tabIndex && (a = null), a;
  2056. case "checked":
  2057. return a = this.$.attributes.getNamedItem(a), (a.specified ? a.nodeValue : this.$.checked) ? "checked" : null;
  2058. case "hspace":
  2059. case "value":
  2060. return this.$[a];
  2061. case "style":
  2062. return this.$.style.cssText;
  2063. case "contenteditable":
  2064. case "contentEditable":
  2065. return this.$.attributes.getNamedItem("contentEditable").specified ? this.$.getAttribute("contentEditable") : null
  2066. }
  2067. return this.$.getAttribute(a, 2)
  2068. } : a
  2069. }(), getAttributes: function (a) {
  2070. var b = {}, c = this.$.attributes, e;
  2071. a = CKEDITOR.tools.isArray(a) ?
  2072. a : [];
  2073. for (e = 0; e < c.length; e++) -1 === CKEDITOR.tools.indexOf(a, c[e].name) && (b[c[e].name] = c[e].value);
  2074. return b
  2075. }, getChildren: function () {
  2076. return new CKEDITOR.dom.nodeList(this.$.childNodes)
  2077. }, getComputedStyle: document.defaultView && document.defaultView.getComputedStyle ? function (a) {
  2078. var b = this.getWindow().$.getComputedStyle(this.$, null);
  2079. return b ? b.getPropertyValue(a) : ""
  2080. } : function (a) {
  2081. return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2082. }, getDtd: function () {
  2083. var a = CKEDITOR.dtd[this.getName()];
  2084. this.getDtd =
  2085. function () {
  2086. return a
  2087. };
  2088. return a
  2089. }, getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag, getTabIndex: function () {
  2090. var a = this.$.tabIndex;
  2091. return 0 !== a || CKEDITOR.dtd.$tabIndex[this.getName()] || 0 === parseInt(this.getAttribute("tabindex"), 10) ? a : -1
  2092. }, getText: function () {
  2093. return this.$.textContent || this.$.innerText || ""
  2094. }, getWindow: function () {
  2095. return this.getDocument().getWindow()
  2096. }, getId: function () {
  2097. return this.$.id || null
  2098. }, getNameAtt: function () {
  2099. return this.$.name || null
  2100. }, getName: function () {
  2101. var a = this.$.nodeName.toLowerCase();
  2102. if (CKEDITOR.env.ie && 8 >= document.documentMode) {
  2103. var b = this.$.scopeName;
  2104. "HTML" != b && (a = b.toLowerCase() + ":" + a)
  2105. }
  2106. this.getName = function () {
  2107. return a
  2108. };
  2109. return this.getName()
  2110. }, getValue: function () {
  2111. return this.$.value
  2112. }, getFirst: function (a) {
  2113. var b = this.$.firstChild;
  2114. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getNext(a));
  2115. return b
  2116. }, getLast: function (a) {
  2117. var b = this.$.lastChild;
  2118. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getPrevious(a));
  2119. return b
  2120. }, getStyle: function (a) {
  2121. return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2122. },
  2123. is: function () {
  2124. var a = this.getName();
  2125. if ("object" == typeof arguments[0]) return !!arguments[0][a];
  2126. for (var b = 0; b < arguments.length; b++) if (arguments[b] == a) return !0;
  2127. return !1
  2128. }, isEditable: function (a) {
  2129. var b = this.getName();
  2130. return this.isReadOnly() || "none" == this.getComputedStyle("display") || "hidden" == this.getComputedStyle("visibility") || CKEDITOR.dtd.$nonEditable[b] || CKEDITOR.dtd.$empty[b] || this.is("a") && (this.data("cke-saved-name") || this.hasAttribute("name")) && !this.getChildCount() ? !1 : !1 !== a ? (a = CKEDITOR.dtd[b] ||
  2131. CKEDITOR.dtd.span, !(!a || !a["#"])) : !0
  2132. }, isIdentical: function (a) {
  2133. var b = this.clone(0, 1);
  2134. a = a.clone(0, 1);
  2135. b.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2136. a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2137. if (b.$.isEqualNode) return b.$.style.cssText = CKEDITOR.tools.normalizeCssText(b.$.style.cssText), a.$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText), b.$.isEqualNode(a.$);
  2138. b = b.getOuterHtml();
  2139. a =
  2140. a.getOuterHtml();
  2141. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && this.is("a")) {
  2142. var c = this.getParent();
  2143. c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(b), b = c.getHtml(), c.setHtml(a), a = c.getHtml())
  2144. }
  2145. return b == a
  2146. }, isVisible: function () {
  2147. var a = (this.$.offsetHeight || this.$.offsetWidth) && "hidden" != this.getComputedStyle("visibility"),
  2148. b, c;
  2149. a && CKEDITOR.env.webkit && (b = this.getWindow(), !b.equals(CKEDITOR.document.getWindow()) && (c = b.$.frameElement) && (a = (new CKEDITOR.dom.element(c)).isVisible()));
  2150. return !!a
  2151. }, isEmptyInlineRemoveable: function () {
  2152. if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return !1;
  2153. for (var a = this.getChildren(), b = 0, c = a.count(); b < c; b++) {
  2154. var e = a.getItem(b);
  2155. if (e.type != CKEDITOR.NODE_ELEMENT || !e.data("cke-bookmark")) if (e.type == CKEDITOR.NODE_ELEMENT && !e.isEmptyInlineRemoveable() || e.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(e.getText())) return !1
  2156. }
  2157. return !0
  2158. }, hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function () {
  2159. for (var a = this.$.attributes, b = 0; b < a.length; b++) {
  2160. var c = a[b];
  2161. switch (c.nodeName) {
  2162. case "class":
  2163. if (this.getAttribute("class")) return !0;
  2164. case "data-cke-expando":
  2165. continue;
  2166. default:
  2167. if (c.specified) return !0
  2168. }
  2169. }
  2170. return !1
  2171. } : function () {
  2172. var a = this.$.attributes, b = a.length, c = {"data-cke-expando": 1, _moz_dirty: 1};
  2173. return 0 < b && (2 < b || !c[a[0].nodeName] || 2 == b && !c[a[1].nodeName])
  2174. }, hasAttribute: function () {
  2175. function a(b) {
  2176. var c = this.$.attributes.getNamedItem(b);
  2177. if ("input" == this.getName()) switch (b) {
  2178. case "class":
  2179. return 0 < this.$.className.length;
  2180. case "checked":
  2181. return !!this.$.checked;
  2182. case "value":
  2183. return b = this.getAttribute("type"), "checkbox" == b || "radio" == b ? "on" != this.$.value : !!this.$.value
  2184. }
  2185. return c ?
  2186. c.specified : !1
  2187. }
  2188. return CKEDITOR.env.ie ? 8 > CKEDITOR.env.version ? function (b) {
  2189. return "name" == b ? !!this.$.name : a.call(this, b)
  2190. } : a : function (a) {
  2191. return !!this.$.attributes.getNamedItem(a)
  2192. }
  2193. }(), hide: function () {
  2194. this.setStyle("display", "none")
  2195. }, moveChildren: function (a, b) {
  2196. var c = this.$;
  2197. a = a.$;
  2198. if (c != a) {
  2199. var e;
  2200. if (b) for (; e = c.lastChild;) a.insertBefore(c.removeChild(e), a.firstChild); else for (; e = c.firstChild;) a.appendChild(c.removeChild(e))
  2201. }
  2202. }, mergeSiblings: function () {
  2203. function a(b, c, e) {
  2204. if (c && c.type == CKEDITOR.NODE_ELEMENT) {
  2205. for (var d =
  2206. []; c.data("cke-bookmark") || c.isEmptyInlineRemoveable();) if (d.push(c), c = e ? c.getNext() : c.getPrevious(), !c || c.type != CKEDITOR.NODE_ELEMENT) return;
  2207. if (b.isIdentical(c)) {
  2208. for (var h = e ? b.getLast() : b.getFirst(); d.length;) d.shift().move(b, !e);
  2209. c.moveChildren(b, !e);
  2210. c.remove();
  2211. h && h.type == CKEDITOR.NODE_ELEMENT && h.mergeSiblings()
  2212. }
  2213. }
  2214. }
  2215. return function (b) {
  2216. if (!1 === b || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) a(this, this.getNext(), !0), a(this, this.getPrevious())
  2217. }
  2218. }(), show: function () {
  2219. this.setStyles({
  2220. display: "",
  2221. visibility: ""
  2222. })
  2223. }, setAttribute: function () {
  2224. var a = function (a, b) {
  2225. this.$.setAttribute(a, b);
  2226. return this
  2227. };
  2228. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function (b, c) {
  2229. "class" == b ? this.$.className = c : "style" == b ? this.$.style.cssText = c : "tabindex" == b ? this.$.tabIndex = c : "checked" == b ? this.$.checked = c : "contenteditable" == b ? a.call(this, "contentEditable", c) : a.apply(this, arguments);
  2230. return this
  2231. } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function (b, c) {
  2232. if ("src" == b && c.match(/^http:\/\//)) try {
  2233. a.apply(this,
  2234. arguments)
  2235. } catch (e) {
  2236. } else a.apply(this, arguments);
  2237. return this
  2238. } : a
  2239. }(), setAttributes: function (a) {
  2240. for (var b in a) this.setAttribute(b, a[b]);
  2241. return this
  2242. }, setValue: function (a) {
  2243. this.$.value = a;
  2244. return this
  2245. }, removeAttribute: function () {
  2246. var a = function (a) {
  2247. this.$.removeAttribute(a)
  2248. };
  2249. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function (a) {
  2250. "class" == a ? a = "className" : "tabindex" == a ? a = "tabIndex" : "contenteditable" == a && (a = "contentEditable");
  2251. this.$.removeAttribute(a)
  2252. } : a
  2253. }(), removeAttributes: function (a) {
  2254. if (CKEDITOR.tools.isArray(a)) for (var b =
  2255. 0; b < a.length; b++) this.removeAttribute(a[b]); else for (b in a = a || this.getAttributes(), a) a.hasOwnProperty(b) && this.removeAttribute(b)
  2256. }, removeStyle: function (a) {
  2257. var b = this.$.style;
  2258. if (b.removeProperty || "border" != a && "margin" != a && "padding" != a) b.removeProperty ? b.removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)), this.$.style.cssText || this.removeAttribute("style"); else {
  2259. var c = ["top", "left", "right", "bottom"], e;
  2260. "border" == a && (e = ["color", "style", "width"]);
  2261. for (var b = [], d = 0; d < c.length; d++) if (e) for (var v =
  2262. 0; v < e.length; v++) b.push([a, c[d], e[v]].join("-")); else b.push([a, c[d]].join("-"));
  2263. for (a = 0; a < b.length; a++) this.removeStyle(b[a])
  2264. }
  2265. }, setStyle: function (a, b) {
  2266. this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b;
  2267. return this
  2268. }, setStyles: function (a) {
  2269. for (var b in a) this.setStyle(b, a[b]);
  2270. return this
  2271. }, setOpacity: function (a) {
  2272. CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? (a = Math.round(100 * a), this.setStyle("filter", 100 <= a ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity\x3d" + a + ")")) : this.setStyle("opacity", a)
  2273. }, unselectable: function () {
  2274. this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
  2275. "none"));
  2276. if (CKEDITOR.env.ie) {
  2277. this.setAttribute("unselectable", "on");
  2278. for (var a, b = this.getElementsByTag("*"), c = 0, e = b.count(); c < e; c++) a = b.getItem(c), a.setAttribute("unselectable", "on")
  2279. }
  2280. }, getPositionedAncestor: function () {
  2281. for (var a = this; "html" != a.getName();) {
  2282. if ("static" != a.getComputedStyle("position")) return a;
  2283. a = a.getParent()
  2284. }
  2285. return null
  2286. }, getDocumentPosition: function (a) {
  2287. var b = 0, c = 0, e = this.getDocument(), d = e.getBody(), v = "BackCompat" == e.$.compatMode;
  2288. if (document.documentElement.getBoundingClientRect && (CKEDITOR.env.ie ?
  2289. 8 !== CKEDITOR.env.version : 1)) {
  2290. var f = this.$.getBoundingClientRect(), g = e.$.documentElement,
  2291. u = g.clientTop || d.$.clientTop || 0, m = g.clientLeft || d.$.clientLeft || 0, k = !0;
  2292. CKEDITOR.env.ie && (k = e.getDocumentElement().contains(this), e = e.getBody().contains(this), k = v && e || !v && k);
  2293. k && (CKEDITOR.env.webkit || CKEDITOR.env.ie && 12 <= CKEDITOR.env.version ? (b = d.$.scrollLeft || g.scrollLeft, c = d.$.scrollTop || g.scrollTop) : (c = v ? d.$ : g, b = c.scrollLeft, c = c.scrollTop), b = f.left + b - m, c = f.top + c - u)
  2294. } else for (u = this, m = null; u && "body" != u.getName() &&
  2295. "html" != u.getName();) {
  2296. b += u.$.offsetLeft - u.$.scrollLeft;
  2297. c += u.$.offsetTop - u.$.scrollTop;
  2298. u.equals(this) || (b += u.$.clientLeft || 0, c += u.$.clientTop || 0);
  2299. for (; m && !m.equals(u);) b -= m.$.scrollLeft, c -= m.$.scrollTop, m = m.getParent();
  2300. m = u;
  2301. u = (f = u.$.offsetParent) ? new CKEDITOR.dom.element(f) : null
  2302. }
  2303. a && (f = this.getWindow(), u = a.getWindow(), !f.equals(u) && f.$.frameElement && (a = (new CKEDITOR.dom.element(f.$.frameElement)).getDocumentPosition(a), b += a.x, c += a.y));
  2304. document.documentElement.getBoundingClientRect || !CKEDITOR.env.gecko ||
  2305. v || (b += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0);
  2306. return {x: b, y: c}
  2307. }, scrollIntoView: function (a) {
  2308. var b = this.getParent();
  2309. if (b) {
  2310. do if ((b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1), b.is("html")) {
  2311. var c = b.getWindow();
  2312. try {
  2313. var e = c.$.frameElement;
  2314. e && (b = new CKEDITOR.dom.element(e))
  2315. } catch (d) {
  2316. }
  2317. } while (b = b.getParent())
  2318. }
  2319. }, scrollIntoParent: function (a, b, c) {
  2320. var e, d, v, f;
  2321. function g(b, c) {
  2322. /body|html/.test(a.getName()) ?
  2323. a.getWindow().$.scrollBy(b, c) : (a.$.scrollLeft += b, a.$.scrollTop += c)
  2324. }
  2325. function u(a, b) {
  2326. var c = {x: 0, y: 0};
  2327. if (!a.is(k ? "body" : "html")) {
  2328. var e = a.$.getBoundingClientRect();
  2329. c.x = e.left;
  2330. c.y = e.top
  2331. }
  2332. e = a.getWindow();
  2333. e.equals(b) || (e = u(CKEDITOR.dom.element.get(e.$.frameElement), b), c.x += e.x, c.y += e.y);
  2334. return c
  2335. }
  2336. function m(a, b) {
  2337. return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0
  2338. }
  2339. !a && (a = this.getWindow());
  2340. v = a.getDocument();
  2341. var k = "BackCompat" == v.$.compatMode;
  2342. a instanceof CKEDITOR.dom.window && (a = k ? v.getBody() : v.getDocumentElement());
  2343. CKEDITOR.env.webkit && (v = this.getEditor(!1)) && (v._.previousScrollTop = null);
  2344. v = a.getWindow();
  2345. d = u(this, v);
  2346. var w = u(a, v), H = this.$.offsetHeight;
  2347. e = this.$.offsetWidth;
  2348. var n = a.$.clientHeight, r = a.$.clientWidth;
  2349. v = d.x - m(this, "left") - w.x || 0;
  2350. f = d.y - m(this, "top") - w.y || 0;
  2351. e = d.x + e + m(this, "right") - (w.x + r) || 0;
  2352. d = d.y + H + m(this, "bottom") - (w.y + n) || 0;
  2353. (0 > f || 0 < d) && g(0, !0 === b ? f : !1 === b ? d : 0 > f ? f : d);
  2354. c && (0 > v || 0 < e) && g(0 > v ? v : e, 0)
  2355. }, setState: function (a, b, c) {
  2356. b = b || "cke";
  2357. switch (a) {
  2358. case CKEDITOR.TRISTATE_ON:
  2359. this.addClass(b + "_on");
  2360. this.removeClass(b +
  2361. "_off");
  2362. this.removeClass(b + "_disabled");
  2363. c && this.setAttribute("aria-pressed", !0);
  2364. c && this.removeAttribute("aria-disabled");
  2365. break;
  2366. case CKEDITOR.TRISTATE_DISABLED:
  2367. this.addClass(b + "_disabled");
  2368. this.removeClass(b + "_off");
  2369. this.removeClass(b + "_on");
  2370. c && this.setAttribute("aria-disabled", !0);
  2371. c && this.removeAttribute("aria-pressed");
  2372. break;
  2373. default:
  2374. this.addClass(b + "_off"), this.removeClass(b + "_on"), this.removeClass(b + "_disabled"), c && this.removeAttribute("aria-pressed"), c && this.removeAttribute("aria-disabled")
  2375. }
  2376. },
  2377. getFrameDocument: function () {
  2378. var a = this.$;
  2379. try {
  2380. a.contentWindow.document
  2381. } catch (b) {
  2382. a.src = a.src
  2383. }
  2384. return a && new CKEDITOR.dom.document(a.contentWindow.document)
  2385. }, copyAttributes: function (a, b) {
  2386. var c = this.$.attributes;
  2387. b = b || {};
  2388. for (var e = 0; e < c.length; e++) {
  2389. var d = c[e], v = d.nodeName.toLowerCase(), f;
  2390. if (!(v in b)) if ("checked" == v && (f = this.getAttribute(v))) a.setAttribute(v, f); else if (!CKEDITOR.env.ie || this.hasAttribute(v)) f = this.getAttribute(v), null === f && (f = d.nodeValue), a.setAttribute(v, f)
  2391. }
  2392. "" !== this.$.style.cssText &&
  2393. (a.$.style.cssText = this.$.style.cssText)
  2394. }, renameNode: function (a) {
  2395. if (this.getName() != a) {
  2396. var b = this.getDocument();
  2397. a = new CKEDITOR.dom.element(a, b);
  2398. this.copyAttributes(a);
  2399. this.moveChildren(a);
  2400. this.getParent(!0) && this.$.parentNode.replaceChild(a.$, this.$);
  2401. a.$["data-cke-expando"] = this.$["data-cke-expando"];
  2402. this.$ = a.$;
  2403. delete this.getName
  2404. }
  2405. }, getChild: function () {
  2406. function a(b, c) {
  2407. var e = b.childNodes;
  2408. if (0 <= c && c < e.length) return e[c]
  2409. }
  2410. return function (b) {
  2411. var c = this.$;
  2412. if (b.slice) for (b = b.slice(); 0 < b.length && c;) c = a(c,
  2413. b.shift()); else c = a(c, b);
  2414. return c ? new CKEDITOR.dom.node(c) : null
  2415. }
  2416. }(), getChildCount: function () {
  2417. return this.$.childNodes.length
  2418. }, disableContextMenu: function () {
  2419. function a(b) {
  2420. return b.type == CKEDITOR.NODE_ELEMENT && b.hasClass("cke_enable_context_menu")
  2421. }
  2422. this.on("contextmenu", function (b) {
  2423. b.data.getTarget().getAscendant(a, !0) || b.data.preventDefault()
  2424. })
  2425. }, getDirection: function (a) {
  2426. return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() && this.getParent().getDirection(1) || this.getDocument().$.dir ||
  2427. "ltr" : this.getStyle("direction") || this.getAttribute("dir")
  2428. }, data: function (a, b) {
  2429. a = "data-" + a;
  2430. if (void 0 === b) return this.getAttribute(a);
  2431. !1 === b ? this.removeAttribute(a) : this.setAttribute(a, b);
  2432. return null
  2433. }, getEditor: function (a) {
  2434. var b = CKEDITOR.instances, c, e, d;
  2435. a = a || void 0 === a;
  2436. for (c in b) if (e = b[c], e.element.equals(this) && e.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || !a && (d = e.editable()) && (d.equals(this) || d.contains(this))) return e;
  2437. return null
  2438. }, find: function (a) {
  2439. var c = d(this);
  2440. a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this,
  2441. a)));
  2442. c();
  2443. return a
  2444. }, findOne: function (a) {
  2445. var c = d(this);
  2446. a = this.$.querySelector(b(this, a));
  2447. c();
  2448. return a ? new CKEDITOR.dom.element(a) : null
  2449. }, forEach: function (a, b, c) {
  2450. if (!(c || b && this.type != b)) var e = a(this);
  2451. if (!1 !== e) {
  2452. c = this.getChildren();
  2453. for (var d = 0; d < c.count(); d++) e = c.getItem(d), e.type == CKEDITOR.NODE_ELEMENT ? e.forEach(a, b) : b && e.type != b || a(e)
  2454. }
  2455. }
  2456. });
  2457. var k = {
  2458. width: ["border-left-width", "border-right-width", "padding-left", "padding-right"],
  2459. height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"]
  2460. };
  2461. CKEDITOR.dom.element.prototype.setSize = function (a, b, d) {
  2462. "number" == typeof b && (!d || CKEDITOR.env.ie && CKEDITOR.env.quirks || (b -= c.call(this, a)), this.setStyle(a, b + "px"))
  2463. };
  2464. CKEDITOR.dom.element.prototype.getSize = function (a, b) {
  2465. var d = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0;
  2466. b && (d -= c.call(this, a));
  2467. return d
  2468. }
  2469. })();
  2470. CKEDITOR.dom.documentFragment = function (a) {
  2471. a = a || CKEDITOR.document;
  2472. this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() : a
  2473. };
  2474. CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, {
  2475. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  2476. insertAfterNode: function (a) {
  2477. a = a.$;
  2478. a.parentNode.insertBefore(this.$, a.nextSibling)
  2479. },
  2480. getHtml: function () {
  2481. var a = new CKEDITOR.dom.element("div");
  2482. this.clone(1, 1).appendTo(a);
  2483. return a.getHtml().replace(/\s*data-cke-expando=".*?"/g, "")
  2484. }
  2485. }, !0, {
  2486. append: 1,
  2487. appendBogus: 1,
  2488. clone: 1,
  2489. getFirst: 1,
  2490. getHtml: 1,
  2491. getLast: 1,
  2492. getParent: 1,
  2493. getNext: 1,
  2494. getPrevious: 1,
  2495. appendTo: 1,
  2496. moveChildren: 1,
  2497. insertBefore: 1,
  2498. insertAfterNode: 1,
  2499. replace: 1,
  2500. trim: 1,
  2501. type: 1,
  2502. ltrim: 1,
  2503. rtrim: 1,
  2504. getDocument: 1,
  2505. getChildCount: 1,
  2506. getChild: 1,
  2507. getChildren: 1
  2508. });
  2509. (function () {
  2510. function a(a, b) {
  2511. var c = this.range;
  2512. if (this._.end) return null;
  2513. if (!this._.start) {
  2514. this._.start = 1;
  2515. if (c.collapsed) return this.end(), null;
  2516. c.optimize()
  2517. }
  2518. var e, d = c.startContainer;
  2519. e = c.endContainer;
  2520. var f = c.startOffset, y = c.endOffset, g, n = this.guard, r = this.type,
  2521. C = a ? "getPreviousSourceNode" : "getNextSourceNode";
  2522. if (!a && !this._.guardLTR) {
  2523. var L = e.type == CKEDITOR.NODE_ELEMENT ? e : e.getParent(),
  2524. h = e.type == CKEDITOR.NODE_ELEMENT ? e.getChild(y) : e.getNext();
  2525. this._.guardLTR = function (a, b) {
  2526. return (!b || !L.equals(a)) && (!h ||
  2527. !a.equals(h)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
  2528. }
  2529. }
  2530. if (a && !this._.guardRTL) {
  2531. var k = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(),
  2532. t = d.type == CKEDITOR.NODE_ELEMENT ? f ? d.getChild(f - 1) : null : d.getPrevious();
  2533. this._.guardRTL = function (a, b) {
  2534. return (!b || !k.equals(a)) && (!t || !a.equals(t)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
  2535. }
  2536. }
  2537. var D = a ? this._.guardRTL : this._.guardLTR;
  2538. g = n ? function (a, b) {
  2539. return !1 === D(a, b) ? !1 : n(a, b)
  2540. } : D;
  2541. this.current ? e = this.current[C](!1, r, g) : (a ? e.type == CKEDITOR.NODE_ELEMENT &&
  2542. (e = 0 < y ? e.getChild(y - 1) : !1 === g(e, !0) ? null : e.getPreviousSourceNode(!0, r, g)) : (e = d, e.type == CKEDITOR.NODE_ELEMENT && ((e = e.getChild(f)) || (e = !1 === g(d, !0) ? null : d.getNextSourceNode(!0, r, g)))), e && !1 === g(e) && (e = null));
  2543. for (; e && !this._.end;) {
  2544. this.current = e;
  2545. if (!this.evaluator || !1 !== this.evaluator(e)) {
  2546. if (!b) return e
  2547. } else if (b && this.evaluator) return !1;
  2548. e = e[C](!1, r, g)
  2549. }
  2550. this.end();
  2551. return this.current = null
  2552. }
  2553. function d(b) {
  2554. for (var c, e = null; c = a.call(this, b);) e = c;
  2555. return e
  2556. }
  2557. CKEDITOR.dom.walker = CKEDITOR.tools.createClass({
  2558. $: function (a) {
  2559. this.range =
  2560. a;
  2561. this._ = {}
  2562. }, proto: {
  2563. end: function () {
  2564. this._.end = 1
  2565. }, next: function () {
  2566. return a.call(this)
  2567. }, previous: function () {
  2568. return a.call(this, 1)
  2569. }, checkForward: function () {
  2570. return !1 !== a.call(this, 0, 1)
  2571. }, checkBackward: function () {
  2572. return !1 !== a.call(this, 1, 1)
  2573. }, lastForward: function () {
  2574. return d.call(this)
  2575. }, lastBackward: function () {
  2576. return d.call(this, 1)
  2577. }, reset: function () {
  2578. delete this.current;
  2579. this._ = {}
  2580. }
  2581. }
  2582. });
  2583. var b = {
  2584. block: 1,
  2585. "list-item": 1,
  2586. table: 1,
  2587. "table-row-group": 1,
  2588. "table-header-group": 1,
  2589. "table-footer-group": 1,
  2590. "table-row": 1,
  2591. "table-column-group": 1,
  2592. "table-column": 1,
  2593. "table-cell": 1,
  2594. "table-caption": 1
  2595. }, c = {absolute: 1, fixed: 1};
  2596. CKEDITOR.dom.element.prototype.isBlockBoundary = function (a) {
  2597. return "none" != this.getComputedStyle("float") || this.getComputedStyle("position") in c || !b[this.getComputedStyle("display")] ? !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) : !0
  2598. };
  2599. CKEDITOR.dom.walker.blockBoundary = function (a) {
  2600. return function (b) {
  2601. return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a))
  2602. }
  2603. };
  2604. CKEDITOR.dom.walker.listItemBoundary = function () {
  2605. return this.blockBoundary({br: 1})
  2606. };
  2607. CKEDITOR.dom.walker.bookmark = function (a, b) {
  2608. function c(a) {
  2609. return a && a.getName && "span" == a.getName() && a.data("cke-bookmark")
  2610. }
  2611. return function (e) {
  2612. var d, f;
  2613. d = e && e.type != CKEDITOR.NODE_ELEMENT && (f = e.getParent()) && c(f);
  2614. d = a ? d : d || c(e);
  2615. return !!(b ^ d)
  2616. }
  2617. };
  2618. CKEDITOR.dom.walker.whitespaces = function (a) {
  2619. return function (b) {
  2620. var c;
  2621. b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);
  2622. return !!(a ^ c)
  2623. }
  2624. };
  2625. CKEDITOR.dom.walker.invisible =
  2626. function (a) {
  2627. var b = CKEDITOR.dom.walker.whitespaces(), c = CKEDITOR.env.webkit ? 1 : 0;
  2628. return function (e) {
  2629. b(e) ? e = 1 : (e.type == CKEDITOR.NODE_TEXT && (e = e.getParent()), e = e.$.offsetWidth <= c);
  2630. return !!(a ^ e)
  2631. }
  2632. };
  2633. CKEDITOR.dom.walker.nodeType = function (a, b) {
  2634. return function (c) {
  2635. return !!(b ^ c.type == a)
  2636. }
  2637. };
  2638. CKEDITOR.dom.walker.bogus = function (a) {
  2639. function b(a) {
  2640. return !g(a) && !k(a)
  2641. }
  2642. return function (c) {
  2643. var e = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && f.test(c.getText());
  2644. e && (e = c.getParent(), c = c.getNext(b), e = e.isBlockBoundary() &&
  2645. (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary()));
  2646. return !!(a ^ e)
  2647. }
  2648. };
  2649. CKEDITOR.dom.walker.temp = function (a) {
  2650. return function (b) {
  2651. b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  2652. b = b && b.hasAttribute("data-cke-temp");
  2653. return !!(a ^ b)
  2654. }
  2655. };
  2656. var f = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/, g = CKEDITOR.dom.walker.whitespaces(),
  2657. k = CKEDITOR.dom.walker.bookmark(), h = CKEDITOR.dom.walker.temp(), p = function (a) {
  2658. return k(a) || g(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty)
  2659. };
  2660. CKEDITOR.dom.walker.ignored =
  2661. function (a) {
  2662. return function (b) {
  2663. b = g(b) || k(b) || h(b);
  2664. return !!(a ^ b)
  2665. }
  2666. };
  2667. var q = CKEDITOR.dom.walker.ignored();
  2668. CKEDITOR.dom.walker.empty = function (a) {
  2669. return function (b) {
  2670. for (var c = 0, e = b.getChildCount(); c < e; ++c) if (!q(b.getChild(c))) return !!a;
  2671. return !a
  2672. }
  2673. };
  2674. var e = CKEDITOR.dom.walker.empty(),
  2675. y = CKEDITOR.dom.walker.validEmptyBlockContainers = CKEDITOR.tools.extend(function (a) {
  2676. var b = {}, c;
  2677. for (c in a) CKEDITOR.dtd[c]["#"] && (b[c] = 1);
  2678. return b
  2679. }(CKEDITOR.dtd.$block), {caption: 1, td: 1, th: 1});
  2680. CKEDITOR.dom.walker.editable = function (a) {
  2681. return function (b) {
  2682. b =
  2683. q(b) ? !1 : b.type == CKEDITOR.NODE_TEXT || b.type == CKEDITOR.NODE_ELEMENT && (b.is(CKEDITOR.dtd.$inline) || b.is("hr") || "false" == b.getAttribute("contenteditable") || !CKEDITOR.env.needsBrFiller && b.is(y) && e(b)) ? !0 : !1;
  2684. return !!(a ^ b)
  2685. }
  2686. };
  2687. CKEDITOR.dom.element.prototype.getBogus = function () {
  2688. var a = this;
  2689. do a = a.getPreviousSourceNode(); while (p(a));
  2690. return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && f.test(a.getText())) ? a : !1
  2691. }
  2692. })();
  2693. CKEDITOR.dom.range = function (a) {
  2694. this.endOffset = this.endContainer = this.startOffset = this.startContainer = null;
  2695. this.collapsed = !0;
  2696. var d = a instanceof CKEDITOR.dom.document;
  2697. this.document = d ? a : a.getDocument();
  2698. this.root = d ? a.getBody() : a
  2699. };
  2700. (function () {
  2701. function a(a) {
  2702. a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset
  2703. }
  2704. function d(a, b, c, d, f) {
  2705. function g(a, b, c, e) {
  2706. var G = c ? a.getPrevious() : a.getNext();
  2707. if (e && k) return G;
  2708. n || e ? b.append(a.clone(!0, f), c) : (a.remove(), q && b.append(a, c));
  2709. return G
  2710. }
  2711. function m() {
  2712. var a, b, c, e = Math.min(O.length, l.length);
  2713. for (a = 0; a < e; a++) if (b = O[a], c = l[a], !b.equals(c)) return a;
  2714. return a - 1
  2715. }
  2716. function h() {
  2717. var b = K - 1, c = D && z && !r.equals(C);
  2718. b < B - 1 || b < A - 1 || c ? (c ? a.moveToPosition(C,
  2719. CKEDITOR.POSITION_BEFORE_START) : A == b + 1 && t ? a.moveToPosition(l[b], CKEDITOR.POSITION_BEFORE_END) : a.moveToPosition(l[b + 1], CKEDITOR.POSITION_BEFORE_START), d && (b = O[b + 1]) && b.type == CKEDITOR.NODE_ELEMENT && (c = CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e', a.document), c.insertAfter(b), b.mergeSiblings(!1), a.moveToBookmark({startNode: c}))) : a.collapse(!0)
  2720. }
  2721. a.optimizeBookmark();
  2722. var k = 0 === b, q = 1 == b, n = 2 == b;
  2723. b = n || q;
  2724. var r = a.startContainer, C = a.endContainer,
  2725. L = a.startOffset, E = a.endOffset, N, t, D, z, I, P;
  2726. if (n && C.type == CKEDITOR.NODE_TEXT && (r.equals(C) || r.type === CKEDITOR.NODE_ELEMENT && r.getFirst().equals(C))) c.append(a.document.createText(C.substring(L, E))); else {
  2727. C.type == CKEDITOR.NODE_TEXT ? n ? P = !0 : C = C.split(E) : 0 < C.getChildCount() ? E >= C.getChildCount() ? (C = C.getChild(E - 1), t = !0) : C = C.getChild(E) : z = t = !0;
  2728. r.type == CKEDITOR.NODE_TEXT ? n ? I = !0 : r.split(L) : 0 < r.getChildCount() ? 0 === L ? (r = r.getChild(L), N = !0) : r = r.getChild(L - 1) : D = N = !0;
  2729. for (var O = r.getParents(), l = C.getParents(), K = m(),
  2730. B = O.length - 1, A = l.length - 1, J = c, G, X, V, da = -1, Q = K; Q <= B; Q++) {
  2731. X = O[Q];
  2732. V = X.getNext();
  2733. for (Q != B || X.equals(l[Q]) && B < A ? b && (G = J.append(X.clone(0, f))) : N ? g(X, J, !1, D) : I && J.append(a.document.createText(X.substring(L))); V;) {
  2734. if (V.equals(l[Q])) {
  2735. da = Q;
  2736. break
  2737. }
  2738. V = g(V, J)
  2739. }
  2740. J = G
  2741. }
  2742. J = c;
  2743. for (Q = K; Q <= A; Q++) if (c = l[Q], V = c.getPrevious(), c.equals(O[Q])) b && (J = J.getChild(0)); else {
  2744. Q != A || c.equals(O[Q]) && A < B ? b && (G = J.append(c.clone(0, f))) : t ? g(c, J, !1, z) : P && J.append(a.document.createText(c.substring(0, E)));
  2745. if (Q > da) for (; V;) V = g(V, J, !0);
  2746. J = G
  2747. }
  2748. n || h()
  2749. }
  2750. }
  2751. function b() {
  2752. var a = !1, b = CKEDITOR.dom.walker.whitespaces(), c = CKEDITOR.dom.walker.bookmark(!0),
  2753. d = CKEDITOR.dom.walker.bogus();
  2754. return function (f) {
  2755. return c(f) || b(f) ? !0 : d(f) && !a ? a = !0 : f.type == CKEDITOR.NODE_TEXT && (f.hasAscendant("pre") || CKEDITOR.tools.trim(f.getText()).length) || f.type == CKEDITOR.NODE_ELEMENT && !f.is(g) ? !1 : !0
  2756. }
  2757. }
  2758. function c(a) {
  2759. var b = CKEDITOR.dom.walker.whitespaces(), c = CKEDITOR.dom.walker.bookmark(1);
  2760. return function (d) {
  2761. return c(d) || b(d) ? !0 : !a && k(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty)
  2762. }
  2763. }
  2764. function f(a) {
  2765. return function () {
  2766. var b;
  2767. return this[a ? "getPreviousNode" : "getNextNode"](function (a) {
  2768. !b && q(a) && (b = a);
  2769. return p(a) && !(k(a) && a.equals(b))
  2770. })
  2771. }
  2772. }
  2773. var g = {
  2774. abbr: 1,
  2775. acronym: 1,
  2776. b: 1,
  2777. bdo: 1,
  2778. big: 1,
  2779. cite: 1,
  2780. code: 1,
  2781. del: 1,
  2782. dfn: 1,
  2783. em: 1,
  2784. font: 1,
  2785. i: 1,
  2786. ins: 1,
  2787. label: 1,
  2788. kbd: 1,
  2789. q: 1,
  2790. samp: 1,
  2791. small: 1,
  2792. span: 1,
  2793. strike: 1,
  2794. strong: 1,
  2795. sub: 1,
  2796. sup: 1,
  2797. tt: 1,
  2798. u: 1,
  2799. "var": 1
  2800. }, k = CKEDITOR.dom.walker.bogus(), h = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/, p = CKEDITOR.dom.walker.editable(),
  2801. q = CKEDITOR.dom.walker.ignored(!0);
  2802. CKEDITOR.dom.range.prototype = {
  2803. clone: function () {
  2804. var a =
  2805. new CKEDITOR.dom.range(this.root);
  2806. a._setStartContainer(this.startContainer);
  2807. a.startOffset = this.startOffset;
  2808. a._setEndContainer(this.endContainer);
  2809. a.endOffset = this.endOffset;
  2810. a.collapsed = this.collapsed;
  2811. return a
  2812. }, collapse: function (a) {
  2813. a ? (this._setEndContainer(this.startContainer), this.endOffset = this.startOffset) : (this._setStartContainer(this.endContainer), this.startOffset = this.endOffset);
  2814. this.collapsed = !0
  2815. }, cloneContents: function (a) {
  2816. var b = new CKEDITOR.dom.documentFragment(this.document);
  2817. this.collapsed ||
  2818. d(this, 2, b, !1, "undefined" == typeof a ? !0 : a);
  2819. return b
  2820. }, deleteContents: function (a) {
  2821. this.collapsed || d(this, 0, null, a)
  2822. }, extractContents: function (a, b) {
  2823. var c = new CKEDITOR.dom.documentFragment(this.document);
  2824. this.collapsed || d(this, 1, c, a, "undefined" == typeof b ? !0 : b);
  2825. return c
  2826. }, createBookmark: function (a) {
  2827. var b, c, d, f, g = this.collapsed;
  2828. b = this.document.createElement("span");
  2829. b.data("cke-bookmark", 1);
  2830. b.setStyle("display", "none");
  2831. b.setHtml("\x26nbsp;");
  2832. a && (d = "cke_bm_" + CKEDITOR.tools.getNextNumber(), b.setAttribute("id",
  2833. d + (g ? "C" : "S")));
  2834. g || (c = b.clone(), c.setHtml("\x26nbsp;"), a && c.setAttribute("id", d + "E"), f = this.clone(), f.collapse(), f.insertNode(c));
  2835. f = this.clone();
  2836. f.collapse(!0);
  2837. f.insertNode(b);
  2838. c ? (this.setStartAfter(b), this.setEndBefore(c)) : this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END);
  2839. return {startNode: a ? d + (g ? "C" : "S") : b, endNode: a ? d + "E" : c, serializable: a, collapsed: g}
  2840. }, createBookmark2: function () {
  2841. function a(b) {
  2842. var e = b.container, d = b.offset, m;
  2843. m = e;
  2844. var f = d;
  2845. m = m.type != CKEDITOR.NODE_ELEMENT || 0 === f || f == m.getChildCount() ?
  2846. 0 : m.getChild(f - 1).type == CKEDITOR.NODE_TEXT && m.getChild(f).type == CKEDITOR.NODE_TEXT;
  2847. m && (e = e.getChild(d - 1), d = e.getLength());
  2848. if (e.type == CKEDITOR.NODE_ELEMENT && 0 < d) {
  2849. a:{
  2850. for (m = e; d--;) if (f = m.getChild(d).getIndex(!0), 0 <= f) {
  2851. d = f;
  2852. break a
  2853. }
  2854. d = -1
  2855. }
  2856. d += 1
  2857. }
  2858. if (e.type == CKEDITOR.NODE_TEXT) {
  2859. m = e;
  2860. for (f = 0; (m = m.getPrevious()) && m.type == CKEDITOR.NODE_TEXT;) f += m.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE, "").length;
  2861. m = f;
  2862. e.getText() ? d += m : (f = e.getPrevious(c), m ? (d = m, e = f ? f.getNext() : e.getParent().getFirst()) : (e =
  2863. e.getParent(), d = f ? f.getIndex(!0) + 1 : 0))
  2864. }
  2865. b.container = e;
  2866. b.offset = d
  2867. }
  2868. function b(a, c) {
  2869. var e = c.getCustomData("cke-fillingChar");
  2870. if (e) {
  2871. var d = a.container;
  2872. e.equals(d) && (a.offset -= CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length, 0 >= a.offset && (a.offset = d.getIndex(), a.container = d.getParent()))
  2873. }
  2874. }
  2875. var c = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, !0);
  2876. return function (c) {
  2877. var d = this.collapsed, f = {container: this.startContainer, offset: this.startOffset},
  2878. m = {container: this.endContainer, offset: this.endOffset};
  2879. c && (a(f),
  2880. b(f, this.root), d || (a(m), b(m, this.root)));
  2881. return {
  2882. start: f.container.getAddress(c),
  2883. end: d ? null : m.container.getAddress(c),
  2884. startOffset: f.offset,
  2885. endOffset: m.offset,
  2886. normalized: c,
  2887. collapsed: d,
  2888. is2: !0
  2889. }
  2890. }
  2891. }(), moveToBookmark: function (a) {
  2892. if (a.is2) {
  2893. var b = this.document.getByAddress(a.start, a.normalized), c = a.startOffset,
  2894. d = a.end && this.document.getByAddress(a.end, a.normalized);
  2895. a = a.endOffset;
  2896. this.setStart(b, c);
  2897. d ? this.setEnd(d, a) : this.collapse(!0)
  2898. } else b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode,
  2899. a = c ? this.document.getById(a.endNode) : a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(!0)
  2900. }, getBoundaryNodes: function () {
  2901. var a = this.startContainer, b = this.endContainer, c = this.startOffset, d = this.endOffset, f;
  2902. if (a.type == CKEDITOR.NODE_ELEMENT) if (f = a.getChildCount(), f > c) a = a.getChild(c); else if (1 > f) a = a.getPreviousSourceNode(); else {
  2903. for (a = a.$; a.lastChild;) a = a.lastChild;
  2904. a = new CKEDITOR.dom.node(a);
  2905. a = a.getNextSourceNode() || a
  2906. }
  2907. if (b.type == CKEDITOR.NODE_ELEMENT) if (f = b.getChildCount(),
  2908. f > d) b = b.getChild(d).getPreviousSourceNode(!0); else if (1 > f) b = b.getPreviousSourceNode(); else {
  2909. for (b = b.$; b.lastChild;) b = b.lastChild;
  2910. b = new CKEDITOR.dom.node(b)
  2911. }
  2912. a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b);
  2913. return {startNode: a, endNode: b}
  2914. }, getCommonAncestor: function (a, b) {
  2915. var c = this.startContainer, d = this.endContainer,
  2916. c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d);
  2917. return b && !c.is ? c.getParent() : c
  2918. }, optimize: function () {
  2919. var a =
  2920. this.startContainer, b = this.startOffset;
  2921. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a));
  2922. a = this.endContainer;
  2923. b = this.endOffset;
  2924. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a))
  2925. }, optimizeBookmark: function () {
  2926. var a = this.startContainer, b = this.endContainer;
  2927. a.is && a.is("span") && a.data("cke-bookmark") && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
  2928. b && b.is && b.is("span") && b.data("cke-bookmark") && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
  2929. },
  2930. trim: function (a, b) {
  2931. var c = this.startContainer, d = this.startOffset, f = this.collapsed;
  2932. if ((!a || f) && c && c.type == CKEDITOR.NODE_TEXT) {
  2933. if (d) if (d >= c.getLength()) d = c.getIndex() + 1, c = c.getParent(); else {
  2934. var g = c.split(d), d = c.getIndex() + 1, c = c.getParent();
  2935. this.startContainer.equals(this.endContainer) ? this.setEnd(g, this.endOffset - this.startOffset) : c.equals(this.endContainer) && (this.endOffset += 1)
  2936. } else d = c.getIndex(), c = c.getParent();
  2937. this.setStart(c, d);
  2938. if (f) {
  2939. this.collapse(!0);
  2940. return
  2941. }
  2942. }
  2943. c = this.endContainer;
  2944. d = this.endOffset;
  2945. b || f || !c || c.type != CKEDITOR.NODE_TEXT || (d ? (d >= c.getLength() || c.split(d), d = c.getIndex() + 1) : d = c.getIndex(), c = c.getParent(), this.setEnd(c, d))
  2946. }, enlarge: function (a, b) {
  2947. function c(a) {
  2948. return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a
  2949. }
  2950. var d = new RegExp(/[^\s\ufeff]/);
  2951. switch (a) {
  2952. case CKEDITOR.ENLARGE_INLINE:
  2953. var f = 1;
  2954. case CKEDITOR.ENLARGE_ELEMENT:
  2955. var g = function (a, b) {
  2956. var c = new CKEDITOR.dom.range(h);
  2957. c.setStart(a, b);
  2958. c.setEndAt(h, CKEDITOR.POSITION_BEFORE_END);
  2959. var c = new CKEDITOR.dom.walker(c),
  2960. e;
  2961. for (c.guard = function (a) {
  2962. return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary())
  2963. }; e = c.next();) {
  2964. if (e.type != CKEDITOR.NODE_TEXT) return !1;
  2965. N = e != a ? e.getText() : e.substring(b);
  2966. if (d.test(N)) return !1
  2967. }
  2968. return !0
  2969. };
  2970. if (this.collapsed) break;
  2971. var m = this.getCommonAncestor(), h = this.root, k, q, n, r, C, L = !1, E, N;
  2972. E = this.startContainer;
  2973. var t = this.startOffset;
  2974. E.type == CKEDITOR.NODE_TEXT ? (t && (E = !CKEDITOR.tools.trim(E.substring(0, t)).length && E, L = !!E), E && ((r = E.getPrevious()) || (n = E.getParent()))) : (t && (r = E.getChild(t - 1) || E.getLast()),
  2975. r || (n = E));
  2976. for (n = c(n); n || r;) {
  2977. if (n && !r) {
  2978. !C && n.equals(m) && (C = !0);
  2979. if (f ? n.isBlockBoundary() : !h.contains(n)) break;
  2980. L && "inline" == n.getComputedStyle("display") || (L = !1, C ? k = n : this.setStartBefore(n));
  2981. r = n.getPrevious()
  2982. }
  2983. for (; r;) if (E = !1, r.type == CKEDITOR.NODE_COMMENT) r = r.getPrevious(); else {
  2984. if (r.type == CKEDITOR.NODE_TEXT) N = r.getText(), d.test(N) && (r = null), E = /[\s\ufeff]$/.test(N); else if ((r.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && r.is("br")) && !r.data("cke-bookmark")) if (L && CKEDITOR.dtd.$removeEmpty[r.getName()]) {
  2985. N =
  2986. r.getText();
  2987. if (d.test(N)) r = null; else for (var t = r.$.getElementsByTagName("*"), D = 0, z; z = t[D++];) if (!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]) {
  2988. r = null;
  2989. break
  2990. }
  2991. r && (E = !!N.length)
  2992. } else r = null;
  2993. E && (L ? C ? k = n : n && this.setStartBefore(n) : L = !0);
  2994. if (r) {
  2995. E = r.getPrevious();
  2996. if (!n && !E) {
  2997. n = r;
  2998. r = null;
  2999. break
  3000. }
  3001. r = E
  3002. } else n = null
  3003. }
  3004. n && (n = c(n.getParent()))
  3005. }
  3006. E = this.endContainer;
  3007. t = this.endOffset;
  3008. n = r = null;
  3009. C = L = !1;
  3010. E.type == CKEDITOR.NODE_TEXT ? CKEDITOR.tools.trim(E.substring(t)).length ? L = !0 : (L = !E.getLength(), t == E.getLength() ? (r = E.getNext()) ||
  3011. (n = E.getParent()) : g(E, t) && (n = E.getParent())) : (r = E.getChild(t)) || (n = E);
  3012. for (; n || r;) {
  3013. if (n && !r) {
  3014. !C && n.equals(m) && (C = !0);
  3015. if (f ? n.isBlockBoundary() : !h.contains(n)) break;
  3016. L && "inline" == n.getComputedStyle("display") || (L = !1, C ? q = n : n && this.setEndAfter(n));
  3017. r = n.getNext()
  3018. }
  3019. for (; r;) {
  3020. E = !1;
  3021. if (r.type == CKEDITOR.NODE_TEXT) N = r.getText(), g(r, 0) || (r = null), E = /^[\s\ufeff]/.test(N); else if (r.type == CKEDITOR.NODE_ELEMENT) {
  3022. if ((0 < r.$.offsetWidth || b && r.is("br")) && !r.data("cke-bookmark")) if (L && CKEDITOR.dtd.$removeEmpty[r.getName()]) {
  3023. N =
  3024. r.getText();
  3025. if (d.test(N)) r = null; else for (t = r.$.getElementsByTagName("*"), D = 0; z = t[D++];) if (!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]) {
  3026. r = null;
  3027. break
  3028. }
  3029. r && (E = !!N.length)
  3030. } else r = null
  3031. } else E = 1;
  3032. E && L && (C ? q = n : this.setEndAfter(n));
  3033. if (r) {
  3034. E = r.getNext();
  3035. if (!n && !E) {
  3036. n = r;
  3037. r = null;
  3038. break
  3039. }
  3040. r = E
  3041. } else n = null
  3042. }
  3043. n && (n = c(n.getParent()))
  3044. }
  3045. k && q && (m = k.contains(q) ? q : k, this.setStartBefore(m), this.setEndAfter(m));
  3046. break;
  3047. case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
  3048. case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
  3049. n = new CKEDITOR.dom.range(this.root);
  3050. h = this.root;
  3051. n.setStartAt(h, CKEDITOR.POSITION_AFTER_START);
  3052. n.setEnd(this.startContainer, this.startOffset);
  3053. n = new CKEDITOR.dom.walker(n);
  3054. var I, P,
  3055. O = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? {br: 1} : null),
  3056. l = null, K = function (a) {
  3057. if (a.type == CKEDITOR.NODE_ELEMENT && "false" == a.getAttribute("contenteditable")) if (l) {
  3058. if (l.equals(a)) {
  3059. l = null;
  3060. return
  3061. }
  3062. } else l = a; else if (l) return;
  3063. var b = O(a);
  3064. b || (I = a);
  3065. return b
  3066. }, f = function (a) {
  3067. var b = K(a);
  3068. !b && a.is && a.is("br") && (P = a);
  3069. return b
  3070. };
  3071. n.guard = K;
  3072. n = n.lastBackward();
  3073. I = I || h;
  3074. this.setStartAt(I, !I.is("br") && (!n && this.checkStartOfBlock() || n && I.contains(n)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
  3075. if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
  3076. n = this.clone();
  3077. n = new CKEDITOR.dom.walker(n);
  3078. var B = CKEDITOR.dom.walker.whitespaces(), A = CKEDITOR.dom.walker.bookmark();
  3079. n.evaluator = function (a) {
  3080. return !B(a) && !A(a)
  3081. };
  3082. if ((n = n.previous()) && n.type == CKEDITOR.NODE_ELEMENT && n.is("br")) break
  3083. }
  3084. n = this.clone();
  3085. n.collapse();
  3086. n.setEndAt(h, CKEDITOR.POSITION_BEFORE_END);
  3087. n = new CKEDITOR.dom.walker(n);
  3088. n.guard = a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? f : K;
  3089. I = l = P = null;
  3090. n = n.lastForward();
  3091. I = I || h;
  3092. this.setEndAt(I, !n && this.checkEndOfBlock() || n && I.contains(n) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START);
  3093. P && this.setEndAfter(P)
  3094. }
  3095. }, shrink: function (a, b, c) {
  3096. var d = "boolean" === typeof c ? c : c && "boolean" === typeof c.shrinkOnBlockBoundary ? c.shrinkOnBlockBoundary : !0,
  3097. f = c && c.skipBogus;
  3098. if (!this.collapsed) {
  3099. a = a || CKEDITOR.SHRINK_TEXT;
  3100. var g = this.clone(), m = this.startContainer, h = this.endContainer, k = this.startOffset,
  3101. q = this.endOffset, n = c = 1;
  3102. m && m.type == CKEDITOR.NODE_TEXT && (k ? k >= m.getLength() ? g.setStartAfter(m) : (g.setStartBefore(m), c = 0) : g.setStartBefore(m));
  3103. h && h.type == CKEDITOR.NODE_TEXT && (q ? q >= h.getLength() ? g.setEndAfter(h) : (g.setEndAfter(h), n = 0) : g.setEndBefore(h));
  3104. var g = new CKEDITOR.dom.walker(g), r = CKEDITOR.dom.walker.bookmark(),
  3105. C = CKEDITOR.dom.walker.bogus();
  3106. g.evaluator = function (b) {
  3107. return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT)
  3108. };
  3109. var L;
  3110. g.guard = function (b, c) {
  3111. if (f && C(b) || r(b)) return !0;
  3112. if (a == CKEDITOR.SHRINK_ELEMENT && b.type == CKEDITOR.NODE_TEXT || c && b.equals(L) || !1 === d && b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute("contenteditable")) return !1;
  3113. c || b.type != CKEDITOR.NODE_ELEMENT || (L = b);
  3114. return !0
  3115. };
  3116. c && (m = g[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(m, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
  3117. n && (g.reset(), (g = g[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(g, b ? CKEDITOR.POSITION_BEFORE_END :
  3118. CKEDITOR.POSITION_AFTER_END));
  3119. return !(!c && !n)
  3120. }
  3121. }, insertNode: function (a) {
  3122. this.optimizeBookmark();
  3123. this.trim(!1, !0);
  3124. var b = this.startContainer, c = b.getChild(this.startOffset);
  3125. c ? a.insertBefore(c) : b.append(a);
  3126. a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
  3127. this.setStartBefore(a)
  3128. }, moveToPosition: function (a, b) {
  3129. this.setStartAt(a, b);
  3130. this.collapse(!0)
  3131. }, moveToRange: function (a) {
  3132. this.setStart(a.startContainer, a.startOffset);
  3133. this.setEnd(a.endContainer, a.endOffset)
  3134. }, selectNodeContents: function (a) {
  3135. this.setStart(a,
  3136. 0);
  3137. this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
  3138. }, setStart: function (b, c) {
  3139. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex(), b = b.getParent());
  3140. this._setStartContainer(b);
  3141. this.startOffset = c;
  3142. this.endContainer || (this._setEndContainer(b), this.endOffset = c);
  3143. a(this)
  3144. }, setEnd: function (b, c) {
  3145. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b.getParent());
  3146. this._setEndContainer(b);
  3147. this.endOffset = c;
  3148. this.startContainer ||
  3149. (this._setStartContainer(b), this.startOffset = c);
  3150. a(this)
  3151. }, setStartAfter: function (a) {
  3152. this.setStart(a.getParent(), a.getIndex() + 1)
  3153. }, setStartBefore: function (a) {
  3154. this.setStart(a.getParent(), a.getIndex())
  3155. }, setEndAfter: function (a) {
  3156. this.setEnd(a.getParent(), a.getIndex() + 1)
  3157. }, setEndBefore: function (a) {
  3158. this.setEnd(a.getParent(), a.getIndex())
  3159. }, setStartAt: function (b, c) {
  3160. switch (c) {
  3161. case CKEDITOR.POSITION_AFTER_START:
  3162. this.setStart(b, 0);
  3163. break;
  3164. case CKEDITOR.POSITION_BEFORE_END:
  3165. b.type == CKEDITOR.NODE_TEXT ? this.setStart(b,
  3166. b.getLength()) : this.setStart(b, b.getChildCount());
  3167. break;
  3168. case CKEDITOR.POSITION_BEFORE_START:
  3169. this.setStartBefore(b);
  3170. break;
  3171. case CKEDITOR.POSITION_AFTER_END:
  3172. this.setStartAfter(b)
  3173. }
  3174. a(this)
  3175. }, setEndAt: function (b, c) {
  3176. switch (c) {
  3177. case CKEDITOR.POSITION_AFTER_START:
  3178. this.setEnd(b, 0);
  3179. break;
  3180. case CKEDITOR.POSITION_BEFORE_END:
  3181. b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount());
  3182. break;
  3183. case CKEDITOR.POSITION_BEFORE_START:
  3184. this.setEndBefore(b);
  3185. break;
  3186. case CKEDITOR.POSITION_AFTER_END:
  3187. this.setEndAfter(b)
  3188. }
  3189. a(this)
  3190. },
  3191. fixBlock: function (a, b) {
  3192. var c = this.createBookmark(), d = this.document.createElement(b);
  3193. this.collapse(a);
  3194. this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  3195. this.extractContents().appendTo(d);
  3196. d.trim();
  3197. this.insertNode(d);
  3198. var f = d.getBogus();
  3199. f && f.remove();
  3200. d.appendBogus();
  3201. this.moveToBookmark(c);
  3202. return d
  3203. }, splitBlock: function (a, b) {
  3204. var c = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
  3205. d = new CKEDITOR.dom.elementPath(this.endContainer, this.root), f = c.block, g = d.block, m = null;
  3206. if (!c.blockLimit.equals(d.blockLimit)) return null;
  3207. "br" != a && (f || (f = this.fixBlock(!0, a), g = (new CKEDITOR.dom.elementPath(this.endContainer, this.root)).block), g || (g = this.fixBlock(!1, a)));
  3208. c = f && this.checkStartOfBlock();
  3209. d = g && this.checkEndOfBlock();
  3210. this.deleteContents();
  3211. f && f.equals(g) && (d ? (m = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(g, CKEDITOR.POSITION_AFTER_END), g = null) : c ? (m = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START), f = null) : (g = this.splitElement(f,
  3212. b || !1), f.is("ul", "ol") || f.appendBogus()));
  3213. return {previousBlock: f, nextBlock: g, wasStartOfBlock: c, wasEndOfBlock: d, elementPath: m}
  3214. }, splitElement: function (a, b) {
  3215. if (!this.collapsed) return null;
  3216. this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
  3217. var c = this.extractContents(!1, b || !1), d = a.clone(!1, b || !1);
  3218. c.appendTo(d);
  3219. d.insertAfter(a);
  3220. this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  3221. return d
  3222. }, removeEmptyBlocksAtEnd: function () {
  3223. function a(e) {
  3224. return function (a) {
  3225. return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() ||
  3226. e.is("table") && a.is("caption") ? !1 : !0
  3227. }
  3228. }
  3229. var b = CKEDITOR.dom.walker.whitespaces(), c = CKEDITOR.dom.walker.bookmark(!1);
  3230. return function (b) {
  3231. for (var c = this.createBookmark(), d = this[b ? "endPath" : "startPath"](), m = d.block || d.blockLimit, f; m && !m.equals(d.root) && !m.getFirst(a(m));) f = m.getParent(), this[b ? "setEndAt" : "setStartAt"](m, CKEDITOR.POSITION_AFTER_END), m.remove(1), m = f;
  3232. this.moveToBookmark(c)
  3233. }
  3234. }(), startPath: function () {
  3235. return new CKEDITOR.dom.elementPath(this.startContainer, this.root)
  3236. }, endPath: function () {
  3237. return new CKEDITOR.dom.elementPath(this.endContainer,
  3238. this.root)
  3239. }, checkBoundaryOfElement: function (a, b) {
  3240. var d = b == CKEDITOR.START, f = this.clone();
  3241. f.collapse(d);
  3242. f[d ? "setStartAt" : "setEndAt"](a, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
  3243. f = new CKEDITOR.dom.walker(f);
  3244. f.evaluator = c(d);
  3245. return f[d ? "checkBackward" : "checkForward"]()
  3246. }, checkStartOfBlock: function () {
  3247. var a = this.startContainer, c = this.startOffset;
  3248. CKEDITOR.env.ie && c && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.ltrim(a.substring(0, c)), h.test(a) && this.trim(0, 1));
  3249. this.trim();
  3250. a = new CKEDITOR.dom.elementPath(this.startContainer,
  3251. this.root);
  3252. c = this.clone();
  3253. c.collapse(!0);
  3254. c.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START);
  3255. a = new CKEDITOR.dom.walker(c);
  3256. a.evaluator = b();
  3257. return a.checkBackward()
  3258. }, checkEndOfBlock: function () {
  3259. var a = this.endContainer, c = this.endOffset;
  3260. CKEDITOR.env.ie && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.rtrim(a.substring(c)), h.test(a) && this.trim(1, 0));
  3261. this.trim();
  3262. a = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
  3263. c = this.clone();
  3264. c.collapse(!1);
  3265. c.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END);
  3266. a = new CKEDITOR.dom.walker(c);
  3267. a.evaluator = b();
  3268. return a.checkForward()
  3269. }, getPreviousNode: function (a, b, c) {
  3270. var d = this.clone();
  3271. d.collapse(1);
  3272. d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START);
  3273. c = new CKEDITOR.dom.walker(d);
  3274. c.evaluator = a;
  3275. c.guard = b;
  3276. return c.previous()
  3277. }, getNextNode: function (a, b, c) {
  3278. var d = this.clone();
  3279. d.collapse();
  3280. d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
  3281. c = new CKEDITOR.dom.walker(d);
  3282. c.evaluator = a;
  3283. c.guard = b;
  3284. return c.next()
  3285. }, checkReadOnly: function () {
  3286. function a(b, c) {
  3287. for (; b;) {
  3288. if (b.type ==
  3289. CKEDITOR.NODE_ELEMENT) {
  3290. if ("false" == b.getAttribute("contentEditable") && !b.data("cke-editable")) return 0;
  3291. if (b.is("html") || "true" == b.getAttribute("contentEditable") && (b.contains(c) || b.equals(c))) break
  3292. }
  3293. b = b.getParent()
  3294. }
  3295. return 1
  3296. }
  3297. return function () {
  3298. var b = this.startContainer, c = this.endContainer;
  3299. return !(a(b, c) && a(c, b))
  3300. }
  3301. }(), moveToElementEditablePosition: function (a, b) {
  3302. if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) return this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START),
  3303. !0;
  3304. for (var c = 0; a;) {
  3305. if (a.type == CKEDITOR.NODE_TEXT) {
  3306. b && this.endContainer && this.checkEndOfBlock() && h.test(a.getText()) ? this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START) : this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START);
  3307. c = 1;
  3308. break
  3309. }
  3310. if (a.type == CKEDITOR.NODE_ELEMENT) if (a.isEditable()) this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START), c = 1; else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START);
  3311. else if ("false" == a.getAttribute("contenteditable") && a.is(CKEDITOR.dtd.$block)) return this.setStartBefore(a), this.setEndAfter(a), !0;
  3312. var d = a, f = c, g = void 0;
  3313. d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(!1) && (g = d[b ? "getLast" : "getFirst"](q));
  3314. f || g || (g = d[b ? "getPrevious" : "getNext"](q));
  3315. a = g
  3316. }
  3317. return !!c
  3318. }, moveToClosestEditablePosition: function (a, b) {
  3319. var c, d = 0, f, g, m = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
  3320. a ? (c = new CKEDITOR.dom.range(this.root), c.moveToPosition(a, m[b ? 0 : 1])) : c = this.clone();
  3321. if (a &&
  3322. !a.is(CKEDITOR.dtd.$block)) d = 1; else if (f = c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) d = 1, (g = f.type == CKEDITOR.NODE_ELEMENT) && f.is(CKEDITOR.dtd.$block) && "false" == f.getAttribute("contenteditable") ? (c.setStartAt(f, CKEDITOR.POSITION_BEFORE_START), c.setEndAt(f, CKEDITOR.POSITION_AFTER_END)) : !CKEDITOR.env.needsBrFiller && g && f.is(CKEDITOR.dom.walker.validEmptyBlockContainers) ? (c.setEnd(f, 0), c.collapse()) : c.moveToPosition(f, m[b ? 1 : 0]);
  3323. d && this.moveToRange(c);
  3324. return !!d
  3325. }, moveToElementEditStart: function (a) {
  3326. return this.moveToElementEditablePosition(a)
  3327. },
  3328. moveToElementEditEnd: function (a) {
  3329. return this.moveToElementEditablePosition(a, !0)
  3330. }, getEnclosedNode: function () {
  3331. var a = this.clone();
  3332. a.optimize();
  3333. if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null;
  3334. var a = new CKEDITOR.dom.walker(a), b = CKEDITOR.dom.walker.bookmark(!1, !0),
  3335. c = CKEDITOR.dom.walker.whitespaces(!0);
  3336. a.evaluator = function (a) {
  3337. return c(a) && b(a)
  3338. };
  3339. var d = a.next();
  3340. a.reset();
  3341. return d && d.equals(a.previous()) ? d : null
  3342. }, getTouchedStartNode: function () {
  3343. var a = this.startContainer;
  3344. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a
  3345. }, getTouchedEndNode: function () {
  3346. var a = this.endContainer;
  3347. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
  3348. }, getNextEditableNode: f(), getPreviousEditableNode: f(1), _getTableElement: function (a) {
  3349. a = a || {td: 1, th: 1, tr: 1, tbody: 1, thead: 1, tfoot: 1, table: 1};
  3350. var b = this.startContainer, c = this.endContainer, d = b.getAscendant("table", !0),
  3351. f = c.getAscendant("table", !0);
  3352. return d && !this.root.contains(d) ?
  3353. null : CKEDITOR.env.safari && d && c.equals(this.root) ? b.getAscendant(a, !0) : this.getEnclosedNode() ? this.getEnclosedNode().getAscendant(a, !0) : d && f && (d.equals(f) || d.contains(f) || f.contains(d)) ? b.getAscendant(a, !0) : null
  3354. }, scrollIntoView: function () {
  3355. var a = new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", this.document), b,
  3356. c, d, f = this.clone();
  3357. f.optimize();
  3358. (d = f.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = f.startContainer.getText(), b = f.startContainer.split(f.startOffset), a.insertAfter(f.startContainer)) :
  3359. f.insertNode(a);
  3360. a.scrollIntoView();
  3361. d && (f.startContainer.setText(c), b.remove());
  3362. a.remove()
  3363. }, getClientRects: function () {
  3364. function a(b, c) {
  3365. var d = CKEDITOR.tools.array.map(b, function (a) {
  3366. return a
  3367. }), e = new CKEDITOR.dom.range(c.root), f, g, n;
  3368. c.startContainer instanceof CKEDITOR.dom.element && (g = 0 === c.startOffset && c.startContainer.hasAttribute("data-widget"));
  3369. c.endContainer instanceof CKEDITOR.dom.element && (n = (n = c.endOffset === (c.endContainer.getChildCount ? c.endContainer.getChildCount() : c.endContainer.length)) && c.endContainer.hasAttribute("data-widget"));
  3370. g && e.setStart(c.startContainer.getParent(), c.startContainer.getIndex());
  3371. n && e.setEnd(c.endContainer.getParent(), c.endContainer.getIndex() + 1);
  3372. if (g || n) c = e;
  3373. e = c.cloneContents();
  3374. e = CKEDITOR.dom.document.prototype.find.call(e, "[data-cke-widget-id]").toArray();
  3375. if (e = CKEDITOR.tools.array.map(e, function (a) {
  3376. var b = c.root.editor;
  3377. a = a.getAttribute("data-cke-widget-id");
  3378. return b.widgets.instances[a].element
  3379. })) return e = CKEDITOR.tools.array.map(e, function (a) {
  3380. var b;
  3381. b = a.getParent().hasClass("cke_widget_wrapper") ? a.getParent() :
  3382. a;
  3383. f = this.root.getDocument().$.createRange();
  3384. f.setStart(b.getParent().$, b.getIndex());
  3385. f.setEnd(b.getParent().$, b.getIndex() + 1);
  3386. b = f.getClientRects();
  3387. b.widgetRect = a.getClientRect();
  3388. return b
  3389. }, c), CKEDITOR.tools.array.forEach(e, function (a) {
  3390. function b(e) {
  3391. CKEDITOR.tools.array.forEach(d, function (b, f) {
  3392. var n = CKEDITOR.tools.objectCompare(a[e], b);
  3393. n || (n = CKEDITOR.tools.objectCompare(a.widgetRect, b));
  3394. n && (Array.prototype.splice.call(d, f, a.length - e, a.widgetRect), c = !0)
  3395. });
  3396. c || (e < d.length - 1 ? b(e + 1) : d.push(a.widgetRect))
  3397. }
  3398. var c;
  3399. b(0)
  3400. }), d
  3401. }
  3402. function b(a, c, e) {
  3403. var f;
  3404. c.collapsed ? e.startContainer instanceof CKEDITOR.dom.element ? (a = e.checkStartOfBlock(), f = new CKEDITOR.dom.text("​"), a ? e.startContainer.append(f, !0) : 0 === e.startOffset ? f.insertBefore(e.startContainer.getFirst()) : (e = e.startContainer.getChildren().getItem(e.startOffset - 1), f.insertAfter(e)), c.setStart(f.$, 0), c.setEnd(f.$, 0), a = c.getClientRects(), f.remove()) : e.startContainer instanceof CKEDITOR.dom.text && ("" === e.startContainer.getText() ? (e.startContainer.setText("​"),
  3405. a = c.getClientRects(), e.startContainer.setText("")) : a = [d(e.createBookmark())]) : a = [d(e.createBookmark())];
  3406. return a
  3407. }
  3408. function c(a, b, d) {
  3409. a = CKEDITOR.tools.extend({}, a);
  3410. b && (a = CKEDITOR.tools.getAbsoluteRectPosition(d.document.getWindow(), a));
  3411. !a.width && (a.width = a.right - a.left);
  3412. !a.height && (a.height = a.bottom - a.top);
  3413. return a
  3414. }
  3415. function d(a) {
  3416. var b = a.startNode;
  3417. a = a.endNode;
  3418. var c;
  3419. b.setText("​");
  3420. b.removeStyle("display");
  3421. a ? (a.setText("​"), a.removeStyle("display"), c = [b.getClientRect(), a.getClientRect()], a.remove()) : c =
  3422. [b.getClientRect(), b.getClientRect()];
  3423. b.remove();
  3424. return {
  3425. right: Math.max(c[0].right, c[1].right),
  3426. bottom: Math.max(c[0].bottom, c[1].bottom),
  3427. left: Math.min(c[0].left, c[1].left),
  3428. top: Math.min(c[0].top, c[1].top),
  3429. width: Math.abs(c[0].left - c[1].left),
  3430. height: Math.max(c[0].bottom, c[1].bottom) - Math.min(c[0].top, c[1].top)
  3431. }
  3432. }
  3433. return void 0 !== this.document.getSelection ? function (d) {
  3434. var f = this.root.getDocument().$.createRange(), m;
  3435. f.setStart(this.startContainer.$, this.startOffset);
  3436. f.setEnd(this.endContainer.$, this.endOffset);
  3437. m = f.getClientRects();
  3438. m = a(m, this);
  3439. m.length || (m = b(m, f, this));
  3440. return CKEDITOR.tools.array.map(m, function (a) {
  3441. return c(a, d, this)
  3442. }, this)
  3443. } : function (a) {
  3444. return [c(d(this.createBookmark()), a, this)]
  3445. }
  3446. }(), _setStartContainer: function (a) {
  3447. this.startContainer = a
  3448. }, _setEndContainer: function (a) {
  3449. this.endContainer = a
  3450. }, _find: function (a, b) {
  3451. var c = this.getCommonAncestor(), d = this.getBoundaryNodes(), f = [], g, m, h, k;
  3452. if (c && c.find) for (m = c.find(a), g = 0; g < m.count(); g++) if (c = m.getItem(g), b || !c.isReadOnly()) h = c.getPosition(d.startNode) & CKEDITOR.POSITION_FOLLOWING ||
  3453. d.startNode.equals(c), k = c.getPosition(d.endNode) & CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IS_CONTAINED || d.endNode.equals(c), h && k && f.push(c);
  3454. return f
  3455. }
  3456. };
  3457. CKEDITOR.dom.range.mergeRanges = function (a) {
  3458. return CKEDITOR.tools.array.reduce(a, function (a, b) {
  3459. var c = a[a.length - 1], d = !1;
  3460. b = b.clone();
  3461. b.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  3462. if (c) {
  3463. var e = new CKEDITOR.dom.range(b.root), d = new CKEDITOR.dom.walker(e),
  3464. f = CKEDITOR.dom.walker.whitespaces();
  3465. e.setStart(c.endContainer, c.endOffset);
  3466. e.setEnd(b.startContainer, b.startOffset);
  3467. for (e = d.next(); f(e) || b.endContainer.equals(e);) e = d.next();
  3468. d = !e
  3469. }
  3470. d ? c.setEnd(b.endContainer, b.endOffset) : a.push(b);
  3471. return a
  3472. }, [])
  3473. }
  3474. })();
  3475. CKEDITOR.POSITION_AFTER_START = 1;
  3476. CKEDITOR.POSITION_BEFORE_END = 2;
  3477. CKEDITOR.POSITION_BEFORE_START = 3;
  3478. CKEDITOR.POSITION_AFTER_END = 4;
  3479. CKEDITOR.ENLARGE_ELEMENT = 1;
  3480. CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2;
  3481. CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3;
  3482. CKEDITOR.ENLARGE_INLINE = 4;
  3483. CKEDITOR.START = 1;
  3484. CKEDITOR.END = 2;
  3485. CKEDITOR.SHRINK_ELEMENT = 1;
  3486. CKEDITOR.SHRINK_TEXT = 2;
  3487. "use strict";
  3488. (function () {
  3489. function a(a) {
  3490. 1 > arguments.length || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks = 0, this._ || (this._ = {}))
  3491. }
  3492. function d(a) {
  3493. var b = [];
  3494. a.forEach(function (a) {
  3495. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  3496. }, CKEDITOR.NODE_ELEMENT, !0);
  3497. return b
  3498. }
  3499. function b(a, c, f, g) {
  3500. a:{
  3501. null == g && (g = d(f));
  3502. for (var h; h = g.shift();) if (h.getDtd().p) {
  3503. g = {element: h, remaining: g};
  3504. break a
  3505. }
  3506. g = null
  3507. }
  3508. if (!g) return 0;
  3509. if ((h = CKEDITOR.filter.instances[g.element.data("cke-filter")]) && !h.check(c)) return b(a,
  3510. c, f, g.remaining);
  3511. c = new CKEDITOR.dom.range(g.element);
  3512. c.selectNodeContents(g.element);
  3513. c = c.createIterator();
  3514. c.enlargeBr = a.enlargeBr;
  3515. c.enforceRealBlocks = a.enforceRealBlocks;
  3516. c.activeFilter = c.filter = h;
  3517. a._.nestedEditable = {element: g.element, container: f, remaining: g.remaining, iterator: c};
  3518. return 1
  3519. }
  3520. function c(a, b, c) {
  3521. if (!b) return !1;
  3522. a = a.clone();
  3523. a.collapse(!c);
  3524. return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END)
  3525. }
  3526. var f = /^[\r\n\t ]+$/, g = CKEDITOR.dom.walker.bookmark(!1, !0), k = CKEDITOR.dom.walker.whitespaces(!0),
  3527. h = function (a) {
  3528. return g(a) && k(a)
  3529. }, p = {dd: 1, dt: 1, li: 1};
  3530. a.prototype = {
  3531. getNextParagraph: function (a) {
  3532. var d, k, v, x, F;
  3533. a = a || "p";
  3534. if (this._.nestedEditable) {
  3535. if (d = this._.nestedEditable.iterator.getNextParagraph(a)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, d;
  3536. this.activeFilter = this.filter;
  3537. if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, this._.nestedEditable.iterator.getNextParagraph(a);
  3538. this._.nestedEditable =
  3539. null
  3540. }
  3541. if (!this.range.root.getDtd()[a]) return null;
  3542. if (!this._.started) {
  3543. var u = this.range.clone();
  3544. k = u.startPath();
  3545. var m = u.endPath(), M = !u.collapsed && c(u, k.block), w = !u.collapsed && c(u, m.block, 1);
  3546. u.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
  3547. M && u.setStartAt(k.block, CKEDITOR.POSITION_BEFORE_END);
  3548. w && u.setEndAt(m.block, CKEDITOR.POSITION_AFTER_START);
  3549. k = u.endContainer.hasAscendant("pre", !0) || u.startContainer.hasAscendant("pre", !0);
  3550. u.enlarge(this.forceBrBreak && !k || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  3551. u.collapsed || (k = new CKEDITOR.dom.walker(u.clone()), m = CKEDITOR.dom.walker.bookmark(!0, !0), k.evaluator = m, this._.nextNode = k.next(), k = new CKEDITOR.dom.walker(u.clone()), k.evaluator = m, k = k.previous(), this._.lastNode = k.getNextSourceNode(!0, null, u.root), this._.lastNode && this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary() && (m = this.range.clone(), m.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END), m.checkEndOfBlock() &&
  3552. (m = new CKEDITOR.dom.elementPath(m.endContainer, m.root), this._.lastNode = (m.block || m.blockLimit).getNextSourceNode(!0))), this._.lastNode && u.root.contains(this._.lastNode) || (this._.lastNode = this._.docEndMarker = u.document.createText(""), this._.lastNode.insertAfter(k)), u = null);
  3553. this._.started = 1;
  3554. k = u
  3555. }
  3556. m = this._.nextNode;
  3557. u = this._.lastNode;
  3558. for (this._.nextNode = null; m;) {
  3559. var M = 0, w = m.hasAscendant("pre"), H = m.type != CKEDITOR.NODE_ELEMENT, n = 0;
  3560. if (H) m.type == CKEDITOR.NODE_TEXT && f.test(m.getText()) && (H = 0); else {
  3561. var r = m.getName();
  3562. if (CKEDITOR.dtd.$block[r] && "false" == m.getAttribute("contenteditable")) {
  3563. d = m;
  3564. b(this, a, d);
  3565. break
  3566. } else if (m.isBlockBoundary(this.forceBrBreak && !w && {br: 1})) {
  3567. if ("br" == r) H = 1; else if (!k && !m.getChildCount() && "hr" != r) {
  3568. d = m;
  3569. v = m.equals(u);
  3570. break
  3571. }
  3572. k && (k.setEndAt(m, CKEDITOR.POSITION_BEFORE_START), "br" != r && (this._.nextNode = m));
  3573. M = 1
  3574. } else {
  3575. if (m.getFirst()) {
  3576. k || (k = this.range.clone(), k.setStartAt(m, CKEDITOR.POSITION_BEFORE_START));
  3577. m = m.getFirst();
  3578. continue
  3579. }
  3580. H = 1
  3581. }
  3582. }
  3583. H && !k && (k = this.range.clone(), k.setStartAt(m, CKEDITOR.POSITION_BEFORE_START));
  3584. v = (!M || H) && m.equals(u);
  3585. if (k && !M) for (; !m.getNext(h) && !v;) {
  3586. r = m.getParent();
  3587. if (r.isBlockBoundary(this.forceBrBreak && !w && {br: 1})) {
  3588. M = 1;
  3589. H = 0;
  3590. v || r.equals(u);
  3591. k.setEndAt(r, CKEDITOR.POSITION_BEFORE_END);
  3592. break
  3593. }
  3594. m = r;
  3595. H = 1;
  3596. v = m.equals(u);
  3597. n = 1
  3598. }
  3599. H && k.setEndAt(m, CKEDITOR.POSITION_AFTER_END);
  3600. m = this._getNextSourceNode(m, n, u);
  3601. if ((v = !m) || M && k) break
  3602. }
  3603. if (!d) {
  3604. if (!k) return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null;
  3605. d = new CKEDITOR.dom.elementPath(k.startContainer, k.root);
  3606. m = d.blockLimit;
  3607. M = {div: 1, th: 1, td: 1};
  3608. d = d.block;
  3609. !d && m && !this.enforceRealBlocks && M[m.getName()] && k.checkStartOfBlock() && k.checkEndOfBlock() && !m.equals(k.root) ? d = m : !d || this.enforceRealBlocks && d.is(p) ? (d = this.range.document.createElement(a), k.extractContents().appendTo(d), d.trim(), k.insertNode(d), x = F = !0) : "li" != d.getName() ? k.checkStartOfBlock() && k.checkEndOfBlock() || (d = d.clone(!1), k.extractContents().appendTo(d), d.trim(), F = k.splitBlock(), x = !F.wasStartOfBlock, F = !F.wasEndOfBlock, k.insertNode(d)) : v || (this._.nextNode = d.equals(u) ? null : this._getNextSourceNode(k.getBoundaryNodes().endNode,
  3610. 1, u))
  3611. }
  3612. x && (x = d.getPrevious()) && x.type == CKEDITOR.NODE_ELEMENT && ("br" == x.getName() ? x.remove() : x.getLast() && "br" == x.getLast().$.nodeName.toLowerCase() && x.getLast().remove());
  3613. F && (x = d.getLast()) && x.type == CKEDITOR.NODE_ELEMENT && "br" == x.getName() && (!CKEDITOR.env.needsBrFiller || x.getPrevious(g) || x.getNext(g)) && x.remove();
  3614. this._.nextNode || (this._.nextNode = v || d.equals(u) || !u ? null : this._getNextSourceNode(d, 1, u));
  3615. return d
  3616. }, _getNextSourceNode: function (a, b, c) {
  3617. function d(a) {
  3618. return !(a.equals(c) || a.equals(f))
  3619. }
  3620. var f =
  3621. this.range.root;
  3622. for (a = a.getNextSourceNode(b, null, d); !g(a);) a = a.getNextSourceNode(b, null, d);
  3623. return a
  3624. }
  3625. };
  3626. CKEDITOR.dom.range.prototype.createIterator = function () {
  3627. return new a(this)
  3628. }
  3629. })();
  3630. CKEDITOR.command = function (a, d) {
  3631. this.uiItems = [];
  3632. this.exec = function (b) {
  3633. if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return !1;
  3634. this.editorFocus && a.focus();
  3635. return !1 === this.fire("exec") ? !0 : !1 !== d.exec.call(this, a, b)
  3636. };
  3637. this.refresh = function (a, b) {
  3638. if (!this.readOnly && a.readOnly) return !0;
  3639. if (this.context && !b.isContextFor(this.context) || !this.checkAllowed(!0)) return this.disable(), !0;
  3640. this.startDisabled || this.enable();
  3641. this.modes && !this.modes[a.mode] && this.disable();
  3642. return !1 === this.fire("refresh",
  3643. {editor: a, path: b}) ? !0 : d.refresh && !1 !== d.refresh.apply(this, arguments)
  3644. };
  3645. var b;
  3646. this.checkAllowed = function (c) {
  3647. return c || "boolean" != typeof b ? b = a.activeFilter.checkFeature(this) : b
  3648. };
  3649. CKEDITOR.tools.extend(this, d, {
  3650. modes: {wysiwyg: 1},
  3651. editorFocus: 1,
  3652. contextSensitive: !!d.context,
  3653. state: CKEDITOR.TRISTATE_DISABLED
  3654. });
  3655. CKEDITOR.event.call(this)
  3656. };
  3657. CKEDITOR.command.prototype = {
  3658. enable: function () {
  3659. this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(this.preserveState && "undefined" != typeof this.previousState ? this.previousState : CKEDITOR.TRISTATE_OFF)
  3660. }, disable: function () {
  3661. this.setState(CKEDITOR.TRISTATE_DISABLED)
  3662. }, setState: function (a) {
  3663. if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return !1;
  3664. this.previousState = this.state;
  3665. this.state = a;
  3666. this.fire("state");
  3667. return !0
  3668. }, toggleState: function () {
  3669. this.state == CKEDITOR.TRISTATE_OFF ?
  3670. this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF)
  3671. }
  3672. };
  3673. CKEDITOR.event.implementOn(CKEDITOR.command.prototype);
  3674. CKEDITOR.ENTER_P = 1;
  3675. CKEDITOR.ENTER_BR = 2;
  3676. CKEDITOR.ENTER_DIV = 3;
  3677. CKEDITOR.config = {
  3678. customConfig: "config.js",
  3679. autoUpdateElement: !0,
  3680. language: "",
  3681. defaultLanguage: "en",
  3682. contentsLangDirection: "",
  3683. enterMode: CKEDITOR.ENTER_P,
  3684. forceEnterMode: !1,
  3685. shiftEnterMode: CKEDITOR.ENTER_BR,
  3686. docType: "\x3c!DOCTYPE html\x3e",
  3687. bodyId: "",
  3688. bodyClass: "",
  3689. fullPage: !1,
  3690. height: 200,
  3691. contentsCss: CKEDITOR.getUrl("contents.css"),
  3692. extraPlugins: "",
  3693. removePlugins: "",
  3694. protectedSource: [],
  3695. tabIndex: 0,
  3696. width: "",
  3697. baseFloatZIndex: 1E4,
  3698. blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85]
  3699. };
  3700. (function () {
  3701. function a(a, b, c, d, e) {
  3702. var f, n;
  3703. a = [];
  3704. for (f in b) {
  3705. n = b[f];
  3706. n = "boolean" == typeof n ? {} : "function" == typeof n ? {match: n} : D(n);
  3707. "$" != f.charAt(0) && (n.elements = f);
  3708. c && (n.featureName = c.toLowerCase());
  3709. var l = n;
  3710. l.elements = k(l.elements, /\s+/) || null;
  3711. l.propertiesOnly = l.propertiesOnly || !0 === l.elements;
  3712. var m = /\s*,\s*/, g = void 0;
  3713. for (g in P) {
  3714. l[g] = k(l[g], m) || null;
  3715. var r = l, t = O[g], z = k(l[O[g]], m), B = l[g], h = [], A = !0, C = void 0;
  3716. z ? A = !1 : z = {};
  3717. for (C in B) "!" == C.charAt(0) && (C = C.slice(1), h.push(C), z[C] = !0, A = !1);
  3718. for (; C = h.pop();) B[C] =
  3719. B["!" + C], delete B["!" + C];
  3720. r[t] = (A ? !1 : z) || null
  3721. }
  3722. l.match = l.match || null;
  3723. d.push(n);
  3724. a.push(n)
  3725. }
  3726. b = e.elements;
  3727. e = e.generic;
  3728. var I;
  3729. c = 0;
  3730. for (d = a.length; c < d; ++c) {
  3731. f = D(a[c]);
  3732. n = !0 === f.classes || !0 === f.styles || !0 === f.attributes;
  3733. l = f;
  3734. g = t = m = void 0;
  3735. for (m in P) l[m] = M(l[m]);
  3736. r = !0;
  3737. for (g in O) {
  3738. m = O[g];
  3739. t = l[m];
  3740. z = [];
  3741. B = void 0;
  3742. for (B in t) -1 < B.indexOf("*") ? z.push(new RegExp("^" + B.replace(/\*/g, ".*") + "$")) : z.push(B);
  3743. t = z;
  3744. t.length && (l[m] = t, r = !1)
  3745. }
  3746. l.nothingRequired = r;
  3747. l.noProperties = !(l.attributes || l.classes || l.styles);
  3748. if (!0 === f.elements ||
  3749. null === f.elements) e[n ? "unshift" : "push"](f); else for (I in l = f.elements, delete f.elements, l) if (b[I]) b[I][n ? "unshift" : "push"](f); else b[I] = [f]
  3750. }
  3751. }
  3752. function d(a, c, d, e) {
  3753. if (!a.match || a.match(c)) if (e || h(a, c)) if (a.propertiesOnly || (d.valid = !0), d.allAttributes || (d.allAttributes = b(a.attributes, c.attributes, d.validAttributes)), d.allStyles || (d.allStyles = b(a.styles, c.styles, d.validStyles)), !d.allClasses) {
  3754. a = a.classes;
  3755. c = c.classes;
  3756. e = d.validClasses;
  3757. if (a) if (!0 === a) a = !0; else {
  3758. for (var f = 0, n = c.length, l; f < n; ++f) l = c[f], e[l] ||
  3759. (e[l] = a(l));
  3760. a = !1
  3761. } else a = !1;
  3762. d.allClasses = a
  3763. }
  3764. }
  3765. function b(a, b, c) {
  3766. if (!a) return !1;
  3767. if (!0 === a) return !0;
  3768. for (var d in b) c[d] || (c[d] = a(d));
  3769. return !1
  3770. }
  3771. function c(a, b, c) {
  3772. if (!a.match || a.match(b)) {
  3773. if (a.noProperties) return !1;
  3774. c.hadInvalidAttribute = f(a.attributes, b.attributes) || c.hadInvalidAttribute;
  3775. c.hadInvalidStyle = f(a.styles, b.styles) || c.hadInvalidStyle;
  3776. a = a.classes;
  3777. b = b.classes;
  3778. if (a) {
  3779. for (var d = !1, e = !0 === a, l = b.length; l--;) if (e || a(b[l])) b.splice(l, 1), d = !0;
  3780. a = d
  3781. } else a = !1;
  3782. c.hadInvalidClass = a || c.hadInvalidClass
  3783. }
  3784. }
  3785. function f(a,
  3786. b) {
  3787. if (!a) return !1;
  3788. var c = !1, d = !0 === a, e;
  3789. for (e in b) if (d || a(e)) delete b[e], c = !0;
  3790. return c
  3791. }
  3792. function g(a, b, c) {
  3793. if (a.disabled || a.customConfig && !c || !b) return !1;
  3794. a._.cachedChecks = {};
  3795. return !0
  3796. }
  3797. function k(a, b) {
  3798. if (!a) return !1;
  3799. if (!0 === a) return a;
  3800. if ("string" == typeof a) return a = z(a), "*" == a ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b));
  3801. if (CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : !1;
  3802. var c = {}, d = 0, e;
  3803. for (e in a) c[e] = a[e], d++;
  3804. return d ? c : !1
  3805. }
  3806. function h(a, b) {
  3807. if (a.nothingRequired) return !0;
  3808. var c, d, e, f;
  3809. if (e = a.requiredClasses) for (f = b.classes, c = 0; c < e.length; ++c) if (d = e[c], "string" == typeof d) {
  3810. if (-1 == CKEDITOR.tools.indexOf(f, d)) return !1
  3811. } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(f, d)) return !1;
  3812. return p(b.styles, a.requiredStyles) && p(b.attributes, a.requiredAttributes)
  3813. }
  3814. function p(a, b) {
  3815. if (!b) return !0;
  3816. for (var c = 0, d; c < b.length; ++c) if (d = b[c], "string" == typeof d) {
  3817. if (!(d in a)) return !1
  3818. } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) return !1;
  3819. return !0
  3820. }
  3821. function q(a) {
  3822. if (!a) return {};
  3823. a = a.split(/\s*,\s*/).sort();
  3824. for (var b = {}; a.length;) b[a.shift()] = "cke-test";
  3825. return b
  3826. }
  3827. function e(a) {
  3828. var b, c, d, e, f = {}, n = 1;
  3829. for (a = z(a); b = a.match(l);) (c = b[2]) ? (d = y(c, "styles"), e = y(c, "attrs"), c = y(c, "classes")) : d = e = c = null, f["$" + n++] = {
  3830. elements: b[1],
  3831. classes: c,
  3832. styles: d,
  3833. attributes: e
  3834. }, a = a.slice(b[0].length);
  3835. return f
  3836. }
  3837. function y(a, b) {
  3838. var c = a.match(K[b]);
  3839. return c ? z(c[1]) : null
  3840. }
  3841. function v(a) {
  3842. var b = a.styleBackup = a.attributes.style, c = a.classBackup = a.attributes["class"];
  3843. a.styles || (a.styles = CKEDITOR.tools.parseCssText(b ||
  3844. "", 1));
  3845. a.classes || (a.classes = c ? c.split(/\s+/) : [])
  3846. }
  3847. function x(a, b, e, f) {
  3848. var l = 0, n;
  3849. f.toHtml && (b.name = b.name.replace(B, "$1"));
  3850. if (f.doCallbacks && a.elementCallbacks) {
  3851. a:{
  3852. n = a.elementCallbacks;
  3853. for (var g = 0, t = n.length, D; g < t; ++g) if (D = n[g](b)) {
  3854. n = D;
  3855. break a
  3856. }
  3857. n = void 0
  3858. }
  3859. if (n) return n
  3860. }
  3861. if (f.doTransform && (n = a._.transformations[b.name])) {
  3862. v(b);
  3863. for (g = 0; g < n.length; ++g) r(a, b, n[g]);
  3864. u(b)
  3865. }
  3866. if (f.doFilter) {
  3867. a:{
  3868. g = b.name;
  3869. t = a._;
  3870. a = t.allowedRules.elements[g];
  3871. n = t.allowedRules.generic;
  3872. g = t.disallowedRules.elements[g];
  3873. t = t.disallowedRules.generic;
  3874. D = f.skipRequired;
  3875. var z = {
  3876. valid: !1,
  3877. validAttributes: {},
  3878. validClasses: {},
  3879. validStyles: {},
  3880. allAttributes: !1,
  3881. allClasses: !1,
  3882. allStyles: !1,
  3883. hadInvalidAttribute: !1,
  3884. hadInvalidClass: !1,
  3885. hadInvalidStyle: !1
  3886. }, k, C;
  3887. if (a || n) {
  3888. v(b);
  3889. if (g) for (k = 0, C = g.length; k < C; ++k) if (!1 === c(g[k], b, z)) {
  3890. a = null;
  3891. break a
  3892. }
  3893. if (t) for (k = 0, C = t.length; k < C; ++k) c(t[k], b, z);
  3894. if (a) for (k = 0, C = a.length; k < C; ++k) d(a[k], b, z, D);
  3895. if (n) for (k = 0, C = n.length; k < C; ++k) d(n[k], b, z, D);
  3896. a = z
  3897. } else a = null
  3898. }
  3899. if (!a || !a.valid) return e.push(b), 1;
  3900. C = a.validAttributes;
  3901. var h = a.validStyles;
  3902. n = a.validClasses;
  3903. var g = b.attributes, I = b.styles, t = b.classes;
  3904. D = b.classBackup;
  3905. var L = b.styleBackup, K, E, O = [], z = [], J = /^data-cke-/;
  3906. k = !1;
  3907. delete g.style;
  3908. delete g["class"];
  3909. delete b.classBackup;
  3910. delete b.styleBackup;
  3911. if (!a.allAttributes) for (K in g) C[K] || (J.test(K) ? K == (E = K.replace(/^data-cke-saved-/, "")) || C[E] || (delete g[K], k = !0) : (delete g[K], k = !0));
  3912. if (!a.allStyles || a.hadInvalidStyle) {
  3913. for (K in I) a.allStyles || h[K] ? O.push(K + ":" + I[K]) : k = !0;
  3914. O.length && (g.style = O.sort().join("; "))
  3915. } else L && (g.style = L);
  3916. if (!a.allClasses ||
  3917. a.hadInvalidClass) {
  3918. for (K = 0; K < t.length; ++K) (a.allClasses || n[t[K]]) && z.push(t[K]);
  3919. z.length && (g["class"] = z.sort().join(" "));
  3920. D && z.length < D.split(/\s+/).length && (k = !0)
  3921. } else D && (g["class"] = D);
  3922. k && (l = 1);
  3923. if (!f.skipFinalValidation && !m(b)) return e.push(b), 1
  3924. }
  3925. f.toHtml && (b.name = b.name.replace(A, "cke:$1"));
  3926. return l
  3927. }
  3928. function F(a) {
  3929. var b = [], c;
  3930. for (c in a) -1 < c.indexOf("*") && b.push(c.replace(/\*/g, ".*"));
  3931. return b.length ? new RegExp("^(?:" + b.join("|") + ")$") : null
  3932. }
  3933. function u(a) {
  3934. var b = a.attributes, c;
  3935. delete b.style;
  3936. delete b["class"];
  3937. if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) b.style = c;
  3938. a.classes.length && (b["class"] = a.classes.sort().join(" "))
  3939. }
  3940. function m(a) {
  3941. switch (a.name) {
  3942. case "a":
  3943. if (!(a.children.length || a.attributes.name || a.attributes.id)) return !1;
  3944. break;
  3945. case "img":
  3946. if (!a.attributes.src) return !1
  3947. }
  3948. return !0
  3949. }
  3950. function M(a) {
  3951. if (!a) return !1;
  3952. if (!0 === a) return !0;
  3953. var b = F(a);
  3954. return function (c) {
  3955. return c in a || b && c.match(b)
  3956. }
  3957. }
  3958. function w() {
  3959. return new CKEDITOR.htmlParser.element("br")
  3960. }
  3961. function H(a) {
  3962. return a.type == CKEDITOR.NODE_ELEMENT && ("br" ==
  3963. a.name || t.$block[a.name])
  3964. }
  3965. function n(a, b, c) {
  3966. var d = a.name;
  3967. if (t.$empty[d] || !a.children.length) "hr" == d && "br" == b ? a.replaceWith(w()) : (a.parent && c.push({
  3968. check: "it",
  3969. el: a.parent
  3970. }), a.remove()); else if (t.$block[d] || "tr" == d) if ("br" == b) a.previous && !H(a.previous) && (b = w(), b.insertBefore(a)), a.next && !H(a.next) && (b = w(), b.insertAfter(a)), a.replaceWithChildren(); else {
  3971. var d = a.children, e;
  3972. b:{
  3973. e = t[b];
  3974. for (var f = 0, n = d.length, l; f < n; ++f) if (l = d[f], l.type == CKEDITOR.NODE_ELEMENT && !e[l.name]) {
  3975. e = !1;
  3976. break b
  3977. }
  3978. e = !0
  3979. }
  3980. if (e) a.name = b, a.attributes =
  3981. {}, c.push({check: "parent-down", el: a}); else {
  3982. e = a.parent;
  3983. for (var f = e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || "body" == e.name, g, m, n = d.length; 0 < n;) l = d[--n], f && (l.type == CKEDITOR.NODE_TEXT || l.type == CKEDITOR.NODE_ELEMENT && t.$inline[l.name]) ? (g || (g = new CKEDITOR.htmlParser.element(b), g.insertAfter(a), c.push({
  3984. check: "parent-down",
  3985. el: g
  3986. })), g.add(l, 0)) : (g = null, m = t[e.name] || t.span, l.insertAfter(a), e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || l.type != CKEDITOR.NODE_ELEMENT || m[l.name] || c.push({
  3987. check: "el-up",
  3988. el: l
  3989. }));
  3990. a.remove()
  3991. }
  3992. } else d in
  3993. {style: 1, script: 1} ? a.remove() : (a.parent && c.push({
  3994. check: "it",
  3995. el: a.parent
  3996. }), a.replaceWithChildren())
  3997. }
  3998. function r(a, b, c) {
  3999. var d, e;
  4000. for (d = 0; d < c.length; ++d) if (e = c[d], !(e.check && !a.check(e.check, !1) || e.left && !e.left(b))) {
  4001. e.right(b, J);
  4002. break
  4003. }
  4004. }
  4005. function C(a, b) {
  4006. var c = b.getDefinition(), d = c.attributes, e = c.styles, f, n, l, g;
  4007. if (a.name != c.element) return !1;
  4008. for (f in d) if ("class" == f) for (c = d[f].split(/\s+/), l = a.classes.join("|"); g = c.pop();) {
  4009. if (-1 == l.indexOf(g)) return !1
  4010. } else if (a.attributes[f] != d[f]) return !1;
  4011. for (n in e) if (a.styles[n] !=
  4012. e[n]) return !1;
  4013. return !0
  4014. }
  4015. function L(a, b) {
  4016. var c, d;
  4017. "string" == typeof a ? c = a : a instanceof CKEDITOR.style ? d = a : (c = a[0], d = a[1]);
  4018. return [{
  4019. element: c, left: d, right: function (a, c) {
  4020. c.transform(a, b)
  4021. }
  4022. }]
  4023. }
  4024. function E(a) {
  4025. return function (b) {
  4026. return C(b, a)
  4027. }
  4028. }
  4029. function N(a) {
  4030. return function (b, c) {
  4031. c[a](b)
  4032. }
  4033. }
  4034. var t = CKEDITOR.dtd, D = CKEDITOR.tools.copy, z = CKEDITOR.tools.trim, I = ["", "p", "br", "div"];
  4035. CKEDITOR.FILTER_SKIP_TREE = 2;
  4036. CKEDITOR.filter = function (a, b) {
  4037. this.allowedContent = [];
  4038. this.disallowedContent = [];
  4039. this.elementCallbacks = null;
  4040. this.disabled =
  4041. !1;
  4042. this.editor = null;
  4043. this.id = CKEDITOR.tools.getNextNumber();
  4044. this._ = {
  4045. allowedRules: {elements: {}, generic: []},
  4046. disallowedRules: {elements: {}, generic: []},
  4047. transformations: {},
  4048. cachedTests: {},
  4049. cachedChecks: {}
  4050. };
  4051. CKEDITOR.filter.instances[this.id] = this;
  4052. var c = this.editor = a instanceof CKEDITOR.editor ? a : null;
  4053. if (c && !b) {
  4054. this.customConfig = !0;
  4055. var d = c.config.allowedContent;
  4056. !0 === d ? this.disabled = !0 : (d || (this.customConfig = !1), this.allow(d, "config", 1), this.allow(c.config.extraAllowedContent, "extra", 1), this.allow(I[c.enterMode] +
  4057. " " + I[c.shiftEnterMode], "default", 1), this.disallow(c.config.disallowedContent))
  4058. } else this.customConfig = !1, this.allow(b || a, "default", 1)
  4059. };
  4060. CKEDITOR.filter.instances = {};
  4061. CKEDITOR.filter.prototype = {
  4062. allow: function (b, c, d) {
  4063. if (!g(this, b, d)) return !1;
  4064. var f, n;
  4065. if ("string" == typeof b) b = e(b); else if (b instanceof CKEDITOR.style) {
  4066. if (b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, d);
  4067. f = b.getDefinition();
  4068. b = {};
  4069. d = f.attributes;
  4070. b[f.element] = f = {
  4071. styles: f.styles,
  4072. requiredStyles: f.styles && CKEDITOR.tools.objectKeys(f.styles)
  4073. };
  4074. d && (d = D(d), f.classes = d["class"] ? d["class"].split(/\s+/) : null, f.requiredClasses = f.classes, delete d["class"], f.attributes = d, f.requiredAttributes = d && CKEDITOR.tools.objectKeys(d))
  4075. } else if (CKEDITOR.tools.isArray(b)) {
  4076. for (f = 0; f < b.length; ++f) n = this.allow(b[f], c, d);
  4077. return n
  4078. }
  4079. a(this, b, c, this.allowedContent, this._.allowedRules);
  4080. return !0
  4081. }, applyTo: function (a, b, c, d) {
  4082. if (this.disabled) return !1;
  4083. var e = this, f = [], l = this.editor && this.editor.config.protectedSource, g, r = !1,
  4084. D = {doFilter: !c, doTransform: !0, doCallbacks: !0, toHtml: b};
  4085. a.forEach(function (a) {
  4086. if (a.type == CKEDITOR.NODE_ELEMENT) {
  4087. if ("off" == a.attributes["data-cke-filter"]) return !1;
  4088. if (!b || "span" != a.name || !~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-")) if (g = x(e, a, f, D), g & 1) r = !0; else if (g & 2) return !1
  4089. } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
  4090. var c;
  4091. a:{
  4092. var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));
  4093. c = [];
  4094. var n, G, m;
  4095. if (l) for (G = 0; G < l.length; ++G) if ((m = d.match(l[G])) && m[0].length == d.length) {
  4096. c = !0;
  4097. break a
  4098. }
  4099. d = CKEDITOR.htmlParser.fragment.fromHtml(d);
  4100. 1 == d.children.length && (n = d.children[0]).type == CKEDITOR.NODE_ELEMENT && x(e, n, c, D);
  4101. c = !c.length
  4102. }
  4103. c || f.push(a)
  4104. }
  4105. }, null, !0);
  4106. f.length && (r = !0);
  4107. var z;
  4108. a = [];
  4109. d = I[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)];
  4110. for (var k; c = f.pop();) c.type == CKEDITOR.NODE_ELEMENT ? n(c, d, a) : c.remove();
  4111. for (; z = a.pop();) if (c = z.el, c.parent) switch (k = t[c.parent.name] || t.span, z.check) {
  4112. case "it":
  4113. t.$removeEmpty[c.name] && !c.children.length ? n(c, d, a) : m(c) || n(c, d, a);
  4114. break;
  4115. case "el-up":
  4116. c.parent.type ==
  4117. CKEDITOR.NODE_DOCUMENT_FRAGMENT || k[c.name] || n(c, d, a);
  4118. break;
  4119. case "parent-down":
  4120. c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || k[c.name] || n(c.parent, d, a)
  4121. }
  4122. return r
  4123. }, checkFeature: function (a) {
  4124. if (this.disabled || !a) return !0;
  4125. a.toFeature && (a = a.toFeature(this.editor));
  4126. return !a.requiredContent || this.check(a.requiredContent)
  4127. }, disable: function () {
  4128. this.disabled = !0
  4129. }, disallow: function (b) {
  4130. if (!g(this, b, !0)) return !1;
  4131. "string" == typeof b && (b = e(b));
  4132. a(this, b, null, this.disallowedContent, this._.disallowedRules);
  4133. return !0
  4134. },
  4135. addContentForms: function (a) {
  4136. if (!this.disabled && a) {
  4137. var b, c, d = [], e;
  4138. for (b = 0; b < a.length && !e; ++b) c = a[b], ("string" == typeof c || c instanceof CKEDITOR.style) && this.check(c) && (e = c);
  4139. if (e) {
  4140. for (b = 0; b < a.length; ++b) d.push(L(a[b], e));
  4141. this.addTransformations(d)
  4142. }
  4143. }
  4144. }, addElementCallback: function (a) {
  4145. this.elementCallbacks || (this.elementCallbacks = []);
  4146. this.elementCallbacks.push(a)
  4147. }, addFeature: function (a) {
  4148. if (this.disabled || !a) return !0;
  4149. a.toFeature && (a = a.toFeature(this.editor));
  4150. this.allow(a.allowedContent, a.name);
  4151. this.addTransformations(a.contentTransformations);
  4152. this.addContentForms(a.contentForms);
  4153. return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : !0
  4154. }, addTransformations: function (a) {
  4155. var b, c;
  4156. if (!this.disabled && a) {
  4157. var d = this._.transformations, e;
  4158. for (e = 0; e < a.length; ++e) {
  4159. b = a[e];
  4160. var f = void 0, n = void 0, l = void 0, g = void 0, m = void 0, t = void 0;
  4161. c = [];
  4162. for (n = 0; n < b.length; ++n) l = b[n], "string" == typeof l ? (l = l.split(/\s*:\s*/), g = l[0], m = null, t = l[1]) : (g = l.check, m = l.left, t = l.right), f || (f = l, f = f.element ? f.element : g ? g.match(/^([a-z0-9]+)/i)[0] :
  4163. f.left.getDefinition().element), m instanceof CKEDITOR.style && (m = E(m)), c.push({
  4164. check: g == f ? null : g,
  4165. left: m,
  4166. right: "string" == typeof t ? N(t) : t
  4167. });
  4168. b = f;
  4169. d[b] || (d[b] = []);
  4170. d[b].push(c)
  4171. }
  4172. }
  4173. }, check: function (a, b, c) {
  4174. if (this.disabled) return !0;
  4175. if (CKEDITOR.tools.isArray(a)) {
  4176. for (var d = a.length; d--;) if (this.check(a[d], b, c)) return !0;
  4177. return !1
  4178. }
  4179. var f, n;
  4180. if ("string" == typeof a) {
  4181. n = a + "\x3c" + (!1 === b ? "0" : "1") + (c ? "1" : "0") + "\x3e";
  4182. if (n in this._.cachedChecks) return this._.cachedChecks[n];
  4183. f = e(a).$1;
  4184. var l = f.styles, d = f.classes;
  4185. f.name = f.elements;
  4186. f.classes = d = d ? d.split(/\s*,\s*/) : [];
  4187. f.styles = q(l);
  4188. f.attributes = q(f.attributes);
  4189. f.children = [];
  4190. d.length && (f.attributes["class"] = d.join(" "));
  4191. l && (f.attributes.style = CKEDITOR.tools.writeCssText(f.styles))
  4192. } else f = a.getDefinition(), l = f.styles, d = f.attributes || {}, l && !CKEDITOR.tools.isEmpty(l) ? (l = D(l), d.style = CKEDITOR.tools.writeCssText(l, !0)) : l = {}, f = {
  4193. name: f.element,
  4194. attributes: d,
  4195. classes: d["class"] ? d["class"].split(/\s+/) : [],
  4196. styles: l,
  4197. children: []
  4198. };
  4199. var l = CKEDITOR.tools.clone(f), g = [], m;
  4200. if (!1 !== b && (m = this._.transformations[f.name])) {
  4201. for (d =
  4202. 0; d < m.length; ++d) r(this, f, m[d]);
  4203. u(f)
  4204. }
  4205. x(this, l, g, {doFilter: !0, doTransform: !1 !== b, skipRequired: !c, skipFinalValidation: !c});
  4206. 0 < g.length ? c = !1 : ((b = f.attributes["class"]) && (f.attributes["class"] = f.attributes["class"].split(" ").sort().join(" ")), c = CKEDITOR.tools.objectCompare(f.attributes, l.attributes, !0), b && (f.attributes["class"] = b));
  4207. "string" == typeof a && (this._.cachedChecks[n] = c);
  4208. return c
  4209. }, getAllowedEnterMode: function () {
  4210. var a = ["p", "div", "br"], b = {p: CKEDITOR.ENTER_P, div: CKEDITOR.ENTER_DIV, br: CKEDITOR.ENTER_BR};
  4211. return function (c, d) {
  4212. var f = a.slice(), e;
  4213. if (this.check(I[c])) return c;
  4214. for (d || (f = f.reverse()); e = f.pop();) if (this.check(e)) return b[e];
  4215. return CKEDITOR.ENTER_BR
  4216. }
  4217. }(), clone: function () {
  4218. var a = new CKEDITOR.filter, b = CKEDITOR.tools.clone;
  4219. a.allowedContent = b(this.allowedContent);
  4220. a._.allowedRules = b(this._.allowedRules);
  4221. a.disallowedContent = b(this.disallowedContent);
  4222. a._.disallowedRules = b(this._.disallowedRules);
  4223. a._.transformations = b(this._.transformations);
  4224. a.disabled = this.disabled;
  4225. a.editor = this.editor;
  4226. return a
  4227. }, destroy: function () {
  4228. delete CKEDITOR.filter.instances[this.id];
  4229. delete this._;
  4230. delete this.allowedContent;
  4231. delete this.disallowedContent
  4232. }
  4233. };
  4234. var P = {styles: 1, attributes: 1, classes: 1},
  4235. O = {styles: "requiredStyles", attributes: "requiredAttributes", classes: "requiredClasses"},
  4236. l = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
  4237. K = {styles: /{([^}]+)}/, attrs: /\[([^\]]+)\]/, classes: /\(([^\)]+)\)/}, B = /^cke:(object|embed|param)$/,
  4238. A = /^(object|embed|param)$/, J;
  4239. J = CKEDITOR.filter.transformationsTools = {
  4240. sizeToStyle: function (a) {
  4241. this.lengthToStyle(a,
  4242. "width");
  4243. this.lengthToStyle(a, "height")
  4244. }, sizeToAttribute: function (a) {
  4245. this.lengthToAttribute(a, "width");
  4246. this.lengthToAttribute(a, "height")
  4247. }, lengthToStyle: function (a, b, c) {
  4248. c = c || b;
  4249. if (!(c in a.styles)) {
  4250. var d = a.attributes[b];
  4251. d && (/^\d+$/.test(d) && (d += "px"), a.styles[c] = d)
  4252. }
  4253. delete a.attributes[b]
  4254. }, lengthToAttribute: function (a, b, c) {
  4255. c = c || b;
  4256. if (!(c in a.attributes)) {
  4257. var d = a.styles[b], f = d && d.match(/^(\d+)(?:\.\d*)?px$/);
  4258. f ? a.attributes[c] = f[1] : "cke-test" == d && (a.attributes[c] = "cke-test")
  4259. }
  4260. delete a.styles[b]
  4261. }, alignmentToStyle: function (a) {
  4262. if (!("float" in
  4263. a.styles)) {
  4264. var b = a.attributes.align;
  4265. if ("left" == b || "right" == b) a.styles["float"] = b
  4266. }
  4267. delete a.attributes.align
  4268. }, alignmentToAttribute: function (a) {
  4269. if (!("align" in a.attributes)) {
  4270. var b = a.styles["float"];
  4271. if ("left" == b || "right" == b) a.attributes.align = b
  4272. }
  4273. delete a.styles["float"]
  4274. }, splitBorderShorthand: function (a) {
  4275. if (a.styles.border) {
  4276. var b = CKEDITOR.tools.style.parse.border(a.styles.border);
  4277. b.color && (a.styles["border-color"] = b.color);
  4278. b.style && (a.styles["border-style"] = b.style);
  4279. b.width && (a.styles["border-width"] = b.width);
  4280. delete a.styles.border
  4281. }
  4282. }, listTypeToStyle: function (a) {
  4283. if (a.attributes.type) switch (a.attributes.type) {
  4284. case "a":
  4285. a.styles["list-style-type"] = "lower-alpha";
  4286. break;
  4287. case "A":
  4288. a.styles["list-style-type"] = "upper-alpha";
  4289. break;
  4290. case "i":
  4291. a.styles["list-style-type"] = "lower-roman";
  4292. break;
  4293. case "I":
  4294. a.styles["list-style-type"] = "upper-roman";
  4295. break;
  4296. case "1":
  4297. a.styles["list-style-type"] = "decimal";
  4298. break;
  4299. default:
  4300. a.styles["list-style-type"] = a.attributes.type
  4301. }
  4302. }, splitMarginShorthand: function (a) {
  4303. function b(d) {
  4304. a.styles["margin-top"] =
  4305. c[d[0]];
  4306. a.styles["margin-right"] = c[d[1]];
  4307. a.styles["margin-bottom"] = c[d[2]];
  4308. a.styles["margin-left"] = c[d[3]]
  4309. }
  4310. if (a.styles.margin) {
  4311. var c = a.styles.margin.match(/(\-?[\.\d]+\w+)/g) || ["0px"];
  4312. switch (c.length) {
  4313. case 1:
  4314. b([0, 0, 0, 0]);
  4315. break;
  4316. case 2:
  4317. b([0, 1, 0, 1]);
  4318. break;
  4319. case 3:
  4320. b([0, 1, 2, 1]);
  4321. break;
  4322. case 4:
  4323. b([0, 1, 2, 3])
  4324. }
  4325. delete a.styles.margin
  4326. }
  4327. }, matchesStyle: C, transform: function (a, b) {
  4328. if ("string" == typeof b) a.name = b; else {
  4329. var c = b.getDefinition(), d = c.styles, f = c.attributes, e, l, n, g;
  4330. a.name = c.element;
  4331. for (e in f) if ("class" == e) for (c =
  4332. a.classes.join("|"), n = f[e].split(/\s+/); g = n.pop();) -1 == c.indexOf(g) && a.classes.push(g); else a.attributes[e] = f[e];
  4333. for (l in d) a.styles[l] = d[l]
  4334. }
  4335. }
  4336. }
  4337. })();
  4338. (function () {
  4339. CKEDITOR.focusManager = function (a) {
  4340. if (a.focusManager) return a.focusManager;
  4341. this.hasFocus = !1;
  4342. this.currentActive = null;
  4343. this._ = {editor: a};
  4344. return this
  4345. };
  4346. CKEDITOR.focusManager._ = {blurDelay: 200};
  4347. CKEDITOR.focusManager.prototype = {
  4348. focus: function (a) {
  4349. this._.timer && clearTimeout(this._.timer);
  4350. a && (this.currentActive = a);
  4351. this.hasFocus || this._.locked || ((a = CKEDITOR.currentInstance) && a.focusManager.blur(1), this.hasFocus = !0, (a = this._.editor.container) && a.addClass("cke_focus"), this._.editor.fire("focus"))
  4352. }, lock: function () {
  4353. this._.locked =
  4354. 1
  4355. }, unlock: function () {
  4356. delete this._.locked
  4357. }, blur: function (a) {
  4358. function d() {
  4359. if (this.hasFocus) {
  4360. this.hasFocus = !1;
  4361. var a = this._.editor.container;
  4362. a && a.removeClass("cke_focus");
  4363. this._.editor.fire("blur")
  4364. }
  4365. }
  4366. if (!this._.locked) {
  4367. this._.timer && clearTimeout(this._.timer);
  4368. var b = CKEDITOR.focusManager._.blurDelay;
  4369. a || !b ? d.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function () {
  4370. delete this._.timer;
  4371. d.call(this)
  4372. }, b, this)
  4373. }
  4374. }, add: function (a, d) {
  4375. var b = a.getCustomData("focusmanager");
  4376. if (!b || b != this) {
  4377. b && b.remove(a);
  4378. var b =
  4379. "focus", c = "blur";
  4380. d && (CKEDITOR.env.ie ? (b = "focusin", c = "focusout") : CKEDITOR.event.useCapture = 1);
  4381. var f = {
  4382. blur: function () {
  4383. a.equals(this.currentActive) && this.blur()
  4384. }, focus: function () {
  4385. this.focus(a)
  4386. }
  4387. };
  4388. a.on(b, f.focus, this);
  4389. a.on(c, f.blur, this);
  4390. d && (CKEDITOR.event.useCapture = 0);
  4391. a.setCustomData("focusmanager", this);
  4392. a.setCustomData("focusmanager_handlers", f)
  4393. }
  4394. }, remove: function (a) {
  4395. a.removeCustomData("focusmanager");
  4396. var d = a.removeCustomData("focusmanager_handlers");
  4397. a.removeListener("blur", d.blur);
  4398. a.removeListener("focus",
  4399. d.focus)
  4400. }
  4401. }
  4402. })();
  4403. CKEDITOR.keystrokeHandler = function (a) {
  4404. if (a.keystrokeHandler) return a.keystrokeHandler;
  4405. this.keystrokes = {};
  4406. this.blockedKeystrokes = {};
  4407. this._ = {editor: a};
  4408. return this
  4409. };
  4410. (function () {
  4411. var a, d = function (b) {
  4412. b = b.data;
  4413. var d = b.getKeystroke(), g = this.keystrokes[d], k = this._.editor;
  4414. a = !1 === k.fire("key", {keyCode: d, domEvent: b});
  4415. a || (g && (a = !1 !== k.execCommand(g, {from: "keystrokeHandler"})), a || (a = !!this.blockedKeystrokes[d]));
  4416. a && b.preventDefault(!0);
  4417. return !a
  4418. }, b = function (b) {
  4419. a && (a = !1, b.data.preventDefault(!0))
  4420. };
  4421. CKEDITOR.keystrokeHandler.prototype = {
  4422. attach: function (a) {
  4423. a.on("keydown", d, this);
  4424. if (CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this)
  4425. }
  4426. }
  4427. })();
  4428. (function () {
  4429. CKEDITOR.lang = {
  4430. languages: {
  4431. af: 1,
  4432. ar: 1,
  4433. az: 1,
  4434. bg: 1,
  4435. bn: 1,
  4436. bs: 1,
  4437. ca: 1,
  4438. cs: 1,
  4439. cy: 1,
  4440. da: 1,
  4441. de: 1,
  4442. "de-ch": 1,
  4443. el: 1,
  4444. "en-au": 1,
  4445. "en-ca": 1,
  4446. "en-gb": 1,
  4447. en: 1,
  4448. eo: 1,
  4449. es: 1,
  4450. "es-mx": 1,
  4451. et: 1,
  4452. eu: 1,
  4453. fa: 1,
  4454. fi: 1,
  4455. fo: 1,
  4456. "fr-ca": 1,
  4457. fr: 1,
  4458. gl: 1,
  4459. gu: 1,
  4460. he: 1,
  4461. hi: 1,
  4462. hr: 1,
  4463. hu: 1,
  4464. id: 1,
  4465. is: 1,
  4466. it: 1,
  4467. ja: 1,
  4468. ka: 1,
  4469. km: 1,
  4470. ko: 1,
  4471. ku: 1,
  4472. lt: 1,
  4473. lv: 1,
  4474. mk: 1,
  4475. mn: 1,
  4476. ms: 1,
  4477. nb: 1,
  4478. nl: 1,
  4479. no: 1,
  4480. oc: 1,
  4481. pl: 1,
  4482. "pt-br": 1,
  4483. pt: 1,
  4484. ro: 1,
  4485. ru: 1,
  4486. si: 1,
  4487. sk: 1,
  4488. sl: 1,
  4489. sq: 1,
  4490. "sr-latn": 1,
  4491. sr: 1,
  4492. sv: 1,
  4493. th: 1,
  4494. tr: 1,
  4495. tt: 1,
  4496. ug: 1,
  4497. uk: 1,
  4498. vi: 1,
  4499. "zh-cn": 1,
  4500. zh: 1
  4501. }, rtl: {ar: 1, fa: 1, he: 1, ku: 1, ug: 1}, load: function (a, d, b) {
  4502. a && CKEDITOR.lang.languages[a] ||
  4503. (a = this.detect(d, a));
  4504. var c = this;
  4505. d = function () {
  4506. c[a].dir = c.rtl[a] ? "rtl" : "ltr";
  4507. b(a, c[a])
  4508. };
  4509. this[a] ? d() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), d, this)
  4510. }, detect: function (a, d) {
  4511. var b = this.languages;
  4512. d = d || navigator.userLanguage || navigator.language || a;
  4513. var c = d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/), f = c[1], c = c[2];
  4514. b[f + "-" + c] ? f = f + "-" + c : b[f] || (f = null);
  4515. CKEDITOR.lang.detect = f ? function () {
  4516. return f
  4517. } : function (a) {
  4518. return a
  4519. };
  4520. return f || a
  4521. }
  4522. }
  4523. })();
  4524. CKEDITOR.scriptLoader = function () {
  4525. var a = {}, d = {};
  4526. return {
  4527. load: function (b, c, f, g) {
  4528. var k = "string" == typeof b;
  4529. k && (b = [b]);
  4530. f || (f = CKEDITOR);
  4531. var h = b.length, p = [], q = [], e = function (a) {
  4532. c && (k ? c.call(f, a) : c.call(f, p, q))
  4533. };
  4534. if (0 === h) e(!0); else {
  4535. var y = function (a, b) {
  4536. (b ? p : q).push(a);
  4537. 0 >= --h && (g && CKEDITOR.document.getDocumentElement().removeStyle("cursor"), e(b))
  4538. }, v = function (b, c) {
  4539. a[b] = 1;
  4540. var f = d[b];
  4541. delete d[b];
  4542. for (var e = 0; e < f.length; e++) f[e](b, c)
  4543. }, x = function (b) {
  4544. if (a[b]) y(b, !0); else {
  4545. var f = d[b] || (d[b] = []);
  4546. f.push(y);
  4547. if (!(1 < f.length)) {
  4548. var e =
  4549. new CKEDITOR.dom.element("script");
  4550. e.setAttributes({type: "text/javascript", src: b});
  4551. c && (CKEDITOR.env.ie && (8 >= CKEDITOR.env.version || CKEDITOR.env.ie9Compat) ? e.$.onreadystatechange = function () {
  4552. if ("loaded" == e.$.readyState || "complete" == e.$.readyState) e.$.onreadystatechange = null, v(b, !0)
  4553. } : (e.$.onload = function () {
  4554. setTimeout(function () {
  4555. e.$.onload = null;
  4556. e.$.onerror = null;
  4557. v(b, !0)
  4558. }, 0)
  4559. }, e.$.onerror = function () {
  4560. e.$.onload = null;
  4561. e.$.onerror = null;
  4562. v(b, !1)
  4563. }));
  4564. e.appendTo(CKEDITOR.document.getHead())
  4565. }
  4566. }
  4567. };
  4568. g && CKEDITOR.document.getDocumentElement().setStyle("cursor",
  4569. "wait");
  4570. for (var F = 0; F < h; F++) x(b[F])
  4571. }
  4572. }, queue: function () {
  4573. function a() {
  4574. var b;
  4575. (b = c[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0)
  4576. }
  4577. var c = [];
  4578. return function (d, g) {
  4579. var k = this;
  4580. c.push({
  4581. scriptUrl: d, callback: function () {
  4582. g && g.apply(this, arguments);
  4583. c.shift();
  4584. a.call(k)
  4585. }
  4586. });
  4587. 1 == c.length && a.call(this)
  4588. }
  4589. }()
  4590. }
  4591. }();
  4592. CKEDITOR.resourceManager = function (a, d) {
  4593. this.basePath = a;
  4594. this.fileName = d;
  4595. this.registered = {};
  4596. this.loaded = {};
  4597. this.externals = {};
  4598. this._ = {waitingList: {}}
  4599. };
  4600. CKEDITOR.resourceManager.prototype = {
  4601. add: function (a, d) {
  4602. if (this.registered[a]) throw Error('[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.');
  4603. var b = this.registered[a] = d || {};
  4604. b.name = a;
  4605. b.path = this.getPath(a);
  4606. CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b);
  4607. return this.get(a)
  4608. }, get: function (a) {
  4609. return this.registered[a] || null
  4610. }, getPath: function (a) {
  4611. var d = this.externals[a];
  4612. return CKEDITOR.getUrl(d && d.dir || this.basePath + a + "/")
  4613. }, getFilePath: function (a) {
  4614. var d = this.externals[a];
  4615. return CKEDITOR.getUrl(this.getPath(a) + (d ? d.file : this.fileName + ".js"))
  4616. }, addExternal: function (a, d, b) {
  4617. a = a.split(",");
  4618. for (var c = 0; c < a.length; c++) {
  4619. var f = a[c];
  4620. b || (d = d.replace(/[^\/]+$/, function (a) {
  4621. b = a;
  4622. return ""
  4623. }));
  4624. this.externals[f] = {dir: d, file: b || this.fileName + ".js"}
  4625. }
  4626. }, load: function (a, d, b) {
  4627. CKEDITOR.tools.isArray(a) || (a = a ? [a] : []);
  4628. for (var c = this.loaded, f = this.registered, g = [], k = {}, h = {}, p = 0; p < a.length; p++) {
  4629. var q = a[p];
  4630. if (q) if (c[q] || f[q]) h[q] = this.get(q); else {
  4631. var e = this.getFilePath(q);
  4632. g.push(e);
  4633. e in k || (k[e] =
  4634. []);
  4635. k[e].push(q)
  4636. }
  4637. }
  4638. CKEDITOR.scriptLoader.load(g, function (a, e) {
  4639. if (e.length) throw Error('[CKEDITOR.resourceManager.load] Resource name "' + k[e[0]].join(",") + '" was not found at "' + e[0] + '".');
  4640. for (var f = 0; f < a.length; f++) for (var g = k[a[f]], p = 0; p < g.length; p++) {
  4641. var m = g[p];
  4642. h[m] = this.get(m);
  4643. c[m] = 1
  4644. }
  4645. d.call(b, h)
  4646. }, this)
  4647. }
  4648. };
  4649. CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin");
  4650. CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function (a) {
  4651. var d = {};
  4652. return function (b, c, f) {
  4653. var g = {}, k = function (b) {
  4654. a.call(this, b, function (a) {
  4655. CKEDITOR.tools.extend(g, a);
  4656. var b = [], e;
  4657. for (e in a) {
  4658. var h = a[e], v = h && h.requires;
  4659. if (!d[e]) {
  4660. if (h.icons) for (var x = h.icons.split(","), F = x.length; F--;) CKEDITOR.skin.addIcon(x[F], h.path + "icons/" + (CKEDITOR.env.hidpi && h.hidpi ? "hidpi/" : "") + x[F] + ".png");
  4661. d[e] = 1
  4662. }
  4663. if (v) for (v.split && (v = v.split(",")), h = 0; h < v.length; h++) g[v[h]] || b.push(v[h])
  4664. }
  4665. if (b.length) k.call(this,
  4666. b); else {
  4667. for (e in g) h = g[e], h.onLoad && !h.onLoad._called && (!1 === h.onLoad() && delete g[e], h.onLoad._called = 1);
  4668. c && c.call(f || window, g)
  4669. }
  4670. }, this)
  4671. };
  4672. k.call(this, b)
  4673. }
  4674. });
  4675. CKEDITOR.plugins.setLang = function (a, d, b) {
  4676. var c = this.get(a);
  4677. a = c.langEntries || (c.langEntries = {});
  4678. c = c.lang || (c.lang = []);
  4679. c.split && (c = c.split(","));
  4680. -1 == CKEDITOR.tools.indexOf(c, d) && c.push(d);
  4681. a[d] = b
  4682. };
  4683. CKEDITOR.ui = function (a) {
  4684. if (a.ui) return a.ui;
  4685. this.items = {};
  4686. this.instances = {};
  4687. this.editor = a;
  4688. this._ = {handlers: {}};
  4689. return this
  4690. };
  4691. CKEDITOR.ui.prototype = {
  4692. add: function (a, d, b) {
  4693. b.name = a.toLowerCase();
  4694. var c = this.items[a] = {
  4695. type: d,
  4696. command: b.command || null,
  4697. args: Array.prototype.slice.call(arguments, 2)
  4698. };
  4699. CKEDITOR.tools.extend(c, b)
  4700. }, get: function (a) {
  4701. return this.instances[a]
  4702. }, create: function (a) {
  4703. var d = this.items[a], b = d && this._.handlers[d.type],
  4704. c = d && d.command && this.editor.getCommand(d.command), b = b && b.create.apply(this, d.args);
  4705. this.instances[a] = b;
  4706. c && c.uiItems.push(b);
  4707. b && !b.type && (b.type = d.type);
  4708. return b
  4709. }, addHandler: function (a, d) {
  4710. this._.handlers[a] =
  4711. d
  4712. }, space: function (a) {
  4713. return CKEDITOR.document.getById(this.spaceId(a))
  4714. }, spaceId: function (a) {
  4715. return this.editor.id + "_" + a
  4716. }
  4717. };
  4718. CKEDITOR.event.implementOn(CKEDITOR.ui);
  4719. (function () {
  4720. function a(a, e, f) {
  4721. CKEDITOR.event.call(this);
  4722. a = a && CKEDITOR.tools.clone(a);
  4723. if (void 0 !== e) {
  4724. if (!(e instanceof CKEDITOR.dom.element)) throw Error("Expect element of type CKEDITOR.dom.element.");
  4725. if (!f) throw Error("One of the element modes must be specified.");
  4726. if (CKEDITOR.env.ie && CKEDITOR.env.quirks && f == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks.");
  4727. if (!b(e, f)) throw Error('The specified element mode is not supported on element: "' + e.getName() + '".');
  4728. this.element = e;
  4729. this.elementMode = f;
  4730. this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (e.getId() || e.getNameAtt())
  4731. } else this.elementMode = CKEDITOR.ELEMENT_MODE_NONE;
  4732. this._ = {};
  4733. this.commands = {};
  4734. this.templates = {};
  4735. this.name = this.name || d();
  4736. this.id = CKEDITOR.tools.getNextId();
  4737. this.status = "unloaded";
  4738. this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
  4739. this.ui = new CKEDITOR.ui(this);
  4740. this.focusManager = new CKEDITOR.focusManager(this);
  4741. this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
  4742. this.on("readOnly",
  4743. c);
  4744. this.on("selectionChange", function (a) {
  4745. g(this, a.data.path)
  4746. });
  4747. this.on("activeFilterChange", function () {
  4748. g(this, this.elementPath(), !0)
  4749. });
  4750. this.on("mode", c);
  4751. this.on("instanceReady", function () {
  4752. if (this.config.startupFocus) {
  4753. if ("end" === this.config.startupFocus) {
  4754. var a = this.createRange();
  4755. a.selectNodeContents(this.editable());
  4756. a.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
  4757. a.collapse();
  4758. this.getSelection().selectRanges([a])
  4759. }
  4760. this.focus()
  4761. }
  4762. });
  4763. CKEDITOR.fire("instanceCreated", null, this);
  4764. CKEDITOR.add(this);
  4765. CKEDITOR.tools.setTimeout(function () {
  4766. "destroyed" !==
  4767. this.status ? h(this, a) : CKEDITOR.warn("editor-incorrect-destroy")
  4768. }, 0, this)
  4769. }
  4770. function d() {
  4771. do var a = "editor" + ++F; while (CKEDITOR.instances[a]);
  4772. return a
  4773. }
  4774. function b(a, b) {
  4775. return b == CKEDITOR.ELEMENT_MODE_INLINE ? a.is(CKEDITOR.dtd.$editable) || a.is("textarea") : b == CKEDITOR.ELEMENT_MODE_REPLACE ? !a.is(CKEDITOR.dtd.$nonBodyContent) : 1
  4776. }
  4777. function c() {
  4778. var a = this.commands, b;
  4779. for (b in a) f(this, a[b])
  4780. }
  4781. function f(a, b) {
  4782. b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" : b.modes[a.mode] ? "enable" : "disable"]()
  4783. }
  4784. function g(a,
  4785. b, c) {
  4786. if (b) {
  4787. var d, e, f = a.commands;
  4788. for (e in f) d = f[e], (c || d.contextSensitive) && d.refresh(a, b)
  4789. }
  4790. }
  4791. function k(a) {
  4792. var b = a.config.customConfig;
  4793. if (!b) return !1;
  4794. var b = CKEDITOR.getUrl(b), c = u[b] || (u[b] = {});
  4795. c.fn ? (c.fn.call(a, a.config), CKEDITOR.getUrl(a.config.customConfig) != b && k(a) || a.fireOnce("customConfigLoaded")) : CKEDITOR.scriptLoader.queue(b, function () {
  4796. c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function () {
  4797. };
  4798. k(a)
  4799. });
  4800. return !0
  4801. }
  4802. function h(a, b) {
  4803. a.on("customConfigLoaded", function () {
  4804. if (b) {
  4805. if (b.on) for (var c in b.on) a.on(c,
  4806. b.on[c]);
  4807. CKEDITOR.tools.extend(a.config, b, !0);
  4808. delete a.config.on
  4809. }
  4810. c = a.config;
  4811. a.readOnly = c.readOnly ? !0 : a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is("textarea") ? a.element.hasAttribute("disabled") || a.element.hasAttribute("readonly") : a.element.isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.element.hasAttribute("disabled") || a.element.hasAttribute("readonly") : !1;
  4812. a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) :
  4813. !1;
  4814. a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") || 0;
  4815. a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
  4816. a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
  4817. c.skin && (CKEDITOR.skinName = c.skin);
  4818. a.fireOnce("configLoaded");
  4819. a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
  4820. a.filter = a.activeFilter = new CKEDITOR.filter(a);
  4821. p(a)
  4822. });
  4823. b && null != b.customConfig && (a.config.customConfig = b.customConfig);
  4824. k(a) || a.fireOnce("customConfigLoaded")
  4825. }
  4826. function p(a) {
  4827. CKEDITOR.skin.loadPart("editor", function () {
  4828. q(a)
  4829. })
  4830. }
  4831. function q(a) {
  4832. CKEDITOR.lang.load(a.config.language, a.config.defaultLanguage, function (b, c) {
  4833. var d = a.config.title;
  4834. a.langCode = b;
  4835. a.lang = CKEDITOR.tools.prototypedCopy(c);
  4836. a.title = "string" == typeof d || !1 === d ? d : [a.lang.editor, a.name].join(", ");
  4837. a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir);
  4838. a.fire("langLoaded");
  4839. e(a)
  4840. })
  4841. }
  4842. function e(a) {
  4843. a.getStylesSet(function (b) {
  4844. a.once("loaded",
  4845. function () {
  4846. a.fire("stylesSet", {styles: b})
  4847. }, null, null, 1);
  4848. y(a)
  4849. })
  4850. }
  4851. function y(a) {
  4852. function b(a) {
  4853. if (!a) return "";
  4854. CKEDITOR.tools.isArray(a) && (a = a.join(","));
  4855. return a.replace(/\s/g, "")
  4856. }
  4857. var c = a.config, d = b(c.plugins), e = b(c.extraPlugins), f = b(c.removePlugins);
  4858. if (e) var g = new RegExp("(?:^|,)(?:" + e.replace(/,/g, "|") + ")(?\x3d,|$)", "g"), d = d.replace(g, ""),
  4859. d = d + ("," + e);
  4860. if (f) var k = new RegExp("(?:^|,)(?:" + f.replace(/,/g, "|") + ")(?\x3d,|$)", "g"), d = d.replace(k, "");
  4861. CKEDITOR.env.air && (d += ",adobeair");
  4862. CKEDITOR.plugins.load(d.split(","),
  4863. function (b) {
  4864. var d = [], e = [], f = [];
  4865. a.plugins = CKEDITOR.tools.extend({}, a.plugins, b);
  4866. for (var n in b) {
  4867. var g = b[n], r = g.lang, h = null, l = g.requires, C;
  4868. CKEDITOR.tools.isArray(l) && (l = l.join(","));
  4869. if (l && (C = l.match(k))) for (; l = C.pop();) CKEDITOR.error("editor-plugin-required", {
  4870. plugin: l.replace(",", ""),
  4871. requiredBy: n
  4872. });
  4873. r && !a.lang[n] && (r.split && (r = r.split(",")), 0 <= CKEDITOR.tools.indexOf(r, a.langCode) ? h = a.langCode : (h = a.langCode.replace(/-.*/, ""), h = h != a.langCode && 0 <= CKEDITOR.tools.indexOf(r, h) ? h : 0 <= CKEDITOR.tools.indexOf(r,
  4874. "en") ? "en" : r[0]), g.langEntries && g.langEntries[h] ? (a.lang[n] = g.langEntries[h], h = null) : f.push(CKEDITOR.getUrl(g.path + "lang/" + h + ".js")));
  4875. e.push(h);
  4876. d.push(g)
  4877. }
  4878. CKEDITOR.scriptLoader.load(f, function () {
  4879. for (var b = ["beforeInit", "init", "afterInit"], f = 0; f < b.length; f++) for (var l = 0; l < d.length; l++) {
  4880. var n = d[l];
  4881. 0 === f && e[l] && n.lang && n.langEntries && (a.lang[n.name] = n.langEntries[e[l]]);
  4882. if (n[b[f]]) n[b[f]](a)
  4883. }
  4884. a.fireOnce("pluginsLoaded");
  4885. c.keystrokes && a.setKeystroke(a.config.keystrokes);
  4886. for (l = 0; l < a.config.blockedKeystrokes.length; l++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[l]] =
  4887. 1;
  4888. a.status = "loaded";
  4889. a.fireOnce("loaded");
  4890. CKEDITOR.fire("instanceLoaded", null, a)
  4891. })
  4892. })
  4893. }
  4894. function v() {
  4895. var a = this.element;
  4896. if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
  4897. var b = this.getData();
  4898. this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
  4899. a.is("textarea") ? a.setValue(b) : a.setHtml(b);
  4900. return !0
  4901. }
  4902. return !1
  4903. }
  4904. function x(a, b) {
  4905. function c(a) {
  4906. var b = a.startContainer, d = a.endContainer;
  4907. return b.is && (b.is("tr") || b.is("td") && b.equals(d) && a.endOffset === b.getChildCount()) ? !0 : !1
  4908. }
  4909. function d(a) {
  4910. var b = a.startContainer;
  4911. return b.is("tr") ? a.cloneContents() : b.clone(!0)
  4912. }
  4913. for (var e = new CKEDITOR.dom.documentFragment, f, g, k, h = 0; h < a.length; h++) {
  4914. var N = a[h], t = N.startContainer.getAscendant("tr", !0);
  4915. c(N) ? (f || (f = t.getAscendant("table").clone(), f.append(t.getAscendant({
  4916. thead: 1,
  4917. tbody: 1,
  4918. tfoot: 1
  4919. }).clone()), e.append(f), f = f.findOne("thead, tbody, tfoot")), g && g.equals(t) || (g = t, k = t.clone(), f.append(k)), k.append(d(N))) : e.append(N.cloneContents())
  4920. }
  4921. return f ? e : b.getHtmlFromRange(a[0])
  4922. }
  4923. a.prototype = CKEDITOR.editor.prototype;
  4924. CKEDITOR.editor =
  4925. a;
  4926. var F = 0, u = {};
  4927. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  4928. plugins: {
  4929. detectConflict: function (a, b) {
  4930. for (var c = 0; c < b.length; c++) {
  4931. var d = b[c];
  4932. if (this[d]) return CKEDITOR.warn("editor-plugin-conflict", {plugin: a, replacedWith: d}), !0
  4933. }
  4934. return !1
  4935. }
  4936. }, addCommand: function (a, b) {
  4937. b.name = a.toLowerCase();
  4938. var c = b instanceof CKEDITOR.command ? b : new CKEDITOR.command(this, b);
  4939. this.mode && f(this, c);
  4940. return this.commands[a] = c
  4941. }, _attachToForm: function () {
  4942. function a(b) {
  4943. c.updateElement();
  4944. c._.required && !d.getValue() && !1 === c.fire("required") &&
  4945. b.data.preventDefault()
  4946. }
  4947. function b(a) {
  4948. return !!(a && a.call && a.apply)
  4949. }
  4950. var c = this, d = c.element, e = new CKEDITOR.dom.element(d.$.form);
  4951. d.is("textarea") && e && (e.on("submit", a), b(e.$.submit) && (e.$.submit = CKEDITOR.tools.override(e.$.submit, function (b) {
  4952. return function () {
  4953. a();
  4954. b.apply ? b.apply(this) : b()
  4955. }
  4956. })), c.on("destroy", function () {
  4957. e.removeListener("submit", a)
  4958. }))
  4959. }, destroy: function (a) {
  4960. var b = CKEDITOR.filter.instances, c = this;
  4961. this.fire("beforeDestroy");
  4962. !a && v.call(this);
  4963. this.editable(null);
  4964. this.filter && delete this.filter;
  4965. CKEDITOR.tools.array.forEach(CKEDITOR.tools.objectKeys(b), function (a) {
  4966. a = b[a];
  4967. c === a.editor && a.destroy()
  4968. });
  4969. delete this.activeFilter;
  4970. this.status = "destroyed";
  4971. this.fire("destroy");
  4972. this.removeAllListeners();
  4973. CKEDITOR.remove(this);
  4974. CKEDITOR.fire("instanceDestroyed", null, this)
  4975. }, elementPath: function (a) {
  4976. if (!a) {
  4977. a = this.getSelection();
  4978. if (!a) return null;
  4979. a = a.getStartElement()
  4980. }
  4981. return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
  4982. }, createRange: function () {
  4983. var a = this.editable();
  4984. return a ? new CKEDITOR.dom.range(a) :
  4985. null
  4986. }, execCommand: function (a, b) {
  4987. var c = this.getCommand(a), d = {name: a, commandData: b || {}, command: c};
  4988. return c && c.state != CKEDITOR.TRISTATE_DISABLED && !1 !== this.fire("beforeCommandExec", d) && (d.returnValue = c.exec(d.commandData), !c.async && !1 !== this.fire("afterCommandExec", d)) ? d.returnValue : !1
  4989. }, getCommand: function (a) {
  4990. return this.commands[a]
  4991. }, getData: function (a) {
  4992. !a && this.fire("beforeGetData");
  4993. var b = this._.data;
  4994. "string" != typeof b && (b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ?
  4995. b.getValue() : b.getHtml() : "");
  4996. b = {dataValue: b};
  4997. !a && this.fire("getData", b);
  4998. return b.dataValue
  4999. }, getSnapshot: function () {
  5000. var a = this.fire("getSnapshot");
  5001. "string" != typeof a && (a = (a = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.is("textarea") ? a.getValue() : a.getHtml() : "");
  5002. return a
  5003. }, loadSnapshot: function (a) {
  5004. this.fire("loadSnapshot", a)
  5005. }, setData: function (a, b, c) {
  5006. var d = !0, e = b;
  5007. b && "object" == typeof b && (c = b.internal, e = b.callback, d = !b.noSnapshot);
  5008. !c && d && this.fire("saveSnapshot");
  5009. if (e || !c) this.once("dataReady",
  5010. function (a) {
  5011. !c && d && this.fire("saveSnapshot");
  5012. e && e.call(a.editor)
  5013. });
  5014. a = {dataValue: a};
  5015. !c && this.fire("setData", a);
  5016. this._.data = a.dataValue;
  5017. !c && this.fire("afterSetData", a)
  5018. }, setReadOnly: function (a) {
  5019. a = null == a || a;
  5020. this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this.editable().setReadOnly(a), this.fire("readOnly"))
  5021. }, insertHtml: function (a, b, c) {
  5022. this.fire("insertHtml", {dataValue: a, mode: b, range: c})
  5023. }, insertText: function (a) {
  5024. this.fire("insertText", a)
  5025. }, insertElement: function (a) {
  5026. this.fire("insertElement",
  5027. a)
  5028. }, getSelectedHtml: function (a) {
  5029. var b = this.editable(), c = this.getSelection(), c = c && c.getRanges();
  5030. if (!b || !c || 0 === c.length) return null;
  5031. b = x(c, b);
  5032. return a ? b.getHtml() : b
  5033. }, extractSelectedHtml: function (a, b) {
  5034. var c = this.editable(), d = this.getSelection().getRanges(), e = new CKEDITOR.dom.documentFragment, f;
  5035. if (!c || 0 === d.length) return null;
  5036. for (f = 0; f < d.length; f++) e.append(c.extractHtmlFromRange(d[f], b));
  5037. b || this.getSelection().selectRanges([d[0]]);
  5038. return a ? e.getHtml() : e
  5039. }, focus: function () {
  5040. this.fire("beforeFocus")
  5041. }, checkDirty: function () {
  5042. return "ready" ==
  5043. this.status && this._.previousValue !== this.getSnapshot()
  5044. }, resetDirty: function () {
  5045. this._.previousValue = this.getSnapshot()
  5046. }, updateElement: function () {
  5047. return v.call(this)
  5048. }, setKeystroke: function () {
  5049. for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [[].slice.call(arguments, 0)], c, d, e = b.length; e--;) c = b[e], d = 0, CKEDITOR.tools.isArray(c) && (d = c[1], c = c[0]), d ? a[c] = d : delete a[c]
  5050. }, getCommandKeystroke: function (a, b) {
  5051. var c = "string" === typeof a ? this.getCommand(a) : a, d = [];
  5052. if (c) {
  5053. var e =
  5054. CKEDITOR.tools.object.findKey(this.commands, c), f = this.keystrokeHandler.keystrokes;
  5055. if (c.fakeKeystroke) d.push(c.fakeKeystroke); else for (var g in f) f[g] === e && d.push(g)
  5056. }
  5057. return b ? d : d[0] || null
  5058. }, addFeature: function (a) {
  5059. return this.filter.addFeature(a)
  5060. }, setActiveFilter: function (a) {
  5061. a || (a = this.filter);
  5062. this.activeFilter !== a && (this.activeFilter = a, this.fire("activeFilterChange"), a === this.filter ? this.setActiveEnterMode(null, null) : this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode), a.getAllowedEnterMode(this.shiftEnterMode,
  5063. !0)))
  5064. }, setActiveEnterMode: function (a, b) {
  5065. a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
  5066. b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
  5067. if (this.activeEnterMode != a || this.activeShiftEnterMode != b) this.activeEnterMode = a, this.activeShiftEnterMode = b, this.fire("activeEnterModeChange")
  5068. }, showNotification: function (a) {
  5069. alert(a)
  5070. }
  5071. })
  5072. })();
  5073. CKEDITOR.ELEMENT_MODE_NONE = 0;
  5074. CKEDITOR.ELEMENT_MODE_REPLACE = 1;
  5075. CKEDITOR.ELEMENT_MODE_APPENDTO = 2;
  5076. CKEDITOR.ELEMENT_MODE_INLINE = 3;
  5077. CKEDITOR.htmlParser = function () {
  5078. this._ = {htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}
  5079. };
  5080. (function () {
  5081. var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g, d = {
  5082. checked: 1,
  5083. compact: 1,
  5084. declare: 1,
  5085. defer: 1,
  5086. disabled: 1,
  5087. ismap: 1,
  5088. multiple: 1,
  5089. nohref: 1,
  5090. noresize: 1,
  5091. noshade: 1,
  5092. nowrap: 1,
  5093. readonly: 1,
  5094. selected: 1
  5095. };
  5096. CKEDITOR.htmlParser.prototype = {
  5097. onTagOpen: function () {
  5098. }, onTagClose: function () {
  5099. }, onText: function () {
  5100. }, onCDATA: function () {
  5101. }, onComment: function () {
  5102. }, parse: function (b) {
  5103. for (var c, f, g = 0, k; c = this._.htmlPartsRegex.exec(b);) {
  5104. f = c.index;
  5105. if (f > g) if (g = b.substring(g, f), k) k.push(g); else this.onText(g);
  5106. g = this._.htmlPartsRegex.lastIndex;
  5107. if (f = c[1]) if (f = f.toLowerCase(), k && CKEDITOR.dtd.$cdata[f] && (this.onCDATA(k.join("")), k = null), !k) {
  5108. this.onTagClose(f);
  5109. continue
  5110. }
  5111. if (k) k.push(c[0]); else if (f = c[3]) {
  5112. if (f = f.toLowerCase(), !/="/.test(f)) {
  5113. var h = {}, p, q = c[4];
  5114. c = !!c[5];
  5115. if (q) for (; p = a.exec(q);) {
  5116. var e = p[1].toLowerCase();
  5117. p = p[2] || p[3] || p[4] || "";
  5118. h[e] = !p && d[e] ? e : CKEDITOR.tools.htmlDecodeAttr(p)
  5119. }
  5120. this.onTagOpen(f, h, c);
  5121. !k && CKEDITOR.dtd.$cdata[f] && (k = [])
  5122. }
  5123. } else if (f = c[2]) this.onComment(f)
  5124. }
  5125. if (b.length > g) this.onText(b.substring(g,
  5126. b.length))
  5127. }
  5128. }
  5129. })();
  5130. CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
  5131. $: function () {
  5132. this._ = {output: []}
  5133. }, proto: {
  5134. openTag: function (a) {
  5135. this._.output.push("\x3c", a)
  5136. }, openTagClose: function (a, d) {
  5137. d ? this._.output.push(" /\x3e") : this._.output.push("\x3e")
  5138. }, attribute: function (a, d) {
  5139. "string" == typeof d && (d = CKEDITOR.tools.htmlEncodeAttr(d));
  5140. this._.output.push(" ", a, '\x3d"', d, '"')
  5141. }, closeTag: function (a) {
  5142. this._.output.push("\x3c/", a, "\x3e")
  5143. }, text: function (a) {
  5144. this._.output.push(a)
  5145. }, comment: function (a) {
  5146. this._.output.push("\x3c!--", a,
  5147. "--\x3e")
  5148. }, write: function (a) {
  5149. this._.output.push(a)
  5150. }, reset: function () {
  5151. this._.output = [];
  5152. this._.indent = !1
  5153. }, getHtml: function (a) {
  5154. var d = this._.output.join("");
  5155. a && this.reset();
  5156. return d
  5157. }
  5158. }
  5159. });
  5160. "use strict";
  5161. (function () {
  5162. CKEDITOR.htmlParser.node = function () {
  5163. };
  5164. CKEDITOR.htmlParser.node.prototype = {
  5165. remove: function () {
  5166. var a = this.parent.children, d = CKEDITOR.tools.indexOf(a, this), b = this.previous, c = this.next;
  5167. b && (b.next = c);
  5168. c && (c.previous = b);
  5169. a.splice(d, 1);
  5170. this.parent = null
  5171. }, replaceWith: function (a) {
  5172. var d = this.parent.children, b = CKEDITOR.tools.indexOf(d, this), c = a.previous = this.previous,
  5173. f = a.next = this.next;
  5174. c && (c.next = a);
  5175. f && (f.previous = a);
  5176. d[b] = a;
  5177. a.parent = this.parent;
  5178. this.parent = null
  5179. }, insertAfter: function (a) {
  5180. var d = a.parent.children,
  5181. b = CKEDITOR.tools.indexOf(d, a), c = a.next;
  5182. d.splice(b + 1, 0, this);
  5183. this.next = a.next;
  5184. this.previous = a;
  5185. a.next = this;
  5186. c && (c.previous = this);
  5187. this.parent = a.parent
  5188. }, insertBefore: function (a) {
  5189. var d = a.parent.children, b = CKEDITOR.tools.indexOf(d, a);
  5190. d.splice(b, 0, this);
  5191. this.next = a;
  5192. (this.previous = a.previous) && (a.previous.next = this);
  5193. a.previous = this;
  5194. this.parent = a.parent
  5195. }, getAscendant: function (a) {
  5196. var d = "function" == typeof a ? a : "string" == typeof a ? function (b) {
  5197. return b.name == a
  5198. } : function (b) {
  5199. return b.name in a
  5200. }, b = this.parent;
  5201. for (; b &&
  5202. b.type == CKEDITOR.NODE_ELEMENT;) {
  5203. if (d(b)) return b;
  5204. b = b.parent
  5205. }
  5206. return null
  5207. }, wrapWith: function (a) {
  5208. this.replaceWith(a);
  5209. a.add(this);
  5210. return a
  5211. }, getIndex: function () {
  5212. return CKEDITOR.tools.indexOf(this.parent.children, this)
  5213. }, getFilterContext: function (a) {
  5214. return a || {}
  5215. }
  5216. }
  5217. })();
  5218. "use strict";
  5219. CKEDITOR.htmlParser.comment = function (a) {
  5220. this.value = a;
  5221. this._ = {isBlockLike: !1}
  5222. };
  5223. CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5224. type: CKEDITOR.NODE_COMMENT,
  5225. filter: function (a, d) {
  5226. var b = this.value;
  5227. if (!(b = a.onComment(d, b, this))) return this.remove(), !1;
  5228. if ("string" != typeof b) return this.replaceWith(b), !1;
  5229. this.value = b;
  5230. return !0
  5231. },
  5232. writeHtml: function (a, d) {
  5233. d && this.filter(d);
  5234. a.comment(this.value)
  5235. }
  5236. });
  5237. "use strict";
  5238. (function () {
  5239. CKEDITOR.htmlParser.text = function (a) {
  5240. this.value = a;
  5241. this._ = {isBlockLike: !1}
  5242. };
  5243. CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5244. type: CKEDITOR.NODE_TEXT,
  5245. filter: function (a, d) {
  5246. if (!(this.value = a.onText(d, this.value, this))) return this.remove(), !1
  5247. },
  5248. writeHtml: function (a, d) {
  5249. d && this.filter(d);
  5250. a.text(this.value)
  5251. }
  5252. })
  5253. })();
  5254. "use strict";
  5255. (function () {
  5256. CKEDITOR.htmlParser.cdata = function (a) {
  5257. this.value = a
  5258. };
  5259. CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5260. type: CKEDITOR.NODE_TEXT,
  5261. filter: function () {
  5262. },
  5263. writeHtml: function (a) {
  5264. a.write(this.value)
  5265. }
  5266. })
  5267. })();
  5268. "use strict";
  5269. CKEDITOR.htmlParser.fragment = function () {
  5270. this.children = [];
  5271. this.parent = null;
  5272. this._ = {isBlockLike: !0, hasInlineStarted: !1}
  5273. };
  5274. (function () {
  5275. function a(a) {
  5276. return a.attributes["data-cke-survive"] ? !1 : "a" == a.name && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name]
  5277. }
  5278. var d = CKEDITOR.tools.extend({
  5279. table: 1,
  5280. ul: 1,
  5281. ol: 1,
  5282. dl: 1
  5283. }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl), b = {ol: 1, ul: 1},
  5284. c = CKEDITOR.tools.extend({}, {html: 1}, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, {
  5285. style: 1,
  5286. script: 1
  5287. }), f = {ul: "li", ol: "li", dl: "dd", table: "tbody", tbody: "tr", thead: "tr", tfoot: "tr", tr: "td"};
  5288. CKEDITOR.htmlParser.fragment.fromHtml =
  5289. function (g, k, h) {
  5290. function p(a) {
  5291. var b;
  5292. if (0 < m.length) for (var c = 0; c < m.length; c++) {
  5293. var d = m[c], e = d.name, f = CKEDITOR.dtd[e], n = w.name && CKEDITOR.dtd[w.name];
  5294. n && !n[e] || a && f && !f[a] && CKEDITOR.dtd[a] ? e == w.name && (y(w, w.parent, 1), c--) : (b || (q(), b = 1), d = d.clone(), d.parent = w, w = d, m.splice(c, 1), c--)
  5295. }
  5296. }
  5297. function q() {
  5298. for (; M.length;) y(M.shift(), w)
  5299. }
  5300. function e(a) {
  5301. if (a._.isBlockLike && "pre" != a.name && "textarea" != a.name) {
  5302. var b = a.children.length, c = a.children[b - 1], d;
  5303. c && c.type == CKEDITOR.NODE_TEXT && ((d = CKEDITOR.tools.rtrim(c.value)) ?
  5304. c.value = d : a.children.length = b - 1)
  5305. }
  5306. }
  5307. function y(b, c, d) {
  5308. c = c || w || u;
  5309. var f = w;
  5310. void 0 === b.previous && (v(c, b) && (w = c, F.onTagOpen(h, {}), b.returnPoint = c = w), e(b), a(b) && !b.children.length || c.add(b), "pre" == b.name && (n = !1), "textarea" == b.name && (H = !1));
  5311. b.returnPoint ? (w = b.returnPoint, delete b.returnPoint) : w = d ? c : f
  5312. }
  5313. function v(a, b) {
  5314. if ((a == u || "body" == a.name) && h && (!a.name || CKEDITOR.dtd[a.name][h])) {
  5315. var c, d;
  5316. return (c = b.attributes && (d = b.attributes["data-cke-real-element-type"]) ? d : b.name) && c in CKEDITOR.dtd.$inline && !(c in CKEDITOR.dtd.head) &&
  5317. !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
  5318. }
  5319. }
  5320. function x(a, b) {
  5321. return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || "dt" == a && "dd" == b || "dd" == a && "dt" == b : !1
  5322. }
  5323. var F = new CKEDITOR.htmlParser,
  5324. u = k instanceof CKEDITOR.htmlParser.element ? k : "string" == typeof k ? new CKEDITOR.htmlParser.element(k) : new CKEDITOR.htmlParser.fragment,
  5325. m = [], M = [], w = u, H = "textarea" == u.name, n = "pre" == u.name;
  5326. F.onTagOpen = function (e, f, g, k) {
  5327. f = new CKEDITOR.htmlParser.element(e, f);
  5328. f.isUnknown && g && (f.isEmpty = !0);
  5329. f.isOptionalClose = k;
  5330. if (a(f)) m.push(f); else {
  5331. if ("pre" == e) n = !0; else {
  5332. if ("br" == e && n) {
  5333. w.add(new CKEDITOR.htmlParser.text("\n"));
  5334. return
  5335. }
  5336. "textarea" == e && (H = !0)
  5337. }
  5338. if ("br" == e) M.push(f); else {
  5339. for (; !(k = (g = w.name) ? CKEDITOR.dtd[g] || (w._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c, f.isUnknown || w.isUnknown || k[e]);) if (w.isOptionalClose) F.onTagClose(g); else if (e in b && g in b) g = w.children, (g = g[g.length - 1]) && "li" == g.name || y(g = new CKEDITOR.htmlParser.element("li"), w), !f.returnPoint && (f.returnPoint = w), w = g; else if (e in CKEDITOR.dtd.$listItem &&
  5340. !x(e, g)) F.onTagOpen("li" == e ? "ul" : "dl", {}, 0, 1); else if (g in d && !x(e, g)) !f.returnPoint && (f.returnPoint = w), w = w.parent; else if (g in CKEDITOR.dtd.$inline && m.unshift(w), w.parent) y(w, w.parent, 1); else {
  5341. f.isOrphan = 1;
  5342. break
  5343. }
  5344. p(e);
  5345. q();
  5346. f.parent = w;
  5347. f.isEmpty ? y(f) : w = f
  5348. }
  5349. }
  5350. };
  5351. F.onTagClose = function (a) {
  5352. for (var b = m.length - 1; 0 <= b; b--) if (a == m[b].name) {
  5353. m.splice(b, 1);
  5354. return
  5355. }
  5356. for (var c = [], d = [], e = w; e != u && e.name != a;) e._.isBlockLike || d.unshift(e), c.push(e), e = e.returnPoint || e.parent;
  5357. if (e != u) {
  5358. for (b = 0; b < c.length; b++) {
  5359. var f = c[b];
  5360. y(f, f.parent)
  5361. }
  5362. w =
  5363. e;
  5364. e._.isBlockLike && q();
  5365. y(e, e.parent);
  5366. e == w && (w = w.parent);
  5367. m = m.concat(d)
  5368. }
  5369. "body" == a && (h = !1)
  5370. };
  5371. F.onText = function (a) {
  5372. if (!(w._.hasInlineStarted && !M.length || n || H) && (a = CKEDITOR.tools.ltrim(a), 0 === a.length)) return;
  5373. var b = w.name,
  5374. e = b ? CKEDITOR.dtd[b] || (w._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c;
  5375. if (!H && !e["#"] && b in d) F.onTagOpen(f[b] || ""), F.onText(a); else {
  5376. q();
  5377. p();
  5378. n || H || (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
  5379. a = new CKEDITOR.htmlParser.text(a);
  5380. if (v(w, a)) this.onTagOpen(h, {}, 0, 1);
  5381. w.add(a)
  5382. }
  5383. };
  5384. F.onCDATA =
  5385. function (a) {
  5386. w.add(new CKEDITOR.htmlParser.cdata(a))
  5387. };
  5388. F.onComment = function (a) {
  5389. q();
  5390. p();
  5391. w.add(new CKEDITOR.htmlParser.comment(a))
  5392. };
  5393. F.parse(g);
  5394. for (q(); w != u;) y(w, w.parent, 1);
  5395. e(u);
  5396. return u
  5397. };
  5398. CKEDITOR.htmlParser.fragment.prototype = {
  5399. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT, add: function (a, b) {
  5400. isNaN(b) && (b = this.children.length);
  5401. var c = 0 < b ? this.children[b - 1] : null;
  5402. if (c) {
  5403. if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT && (c.value = CKEDITOR.tools.rtrim(c.value), 0 === c.value.length)) {
  5404. this.children.pop();
  5405. this.add(a);
  5406. return
  5407. }
  5408. c.next =
  5409. a
  5410. }
  5411. a.previous = c;
  5412. a.parent = this;
  5413. this.children.splice(b, 0, a);
  5414. this._.hasInlineStarted || (this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike)
  5415. }, filter: function (a, b) {
  5416. b = this.getFilterContext(b);
  5417. a.onRoot(b, this);
  5418. this.filterChildren(a, !1, b)
  5419. }, filterChildren: function (a, b, c) {
  5420. if (this.childrenFilteredBy != a.id) {
  5421. c = this.getFilterContext(c);
  5422. if (b && !this.parent) a.onRoot(c, this);
  5423. this.childrenFilteredBy = a.id;
  5424. for (b = 0; b < this.children.length; b++) !1 === this.children[b].filter(a,
  5425. c) && b--
  5426. }
  5427. }, writeHtml: function (a, b) {
  5428. b && this.filter(b);
  5429. this.writeChildrenHtml(a)
  5430. }, writeChildrenHtml: function (a, b, c) {
  5431. var d = this.getFilterContext();
  5432. if (c && !this.parent && b) b.onRoot(d, this);
  5433. b && this.filterChildren(b, !1, d);
  5434. b = 0;
  5435. c = this.children;
  5436. for (d = c.length; b < d; b++) c[b].writeHtml(a)
  5437. }, forEach: function (a, b, c) {
  5438. if (!(c || b && this.type != b)) var d = a(this);
  5439. if (!1 !== d) {
  5440. c = this.children;
  5441. for (var f = 0; f < c.length; f++) d = c[f], d.type == CKEDITOR.NODE_ELEMENT ? d.forEach(a, b) : b && d.type != b || a(d)
  5442. }
  5443. }, getFilterContext: function (a) {
  5444. return a ||
  5445. {}
  5446. }
  5447. }
  5448. })();
  5449. "use strict";
  5450. (function () {
  5451. function a() {
  5452. this.rules = []
  5453. }
  5454. function d(b, c, d, g) {
  5455. var k, h;
  5456. for (k in c) (h = b[k]) || (h = b[k] = new a), h.add(c[k], d, g)
  5457. }
  5458. CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({
  5459. $: function (b) {
  5460. this.id = CKEDITOR.tools.getNextNumber();
  5461. this.elementNameRules = new a;
  5462. this.attributeNameRules = new a;
  5463. this.elementsRules = {};
  5464. this.attributesRules = {};
  5465. this.textRules = new a;
  5466. this.commentRules = new a;
  5467. this.rootRules = new a;
  5468. b && this.addRules(b, 10)
  5469. }, proto: {
  5470. addRules: function (a, c) {
  5471. var f;
  5472. "number" == typeof c ? f = c : c && "priority" in c && (f =
  5473. c.priority);
  5474. "number" != typeof f && (f = 10);
  5475. "object" != typeof c && (c = {});
  5476. a.elementNames && this.elementNameRules.addMany(a.elementNames, f, c);
  5477. a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, f, c);
  5478. a.elements && d(this.elementsRules, a.elements, f, c);
  5479. a.attributes && d(this.attributesRules, a.attributes, f, c);
  5480. a.text && this.textRules.add(a.text, f, c);
  5481. a.comment && this.commentRules.add(a.comment, f, c);
  5482. a.root && this.rootRules.add(a.root, f, c)
  5483. }, applyTo: function (a) {
  5484. a.filter(this)
  5485. }, onElementName: function (a, c) {
  5486. return this.elementNameRules.execOnName(a,
  5487. c)
  5488. }, onAttributeName: function (a, c) {
  5489. return this.attributeNameRules.execOnName(a, c)
  5490. }, onText: function (a, c, d) {
  5491. return this.textRules.exec(a, c, d)
  5492. }, onComment: function (a, c, d) {
  5493. return this.commentRules.exec(a, c, d)
  5494. }, onRoot: function (a, c) {
  5495. return this.rootRules.exec(a, c)
  5496. }, onElement: function (a, c) {
  5497. for (var d = [this.elementsRules["^"], this.elementsRules[c.name], this.elementsRules.$], g, k = 0; 3 > k; k++) if (g = d[k]) {
  5498. g = g.exec(a, c, this);
  5499. if (!1 === g) return null;
  5500. if (g && g != c) return this.onNode(a, g);
  5501. if (c.parent && !c.name) break
  5502. }
  5503. return c
  5504. },
  5505. onNode: function (a, c) {
  5506. var d = c.type;
  5507. return d == CKEDITOR.NODE_ELEMENT ? this.onElement(a, c) : d == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(a, c.value)) : d == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(a, c.value)) : null
  5508. }, onAttribute: function (a, c, d, g) {
  5509. return (d = this.attributesRules[d]) ? d.exec(a, g, c, this) : g
  5510. }
  5511. }
  5512. });
  5513. CKEDITOR.htmlParser.filterRulesGroup = a;
  5514. a.prototype = {
  5515. add: function (a, c, d) {
  5516. this.rules.splice(this.findIndex(c), 0, {value: a, priority: c, options: d})
  5517. }, addMany: function (a,
  5518. c, d) {
  5519. for (var g = [this.findIndex(c), 0], k = 0, h = a.length; k < h; k++) g.push({
  5520. value: a[k],
  5521. priority: c,
  5522. options: d
  5523. });
  5524. this.rules.splice.apply(this.rules, g)
  5525. }, findIndex: function (a) {
  5526. for (var c = this.rules, d = c.length - 1; 0 <= d && a < c[d].priority;) d--;
  5527. return d + 1
  5528. }, exec: function (a, c) {
  5529. var d = c instanceof CKEDITOR.htmlParser.node || c instanceof CKEDITOR.htmlParser.fragment,
  5530. g = Array.prototype.slice.call(arguments, 1), k = this.rules, h = k.length, p, q, e, y;
  5531. for (y = 0; y < h; y++) if (d && (p = c.type, q = c.name), e = k[y], !(a.nonEditable && !e.options.applyToAll ||
  5532. a.nestedEditable && e.options.excludeNestedEditable)) {
  5533. e = e.value.apply(null, g);
  5534. if (!1 === e || d && e && (e.name != q || e.type != p)) return e;
  5535. null != e && (g[0] = c = e)
  5536. }
  5537. return c
  5538. }, execOnName: function (a, c) {
  5539. for (var d = 0, g = this.rules, k = g.length, h; c && d < k; d++) h = g[d], a.nonEditable && !h.options.applyToAll || a.nestedEditable && h.options.excludeNestedEditable || (c = c.replace(h.value[0], h.value[1]));
  5540. return c
  5541. }
  5542. }
  5543. })();
  5544. (function () {
  5545. function a(a, d) {
  5546. function e(a) {
  5547. return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") : new CKEDITOR.htmlParser.element("br", {"data-cke-bogus": 1})
  5548. }
  5549. function l(a, d) {
  5550. return function (f) {
  5551. if (f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  5552. var l = [], n = b(f), D, G;
  5553. if (n) for (t(n, 1) && l.push(n); n;) g(n) && (D = c(n)) && t(D) && ((G = c(D)) && !g(G) ? l.push(D) : (e(z).insertAfter(D), D.remove())), n = n.previous;
  5554. for (n = 0; n < l.length; n++) l[n].remove();
  5555. if (l = !a || !1 !== ("function" == typeof d ? d(f) : d)) z || CKEDITOR.env.needsBrFiller ||
  5556. f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT ? z || CKEDITOR.env.needsBrFiller || !(7 < document.documentMode || f.name in CKEDITOR.dtd.tr || f.name in CKEDITOR.dtd.$listItem) ? (l = b(f), l = !l || "form" == f.name && "input" == l.name) : l = !1 : l = !1;
  5557. l && f.add(e(a))
  5558. }
  5559. }
  5560. }
  5561. function t(a, b) {
  5562. if ((!z || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && "br" == a.name && !a.attributes["data-cke-eol"]) return !0;
  5563. var c;
  5564. return a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(w)) && (c.index && ((new CKEDITOR.htmlParser.text(a.value.substring(0, c.index))).insertBefore(a),
  5565. a.value = c[0]), !CKEDITOR.env.needsBrFiller && z && (!b || a.parent.name in B) || !z && ((c = a.previous) && "br" == c.name || !c || g(c))) ? !0 : !1
  5566. }
  5567. var D = {elements: {}}, z = "html" == d, B = CKEDITOR.tools.extend({}, C), h;
  5568. for (h in B) "#" in n[h] || delete B[h];
  5569. for (h in B) D.elements[h] = l(z, a.config.fillEmptyBlocks);
  5570. D.root = l(z, !1);
  5571. D.elements.br = function (a) {
  5572. return function (b) {
  5573. if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  5574. var d = b.attributes;
  5575. if ("data-cke-bogus" in d || "data-cke-eol" in d) delete d["data-cke-bogus"]; else {
  5576. for (d = b.next; d && f(d);) d =
  5577. d.next;
  5578. var l = c(b);
  5579. !d && g(b.parent) ? k(b.parent, e(a)) : g(d) && l && !g(l) && e(a).insertBefore(d)
  5580. }
  5581. }
  5582. }
  5583. }(z);
  5584. return D
  5585. }
  5586. function d(a, b) {
  5587. return a != CKEDITOR.ENTER_BR && !1 !== b ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
  5588. }
  5589. function b(a) {
  5590. for (a = a.children[a.children.length - 1]; a && f(a);) a = a.previous;
  5591. return a
  5592. }
  5593. function c(a) {
  5594. for (a = a.previous; a && f(a);) a = a.previous;
  5595. return a
  5596. }
  5597. function f(a) {
  5598. return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"]
  5599. }
  5600. function g(a) {
  5601. return a &&
  5602. (a.type == CKEDITOR.NODE_ELEMENT && a.name in C || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  5603. }
  5604. function k(a, b) {
  5605. var c = a.children[a.children.length - 1];
  5606. a.children.push(b);
  5607. b.parent = a;
  5608. c && (c.next = b, b.previous = c)
  5609. }
  5610. function h(a) {
  5611. a = a.attributes;
  5612. "false" != a.contenteditable && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
  5613. a.contenteditable = "false"
  5614. }
  5615. function p(a) {
  5616. a = a.attributes;
  5617. switch (a["data-cke-editable"]) {
  5618. case "true":
  5619. a.contenteditable = "true";
  5620. break;
  5621. case "1":
  5622. delete a.contenteditable
  5623. }
  5624. }
  5625. function q(a) {
  5626. return a.replace(D,
  5627. function (a, b, c) {
  5628. return "\x3c" + b + c.replace(z, function (a, b) {
  5629. return I.test(b) && -1 == c.indexOf("data-cke-saved-" + b) ? " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a : a
  5630. }) + "\x3e"
  5631. })
  5632. }
  5633. function e(a, b) {
  5634. return a.replace(b, function (a, b, c) {
  5635. 0 === a.indexOf("\x3ctextarea") && (a = b + u(c).replace(/</g, "\x26lt;").replace(/>/g, "\x26gt;") + "\x3c/textarea\x3e");
  5636. return "\x3ccke:encoded\x3e" + encodeURIComponent(a) + "\x3c/cke:encoded\x3e"
  5637. })
  5638. }
  5639. function y(a) {
  5640. return a.replace(l, function (a, b) {
  5641. return decodeURIComponent(b)
  5642. })
  5643. }
  5644. function v(a) {
  5645. return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,
  5646. function (a) {
  5647. return "\x3c!--" + H + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\x3e"
  5648. })
  5649. }
  5650. function x(a) {
  5651. return CKEDITOR.tools.array.reduce(a.split(""), function (a, b) {
  5652. var c = b.toLowerCase(), d = b.toUpperCase(), e = F(c);
  5653. c !== d && (e += "|" + F(d));
  5654. return a + ("(" + e + ")")
  5655. }, "")
  5656. }
  5657. function F(a) {
  5658. var b;
  5659. b = a.charCodeAt(0);
  5660. var c = b.toString(16);
  5661. b = {
  5662. htmlCode: "\x26#" + b + ";?",
  5663. hex: "\x26#x0*" + c + ";?",
  5664. entity: {"\x3c": "\x26lt;", "\x3e": "\x26gt;", ":": "\x26colon;"}[a]
  5665. };
  5666. for (var d in b) b[d] && (a += "|" + b[d]);
  5667. return a
  5668. }
  5669. function u(a) {
  5670. return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,
  5671. function (a, b) {
  5672. return decodeURIComponent(b)
  5673. })
  5674. }
  5675. function m(a, b) {
  5676. var c = b._.dataStore;
  5677. return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g, function (a, b) {
  5678. return decodeURIComponent(b)
  5679. }).replace(/\{cke_protected_(\d+)\}/g, function (a, b) {
  5680. return c && c[b] || ""
  5681. })
  5682. }
  5683. function M(a, b) {
  5684. var c = [], d = b.config.protectedSource, e = b._.dataStore || (b._.dataStore = {id: 1}),
  5685. f = /<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,
  5686. d = [/<script[\s\S]*?(<\/script>|$)/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(d);
  5687. a = a.replace(/\x3c!--[\s\S]*?--\x3e/g,
  5688. function (a) {
  5689. return "\x3c!--{cke_tempcomment}" + (c.push(a) - 1) + "--\x3e"
  5690. });
  5691. for (var l = 0; l < d.length; l++) a = a.replace(d[l], function (a) {
  5692. a = a.replace(f, function (a, b, d) {
  5693. return c[d]
  5694. });
  5695. return /cke_temp(comment)?/.test(a) ? a : "\x3c!--{cke_temp}" + (c.push(a) - 1) + "--\x3e"
  5696. });
  5697. a = a.replace(f, function (a, b, d) {
  5698. return "\x3c!--" + H + (b ? "{C}" : "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "--\x3e"
  5699. });
  5700. a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, function (a) {
  5701. return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,
  5702. function (a, b) {
  5703. e[e.id] = decodeURIComponent(b);
  5704. return "{cke_protected_" + e.id++ + "}"
  5705. })
  5706. });
  5707. return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function (a, c, d, e) {
  5708. return "\x3c" + c + d + "\x3e" + m(u(e), b) + "\x3c/" + c + "\x3e"
  5709. })
  5710. }
  5711. CKEDITOR.htmlDataProcessor = function (b) {
  5712. var c, f, l = this;
  5713. this.editor = b;
  5714. this.dataFilter = c = new CKEDITOR.htmlParser.filter;
  5715. this.htmlFilter = f = new CKEDITOR.htmlParser.filter;
  5716. this.writer = new CKEDITOR.htmlParser.basicWriter;
  5717. c.addRules(L);
  5718. c.addRules(E, {applyToAll: !0});
  5719. c.addRules(a(b, "data"),
  5720. {applyToAll: !0});
  5721. f.addRules(N);
  5722. f.addRules(t, {applyToAll: !0});
  5723. f.addRules(a(b, "html"), {applyToAll: !0});
  5724. b.on("toHtml", function (a) {
  5725. a = a.data;
  5726. var c = a.dataValue, f, c = c.replace(K, ""), c = M(c, b), c = e(c, O), c = q(c), c = e(c, P),
  5727. c = c.replace(B, "$1cke:$2"), c = c.replace(J, "\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),
  5728. c = c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"),
  5729. c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + CKEDITOR.rnd + "-$2");
  5730. f = a.context || b.editable().getName();
  5731. var l;
  5732. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && "pre" ==
  5733. f && (f = "div", c = "\x3cpre\x3e" + c + "\x3c/pre\x3e", l = 1);
  5734. f = b.document.createElement(f);
  5735. f.setHtml("a" + c);
  5736. c = f.getHtml().substr(1);
  5737. c = c.replace(new RegExp("data-cke-" + CKEDITOR.rnd + "-", "ig"), "");
  5738. l && (c = c.replace(/^<pre>|<\/pre>$/gi, ""));
  5739. c = c.replace(A, "$1$2");
  5740. c = y(c);
  5741. c = u(c);
  5742. f = !1 === a.fixForBody ? !1 : d(a.enterMode, b.config.autoParagraph);
  5743. c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, f);
  5744. f && (l = c, !l.children.length && CKEDITOR.dtd[l.name][f] && (f = new CKEDITOR.htmlParser.element(f), l.add(f)));
  5745. a.dataValue = c
  5746. }, null, null,
  5747. 5);
  5748. b.on("toHtml", function (a) {
  5749. a.data.filter.applyTo(a.data.dataValue, !0, a.data.dontFilter, a.data.enterMode) && b.fire("dataFiltered")
  5750. }, null, null, 6);
  5751. b.on("toHtml", function (a) {
  5752. a.data.dataValue.filterChildren(l.dataFilter, !0)
  5753. }, null, null, 10);
  5754. b.on("toHtml", function (a) {
  5755. a = a.data;
  5756. var b = a.dataValue, c = new CKEDITOR.htmlParser.basicWriter;
  5757. b.writeChildrenHtml(c);
  5758. b = c.getHtml(!0);
  5759. a.dataValue = v(b)
  5760. }, null, null, 15);
  5761. b.on("toDataFormat", function (a) {
  5762. var c = a.data.dataValue;
  5763. a.data.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/^<br *\/?>/i,
  5764. ""));
  5765. a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, d(a.data.enterMode, b.config.autoParagraph))
  5766. }, null, null, 5);
  5767. b.on("toDataFormat", function (a) {
  5768. a.data.dataValue.filterChildren(l.htmlFilter, !0)
  5769. }, null, null, 10);
  5770. b.on("toDataFormat", function (a) {
  5771. a.data.filter.applyTo(a.data.dataValue, !1, !0)
  5772. }, null, null, 11);
  5773. b.on("toDataFormat", function (a) {
  5774. var c = a.data.dataValue, d = l.writer;
  5775. d.reset();
  5776. c.writeChildrenHtml(d);
  5777. c = d.getHtml(!0);
  5778. c = u(c);
  5779. c = m(c, b);
  5780. a.data.dataValue = c
  5781. }, null, null, 15)
  5782. };
  5783. CKEDITOR.htmlDataProcessor.prototype =
  5784. {
  5785. toHtml: function (a, b, c, d) {
  5786. var e = this.editor, f, l, n, g;
  5787. b && "object" == typeof b ? (f = b.context, c = b.fixForBody, d = b.dontFilter, l = b.filter, n = b.enterMode, g = b.protectedWhitespaces) : f = b;
  5788. f || null === f || (f = e.editable().getName());
  5789. return e.fire("toHtml", {
  5790. dataValue: a,
  5791. context: f,
  5792. fixForBody: c,
  5793. dontFilter: d,
  5794. filter: l || e.filter,
  5795. enterMode: n || e.enterMode,
  5796. protectedWhitespaces: g
  5797. }).dataValue
  5798. }, toDataFormat: function (a, b) {
  5799. var c, d, e;
  5800. b && (c = b.context, d = b.filter, e = b.enterMode);
  5801. c || null === c || (c = this.editor.editable().getName());
  5802. return this.editor.fire("toDataFormat",
  5803. {
  5804. dataValue: a,
  5805. filter: d || this.editor.filter,
  5806. context: c,
  5807. enterMode: e || this.editor.enterMode
  5808. }).dataValue
  5809. }
  5810. };
  5811. var w = /(?:&nbsp;|\xa0)$/, H = "{cke_protected}", n = CKEDITOR.dtd,
  5812. r = "caption colgroup col thead tfoot tbody".split(" "),
  5813. C = CKEDITOR.tools.extend({}, n.$blockLimit, n.$block), L = {elements: {input: h, textarea: h}}, E = {
  5814. attributeNames: [[/^on/, "data-cke-pa-on"], [/^srcdoc/, "data-cke-pa-srcdoc"], [/^data-cke-expando$/, ""]],
  5815. elements: {
  5816. iframe: function (a) {
  5817. if (a.attributes && a.attributes.src) {
  5818. var b = a.attributes.src.toLowerCase().replace(/[^a-z]/gi,
  5819. "");
  5820. if (0 === b.indexOf("javascript") || 0 === b.indexOf("data")) a.attributes["data-cke-pa-src"] = a.attributes.src, delete a.attributes.src
  5821. }
  5822. }
  5823. }
  5824. }, N = {
  5825. elements: {
  5826. embed: function (a) {
  5827. var b = a.parent;
  5828. if (b && "object" == b.name) {
  5829. var c = b.attributes.width, b = b.attributes.height;
  5830. c && (a.attributes.width = c);
  5831. b && (a.attributes.height = b)
  5832. }
  5833. }, a: function (a) {
  5834. var b = a.attributes;
  5835. if (!(a.children.length || b.name || b.id || a.attributes["data-cke-saved-name"])) return !1
  5836. }
  5837. }
  5838. }, t = {
  5839. elementNames: [[/^cke:/, ""], [/^\?xml:namespace$/, ""]], attributeNames: [[/^data-cke-(saved|pa)-/,
  5840. ""], [/^data-cke-.*/, ""], ["hidefocus", ""]], elements: {
  5841. $: function (a) {
  5842. var b = a.attributes;
  5843. if (b) {
  5844. if (b["data-cke-temp"]) return !1;
  5845. for (var c = ["name", "href", "src"], d, e = 0; e < c.length; e++) d = "data-cke-saved-" + c[e], d in b && delete b[c[e]]
  5846. }
  5847. return a
  5848. }, table: function (a) {
  5849. a.children.slice(0).sort(function (a, b) {
  5850. var c, d;
  5851. a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type && (c = CKEDITOR.tools.indexOf(r, a.name), d = CKEDITOR.tools.indexOf(r, b.name));
  5852. -1 < c && -1 < d && c != d || (c = a.parent ? a.getIndex() : -1, d = b.parent ? b.getIndex() : -1);
  5853. return c > d ?
  5854. 1 : -1
  5855. })
  5856. }, param: function (a) {
  5857. a.children = [];
  5858. a.isEmpty = !0;
  5859. return a
  5860. }, span: function (a) {
  5861. "Apple-style-span" == a.attributes["class"] && delete a.name
  5862. }, html: function (a) {
  5863. delete a.attributes.contenteditable;
  5864. delete a.attributes["class"]
  5865. }, body: function (a) {
  5866. delete a.attributes.spellcheck;
  5867. delete a.attributes.contenteditable
  5868. }, style: function (a) {
  5869. var b = a.children[0];
  5870. b && b.value && (b.value = CKEDITOR.tools.trim(b.value));
  5871. a.attributes.type || (a.attributes.type = "text/css")
  5872. }, title: function (a) {
  5873. var b = a.children[0];
  5874. !b && k(a, b = new CKEDITOR.htmlParser.text);
  5875. b.value = a.attributes["data-cke-title"] || ""
  5876. }, input: p, textarea: p
  5877. }, attributes: {
  5878. "class": function (a) {
  5879. return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || !1
  5880. }
  5881. }
  5882. };
  5883. CKEDITOR.env.ie && (t.attributes.style = function (a) {
  5884. return a.replace(/(^|;)([^\:]+)/g, function (a) {
  5885. return a.toLowerCase()
  5886. })
  5887. });
  5888. var D = /<(a|area|img|input|source)\b([^>]*)>/gi,
  5889. z = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi, I = /^(href|src|name)$/i,
  5890. P = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
  5891. O = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi, l = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
  5892. K = new RegExp("(" + x("\x3ccke:encoded\x3e") + "(.*?)" + x("\x3c/cke:encoded\x3e") + ")|(" + x("\x3c") + x("/") + "?" + x("cke:encoded\x3e") + ")", "gi"),
  5893. B = /(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,
  5894. A = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi, J = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi
  5895. })();
  5896. "use strict";
  5897. CKEDITOR.htmlParser.element = function (a, d) {
  5898. this.name = a;
  5899. this.attributes = d || {};
  5900. this.children = [];
  5901. var b = a || "", c = b.match(/^cke:(.*)/);
  5902. c && (b = c[1]);
  5903. b = !!(CKEDITOR.dtd.$nonBodyContent[b] || CKEDITOR.dtd.$block[b] || CKEDITOR.dtd.$listItem[b] || CKEDITOR.dtd.$tableContent[b] || CKEDITOR.dtd.$nonEditable[b] || "br" == b);
  5904. this.isEmpty = !!CKEDITOR.dtd.$empty[a];
  5905. this.isUnknown = !CKEDITOR.dtd[a];
  5906. this._ = {isBlockLike: b, hasInlineStarted: this.isEmpty || !b}
  5907. };
  5908. CKEDITOR.htmlParser.cssStyle = function (a) {
  5909. var d = {};
  5910. ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || "").replace(/&quot;/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function (a, c, f) {
  5911. "font-family" == c && (f = f.replace(/["']/g, ""));
  5912. d[c.toLowerCase()] = f
  5913. });
  5914. return {
  5915. rules: d, populate: function (a) {
  5916. var c = this.toString();
  5917. c && (a instanceof CKEDITOR.dom.element ? a.setAttribute("style", c) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = c : a.style = c)
  5918. }, toString: function () {
  5919. var a = [], c;
  5920. for (c in d) d[c] && a.push(c, ":", d[c], ";");
  5921. return a.join("")
  5922. }
  5923. }
  5924. };
  5925. (function () {
  5926. function a(a) {
  5927. return function (b) {
  5928. return b.type == CKEDITOR.NODE_ELEMENT && ("string" == typeof a ? b.name == a : b.name in a)
  5929. }
  5930. }
  5931. var d = function (a, b) {
  5932. a = a[0];
  5933. b = b[0];
  5934. return a < b ? -1 : a > b ? 1 : 0
  5935. }, b = CKEDITOR.htmlParser.fragment.prototype;
  5936. CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5937. type: CKEDITOR.NODE_ELEMENT, add: b.add, clone: function () {
  5938. return new CKEDITOR.htmlParser.element(this.name, this.attributes)
  5939. }, filter: function (a, b) {
  5940. var d = this, k, h;
  5941. b = d.getFilterContext(b);
  5942. if (!d.parent) a.onRoot(b,
  5943. d);
  5944. for (; ;) {
  5945. k = d.name;
  5946. if (!(h = a.onElementName(b, k))) return this.remove(), !1;
  5947. d.name = h;
  5948. if (!(d = a.onElement(b, d))) return this.remove(), !1;
  5949. if (d !== this) return this.replaceWith(d), !1;
  5950. if (d.name == k) break;
  5951. if (d.type != CKEDITOR.NODE_ELEMENT) return this.replaceWith(d), !1;
  5952. if (!d.name) return this.replaceWithChildren(), !1
  5953. }
  5954. k = d.attributes;
  5955. var p, q;
  5956. for (p in k) {
  5957. for (h = k[p]; ;) if (q = a.onAttributeName(b, p)) if (q != p) delete k[p], p = q; else break; else {
  5958. delete k[p];
  5959. break
  5960. }
  5961. q && (!1 === (h = a.onAttribute(b, d, q, h)) ? delete k[q] : k[q] = h)
  5962. }
  5963. d.isEmpty ||
  5964. this.filterChildren(a, !1, b);
  5965. return !0
  5966. }, filterChildren: b.filterChildren, writeHtml: function (a, b) {
  5967. b && this.filter(b);
  5968. var g = this.name, k = [], h = this.attributes, p, q;
  5969. a.openTag(g, h);
  5970. for (p in h) k.push([p, h[p]]);
  5971. a.sortAttributes && k.sort(d);
  5972. p = 0;
  5973. for (q = k.length; p < q; p++) h = k[p], a.attribute(h[0], h[1]);
  5974. a.openTagClose(g, this.isEmpty);
  5975. this.writeChildrenHtml(a);
  5976. this.isEmpty || a.closeTag(g)
  5977. }, writeChildrenHtml: b.writeChildrenHtml, replaceWithChildren: function () {
  5978. for (var a = this.children, b = a.length; b;) a[--b].insertAfter(this);
  5979. this.remove()
  5980. }, forEach: b.forEach, getFirst: function (b) {
  5981. if (!b) return this.children.length ? this.children[0] : null;
  5982. "function" != typeof b && (b = a(b));
  5983. for (var d = 0, g = this.children.length; d < g; ++d) if (b(this.children[d])) return this.children[d];
  5984. return null
  5985. }, getHtml: function () {
  5986. var a = new CKEDITOR.htmlParser.basicWriter;
  5987. this.writeChildrenHtml(a);
  5988. return a.getHtml()
  5989. }, setHtml: function (a) {
  5990. a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children;
  5991. for (var b = 0, d = a.length; b < d; ++b) a[b].parent = this
  5992. }, getOuterHtml: function () {
  5993. var a =
  5994. new CKEDITOR.htmlParser.basicWriter;
  5995. this.writeHtml(a);
  5996. return a.getHtml()
  5997. }, split: function (a) {
  5998. for (var b = this.children.splice(a, this.children.length - a), d = this.clone(), k = 0; k < b.length; ++k) b[k].parent = d;
  5999. d.children = b;
  6000. b[0] && (b[0].previous = null);
  6001. 0 < a && (this.children[a - 1].next = null);
  6002. this.parent.add(d, this.getIndex() + 1);
  6003. return d
  6004. }, find: function (a, b) {
  6005. void 0 === b && (b = !1);
  6006. var d = [], k;
  6007. for (k = 0; k < this.children.length; k++) {
  6008. var h = this.children[k];
  6009. "function" == typeof a && a(h) ? d.push(h) : "string" == typeof a && h.name === a && d.push(h);
  6010. b && h.find && (d = d.concat(h.find(a, b)))
  6011. }
  6012. return d
  6013. }, addClass: function (a) {
  6014. if (!this.hasClass(a)) {
  6015. var b = this.attributes["class"] || "";
  6016. this.attributes["class"] = b + (b ? " " : "") + a
  6017. }
  6018. }, removeClass: function (a) {
  6019. var b = this.attributes["class"];
  6020. b && ((b = CKEDITOR.tools.trim(b.replace(new RegExp("(?:\\s+|^)" + a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"])
  6021. }, hasClass: function (a) {
  6022. var b = this.attributes["class"];
  6023. return b ? (new RegExp("(?:^|\\s)" + a + "(?\x3d\\s|$)")).test(b) : !1
  6024. }, getFilterContext: function (a) {
  6025. var b =
  6026. [];
  6027. a || (a = {nonEditable: !1, nestedEditable: !1});
  6028. a.nonEditable || "false" != this.attributes.contenteditable ? a.nonEditable && !a.nestedEditable && "true" == this.attributes.contenteditable && b.push("nestedEditable", !0) : b.push("nonEditable", !0);
  6029. if (b.length) {
  6030. a = CKEDITOR.tools.copy(a);
  6031. for (var d = 0; d < b.length; d += 2) a[b[d]] = b[d + 1]
  6032. }
  6033. return a
  6034. }
  6035. }, !0)
  6036. })();
  6037. (function () {
  6038. var a = /{([^}]+)}/g;
  6039. CKEDITOR.template = function (a) {
  6040. this.source = String(a)
  6041. };
  6042. CKEDITOR.template.prototype.output = function (d, b) {
  6043. var c = this.source.replace(a, function (a, b) {
  6044. return void 0 !== d[b] ? d[b] : a
  6045. });
  6046. return b ? b.push(c) : c
  6047. }
  6048. })();
  6049. delete CKEDITOR.loadFullCore;
  6050. CKEDITOR.instances = {};
  6051. CKEDITOR.document = new CKEDITOR.dom.document(document);
  6052. CKEDITOR.add = function (a) {
  6053. function d() {
  6054. CKEDITOR.currentInstance == a && (CKEDITOR.currentInstance = null, CKEDITOR.fire("currentInstance"))
  6055. }
  6056. CKEDITOR.instances[a.name] = a;
  6057. a.on("focus", function () {
  6058. CKEDITOR.currentInstance != a && (CKEDITOR.currentInstance = a, CKEDITOR.fire("currentInstance"))
  6059. });
  6060. a.on("blur", d);
  6061. a.on("destroy", d);
  6062. CKEDITOR.fire("instance", null, a)
  6063. };
  6064. CKEDITOR.remove = function (a) {
  6065. delete CKEDITOR.instances[a.name]
  6066. };
  6067. (function () {
  6068. var a = {};
  6069. CKEDITOR.addTemplate = function (d, b) {
  6070. var c = a[d];
  6071. if (c) return c;
  6072. c = {name: d, source: b};
  6073. CKEDITOR.fire("template", c);
  6074. return a[d] = new CKEDITOR.template(c.source)
  6075. };
  6076. CKEDITOR.getTemplate = function (d) {
  6077. return a[d]
  6078. }
  6079. })();
  6080. (function () {
  6081. var a = [];
  6082. CKEDITOR.addCss = function (d) {
  6083. a.push(d)
  6084. };
  6085. CKEDITOR.getCss = function () {
  6086. return a.join("\n")
  6087. }
  6088. })();
  6089. CKEDITOR.on("instanceDestroyed", function () {
  6090. CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset")
  6091. });
  6092. CKEDITOR.TRISTATE_ON = 1;
  6093. CKEDITOR.TRISTATE_OFF = 2;
  6094. CKEDITOR.TRISTATE_DISABLED = 0;
  6095. (function () {
  6096. CKEDITOR.inline = function (a, d) {
  6097. if (!CKEDITOR.env.isCompatible) return null;
  6098. a = CKEDITOR.dom.element.get(a);
  6099. if (a.getEditor()) throw'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  6100. var b = new CKEDITOR.editor(d, a, CKEDITOR.ELEMENT_MODE_INLINE), c = a.is("textarea") ? a : null;
  6101. c ? (b.setData(c.getValue(), null, !0), a = CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"' + !!b.readOnly + '" class\x3d"cke_textarea_inline"\x3e' + c.getValue() + "\x3c/div\x3e", CKEDITOR.document),
  6102. a.insertAfter(c), c.hide(), c.$.form && b._attachToForm()) : b.setData(a.getHtml(), null, !0);
  6103. b.on("loaded", function () {
  6104. b.fire("uiReady");
  6105. b.editable(a);
  6106. b.container = a;
  6107. b.ui.contentsElement = a;
  6108. b.setData(b.getData(1));
  6109. b.resetDirty();
  6110. b.fire("contentDom");
  6111. b.mode = "wysiwyg";
  6112. b.fire("mode");
  6113. b.status = "ready";
  6114. b.fireOnce("instanceReady");
  6115. CKEDITOR.fire("instanceReady", null, b)
  6116. }, null, null, 1E4);
  6117. b.on("destroy", function () {
  6118. c && (b.container.clearCustomData(), b.container.remove(), c.show());
  6119. b.element.clearCustomData();
  6120. delete b.element
  6121. });
  6122. return b
  6123. };
  6124. CKEDITOR.inlineAll = function () {
  6125. var a, d, b;
  6126. for (b in CKEDITOR.dtd.$editable) for (var c = CKEDITOR.document.getElementsByTag(b), f = 0, g = c.count(); f < g; f++) a = c.getItem(f), "true" == a.getAttribute("contenteditable") && (d = {
  6127. element: a,
  6128. config: {}
  6129. }, !1 !== CKEDITOR.fire("inline", d) && CKEDITOR.inline(a, d.config))
  6130. };
  6131. CKEDITOR.domReady(function () {
  6132. !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll()
  6133. })
  6134. })();
  6135. CKEDITOR.replaceClass = "ckeditor";
  6136. (function () {
  6137. function a(a, f, g, k) {
  6138. if (!CKEDITOR.env.isCompatible) return null;
  6139. a = CKEDITOR.dom.element.get(a);
  6140. if (a.getEditor()) throw'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  6141. var h = new CKEDITOR.editor(f, a, k);
  6142. k == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle("visibility", "hidden"), h._.required = a.hasAttribute("required"), a.removeAttribute("required"));
  6143. g && h.setData(g, null, !0);
  6144. h.on("loaded", function () {
  6145. b(h);
  6146. k == CKEDITOR.ELEMENT_MODE_REPLACE && h.config.autoUpdateElement &&
  6147. a.$.form && h._attachToForm();
  6148. h.setMode(h.config.startupMode, function () {
  6149. h.resetDirty();
  6150. h.status = "ready";
  6151. h.fireOnce("instanceReady");
  6152. CKEDITOR.fire("instanceReady", null, h)
  6153. })
  6154. });
  6155. h.on("destroy", d);
  6156. return h
  6157. }
  6158. function d() {
  6159. var a = this.container, b = this.element;
  6160. a && (a.clearCustomData(), a.remove());
  6161. b && (b.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (b.show(), this._.required && b.setAttribute("required", "required")), delete this.element)
  6162. }
  6163. function b(a) {
  6164. var b = a.name, d = a.element, k = a.elementMode, h =
  6165. a.fire("uiSpace", {space: "top", html: ""}).html,
  6166. p = a.fire("uiSpace", {space: "bottom", html: ""}).html,
  6167. q = new CKEDITOR.template('\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"' + (a.title ? ' aria-labelledby\x3d"cke_{name}_arialbl"' : "") + "\x3e" + (a.title ? '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' : "") + '\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'),
  6168. b = CKEDITOR.dom.element.createFromHtml(q.output({
  6169. id: a.id,
  6170. name: b,
  6171. langDir: a.lang.dir,
  6172. langCode: a.langCode,
  6173. voiceLabel: a.title,
  6174. topHtml: h ? '\x3cspan id\x3d"' + a.ui.spaceId("top") + '" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e' + h + "\x3c/span\x3e" : "",
  6175. contentId: a.ui.spaceId("contents"),
  6176. bottomHtml: p ? '\x3cspan id\x3d"' + a.ui.spaceId("bottom") + '" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e' + p + "\x3c/span\x3e" : "",
  6177. outerEl: CKEDITOR.env.ie ? "span" : "div"
  6178. }));
  6179. k == CKEDITOR.ELEMENT_MODE_REPLACE ?
  6180. (d.hide(), b.insertAfter(d)) : d.append(b);
  6181. a.container = b;
  6182. a.ui.contentsElement = a.ui.space("contents");
  6183. h && a.ui.space("top").unselectable();
  6184. p && a.ui.space("bottom").unselectable();
  6185. d = a.config.width;
  6186. k = a.config.height;
  6187. d && b.setStyle("width", CKEDITOR.tools.cssLength(d));
  6188. k && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(k));
  6189. b.disableContextMenu();
  6190. CKEDITOR.env.webkit && b.on("focus", function () {
  6191. a.focus()
  6192. });
  6193. a.fireOnce("uiReady")
  6194. }
  6195. CKEDITOR.replace = function (b, d) {
  6196. return a(b, d, null, CKEDITOR.ELEMENT_MODE_REPLACE)
  6197. };
  6198. CKEDITOR.appendTo = function (b, d, g) {
  6199. return a(b, d, g, CKEDITOR.ELEMENT_MODE_APPENDTO)
  6200. };
  6201. CKEDITOR.replaceAll = function () {
  6202. for (var a = document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) {
  6203. var d = null, k = a[b];
  6204. if (k.name || k.id) {
  6205. if ("string" == typeof arguments[0]) {
  6206. if (!(new RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)")).test(k.className)) continue
  6207. } else if ("function" == typeof arguments[0] && (d = {}, !1 === arguments[0](k, d))) continue;
  6208. this.replace(k, d)
  6209. }
  6210. }
  6211. };
  6212. CKEDITOR.editor.prototype.addMode = function (a, b) {
  6213. (this._.modes || (this._.modes =
  6214. {}))[a] = b
  6215. };
  6216. CKEDITOR.editor.prototype.setMode = function (a, b) {
  6217. var d = this, k = this._.modes;
  6218. if (a != d.mode && k && k[a]) {
  6219. d.fire("beforeSetMode", a);
  6220. if (d.mode) {
  6221. var h = d.checkDirty(), k = d._.previousModeData, p, q = 0;
  6222. d.fire("beforeModeUnload");
  6223. d.editable(0);
  6224. d._.previousMode = d.mode;
  6225. d._.previousModeData = p = d.getData(1);
  6226. "source" == d.mode && k == p && (d.fire("lockSnapshot", {forceUpdate: !0}), q = 1);
  6227. d.ui.space("contents").setHtml("");
  6228. d.mode = ""
  6229. } else d._.previousModeData = d.getData(1);
  6230. this._.modes[a](function () {
  6231. d.mode = a;
  6232. void 0 !== h && !h &&
  6233. d.resetDirty();
  6234. q ? d.fire("unlockSnapshot") : "wysiwyg" == a && d.fire("saveSnapshot");
  6235. setTimeout(function () {
  6236. d.fire("mode");
  6237. b && b.call(d)
  6238. }, 0)
  6239. })
  6240. }
  6241. };
  6242. CKEDITOR.editor.prototype.resize = function (a, b, d, k) {
  6243. var h = this.container, p = this.ui.space("contents"),
  6244. q = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement;
  6245. k = k ? this.container.getFirst(function (a) {
  6246. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  6247. }) : h;
  6248. k.setSize("width", a, !0);
  6249. q && (q.style.width = "1%");
  6250. var e = (k.$.offsetHeight || 0) - (p.$.clientHeight ||
  6251. 0), h = Math.max(b - (d ? 0 : e), 0);
  6252. b = d ? b + e : b;
  6253. p.setStyle("height", h + "px");
  6254. q && (q.style.width = "100%");
  6255. this.fire("resize", {outerHeight: b, contentsHeight: h, outerWidth: a || k.getSize("width")})
  6256. };
  6257. CKEDITOR.editor.prototype.getResizable = function (a) {
  6258. return a ? this.ui.space("contents") : this.container
  6259. };
  6260. CKEDITOR.domReady(function () {
  6261. CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass)
  6262. })
  6263. })();
  6264. CKEDITOR.config.startupMode = "wysiwyg";
  6265. (function () {
  6266. function a(a) {
  6267. var b = a.editor, e = a.data.path, f = e.blockLimit, g = a.data.selection, h = g.getRanges()[0], t;
  6268. if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller) if (g = d(g, e)) g.appendBogus(), t = CKEDITOR.env.ie;
  6269. k(b, e.block, f) && h.collapsed && !h.getCommonAncestor().isReadOnly() && (e = h.clone(), e.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS), f = new CKEDITOR.dom.walker(e), f.guard = function (a) {
  6270. return !c(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly()
  6271. }, !f.checkForward() || e.checkStartOfBlock() && e.checkEndOfBlock()) &&
  6272. (b = h.fixBlock(!0, b.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p"), CKEDITOR.env.needsBrFiller || (b = b.getFirst(c)) && b.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/) && b.remove(), t = 1, a.cancel());
  6273. t && h.select()
  6274. }
  6275. function d(a, b) {
  6276. if (a.isFake) return 0;
  6277. var d = b.block || b.blockLimit, e = d && d.getLast(c);
  6278. if (!(!d || !d.isBlockBoundary() || e && e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary() || d.is("pre") || d.getBogus())) return d
  6279. }
  6280. function b(a) {
  6281. var b = a.data.getTarget();
  6282. b.is("input") &&
  6283. (b = b.getAttribute("type"), "submit" != b && "reset" != b || a.data.preventDefault())
  6284. }
  6285. function c(a) {
  6286. return e(a) && y(a)
  6287. }
  6288. function f(a, b) {
  6289. return function (c) {
  6290. var d = c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget;
  6291. (d = d && d.nodeType == CKEDITOR.NODE_ELEMENT ? new CKEDITOR.dom.element(d) : null) && (b.equals(d) || b.contains(d)) || a.call(this, c)
  6292. }
  6293. }
  6294. function g(a) {
  6295. function b(a) {
  6296. return function (b, e) {
  6297. e && b.type == CKEDITOR.NODE_ELEMENT && b.is(f) && (d = b);
  6298. if (!(e || !c(b) || a && x(b))) return !1
  6299. }
  6300. }
  6301. var d, e = a.getRanges()[0];
  6302. a = a.root;
  6303. var f = {table: 1, ul: 1, ol: 1, dl: 1};
  6304. if (e.startPath().contains(f)) {
  6305. var g = e.clone();
  6306. g.collapse(1);
  6307. g.setStartAt(a, CKEDITOR.POSITION_AFTER_START);
  6308. a = new CKEDITOR.dom.walker(g);
  6309. a.guard = b();
  6310. a.checkBackward();
  6311. if (d) return g = e.clone(), g.collapse(), g.setEndAt(d, CKEDITOR.POSITION_AFTER_END), a = new CKEDITOR.dom.walker(g), a.guard = b(!0), d = !1, a.checkForward(), d
  6312. }
  6313. return null
  6314. }
  6315. function k(a, b, c) {
  6316. return !1 !== a.config.autoParagraph && a.activeEnterMode != CKEDITOR.ENTER_BR && (a.editable().equals(c) && !b || b && "true" == b.getAttribute("contenteditable"))
  6317. }
  6318. function h(a) {
  6319. return a.activeEnterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? a.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
  6320. }
  6321. function p(a) {
  6322. var b = a.editor;
  6323. b.getSelection().scrollIntoView();
  6324. setTimeout(function () {
  6325. b.fire("saveSnapshot")
  6326. }, 0)
  6327. }
  6328. function q(a, b, c) {
  6329. var d = a.getCommonAncestor(b);
  6330. for (b = a = c ? b : a; (a = a.getParent()) && !d.equals(a) && 1 == a.getChildCount();) b = a;
  6331. b.remove()
  6332. }
  6333. var e, y, v, x, F, u, m, M, w, H;
  6334. CKEDITOR.editable = CKEDITOR.tools.createClass({
  6335. base: CKEDITOR.dom.element, $: function (a, b) {
  6336. this.base(b.$ ||
  6337. b);
  6338. this.editor = a;
  6339. this.status = "unloaded";
  6340. this.hasFocus = !1;
  6341. this.setup()
  6342. }, proto: {
  6343. focus: function () {
  6344. var a;
  6345. if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument().getActive(), this.contains(a))) {
  6346. a.focus();
  6347. return
  6348. }
  6349. CKEDITOR.env.edge && 14 < CKEDITOR.env.version && !this.hasFocus && this.getDocument().equals(CKEDITOR.document) && (this.editor._.previousScrollTop = this.$.scrollTop);
  6350. try {
  6351. if (!CKEDITOR.env.ie || CKEDITOR.env.edge && 14 < CKEDITOR.env.version || !this.getDocument().equals(CKEDITOR.document)) if (CKEDITOR.env.chrome) {
  6352. var b =
  6353. this.$.scrollTop;
  6354. this.$.focus();
  6355. this.$.scrollTop = b
  6356. } else this.$.focus(); else this.$.setActive()
  6357. } catch (c) {
  6358. if (!CKEDITOR.env.ie) throw c;
  6359. }
  6360. CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(), a.equals(this.getWindow().getFrame()) || this.getWindow().focus())
  6361. }, on: function (a, b) {
  6362. var c = Array.prototype.slice.call(arguments, 0);
  6363. CKEDITOR.env.ie && /^focus|blur$/.exec(a) && (a = "focus" == a ? "focusin" : "focusout", b = f(b, this), c[0] = a, c[1] = b);
  6364. return CKEDITOR.dom.element.prototype.on.apply(this, c)
  6365. }, attachListener: function (a) {
  6366. !this._.listeners &&
  6367. (this._.listeners = []);
  6368. var b = Array.prototype.slice.call(arguments, 1), b = a.on.apply(a, b);
  6369. this._.listeners.push(b);
  6370. return b
  6371. }, clearListeners: function () {
  6372. var a = this._.listeners;
  6373. try {
  6374. for (; a.length;) a.pop().removeListener()
  6375. } catch (b) {
  6376. }
  6377. }, restoreAttrs: function () {
  6378. var a = this._.attrChanges, b, c;
  6379. for (c in a) a.hasOwnProperty(c) && (b = a[c], null !== b ? this.setAttribute(c, b) : this.removeAttribute(c))
  6380. }, attachClass: function (a) {
  6381. var b = this.getCustomData("classes");
  6382. this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData("classes",
  6383. b), this.addClass(a))
  6384. }, changeAttr: function (a, b) {
  6385. var c = this.getAttribute(a);
  6386. b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._.attrChanges[a] = c), this.setAttribute(a, b))
  6387. }, insertText: function (a) {
  6388. this.editor.focus();
  6389. this.insertHtml(this.transformPlainTextToHtml(a), "text")
  6390. }, transformPlainTextToHtml: function (a) {
  6391. var b = this.editor.getSelection().getStartElement().hasAscendant("pre", !0) ? CKEDITOR.ENTER_BR : this.editor.activeEnterMode;
  6392. return CKEDITOR.tools.transformPlainTextToHtml(a,
  6393. b)
  6394. }, insertHtml: function (a, b, c) {
  6395. var d = this.editor;
  6396. d.focus();
  6397. d.fire("saveSnapshot");
  6398. c || (c = d.getSelection().getRanges()[0]);
  6399. u(this, b || "html", a, c);
  6400. c.select();
  6401. p(this);
  6402. this.editor.fire("afterInsertHtml", {})
  6403. }, insertHtmlIntoRange: function (a, b, c) {
  6404. u(this, c || "html", a, b);
  6405. this.editor.fire("afterInsertHtml", {intoRange: b})
  6406. }, insertElement: function (a, b) {
  6407. var d = this.editor;
  6408. d.focus();
  6409. d.fire("saveSnapshot");
  6410. var e = d.activeEnterMode, d = d.getSelection(), f = a.getName(), f = CKEDITOR.dtd.$block[f];
  6411. b || (b = d.getRanges()[0]);
  6412. this.insertElementIntoRange(a,
  6413. b) && (b.moveToPosition(a, CKEDITOR.POSITION_AFTER_END), f && ((f = a.getNext(function (a) {
  6414. return c(a) && !x(a)
  6415. })) && f.type == CKEDITOR.NODE_ELEMENT && f.is(CKEDITOR.dtd.$block) ? f.getDtd()["#"] ? b.moveToElementEditStart(f) : b.moveToElementEditEnd(a) : f || e == CKEDITOR.ENTER_BR || (f = b.fixBlock(!0, e == CKEDITOR.ENTER_DIV ? "div" : "p"), b.moveToElementEditStart(f))));
  6416. d.selectRanges([b]);
  6417. p(this)
  6418. }, insertElementIntoSelection: function (a) {
  6419. this.insertElement(a)
  6420. }, insertElementIntoRange: function (a, b) {
  6421. var c = this.editor, d = c.config.enterMode,
  6422. e = a.getName(), f = CKEDITOR.dtd.$block[e];
  6423. if (b.checkReadOnly()) return !1;
  6424. b.deleteContents(1);
  6425. b.startContainer.type == CKEDITOR.NODE_ELEMENT && (b.startContainer.is({
  6426. tr: 1,
  6427. table: 1,
  6428. tbody: 1,
  6429. thead: 1,
  6430. tfoot: 1
  6431. }) ? m(b) : b.startContainer.is(CKEDITOR.dtd.$list) && M(b));
  6432. var t, g;
  6433. if (f) for (; (t = b.getCommonAncestor(0, 1)) && (g = CKEDITOR.dtd[t.getName()]) && (!g || !g[e]);) t.getName() in CKEDITOR.dtd.span ? b.splitElement(t) : b.checkStartOfBlock() && b.checkEndOfBlock() ? (b.setStartBefore(t), b.collapse(!0), t.remove()) : b.splitBlock(d == CKEDITOR.ENTER_DIV ?
  6434. "div" : "p", c.editable());
  6435. b.insertNode(a);
  6436. return !0
  6437. }, setData: function (a, b) {
  6438. b || (a = this.editor.dataProcessor.toHtml(a));
  6439. this.setHtml(a);
  6440. this.fixInitialSelection();
  6441. "unloaded" == this.status && (this.status = "ready");
  6442. this.editor.fire("dataReady")
  6443. }, getData: function (a) {
  6444. var b = this.getHtml();
  6445. a || (b = this.editor.dataProcessor.toDataFormat(b));
  6446. return b
  6447. }, setReadOnly: function (a) {
  6448. this.setAttribute("contenteditable", !a)
  6449. }, detach: function () {
  6450. this.removeClass("cke_editable");
  6451. this.status = "detached";
  6452. var a = this.editor;
  6453. this._.detach();
  6454. delete a.document;
  6455. delete a.window
  6456. }, isInline: function () {
  6457. return this.getDocument().equals(CKEDITOR.document)
  6458. }, fixInitialSelection: function () {
  6459. function a() {
  6460. var b = c.getDocument().$, d = b.getSelection(), e;
  6461. a:if (d.anchorNode && d.anchorNode == c.$) e = !0; else {
  6462. if (CKEDITOR.env.webkit && (e = c.getDocument().getActive()) && e.equals(c) && !d.anchorNode) {
  6463. e = !0;
  6464. break a
  6465. }
  6466. e = void 0
  6467. }
  6468. e && (e = new CKEDITOR.dom.range(c), e.moveToElementEditStart(c), b = b.createRange(), b.setStart(e.startContainer.$, e.startOffset), b.collapse(!0), d.removeAllRanges(),
  6469. d.addRange(b))
  6470. }
  6471. function b() {
  6472. var a = c.getDocument().$, d = a.selection, e = c.getDocument().getActive();
  6473. "None" == d.type && e.equals(c) && (d = new CKEDITOR.dom.range(c), a = a.body.createTextRange(), d.moveToElementEditStart(c), d = d.startContainer, d.type != CKEDITOR.NODE_ELEMENT && (d = d.getParent()), a.moveToElementText(d.$), a.collapse(!0), a.select())
  6474. }
  6475. var c = this;
  6476. if (CKEDITOR.env.ie && (9 > CKEDITOR.env.version || CKEDITOR.env.quirks)) this.hasFocus && (this.focus(), b()); else if (this.hasFocus) this.focus(), a(); else this.once("focus",
  6477. function () {
  6478. a()
  6479. }, null, null, -999)
  6480. }, getHtmlFromRange: function (a) {
  6481. if (a.collapsed) return new CKEDITOR.dom.documentFragment(a.document);
  6482. a = {doc: this.getDocument(), range: a.clone()};
  6483. w.eol.detect(a, this);
  6484. w.bogus.exclude(a);
  6485. w.cell.shrink(a);
  6486. a.fragment = a.range.cloneContents();
  6487. w.tree.rebuild(a, this);
  6488. w.eol.fix(a, this);
  6489. return new CKEDITOR.dom.documentFragment(a.fragment.$)
  6490. }, extractHtmlFromRange: function (a, b) {
  6491. var c = H, d = {range: a, doc: a.document}, e = this.getHtmlFromRange(a);
  6492. if (a.collapsed) return a.optimize(), e;
  6493. a.enlarge(CKEDITOR.ENLARGE_INLINE,
  6494. 1);
  6495. c.table.detectPurge(d);
  6496. d.bookmark = a.createBookmark();
  6497. delete d.range;
  6498. var f = this.editor.createRange();
  6499. f.moveToPosition(d.bookmark.startNode, CKEDITOR.POSITION_BEFORE_START);
  6500. d.targetBookmark = f.createBookmark();
  6501. c.list.detectMerge(d, this);
  6502. c.table.detectRanges(d, this);
  6503. c.block.detectMerge(d, this);
  6504. d.tableContentsRanges ? (c.table.deleteRanges(d), a.moveToBookmark(d.bookmark), d.range = a) : (a.moveToBookmark(d.bookmark), d.range = a, a.extractContents(c.detectExtractMerge(d)));
  6505. a.moveToBookmark(d.targetBookmark);
  6506. a.optimize();
  6507. c.fixUneditableRangePosition(a);
  6508. c.list.merge(d, this);
  6509. c.table.purge(d, this);
  6510. c.block.merge(d, this);
  6511. if (b) {
  6512. c = a.startPath();
  6513. if (d = a.checkStartOfBlock() && a.checkEndOfBlock() && c.block && !a.root.equals(c.block)) {
  6514. a:{
  6515. var d = c.block.getElementsByTag("span"), f = 0, t;
  6516. if (d) for (; t = d.getItem(f++);) if (!y(t)) {
  6517. d = !0;
  6518. break a
  6519. }
  6520. d = !1
  6521. }
  6522. d = !d
  6523. }
  6524. d && (a.moveToPosition(c.block, CKEDITOR.POSITION_BEFORE_START), c.block.remove())
  6525. } else c.autoParagraph(this.editor, a), v(a.startContainer) && a.startContainer.appendBogus();
  6526. a.startContainer.mergeSiblings();
  6527. return e
  6528. }, setup: function () {
  6529. var a = this.editor;
  6530. this.attachListener(a, "beforeGetData", function () {
  6531. var b = this.getData();
  6532. this.is("textarea") || !1 !== a.config.ignoreEmptyParagraph && (b = b.replace(F, function (a, b) {
  6533. return b
  6534. }));
  6535. a.setData(b, null, 1)
  6536. }, this);
  6537. this.attachListener(a, "getSnapshot", function (a) {
  6538. a.data = this.getData(1)
  6539. }, this);
  6540. this.attachListener(a, "afterSetData", function () {
  6541. this.setData(a.getData(1))
  6542. }, this);
  6543. this.attachListener(a, "loadSnapshot", function (a) {
  6544. this.setData(a.data, 1)
  6545. }, this);
  6546. this.attachListener(a,
  6547. "beforeFocus", function () {
  6548. var b = a.getSelection();
  6549. (b = b && b.getNative()) && "Control" == b.type || this.focus()
  6550. }, this);
  6551. this.attachListener(a, "insertHtml", function (a) {
  6552. this.insertHtml(a.data.dataValue, a.data.mode, a.data.range)
  6553. }, this);
  6554. this.attachListener(a, "insertElement", function (a) {
  6555. this.insertElement(a.data)
  6556. }, this);
  6557. this.attachListener(a, "insertText", function (a) {
  6558. this.insertText(a.data)
  6559. }, this);
  6560. this.setReadOnly(a.readOnly);
  6561. this.attachClass("cke_editable");
  6562. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? this.attachClass("cke_editable_inline") :
  6563. a.elementMode != CKEDITOR.ELEMENT_MODE_REPLACE && a.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || this.attachClass("cke_editable_themed");
  6564. this.attachClass("cke_contents_" + a.config.contentsLangDirection);
  6565. a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly;
  6566. a.keystrokeHandler.attach(this);
  6567. this.on("blur", function () {
  6568. this.hasFocus = !1
  6569. }, null, null, -1);
  6570. this.on("focus", function () {
  6571. this.hasFocus = !0
  6572. }, null, null, -1);
  6573. if (CKEDITOR.env.webkit) this.on("scroll", function () {
  6574. a._.previousScrollTop = a.editable().$.scrollTop
  6575. }, null,
  6576. null, -1);
  6577. if (CKEDITOR.env.edge && 14 < CKEDITOR.env.version) {
  6578. var d = function () {
  6579. var b = a.editable();
  6580. null != a._.previousScrollTop && b.getDocument().equals(CKEDITOR.document) && (b.$.scrollTop = a._.previousScrollTop, a._.previousScrollTop = null, this.removeListener("scroll", d))
  6581. };
  6582. this.on("scroll", d)
  6583. }
  6584. a.focusManager.add(this);
  6585. this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, a.once("contentDom", function () {
  6586. a.focusManager.focus(this)
  6587. }, this));
  6588. this.isInline() && this.changeAttr("tabindex", a.tabIndex);
  6589. if (!this.is("textarea")) {
  6590. a.document =
  6591. this.getDocument();
  6592. a.window = this.getWindow();
  6593. var f = a.document;
  6594. this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker);
  6595. var h = a.config.contentsLangDirection;
  6596. this.getDirection(1) != h && this.changeAttr("dir", h);
  6597. var k = CKEDITOR.getCss();
  6598. if (k) {
  6599. var h = f.getHead(), m = h.getCustomData("stylesheet");
  6600. m ? k != m.getText() && (CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? m.$.styleSheet.cssText = k : m.setText(k)) : (k = f.appendStyleText(k), k = new CKEDITOR.dom.element(k.ownerNode || k.owningElement), h.setCustomData("stylesheet",
  6601. k), k.data("cke-temp", 1))
  6602. }
  6603. h = f.getCustomData("stylesheet_ref") || 0;
  6604. f.setCustomData("stylesheet_ref", h + 1);
  6605. this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling);
  6606. this.attachListener(this, "click", function (a) {
  6607. a = a.data;
  6608. var b = (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a");
  6609. b && 2 != a.$.button && b.isReadOnly() && a.preventDefault()
  6610. });
  6611. var t = {8: 1, 46: 1};
  6612. this.attachListener(a, "key", function (b) {
  6613. if (a.readOnly) return !0;
  6614. var c = b.data.domEvent.getKey(), d;
  6615. b = a.getSelection();
  6616. if (0 !== b.getRanges().length) {
  6617. if (c in
  6618. t) {
  6619. var f, k = b.getRanges()[0], l = k.startPath(), h, B, A, c = 8 == c;
  6620. CKEDITOR.env.ie && 11 > CKEDITOR.env.version && (f = b.getSelectedElement()) || (f = g(b)) ? (a.fire("saveSnapshot"), k.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START), f.remove(), k.select(), a.fire("saveSnapshot"), d = 1) : k.collapsed && ((h = l.block) && (A = h[c ? "getPrevious" : "getNext"](e)) && A.type == CKEDITOR.NODE_ELEMENT && A.is("table") && k[c ? "checkStartOfBlock" : "checkEndOfBlock"]() ? (a.fire("saveSnapshot"), k[c ? "checkEndOfBlock" : "checkStartOfBlock"]() && h.remove(), k["moveToElementEdit" +
  6621. (c ? "End" : "Start")](A), k.select(), a.fire("saveSnapshot"), d = 1) : l.blockLimit && l.blockLimit.is("td") && (B = l.blockLimit.getAscendant("table")) && k.checkBoundaryOfElement(B, c ? CKEDITOR.START : CKEDITOR.END) && (A = B[c ? "getPrevious" : "getNext"](e)) ? (a.fire("saveSnapshot"), k["moveToElementEdit" + (c ? "End" : "Start")](A), k.checkStartOfBlock() && k.checkEndOfBlock() ? A.remove() : k.select(), a.fire("saveSnapshot"), d = 1) : (B = l.contains(["td", "th", "caption"])) && k.checkBoundaryOfElement(B, c ? CKEDITOR.START : CKEDITOR.END) && (d = 1))
  6622. }
  6623. return !d
  6624. }
  6625. });
  6626. a.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && this.attachListener(this, "keyup", function (b) {
  6627. b.data.getKeystroke() in t && !this.getFirst(c) && (this.appendBogus(), b = a.createRange(), b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), b.select())
  6628. });
  6629. this.attachListener(this, "dblclick", function (b) {
  6630. if (a.readOnly) return !1;
  6631. b = {element: b.data.getTarget()};
  6632. a.fire("doubleclick", b)
  6633. });
  6634. CKEDITOR.env.ie && this.attachListener(this, "click", b);
  6635. CKEDITOR.env.ie && !CKEDITOR.env.edge || this.attachListener(this, "mousedown",
  6636. function (b) {
  6637. var c = b.data.getTarget();
  6638. c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly() && (a.getSelection().selectElement(c), c.is("input", "textarea", "select") && b.data.preventDefault())
  6639. });
  6640. CKEDITOR.env.edge && this.attachListener(this, "mouseup", function (b) {
  6641. (b = b.data.getTarget()) && b.is("img") && !b.isReadOnly() && a.getSelection().selectElement(b)
  6642. });
  6643. CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function (b) {
  6644. if (2 == b.data.$.button && (b = b.data.getTarget(), !b.getAscendant("table") && !b.getOuterHtml().replace(F,
  6645. ""))) {
  6646. var c = a.createRange();
  6647. c.moveToElementEditStart(b);
  6648. c.select(!0)
  6649. }
  6650. });
  6651. CKEDITOR.env.webkit && (this.attachListener(this, "click", function (a) {
  6652. a.data.getTarget().is("input", "select") && a.data.preventDefault()
  6653. }), this.attachListener(this, "mouseup", function (a) {
  6654. a.data.getTarget().is("input", "textarea") && a.data.preventDefault()
  6655. }));
  6656. CKEDITOR.env.webkit && this.attachListener(a, "key", function (b) {
  6657. if (a.readOnly) return !0;
  6658. var c = b.data.domEvent.getKey();
  6659. if (c in t && (b = a.getSelection(), 0 !== b.getRanges().length)) {
  6660. var c =
  6661. 8 == c, d = b.getRanges()[0];
  6662. b = d.startPath();
  6663. if (d.collapsed) a:{
  6664. var e = b.block;
  6665. if (e && d[c ? "checkStartOfBlock" : "checkEndOfBlock"]() && d.moveToClosestEditablePosition(e, !c) && d.collapsed) {
  6666. if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) {
  6667. var f = d.startContainer.getChild(d.startOffset - (c ? 1 : 0));
  6668. if (f && f.type == CKEDITOR.NODE_ELEMENT && f.is("hr")) {
  6669. a.fire("saveSnapshot");
  6670. f.remove();
  6671. b = !0;
  6672. break a
  6673. }
  6674. }
  6675. d = d.startPath().block;
  6676. if (!d || d && d.contains(e)) b = void 0; else {
  6677. a.fire("saveSnapshot");
  6678. var l;
  6679. (l = (c ? d : e).getBogus()) && l.remove();
  6680. l = a.getSelection();
  6681. f = l.createBookmarks();
  6682. (c ? e : d).moveChildren(c ? d : e, !1);
  6683. b.lastElement.mergeSiblings();
  6684. q(e, d, !c);
  6685. l.selectBookmarks(f);
  6686. b = !0
  6687. }
  6688. } else b = !1
  6689. } else c = d, l = b.block, d = c.endPath().block, l && d && !l.equals(d) ? (a.fire("saveSnapshot"), (e = l.getBogus()) && e.remove(), c.enlarge(CKEDITOR.ENLARGE_INLINE), c.deleteContents(), d.getParent() && (d.moveChildren(l, !1), b.lastElement.mergeSiblings(), q(l, d, !0)), c = a.getSelection().getRanges()[0], c.collapse(1), c.optimize(), "" === c.startContainer.getHtml() && c.startContainer.appendBogus(),
  6690. c.select(), b = !0) : b = !1;
  6691. if (!b) return;
  6692. a.getSelection().scrollIntoView();
  6693. a.fire("saveSnapshot");
  6694. return !1
  6695. }
  6696. }, this, null, 100)
  6697. }
  6698. }
  6699. }, _: {
  6700. detach: function () {
  6701. this.editor.setData(this.editor.getData(), 0, 1);
  6702. this.clearListeners();
  6703. this.restoreAttrs();
  6704. var a;
  6705. if (a = this.removeCustomData("classes")) for (; a.length;) this.removeClass(a.pop());
  6706. if (!this.is("textarea")) {
  6707. a = this.getDocument();
  6708. var b = a.getHead();
  6709. if (b.getCustomData("stylesheet")) {
  6710. var c = a.getCustomData("stylesheet_ref");
  6711. --c ? a.setCustomData("stylesheet_ref", c) : (a.removeCustomData("stylesheet_ref"),
  6712. b.removeCustomData("stylesheet").remove())
  6713. }
  6714. }
  6715. this.editor.fire("contentDomUnload");
  6716. delete this.editor
  6717. }
  6718. }
  6719. });
  6720. CKEDITOR.editor.prototype.editable = function (a) {
  6721. var b = this._.editable;
  6722. if (b && a) return 0;
  6723. arguments.length && (b = this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null));
  6724. return b
  6725. };
  6726. CKEDITOR.on("instanceLoaded", function (b) {
  6727. var c = b.editor;
  6728. c.on("insertElement", function (a) {
  6729. a = a.data;
  6730. a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") || a.is("textarea")) && ("false" != a.getAttribute("contentEditable") &&
  6731. a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1"), a.setAttribute("contentEditable", !1))
  6732. });
  6733. c.on("selectionChange", function (b) {
  6734. if (!c.readOnly) {
  6735. var d = c.getSelection();
  6736. d && !d.isLocked && (d = c.checkDirty(), c.fire("lockSnapshot"), a(b), c.fire("unlockSnapshot"), !d && c.resetDirty())
  6737. }
  6738. })
  6739. });
  6740. CKEDITOR.on("instanceCreated", function (a) {
  6741. var b = a.editor;
  6742. b.on("mode", function () {
  6743. var a = b.editable();
  6744. if (a && a.isInline()) {
  6745. var c = b.title;
  6746. a.changeAttr("role", "textbox");
  6747. a.changeAttr("aria-multiline", "true");
  6748. a.changeAttr("aria-label",
  6749. c);
  6750. c && a.changeAttr("title", c);
  6751. var d = b.fire("ariaEditorHelpLabel", {}).label;
  6752. if (d && (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents"))) {
  6753. var e = CKEDITOR.tools.getNextId(),
  6754. d = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + e + '" class\x3d"cke_voice_label"\x3e' + d + "\x3c/span\x3e");
  6755. c.append(d);
  6756. a.changeAttr("aria-describedby", e)
  6757. }
  6758. }
  6759. })
  6760. });
  6761. CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
  6762. e = CKEDITOR.dom.walker.whitespaces(!0);
  6763. y = CKEDITOR.dom.walker.bookmark(!1, !0);
  6764. v = CKEDITOR.dom.walker.empty();
  6765. x = CKEDITOR.dom.walker.bogus();
  6766. F = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
  6767. u = function () {
  6768. function a(b) {
  6769. return b.type == CKEDITOR.NODE_ELEMENT
  6770. }
  6771. function b(c, d) {
  6772. var e, f, g, t, k = [], z = d.range.startContainer;
  6773. e = d.range.startPath();
  6774. for (var z = D[z.getName()], h = 0, I = c.getChildren(), m = I.count(), q = -1, p = -1, P = 0, E = e.contains(D.$list); h < m; ++h) e = I.getItem(h), a(e) ? (g =
  6775. e.getName(), E && g in CKEDITOR.dtd.$list ? k = k.concat(b(e, d)) : (t = !!z[g], "br" != g || !e.data("cke-eol") || h && h != m - 1 || (P = (f = h ? k[h - 1].node : I.getItem(h + 1)) && (!a(f) || !f.is("br")), f = f && a(f) && D.$block[f.getName()]), -1 != q || t || (q = h), t || (p = h), k.push({
  6776. isElement: 1,
  6777. isLineBreak: P,
  6778. isBlock: e.isBlockBoundary(),
  6779. hasBlockSibling: f,
  6780. node: e,
  6781. name: g,
  6782. allowed: t
  6783. }), f = P = 0)) : k.push({isElement: 0, node: e, allowed: 1});
  6784. -1 < q && (k[q].firstNotAllowed = 1);
  6785. -1 < p && (k[p].lastNotAllowed = 1);
  6786. return k
  6787. }
  6788. function d(b, c) {
  6789. var e = [], f = b.getChildren(), g = f.count(),
  6790. t, k = 0, h = D[c], z = !b.is(D.$inline) || b.is("br");
  6791. for (z && e.push(" "); k < g; k++) t = f.getItem(k), a(t) && !t.is(h) ? e = e.concat(d(t, c)) : e.push(t);
  6792. z && e.push(" ");
  6793. return e
  6794. }
  6795. function e(b) {
  6796. return a(b.startContainer) && b.startContainer.getChild(b.startOffset - 1)
  6797. }
  6798. function f(b) {
  6799. return b && a(b) && (b.is(D.$removeEmpty) || b.is("a") && !b.isBlockBoundary())
  6800. }
  6801. function g(b, c, d, e) {
  6802. var f = b.clone(), t, k;
  6803. f.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  6804. (t = (new CKEDITOR.dom.walker(f)).next()) && a(t) && z[t.getName()] && (k = t.getPrevious()) && a(k) && !k.getParent().equals(b.startContainer) &&
  6805. d.contains(k) && e.contains(t) && t.isIdentical(k) && (t.moveChildren(k), t.remove(), g(b, c, d, e))
  6806. }
  6807. function t(b, c) {
  6808. function d(b, c) {
  6809. if (c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) return b.remove(), 1
  6810. }
  6811. var e = c.endContainer.getChild(c.endOffset), f = c.endContainer.getChild(c.endOffset - 1);
  6812. e && d(e, b[b.length - 1]);
  6813. f && d(f, b[0]) && (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse())
  6814. }
  6815. var D = CKEDITOR.dtd, z = {
  6816. p: 1,
  6817. div: 1,
  6818. h1: 1,
  6819. h2: 1,
  6820. h3: 1,
  6821. h4: 1,
  6822. h5: 1,
  6823. h6: 1,
  6824. ul: 1,
  6825. ol: 1,
  6826. li: 1,
  6827. pre: 1,
  6828. dl: 1,
  6829. blockquote: 1
  6830. }, I = {
  6831. p: 1, div: 1, h1: 1, h2: 1,
  6832. h3: 1, h4: 1, h5: 1, h6: 1
  6833. }, m = CKEDITOR.tools.extend({}, D.$inline);
  6834. delete m.br;
  6835. return function (z, l, K, B) {
  6836. var A = z.editor, J = !1;
  6837. "unfiltered_html" == l && (l = "html", J = !0);
  6838. if (!B.checkReadOnly()) {
  6839. var G = (new CKEDITOR.dom.elementPath(B.startContainer, B.root)).blockLimit || B.root;
  6840. z = {
  6841. type: l,
  6842. dontFilter: J,
  6843. editable: z,
  6844. editor: A,
  6845. range: B,
  6846. blockLimit: G,
  6847. mergeCandidates: [],
  6848. zombies: []
  6849. };
  6850. l = z.range;
  6851. B = z.mergeCandidates;
  6852. var q, p;
  6853. "text" == z.type && l.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (q = CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",
  6854. l.document), l.insertNode(q), l.setStartAfter(q));
  6855. J = new CKEDITOR.dom.elementPath(l.startContainer);
  6856. z.endPath = G = new CKEDITOR.dom.elementPath(l.endContainer);
  6857. if (!l.collapsed) {
  6858. var A = G.block || G.blockLimit, v = l.getCommonAncestor();
  6859. A && !A.equals(v) && !A.contains(v) && l.checkEndOfBlock() && z.zombies.push(A);
  6860. l.deleteContents()
  6861. }
  6862. for (; (p = e(l)) && a(p) && p.isBlockBoundary() && J.contains(p);) l.moveToPosition(p, CKEDITOR.POSITION_BEFORE_END);
  6863. g(l, z.blockLimit, J, G);
  6864. q && (l.setEndBefore(q), l.collapse(), q.remove());
  6865. q = l.startPath();
  6866. if (A = q.contains(f, !1, 1)) l.splitElement(A), z.inlineStylesRoot = A, z.inlineStylesPeak = q.lastElement;
  6867. q = l.createBookmark();
  6868. (A = q.startNode.getPrevious(c)) && a(A) && f(A) && B.push(A);
  6869. (A = q.startNode.getNext(c)) && a(A) && f(A) && B.push(A);
  6870. for (A = q.startNode; (A = A.getParent()) && f(A);) B.push(A);
  6871. l.moveToBookmark(q);
  6872. if (q = K) {
  6873. q = z.range;
  6874. if ("text" == z.type && z.inlineStylesRoot) {
  6875. p = z.inlineStylesPeak;
  6876. l = p.getDocument().createText("{cke-peak}");
  6877. for (B = z.inlineStylesRoot.getParent(); !p.equals(B);) l = l.appendTo(p.clone()), p = p.getParent();
  6878. K = l.getOuterHtml().split("{cke-peak}").join(K)
  6879. }
  6880. p = z.blockLimit.getName();
  6881. if (/^\s+|\s+$/.test(K) && "span" in CKEDITOR.dtd[p]) {
  6882. var u = '\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';
  6883. K = u + K + u
  6884. }
  6885. K = z.editor.dataProcessor.toHtml(K, {
  6886. context: null,
  6887. fixForBody: !1,
  6888. protectedWhitespaces: !!u,
  6889. dontFilter: z.dontFilter,
  6890. filter: z.editor.activeFilter,
  6891. enterMode: z.editor.activeEnterMode
  6892. });
  6893. p = q.document.createElement("body");
  6894. p.setHtml(K);
  6895. u && (p.getFirst().remove(), p.getLast().remove());
  6896. if ((u = q.startPath().block) && (1 !=
  6897. u.getChildCount() || !u.getBogus())) a:{
  6898. var y;
  6899. if (1 == p.getChildCount() && a(y = p.getFirst()) && y.is(I) && !y.hasAttribute("contenteditable")) {
  6900. u = y.getElementsByTag("*");
  6901. q = 0;
  6902. for (B = u.count(); q < B; q++) if (l = u.getItem(q), !l.is(m)) break a;
  6903. y.moveChildren(y.getParent(1));
  6904. y.remove()
  6905. }
  6906. }
  6907. z.dataWrapper = p;
  6908. q = K
  6909. }
  6910. if (q) {
  6911. y = z.range;
  6912. q = y.document;
  6913. var x;
  6914. p = z.blockLimit;
  6915. B = 0;
  6916. var w, u = [], F, T;
  6917. K = A = 0;
  6918. var H, M;
  6919. l = y.startContainer;
  6920. var J = z.endPath.elements[0], W, G = J.getPosition(l),
  6921. v = !!J.getCommonAncestor(l) && G != CKEDITOR.POSITION_IDENTICAL && !(G & CKEDITOR.POSITION_CONTAINS +
  6922. CKEDITOR.POSITION_IS_CONTAINED);
  6923. l = b(z.dataWrapper, z);
  6924. for (t(l, y); B < l.length; B++) {
  6925. G = l[B];
  6926. if (x = G.isLineBreak) {
  6927. x = y;
  6928. H = p;
  6929. var S = void 0, Y = void 0;
  6930. G.hasBlockSibling ? x = 1 : (S = x.startContainer.getAscendant(D.$block, 1)) && S.is({
  6931. div: 1,
  6932. p: 1
  6933. }) ? (Y = S.getPosition(H), Y == CKEDITOR.POSITION_IDENTICAL || Y == CKEDITOR.POSITION_CONTAINS ? x = 0 : (H = x.splitElement(S), x.moveToPosition(H, CKEDITOR.POSITION_AFTER_START), x = 1)) : x = 0
  6934. }
  6935. if (x) K = 0 < B; else {
  6936. x = y.startPath();
  6937. !G.isBlock && k(z.editor, x.block, x.blockLimit) && (T = h(z.editor)) && (T = q.createElement(T),
  6938. T.appendBogus(), y.insertNode(T), CKEDITOR.env.needsBrFiller && (w = T.getBogus()) && w.remove(), y.moveToPosition(T, CKEDITOR.POSITION_BEFORE_END));
  6939. if ((x = y.startPath().block) && !x.equals(F)) {
  6940. if (w = x.getBogus()) w.remove(), u.push(x);
  6941. F = x
  6942. }
  6943. G.firstNotAllowed && (A = 1);
  6944. if (A && G.isElement) {
  6945. x = y.startContainer;
  6946. for (H = null; x && !D[x.getName()][G.name];) {
  6947. if (x.equals(p)) {
  6948. x = null;
  6949. break
  6950. }
  6951. H = x;
  6952. x = x.getParent()
  6953. }
  6954. if (x) H && (M = y.splitElement(H), z.zombies.push(M), z.zombies.push(H)); else {
  6955. H = p.getName();
  6956. W = !B;
  6957. x = B == l.length - 1;
  6958. H = d(G.node, H);
  6959. for (var S =
  6960. [], Y = H.length, Z = 0, ba = void 0, ca = 0, U = -1; Z < Y; Z++) ba = H[Z], " " == ba ? (ca || W && !Z || (S.push(new CKEDITOR.dom.text(" ")), U = S.length), ca = 1) : (S.push(ba), ca = 0);
  6961. x && U == S.length && S.pop();
  6962. W = S
  6963. }
  6964. }
  6965. if (W) {
  6966. for (; x = W.pop();) y.insertNode(x);
  6967. W = 0
  6968. } else y.insertNode(G.node);
  6969. G.lastNotAllowed && B < l.length - 1 && ((M = v ? J : M) && y.setEndAt(M, CKEDITOR.POSITION_AFTER_START), A = 0);
  6970. y.collapse()
  6971. }
  6972. }
  6973. 1 != l.length ? w = !1 : (w = l[0], w = w.isElement && "false" == w.node.getAttribute("contenteditable"));
  6974. w && (K = !0, x = l[0].node, y.setStartAt(x, CKEDITOR.POSITION_BEFORE_START),
  6975. y.setEndAt(x, CKEDITOR.POSITION_AFTER_END));
  6976. z.dontMoveCaret = K;
  6977. z.bogusNeededBlocks = u
  6978. }
  6979. w = z.range;
  6980. var R;
  6981. M = z.bogusNeededBlocks;
  6982. for (W = w.createBookmark(); F = z.zombies.pop();) F.getParent() && (T = w.clone(), T.moveToElementEditStart(F), T.removeEmptyBlocksAtEnd());
  6983. if (M) for (; F = M.pop();) CKEDITOR.env.needsBrFiller ? F.appendBogus() : F.append(w.document.createText(" "));
  6984. for (; F = z.mergeCandidates.pop();) F.mergeSiblings();
  6985. w.moveToBookmark(W);
  6986. if (!z.dontMoveCaret) {
  6987. for (F = e(w); F && a(F) && !F.is(D.$empty);) {
  6988. if (F.isBlockBoundary()) w.moveToPosition(F,
  6989. CKEDITOR.POSITION_BEFORE_END); else {
  6990. if (f(F) && F.getHtml().match(/(\s|&nbsp;)$/g)) {
  6991. R = null;
  6992. break
  6993. }
  6994. R = w.clone();
  6995. R.moveToPosition(F, CKEDITOR.POSITION_BEFORE_END)
  6996. }
  6997. F = F.getLast(c)
  6998. }
  6999. R && w.moveToRange(R)
  7000. }
  7001. }
  7002. }
  7003. }();
  7004. m = function () {
  7005. function a(b) {
  7006. b = new CKEDITOR.dom.walker(b);
  7007. b.guard = function (a, b) {
  7008. if (b) return !1;
  7009. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent)
  7010. };
  7011. b.evaluator = function (a) {
  7012. return a.type == CKEDITOR.NODE_ELEMENT
  7013. };
  7014. return b
  7015. }
  7016. function b(a, c, d) {
  7017. c = a.getDocument().createElement(c);
  7018. a.append(c, d);
  7019. return c
  7020. }
  7021. function c(a) {
  7022. var b = a.count(), d;
  7023. for (b; 0 < b--;) d = a.getItem(b), CKEDITOR.tools.trim(d.getHtml()) || (d.appendBogus(), CKEDITOR.env.ie && 9 > CKEDITOR.env.version && d.getChildCount() && d.getFirst().remove())
  7024. }
  7025. return function (d) {
  7026. var e = d.startContainer, f = e.getAscendant("table", 1), t = !1;
  7027. c(f.getElementsByTag("td"));
  7028. c(f.getElementsByTag("th"));
  7029. f = d.clone();
  7030. f.setStart(e, 0);
  7031. f = a(f).lastBackward();
  7032. f || (f = d.clone(), f.setEndAt(e, CKEDITOR.POSITION_BEFORE_END), f = a(f).lastForward(), t = !0);
  7033. f || (f = e);
  7034. f.is("table") ? (d.setStartAt(f, CKEDITOR.POSITION_BEFORE_START),
  7035. d.collapse(!0), f.remove()) : (f.is({
  7036. tbody: 1,
  7037. thead: 1,
  7038. tfoot: 1
  7039. }) && (f = b(f, "tr", t)), f.is("tr") && (f = b(f, f.getParent().is("thead") ? "th" : "td", t)), (e = f.getBogus()) && e.remove(), d.moveToPosition(f, t ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END))
  7040. }
  7041. }();
  7042. M = function () {
  7043. function a(b) {
  7044. b = new CKEDITOR.dom.walker(b);
  7045. b.guard = function (a, b) {
  7046. if (b) return !1;
  7047. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$list) || a.is(CKEDITOR.dtd.$listItem)
  7048. };
  7049. b.evaluator = function (a) {
  7050. return a.type == CKEDITOR.NODE_ELEMENT &&
  7051. a.is(CKEDITOR.dtd.$listItem)
  7052. };
  7053. return b
  7054. }
  7055. return function (b) {
  7056. var c = b.startContainer, d = !1, e;
  7057. e = b.clone();
  7058. e.setStart(c, 0);
  7059. e = a(e).lastBackward();
  7060. e || (e = b.clone(), e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END), e = a(e).lastForward(), d = !0);
  7061. e || (e = c);
  7062. e.is(CKEDITOR.dtd.$list) ? (b.setStartAt(e, CKEDITOR.POSITION_BEFORE_START), b.collapse(!0), e.remove()) : ((c = e.getBogus()) && c.remove(), b.moveToPosition(e, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END), b.select())
  7063. }
  7064. }();
  7065. w = {
  7066. eol: {
  7067. detect: function (a, b) {
  7068. var c = a.range,
  7069. d = c.clone(), e = c.clone(), f = new CKEDITOR.dom.elementPath(c.startContainer, b),
  7070. t = new CKEDITOR.dom.elementPath(c.endContainer, b);
  7071. d.collapse(1);
  7072. e.collapse();
  7073. f.block && d.checkBoundaryOfElement(f.block, CKEDITOR.END) && (c.setStartAfter(f.block), a.prependEolBr = 1);
  7074. t.block && e.checkBoundaryOfElement(t.block, CKEDITOR.START) && (c.setEndBefore(t.block), a.appendEolBr = 1)
  7075. }, fix: function (a, b) {
  7076. var c = b.getDocument(), d;
  7077. a.appendEolBr && (d = this.createEolBr(c), a.fragment.append(d));
  7078. !a.prependEolBr || d && !d.getPrevious() || a.fragment.append(this.createEolBr(c),
  7079. 1)
  7080. }, createEolBr: function (a) {
  7081. return a.createElement("br", {attributes: {"data-cke-eol": 1}})
  7082. }
  7083. }, bogus: {
  7084. exclude: function (a) {
  7085. var b = a.range.getBoundaryNodes(), c = b.startNode, b = b.endNode;
  7086. !b || !x(b) || c && c.equals(b) || a.range.setEndBefore(b)
  7087. }
  7088. }, tree: {
  7089. rebuild: function (a, b) {
  7090. var c = a.range, d = c.getCommonAncestor(), e = new CKEDITOR.dom.elementPath(d, b),
  7091. f = new CKEDITOR.dom.elementPath(c.startContainer, b),
  7092. c = new CKEDITOR.dom.elementPath(c.endContainer, b), t;
  7093. d.type == CKEDITOR.NODE_TEXT && (d = d.getParent());
  7094. if (e.blockLimit.is({
  7095. tr: 1,
  7096. table: 1
  7097. })) {
  7098. var g = e.contains("table").getParent();
  7099. t = function (a) {
  7100. return !a.equals(g)
  7101. }
  7102. } else if (e.block && e.block.is(CKEDITOR.dtd.$listItem) && (f = f.contains(CKEDITOR.dtd.$list), c = c.contains(CKEDITOR.dtd.$list), !f.equals(c))) {
  7103. var z = e.contains(CKEDITOR.dtd.$list).getParent();
  7104. t = function (a) {
  7105. return !a.equals(z)
  7106. }
  7107. }
  7108. t || (t = function (a) {
  7109. return !a.equals(e.block) && !a.equals(e.blockLimit)
  7110. });
  7111. this.rebuildFragment(a, b, d, t)
  7112. }, rebuildFragment: function (a, b, c, d) {
  7113. for (var e; c && !c.equals(b) && d(c);) e = c.clone(0, 1), a.fragment.appendTo(e),
  7114. a.fragment = e, c = c.getParent()
  7115. }
  7116. }, cell: {
  7117. shrink: function (a) {
  7118. a = a.range;
  7119. var b = a.startContainer, c = a.endContainer, d = a.startOffset, e = a.endOffset;
  7120. b.type == CKEDITOR.NODE_ELEMENT && b.equals(c) && b.is("tr") && ++d == e && a.shrink(CKEDITOR.SHRINK_TEXT)
  7121. }
  7122. }
  7123. };
  7124. H = function () {
  7125. function a(b, c) {
  7126. var d = b.getParent();
  7127. if (d.is(CKEDITOR.dtd.$inline)) b[c ? "insertBefore" : "insertAfter"](d)
  7128. }
  7129. function b(c, d, e) {
  7130. a(d);
  7131. a(e, 1);
  7132. for (var f; f = e.getNext();) f.insertAfter(d), d = f;
  7133. v(c) && c.remove()
  7134. }
  7135. function c(a, b) {
  7136. var d = new CKEDITOR.dom.range(a);
  7137. d.setStartAfter(b.startNode);
  7138. d.setEndBefore(b.endNode);
  7139. return d
  7140. }
  7141. return {
  7142. list: {
  7143. detectMerge: function (a, b) {
  7144. var d = c(b, a.bookmark), e = d.startPath(), f = d.endPath(),
  7145. g = e.contains(CKEDITOR.dtd.$list), k = f.contains(CKEDITOR.dtd.$list);
  7146. a.mergeList = g && k && g.getParent().equals(k.getParent()) && !g.equals(k);
  7147. a.mergeListItems = e.block && f.block && e.block.is(CKEDITOR.dtd.$listItem) && f.block.is(CKEDITOR.dtd.$listItem);
  7148. if (a.mergeList || a.mergeListItems) d = d.clone(), d.setStartBefore(a.bookmark.startNode), d.setEndAfter(a.bookmark.endNode), a.mergeListBookmark =
  7149. d.createBookmark()
  7150. }, merge: function (a, c) {
  7151. if (a.mergeListBookmark) {
  7152. var d = a.mergeListBookmark.startNode, e = a.mergeListBookmark.endNode,
  7153. f = new CKEDITOR.dom.elementPath(d, c), g = new CKEDITOR.dom.elementPath(e, c);
  7154. if (a.mergeList) {
  7155. var k = f.contains(CKEDITOR.dtd.$list), h = g.contains(CKEDITOR.dtd.$list);
  7156. k.equals(h) || (h.moveChildren(k), h.remove())
  7157. }
  7158. a.mergeListItems && (f = f.contains(CKEDITOR.dtd.$listItem), g = g.contains(CKEDITOR.dtd.$listItem), f.equals(g) || b(g, d, e));
  7159. d.remove();
  7160. e.remove()
  7161. }
  7162. }
  7163. }, block: {
  7164. detectMerge: function (a,
  7165. b) {
  7166. if (!a.tableContentsRanges && !a.mergeListBookmark) {
  7167. var c = new CKEDITOR.dom.range(b);
  7168. c.setStartBefore(a.bookmark.startNode);
  7169. c.setEndAfter(a.bookmark.endNode);
  7170. a.mergeBlockBookmark = c.createBookmark()
  7171. }
  7172. }, merge: function (a, c) {
  7173. if (a.mergeBlockBookmark && !a.purgeTableBookmark) {
  7174. var d = a.mergeBlockBookmark.startNode, e = a.mergeBlockBookmark.endNode,
  7175. f = new CKEDITOR.dom.elementPath(d, c), g = new CKEDITOR.dom.elementPath(e, c),
  7176. f = f.block, g = g.block;
  7177. f && g && !f.equals(g) && b(g, d, e);
  7178. d.remove();
  7179. e.remove()
  7180. }
  7181. }
  7182. }, table: function () {
  7183. function a(c) {
  7184. var e =
  7185. [], f, g = new CKEDITOR.dom.walker(c), k = c.startPath().contains(d),
  7186. h = c.endPath().contains(d), l = {};
  7187. g.guard = function (a, g) {
  7188. if (a.type == CKEDITOR.NODE_ELEMENT) {
  7189. var A = "visited_" + (g ? "out" : "in");
  7190. if (a.getCustomData(A)) return;
  7191. CKEDITOR.dom.element.setMarker(l, a, A, 1)
  7192. }
  7193. if (g && k && a.equals(k)) f = c.clone(), f.setEndAt(k, CKEDITOR.POSITION_BEFORE_END), e.push(f); else if (!g && h && a.equals(h)) f = c.clone(), f.setStartAt(h, CKEDITOR.POSITION_AFTER_START), e.push(f); else {
  7194. if (A = !g) A = a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && (!k || b(a, k)) && (!h ||
  7195. b(a, h));
  7196. if (!A && (A = g)) if (a.is(d)) var A = k && k.getAscendant("table", !0),
  7197. I = h && h.getAscendant("table", !0), m = a.getAscendant("table", !0),
  7198. A = A && A.contains(m) || I && I.contains(m); else A = void 0;
  7199. A && (f = c.clone(), f.selectNodeContents(a), e.push(f))
  7200. }
  7201. };
  7202. g.lastForward();
  7203. CKEDITOR.dom.element.clearAllMarkers(l);
  7204. return e
  7205. }
  7206. function b(a, c) {
  7207. var d = CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED, e = a.getPosition(c);
  7208. return e === CKEDITOR.POSITION_IDENTICAL ? !1 : 0 === (e & d)
  7209. }
  7210. var d = {td: 1, th: 1, caption: 1};
  7211. return {
  7212. detectPurge: function (a) {
  7213. var b =
  7214. a.range, c = b.clone();
  7215. c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  7216. var c = new CKEDITOR.dom.walker(c), e = 0;
  7217. c.evaluator = function (a) {
  7218. a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && ++e
  7219. };
  7220. c.checkForward();
  7221. if (1 < e) {
  7222. var c = b.startPath().contains("table"), f = b.endPath().contains("table");
  7223. c && f && b.checkBoundaryOfElement(c, CKEDITOR.START) && b.checkBoundaryOfElement(f, CKEDITOR.END) && (b = a.range.clone(), b.setStartBefore(c), b.setEndAfter(f), a.purgeTableBookmark = b.createBookmark())
  7224. }
  7225. }, detectRanges: function (e, f) {
  7226. var g = c(f, e.bookmark), k = g.clone(),
  7227. h, m, l = g.getCommonAncestor();
  7228. l.is(CKEDITOR.dtd.$tableContent) && !l.is(d) && (l = l.getAscendant("table", !0));
  7229. m = l;
  7230. l = new CKEDITOR.dom.elementPath(g.startContainer, m);
  7231. m = new CKEDITOR.dom.elementPath(g.endContainer, m);
  7232. l = l.contains("table");
  7233. m = m.contains("table");
  7234. if (l || m) l && m && b(l, m) ? (e.tableSurroundingRange = k, k.setStartAt(l, CKEDITOR.POSITION_AFTER_END), k.setEndAt(m, CKEDITOR.POSITION_BEFORE_START), k = g.clone(), k.setEndAt(l, CKEDITOR.POSITION_AFTER_END), h = g.clone(), h.setStartAt(m, CKEDITOR.POSITION_BEFORE_START),
  7235. h = a(k).concat(a(h))) : l ? m || (e.tableSurroundingRange = k, k.setStartAt(l, CKEDITOR.POSITION_AFTER_END), g.setEndAt(l, CKEDITOR.POSITION_AFTER_END)) : (e.tableSurroundingRange = k, k.setEndAt(m, CKEDITOR.POSITION_BEFORE_START), g.setStartAt(m, CKEDITOR.POSITION_AFTER_START)), e.tableContentsRanges = h ? h : a(g)
  7236. }, deleteRanges: function (a) {
  7237. for (var b; b = a.tableContentsRanges.pop();) b.extractContents(), v(b.startContainer) && b.startContainer.appendBogus();
  7238. a.tableSurroundingRange && a.tableSurroundingRange.extractContents()
  7239. }, purge: function (a) {
  7240. if (a.purgeTableBookmark) {
  7241. var b =
  7242. a.doc, c = a.range.clone(), b = b.createElement("p");
  7243. b.insertBefore(a.purgeTableBookmark.startNode);
  7244. c.moveToBookmark(a.purgeTableBookmark);
  7245. c.deleteContents();
  7246. a.range.moveToPosition(b, CKEDITOR.POSITION_AFTER_START)
  7247. }
  7248. }
  7249. }
  7250. }(), detectExtractMerge: function (a) {
  7251. return !(a.range.startPath().contains(CKEDITOR.dtd.$listItem) && a.range.endPath().contains(CKEDITOR.dtd.$listItem))
  7252. }, fixUneditableRangePosition: function (a) {
  7253. a.startContainer.getDtd()["#"] || a.moveToClosestEditablePosition(null, !0)
  7254. }, autoParagraph: function (a, b) {
  7255. var c =
  7256. b.startPath(), d;
  7257. k(a, c.block, c.blockLimit) && (d = h(a)) && (d = b.document.createElement(d), d.appendBogus(), b.insertNode(d), b.moveToPosition(d, CKEDITOR.POSITION_AFTER_START))
  7258. }
  7259. }
  7260. }()
  7261. })();
  7262. (function () {
  7263. function a(a) {
  7264. return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a)
  7265. }
  7266. function d(b, c) {
  7267. if (0 === b.length || a(b[0].getEnclosedNode())) return !1;
  7268. var d, e;
  7269. if ((d = !c && 1 === b.length) && !(d = b[0].collapsed)) {
  7270. var f = b[0];
  7271. d = f.startContainer.getAscendant({td: 1, th: 1}, !0);
  7272. var g = f.endContainer.getAscendant({td: 1, th: 1}, !0);
  7273. e = CKEDITOR.tools.trim;
  7274. d && d.equals(g) && !d.findOne("td, th, tr, tbody, table") ? (f = f.cloneContents(), d = f.getFirst() ? e(f.getFirst().getText()) !== e(d.getText()) : !0) : d = !1
  7275. }
  7276. if (d) return !1;
  7277. for (e = 0; e < b.length; e++) if (d = b[e]._getTableElement(), !d) return !1;
  7278. return !0
  7279. }
  7280. function b(a) {
  7281. function b(a) {
  7282. a = a.find("td, th");
  7283. var c = [], d;
  7284. for (d = 0; d < a.count(); d++) c.push(a.getItem(d));
  7285. return c
  7286. }
  7287. var c = [], d, e;
  7288. for (e = 0; e < a.length; e++) d = a[e]._getTableElement(), d.is && d.is({
  7289. td: 1,
  7290. th: 1
  7291. }) ? c.push(d) : c = c.concat(b(d));
  7292. return c
  7293. }
  7294. function c(a) {
  7295. a = b(a);
  7296. var c = "", d = [], e, f;
  7297. for (f = 0; f < a.length; f++) e && !e.equals(a[f].getAscendant("tr")) ? (c += d.join("\t") + "\n", e = a[f].getAscendant("tr"), d = []) : 0 === f && (e = a[f].getAscendant("tr")), d.push(a[f].getText());
  7298. return c += d.join("\t")
  7299. }
  7300. function f(a) {
  7301. var b = this.root.editor, d = b.getSelection(1);
  7302. this.reset();
  7303. n = !0;
  7304. d.root.once("selectionchange", function (a) {
  7305. a.cancel()
  7306. }, null, null, 0);
  7307. d.selectRanges([a[0]]);
  7308. d = this._.cache;
  7309. d.ranges = new CKEDITOR.dom.rangeList(a);
  7310. d.type = CKEDITOR.SELECTION_TEXT;
  7311. d.selectedElement = a[0]._getTableElement();
  7312. d.selectedText = c(a);
  7313. d.nativeSel = null;
  7314. this.isFake = 1;
  7315. this.rev = M++;
  7316. b._.fakeSelection = this;
  7317. n = !1;
  7318. this.root.fire("selectionchange")
  7319. }
  7320. function g() {
  7321. var b = this._.fakeSelection, c;
  7322. if (b) {
  7323. c = this.getSelection(1);
  7324. var e;
  7325. if (!(e = !c) && (e = !c.isHidden())) {
  7326. e = b;
  7327. var f = c.getRanges(), g = e.getRanges(),
  7328. k = f.length && f[0]._getTableElement() && f[0]._getTableElement().getAscendant("table", !0),
  7329. l = g.length && g[0]._getTableElement() && g[0]._getTableElement().getAscendant("table", !0),
  7330. h = 1 === f.length && f[0]._getTableElement() && f[0]._getTableElement().is("table"),
  7331. B = 1 === g.length && g[0]._getTableElement() && g[0]._getTableElement().is("table");
  7332. if (a(e.getSelectedElement())) e = !1; else {
  7333. var A = 1 === f.length && f[0].collapsed, g = d(f, !!CKEDITOR.env.webkit) &&
  7334. d(g);
  7335. k = k && l ? k.equals(l) || l.contains(k) : !1;
  7336. k && (A || g) ? (h && !B && e.selectRanges(f), e = !0) : e = !1
  7337. }
  7338. e = !e
  7339. }
  7340. e && (b.reset(), b = 0)
  7341. }
  7342. if (!b && (b = c || this.getSelection(1), !b || b.getType() == CKEDITOR.SELECTION_NONE)) return;
  7343. this.fire("selectionCheck", b);
  7344. c = this.elementPath();
  7345. c.compare(this._.selectionPreviousPath) || (e = this._.selectionPreviousPath && this._.selectionPreviousPath.blockLimit.equals(c.blockLimit), !CKEDITOR.env.webkit && !CKEDITOR.env.gecko || e || (this._.previousActive = this.document.getActive()), this._.selectionPreviousPath =
  7346. c, this.fire("selectionChange", {selection: b, path: c}))
  7347. }
  7348. function k() {
  7349. C = !0;
  7350. r || (h.call(this), r = CKEDITOR.tools.setTimeout(h, 200, this))
  7351. }
  7352. function h() {
  7353. r = null;
  7354. C && (CKEDITOR.tools.setTimeout(g, 0, this), C = !1)
  7355. }
  7356. function p(a) {
  7357. return L(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? !0 : !1
  7358. }
  7359. function q(a) {
  7360. function b(c, d) {
  7361. return c && c.type != CKEDITOR.NODE_TEXT ? a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c) : !1
  7362. }
  7363. if (!(a.root instanceof CKEDITOR.editable)) return !1;
  7364. var c = a.startContainer, d = a.getPreviousNode(p,
  7365. null, c), e = a.getNextNode(p, null, c);
  7366. return b(d) || b(e, 1) || !(d || e || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c.getBogus()) ? !0 : !1
  7367. }
  7368. function e(a) {
  7369. y(a, !1);
  7370. var b = a.getDocument().createText(w);
  7371. a.setCustomData("cke-fillingChar", b);
  7372. return b
  7373. }
  7374. function y(a, b) {
  7375. var c = a && a.removeCustomData("cke-fillingChar");
  7376. if (c) {
  7377. if (!1 !== b) {
  7378. var d = a.getDocument().getSelection().getNative(), e = d && "None" != d.type && d.getRangeAt(0),
  7379. f = w.length;
  7380. if (c.getLength() > f && e && e.intersectsNode(c.$)) {
  7381. var l = [{node: d.anchorNode, offset: d.anchorOffset},
  7382. {node: d.focusNode, offset: d.focusOffset}];
  7383. d.anchorNode == c.$ && d.anchorOffset > f && (l[0].offset -= f);
  7384. d.focusNode == c.$ && d.focusOffset > f && (l[1].offset -= f)
  7385. }
  7386. }
  7387. c.setText(v(c.getText(), 1));
  7388. l && (c = a.getDocument().$, d = c.getSelection(), c = c.createRange(), c.setStart(l[0].node, l[0].offset), c.collapse(!0), d.removeAllRanges(), d.addRange(c), d.extend(l[1].node, l[1].offset))
  7389. }
  7390. }
  7391. function v(a, b) {
  7392. return b ? a.replace(H, function (a, b) {
  7393. return b ? " " : ""
  7394. }) : a.replace(w, "")
  7395. }
  7396. function x(a, b) {
  7397. var c = b && CKEDITOR.tools.htmlEncode(b) || "\x26nbsp;",
  7398. c = CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"' + (CKEDITOR.env.ie && 14 > CKEDITOR.env.version ? "display:none" : "position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;") + '"\x3e' + c + "\x3c/div\x3e", a.document);
  7399. a.fire("lockSnapshot");
  7400. a.editable().append(c);
  7401. var d = a.getSelection(1), e = a.createRange(), f = d.root.on("selectionchange", function (a) {
  7402. a.cancel()
  7403. }, null, null, 0);
  7404. e.setStartAt(c, CKEDITOR.POSITION_AFTER_START);
  7405. e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  7406. d.selectRanges([e]);
  7407. f.removeListener();
  7408. a.fire("unlockSnapshot");
  7409. a._.hiddenSelectionContainer = c
  7410. }
  7411. function F(a) {
  7412. var b = {37: 1, 39: 1, 8: 1, 46: 1};
  7413. return function (c) {
  7414. var d = c.data.getKeystroke();
  7415. if (b[d]) {
  7416. var e = a.getSelection().getRanges(), f = e[0];
  7417. 1 == e.length && f.collapsed && (d = f[38 > d ? "getPreviousEditableNode" : "getNextEditableNode"]()) && d.type == CKEDITOR.NODE_ELEMENT && "false" == d.getAttribute("contenteditable") && (a.getSelection().fake(d), c.data.preventDefault(), c.cancel())
  7418. }
  7419. }
  7420. }
  7421. function u(a) {
  7422. for (var b = 0; b < a.length; b++) {
  7423. var c =
  7424. a[b];
  7425. c.getCommonAncestor().isReadOnly() && a.splice(b, 1);
  7426. if (!c.collapsed) {
  7427. if (c.startContainer.isReadOnly()) for (var d = c.startContainer, e; d && !((e = d.type == CKEDITOR.NODE_ELEMENT) && d.is("body") || !d.isReadOnly());) e && "false" == d.getAttribute("contentEditable") && c.setStartAfter(d), d = d.getParent();
  7428. d = c.startContainer;
  7429. e = c.endContainer;
  7430. var f = c.startOffset, l = c.endOffset, g = c.clone();
  7431. d && d.type == CKEDITOR.NODE_TEXT && (f >= d.getLength() ? g.setStartAfter(d) : g.setStartBefore(d));
  7432. e && e.type == CKEDITOR.NODE_TEXT && (l ? g.setEndAfter(e) :
  7433. g.setEndBefore(e));
  7434. d = new CKEDITOR.dom.walker(g);
  7435. d.evaluator = function (d) {
  7436. if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) {
  7437. var e = c.clone();
  7438. c.setEndBefore(d);
  7439. c.collapsed && a.splice(b--, 1);
  7440. d.getPosition(g.endContainer) & CKEDITOR.POSITION_CONTAINS || (e.setStartAfter(d), e.collapsed || a.splice(b + 1, 0, e));
  7441. return !0
  7442. }
  7443. return !1
  7444. };
  7445. d.next()
  7446. }
  7447. }
  7448. return a
  7449. }
  7450. var m = "function" != typeof window.getSelection, M = 1, w = CKEDITOR.tools.repeat("​", 7),
  7451. H = new RegExp(w + "( )?", "g"), n, r, C, L = CKEDITOR.dom.walker.invisible(1), E = function () {
  7452. function a(b) {
  7453. return function (a) {
  7454. var c =
  7455. a.editor.createRange();
  7456. c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
  7457. return !1
  7458. }
  7459. }
  7460. function b(a) {
  7461. return function (b) {
  7462. var c = b.editor, d = c.createRange(), e;
  7463. if (!c.readOnly) return (e = d.moveToClosestEditablePosition(b.selected, a)) || (e = d.moveToClosestEditablePosition(b.selected, !a)), e && c.getSelection().selectRanges([d]), c.fire("saveSnapshot"), b.selected.remove(), e || (d.moveToElementEditablePosition(c.editable()), c.getSelection().selectRanges([d])), c.fire("saveSnapshot"),
  7464. !1
  7465. }
  7466. }
  7467. var c = a(), d = a(1);
  7468. return {37: c, 38: c, 39: d, 40: d, 8: b(), 46: b(1)}
  7469. }();
  7470. CKEDITOR.on("instanceCreated", function (a) {
  7471. function b() {
  7472. var a = c.getSelection();
  7473. a && a.removeAllRanges()
  7474. }
  7475. var c = a.editor;
  7476. c.on("contentDom", function () {
  7477. function a() {
  7478. p = new CKEDITOR.dom.selection(c.getSelection());
  7479. p.lock()
  7480. }
  7481. function b() {
  7482. f.removeListener("mouseup", b);
  7483. n.removeListener("mouseup", b);
  7484. var a = CKEDITOR.document.$.selection, c = a.createRange();
  7485. "None" != a.type && c.parentElement() && c.parentElement().ownerDocument == e.$ && c.select()
  7486. }
  7487. function d(a) {
  7488. a =
  7489. a.getRanges()[0];
  7490. return a ? (a = a.startContainer.getAscendant(function (a) {
  7491. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable")
  7492. }, !0)) && "false" === a.getAttribute("contenteditable") ? a : null : null
  7493. }
  7494. var e = c.document, f = CKEDITOR.document, h = c.editable(), t = e.getBody(),
  7495. n = e.getDocumentElement(), D = h.isInline(), q, p;
  7496. CKEDITOR.env.gecko && h.attachListener(h, "focus", function (a) {
  7497. a.removeListener();
  7498. 0 !== q && (a = c.getSelection().getNative()) && a.isCollapsed && a.anchorNode == h.$ && (a = c.createRange(), a.moveToElementEditStart(h),
  7499. a.select())
  7500. }, null, null, -2);
  7501. h.attachListener(h, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? "focusin" : "focus", function () {
  7502. if (q && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
  7503. q = c._.previousActive && c._.previousActive.equals(e.getActive());
  7504. var a = null != c._.previousScrollTop && c._.previousScrollTop != h.$.scrollTop;
  7505. CKEDITOR.env.webkit && q && a && (h.$.scrollTop = c._.previousScrollTop)
  7506. }
  7507. c.unlockSelection(q);
  7508. q = 0
  7509. }, null, null, -1);
  7510. h.attachListener(h, "mousedown", function () {
  7511. q = 0
  7512. });
  7513. if (CKEDITOR.env.ie || D) m ? h.attachListener(h, "beforedeactivate",
  7514. a, null, null, -1) : h.attachListener(c, "selectionCheck", a, null, null, -1), h.attachListener(h, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? "focusout" : "blur", function () {
  7515. c.lockSelection(p);
  7516. q = 1
  7517. }, null, null, -1), h.attachListener(h, "mousedown", function () {
  7518. q = 0
  7519. });
  7520. if (CKEDITOR.env.ie && !D) {
  7521. var v;
  7522. h.attachListener(h, "mousedown", function (a) {
  7523. 2 == a.data.$.button && ((a = c.document.getSelection()) && a.getType() != CKEDITOR.SELECTION_NONE || (v = c.window.getScrollPosition()))
  7524. });
  7525. h.attachListener(h, "mouseup", function (a) {
  7526. 2 == a.data.$.button &&
  7527. v && (c.document.$.documentElement.scrollLeft = v.x, c.document.$.documentElement.scrollTop = v.y);
  7528. v = null
  7529. });
  7530. if ("BackCompat" != e.$.compatMode) {
  7531. if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) {
  7532. var r, x;
  7533. n.on("mousedown", function (a) {
  7534. function b(a) {
  7535. a = a.data.$;
  7536. if (r) {
  7537. var c = t.$.createTextRange();
  7538. try {
  7539. c.moveToPoint(a.clientX, a.clientY)
  7540. } catch (d) {
  7541. }
  7542. r.setEndPoint(0 > x.compareEndPoints("StartToStart", c) ? "EndToEnd" : "StartToStart", c);
  7543. r.select()
  7544. }
  7545. }
  7546. function c() {
  7547. n.removeListener("mousemove", b);
  7548. f.removeListener("mouseup", c);
  7549. n.removeListener("mouseup",
  7550. c);
  7551. r.select()
  7552. }
  7553. a = a.data;
  7554. if (a.getTarget().is("html") && a.$.y < n.$.clientHeight && a.$.x < n.$.clientWidth) {
  7555. r = t.$.createTextRange();
  7556. try {
  7557. r.moveToPoint(a.$.clientX, a.$.clientY)
  7558. } catch (d) {
  7559. }
  7560. x = r.duplicate();
  7561. n.on("mousemove", b);
  7562. f.on("mouseup", c);
  7563. n.on("mouseup", c)
  7564. }
  7565. })
  7566. }
  7567. if (7 < CKEDITOR.env.version && 11 > CKEDITOR.env.version) n.on("mousedown", function (a) {
  7568. a.data.getTarget().is("html") && (f.on("mouseup", b), n.on("mouseup", b))
  7569. })
  7570. }
  7571. }
  7572. h.attachListener(h, "selectionchange", g, c);
  7573. h.attachListener(h, "keyup", k, c);
  7574. h.attachListener(h, "touchstart",
  7575. k, c);
  7576. h.attachListener(h, "touchend", k, c);
  7577. CKEDITOR.env.ie && h.attachListener(h, "keydown", function (a) {
  7578. var b = this.getSelection(1), c = d(b);
  7579. c && !c.equals(h) && (b.selectElement(c), a.data.preventDefault())
  7580. }, c);
  7581. h.attachListener(h, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? "focusin" : "focus", function () {
  7582. c.forceNextSelectionCheck();
  7583. c.selectionChange(1)
  7584. });
  7585. if (D && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
  7586. var u;
  7587. h.attachListener(h, "mousedown", function () {
  7588. u = 1
  7589. });
  7590. h.attachListener(e.getDocumentElement(), "mouseup", function () {
  7591. u &&
  7592. k.call(c);
  7593. u = 0
  7594. })
  7595. } else h.attachListener(CKEDITOR.env.ie ? h : e.getDocumentElement(), "mouseup", k, c);
  7596. CKEDITOR.env.webkit && h.attachListener(e, "keydown", function (a) {
  7597. switch (a.data.getKey()) {
  7598. case 13:
  7599. case 33:
  7600. case 34:
  7601. case 35:
  7602. case 36:
  7603. case 37:
  7604. case 39:
  7605. case 8:
  7606. case 45:
  7607. case 46:
  7608. h.hasFocus && y(h)
  7609. }
  7610. }, null, null, -1);
  7611. h.attachListener(h, "keydown", F(c), null, null, -1)
  7612. });
  7613. c.on("setData", function () {
  7614. c.unlockSelection();
  7615. CKEDITOR.env.webkit && b()
  7616. });
  7617. c.on("contentDomUnload", function () {
  7618. c.unlockSelection()
  7619. });
  7620. if (CKEDITOR.env.ie9Compat) c.on("beforeDestroy",
  7621. b, null, null, 9);
  7622. c.on("dataReady", function () {
  7623. delete c._.fakeSelection;
  7624. delete c._.hiddenSelectionContainer;
  7625. c.selectionChange(1)
  7626. });
  7627. c.on("loadSnapshot", function () {
  7628. var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT), b = c.editable().getLast(a);
  7629. b && b.hasAttribute("data-cke-hidden-sel") && (b.remove(), CKEDITOR.env.gecko && (a = c.editable().getFirst(a)) && a.is("br") && a.getAttribute("_moz_editor_bogus_node") && a.remove())
  7630. }, null, null, 100);
  7631. c.on("key", function (a) {
  7632. if ("wysiwyg" == c.mode) {
  7633. var b = c.getSelection();
  7634. if (b.isFake) {
  7635. var d =
  7636. E[a.data.keyCode];
  7637. if (d) return d({editor: c, selected: b.getSelectedElement(), selection: b, keyEvent: a})
  7638. }
  7639. }
  7640. })
  7641. });
  7642. if (CKEDITOR.env.webkit) CKEDITOR.on("instanceReady", function (a) {
  7643. var b = a.editor;
  7644. b.on("selectionChange", function () {
  7645. var a = b.editable(), c = a.getCustomData("cke-fillingChar");
  7646. c && (c.getCustomData("ready") ? (y(a), a.editor.fire("selectionCheck")) : c.setCustomData("ready", 1))
  7647. }, null, null, -1);
  7648. b.on("beforeSetMode", function () {
  7649. y(b.editable())
  7650. }, null, null, -1);
  7651. b.on("getSnapshot", function (a) {
  7652. a.data && (a.data = v(a.data))
  7653. },
  7654. b, null, 20);
  7655. b.on("toDataFormat", function (a) {
  7656. a.data.dataValue = v(a.data.dataValue)
  7657. }, null, null, 0)
  7658. });
  7659. CKEDITOR.editor.prototype.selectionChange = function (a) {
  7660. (a ? g : k).call(this)
  7661. };
  7662. CKEDITOR.editor.prototype.getSelection = function (a) {
  7663. return !this._.savedSelection && !this._.fakeSelection || a ? (a = this.editable()) && "wysiwyg" == this.mode ? new CKEDITOR.dom.selection(a) : null : this._.savedSelection || this._.fakeSelection
  7664. };
  7665. CKEDITOR.editor.prototype.lockSelection = function (a) {
  7666. a = a || this.getSelection(1);
  7667. return a.getType() != CKEDITOR.SELECTION_NONE ?
  7668. (!a.isLocked && a.lock(), this._.savedSelection = a, !0) : !1
  7669. };
  7670. CKEDITOR.editor.prototype.unlockSelection = function (a) {
  7671. var b = this._.savedSelection;
  7672. return b ? (b.unlock(a), delete this._.savedSelection, !0) : !1
  7673. };
  7674. CKEDITOR.editor.prototype.forceNextSelectionCheck = function () {
  7675. delete this._.selectionPreviousPath
  7676. };
  7677. CKEDITOR.dom.document.prototype.getSelection = function () {
  7678. return new CKEDITOR.dom.selection(this)
  7679. };
  7680. CKEDITOR.dom.range.prototype.select = function () {
  7681. var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() :
  7682. new CKEDITOR.dom.selection(this.root);
  7683. a.selectRanges([this]);
  7684. return a
  7685. };
  7686. CKEDITOR.SELECTION_NONE = 1;
  7687. CKEDITOR.SELECTION_TEXT = 2;
  7688. CKEDITOR.SELECTION_ELEMENT = 3;
  7689. CKEDITOR.dom.selection = function (a) {
  7690. if (a instanceof CKEDITOR.dom.selection) {
  7691. var b = a;
  7692. a = a.root
  7693. }
  7694. var c = a instanceof CKEDITOR.dom.element;
  7695. this.rev = b ? b.rev : M++;
  7696. this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
  7697. this.root = c ? a : this.document.getBody();
  7698. this.isLocked = 0;
  7699. this._ = {cache: {}};
  7700. if (b) return CKEDITOR.tools.extend(this._.cache, b._.cache),
  7701. this.isFake = b.isFake, this.isLocked = b.isLocked, this;
  7702. a = this.getNative();
  7703. var d, e;
  7704. if (a) if (a.getRangeAt) d = (e = a.rangeCount && a.getRangeAt(0)) && new CKEDITOR.dom.node(e.commonAncestorContainer); else {
  7705. try {
  7706. e = a.createRange()
  7707. } catch (f) {
  7708. }
  7709. d = e && CKEDITOR.dom.element.get(e.item && e.item(0) || e.parentElement())
  7710. }
  7711. if (!d || d.type != CKEDITOR.NODE_ELEMENT && d.type != CKEDITOR.NODE_TEXT || !this.root.equals(d) && !this.root.contains(d)) this._.cache.type = CKEDITOR.SELECTION_NONE, this._.cache.startElement = null, this._.cache.selectedElement =
  7712. null, this._.cache.selectedText = "", this._.cache.ranges = new CKEDITOR.dom.rangeList;
  7713. return this
  7714. };
  7715. var N = {
  7716. img: 1,
  7717. hr: 1,
  7718. li: 1,
  7719. table: 1,
  7720. tr: 1,
  7721. td: 1,
  7722. th: 1,
  7723. embed: 1,
  7724. object: 1,
  7725. ol: 1,
  7726. ul: 1,
  7727. a: 1,
  7728. input: 1,
  7729. form: 1,
  7730. select: 1,
  7731. textarea: 1,
  7732. button: 1,
  7733. fieldset: 1,
  7734. thead: 1,
  7735. tfoot: 1
  7736. };
  7737. CKEDITOR.tools.extend(CKEDITOR.dom.selection, {
  7738. _removeFillingCharSequenceString: v,
  7739. _createFillingCharSequenceNode: e,
  7740. FILLING_CHAR_SEQUENCE: w
  7741. });
  7742. CKEDITOR.dom.selection.prototype = {
  7743. getNative: function () {
  7744. return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel =
  7745. m ? this.document.$.selection : this.document.getWindow().$.getSelection()
  7746. }, getType: m ? function () {
  7747. var a = this._.cache;
  7748. if (a.type) return a.type;
  7749. var b = CKEDITOR.SELECTION_NONE;
  7750. try {
  7751. var c = this.getNative(), d = c.type;
  7752. "Text" == d && (b = CKEDITOR.SELECTION_TEXT);
  7753. "Control" == d && (b = CKEDITOR.SELECTION_ELEMENT);
  7754. c.createRange().parentElement() && (b = CKEDITOR.SELECTION_TEXT)
  7755. } catch (e) {
  7756. }
  7757. return a.type = b
  7758. } : function () {
  7759. var a = this._.cache;
  7760. if (a.type) return a.type;
  7761. var b = CKEDITOR.SELECTION_TEXT, c = this.getNative();
  7762. if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
  7763. else if (1 == c.rangeCount) {
  7764. var c = c.getRangeAt(0), d = c.startContainer;
  7765. d == c.endContainer && 1 == d.nodeType && 1 == c.endOffset - c.startOffset && N[d.childNodes[c.startOffset].nodeName.toLowerCase()] && (b = CKEDITOR.SELECTION_ELEMENT)
  7766. }
  7767. return a.type = b
  7768. }, getRanges: function () {
  7769. var a = m ? function () {
  7770. function a(b) {
  7771. return (new CKEDITOR.dom.node(b)).getIndex()
  7772. }
  7773. var b = function (b, c) {
  7774. b = b.duplicate();
  7775. b.collapse(c);
  7776. var d = b.parentElement();
  7777. if (!d.hasChildNodes()) return {container: d, offset: 0};
  7778. for (var e = d.children, f, g, h = b.duplicate(), k = 0,
  7779. m = e.length - 1, n = -1, t, q; k <= m;) if (n = Math.floor((k + m) / 2), f = e[n], h.moveToElementText(f), t = h.compareEndPoints("StartToStart", b), 0 < t) m = n - 1; else if (0 > t) k = n + 1; else return {
  7780. container: d,
  7781. offset: a(f)
  7782. };
  7783. if (-1 == n || n == e.length - 1 && 0 > t) {
  7784. h.moveToElementText(d);
  7785. h.setEndPoint("StartToStart", b);
  7786. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  7787. e = d.childNodes;
  7788. if (!h) return f = e[e.length - 1], f.nodeType != CKEDITOR.NODE_TEXT ? {
  7789. container: d,
  7790. offset: e.length
  7791. } : {container: f, offset: f.nodeValue.length};
  7792. for (d = e.length; 0 < h && 0 < d;) g = e[--d], g.nodeType ==
  7793. CKEDITOR.NODE_TEXT && (q = g, h -= g.nodeValue.length);
  7794. return {container: q, offset: -h}
  7795. }
  7796. h.collapse(0 < t ? !0 : !1);
  7797. h.setEndPoint(0 < t ? "StartToStart" : "EndToStart", b);
  7798. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  7799. if (!h) return {container: d, offset: a(f) + (0 < t ? 0 : 1)};
  7800. for (; 0 < h;) try {
  7801. g = f[0 < t ? "previousSibling" : "nextSibling"], g.nodeType == CKEDITOR.NODE_TEXT && (h -= g.nodeValue.length, q = g), f = g
  7802. } catch (p) {
  7803. return {container: d, offset: a(f)}
  7804. }
  7805. return {container: q, offset: 0 < t ? -h : q.nodeValue.length + h}
  7806. };
  7807. return function () {
  7808. var a = this.getNative(), c = a &&
  7809. a.createRange(), d = this.getType();
  7810. if (!a) return [];
  7811. if (d == CKEDITOR.SELECTION_TEXT) return a = new CKEDITOR.dom.range(this.root), d = b(c, !0), a.setStart(new CKEDITOR.dom.node(d.container), d.offset), d = b(c), a.setEnd(new CKEDITOR.dom.node(d.container), d.offset), a.endContainer.getPosition(a.startContainer) & CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer.getIndex() && a.collapse(), [a];
  7812. if (d == CKEDITOR.SELECTION_ELEMENT) {
  7813. for (var d = [], e = 0; e < c.length; e++) {
  7814. for (var f = c.item(e), g = f.parentNode, h = 0, a = new CKEDITOR.dom.range(this.root); h <
  7815. g.childNodes.length && g.childNodes[h] != f; h++) ;
  7816. a.setStart(new CKEDITOR.dom.node(g), h);
  7817. a.setEnd(new CKEDITOR.dom.node(g), h + 1);
  7818. d.push(a)
  7819. }
  7820. return d
  7821. }
  7822. return []
  7823. }
  7824. }() : function () {
  7825. var a = [], b, c = this.getNative();
  7826. if (!c) return a;
  7827. for (var d = 0; d < c.rangeCount; d++) {
  7828. var e = c.getRangeAt(d);
  7829. b = new CKEDITOR.dom.range(this.root);
  7830. b.setStart(new CKEDITOR.dom.node(e.startContainer), e.startOffset);
  7831. b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset);
  7832. a.push(b)
  7833. }
  7834. return a
  7835. };
  7836. return function (b) {
  7837. var c = this._.cache, d = c.ranges;
  7838. d || (c.ranges =
  7839. d = new CKEDITOR.dom.rangeList(a.call(this)));
  7840. return b ? u(new CKEDITOR.dom.rangeList(d.slice())) : d
  7841. }
  7842. }(), getStartElement: function () {
  7843. var a = this._.cache;
  7844. if (void 0 !== a.startElement) return a.startElement;
  7845. var b;
  7846. switch (this.getType()) {
  7847. case CKEDITOR.SELECTION_ELEMENT:
  7848. return this.getSelectedElement();
  7849. case CKEDITOR.SELECTION_TEXT:
  7850. var c = this.getRanges()[0];
  7851. if (c) {
  7852. if (c.collapsed) b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent()); else {
  7853. for (c.optimize(); b = c.startContainer, c.startOffset == (b.getChildCount ?
  7854. b.getChildCount() : b.getLength()) && !b.isBlockBoundary();) c.setStartAfter(b);
  7855. b = c.startContainer;
  7856. if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
  7857. if ((b = b.getChild(c.startOffset)) && b.type == CKEDITOR.NODE_ELEMENT) for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) b = c, c = c.getFirst(); else b = c.startContainer
  7858. }
  7859. b = b.$
  7860. }
  7861. }
  7862. return a.startElement = b ? new CKEDITOR.dom.element(b) : null
  7863. }, getSelectedElement: function () {
  7864. var a = this._.cache;
  7865. if (void 0 !== a.selectedElement) return a.selectedElement;
  7866. var b = this, c = CKEDITOR.tools.tryThese(function () {
  7867. return b.getNative().createRange().item(0)
  7868. },
  7869. function () {
  7870. for (var a = b.getRanges()[0].clone(), c, d, e = 2; e && !((c = a.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && N[c.getName()] && (d = c)); e--) a.shrink(CKEDITOR.SHRINK_ELEMENT);
  7871. return d && d.$
  7872. });
  7873. return a.selectedElement = c ? new CKEDITOR.dom.element(c) : null
  7874. }, getSelectedText: function () {
  7875. var a = this._.cache;
  7876. if (void 0 !== a.selectedText) return a.selectedText;
  7877. var b = this.getNative(), b = m ? "Control" == b.type ? "" : b.createRange().text : b.toString();
  7878. return a.selectedText = b
  7879. }, lock: function () {
  7880. this.getRanges();
  7881. this.getStartElement();
  7882. this.getSelectedElement();
  7883. this.getSelectedText();
  7884. this._.cache.nativeSel = null;
  7885. this.isLocked = 1
  7886. }, unlock: function (a) {
  7887. if (this.isLocked) {
  7888. if (a) var b = this.getSelectedElement(), c = this.getRanges(), e = this.isFake;
  7889. this.isLocked = 0;
  7890. this.reset();
  7891. a && (a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 1) && (d(c) ? f.call(this, c) : e ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c))
  7892. }
  7893. }, reset: function () {
  7894. this._.cache = {};
  7895. this.isFake = 0;
  7896. var a = this.root.editor;
  7897. if (a && a._.fakeSelection) if (this.rev == a._.fakeSelection.rev) {
  7898. delete a._.fakeSelection;
  7899. var b = a._.hiddenSelectionContainer;
  7900. if (b) {
  7901. var c = a.checkDirty();
  7902. a.fire("lockSnapshot");
  7903. b.remove();
  7904. a.fire("unlockSnapshot");
  7905. !c && a.resetDirty()
  7906. }
  7907. delete a._.hiddenSelectionContainer
  7908. } else CKEDITOR.warn("selection-fake-reset");
  7909. this.rev = M++
  7910. }, selectElement: function (a) {
  7911. var b = new CKEDITOR.dom.range(this.root);
  7912. b.setStartBefore(a);
  7913. b.setEndAfter(a);
  7914. this.selectRanges([b])
  7915. }, selectRanges: function (a) {
  7916. var b = this.root.editor, c = b && b._.hiddenSelectionContainer;
  7917. this.reset();
  7918. if (c) for (var c = this.root, g, h = 0; h < a.length; ++h) g =
  7919. a[h], g.endContainer.equals(c) && (g.endOffset = Math.min(g.endOffset, c.getChildCount()));
  7920. if (a.length) if (this.isLocked) {
  7921. var k = CKEDITOR.document.getActive();
  7922. this.unlock();
  7923. this.selectRanges(a);
  7924. this.lock();
  7925. k && !k.equals(this.root) && k.focus()
  7926. } else {
  7927. var l;
  7928. a:{
  7929. var p, B;
  7930. if (1 == a.length && !(B = a[0]).collapsed && (l = B.getEnclosedNode()) && l.type == CKEDITOR.NODE_ELEMENT && (B = B.clone(), B.shrink(CKEDITOR.SHRINK_ELEMENT, !0), (p = B.getEnclosedNode()) && p.type == CKEDITOR.NODE_ELEMENT && (l = p), "false" == l.getAttribute("contenteditable"))) break a;
  7931. l = void 0
  7932. }
  7933. if (l) this.fake(l); else if (b && b.plugins.tableselection && CKEDITOR.plugins.tableselection.isSupportedEnvironment && d(a) && !n) f.call(this, a); else {
  7934. if (m) {
  7935. p = CKEDITOR.dom.walker.whitespaces(!0);
  7936. l = /\ufeff|\u00a0/;
  7937. B = {table: 1, tbody: 1, tr: 1};
  7938. 1 < a.length && (b = a[a.length - 1], a[0].setEnd(b.endContainer, b.endOffset));
  7939. b = a[0];
  7940. a = b.collapsed;
  7941. var A, J, G;
  7942. if ((c = b.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in N && (!c.is("a") || !c.getText())) try {
  7943. G = c.$.createControlRange();
  7944. G.addElement(c.$);
  7945. G.select();
  7946. return
  7947. } catch (v) {
  7948. }
  7949. if (b.startContainer.type ==
  7950. CKEDITOR.NODE_ELEMENT && b.startContainer.getName() in B || b.endContainer.type == CKEDITOR.NODE_ELEMENT && b.endContainer.getName() in B) b.shrink(CKEDITOR.NODE_ELEMENT, !0), a = b.collapsed;
  7951. G = b.createBookmark();
  7952. B = G.startNode;
  7953. a || (k = G.endNode);
  7954. G = b.document.$.body.createTextRange();
  7955. G.moveToElementText(B.$);
  7956. G.moveStart("character", 1);
  7957. k ? (l = b.document.$.body.createTextRange(), l.moveToElementText(k.$), G.setEndPoint("EndToEnd", l), G.moveEnd("character", -1)) : (A = B.getNext(p), J = B.hasAscendant("pre"), A = !(A && A.getText && A.getText().match(l)) &&
  7958. (J || !B.hasPrevious() || B.getPrevious().is && B.getPrevious().is("br")), J = b.document.createElement("span"), J.setHtml("\x26#65279;"), J.insertBefore(B), A && b.document.createText("").insertBefore(B));
  7959. b.setStartBefore(B);
  7960. B.remove();
  7961. a ? (A ? (G.moveStart("character", -1), G.select(), b.document.$.selection.clear()) : G.select(), b.moveToPosition(J, CKEDITOR.POSITION_BEFORE_START), J.remove()) : (b.setEndBefore(k), k.remove(), G.select())
  7962. } else {
  7963. k = this.getNative();
  7964. if (!k) return;
  7965. this.removeAllRanges();
  7966. for (G = 0; G < a.length; G++) {
  7967. if (G <
  7968. a.length - 1 && (A = a[G], J = a[G + 1], l = A.clone(), l.setStart(A.endContainer, A.endOffset), l.setEnd(J.startContainer, J.startOffset), !l.collapsed && (l.shrink(CKEDITOR.NODE_ELEMENT, !0), b = l.getCommonAncestor(), l = l.getEnclosedNode(), b.isReadOnly() || l && l.isReadOnly()))) {
  7969. J.setStart(A.startContainer, A.startOffset);
  7970. a.splice(G--, 1);
  7971. continue
  7972. }
  7973. b = a[G];
  7974. J = this.document.$.createRange();
  7975. b.collapsed && CKEDITOR.env.webkit && q(b) && (l = e(this.root), b.insertNode(l), (A = l.getNext()) && !l.getPrevious() && A.type == CKEDITOR.NODE_ELEMENT && "br" ==
  7976. A.getName() ? (y(this.root), b.moveToPosition(A, CKEDITOR.POSITION_BEFORE_START)) : b.moveToPosition(l, CKEDITOR.POSITION_AFTER_END));
  7977. J.setStart(b.startContainer.$, b.startOffset);
  7978. try {
  7979. J.setEnd(b.endContainer.$, b.endOffset)
  7980. } catch (r) {
  7981. if (0 <= r.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")) b.collapse(1), J.setEnd(b.endContainer.$, b.endOffset); else throw r;
  7982. }
  7983. k.addRange(J)
  7984. }
  7985. }
  7986. this.reset();
  7987. this.root.fire("selectionchange")
  7988. }
  7989. }
  7990. }, fake: function (a, b) {
  7991. var c = this.root.editor;
  7992. void 0 === b && a.hasAttribute("aria-label") && (b = a.getAttribute("aria-label"));
  7993. this.reset();
  7994. x(c, b);
  7995. var d = this._.cache, e = new CKEDITOR.dom.range(this.root);
  7996. e.setStartBefore(a);
  7997. e.setEndAfter(a);
  7998. d.ranges = new CKEDITOR.dom.rangeList(e);
  7999. d.selectedElement = d.startElement = a;
  8000. d.type = CKEDITOR.SELECTION_ELEMENT;
  8001. d.selectedText = d.nativeSel = null;
  8002. this.isFake = 1;
  8003. this.rev = M++;
  8004. c._.fakeSelection = this;
  8005. this.root.fire("selectionchange")
  8006. }, isHidden: function () {
  8007. var a = this.getCommonAncestor();
  8008. a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
  8009. return !(!a || !a.data("cke-hidden-sel"))
  8010. }, isInTable: function (a) {
  8011. return d(this.getRanges(),
  8012. a)
  8013. }, isCollapsed: function () {
  8014. var a = this.getRanges();
  8015. return 1 === a.length && a[0].collapsed
  8016. }, createBookmarks: function (a) {
  8017. a = this.getRanges().createBookmarks(a);
  8018. this.isFake && (a.isFake = 1);
  8019. return a
  8020. }, createBookmarks2: function (a) {
  8021. a = this.getRanges().createBookmarks2(a);
  8022. this.isFake && (a.isFake = 1);
  8023. return a
  8024. }, selectBookmarks: function (a) {
  8025. for (var b = [], c, e = 0; e < a.length; e++) {
  8026. var f = new CKEDITOR.dom.range(this.root);
  8027. f.moveToBookmark(a[e]);
  8028. b.push(f)
  8029. }
  8030. a.isFake && (c = d(b) ? b[0]._getTableElement() : b[0].getEnclosedNode(), c && c.type ==
  8031. CKEDITOR.NODE_ELEMENT || (CKEDITOR.warn("selection-not-fake"), a.isFake = 0));
  8032. a.isFake && !d(b) ? this.fake(c) : this.selectRanges(b);
  8033. return this
  8034. }, getCommonAncestor: function () {
  8035. var a = this.getRanges();
  8036. return a.length ? a[0].startContainer.getCommonAncestor(a[a.length - 1].endContainer) : null
  8037. }, scrollIntoView: function () {
  8038. this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView()
  8039. }, removeAllRanges: function () {
  8040. if (this.getType() != CKEDITOR.SELECTION_NONE) {
  8041. var a = this.getNative();
  8042. try {
  8043. a && a[m ? "empty" : "removeAllRanges"]()
  8044. } catch (b) {
  8045. }
  8046. this.reset()
  8047. }
  8048. }
  8049. }
  8050. })();
  8051. "use strict";
  8052. CKEDITOR.STYLE_BLOCK = 1;
  8053. CKEDITOR.STYLE_INLINE = 2;
  8054. CKEDITOR.STYLE_OBJECT = 3;
  8055. (function () {
  8056. function a(a, b) {
  8057. for (var c, d; (a = a.getParent()) && !a.equals(b);) if (a.getAttribute("data-nostyle")) c = a; else if (!d) {
  8058. var e = a.getAttribute("contentEditable");
  8059. "false" == e ? c = a : "true" == e && (d = 1)
  8060. }
  8061. return c
  8062. }
  8063. function d(a, b, c, d) {
  8064. return (a.getPosition(b) | d) == d && (!c.childRule || c.childRule(a))
  8065. }
  8066. function b(c) {
  8067. var e = c.document;
  8068. if (c.collapsed) e = M(this, e), c.insertNode(e), c.moveToPosition(e, CKEDITOR.POSITION_BEFORE_END); else {
  8069. var g = this.element, h = this._.definition, k, m = h.ignoreReadonly, n = m || h.includeReadonly;
  8070. null ==
  8071. n && (n = c.root.getCustomData("cke_includeReadonly"));
  8072. var q = CKEDITOR.dtd[g];
  8073. q || (k = !0, q = CKEDITOR.dtd.span);
  8074. c.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  8075. c.trim();
  8076. var p = c.createBookmark(), t = p.startNode, v = p.endNode, r = t, y;
  8077. if (!m) {
  8078. var x = c.getCommonAncestor(), m = a(t, x), x = a(v, x);
  8079. m && (r = m.getNextSourceNode(!0));
  8080. x && (v = x)
  8081. }
  8082. for (r.getPosition(v) == CKEDITOR.POSITION_FOLLOWING && (r = 0); r;) {
  8083. m = !1;
  8084. if (r.equals(v)) r = null, m = !0; else {
  8085. var u = r.type == CKEDITOR.NODE_ELEMENT ? r.getName() : null,
  8086. x = u && "false" == r.getAttribute("contentEditable"), w = u &&
  8087. r.getAttribute("data-nostyle");
  8088. if (u && r.data("cke-bookmark") || r.type === CKEDITOR.NODE_COMMENT) {
  8089. r = r.getNextSourceNode(!0);
  8090. continue
  8091. }
  8092. if (x && n && CKEDITOR.dtd.$block[u]) for (var C = r, D = f(C), E = void 0, H = D.length, I = 0, C = H && new CKEDITOR.dom.range(C.getDocument()); I < H; ++I) {
  8093. var E = D[I], L = CKEDITOR.filter.instances[E.data("cke-filter")];
  8094. if (L ? L.check(this) : 1) C.selectNodeContents(E), b.call(this, C)
  8095. }
  8096. D = u ? !q[u] || w ? 0 : x && !n ? 0 : d(r, v, h, P) : 1;
  8097. if (D) if (E = r.getParent(), D = h, H = g, I = k, !E || !(E.getDtd() || CKEDITOR.dtd.span)[H] && !I || D.parentRule &&
  8098. !D.parentRule(E)) m = !0; else {
  8099. if (y || u && CKEDITOR.dtd.$removeEmpty[u] && (r.getPosition(v) | P) != P || (y = c.clone(), y.setStartBefore(r)), u = r.type, u == CKEDITOR.NODE_TEXT || x || u == CKEDITOR.NODE_ELEMENT && !r.getChildCount()) {
  8100. for (var u = r, N; (m = !u.getNext(z)) && (N = u.getParent(), q[N.getName()]) && d(N, t, h, O);) u = N;
  8101. y.setEndAfter(u)
  8102. }
  8103. } else m = !0;
  8104. r = r.getNextSourceNode(w || x)
  8105. }
  8106. if (m && y && !y.collapsed) {
  8107. for (var m = M(this, e), x = m.hasAttributes(), w = y.getCommonAncestor(), u = {}, D = {}, E = {}, H = {}, U, R, aa; m && w;) {
  8108. if (w.getName() == g) {
  8109. for (U in h.attributes) !H[U] &&
  8110. (aa = w.getAttribute(R)) && (m.getAttribute(U) == aa ? D[U] = 1 : H[U] = 1);
  8111. for (R in h.styles) !E[R] && (aa = w.getStyle(R)) && (m.getStyle(R) == aa ? u[R] = 1 : E[R] = 1)
  8112. }
  8113. w = w.getParent()
  8114. }
  8115. for (U in D) m.removeAttribute(U);
  8116. for (R in u) m.removeStyle(R);
  8117. x && !m.hasAttributes() && (m = null);
  8118. m ? (y.extractContents().appendTo(m), y.insertNode(m), F.call(this, m), m.mergeSiblings(), CKEDITOR.env.ie || m.$.normalize()) : (m = new CKEDITOR.dom.element("span"), y.extractContents().appendTo(m), y.insertNode(m), F.call(this, m), m.remove(!0));
  8119. y = null
  8120. }
  8121. }
  8122. c.moveToBookmark(p);
  8123. c.shrink(CKEDITOR.SHRINK_TEXT);
  8124. c.shrink(CKEDITOR.NODE_ELEMENT, !0)
  8125. }
  8126. }
  8127. function c(a) {
  8128. function b() {
  8129. for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(q.getParent()), e = null, f = null, g = 0; g < a.elements.length; g++) {
  8130. var l = a.elements[g];
  8131. if (l == a.block || l == a.blockLimit) break;
  8132. p.checkElementRemovable(l, !0) && (e = l)
  8133. }
  8134. for (g = 0; g < c.elements.length; g++) {
  8135. l = c.elements[g];
  8136. if (l == c.block || l == c.blockLimit) break;
  8137. p.checkElementRemovable(l, !0) && (f = l)
  8138. }
  8139. f && q.breakParent(f);
  8140. e && d.breakParent(e)
  8141. }
  8142. a.enlarge(CKEDITOR.ENLARGE_INLINE,
  8143. 1);
  8144. var c = a.createBookmark(), d = c.startNode, e = this._.definition.alwaysRemoveElement;
  8145. if (a.collapsed) {
  8146. for (var f = new CKEDITOR.dom.elementPath(d.getParent(), a.root), g, h = 0, k; h < f.elements.length && (k = f.elements[h]) && k != f.block && k != f.blockLimit; h++) if (this.checkElementRemovable(k)) {
  8147. var m;
  8148. !e && a.collapsed && (a.checkBoundaryOfElement(k, CKEDITOR.END) || (m = a.checkBoundaryOfElement(k, CKEDITOR.START))) ? (g = k, g.match = m ? "start" : "end") : (k.mergeSiblings(), k.is(this.element) ? x.call(this, k) : u(k, n(this)[k.getName()]))
  8149. }
  8150. if (g) {
  8151. e =
  8152. d;
  8153. for (h = 0; ; h++) {
  8154. k = f.elements[h];
  8155. if (k.equals(g)) break; else if (k.match) continue; else k = k.clone();
  8156. k.append(e);
  8157. e = k
  8158. }
  8159. e["start" == g.match ? "insertBefore" : "insertAfter"](g)
  8160. }
  8161. } else {
  8162. var q = c.endNode, p = this;
  8163. b();
  8164. for (f = d; !f.equals(q);) g = f.getNextSourceNode(), f.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(f) && (f.getName() == this.element ? x.call(this, f) : u(f, n(this)[f.getName()]), g.type == CKEDITOR.NODE_ELEMENT && g.contains(d) && (b(), g = d.getNext())), f = g
  8165. }
  8166. a.moveToBookmark(c);
  8167. a.shrink(CKEDITOR.NODE_ELEMENT, !0)
  8168. }
  8169. function f(a) {
  8170. var b =
  8171. [];
  8172. a.forEach(function (a) {
  8173. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  8174. }, CKEDITOR.NODE_ELEMENT, !0);
  8175. return b
  8176. }
  8177. function g(a) {
  8178. var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0);
  8179. (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && w(a, this)
  8180. }
  8181. function k(a) {
  8182. var b = a.getCommonAncestor(!0, !0);
  8183. if (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) {
  8184. var b = this._.definition, c = b.attributes;
  8185. if (c) for (var d in c) a.removeAttribute(d, c[d]);
  8186. if (b.styles) for (var e in b.styles) b.styles.hasOwnProperty(e) &&
  8187. a.removeStyle(e)
  8188. }
  8189. }
  8190. function h(a) {
  8191. var b = a.createBookmark(!0), c = a.createIterator();
  8192. c.enforceRealBlocks = !0;
  8193. this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR);
  8194. for (var d, e = a.document, f; d = c.getNextParagraph();) !d.isReadOnly() && (c.activeFilter ? c.activeFilter.check(this) : 1) && (f = M(this, e, d), q(d, f));
  8195. a.moveToBookmark(b)
  8196. }
  8197. function p(a) {
  8198. var b = a.createBookmark(1), c = a.createIterator();
  8199. c.enforceRealBlocks = !0;
  8200. c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  8201. for (var d, e; d = c.getNextParagraph();) this.checkElementRemovable(d) &&
  8202. (d.is("pre") ? ((e = this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div")) && d.copyAttributes(e), q(d, e)) : x.call(this, d));
  8203. a.moveToBookmark(b)
  8204. }
  8205. function q(a, b) {
  8206. var c = !b;
  8207. c && (b = a.getDocument().createElement("div"), a.copyAttributes(b));
  8208. var d = b && b.is("pre"), f = a.is("pre"), g = !d && f;
  8209. if (d && !f) {
  8210. f = b;
  8211. (g = a.getBogus()) && g.remove();
  8212. g = a.getHtml();
  8213. g = y(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
  8214. g = g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
  8215. g = g.replace(/([ \t\n\r]+|&nbsp;)/g,
  8216. " ");
  8217. g = g.replace(/<br\b[^>]*>/gi, "\n");
  8218. if (CKEDITOR.env.ie) {
  8219. var h = a.getDocument().createElement("div");
  8220. h.append(f);
  8221. f.$.outerHTML = "\x3cpre\x3e" + g + "\x3c/pre\x3e";
  8222. f.copyAttributes(h.getFirst());
  8223. f = h.getFirst().remove()
  8224. } else f.setHtml(g);
  8225. b = f
  8226. } else g ? b = v(c ? [a.getHtml()] : e(a), b) : a.moveChildren(b);
  8227. b.replace(a);
  8228. if (d) {
  8229. var c = b, k;
  8230. (k = c.getPrevious(I)) && k.type == CKEDITOR.NODE_ELEMENT && k.is("pre") && (d = y(k.getHtml(), /\n$/, "") + "\n\n" + y(c.getHtml(), /^\n/, ""), CKEDITOR.env.ie ? c.$.outerHTML = "\x3cpre\x3e" + d + "\x3c/pre\x3e" :
  8231. c.setHtml(d), k.remove())
  8232. } else c && m(b)
  8233. }
  8234. function e(a) {
  8235. var b = [];
  8236. y(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function (a, b, c) {
  8237. return b + "\x3c/pre\x3e" + c + "\x3cpre\x3e"
  8238. }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function (a, c) {
  8239. b.push(c)
  8240. });
  8241. return b
  8242. }
  8243. function y(a, b, c) {
  8244. var d = "", e = "";
  8245. a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function (a, b, c) {
  8246. b && (d = b);
  8247. c && (e = c);
  8248. return ""
  8249. });
  8250. return d + a.replace(b, c) + e
  8251. }
  8252. function v(a, b) {
  8253. var c;
  8254. 1 < a.length && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
  8255. for (var d = 0; d < a.length; d++) {
  8256. var e = a[d], e = e.replace(/(\r\n|\r)/g, "\n"), e = y(e, /^[ \t]*\n/, ""), e = y(e, /\n$/, ""),
  8257. e = y(e, /^[ \t]+|[ \t]+$/g, function (a, b) {
  8258. return 1 == a.length ? "\x26nbsp;" : b ? " " + CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) : CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " "
  8259. }), e = e.replace(/\n/g, "\x3cbr\x3e"), e = e.replace(/[ \t]{2,}/g, function (a) {
  8260. return CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " "
  8261. });
  8262. if (c) {
  8263. var f = b.clone();
  8264. f.setHtml(e);
  8265. c.append(f)
  8266. } else b.setHtml(e)
  8267. }
  8268. return c || b
  8269. }
  8270. function x(a, b) {
  8271. var c = this._.definition, d = c.attributes, c = c.styles, e = n(this)[a.getName()],
  8272. f = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c), g;
  8273. for (g in d) if ("class" != g && !this._.definition.fullMatch || a.getAttribute(g) == r(g, d[g])) b && "data-" == g.slice(0, 5) || (f = a.hasAttribute(g), a.removeAttribute(g));
  8274. for (var h in c) this._.definition.fullMatch && a.getStyle(h) != r(h, c[h], !0) || (f = f || !!a.getStyle(h), a.removeStyle(h));
  8275. u(a, e, E[a.getName()]);
  8276. f && (this._.definition.alwaysRemoveElement ?
  8277. m(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode == CKEDITOR.ENTER_BR && !a.hasAttributes() ? m(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div"))
  8278. }
  8279. function F(a) {
  8280. for (var b = n(this), c = a.getElementsByTag(this.element), d, e = c.count(); 0 <= --e;) d = c.getItem(e), d.isReadOnly() || x.call(this, d, !0);
  8281. for (var f in b) if (f != this.element) for (c = a.getElementsByTag(f), e = c.count() - 1; 0 <= e; e--) d = c.getItem(e), d.isReadOnly() || u(d, b[f])
  8282. }
  8283. function u(a, b, c) {
  8284. if (b = b && b.attributes) for (var d = 0; d < b.length; d++) {
  8285. var e = b[d][0],
  8286. f;
  8287. if (f = a.getAttribute(e)) {
  8288. var g = b[d][1];
  8289. (null === g || g.test && g.test(f) || "string" == typeof g && f == g) && a.removeAttribute(e)
  8290. }
  8291. }
  8292. c || m(a)
  8293. }
  8294. function m(a, b) {
  8295. if (!a.hasAttributes() || b) if (CKEDITOR.dtd.$block[a.getName()]) {
  8296. var c = a.getPrevious(I), d = a.getNext(I);
  8297. !c || c.type != CKEDITOR.NODE_TEXT && c.isBlockBoundary({br: 1}) || a.append("br", 1);
  8298. !d || d.type != CKEDITOR.NODE_TEXT && d.isBlockBoundary({br: 1}) || a.append("br");
  8299. a.remove(!0)
  8300. } else c = a.getFirst(), d = a.getLast(), a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(),
  8301. d && !c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT && d.mergeSiblings())
  8302. }
  8303. function M(a, b, c) {
  8304. var d;
  8305. d = a.element;
  8306. "*" == d && (d = "span");
  8307. d = new CKEDITOR.dom.element(d, b);
  8308. c && c.copyAttributes(d);
  8309. d = w(d, a);
  8310. b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style", 1);
  8311. return d
  8312. }
  8313. function w(a, b) {
  8314. var c = b._.definition, d = c.attributes, c = CKEDITOR.style.getStyleText(c);
  8315. if (d) for (var e in d) a.setAttribute(e, d[e]);
  8316. c && a.setAttribute("style", c);
  8317. a.getDocument().removeCustomData("doc_processing_style");
  8318. return a
  8319. }
  8320. function H(a, b) {
  8321. for (var c in a) a[c] = a[c].replace(D, function (a, c) {
  8322. return b[c]
  8323. })
  8324. }
  8325. function n(a) {
  8326. if (a._.overrides) return a._.overrides;
  8327. var b = a._.overrides = {}, c = a._.definition.overrides;
  8328. if (c) {
  8329. CKEDITOR.tools.isArray(c) || (c = [c]);
  8330. for (var d = 0; d < c.length; d++) {
  8331. var e = c[d], f, g;
  8332. "string" == typeof e ? f = e.toLowerCase() : (f = e.element ? e.element.toLowerCase() : a.element, g = e.attributes);
  8333. e = b[f] || (b[f] = {});
  8334. if (g) {
  8335. var e = e.attributes = e.attributes || [], h;
  8336. for (h in g) e.push([h.toLowerCase(), g[h]])
  8337. }
  8338. }
  8339. }
  8340. return b
  8341. }
  8342. function r(a,
  8343. b, c) {
  8344. var d = new CKEDITOR.dom.element("span");
  8345. d[c ? "setStyle" : "setAttribute"](a, b);
  8346. return d[c ? "getStyle" : "getAttribute"](a)
  8347. }
  8348. function C(a, b) {
  8349. function c(a, b) {
  8350. return "font-family" == b.toLowerCase() ? a.replace(/["']/g, "") : a
  8351. }
  8352. "string" == typeof a && (a = CKEDITOR.tools.parseCssText(a));
  8353. "string" == typeof b && (b = CKEDITOR.tools.parseCssText(b, !0));
  8354. for (var d in a) if (!(d in b) || c(b[d], d) != c(a[d], d) && "inherit" != a[d] && "inherit" != b[d]) return !1;
  8355. return !0
  8356. }
  8357. function L(a, b, c) {
  8358. var d = a.getRanges();
  8359. b = b ? this.removeFromRange : this.applyToRange;
  8360. var e, f;
  8361. if (a.isFake && a.isInTable()) for (e = [], f = 0; f < d.length; f++) e.push(d[f].clone());
  8362. for (var g = d.createIterator(); f = g.getNextRange();) b.call(this, f, c);
  8363. a.selectRanges(e || d)
  8364. }
  8365. var E = {
  8366. address: 1,
  8367. div: 1,
  8368. h1: 1,
  8369. h2: 1,
  8370. h3: 1,
  8371. h4: 1,
  8372. h5: 1,
  8373. h6: 1,
  8374. p: 1,
  8375. pre: 1,
  8376. section: 1,
  8377. header: 1,
  8378. footer: 1,
  8379. nav: 1,
  8380. article: 1,
  8381. aside: 1,
  8382. figure: 1,
  8383. dialog: 1,
  8384. hgroup: 1,
  8385. time: 1,
  8386. meter: 1,
  8387. menu: 1,
  8388. command: 1,
  8389. keygen: 1,
  8390. output: 1,
  8391. progress: 1,
  8392. details: 1,
  8393. datagrid: 1,
  8394. datalist: 1
  8395. }, N = {
  8396. a: 1,
  8397. blockquote: 1,
  8398. embed: 1,
  8399. hr: 1,
  8400. img: 1,
  8401. li: 1,
  8402. object: 1,
  8403. ol: 1,
  8404. table: 1,
  8405. td: 1,
  8406. tr: 1,
  8407. th: 1,
  8408. ul: 1,
  8409. dl: 1,
  8410. dt: 1,
  8411. dd: 1,
  8412. form: 1,
  8413. audio: 1,
  8414. video: 1
  8415. }, t = /\s*(?:;\s*|$)/, D = /#\((.+?)\)/g, z = CKEDITOR.dom.walker.bookmark(0, 1),
  8416. I = CKEDITOR.dom.walker.whitespaces(1);
  8417. CKEDITOR.style = function (a, b) {
  8418. if ("string" == typeof a.type) return new CKEDITOR.style.customHandlers[a.type](a);
  8419. var c = a.attributes;
  8420. c && c.style && (a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style)), delete c.style);
  8421. b && (a = CKEDITOR.tools.clone(a), H(a.attributes, b), H(a.styles, b));
  8422. c = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() :
  8423. a.element : "*";
  8424. this.type = a.type || (E[c] ? CKEDITOR.STYLE_BLOCK : N[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
  8425. "object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT);
  8426. this._ = {definition: a}
  8427. };
  8428. CKEDITOR.style.prototype = {
  8429. apply: function (a) {
  8430. if (a instanceof CKEDITOR.dom.document) return L.call(this, a.getSelection());
  8431. if (this.checkApplicable(a.elementPath(), a)) {
  8432. var b = this._.enterMode;
  8433. b || (this._.enterMode = a.activeEnterMode);
  8434. L.call(this, a.getSelection(), 0, a);
  8435. this._.enterMode = b
  8436. }
  8437. }, remove: function (a) {
  8438. if (a instanceof
  8439. CKEDITOR.dom.document) return L.call(this, a.getSelection(), 1);
  8440. if (this.checkApplicable(a.elementPath(), a)) {
  8441. var b = this._.enterMode;
  8442. b || (this._.enterMode = a.activeEnterMode);
  8443. L.call(this, a.getSelection(), 1, a);
  8444. this._.enterMode = b
  8445. }
  8446. }, applyToRange: function (a) {
  8447. this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? h : this.type == CKEDITOR.STYLE_OBJECT ? g : null;
  8448. return this.applyToRange(a)
  8449. }, removeFromRange: function (a) {
  8450. this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ?
  8451. p : this.type == CKEDITOR.STYLE_OBJECT ? k : null;
  8452. return this.removeFromRange(a)
  8453. }, applyToObject: function (a) {
  8454. w(a, this)
  8455. }, checkActive: function (a, b) {
  8456. switch (this.type) {
  8457. case CKEDITOR.STYLE_BLOCK:
  8458. return this.checkElementRemovable(a.block || a.blockLimit, !0, b);
  8459. case CKEDITOR.STYLE_OBJECT:
  8460. case CKEDITOR.STYLE_INLINE:
  8461. for (var c = a.elements, d = 0, e; d < c.length; d++) if (e = c[d], this.type != CKEDITOR.STYLE_INLINE || e != a.block && e != a.blockLimit) {
  8462. if (this.type == CKEDITOR.STYLE_OBJECT) {
  8463. var f = e.getName();
  8464. if (!("string" == typeof this.element ?
  8465. f == this.element : f in this.element)) continue
  8466. }
  8467. if (this.checkElementRemovable(e, !0, b)) return !0
  8468. }
  8469. }
  8470. return !1
  8471. }, checkApplicable: function (a, b, c) {
  8472. b && b instanceof CKEDITOR.filter && (c = b);
  8473. if (c && !c.check(this)) return !1;
  8474. switch (this.type) {
  8475. case CKEDITOR.STYLE_OBJECT:
  8476. return !!a.contains(this.element);
  8477. case CKEDITOR.STYLE_BLOCK:
  8478. return !!a.blockLimit.getDtd()[this.element]
  8479. }
  8480. return !0
  8481. }, checkElementMatch: function (a, b) {
  8482. var c = this._.definition;
  8483. if (!a || !c.ignoreReadonly && a.isReadOnly()) return !1;
  8484. var d = a.getName();
  8485. if ("string" == typeof this.element ?
  8486. d == this.element : d in this.element) {
  8487. if (!b && !a.hasAttributes()) return !0;
  8488. if (d = c._AC) c = d; else {
  8489. var d = {}, e = 0, f = c.attributes;
  8490. if (f) for (var g in f) e++, d[g] = f[g];
  8491. if (g = CKEDITOR.style.getStyleText(c)) d.style || e++, d.style = g;
  8492. d._length = e;
  8493. c = c._AC = d
  8494. }
  8495. if (c._length) {
  8496. for (var h in c) if ("_length" != h) if (d = a.getAttribute(h) || "", "style" == h ? C(c[h], d) : c[h] == d) {
  8497. if (!b) return !0
  8498. } else if (b) return !1;
  8499. if (b) return !0
  8500. } else return !0
  8501. }
  8502. return !1
  8503. }, checkElementRemovable: function (a, b, c) {
  8504. if (this.checkElementMatch(a, b, c)) return !0;
  8505. if (b = n(this)[a.getName()]) {
  8506. var d;
  8507. if (!(b = b.attributes)) return !0;
  8508. for (c = 0; c < b.length; c++) if (d = b[c][0], d = a.getAttribute(d)) {
  8509. var e = b[c][1];
  8510. if (null === e) return !0;
  8511. if ("string" == typeof e) {
  8512. if (d == e) return !0
  8513. } else if (e.test(d)) return !0
  8514. }
  8515. }
  8516. return !1
  8517. }, buildPreview: function (a) {
  8518. var b = this._.definition, c = [], d = b.element;
  8519. "bdo" == d && (d = "span");
  8520. var c = ["\x3c", d], e = b.attributes;
  8521. if (e) for (var f in e) c.push(" ", f, '\x3d"', e[f], '"');
  8522. (e = CKEDITOR.style.getStyleText(b)) && c.push(' style\x3d"', e, '"');
  8523. c.push("\x3e", a || b.name, "\x3c/", d, "\x3e");
  8524. return c.join("")
  8525. }, getDefinition: function () {
  8526. return this._.definition
  8527. }
  8528. };
  8529. CKEDITOR.style.getStyleText = function (a) {
  8530. var b = a._ST;
  8531. if (b) return b;
  8532. var b = a.styles, c = a.attributes && a.attributes.style || "", d = "";
  8533. c.length && (c = c.replace(t, ";"));
  8534. for (var e in b) {
  8535. var f = b[e], g = (e + ":" + f).replace(t, ";");
  8536. "inherit" == f ? d += g : c += g
  8537. }
  8538. c.length && (c = CKEDITOR.tools.normalizeCssText(c, !0));
  8539. return a._ST = c + d
  8540. };
  8541. CKEDITOR.style.customHandlers = {};
  8542. CKEDITOR.style.addCustomHandler = function (a) {
  8543. var b = function (a) {
  8544. this._ = {definition: a};
  8545. this.setup && this.setup(a)
  8546. };
  8547. b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),
  8548. {assignedTo: CKEDITOR.STYLE_OBJECT}, a, !0);
  8549. return this.customHandlers[a.type] = b
  8550. };
  8551. var P = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
  8552. O = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
  8553. })();
  8554. CKEDITOR.styleCommand = function (a, d) {
  8555. this.requiredContent = this.allowedContent = this.style = a;
  8556. CKEDITOR.tools.extend(this, d, !0)
  8557. };
  8558. CKEDITOR.styleCommand.prototype.exec = function (a) {
  8559. a.focus();
  8560. this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON && a.removeStyle(this.style)
  8561. };
  8562. CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet");
  8563. CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet);
  8564. CKEDITOR.loadStylesSet = function (a, d, b) {
  8565. CKEDITOR.stylesSet.addExternal(a, d, "");
  8566. CKEDITOR.stylesSet.load(a, b)
  8567. };
  8568. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  8569. attachStyleStateChange: function (a, d) {
  8570. var b = this._.styleStateChangeCallbacks;
  8571. b || (b = this._.styleStateChangeCallbacks = [], this.on("selectionChange", function (a) {
  8572. for (var d = 0; d < b.length; d++) {
  8573. var g = b[d],
  8574. k = g.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
  8575. g.fn.call(this, k)
  8576. }
  8577. }));
  8578. b.push({style: a, fn: d})
  8579. }, applyStyle: function (a) {
  8580. a.apply(this)
  8581. }, removeStyle: function (a) {
  8582. a.remove(this)
  8583. }, getStylesSet: function (a) {
  8584. if (this._.stylesDefinitions) a(this._.stylesDefinitions);
  8585. else {
  8586. var d = this, b = d.config.stylesCombo_stylesSet || d.config.stylesSet;
  8587. if (!1 === b) a(null); else if (b instanceof Array) d._.stylesDefinitions = b, a(b); else {
  8588. b || (b = "default");
  8589. var b = b.split(":"), c = b[0];
  8590. CKEDITOR.stylesSet.addExternal(c, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
  8591. CKEDITOR.stylesSet.load(c, function (b) {
  8592. d._.stylesDefinitions = b[c];
  8593. a(d._.stylesDefinitions)
  8594. })
  8595. }
  8596. }
  8597. }
  8598. });
  8599. CKEDITOR.dom.comment = function (a, d) {
  8600. "string" == typeof a && (a = (d ? d.$ : document).createComment(a));
  8601. CKEDITOR.dom.domObject.call(this, a)
  8602. };
  8603. CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node;
  8604. CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
  8605. type: CKEDITOR.NODE_COMMENT, getOuterHtml: function () {
  8606. return "\x3c!--" + this.$.nodeValue + "--\x3e"
  8607. }
  8608. });
  8609. "use strict";
  8610. (function () {
  8611. var a = {}, d = {}, b;
  8612. for (b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1);
  8613. for (b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (d[b] = 1);
  8614. CKEDITOR.dom.elementPath = function (b, f) {
  8615. var g = null, k = null, h = [], p = b, q;
  8616. f = f || b.getDocument().getBody();
  8617. p || (p = f);
  8618. do if (p.type == CKEDITOR.NODE_ELEMENT) {
  8619. h.push(p);
  8620. if (!this.lastElement && (this.lastElement = p, p.is(CKEDITOR.dtd.$object) || "false" == p.getAttribute("contenteditable"))) continue;
  8621. if (p.equals(f)) break;
  8622. if (!k && (q = p.getName(),
  8623. "true" == p.getAttribute("contenteditable") ? k = p : !g && d[q] && (g = p), a[q])) {
  8624. if (q = !g && "div" == q) {
  8625. a:{
  8626. q = p.getChildren();
  8627. for (var e = 0, y = q.count(); e < y; e++) {
  8628. var v = q.getItem(e);
  8629. if (v.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[v.getName()]) {
  8630. q = !0;
  8631. break a
  8632. }
  8633. }
  8634. q = !1
  8635. }
  8636. q = !q
  8637. }
  8638. q ? g = p : k = p
  8639. }
  8640. } while (p = p.getParent());
  8641. k || (k = f);
  8642. this.block = g;
  8643. this.blockLimit = k;
  8644. this.root = f;
  8645. this.elements = h
  8646. }
  8647. })();
  8648. CKEDITOR.dom.elementPath.prototype = {
  8649. compare: function (a) {
  8650. var d = this.elements;
  8651. a = a && a.elements;
  8652. if (!a || d.length != a.length) return !1;
  8653. for (var b = 0; b < d.length; b++) if (!d[b].equals(a[b])) return !1;
  8654. return !0
  8655. }, contains: function (a, d, b) {
  8656. var c = 0, f;
  8657. "string" == typeof a && (f = function (b) {
  8658. return b.getName() == a
  8659. });
  8660. a instanceof CKEDITOR.dom.element ? f = function (b) {
  8661. return b.equals(a)
  8662. } : CKEDITOR.tools.isArray(a) ? f = function (b) {
  8663. return -1 < CKEDITOR.tools.indexOf(a, b.getName())
  8664. } : "function" == typeof a ? f = a : "object" == typeof a && (f = function (b) {
  8665. return b.getName() in
  8666. a
  8667. });
  8668. var g = this.elements, k = g.length;
  8669. d && (b ? c += 1 : --k);
  8670. b && (g = Array.prototype.slice.call(g, 0), g.reverse());
  8671. for (; c < k; c++) if (f(g[c])) return g[c];
  8672. return null
  8673. }, isContextFor: function (a) {
  8674. var d;
  8675. return a in CKEDITOR.dtd.$block ? (d = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this.block) && this.block || this.blockLimit, !!d.getDtd()[a]) : !0
  8676. }, direction: function () {
  8677. return (this.block || this.blockLimit || this.root).getDirection(1)
  8678. }
  8679. };
  8680. CKEDITOR.dom.text = function (a, d) {
  8681. "string" == typeof a && (a = (d ? d.$ : document).createTextNode(a));
  8682. this.$ = a
  8683. };
  8684. CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node;
  8685. CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
  8686. type: CKEDITOR.NODE_TEXT, getLength: function () {
  8687. return this.$.nodeValue.length
  8688. }, getText: function () {
  8689. return this.$.nodeValue
  8690. }, setText: function (a) {
  8691. this.$.nodeValue = a
  8692. }, split: function (a) {
  8693. var d = this.$.parentNode, b = d.childNodes.length, c = this.getLength(), f = this.getDocument(),
  8694. g = new CKEDITOR.dom.text(this.$.splitText(a), f);
  8695. d.childNodes.length == b && (a >= c ? (g = f.createText(""), g.insertAfter(this)) : (a = f.createText(""), a.insertAfter(g), a.remove()));
  8696. return g
  8697. }, substring: function (a,
  8698. d) {
  8699. return "number" != typeof d ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, d)
  8700. }
  8701. });
  8702. (function () {
  8703. function a(a, c, d) {
  8704. var g = a.serializable, k = c[d ? "endContainer" : "startContainer"], h = d ? "endOffset" : "startOffset",
  8705. p = g ? c.document.getById(a.startNode) : a.startNode;
  8706. a = g ? c.document.getById(a.endNode) : a.endNode;
  8707. k.equals(p.getPrevious()) ? (c.startOffset = c.startOffset - k.getLength() - a.getPrevious().getLength(), k = a.getNext()) : k.equals(a.getPrevious()) && (c.startOffset -= k.getLength(), k = a.getNext());
  8708. k.equals(p.getParent()) && c[h]++;
  8709. k.equals(a.getParent()) && c[h]++;
  8710. c[d ? "endContainer" : "startContainer"] = k;
  8711. return c
  8712. }
  8713. CKEDITOR.dom.rangeList = function (a) {
  8714. if (a instanceof CKEDITOR.dom.rangeList) return a;
  8715. a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = [];
  8716. return CKEDITOR.tools.extend(a, d)
  8717. };
  8718. var d = {
  8719. createIterator: function () {
  8720. var a = this, c = CKEDITOR.dom.walker.bookmark(), d = [], g;
  8721. return {
  8722. getNextRange: function (k) {
  8723. g = void 0 === g ? 0 : g + 1;
  8724. var h = a[g];
  8725. if (h && 1 < a.length) {
  8726. if (!g) for (var p = a.length - 1; 0 <= p; p--) d.unshift(a[p].createBookmark(!0));
  8727. if (k) for (var q = 0; a[g + q + 1];) {
  8728. var e = h.document;
  8729. k = 0;
  8730. p = e.getById(d[q].endNode);
  8731. for (e = e.getById(d[q + 1].startNode); ;) {
  8732. p =
  8733. p.getNextSourceNode(!1);
  8734. if (e.equals(p)) k = 1; else if (c(p) || p.type == CKEDITOR.NODE_ELEMENT && p.isBlockBoundary()) continue;
  8735. break
  8736. }
  8737. if (!k) break;
  8738. q++
  8739. }
  8740. for (h.moveToBookmark(d.shift()); q--;) p = a[++g], p.moveToBookmark(d.shift()), h.setEnd(p.endContainer, p.endOffset)
  8741. }
  8742. return h
  8743. }
  8744. }
  8745. }, createBookmarks: function (b) {
  8746. for (var c = [], d, g = 0; g < this.length; g++) {
  8747. c.push(d = this[g].createBookmark(b, !0));
  8748. for (var k = g + 1; k < this.length; k++) this[k] = a(d, this[k]), this[k] = a(d, this[k], !0)
  8749. }
  8750. return c
  8751. }, createBookmarks2: function (a) {
  8752. for (var c = [], d = 0; d <
  8753. this.length; d++) c.push(this[d].createBookmark2(a));
  8754. return c
  8755. }, moveToBookmarks: function (a) {
  8756. for (var c = 0; c < this.length; c++) this[c].moveToBookmark(a[c])
  8757. }
  8758. }
  8759. })();
  8760. (function () {
  8761. function a() {
  8762. return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/")
  8763. }
  8764. function d(b) {
  8765. var c = CKEDITOR.skin["ua_" + b], d = CKEDITOR.env;
  8766. if (c) for (var c = c.split(",").sort(function (a, b) {
  8767. return a > b ? -1 : 1
  8768. }), f = 0, g; f < c.length; f++) if (g = c[f], d.ie && (g.replace(/^ie/, "") == d.version || d.quirks && "iequirks" == g) && (g = "ie"), d[g]) {
  8769. b += "_" + c[f];
  8770. break
  8771. }
  8772. return CKEDITOR.getUrl(a() + b + ".css")
  8773. }
  8774. function b(a, b) {
  8775. g[a] || (CKEDITOR.document.appendStyleSheet(d(a)), g[a] = 1);
  8776. b && b()
  8777. }
  8778. function c(a) {
  8779. var b =
  8780. a.getById(k);
  8781. b || (b = a.getHead().append("style"), b.setAttribute("id", k), b.setAttribute("type", "text/css"));
  8782. return b
  8783. }
  8784. function f(a, b, c) {
  8785. var d, f, g;
  8786. if (CKEDITOR.env.webkit) for (b = b.split("}").slice(0, -1), f = 0; f < b.length; f++) b[f] = b[f].split("{");
  8787. for (var h = 0; h < a.length; h++) if (CKEDITOR.env.webkit) for (f = 0; f < b.length; f++) {
  8788. g = b[f][1];
  8789. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  8790. a[h].$.sheet.addRule(b[f][0], g)
  8791. } else {
  8792. g = b;
  8793. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  8794. CKEDITOR.env.ie && 11 > CKEDITOR.env.version ?
  8795. a[h].$.styleSheet.cssText += g : a[h].$.innerHTML += g
  8796. }
  8797. }
  8798. var g = {};
  8799. CKEDITOR.skin = {
  8800. path: a, loadPart: function (c, d) {
  8801. CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() + "skin.js"), function () {
  8802. b(c, d)
  8803. }) : b(c, d)
  8804. }, getPath: function (a) {
  8805. return CKEDITOR.getUrl(d(a))
  8806. }, icons: {}, addIcon: function (a, b, c, d) {
  8807. a = a.toLowerCase();
  8808. this.icons[a] || (this.icons[a] = {path: b, offset: c || 0, bgsize: d || "16px"})
  8809. }, getIconStyle: function (a, b, c, d, f) {
  8810. var g;
  8811. a && (a = a.toLowerCase(), b && (g = this.icons[a + "-rtl"]),
  8812. g || (g = this.icons[a]));
  8813. a = c || g && g.path || "";
  8814. d = d || g && g.offset;
  8815. f = f || g && g.bgsize || "16px";
  8816. a && (a = a.replace(/'/g, "\\'"));
  8817. return a && "background-image:url('" + CKEDITOR.getUrl(a) + "');background-position:0 " + d + "px;background-size:" + f + ";"
  8818. }
  8819. };
  8820. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  8821. getUiColor: function () {
  8822. return this.uiColor
  8823. }, setUiColor: function (a) {
  8824. var b = c(CKEDITOR.document);
  8825. return (this.setUiColor = function (a) {
  8826. this.uiColor = a;
  8827. var c = CKEDITOR.skin.chameleon, d = "", g = "";
  8828. "function" == typeof c && (d = c(this, "editor"), g =
  8829. c(this, "panel"));
  8830. a = [[p, a]];
  8831. f([b], d, a);
  8832. f(h, g, a)
  8833. }).call(this, a)
  8834. }
  8835. });
  8836. var k = "cke_ui_color", h = [], p = /\$color/g;
  8837. CKEDITOR.on("instanceLoaded", function (a) {
  8838. if (!CKEDITOR.env.ie || !CKEDITOR.env.quirks) {
  8839. var b = a.editor;
  8840. a = function (a) {
  8841. a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
  8842. if (!a.getById("cke_ui_color")) {
  8843. var d = c(a);
  8844. h.push(d);
  8845. b.on("destroy", function () {
  8846. h = CKEDITOR.tools.array.filter(h, function (a) {
  8847. return d !== a
  8848. })
  8849. });
  8850. (a = b.getUiColor()) && f([d], CKEDITOR.skin.chameleon(b, "panel"),
  8851. [[p, a]])
  8852. }
  8853. };
  8854. b.on("panelShow", a);
  8855. b.on("menuShow", a);
  8856. b.config.uiColor && b.setUiColor(b.config.uiColor)
  8857. }
  8858. })
  8859. })();
  8860. (function () {
  8861. if (CKEDITOR.env.webkit) CKEDITOR.env.hc = !1; else {
  8862. var a = CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e', CKEDITOR.document);
  8863. a.appendTo(CKEDITOR.document.getHead());
  8864. try {
  8865. var d = a.getComputedStyle("border-top-color"), b = a.getComputedStyle("border-right-color");
  8866. CKEDITOR.env.hc = !(!d || d != b)
  8867. } catch (c) {
  8868. CKEDITOR.env.hc = !1
  8869. }
  8870. a.remove()
  8871. }
  8872. CKEDITOR.env.hc && (CKEDITOR.env.cssClass += " cke_hc");
  8873. CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
  8874. CKEDITOR.status = "loaded";
  8875. CKEDITOR.fireOnce("loaded");
  8876. if (a = CKEDITOR._.pending) for (delete CKEDITOR._.pending, d = 0; d < a.length; d++) CKEDITOR.editor.prototype.constructor.apply(a[d][0], a[d][1]), CKEDITOR.add(a[d][0])
  8877. })();/*
  8878. Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  8879. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8880. */
  8881. CKEDITOR.skin.name = "moono-lisa";
  8882. CKEDITOR.skin.ua_editor = "ie,iequirks,ie8,gecko";
  8883. CKEDITOR.skin.ua_dialog = "ie,iequirks,ie8";
  8884. CKEDITOR.skin.chameleon = function () {
  8885. var b = function () {
  8886. return function (b, d) {
  8887. for (var a = b.match(/[^#]./g), e = 0; 3 > e; e++) {
  8888. var f = e, c;
  8889. c = parseInt(a[e], 16);
  8890. c = ("0" + (0 > d ? 0 | c * (1 + d) : 0 | c + (255 - c) * d).toString(16)).slice(-2);
  8891. a[f] = c
  8892. }
  8893. return "#" + a.join("")
  8894. }
  8895. }(), f = {
  8896. editor: new CKEDITOR.template("{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};] "),
  8897. panel: new CKEDITOR.template(".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};] ")
  8898. };
  8899. return function (g, d) {
  8900. var a = b(g.uiColor, .4), a = {
  8901. id: "." + g.id,
  8902. defaultBorder: b(a, -.2),
  8903. toolbarElementsBorder: b(a, -.25),
  8904. defaultBackground: a,
  8905. lightBackground: b(a, .8),
  8906. darkBackground: b(a, -.15),
  8907. ckeButtonOn: b(a, .4),
  8908. ckeResizer: b(a, -.4),
  8909. ckeColorauto: b(a, .8),
  8910. dialogBody: b(a, .7),
  8911. dialogTab: b(a, .65),
  8912. dialogTabSelected: "#FFF",
  8913. dialogTabSelectedBorder: "#FFF",
  8914. elementsPathColor: b(a, -.6),
  8915. menubuttonHover: b(a, .1),
  8916. menubuttonIcon: b(a, .5),
  8917. menubuttonIconHover: b(a, .3)
  8918. };
  8919. return f[d].output(a).replace(/\[/g, "{").replace(/\]/g, "}")
  8920. }
  8921. }();
  8922. CKEDITOR.plugins.add("dialogui", {
  8923. onLoad: function () {
  8924. var h = function (b) {
  8925. this._ || (this._ = {});
  8926. this._["default"] = this._.initValue = b["default"] || "";
  8927. this._.required = b.required || !1;
  8928. for (var a = [this._], d = 1; d < arguments.length; d++) a.push(arguments[d]);
  8929. a.push(!0);
  8930. CKEDITOR.tools.extend.apply(CKEDITOR.tools, a);
  8931. return this._
  8932. }, r = {
  8933. build: function (b, a, d) {
  8934. return new CKEDITOR.ui.dialog.textInput(b, a, d)
  8935. }
  8936. }, n = {
  8937. build: function (b, a, d) {
  8938. return new CKEDITOR.ui.dialog[a.type](b, a, d)
  8939. }
  8940. }, q = {
  8941. isChanged: function () {
  8942. return this.getValue() !=
  8943. this.getInitValue()
  8944. }, reset: function (b) {
  8945. this.setValue(this.getInitValue(), b)
  8946. }, setInitValue: function () {
  8947. this._.initValue = this.getValue()
  8948. }, resetInitValue: function () {
  8949. this._.initValue = this._["default"]
  8950. }, getInitValue: function () {
  8951. return this._.initValue
  8952. }
  8953. }, v = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  8954. onChange: function (b, a) {
  8955. this._.domOnChangeRegistered || (b.on("load", function () {
  8956. this.getInputElement().on("change", function () {
  8957. b.parts.dialog.isVisible() && this.fire("change", {value: this.getValue()})
  8958. },
  8959. this)
  8960. }, this), this._.domOnChangeRegistered = !0);
  8961. this.on("change", a)
  8962. }
  8963. }, !0), x = /^on([A-Z]\w+)/, t = function (b) {
  8964. for (var a in b) (x.test(a) || "title" == a || "type" == a) && delete b[a];
  8965. return b
  8966. }, w = function (b) {
  8967. b = b.data.getKeystroke();
  8968. b == CKEDITOR.SHIFT + CKEDITOR.ALT + 36 ? this.setDirectionMarker("ltr") : b == CKEDITOR.SHIFT + CKEDITOR.ALT + 35 && this.setDirectionMarker("rtl")
  8969. };
  8970. CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
  8971. labeledElement: function (b, a, d, f) {
  8972. if (!(4 > arguments.length)) {
  8973. var c = h.call(this, a);
  8974. c.labelId = CKEDITOR.tools.getNextId() +
  8975. "_label";
  8976. this._.children = [];
  8977. var e = {role: a.role || "presentation"};
  8978. a.includeLabel && (e["aria-labelledby"] = c.labelId);
  8979. CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "div", null, e, function () {
  8980. var e = [], g = a.required ? " cke_required" : "";
  8981. "horizontal" != a.labelLayout ? e.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label' + g + '" ', ' id\x3d"' + c.labelId + '"', c.inputId ? ' for\x3d"' + c.inputId + '"' : "", (a.labelStyle ? ' style\x3d"' + a.labelStyle + '"' : "") + "\x3e", a.label, "\x3c/label\x3e", '\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',
  8982. a.controlStyle ? ' style\x3d"' + a.controlStyle + '"' : "", ' role\x3d"presentation"\x3e', f.call(this, b, a), "\x3c/div\x3e") : (g = {
  8983. type: "hbox",
  8984. widths: a.widths,
  8985. padding: 0,
  8986. children: [{
  8987. type: "html",
  8988. html: '\x3clabel class\x3d"cke_dialog_ui_labeled_label' + g + '" id\x3d"' + c.labelId + '" for\x3d"' + c.inputId + '"' + (a.labelStyle ? ' style\x3d"' + a.labelStyle + '"' : "") + "\x3e" + CKEDITOR.tools.htmlEncode(a.label) + "\x3c/label\x3e"
  8989. }, {
  8990. type: "html",
  8991. html: '\x3cspan class\x3d"cke_dialog_ui_labeled_content"' + (a.controlStyle ? ' style\x3d"' + a.controlStyle +
  8992. '"' : "") + "\x3e" + f.call(this, b, a) + "\x3c/span\x3e"
  8993. }]
  8994. }, CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, g, e));
  8995. return e.join("")
  8996. })
  8997. }
  8998. }, textInput: function (b, a, d) {
  8999. if (!(3 > arguments.length)) {
  9000. h.call(this, a);
  9001. var f = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
  9002. c = {"class": "cke_dialog_ui_input_" + a.type, id: f, type: a.type};
  9003. a.validate && (this.validate = a.validate);
  9004. a.maxLength && (c.maxlength = a.maxLength);
  9005. a.size && (c.size = a.size);
  9006. a.inputStyle && (c.style = a.inputStyle);
  9007. var e = this, m = !1;
  9008. b.on("load", function () {
  9009. e.getInputElement().on("keydown",
  9010. function (a) {
  9011. 13 == a.data.getKeystroke() && (m = !0)
  9012. });
  9013. e.getInputElement().on("keyup", function (a) {
  9014. 13 == a.data.getKeystroke() && m && (b.getButton("ok") && setTimeout(function () {
  9015. b.getButton("ok").click()
  9016. }, 0), m = !1);
  9017. e.bidi && w.call(e, a)
  9018. }, null, null, 1E3)
  9019. });
  9020. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () {
  9021. var b = ['\x3cdiv class\x3d"cke_dialog_ui_input_', a.type, '" role\x3d"presentation"'];
  9022. a.width && b.push('style\x3d"width:' + a.width + '" ');
  9023. b.push("\x3e\x3cinput ");
  9024. c["aria-labelledby"] = this._.labelId;
  9025. this._.required &&
  9026. (c["aria-required"] = this._.required);
  9027. for (var e in c) b.push(e + '\x3d"' + c[e] + '" ');
  9028. b.push(" /\x3e\x3c/div\x3e");
  9029. return b.join("")
  9030. })
  9031. }
  9032. }, textarea: function (b, a, d) {
  9033. if (!(3 > arguments.length)) {
  9034. h.call(this, a);
  9035. var f = this, c = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea", e = {};
  9036. a.validate && (this.validate = a.validate);
  9037. e.rows = a.rows || 5;
  9038. e.cols = a.cols || 20;
  9039. e["class"] = "cke_dialog_ui_input_textarea " + (a["class"] || "");
  9040. "undefined" != typeof a.inputStyle && (e.style = a.inputStyle);
  9041. a.dir && (e.dir = a.dir);
  9042. if (f.bidi) b.on("load",
  9043. function () {
  9044. f.getInputElement().on("keyup", w)
  9045. }, f);
  9046. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () {
  9047. e["aria-labelledby"] = this._.labelId;
  9048. this._.required && (e["aria-required"] = this._.required);
  9049. var a = ['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"', c, '" '],
  9050. b;
  9051. for (b in e) a.push(b + '\x3d"' + CKEDITOR.tools.htmlEncode(e[b]) + '" ');
  9052. a.push("\x3e", CKEDITOR.tools.htmlEncode(f._["default"]), "\x3c/textarea\x3e\x3c/div\x3e");
  9053. return a.join("")
  9054. })
  9055. }
  9056. }, checkbox: function (b,
  9057. a, d) {
  9058. if (!(3 > arguments.length)) {
  9059. var f = h.call(this, a, {"default": !!a["default"]});
  9060. a.validate && (this.validate = a.validate);
  9061. CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "span", null, null, function () {
  9062. var c = CKEDITOR.tools.extend({}, a, {id: a.id ? a.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox"}, !0),
  9063. e = [], d = CKEDITOR.tools.getNextId() + "_label",
  9064. g = {"class": "cke_dialog_ui_checkbox_input", type: "checkbox", "aria-labelledby": d};
  9065. t(c);
  9066. a["default"] && (g.checked = "checked");
  9067. "undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
  9068. f.checkbox = new CKEDITOR.ui.dialog.uiElement(b, c, e, "input", null, g);
  9069. e.push(' \x3clabel id\x3d"', d, '" for\x3d"', g.id, '"' + (a.labelStyle ? ' style\x3d"' + a.labelStyle + '"' : "") + "\x3e", CKEDITOR.tools.htmlEncode(a.label), "\x3c/label\x3e");
  9070. return e.join("")
  9071. })
  9072. }
  9073. }, radio: function (b, a, d) {
  9074. if (!(3 > arguments.length)) {
  9075. h.call(this, a);
  9076. this._["default"] || (this._["default"] = this._.initValue = a.items[0][1]);
  9077. a.validate && (this.validate = a.validate);
  9078. var f = [], c = this;
  9079. a.role = "radiogroup";
  9080. a.includeLabel = !0;
  9081. CKEDITOR.ui.dialog.labeledElement.call(this,
  9082. b, a, d, function () {
  9083. for (var e = [], d = [], g = (a.id ? a.id : CKEDITOR.tools.getNextId()) + "_radio", k = 0; k < a.items.length; k++) {
  9084. var l = a.items[k], h = void 0 !== l[2] ? l[2] : l[0],
  9085. n = void 0 !== l[1] ? l[1] : l[0],
  9086. p = CKEDITOR.tools.getNextId() + "_radio_input", q = p + "_label",
  9087. p = CKEDITOR.tools.extend({}, a, {id: p, title: null, type: null}, !0),
  9088. h = CKEDITOR.tools.extend({}, p, {title: h}, !0), r = {
  9089. type: "radio",
  9090. "class": "cke_dialog_ui_radio_input",
  9091. name: g,
  9092. value: n,
  9093. "aria-labelledby": q
  9094. }, u = [];
  9095. c._["default"] == n && (r.checked = "checked");
  9096. t(p);
  9097. t(h);
  9098. "undefined" != typeof p.inputStyle &&
  9099. (p.style = p.inputStyle);
  9100. p.keyboardFocusable = !0;
  9101. f.push(new CKEDITOR.ui.dialog.uiElement(b, p, u, "input", null, r));
  9102. u.push(" ");
  9103. new CKEDITOR.ui.dialog.uiElement(b, h, u, "label", null, {
  9104. id: q,
  9105. "for": r.id
  9106. }, l[0]);
  9107. e.push(u.join(""))
  9108. }
  9109. new CKEDITOR.ui.dialog.hbox(b, f, e, d);
  9110. return d.join("")
  9111. });
  9112. this._.children = f
  9113. }
  9114. }, button: function (b, a, d) {
  9115. if (arguments.length) {
  9116. "function" == typeof a && (a = a(b.getParentEditor()));
  9117. h.call(this, a, {disabled: a.disabled || !1});
  9118. CKEDITOR.event.implementOn(this);
  9119. var f = this;
  9120. b.on("load", function () {
  9121. var a = this.getElement();
  9122. (function () {
  9123. a.on("click", function (a) {
  9124. f.click();
  9125. a.data.preventDefault()
  9126. });
  9127. a.on("keydown", function (a) {
  9128. a.data.getKeystroke() in {32: 1} && (f.click(), a.data.preventDefault())
  9129. })
  9130. })();
  9131. a.unselectable()
  9132. }, this);
  9133. var c = CKEDITOR.tools.extend({}, a);
  9134. delete c.style;
  9135. var e = CKEDITOR.tools.getNextId() + "_label";
  9136. CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "a", null, {
  9137. style: a.style,
  9138. href: "javascript:void(0)",
  9139. title: a.label,
  9140. hidefocus: "true",
  9141. "class": a["class"],
  9142. role: "button",
  9143. "aria-labelledby": e
  9144. }, '\x3cspan id\x3d"' + e + '" class\x3d"cke_dialog_ui_button"\x3e' +
  9145. CKEDITOR.tools.htmlEncode(a.label) + "\x3c/span\x3e")
  9146. }
  9147. }, select: function (b, a, d) {
  9148. if (!(3 > arguments.length)) {
  9149. var f = h.call(this, a);
  9150. a.validate && (this.validate = a.validate);
  9151. f.inputId = CKEDITOR.tools.getNextId() + "_select";
  9152. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () {
  9153. var c = CKEDITOR.tools.extend({}, a, {id: a.id ? a.id + "_select" : CKEDITOR.tools.getNextId() + "_select"}, !0),
  9154. e = [], d = [], g = {
  9155. id: f.inputId,
  9156. "class": "cke_dialog_ui_input_select",
  9157. "aria-labelledby": this._.labelId
  9158. };
  9159. e.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
  9160. a.type, '" role\x3d"presentation"');
  9161. a.width && e.push('style\x3d"width:' + a.width + '" ');
  9162. e.push("\x3e");
  9163. void 0 !== a.size && (g.size = a.size);
  9164. void 0 !== a.multiple && (g.multiple = a.multiple);
  9165. t(c);
  9166. for (var k = 0, l; k < a.items.length && (l = a.items[k]); k++) d.push('\x3coption value\x3d"', CKEDITOR.tools.htmlEncode(void 0 !== l[1] ? l[1] : l[0]).replace(/"/g, "\x26quot;"), '" /\x3e ', CKEDITOR.tools.htmlEncode(l[0]));
  9167. "undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
  9168. f.select = new CKEDITOR.ui.dialog.uiElement(b, c, e, "select", null,
  9169. g, d.join(""));
  9170. e.push("\x3c/div\x3e");
  9171. return e.join("")
  9172. })
  9173. }
  9174. }, file: function (b, a, d) {
  9175. if (!(3 > arguments.length)) {
  9176. void 0 === a["default"] && (a["default"] = "");
  9177. var f = CKEDITOR.tools.extend(h.call(this, a), {definition: a, buttons: []});
  9178. a.validate && (this.validate = a.validate);
  9179. b.on("load", function () {
  9180. CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")
  9181. });
  9182. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () {
  9183. f.frameId = CKEDITOR.tools.getNextId() + "_fileInput";
  9184. var b = ['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
  9185. f.frameId, '" title\x3d"', a.label, '" src\x3d"javascript:void('];
  9186. b.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
  9187. b.push(')"\x3e\x3c/iframe\x3e');
  9188. return b.join("")
  9189. })
  9190. }
  9191. }, fileButton: function (b, a, d) {
  9192. var f = this;
  9193. if (!(3 > arguments.length)) {
  9194. h.call(this, a);
  9195. a.validate && (this.validate = a.validate);
  9196. var c = CKEDITOR.tools.extend({}, a), e = c.onClick;
  9197. c.className = (c.className ? c.className + " " : "") + "cke_dialog_ui_button";
  9198. c.onClick = function (c) {
  9199. var d =
  9200. a["for"];
  9201. c = e ? e.call(this, c) : !1;
  9202. !1 !== c && ("xhr" !== c && b.getContentElement(d[0], d[1]).submit(), this.disable())
  9203. };
  9204. b.on("load", function () {
  9205. b.getContentElement(a["for"][0], a["for"][1])._.buttons.push(f)
  9206. });
  9207. CKEDITOR.ui.dialog.button.call(this, b, c, d)
  9208. }
  9209. }, html: function () {
  9210. var b = /^\s*<[\w:]+\s+([^>]*)?>/, a = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/, d = /\/$/;
  9211. return function (f, c, e) {
  9212. if (!(3 > arguments.length)) {
  9213. var m = [], g = c.html;
  9214. "\x3c" != g.charAt(0) && (g = "\x3cspan\x3e" + g + "\x3c/span\x3e");
  9215. var k = c.focus;
  9216. if (k) {
  9217. var l = this.focus;
  9218. this.focus = function () {
  9219. ("function" == typeof k ? k : l).call(this);
  9220. this.fire("focus")
  9221. };
  9222. c.isFocusable && (this.isFocusable = this.isFocusable);
  9223. this.keyboardFocusable = !0
  9224. }
  9225. CKEDITOR.ui.dialog.uiElement.call(this, f, c, m, "span", null, null, "");
  9226. m = m.join("").match(b);
  9227. g = g.match(a) || ["", "", ""];
  9228. d.test(g[1]) && (g[1] = g[1].slice(0, -1), g[2] = "/" + g[2]);
  9229. e.push([g[1], " ", m[1] || "", g[2]].join(""))
  9230. }
  9231. }
  9232. }(), fieldset: function (b, a, d, f, c) {
  9233. var e = c.label;
  9234. this._ = {children: a};
  9235. CKEDITOR.ui.dialog.uiElement.call(this, b, c, f, "fieldset", null, null, function () {
  9236. var a =
  9237. [];
  9238. e && a.push("\x3clegend" + (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : "") + "\x3e" + e + "\x3c/legend\x3e");
  9239. for (var b = 0; b < d.length; b++) a.push(d[b]);
  9240. return a.join("")
  9241. })
  9242. }
  9243. }, !0);
  9244. CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
  9245. CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  9246. setLabel: function (b) {
  9247. var a = CKEDITOR.document.getById(this._.labelId);
  9248. 1 > a.getChildCount() ? (new CKEDITOR.dom.text(b, CKEDITOR.document)).appendTo(a) : a.getChild(0).$.nodeValue =
  9249. b;
  9250. return this
  9251. }, getLabel: function () {
  9252. var b = CKEDITOR.document.getById(this._.labelId);
  9253. return !b || 1 > b.getChildCount() ? "" : b.getChild(0).getText()
  9254. }, eventProcessors: v
  9255. }, !0);
  9256. CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  9257. click: function () {
  9258. return this._.disabled ? !1 : this.fire("click", {dialog: this._.dialog})
  9259. },
  9260. enable: function () {
  9261. this._.disabled = !1;
  9262. var b = this.getElement();
  9263. b && b.removeClass("cke_disabled")
  9264. },
  9265. disable: function () {
  9266. this._.disabled = !0;
  9267. this.getElement().addClass("cke_disabled")
  9268. },
  9269. isVisible: function () {
  9270. return this.getElement().getFirst().isVisible()
  9271. },
  9272. isEnabled: function () {
  9273. return !this._.disabled
  9274. },
  9275. eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  9276. onClick: function (b, a) {
  9277. this.on("click", function () {
  9278. a.apply(this, arguments)
  9279. })
  9280. }
  9281. }, !0),
  9282. accessKeyUp: function () {
  9283. this.click()
  9284. },
  9285. accessKeyDown: function () {
  9286. this.focus()
  9287. },
  9288. keyboardFocusable: !0
  9289. }, !0);
  9290. CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  9291. getInputElement: function () {
  9292. return CKEDITOR.document.getById(this._.inputId)
  9293. },
  9294. focus: function () {
  9295. var b = this.selectParentTab();
  9296. setTimeout(function () {
  9297. var a = b.getInputElement();
  9298. a && a.$.focus()
  9299. }, 0)
  9300. }, select: function () {
  9301. var b = this.selectParentTab();
  9302. setTimeout(function () {
  9303. var a = b.getInputElement();
  9304. a && (a.$.focus(), a.$.select())
  9305. }, 0)
  9306. }, accessKeyUp: function () {
  9307. this.select()
  9308. }, setValue: function (b) {
  9309. if (this.bidi) {
  9310. var a = b && b.charAt(0);
  9311. (a = "‪" == a ? "ltr" : "‫" == a ? "rtl" : null) && (b = b.slice(1));
  9312. this.setDirectionMarker(a)
  9313. }
  9314. b || (b = "");
  9315. return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments)
  9316. },
  9317. getValue: function () {
  9318. var b = CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);
  9319. if (this.bidi && b) {
  9320. var a = this.getDirectionMarker();
  9321. a && (b = ("ltr" == a ? "‪" : "‫") + b)
  9322. }
  9323. return b
  9324. }, setDirectionMarker: function (b) {
  9325. var a = this.getInputElement();
  9326. b ? a.setAttributes({
  9327. dir: b,
  9328. "data-cke-dir-marker": b
  9329. }) : this.getDirectionMarker() && a.removeAttributes(["dir", "data-cke-dir-marker"])
  9330. }, getDirectionMarker: function () {
  9331. return this.getInputElement().data("cke-dir-marker")
  9332. }, keyboardFocusable: !0
  9333. }, q, !0);
  9334. CKEDITOR.ui.dialog.textarea.prototype =
  9335. new CKEDITOR.ui.dialog.textInput;
  9336. CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  9337. getInputElement: function () {
  9338. return this._.select.getElement()
  9339. }, add: function (b, a, d) {
  9340. var f = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
  9341. c = this.getInputElement().$;
  9342. f.$.text = b;
  9343. f.$.value = void 0 === a || null === a ? b : a;
  9344. void 0 === d || null === d ? CKEDITOR.env.ie ? c.add(f.$) : c.add(f.$, null) : c.add(f.$, d);
  9345. return this
  9346. }, remove: function (b) {
  9347. this.getInputElement().$.remove(b);
  9348. return this
  9349. }, clear: function () {
  9350. for (var b = this.getInputElement().$; 0 < b.length;) b.remove(0);
  9351. return this
  9352. }, keyboardFocusable: !0
  9353. }, q, !0);
  9354. CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  9355. getInputElement: function () {
  9356. return this._.checkbox.getElement()
  9357. }, setValue: function (b, a) {
  9358. this.getInputElement().$.checked = b;
  9359. !a && this.fire("change", {value: b})
  9360. }, getValue: function () {
  9361. return this.getInputElement().$.checked
  9362. }, accessKeyUp: function () {
  9363. this.setValue(!this.getValue())
  9364. }, eventProcessors: {
  9365. onChange: function (b,
  9366. a) {
  9367. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return v.onChange.apply(this, arguments);
  9368. b.on("load", function () {
  9369. var a = this._.checkbox.getElement();
  9370. a.on("propertychange", function (b) {
  9371. b = b.data.$;
  9372. "checked" == b.propertyName && this.fire("change", {value: a.$.checked})
  9373. }, this)
  9374. }, this);
  9375. this.on("change", a);
  9376. return null
  9377. }
  9378. }, keyboardFocusable: !0
  9379. }, q, !0);
  9380. CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  9381. setValue: function (b, a) {
  9382. for (var d = this._.children, f, c = 0; c < d.length && (f = d[c]); c++) f.getElement().$.checked =
  9383. f.getValue() == b;
  9384. !a && this.fire("change", {value: b})
  9385. }, getValue: function () {
  9386. for (var b = this._.children, a = 0; a < b.length; a++) if (b[a].getElement().$.checked) return b[a].getValue();
  9387. return null
  9388. }, accessKeyUp: function () {
  9389. var b = this._.children, a;
  9390. for (a = 0; a < b.length; a++) if (b[a].getElement().$.checked) {
  9391. b[a].getElement().focus();
  9392. return
  9393. }
  9394. b[0].getElement().focus()
  9395. }, eventProcessors: {
  9396. onChange: function (b, a) {
  9397. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return v.onChange.apply(this, arguments);
  9398. b.on("load", function () {
  9399. for (var a =
  9400. this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function (a) {
  9401. a = a.data.$;
  9402. "checked" == a.propertyName && this.$.checked && b.fire("change", {value: this.getAttribute("value")})
  9403. })
  9404. }, this);
  9405. this.on("change", a);
  9406. return null
  9407. }
  9408. }
  9409. }, q, !0);
  9410. CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, q, {
  9411. getInputElement: function () {
  9412. var b = CKEDITOR.document.getById(this._.frameId).getFrameDocument();
  9413. return 0 < b.$.forms.length ? new CKEDITOR.dom.element(b.$.forms[0].elements[0]) :
  9414. this.getElement()
  9415. }, submit: function () {
  9416. this.getInputElement().getParent().$.submit();
  9417. return this
  9418. }, getAction: function () {
  9419. return this.getInputElement().getParent().$.action
  9420. }, registerEvents: function (b) {
  9421. var a = /^on([A-Z]\w+)/, d, f = function (a, b, c, d) {
  9422. a.on("formLoaded", function () {
  9423. a.getInputElement().on(c, d, a)
  9424. })
  9425. }, c;
  9426. for (c in b) if (d = c.match(a)) this.eventProcessors[c] ? this.eventProcessors[c].call(this, this._.dialog, b[c]) : f(this, this._.dialog, d[1].toLowerCase(), b[c]);
  9427. return this
  9428. }, reset: function () {
  9429. function b() {
  9430. d.$.open();
  9431. var b = "";
  9432. f.size && (b = f.size - (CKEDITOR.env.ie ? 7 : 0));
  9433. var h = a.frameId + "_input";
  9434. d.$.write(['\x3chtml dir\x3d"' + g + '" lang\x3d"' + k + '"\x3e\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e\x3cbody style\x3d"margin: 0; overflow: hidden; background: transparent;"\x3e', '\x3cform enctype\x3d"multipart/form-data" method\x3d"POST" dir\x3d"' + g + '" lang\x3d"' + k + '" action\x3d"', CKEDITOR.tools.htmlEncode(f.action), '"\x3e\x3clabel id\x3d"', a.labelId, '" for\x3d"', h, '" style\x3d"display:none"\x3e', CKEDITOR.tools.htmlEncode(f.label),
  9435. '\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"', h, '" aria-labelledby\x3d"', a.labelId, '" type\x3d"file" name\x3d"', CKEDITOR.tools.htmlEncode(f.id || "cke_upload"), '" size\x3d"', CKEDITOR.tools.htmlEncode(0 < b ? b : ""), '" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e', CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "", "window.parent.CKEDITOR.tools.callFunction(" + e + ");", "window.onbeforeunload \x3d function() {window.parent.CKEDITOR.tools.callFunction(" + m + ")}", "\x3c/script\x3e"].join(""));
  9436. d.$.close();
  9437. for (b = 0; b < c.length; b++) c[b].enable()
  9438. }
  9439. var a = this._, d = CKEDITOR.document.getById(a.frameId).getFrameDocument(), f = a.definition,
  9440. c = a.buttons, e = this.formLoadedNumber, m = this.formUnloadNumber,
  9441. g = a.dialog._.editor.lang.dir, k = a.dialog._.editor.langCode;
  9442. e || (e = this.formLoadedNumber = CKEDITOR.tools.addFunction(function () {
  9443. this.fire("formLoaded")
  9444. }, this), m = this.formUnloadNumber = CKEDITOR.tools.addFunction(function () {
  9445. this.getInputElement().clearCustomData()
  9446. }, this), this.getDialog()._.editor.on("destroy", function () {
  9447. CKEDITOR.tools.removeFunction(e);
  9448. CKEDITOR.tools.removeFunction(m)
  9449. }));
  9450. CKEDITOR.env.gecko ? setTimeout(b, 500) : b()
  9451. }, getValue: function () {
  9452. return this.getInputElement().$.value || ""
  9453. }, setInitValue: function () {
  9454. this._.initValue = ""
  9455. }, eventProcessors: {
  9456. onChange: function (b, a) {
  9457. this._.domOnChangeRegistered || (this.on("formLoaded", function () {
  9458. this.getInputElement().on("change", function () {
  9459. this.fire("change", {value: this.getValue()})
  9460. }, this)
  9461. }, this), this._.domOnChangeRegistered = !0);
  9462. this.on("change", a)
  9463. }
  9464. }, keyboardFocusable: !0
  9465. }, !0);
  9466. CKEDITOR.ui.dialog.fileButton.prototype =
  9467. new CKEDITOR.ui.dialog.button;
  9468. CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
  9469. CKEDITOR.dialog.addUIElement("text", r);
  9470. CKEDITOR.dialog.addUIElement("password", r);
  9471. CKEDITOR.dialog.addUIElement("tel", r);
  9472. CKEDITOR.dialog.addUIElement("textarea", n);
  9473. CKEDITOR.dialog.addUIElement("checkbox", n);
  9474. CKEDITOR.dialog.addUIElement("radio", n);
  9475. CKEDITOR.dialog.addUIElement("button", n);
  9476. CKEDITOR.dialog.addUIElement("select", n);
  9477. CKEDITOR.dialog.addUIElement("file", n);
  9478. CKEDITOR.dialog.addUIElement("fileButton",
  9479. n);
  9480. CKEDITOR.dialog.addUIElement("html", n);
  9481. CKEDITOR.dialog.addUIElement("fieldset", {
  9482. build: function (b, a, d) {
  9483. for (var f = a.children, c, e = [], h = [], g = 0; g < f.length && (c = f[g]); g++) {
  9484. var k = [];
  9485. e.push(k);
  9486. h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b, c, k))
  9487. }
  9488. return new CKEDITOR.ui.dialog[a.type](b, h, e, d, a)
  9489. }
  9490. })
  9491. }
  9492. });
  9493. CKEDITOR.DIALOG_RESIZE_NONE = 0;
  9494. CKEDITOR.DIALOG_RESIZE_WIDTH = 1;
  9495. CKEDITOR.DIALOG_RESIZE_HEIGHT = 2;
  9496. CKEDITOR.DIALOG_RESIZE_BOTH = 3;
  9497. CKEDITOR.DIALOG_STATE_IDLE = 1;
  9498. CKEDITOR.DIALOG_STATE_BUSY = 2;
  9499. (function () {
  9500. function w() {
  9501. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--) if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  9502. return null
  9503. }
  9504. function z() {
  9505. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++) if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  9506. return null
  9507. }
  9508. function J(a, b) {
  9509. for (var c = a.$.getElementsByTagName("input"),
  9510. e = 0, d = c.length; e < d; e++) {
  9511. var f = new CKEDITOR.dom.element(c[e]);
  9512. "text" == f.getAttribute("type").toLowerCase() && (b ? (f.setAttribute("value", f.getCustomData("fake_value") || ""), f.removeCustomData("fake_value")) : (f.setCustomData("fake_value", f.getAttribute("value")), f.setAttribute("value", "")))
  9513. }
  9514. }
  9515. function S(a, b) {
  9516. var c = this.getInputElement();
  9517. c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", !0));
  9518. a || (this.select ? this.select() : this.focus());
  9519. b && alert(b);
  9520. this.fire("validated", {valid: a, msg: b})
  9521. }
  9522. function T() {
  9523. var a = this.getInputElement();
  9524. a && a.removeAttribute("aria-invalid")
  9525. }
  9526. function U(a) {
  9527. var b = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog", V).output({
  9528. id: CKEDITOR.tools.getNextNumber(),
  9529. editorId: a.id,
  9530. langDir: a.lang.dir,
  9531. langCode: a.langCode,
  9532. editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog",
  9533. closeTitle: a.lang.common.close,
  9534. hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : ""
  9535. })), c = b.getChild([0, 0, 0, 0, 0]), e = c.getChild(0), d = c.getChild(1);
  9536. a.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c);
  9537. !CKEDITOR.env.ie || CKEDITOR.env.quirks || CKEDITOR.env.edge || (a = "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())", CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"' + a + '" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(c.getParent()));
  9538. e.unselectable();
  9539. d.unselectable();
  9540. return {
  9541. element: b, parts: {
  9542. dialog: b.getChild(0), title: e, close: d, tabs: c.getChild(2), contents: c.getChild([3, 0, 0, 0]),
  9543. footer: c.getChild([3, 0, 1, 0])
  9544. }
  9545. }
  9546. }
  9547. function K(a, b, c) {
  9548. this.element = b;
  9549. this.focusIndex = c;
  9550. this.tabIndex = 0;
  9551. this.isFocusable = function () {
  9552. return !b.getAttribute("disabled") && b.isVisible()
  9553. };
  9554. this.focus = function () {
  9555. a._.currentFocusIndex = this.focusIndex;
  9556. this.element.focus()
  9557. };
  9558. b.on("keydown", function (a) {
  9559. a.data.getKeystroke() in {32: 1, 13: 1} && this.fire("click")
  9560. });
  9561. b.on("focus", function () {
  9562. this.fire("mouseover")
  9563. });
  9564. b.on("blur", function () {
  9565. this.fire("mouseout")
  9566. })
  9567. }
  9568. function W(a) {
  9569. function b() {
  9570. a.layout()
  9571. }
  9572. var c = CKEDITOR.document.getWindow();
  9573. c.on("resize", b);
  9574. a.on("hide", function () {
  9575. c.removeListener("resize", b)
  9576. })
  9577. }
  9578. function L(a, b) {
  9579. this._ = {dialog: a};
  9580. CKEDITOR.tools.extend(this, b)
  9581. }
  9582. function X(a) {
  9583. function b(b) {
  9584. var c = a.getSize(), k = CKEDITOR.document.getWindow().getViewPaneSize(), q = b.data.$.screenX,
  9585. n = b.data.$.screenY, r = q - e.x, l = n - e.y;
  9586. e = {x: q, y: n};
  9587. d.x += r;
  9588. d.y += l;
  9589. a.move(d.x + h[3] < g ? -h[3] : d.x - h[1] > k.width - c.width - g ? k.width - c.width + ("rtl" == f.lang.dir ? 0 : h[1]) : d.x, d.y + h[0] < g ? -h[0] : d.y - h[2] > k.height - c.height - g ? k.height - c.height + h[2] : d.y, 1);
  9590. b.data.preventDefault()
  9591. }
  9592. function c() {
  9593. CKEDITOR.document.removeListener("mousemove", b);
  9594. CKEDITOR.document.removeListener("mouseup", c);
  9595. if (CKEDITOR.env.ie6Compat) {
  9596. var a = t.getChild(0).getFrameDocument();
  9597. a.removeListener("mousemove", b);
  9598. a.removeListener("mouseup", c)
  9599. }
  9600. }
  9601. var e = null, d = null, f = a.getParentEditor(), g = f.config.dialog_magnetDistance,
  9602. h = CKEDITOR.skin.margins || [0, 0, 0, 0];
  9603. "undefined" == typeof g && (g = 20);
  9604. a.parts.title.on("mousedown", function (g) {
  9605. e = {x: g.data.$.screenX, y: g.data.$.screenY};
  9606. CKEDITOR.document.on("mousemove", b);
  9607. CKEDITOR.document.on("mouseup",
  9608. c);
  9609. d = a.getPosition();
  9610. if (CKEDITOR.env.ie6Compat) {
  9611. var f = t.getChild(0).getFrameDocument();
  9612. f.on("mousemove", b);
  9613. f.on("mouseup", c)
  9614. }
  9615. g.data.preventDefault()
  9616. }, a)
  9617. }
  9618. function Y(a) {
  9619. function b(b) {
  9620. var c = "rtl" == f.lang.dir, n = k.width, q = k.height,
  9621. F = n + (b.data.$.screenX - m.x) * (c ? -1 : 1) * (a._.moved ? 1 : 2),
  9622. G = q + (b.data.$.screenY - m.y) * (a._.moved ? 1 : 2), A = a._.element.getFirst(),
  9623. A = c && A.getComputedStyle("right"), B = a.getPosition();
  9624. B.y + G > p.height && (G = p.height - B.y);
  9625. (c ? A : B.x) + F > p.width && (F = p.width - (c ? A : B.x));
  9626. if (d == CKEDITOR.DIALOG_RESIZE_WIDTH ||
  9627. d == CKEDITOR.DIALOG_RESIZE_BOTH) n = Math.max(e.minWidth || 0, F - g);
  9628. if (d == CKEDITOR.DIALOG_RESIZE_HEIGHT || d == CKEDITOR.DIALOG_RESIZE_BOTH) q = Math.max(e.minHeight || 0, G - h);
  9629. a.resize(n, q);
  9630. a._.moved || a.layout();
  9631. b.data.preventDefault()
  9632. }
  9633. function c() {
  9634. CKEDITOR.document.removeListener("mouseup", c);
  9635. CKEDITOR.document.removeListener("mousemove", b);
  9636. q && (q.remove(), q = null);
  9637. if (CKEDITOR.env.ie6Compat) {
  9638. var a = t.getChild(0).getFrameDocument();
  9639. a.removeListener("mouseup", c);
  9640. a.removeListener("mousemove", b)
  9641. }
  9642. }
  9643. var e = a.definition, d = e.resizable;
  9644. if (d != CKEDITOR.DIALOG_RESIZE_NONE) {
  9645. var f = a.getParentEditor(), g, h, p, m, k, q, n = CKEDITOR.tools.addFunction(function (d) {
  9646. k = a.getSize();
  9647. var e = a.parts.contents;
  9648. e.$.getElementsByTagName("iframe").length && (q = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%;"\x3e\x3c/div\x3e'), e.append(q));
  9649. h = k.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks));
  9650. g = k.width - a.parts.contents.getSize("width",
  9651. 1);
  9652. m = {x: d.screenX, y: d.screenY};
  9653. p = CKEDITOR.document.getWindow().getViewPaneSize();
  9654. CKEDITOR.document.on("mousemove", b);
  9655. CKEDITOR.document.on("mouseup", c);
  9656. CKEDITOR.env.ie6Compat && (e = t.getChild(0).getFrameDocument(), e.on("mousemove", b), e.on("mouseup", c));
  9657. d.preventDefault && d.preventDefault()
  9658. });
  9659. a.on("load", function () {
  9660. var b = "";
  9661. d == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = " cke_resizer_horizontal" : d == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical");
  9662. b = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer' +
  9663. b + " cke_resizer_" + f.lang.dir + '" title\x3d"' + CKEDITOR.tools.htmlEncode(f.lang.common.resize) + '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + n + ', event )"\x3e' + ("ltr" == f.lang.dir ? "◢" : "◣") + "\x3c/div\x3e");
  9664. a.parts.footer.append(b, 1)
  9665. });
  9666. f.on("destroy", function () {
  9667. CKEDITOR.tools.removeFunction(n)
  9668. })
  9669. }
  9670. }
  9671. function H(a) {
  9672. a.data.preventDefault(1)
  9673. }
  9674. function M(a) {
  9675. var b = CKEDITOR.document.getWindow(), c = a.config, e = CKEDITOR.skinName || a.config.skin,
  9676. d = c.dialog_backgroundCoverColor || ("moono-lisa" == e ? "black" : "white"),
  9677. e = c.dialog_backgroundCoverOpacity,
  9678. f = c.baseFloatZIndex, c = CKEDITOR.tools.genKey(d, e, f), g = y[c];
  9679. g ? g.show() : (f = ['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ', CKEDITOR.env.ie6Compat ? "absolute" : "fixed", "; z-index: ", f, "; top: 0px; left: 0px; ", CKEDITOR.env.ie6Compat ? "" : "background-color: " + d, '" class\x3d"cke_dialog_background_cover"\x3e'], CKEDITOR.env.ie6Compat && (d = "\x3chtml\x3e\x3cbody style\x3d\\'background-color:" + d + ";\\'\x3e\x3c/body\x3e\x3c/html\x3e", f.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),
  9680. f.push("void((function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.write( '" + d + "' );document.close();") + "})())"), f.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')), f.push("\x3c/div\x3e"), g = CKEDITOR.dom.element.createFromHtml(f.join("")), g.setOpacity(void 0 !== e ? e : .5), g.on("keydown", H), g.on("keypress", H), g.on("keyup", H), g.appendTo(CKEDITOR.document.getBody()),
  9681. y[c] = g);
  9682. a.focusManager.add(g);
  9683. t = g;
  9684. a = function () {
  9685. var a = b.getViewPaneSize();
  9686. g.setStyles({width: a.width + "px", height: a.height + "px"})
  9687. };
  9688. var h = function () {
  9689. var a = b.getScrollPosition(), c = CKEDITOR.dialog._.currentTop;
  9690. g.setStyles({left: a.x + "px", top: a.y + "px"});
  9691. if (c) {
  9692. do a = c.getPosition(), c.move(a.x, a.y); while (c = c._.parentDialog)
  9693. }
  9694. };
  9695. I = a;
  9696. b.on("resize", a);
  9697. a();
  9698. CKEDITOR.env.mac && CKEDITOR.env.webkit || g.focus();
  9699. if (CKEDITOR.env.ie6Compat) {
  9700. var p = function () {
  9701. h();
  9702. arguments.callee.prevScrollHandler.apply(this, arguments)
  9703. };
  9704. b.$.setTimeout(function () {
  9705. p.prevScrollHandler =
  9706. window.onscroll || function () {
  9707. };
  9708. window.onscroll = p
  9709. }, 0);
  9710. h()
  9711. }
  9712. }
  9713. function N(a) {
  9714. t && (a.focusManager.remove(t), a = CKEDITOR.document.getWindow(), t.hide(), t = null, a.removeListener("resize", I), CKEDITOR.env.ie6Compat && a.$.setTimeout(function () {
  9715. window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null
  9716. }, 0), I = null)
  9717. }
  9718. var u = CKEDITOR.tools.cssLength,
  9719. V = '\x3cdiv class\x3d"cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog ' +
  9720. CKEDITOR.env.cssClass + ' cke_{langDir}" style\x3d"position:absolute" 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';
  9721. CKEDITOR.dialog = function (a, b) {
  9722. function c() {
  9723. var a = l._.focusList;
  9724. a.sort(function (a, b) {
  9725. return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex
  9726. });
  9727. for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
  9728. }
  9729. function e(a) {
  9730. var b = l._.focusList;
  9731. a = a || 0;
  9732. if (!(1 > b.length)) {
  9733. var c = l._.currentFocusIndex;
  9734. l._.tabBarMode && 0 > a && (c = 0);
  9735. try {
  9736. b[c].getInputElement().$.blur()
  9737. } catch (d) {
  9738. }
  9739. var e = c, g = 1 < l._.pageCount;
  9740. do {
  9741. e += a;
  9742. if (g && !l._.tabBarMode && (e == b.length || -1 == e)) {
  9743. l._.tabBarMode = !0;
  9744. l._.tabs[l._.currentTabId][0].focus();
  9745. l._.currentFocusIndex = -1;
  9746. return
  9747. }
  9748. e = (e + b.length) % b.length;
  9749. if (e == c) break
  9750. } while (a && !b[e].isFocusable());
  9751. b[e].focus();
  9752. "text" == b[e].type && b[e].select()
  9753. }
  9754. }
  9755. function d(b) {
  9756. if (l == CKEDITOR.dialog._.currentTop) {
  9757. var c = b.data.getKeystroke(), d = "rtl" == a.lang.dir, g = [37, 38, 39, 40];
  9758. q = n = 0;
  9759. if (9 == c || c == CKEDITOR.SHIFT + 9) e(c == CKEDITOR.SHIFT + 9 ? -1 : 1), q = 1; else if (c == CKEDITOR.ALT + 121 && !l._.tabBarMode && 1 < l.getPageCount()) l._.tabBarMode = !0, l._.tabs[l._.currentTabId][0].focus(), l._.currentFocusIndex = -1, q = 1; else if (-1 != CKEDITOR.tools.indexOf(g,
  9760. c) && l._.tabBarMode) c = -1 != CKEDITOR.tools.indexOf([d ? 39 : 37, 38], c) ? w.call(l) : z.call(l), l.selectPage(c), l._.tabs[c][0].focus(), q = 1; else if (13 != c && 32 != c || !l._.tabBarMode) if (13 == c) c = b.data.getTarget(), c.is("a", "button", "select", "textarea") || c.is("input") && "button" == c.$.type || ((c = this.getButton("ok")) && CKEDITOR.tools.setTimeout(c.click, 0, c), q = 1), n = 1; else if (27 == c) (c = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(c.click, 0, c) : !1 !== this.fire("cancel", {hide: !0}).hide && this.hide(), n = 1; else return; else this.selectPage(this._.currentTabId),
  9761. this._.tabBarMode = !1, this._.currentFocusIndex = -1, e(1), q = 1;
  9762. f(b)
  9763. }
  9764. }
  9765. function f(a) {
  9766. q ? a.data.preventDefault(1) : n && a.data.stopPropagation()
  9767. }
  9768. var g = CKEDITOR.dialog._.dialogDefinitions[b], h = CKEDITOR.tools.clone(Z),
  9769. p = a.config.dialog_buttonsOrder || "OS", m = a.lang.dir, k = {}, q, n;
  9770. ("OS" == p && CKEDITOR.env.mac || "rtl" == p && "ltr" == m || "ltr" == p && "rtl" == m) && h.buttons.reverse();
  9771. g = CKEDITOR.tools.extend(g(a), h);
  9772. g = CKEDITOR.tools.clone(g);
  9773. g = new O(this, g);
  9774. h = U(a);
  9775. this._ = {
  9776. editor: a,
  9777. element: h.element,
  9778. name: b,
  9779. contentSize: {width: 0, height: 0},
  9780. size: {width: 0, height: 0},
  9781. contents: {},
  9782. buttons: {},
  9783. accessKeyMap: {},
  9784. tabs: {},
  9785. tabIdList: [],
  9786. currentTabId: null,
  9787. currentTabIndex: null,
  9788. pageCount: 0,
  9789. lastTab: null,
  9790. tabBarMode: !1,
  9791. focusList: [],
  9792. currentFocusIndex: 0,
  9793. hasFocus: !1
  9794. };
  9795. this.parts = h.parts;
  9796. CKEDITOR.tools.setTimeout(function () {
  9797. a.fire("ariaWidget", this.parts.contents)
  9798. }, 0, this);
  9799. h = {position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed", top: 0, visibility: "hidden"};
  9800. h["rtl" == m ? "right" : "left"] = 0;
  9801. this.parts.dialog.setStyles(h);
  9802. CKEDITOR.event.call(this);
  9803. this.definition = g = CKEDITOR.fire("dialogDefinition",
  9804. {name: b, definition: g}, a).definition;
  9805. if (!("removeDialogTabs" in a._) && a.config.removeDialogTabs) {
  9806. h = a.config.removeDialogTabs.split(";");
  9807. for (m = 0; m < h.length; m++) if (p = h[m].split(":"), 2 == p.length) {
  9808. var r = p[0];
  9809. k[r] || (k[r] = []);
  9810. k[r].push(p[1])
  9811. }
  9812. a._.removeDialogTabs = k
  9813. }
  9814. if (a._.removeDialogTabs && (k = a._.removeDialogTabs[b])) for (m = 0; m < k.length; m++) g.removeContents(k[m]);
  9815. if (g.onLoad) this.on("load", g.onLoad);
  9816. if (g.onShow) this.on("show", g.onShow);
  9817. if (g.onHide) this.on("hide", g.onHide);
  9818. if (g.onOk) this.on("ok", function (b) {
  9819. a.fire("saveSnapshot");
  9820. setTimeout(function () {
  9821. a.fire("saveSnapshot")
  9822. }, 0);
  9823. !1 === g.onOk.call(this, b) && (b.data.hide = !1)
  9824. });
  9825. this.state = CKEDITOR.DIALOG_STATE_IDLE;
  9826. if (g.onCancel) this.on("cancel", function (a) {
  9827. !1 === g.onCancel.call(this, a) && (a.data.hide = !1)
  9828. });
  9829. var l = this, t = function (a) {
  9830. var b = l._.contents, c = !1, d;
  9831. for (d in b) for (var e in b[d]) if (c = a.call(this, b[d][e])) return
  9832. };
  9833. this.on("ok", function (a) {
  9834. t(function (b) {
  9835. if (b.validate) {
  9836. var c = b.validate(this), d = "string" == typeof c || !1 === c;
  9837. d && (a.data.hide = !1, a.stop());
  9838. S.call(b, !d, "string" == typeof c ?
  9839. c : void 0);
  9840. return d
  9841. }
  9842. })
  9843. }, this, null, 0);
  9844. this.on("cancel", function (b) {
  9845. t(function (c) {
  9846. if (c.isChanged()) return a.config.dialog_noConfirmCancel || confirm(a.lang.common.confirmCancel) || (b.data.hide = !1), !0
  9847. })
  9848. }, this, null, 0);
  9849. this.parts.close.on("click", function (a) {
  9850. !1 !== this.fire("cancel", {hide: !0}).hide && this.hide();
  9851. a.data.preventDefault()
  9852. }, this);
  9853. this.changeFocus = e;
  9854. var x = this._.element;
  9855. a.focusManager.add(x, 1);
  9856. this.on("show", function () {
  9857. x.on("keydown", d, this);
  9858. if (CKEDITOR.env.gecko) x.on("keypress", f, this)
  9859. });
  9860. this.on("hide",
  9861. function () {
  9862. x.removeListener("keydown", d);
  9863. CKEDITOR.env.gecko && x.removeListener("keypress", f);
  9864. t(function (a) {
  9865. T.apply(a)
  9866. })
  9867. });
  9868. this.on("iframeAdded", function (a) {
  9869. (new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", d, this, null, 0)
  9870. });
  9871. this.on("show", function () {
  9872. c();
  9873. var b = 1 < l._.pageCount;
  9874. a.config.dialog_startupFocusTab && b ? (l._.tabBarMode = !0, l._.tabs[l._.currentTabId][0].focus(), l._.currentFocusIndex = -1) : this._.hasFocus || (this._.currentFocusIndex = b ? -1 : this._.focusList.length - 1, g.onFocus ?
  9875. (b = g.onFocus.call(this)) && b.focus() : e(1))
  9876. }, this, null, 4294967295);
  9877. if (CKEDITOR.env.ie6Compat) this.on("load", function () {
  9878. var a = this.getElement(), b = a.getFirst();
  9879. b.remove();
  9880. b.appendTo(a)
  9881. }, this);
  9882. X(this);
  9883. Y(this);
  9884. (new CKEDITOR.dom.text(g.title, CKEDITOR.document)).appendTo(this.parts.title);
  9885. for (m = 0; m < g.contents.length; m++) (k = g.contents[m]) && this.addPage(k);
  9886. this.parts.tabs.on("click", function (a) {
  9887. var b = a.data.getTarget();
  9888. b.hasClass("cke_dialog_tab") && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf("_"))),
  9889. this._.tabBarMode && (this._.tabBarMode = !1, this._.currentFocusIndex = -1, e(1)), a.data.preventDefault())
  9890. }, this);
  9891. m = [];
  9892. k = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, {
  9893. type: "hbox",
  9894. className: "cke_dialog_footer_buttons",
  9895. widths: [],
  9896. children: g.buttons
  9897. }, m).getChild();
  9898. this.parts.footer.setHtml(m.join(""));
  9899. for (m = 0; m < k.length; m++) this._.buttons[k[m].id] = k[m]
  9900. };
  9901. CKEDITOR.dialog.prototype = {
  9902. destroy: function () {
  9903. this.hide();
  9904. this._.element.remove()
  9905. }, resize: function () {
  9906. return function (a, b) {
  9907. this._.contentSize && this._.contentSize.width ==
  9908. a && this._.contentSize.height == b || (CKEDITOR.dialog.fire("resize", {
  9909. dialog: this,
  9910. width: a,
  9911. height: b
  9912. }, this._.editor), this.fire("resize", {
  9913. width: a,
  9914. height: b
  9915. }, this._.editor), this.parts.contents.setStyles({
  9916. width: a + "px",
  9917. height: b + "px"
  9918. }), "rtl" == this._.editor.lang.dir && this._.position && (this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle("right"), 10)), this._.contentSize = {
  9919. width: a,
  9920. height: b
  9921. })
  9922. }
  9923. }(), getSize: function () {
  9924. var a = this._.element.getFirst();
  9925. return {width: a.$.offsetWidth || 0, height: a.$.offsetHeight || 0}
  9926. }, move: function (a, b, c) {
  9927. var e = this._.element.getFirst(), d = "rtl" == this._.editor.lang.dir,
  9928. f = "fixed" == e.getComputedStyle("position");
  9929. CKEDITOR.env.ie && e.setStyle("zoom", "100%");
  9930. f && this._.position && this._.position.x == a && this._.position.y == b || (this._.position = {
  9931. x: a,
  9932. y: b
  9933. }, f || (f = CKEDITOR.document.getWindow().getScrollPosition(), a += f.x, b += f.y), d && (f = this.getSize(), a = CKEDITOR.document.getWindow().getViewPaneSize().width - f.width - a), b = {top: (0 < b ? b : 0) + "px"},
  9934. b[d ? "right" : "left"] = (0 < a ? a : 0) + "px", e.setStyles(b), c && (this._.moved = 1))
  9935. }, getPosition: function () {
  9936. return CKEDITOR.tools.extend({}, this._.position)
  9937. }, show: function () {
  9938. var a = this._.element, b = this.definition;
  9939. a.getParent() && a.getParent().equals(CKEDITOR.document.getBody()) ? a.setStyle("display", "block") : a.appendTo(CKEDITOR.document.getBody());
  9940. this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight);
  9941. this.reset();
  9942. null ===
  9943. this._.currentTabId && this.selectPage(this.definition.contents[0].id);
  9944. null === CKEDITOR.dialog._.currentZIndex && (CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex);
  9945. this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex += 10);
  9946. null === CKEDITOR.dialog._.currentTop ? (CKEDITOR.dialog._.currentTop = this, this._.parentDialog = null, M(this._.editor)) : (this._.parentDialog = CKEDITOR.dialog._.currentTop, this._.parentDialog.getElement().getFirst().$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex /
  9947. 2), CKEDITOR.dialog._.currentTop = this);
  9948. a.on("keydown", P);
  9949. a.on("keyup", Q);
  9950. this._.hasFocus = !1;
  9951. for (var c in b.contents) if (b.contents[c]) {
  9952. var a = b.contents[c], e = this._.tabs[a.id], d = a.requiredContent, f = 0;
  9953. if (e) {
  9954. for (var g in this._.contents[a.id]) {
  9955. var h = this._.contents[a.id][g];
  9956. "hbox" != h.type && "vbox" != h.type && h.getInputElement() && (h.requiredContent && !this._.editor.activeFilter.check(h.requiredContent) ? h.disable() : (h.enable(), f++))
  9957. }
  9958. !f || d && !this._.editor.activeFilter.check(d) ? e[0].addClass("cke_dialog_tab_disabled") :
  9959. e[0].removeClass("cke_dialog_tab_disabled")
  9960. }
  9961. }
  9962. CKEDITOR.tools.setTimeout(function () {
  9963. this.layout();
  9964. W(this);
  9965. this.parts.dialog.setStyle("visibility", "");
  9966. this.fireOnce("load", {});
  9967. CKEDITOR.ui.fire("ready", this);
  9968. this.fire("show", {});
  9969. this._.editor.fire("dialogShow", this);
  9970. this._.parentDialog || this._.editor.focusManager.lock();
  9971. this.foreach(function (a) {
  9972. a.setInitValue && a.setInitValue()
  9973. })
  9974. }, 100, this)
  9975. }, layout: function () {
  9976. var a = this.parts.dialog, b = this.getSize(), c = CKEDITOR.document.getWindow().getViewPaneSize(), e =
  9977. (c.width - b.width) / 2, d = (c.height - b.height) / 2;
  9978. CKEDITOR.env.ie6Compat || (b.height + (0 < d ? d : 0) > c.height || b.width + (0 < e ? e : 0) > c.width ? a.setStyle("position", "absolute") : a.setStyle("position", "fixed"));
  9979. this.move(this._.moved ? this._.position.x : e, this._.moved ? this._.position.y : d)
  9980. }, foreach: function (a) {
  9981. for (var b in this._.contents) for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
  9982. return this
  9983. }, reset: function () {
  9984. var a = function (a) {
  9985. a.reset && a.reset(1)
  9986. };
  9987. return function () {
  9988. this.foreach(a);
  9989. return this
  9990. }
  9991. }(),
  9992. setupContent: function () {
  9993. var a = arguments;
  9994. this.foreach(function (b) {
  9995. b.setup && b.setup.apply(b, a)
  9996. })
  9997. }, commitContent: function () {
  9998. var a = arguments;
  9999. this.foreach(function (b) {
  10000. CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
  10001. b.commit && b.commit.apply(b, a)
  10002. })
  10003. }, hide: function () {
  10004. if (this.parts.dialog.isVisible()) {
  10005. this.fire("hide", {});
  10006. this._.editor.fire("dialogHide", this);
  10007. this.selectPage(this._.tabIdList[0]);
  10008. var a = this._.element;
  10009. a.setStyle("display", "none");
  10010. this.parts.dialog.setStyle("visibility",
  10011. "hidden");
  10012. for (aa(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
  10013. if (this._.parentDialog) {
  10014. var b = this._.parentDialog.getElement().getFirst();
  10015. b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2))
  10016. } else N(this._.editor);
  10017. if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex -= 10; else {
  10018. CKEDITOR.dialog._.currentZIndex = null;
  10019. a.removeListener("keydown", P);
  10020. a.removeListener("keyup", Q);
  10021. var c = this._.editor;
  10022. c.focus();
  10023. setTimeout(function () {
  10024. c.focusManager.unlock();
  10025. CKEDITOR.env.iOS && c.window.focus()
  10026. }, 0)
  10027. }
  10028. delete this._.parentDialog;
  10029. this.foreach(function (a) {
  10030. a.resetInitValue && a.resetInitValue()
  10031. });
  10032. this.setState(CKEDITOR.DIALOG_STATE_IDLE)
  10033. }
  10034. }, addPage: function (a) {
  10035. if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
  10036. for (var b = [], c = a.label ? ' title\x3d"' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", e = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, {
  10037. type: "vbox", className: "cke_dialog_page_contents",
  10038. children: a.elements, expand: !!a.expand, padding: a.padding, style: a.style || "width: 100%;"
  10039. }, b), d = this._.contents[a.id] = {}, f = e.getChild(), g = 0; e = f.shift();) e.notAllowed || "hbox" == e.type || "vbox" == e.type || g++, d[e.id] = e, "function" == typeof e.getChild && f.push.apply(f, e.getChild());
  10040. g || (a.hidden = !0);
  10041. b = CKEDITOR.dom.element.createFromHtml(b.join(""));
  10042. b.setAttribute("role", "tabpanel");
  10043. e = CKEDITOR.env;
  10044. d = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
  10045. c = CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"',
  10046. 0 < this._.pageCount ? " cke_last" : "cke_first", c, a.hidden ? ' style\x3d"display:none"' : "", ' id\x3d"', d, '"', e.gecko && !e.hc ? "" : ' href\x3d"javascript:void(0)"', ' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e', a.label, "\x3c/a\x3e"].join(""));
  10047. b.setAttribute("aria-labelledby", d);
  10048. this._.tabs[a.id] = [c, b];
  10049. this._.tabIdList.push(a.id);
  10050. !a.hidden && this._.pageCount++;
  10051. this._.lastTab = c;
  10052. this.updateStyle();
  10053. b.setAttribute("name", a.id);
  10054. b.appendTo(this.parts.contents);
  10055. c.unselectable();
  10056. this.parts.tabs.append(c);
  10057. a.accessKey &&
  10058. (R(this, this, "CTRL+" + a.accessKey, ba, ca), this._.accessKeyMap["CTRL+" + a.accessKey] = a.id)
  10059. }
  10060. }, selectPage: function (a) {
  10061. if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && !1 !== this.fire("selectPage", {
  10062. page: a,
  10063. currentPage: this._.currentTabId
  10064. })) {
  10065. for (var b in this._.tabs) {
  10066. var c = this._.tabs[b][0], e = this._.tabs[b][1];
  10067. b != a && (c.removeClass("cke_dialog_tab_selected"), e.hide());
  10068. e.setAttribute("aria-hidden", b != a)
  10069. }
  10070. var d = this._.tabs[a];
  10071. d[0].addClass("cke_dialog_tab_selected");
  10072. CKEDITOR.env.ie6Compat ||
  10073. CKEDITOR.env.ie7Compat ? (J(d[1]), d[1].show(), setTimeout(function () {
  10074. J(d[1], 1)
  10075. }, 0)) : d[1].show();
  10076. this._.currentTabId = a;
  10077. this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
  10078. }
  10079. }, updateStyle: function () {
  10080. this.parts.dialog[(1 === this._.pageCount ? "add" : "remove") + "Class"]("cke_single_page")
  10081. }, hidePage: function (a) {
  10082. var b = this._.tabs[a] && this._.tabs[a][0];
  10083. b && 1 != this._.pageCount && b.isVisible() && (a == this._.currentTabId && this.selectPage(w.call(this)), b.hide(), this._.pageCount--, this.updateStyle())
  10084. }, showPage: function (a) {
  10085. if (a =
  10086. this._.tabs[a] && this._.tabs[a][0]) a.show(), this._.pageCount++, this.updateStyle()
  10087. }, getElement: function () {
  10088. return this._.element
  10089. }, getName: function () {
  10090. return this._.name
  10091. }, getContentElement: function (a, b) {
  10092. var c = this._.contents[a];
  10093. return c && c[b]
  10094. }, getValueOf: function (a, b) {
  10095. return this.getContentElement(a, b).getValue()
  10096. }, setValueOf: function (a, b, c) {
  10097. return this.getContentElement(a, b).setValue(c)
  10098. }, getButton: function (a) {
  10099. return this._.buttons[a]
  10100. }, click: function (a) {
  10101. return this._.buttons[a].click()
  10102. }, disableButton: function (a) {
  10103. return this._.buttons[a].disable()
  10104. },
  10105. enableButton: function (a) {
  10106. return this._.buttons[a].enable()
  10107. }, getPageCount: function () {
  10108. return this._.pageCount
  10109. }, getParentEditor: function () {
  10110. return this._.editor
  10111. }, getSelectedElement: function () {
  10112. return this.getParentEditor().getSelection().getSelectedElement()
  10113. }, addFocusable: function (a, b) {
  10114. if ("undefined" == typeof b) b = this._.focusList.length, this._.focusList.push(new K(this, a, b)); else {
  10115. this._.focusList.splice(b, 0, new K(this, a, b));
  10116. for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++
  10117. }
  10118. },
  10119. setState: function (a) {
  10120. if (this.state != a) {
  10121. this.state = a;
  10122. if (a == CKEDITOR.DIALOG_STATE_BUSY) {
  10123. if (!this.parts.spinner) {
  10124. var b = this.getParentEditor().lang.dir, c = {
  10125. attributes: {"class": "cke_dialog_spinner"},
  10126. styles: {"float": "rtl" == b ? "right" : "left"}
  10127. };
  10128. c.styles["margin-" + ("rtl" == b ? "left" : "right")] = "8px";
  10129. this.parts.spinner = CKEDITOR.document.createElement("div", c);
  10130. this.parts.spinner.setHtml("\x26#8987;");
  10131. this.parts.spinner.appendTo(this.parts.title, 1)
  10132. }
  10133. this.parts.spinner.show();
  10134. this.getButton("ok").disable()
  10135. } else a ==
  10136. CKEDITOR.DIALOG_STATE_IDLE && (this.parts.spinner && this.parts.spinner.hide(), this.getButton("ok").enable());
  10137. this.fire("state", a)
  10138. }
  10139. }
  10140. };
  10141. CKEDITOR.tools.extend(CKEDITOR.dialog, {
  10142. add: function (a, b) {
  10143. this._.dialogDefinitions[a] && "function" != typeof b || (this._.dialogDefinitions[a] = b)
  10144. }, exists: function (a) {
  10145. return !!this._.dialogDefinitions[a]
  10146. }, getCurrent: function () {
  10147. return CKEDITOR.dialog._.currentTop
  10148. }, isTabEnabled: function (a, b, c) {
  10149. a = a.config.removeDialogTabs;
  10150. return !(a && a.match(new RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)",
  10151. "i")))
  10152. }, okButton: function () {
  10153. var a = function (a, c) {
  10154. c = c || {};
  10155. return CKEDITOR.tools.extend({
  10156. id: "ok",
  10157. type: "button",
  10158. label: a.lang.common.ok,
  10159. "class": "cke_dialog_ui_button_ok",
  10160. onClick: function (a) {
  10161. a = a.data.dialog;
  10162. !1 !== a.fire("ok", {hide: !0}).hide && a.hide()
  10163. }
  10164. }, c, !0)
  10165. };
  10166. a.type = "button";
  10167. a.override = function (b) {
  10168. return CKEDITOR.tools.extend(function (c) {
  10169. return a(c, b)
  10170. }, {type: "button"}, !0)
  10171. };
  10172. return a
  10173. }(), cancelButton: function () {
  10174. var a = function (a, c) {
  10175. c = c || {};
  10176. return CKEDITOR.tools.extend({
  10177. id: "cancel", type: "button", label: a.lang.common.cancel,
  10178. "class": "cke_dialog_ui_button_cancel", onClick: function (a) {
  10179. a = a.data.dialog;
  10180. !1 !== a.fire("cancel", {hide: !0}).hide && a.hide()
  10181. }
  10182. }, c, !0)
  10183. };
  10184. a.type = "button";
  10185. a.override = function (b) {
  10186. return CKEDITOR.tools.extend(function (c) {
  10187. return a(c, b)
  10188. }, {type: "button"}, !0)
  10189. };
  10190. return a
  10191. }(), addUIElement: function (a, b) {
  10192. this._.uiElementBuilders[a] = b
  10193. }
  10194. });
  10195. CKEDITOR.dialog._ = {uiElementBuilders: {}, dialogDefinitions: {}, currentTop: null, currentZIndex: null};
  10196. CKEDITOR.event.implementOn(CKEDITOR.dialog);
  10197. CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
  10198. var Z = {
  10199. resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
  10200. minWidth: 600,
  10201. minHeight: 400,
  10202. buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton]
  10203. }, C = function (a, b, c) {
  10204. for (var e = 0, d; d = a[e]; e++) if (d.id == b || c && d[c] && (d = C(d[c], b, c))) return d;
  10205. return null
  10206. }, D = function (a, b, c, e, d) {
  10207. if (c) {
  10208. for (var f = 0, g; g = a[f]; f++) {
  10209. if (g.id == c) return a.splice(f, 0, b), b;
  10210. if (e && g[e] && (g = D(g[e], b, c, e, !0))) return g
  10211. }
  10212. if (d) return null
  10213. }
  10214. a.push(b);
  10215. return b
  10216. }, E = function (a, b, c) {
  10217. for (var e = 0, d; d = a[e]; e++) {
  10218. if (d.id == b) return a.splice(e, 1);
  10219. if (c && d[c] && (d = E(d[c],
  10220. b, c))) return d
  10221. }
  10222. return null
  10223. }, O = function (a, b) {
  10224. this.dialog = a;
  10225. for (var c = b.contents, e = 0, d; d = c[e]; e++) c[e] = d && new L(a, d);
  10226. CKEDITOR.tools.extend(this, b)
  10227. };
  10228. O.prototype = {
  10229. getContents: function (a) {
  10230. return C(this.contents, a)
  10231. }, getButton: function (a) {
  10232. return C(this.buttons, a)
  10233. }, addContents: function (a, b) {
  10234. return D(this.contents, a, b)
  10235. }, addButton: function (a, b) {
  10236. return D(this.buttons, a, b)
  10237. }, removeContents: function (a) {
  10238. E(this.contents, a)
  10239. }, removeButton: function (a) {
  10240. E(this.buttons, a)
  10241. }
  10242. };
  10243. L.prototype = {
  10244. get: function (a) {
  10245. return C(this.elements,
  10246. a, "children")
  10247. }, add: function (a, b) {
  10248. return D(this.elements, a, b, "children")
  10249. }, remove: function (a) {
  10250. E(this.elements, a, "children")
  10251. }
  10252. };
  10253. var I, y = {}, t, v = {}, P = function (a) {
  10254. var b = a.data.$.ctrlKey || a.data.$.metaKey, c = a.data.$.altKey, e = a.data.$.shiftKey,
  10255. d = String.fromCharCode(a.data.$.keyCode);
  10256. (b = v[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (e ? "SHIFT+" : "") + d]) && b.length && (b = b[b.length - 1], b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key), a.data.preventDefault())
  10257. }, Q = function (a) {
  10258. var b = a.data.$.ctrlKey || a.data.$.metaKey, c = a.data.$.altKey,
  10259. e = a.data.$.shiftKey, d = String.fromCharCode(a.data.$.keyCode);
  10260. (b = v[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (e ? "SHIFT+" : "") + d]) && b.length && (b = b[b.length - 1], b.keyup && (b.keyup.call(b.uiElement, b.dialog, b.key), a.data.preventDefault()))
  10261. }, R = function (a, b, c, e, d) {
  10262. (v[c] || (v[c] = [])).push({
  10263. uiElement: a,
  10264. dialog: b,
  10265. key: c,
  10266. keyup: d || a.accessKeyUp,
  10267. keydown: e || a.accessKeyDown
  10268. })
  10269. }, aa = function (a) {
  10270. for (var b in v) {
  10271. for (var c = v[b], e = c.length - 1; 0 <= e; e--) c[e].dialog != a && c[e].uiElement != a || c.splice(e, 1);
  10272. 0 === c.length && delete v[b]
  10273. }
  10274. }, ca = function (a,
  10275. b) {
  10276. a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b])
  10277. }, ba = function () {
  10278. };
  10279. (function () {
  10280. CKEDITOR.ui.dialog = {
  10281. uiElement: function (a, b, c, e, d, f, g) {
  10282. if (!(4 > arguments.length)) {
  10283. var h = (e.call ? e(b) : e) || "div", p = ["\x3c", h, " "], m = (d && d.call ? d(b) : d) || {},
  10284. k = (f && f.call ? f(b) : f) || {}, q = (g && g.call ? g.call(this, a, b) : g) || "",
  10285. n = this.domId = k.id || CKEDITOR.tools.getNextId() + "_uiElement";
  10286. b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (m.display = "none", this.notAllowed = !0);
  10287. k.id = n;
  10288. var r = {};
  10289. b.type && (r["cke_dialog_ui_" +
  10290. b.type] = 1);
  10291. b.className && (r[b.className] = 1);
  10292. b.disabled && (r.cke_disabled = 1);
  10293. for (var l = k["class"] && k["class"].split ? k["class"].split(" ") : [], n = 0; n < l.length; n++) l[n] && (r[l[n]] = 1);
  10294. l = [];
  10295. for (n in r) l.push(n);
  10296. k["class"] = l.join(" ");
  10297. b.title && (k.title = b.title);
  10298. r = (b.style || "").split(";");
  10299. b.align && (l = b.align, m["margin-left"] = "left" == l ? 0 : "auto", m["margin-right"] = "right" == l ? 0 : "auto");
  10300. for (n in m) r.push(n + ":" + m[n]);
  10301. b.hidden && r.push("display:none");
  10302. for (n = r.length - 1; 0 <= n; n--) "" === r[n] && r.splice(n, 1);
  10303. 0 < r.length && (k.style =
  10304. (k.style ? k.style + "; " : "") + r.join("; "));
  10305. for (n in k) p.push(n + '\x3d"' + CKEDITOR.tools.htmlEncode(k[n]) + '" ');
  10306. p.push("\x3e", q, "\x3c/", h, "\x3e");
  10307. c.push(p.join(""));
  10308. (this._ || (this._ = {})).dialog = a;
  10309. "boolean" == typeof b.isChanged && (this.isChanged = function () {
  10310. return b.isChanged
  10311. });
  10312. "function" == typeof b.isChanged && (this.isChanged = b.isChanged);
  10313. "function" == typeof b.setValue && (this.setValue = CKEDITOR.tools.override(this.setValue, function (a) {
  10314. return function (c) {
  10315. a.call(this, b.setValue.call(this, c))
  10316. }
  10317. }));
  10318. "function" == typeof b.getValue &&
  10319. (this.getValue = CKEDITOR.tools.override(this.getValue, function (a) {
  10320. return function () {
  10321. return b.getValue.call(this, a.call(this))
  10322. }
  10323. }));
  10324. CKEDITOR.event.implementOn(this);
  10325. this.registerEvents(b);
  10326. this.accessKeyUp && this.accessKeyDown && b.accessKey && R(this, a, "CTRL+" + b.accessKey);
  10327. var t = this;
  10328. a.on("load", function () {
  10329. var b = t.getInputElement();
  10330. if (b) {
  10331. var c = t.type in {
  10332. checkbox: 1,
  10333. ratio: 1
  10334. } && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? "cke_dialog_ui_focused" : "";
  10335. b.on("focus", function () {
  10336. a._.tabBarMode = !1;
  10337. a._.hasFocus = !0;
  10338. t.fire("focus");
  10339. c && this.addClass(c)
  10340. });
  10341. b.on("blur", function () {
  10342. t.fire("blur");
  10343. c && this.removeClass(c)
  10344. })
  10345. }
  10346. });
  10347. CKEDITOR.tools.extend(this, b);
  10348. this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex = a._.focusList.push(this) - 1, this.on("focus", function () {
  10349. a._.currentFocusIndex = t.focusIndex
  10350. }))
  10351. }
  10352. }, hbox: function (a, b, c, e, d) {
  10353. if (!(4 > arguments.length)) {
  10354. this._ || (this._ = {});
  10355. var f = this._.children = b, g = d && d.widths || null, h = d && d.height || null, p,
  10356. m = {role: "presentation"};
  10357. d && d.align && (m.align = d.align);
  10358. CKEDITOR.ui.dialog.uiElement.call(this,
  10359. a, d || {type: "hbox"}, e, "table", {}, m, function () {
  10360. var a = ['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];
  10361. for (p = 0; p < c.length; p++) {
  10362. var b = "cke_dialog_ui_hbox_child", e = [];
  10363. 0 === p && (b = "cke_dialog_ui_hbox_first");
  10364. p == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
  10365. a.push('\x3ctd class\x3d"', b, '" role\x3d"presentation" ');
  10366. g ? g[p] && e.push("width:" + u(g[p])) : e.push("width:" + Math.floor(100 / c.length) + "%");
  10367. h && e.push("height:" + u(h));
  10368. d && void 0 !== d.padding && e.push("padding:" + u(d.padding));
  10369. CKEDITOR.env.ie && CKEDITOR.env.quirks &&
  10370. f[p].align && e.push("text-align:" + f[p].align);
  10371. 0 < e.length && a.push('style\x3d"' + e.join("; ") + '" ');
  10372. a.push("\x3e", c[p], "\x3c/td\x3e")
  10373. }
  10374. a.push("\x3c/tr\x3e\x3c/tbody\x3e");
  10375. return a.join("")
  10376. })
  10377. }
  10378. }, vbox: function (a, b, c, e, d) {
  10379. if (!(3 > arguments.length)) {
  10380. this._ || (this._ = {});
  10381. var f = this._.children = b, g = d && d.width || null, h = d && d.heights || null;
  10382. CKEDITOR.ui.dialog.uiElement.call(this, a, d || {type: "vbox"}, e, "div", null, {role: "presentation"}, function () {
  10383. var b = ['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];
  10384. b.push('style\x3d"');
  10385. d && d.expand && b.push("height:100%;");
  10386. b.push("width:" + u(g || "100%"), ";");
  10387. CKEDITOR.env.webkit && b.push("float:none;");
  10388. b.push('"');
  10389. b.push('align\x3d"', CKEDITOR.tools.htmlEncode(d && d.align || ("ltr" == a.getParentEditor().lang.dir ? "left" : "right")), '" ');
  10390. b.push("\x3e\x3ctbody\x3e");
  10391. for (var e = 0; e < c.length; e++) {
  10392. var k = [];
  10393. b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');
  10394. g && k.push("width:" + u(g || "100%"));
  10395. h ? k.push("height:" + u(h[e])) : d && d.expand && k.push("height:" + Math.floor(100 / c.length) + "%");
  10396. d && void 0 !== d.padding && k.push("padding:" + u(d.padding));
  10397. CKEDITOR.env.ie && CKEDITOR.env.quirks && f[e].align && k.push("text-align:" + f[e].align);
  10398. 0 < k.length && b.push('style\x3d"', k.join("; "), '" ');
  10399. b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e', c[e], "\x3c/td\x3e\x3c/tr\x3e")
  10400. }
  10401. b.push("\x3c/tbody\x3e\x3c/table\x3e");
  10402. return b.join("")
  10403. })
  10404. }
  10405. }
  10406. }
  10407. })();
  10408. CKEDITOR.ui.dialog.uiElement.prototype = {
  10409. getElement: function () {
  10410. return CKEDITOR.document.getById(this.domId)
  10411. }, getInputElement: function () {
  10412. return this.getElement()
  10413. }, getDialog: function () {
  10414. return this._.dialog
  10415. },
  10416. setValue: function (a, b) {
  10417. this.getInputElement().setValue(a);
  10418. !b && this.fire("change", {value: a});
  10419. return this
  10420. }, getValue: function () {
  10421. return this.getInputElement().getValue()
  10422. }, isChanged: function () {
  10423. return !1
  10424. }, selectParentTab: function () {
  10425. for (var a = this.getInputElement(); (a = a.getParent()) && -1 == a.$.className.search("cke_dialog_page_contents");) ;
  10426. if (!a) return this;
  10427. a = a.getAttribute("name");
  10428. this._.dialog._.currentTabId != a && this._.dialog.selectPage(a);
  10429. return this
  10430. }, focus: function () {
  10431. this.selectParentTab().getInputElement().focus();
  10432. return this
  10433. }, registerEvents: function (a) {
  10434. var b = /^on([A-Z]\w+)/, c, e = function (a, b, c, d) {
  10435. b.on("load", function () {
  10436. a.getInputElement().on(c, d, a)
  10437. })
  10438. }, d;
  10439. for (d in a) if (c = d.match(b)) this.eventProcessors[d] ? this.eventProcessors[d].call(this, this._.dialog, a[d]) : e(this, this._.dialog, c[1].toLowerCase(), a[d]);
  10440. return this
  10441. }, eventProcessors: {
  10442. onLoad: function (a, b) {
  10443. a.on("load", b, this)
  10444. }, onShow: function (a, b) {
  10445. a.on("show", b, this)
  10446. }, onHide: function (a, b) {
  10447. a.on("hide", b, this)
  10448. }
  10449. }, accessKeyDown: function () {
  10450. this.focus()
  10451. }, accessKeyUp: function () {
  10452. },
  10453. disable: function () {
  10454. var a = this.getElement();
  10455. this.getInputElement().setAttribute("disabled", "true");
  10456. a.addClass("cke_disabled")
  10457. }, enable: function () {
  10458. var a = this.getElement();
  10459. this.getInputElement().removeAttribute("disabled");
  10460. a.removeClass("cke_disabled")
  10461. }, isEnabled: function () {
  10462. return !this.getElement().hasClass("cke_disabled")
  10463. }, isVisible: function () {
  10464. return this.getInputElement().isVisible()
  10465. }, isFocusable: function () {
  10466. return this.isEnabled() && this.isVisible() ? !0 : !1
  10467. }
  10468. };
  10469. CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,
  10470. {
  10471. getChild: function (a) {
  10472. if (1 > arguments.length) return this._.children.concat();
  10473. a.splice || (a = [a]);
  10474. return 2 > a.length ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null
  10475. }
  10476. }, !0);
  10477. CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
  10478. (function () {
  10479. var a = {
  10480. build: function (a, c, e) {
  10481. for (var d = c.children, f, g = [], h = [], p = 0; p < d.length && (f = d[p]); p++) {
  10482. var m = [];
  10483. g.push(m);
  10484. h.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, m))
  10485. }
  10486. return new CKEDITOR.ui.dialog[c.type](a,
  10487. h, g, e, c)
  10488. }
  10489. };
  10490. CKEDITOR.dialog.addUIElement("hbox", a);
  10491. CKEDITOR.dialog.addUIElement("vbox", a)
  10492. })();
  10493. CKEDITOR.dialogCommand = function (a, b) {
  10494. this.dialogName = a;
  10495. CKEDITOR.tools.extend(this, b, !0)
  10496. };
  10497. CKEDITOR.dialogCommand.prototype = {
  10498. exec: function (a) {
  10499. var b = this.tabId;
  10500. a.openDialog(this.dialogName, function (a) {
  10501. b && a.selectPage(b)
  10502. })
  10503. }, canUndo: !1, editorFocus: 1
  10504. };
  10505. (function () {
  10506. var a = /^([a]|[^a])+$/, b = /^\d*$/, c = /^\d*(?:\.\d+)?$/, e = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
  10507. d = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
  10508. f = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;
  10509. CKEDITOR.VALIDATE_OR = 1;
  10510. CKEDITOR.VALIDATE_AND = 2;
  10511. CKEDITOR.dialog.validate = {
  10512. functions: function () {
  10513. var a = arguments;
  10514. return function () {
  10515. var b = this && this.getValue ? this.getValue() : a[0], c, d = CKEDITOR.VALIDATE_AND, e = [], f;
  10516. for (f = 0; f < a.length; f++) if ("function" == typeof a[f]) e.push(a[f]); else break;
  10517. f < a.length && "string" == typeof a[f] && (c = a[f], f++);
  10518. f < a.length && "number" == typeof a[f] && (d = a[f]);
  10519. var n = d == CKEDITOR.VALIDATE_AND ? !0 : !1;
  10520. for (f = 0; f < e.length; f++) n = d == CKEDITOR.VALIDATE_AND ? n &&
  10521. e[f](b) : n || e[f](b);
  10522. return n ? !0 : c
  10523. }
  10524. }, regex: function (a, b) {
  10525. return function (c) {
  10526. c = this && this.getValue ? this.getValue() : c;
  10527. return a.test(c) ? !0 : b
  10528. }
  10529. }, notEmpty: function (b) {
  10530. return this.regex(a, b)
  10531. }, integer: function (a) {
  10532. return this.regex(b, a)
  10533. }, number: function (a) {
  10534. return this.regex(c, a)
  10535. }, cssLength: function (a) {
  10536. return this.functions(function (a) {
  10537. return d.test(CKEDITOR.tools.trim(a))
  10538. }, a)
  10539. }, htmlLength: function (a) {
  10540. return this.functions(function (a) {
  10541. return e.test(CKEDITOR.tools.trim(a))
  10542. }, a)
  10543. }, inlineStyle: function (a) {
  10544. return this.functions(function (a) {
  10545. return f.test(CKEDITOR.tools.trim(a))
  10546. },
  10547. a)
  10548. }, equals: function (a, b) {
  10549. return this.functions(function (b) {
  10550. return b == a
  10551. }, b)
  10552. }, notEqual: function (a, b) {
  10553. return this.functions(function (b) {
  10554. return b != a
  10555. }, b)
  10556. }
  10557. };
  10558. CKEDITOR.on("instanceDestroyed", function (a) {
  10559. if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
  10560. for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
  10561. for (var c in y) y[c].remove();
  10562. y = {}
  10563. }
  10564. a = a.editor._.storedDialogs;
  10565. for (var d in a) a[d].destroy()
  10566. })
  10567. })();
  10568. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  10569. openDialog: function (a, b) {
  10570. var c = null, e = CKEDITOR.dialog._.dialogDefinitions[a];
  10571. null === CKEDITOR.dialog._.currentTop && M(this);
  10572. if ("function" == typeof e) c = this._.storedDialogs || (this._.storedDialogs = {}), c = c[a] || (c[a] = new CKEDITOR.dialog(this, a)), b && b.call(c, c), c.show(); else {
  10573. if ("failed" == e) throw N(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.');
  10574. "string" == typeof e && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e), function () {
  10575. "function" != typeof CKEDITOR.dialog._.dialogDefinitions[a] && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed");
  10576. this.openDialog(a,
  10577. b)
  10578. }, this, 0, 1)
  10579. }
  10580. CKEDITOR.skin.loadPart("dialog");
  10581. return c
  10582. }
  10583. })
  10584. })();
  10585. CKEDITOR.plugins.add("dialog", {
  10586. requires: "dialogui", init: function (w) {
  10587. w.on("doubleclick", function (z) {
  10588. z.data.dialog && w.openDialog(z.data.dialog)
  10589. }, null, null, 999)
  10590. }
  10591. });
  10592. CKEDITOR.plugins.add("about", {
  10593. requires: "dialog", init: function (a) {
  10594. var b = a.addCommand("about", new CKEDITOR.dialogCommand("about"));
  10595. b.modes = {wysiwyg: 1, source: 1};
  10596. b.canUndo = !1;
  10597. b.readOnly = 1;
  10598. a.ui.addButton && a.ui.addButton("About", {
  10599. label: a.lang.about.dlgTitle,
  10600. command: "about",
  10601. toolbar: "about"
  10602. });
  10603. CKEDITOR.dialog.add("about", this.path + "dialogs/about.js")
  10604. }
  10605. });
  10606. (function () {
  10607. CKEDITOR.plugins.add("a11yhelp", {
  10608. requires: "dialog",
  10609. availableLangs: {
  10610. af: 1,
  10611. ar: 1,
  10612. az: 1,
  10613. bg: 1,
  10614. ca: 1,
  10615. cs: 1,
  10616. cy: 1,
  10617. da: 1,
  10618. de: 1,
  10619. "de-ch": 1,
  10620. el: 1,
  10621. en: 1,
  10622. "en-au": 1,
  10623. "en-gb": 1,
  10624. eo: 1,
  10625. es: 1,
  10626. "es-mx": 1,
  10627. et: 1,
  10628. eu: 1,
  10629. fa: 1,
  10630. fi: 1,
  10631. fo: 1,
  10632. fr: 1,
  10633. "fr-ca": 1,
  10634. gl: 1,
  10635. gu: 1,
  10636. he: 1,
  10637. hi: 1,
  10638. hr: 1,
  10639. hu: 1,
  10640. id: 1,
  10641. it: 1,
  10642. ja: 1,
  10643. km: 1,
  10644. ko: 1,
  10645. ku: 1,
  10646. lt: 1,
  10647. lv: 1,
  10648. mk: 1,
  10649. mn: 1,
  10650. nb: 1,
  10651. nl: 1,
  10652. no: 1,
  10653. oc: 1,
  10654. pl: 1,
  10655. pt: 1,
  10656. "pt-br": 1,
  10657. ro: 1,
  10658. ru: 1,
  10659. si: 1,
  10660. sk: 1,
  10661. sl: 1,
  10662. sq: 1,
  10663. sr: 1,
  10664. "sr-latn": 1,
  10665. sv: 1,
  10666. th: 1,
  10667. tr: 1,
  10668. tt: 1,
  10669. ug: 1,
  10670. uk: 1,
  10671. vi: 1,
  10672. zh: 1,
  10673. "zh-cn": 1
  10674. },
  10675. init: function (b) {
  10676. var c = this;
  10677. b.addCommand("a11yHelp", {
  10678. exec: function () {
  10679. var a =
  10680. b.langCode,
  10681. a = c.availableLangs[a] ? a : c.availableLangs[a.replace(/-.*/, "")] ? a.replace(/-.*/, "") : "en";
  10682. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + a + ".js"), function () {
  10683. b.lang.a11yhelp = c.langEntries[a];
  10684. b.openDialog("a11yHelp")
  10685. })
  10686. }, modes: {wysiwyg: 1, source: 1}, readOnly: 1, canUndo: !1
  10687. });
  10688. b.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp");
  10689. CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js");
  10690. b.on("ariaEditorHelpLabel", function (a) {
  10691. a.data.label = b.lang.common.editorHelp
  10692. })
  10693. }
  10694. })
  10695. })();
  10696. (function () {
  10697. function f(c) {
  10698. var a = this.att;
  10699. c = c && c.hasAttribute(a) && c.getAttribute(a) || "";
  10700. void 0 !== c && this.setValue(c)
  10701. }
  10702. function g() {
  10703. for (var c, a = 0; a < arguments.length; a++) if (arguments[a] instanceof CKEDITOR.dom.element) {
  10704. c = arguments[a];
  10705. break
  10706. }
  10707. if (c) {
  10708. var a = this.att, b = this.getValue();
  10709. b ? c.setAttribute(a, b) : c.removeAttribute(a, b)
  10710. }
  10711. }
  10712. var k = {id: 1, dir: 1, classes: 1, styles: 1};
  10713. CKEDITOR.plugins.add("dialogadvtab", {
  10714. requires: "dialog", allowedContent: function (c) {
  10715. c || (c = k);
  10716. var a = [];
  10717. c.id && a.push("id");
  10718. c.dir && a.push("dir");
  10719. var b =
  10720. "";
  10721. a.length && (b += "[" + a.join(",") + "]");
  10722. c.classes && (b += "(*)");
  10723. c.styles && (b += "{*}");
  10724. return b
  10725. }, createAdvancedTab: function (c, a, b) {
  10726. a || (a = k);
  10727. var d = c.lang.common, h = {
  10728. id: "advanced",
  10729. label: d.advancedTab,
  10730. title: d.advancedTab,
  10731. elements: [{type: "vbox", padding: 1, children: []}]
  10732. }, e = [];
  10733. if (a.id || a.dir) a.id && e.push({
  10734. id: "advId",
  10735. att: "id",
  10736. type: "text",
  10737. requiredContent: b ? b + "[id]" : null,
  10738. label: d.id,
  10739. setup: f,
  10740. commit: g
  10741. }), a.dir && e.push({
  10742. id: "advLangDir",
  10743. att: "dir",
  10744. type: "select",
  10745. requiredContent: b ? b + "[dir]" : null,
  10746. label: d.langDir,
  10747. "default": "",
  10748. style: "width:100%",
  10749. items: [[d.notSet, ""], [d.langDirLTR, "ltr"], [d.langDirRTL, "rtl"]],
  10750. setup: f,
  10751. commit: g
  10752. }), h.elements[0].children.push({type: "hbox", widths: ["50%", "50%"], children: [].concat(e)});
  10753. if (a.styles || a.classes) e = [], a.styles && e.push({
  10754. id: "advStyles",
  10755. att: "style",
  10756. type: "text",
  10757. requiredContent: b ? b + "{cke-xyz}" : null,
  10758. label: d.styles,
  10759. "default": "",
  10760. validate: CKEDITOR.dialog.validate.inlineStyle(d.invalidInlineStyle),
  10761. onChange: function () {
  10762. },
  10763. getStyle: function (a, c) {
  10764. var b = this.getValue().match(new RegExp("(?:^|;)\\s*" +
  10765. a + "\\s*:\\s*([^;]*)", "i"));
  10766. return b ? b[1] : c
  10767. },
  10768. updateStyle: function (a, b) {
  10769. var d = this.getValue(), e = c.document.createElement("span");
  10770. e.setAttribute("style", d);
  10771. e.setStyle(a, b);
  10772. d = CKEDITOR.tools.normalizeCssText(e.getAttribute("style"));
  10773. this.setValue(d, 1)
  10774. },
  10775. setup: f,
  10776. commit: g
  10777. }), a.classes && e.push({
  10778. type: "hbox",
  10779. widths: ["45%", "55%"],
  10780. children: [{
  10781. id: "advCSSClasses",
  10782. att: "class",
  10783. type: "text",
  10784. requiredContent: b ? b + "(cke-xyz)" : null,
  10785. label: d.cssClasses,
  10786. "default": "",
  10787. setup: f,
  10788. commit: g
  10789. }]
  10790. }), h.elements[0].children.push({
  10791. type: "hbox",
  10792. widths: ["50%", "50%"], children: [].concat(e)
  10793. });
  10794. return h
  10795. }
  10796. })
  10797. })();
  10798. CKEDITOR.plugins.add("basicstyles", {
  10799. init: function (c) {
  10800. var e = 0, d = function (g, d, b, a) {
  10801. if (a) {
  10802. a = new CKEDITOR.style(a);
  10803. var f = h[b];
  10804. f.unshift(a);
  10805. c.attachStyleStateChange(a, function (a) {
  10806. !c.readOnly && c.getCommand(b).setState(a)
  10807. });
  10808. c.addCommand(b, new CKEDITOR.styleCommand(a, {contentForms: f}));
  10809. c.ui.addButton && c.ui.addButton(g, {label: d, command: b, toolbar: "basicstyles," + (e += 10)})
  10810. }
  10811. }, h = {
  10812. bold: ["strong", "b", ["span", function (a) {
  10813. a = a.styles["font-weight"];
  10814. return "bold" == a || 700 <= +a
  10815. }]], italic: ["em", "i", ["span", function (a) {
  10816. return "italic" ==
  10817. a.styles["font-style"]
  10818. }]], underline: ["u", ["span", function (a) {
  10819. return "underline" == a.styles["text-decoration"]
  10820. }]], strike: ["s", "strike", ["span", function (a) {
  10821. return "line-through" == a.styles["text-decoration"]
  10822. }]], subscript: ["sub"], superscript: ["sup"]
  10823. }, b = c.config, a = c.lang.basicstyles;
  10824. d("Bold", a.bold, "bold", b.coreStyles_bold);
  10825. d("Italic", a.italic, "italic", b.coreStyles_italic);
  10826. d("Underline", a.underline, "underline", b.coreStyles_underline);
  10827. d("Strike", a.strike, "strike", b.coreStyles_strike);
  10828. d("Subscript", a.subscript,
  10829. "subscript", b.coreStyles_subscript);
  10830. d("Superscript", a.superscript, "superscript", b.coreStyles_superscript);
  10831. c.setKeystroke([[CKEDITOR.CTRL + 66, "bold"], [CKEDITOR.CTRL + 73, "italic"], [CKEDITOR.CTRL + 85, "underline"]])
  10832. }
  10833. });
  10834. CKEDITOR.config.coreStyles_bold = {element: "strong", overrides: "b"};
  10835. CKEDITOR.config.coreStyles_italic = {element: "em", overrides: "i"};
  10836. CKEDITOR.config.coreStyles_underline = {element: "u"};
  10837. CKEDITOR.config.coreStyles_strike = {element: "s", overrides: "strike"};
  10838. CKEDITOR.config.coreStyles_subscript = {element: "sub"};
  10839. CKEDITOR.config.coreStyles_superscript = {element: "sup"};
  10840. (function () {
  10841. function q(a, f, d, b) {
  10842. if (!a.isReadOnly() && !a.equals(d.editable())) {
  10843. CKEDITOR.dom.element.setMarker(b, a, "bidi_processed", 1);
  10844. b = a;
  10845. for (var c = d.editable(); (b = b.getParent()) && !b.equals(c);) if (b.getCustomData("bidi_processed")) {
  10846. a.removeStyle("direction");
  10847. a.removeAttribute("dir");
  10848. return
  10849. }
  10850. b = "useComputedState" in d.config ? d.config.useComputedState : 1;
  10851. (b ? a.getComputedStyle("direction") : a.getStyle("direction") || a.hasAttribute("dir")) != f && (a.removeStyle("direction"), b ? (a.removeAttribute("dir"), f != a.getComputedStyle("direction") &&
  10852. a.setAttribute("dir", f)) : a.setAttribute("dir", f), d.forceNextSelectionCheck())
  10853. }
  10854. }
  10855. function v(a, f, d) {
  10856. var b = a.getCommonAncestor(!1, !0);
  10857. a = a.clone();
  10858. a.enlarge(d == CKEDITOR.ENTER_BR ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  10859. if (a.checkBoundaryOfElement(b, CKEDITOR.START) && a.checkBoundaryOfElement(b, CKEDITOR.END)) {
  10860. for (var c; b && b.type == CKEDITOR.NODE_ELEMENT && (c = b.getParent()) && 1 == c.getChildCount() && !(b.getName() in f);) b = c;
  10861. return b.type == CKEDITOR.NODE_ELEMENT && b.getName() in f && b
  10862. }
  10863. }
  10864. function p(a) {
  10865. return {
  10866. context: "p",
  10867. allowedContent: {
  10868. "h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td": {
  10869. propertiesOnly: !0,
  10870. attributes: "dir"
  10871. }
  10872. }, requiredContent: "p[dir]", refresh: function (a, d) {
  10873. var b = a.config.useComputedState, c, b = void 0 === b || b;
  10874. if (!b) {
  10875. c = d.lastElement;
  10876. for (var h = a.editable(); c && !(c.getName() in u || c.equals(h));) {
  10877. var e = c.getParent();
  10878. if (!e) break;
  10879. c = e
  10880. }
  10881. }
  10882. c = c || d.block || d.blockLimit;
  10883. c.equals(a.editable()) && (h = a.getSelection().getRanges()[0].getEnclosedNode()) && h.type == CKEDITOR.NODE_ELEMENT && (c = h);
  10884. c && (b = b ? c.getComputedStyle("direction") :
  10885. c.getStyle("direction") || c.getAttribute("dir"), a.getCommand("bidirtl").setState("rtl" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF), a.getCommand("bidiltr").setState("ltr" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF));
  10886. b = (d.block || d.blockLimit || a.editable()).getDirection(1);
  10887. b != (a._.selDir || a.lang.dir) && (a._.selDir = b, a.fire("contentDirChanged", b))
  10888. }, exec: function (f) {
  10889. var d = f.getSelection(), b = f.config.enterMode, c = d.getRanges();
  10890. if (c && c.length) {
  10891. for (var h = {}, e = d.createBookmarks(), c = c.createIterator(), g,
  10892. l = 0; g = c.getNextRange(1);) {
  10893. var k = g.getEnclosedNode();
  10894. k && (!k || k.type == CKEDITOR.NODE_ELEMENT && k.getName() in r) || (k = v(g, t, b));
  10895. k && q(k, a, f, h);
  10896. var m = new CKEDITOR.dom.walker(g), n = e[l].startNode, p = e[l++].endNode;
  10897. m.evaluator = function (a) {
  10898. var c = b == CKEDITOR.ENTER_P ? "p" : "div", d;
  10899. if (d = (a ? a.type == CKEDITOR.NODE_ELEMENT : !1) && a.getName() in t) {
  10900. if (c = a.is(c)) c = (c = a.getParent()) ? c.type == CKEDITOR.NODE_ELEMENT : !1;
  10901. d = !(c && a.getParent().is("blockquote"))
  10902. }
  10903. return !!(d && a.getPosition(n) & CKEDITOR.POSITION_FOLLOWING && (a.getPosition(p) &
  10904. CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_CONTAINS) == CKEDITOR.POSITION_PRECEDING)
  10905. };
  10906. for (; k = m.next();) q(k, a, f, h);
  10907. g = g.createIterator();
  10908. for (g.enlargeBr = b != CKEDITOR.ENTER_BR; k = g.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");) q(k, a, f, h)
  10909. }
  10910. CKEDITOR.dom.element.clearAllMarkers(h);
  10911. f.forceNextSelectionCheck();
  10912. d.selectBookmarks(e);
  10913. f.focus()
  10914. }
  10915. }
  10916. }
  10917. }
  10918. function w(a) {
  10919. var f = a == l.setAttribute, d = a == l.removeAttribute, b = /\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
  10920. return function (c, h) {
  10921. if (!this.isReadOnly()) {
  10922. var e;
  10923. if (e = c == (f || d ?
  10924. "dir" : "direction") || "style" == c && (d || b.test(h))) {
  10925. a:{
  10926. e = this;
  10927. for (var g = e.getDocument().getBody().getParent(); e;) {
  10928. if (e.equals(g)) {
  10929. e = !1;
  10930. break a
  10931. }
  10932. e = e.getParent()
  10933. }
  10934. e = !0
  10935. }
  10936. e = !e
  10937. }
  10938. if (e && (e = this.getDirection(1), g = a.apply(this, arguments), e != this.getDirection(1))) return this.getDocument().fire("dirChanged", this), g
  10939. }
  10940. return a.apply(this, arguments)
  10941. }
  10942. }
  10943. var t = {table: 1, ul: 1, ol: 1, blockquote: 1, div: 1}, r = {}, u = {};
  10944. CKEDITOR.tools.extend(r, t, {tr: 1, p: 1, div: 1, li: 1});
  10945. CKEDITOR.tools.extend(u, r, {td: 1});
  10946. CKEDITOR.plugins.add("bidi", {
  10947. init: function (a) {
  10948. function f(b,
  10949. c, d, e, f) {
  10950. a.addCommand(d, new CKEDITOR.command(a, e));
  10951. a.ui.addButton && a.ui.addButton(b, {label: c, command: d, toolbar: "bidi," + f})
  10952. }
  10953. if (!a.blockless) {
  10954. var d = a.lang.bidi;
  10955. f("BidiLtr", d.ltr, "bidiltr", p("ltr"), 10);
  10956. f("BidiRtl", d.rtl, "bidirtl", p("rtl"), 20);
  10957. a.on("contentDom", function () {
  10958. a.document.on("dirChanged", function (b) {
  10959. a.fire("dirChanged", {node: b.data, dir: b.data.getDirection(1)})
  10960. })
  10961. });
  10962. a.on("contentDirChanged", function (b) {
  10963. b = (a.lang.dir != b.data ? "add" : "remove") + "Class";
  10964. var c = a.ui.space(a.config.toolbarLocation);
  10965. if (c) c[b]("cke_mixed_dir_content")
  10966. })
  10967. }
  10968. }
  10969. });
  10970. for (var l = CKEDITOR.dom.element.prototype, n = ["setStyle", "removeStyle", "setAttribute", "removeAttribute"], m = 0; m < n.length; m++) l[n[m]] = CKEDITOR.tools.override(l[n[m]], w)
  10971. })();
  10972. (function () {
  10973. var m = {
  10974. exec: function (g) {
  10975. var a = g.getCommand("blockquote").state, k = g.getSelection(), c = k && k.getRanges()[0];
  10976. if (c) {
  10977. var h = k.createBookmarks();
  10978. if (CKEDITOR.env.ie) {
  10979. var e = h[0].startNode, b = h[0].endNode, d;
  10980. if (e && "blockquote" == e.getParent().getName()) for (d = e; d = d.getNext();) if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
  10981. e.move(d, !0);
  10982. break
  10983. }
  10984. if (b && "blockquote" == b.getParent().getName()) for (d = b; d = d.getPrevious();) if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
  10985. b.move(d);
  10986. break
  10987. }
  10988. }
  10989. var f = c.createIterator();
  10990. f.enlargeBr = g.config.enterMode != CKEDITOR.ENTER_BR;
  10991. if (a == CKEDITOR.TRISTATE_OFF) {
  10992. for (e = []; a = f.getNextParagraph();) e.push(a);
  10993. 1 > e.length && (a = g.document.createElement(g.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), b = h.shift(), c.insertNode(a), a.append(new CKEDITOR.dom.text("", g.document)), c.moveToBookmark(b), c.selectNodeContents(a), c.collapse(!0), b = c.createBookmark(), e.push(a), h.unshift(b));
  10994. d = e[0].getParent();
  10995. c = [];
  10996. for (b = 0; b < e.length; b++) a = e[b], d = d.getCommonAncestor(a.getParent());
  10997. for (a = {
  10998. table: 1, tbody: 1,
  10999. tr: 1, ol: 1, ul: 1
  11000. }; a[d.getName()];) d = d.getParent();
  11001. for (b = null; 0 < e.length;) {
  11002. for (a = e.shift(); !a.getParent().equals(d);) a = a.getParent();
  11003. a.equals(b) || c.push(a);
  11004. b = a
  11005. }
  11006. for (; 0 < c.length;) if (a = c.shift(), "blockquote" == a.getName()) {
  11007. for (b = new CKEDITOR.dom.documentFragment(g.document); a.getFirst();) b.append(a.getFirst().remove()), e.push(b.getLast());
  11008. b.replace(a)
  11009. } else e.push(a);
  11010. c = g.document.createElement("blockquote");
  11011. for (c.insertBefore(e[0]); 0 < e.length;) a = e.shift(), c.append(a)
  11012. } else if (a == CKEDITOR.TRISTATE_ON) {
  11013. b = [];
  11014. for (d = {}; a = f.getNextParagraph();) {
  11015. for (e = c = null; a.getParent();) {
  11016. if ("blockquote" == a.getParent().getName()) {
  11017. c = a.getParent();
  11018. e = a;
  11019. break
  11020. }
  11021. a = a.getParent()
  11022. }
  11023. c && e && !e.getCustomData("blockquote_moveout") && (b.push(e), CKEDITOR.dom.element.setMarker(d, e, "blockquote_moveout", !0))
  11024. }
  11025. CKEDITOR.dom.element.clearAllMarkers(d);
  11026. a = [];
  11027. e = [];
  11028. for (d = {}; 0 < b.length;) f = b.shift(), c = f.getParent(), f.getPrevious() ? f.getNext() ? (f.breakParent(f.getParent()), e.push(f.getNext())) : f.remove().insertAfter(c) : f.remove().insertBefore(c), c.getCustomData("blockquote_processed") ||
  11029. (e.push(c), CKEDITOR.dom.element.setMarker(d, c, "blockquote_processed", !0)), a.push(f);
  11030. CKEDITOR.dom.element.clearAllMarkers(d);
  11031. for (b = e.length - 1; 0 <= b; b--) {
  11032. c = e[b];
  11033. a:{
  11034. d = c;
  11035. for (var f = 0, m = d.getChildCount(), l = void 0; f < m && (l = d.getChild(f)); f++) if (l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) {
  11036. d = !1;
  11037. break a
  11038. }
  11039. d = !0
  11040. }
  11041. d && c.remove()
  11042. }
  11043. if (g.config.enterMode == CKEDITOR.ENTER_BR) for (c = !0; a.length;) if (f = a.shift(), "div" == f.getName()) {
  11044. b = new CKEDITOR.dom.documentFragment(g.document);
  11045. !c || !f.getPrevious() || f.getPrevious().type ==
  11046. CKEDITOR.NODE_ELEMENT && f.getPrevious().isBlockBoundary() || b.append(g.document.createElement("br"));
  11047. for (c = f.getNext() && !(f.getNext().type == CKEDITOR.NODE_ELEMENT && f.getNext().isBlockBoundary()); f.getFirst();) f.getFirst().remove().appendTo(b);
  11048. c && b.append(g.document.createElement("br"));
  11049. b.replace(f);
  11050. c = !1
  11051. }
  11052. }
  11053. k.selectBookmarks(h);
  11054. g.focus()
  11055. }
  11056. }, refresh: function (g, a) {
  11057. this.setState(g.elementPath(a.block || a.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
  11058. }, context: "blockquote", allowedContent: "blockquote",
  11059. requiredContent: "blockquote"
  11060. };
  11061. CKEDITOR.plugins.add("blockquote", {
  11062. init: function (g) {
  11063. g.blockless || (g.addCommand("blockquote", m), g.ui.addButton && g.ui.addButton("Blockquote", {
  11064. label: g.lang.blockquote.toolbar,
  11065. command: "blockquote",
  11066. toolbar: "blocks,10"
  11067. }))
  11068. }
  11069. })
  11070. })();
  11071. (function () {
  11072. function q(b, a) {
  11073. CKEDITOR.tools.extend(this, a, {
  11074. editor: b,
  11075. id: "cke-" + CKEDITOR.tools.getUniqueId(),
  11076. area: b._.notificationArea
  11077. });
  11078. a.type || (this.type = "info");
  11079. this.element = this._createElement();
  11080. b.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)
  11081. }
  11082. function r(b) {
  11083. var a = this;
  11084. this.editor = b;
  11085. this.notifications = [];
  11086. this.element = this._createElement();
  11087. this._uiBuffer = CKEDITOR.tools.eventsBuffer(10, this._layout, this);
  11088. this._changeBuffer = CKEDITOR.tools.eventsBuffer(500, this._layout,
  11089. this);
  11090. b.on("destroy", function () {
  11091. a._removeListeners();
  11092. a.element.remove()
  11093. })
  11094. }
  11095. CKEDITOR.plugins.add("notification", {
  11096. init: function (b) {
  11097. function a(b) {
  11098. var a = new CKEDITOR.dom.element("div");
  11099. a.setStyles({position: "fixed", "margin-left": "-9999px"});
  11100. a.setAttributes({"aria-live": "assertive", "aria-atomic": "true"});
  11101. a.setText(b);
  11102. CKEDITOR.document.getBody().append(a);
  11103. setTimeout(function () {
  11104. a.remove()
  11105. }, 100)
  11106. }
  11107. b._.notificationArea = new r(b);
  11108. b.showNotification = function (a, d, e) {
  11109. var f, l;
  11110. "progress" == d ? f = e : l = e;
  11111. a = new CKEDITOR.plugins.notification(b,
  11112. {message: a, type: d, progress: f, duration: l});
  11113. a.show();
  11114. return a
  11115. };
  11116. b.on("key", function (c) {
  11117. if (27 == c.data.keyCode) {
  11118. var d = b._.notificationArea.notifications;
  11119. d.length && (a(b.lang.notification.closed), d[d.length - 1].hide(), c.cancel())
  11120. }
  11121. })
  11122. }
  11123. });
  11124. q.prototype = {
  11125. show: function () {
  11126. !1 !== this.editor.fire("notificationShow", {notification: this}) && (this.area.add(this), this._hideAfterTimeout())
  11127. }, update: function (b) {
  11128. var a = !0;
  11129. !1 === this.editor.fire("notificationUpdate", {notification: this, options: b}) && (a = !1);
  11130. var c = this.element, d = c.findOne(".cke_notification_message"),
  11131. e = c.findOne(".cke_notification_progress"), f = b.type;
  11132. c.removeAttribute("role");
  11133. b.progress && "progress" != this.type && (f = "progress");
  11134. f && (c.removeClass(this._getClass()), c.removeAttribute("aria-label"), this.type = f, c.addClass(this._getClass()), c.setAttribute("aria-label", this.type), "progress" != this.type || e ? "progress" != this.type && e && e.remove() : (e = this._createProgressElement(), e.insertBefore(d)));
  11135. void 0 !== b.message && (this.message = b.message, d.setHtml(this.message));
  11136. void 0 !== b.progress && (this.progress = b.progress,
  11137. e && e.setStyle("width", this._getPercentageProgress()));
  11138. a && b.important && (c.setAttribute("role", "alert"), this.isVisible() || this.area.add(this));
  11139. this.duration = b.duration;
  11140. this._hideAfterTimeout()
  11141. }, hide: function () {
  11142. !1 !== this.editor.fire("notificationHide", {notification: this}) && this.area.remove(this)
  11143. }, isVisible: function () {
  11144. return 0 <= CKEDITOR.tools.indexOf(this.area.notifications, this)
  11145. }, _createElement: function () {
  11146. var b = this, a, c, d = this.editor.lang.common.close;
  11147. a = new CKEDITOR.dom.element("div");
  11148. a.addClass("cke_notification");
  11149. a.addClass(this._getClass());
  11150. a.setAttributes({id: this.id, role: "alert", "aria-label": this.type});
  11151. "progress" == this.type && a.append(this._createProgressElement());
  11152. c = new CKEDITOR.dom.element("p");
  11153. c.addClass("cke_notification_message");
  11154. c.setHtml(this.message);
  11155. a.append(c);
  11156. c = CKEDITOR.dom.element.createFromHtml('\x3ca class\x3d"cke_notification_close" href\x3d"javascript:void(0)" title\x3d"' + d + '" role\x3d"button" tabindex\x3d"-1"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e');
  11157. a.append(c);
  11158. c.on("click",
  11159. function () {
  11160. b.editor.focus();
  11161. b.hide()
  11162. });
  11163. return a
  11164. }, _getClass: function () {
  11165. return "progress" == this.type ? "cke_notification_info" : "cke_notification_" + this.type
  11166. }, _createProgressElement: function () {
  11167. var b = new CKEDITOR.dom.element("span");
  11168. b.addClass("cke_notification_progress");
  11169. b.setStyle("width", this._getPercentageProgress());
  11170. return b
  11171. }, _getPercentageProgress: function () {
  11172. return Math.round(100 * (this.progress || 0)) + "%"
  11173. }, _hideAfterTimeout: function () {
  11174. var b = this, a;
  11175. this._hideTimeoutId && clearTimeout(this._hideTimeoutId);
  11176. if ("number" == typeof this.duration) a = this.duration; else if ("info" == this.type || "success" == this.type) a = "number" == typeof this.editor.config.notification_duration ? this.editor.config.notification_duration : 5E3;
  11177. a && (b._hideTimeoutId = setTimeout(function () {
  11178. b.hide()
  11179. }, a))
  11180. }
  11181. };
  11182. r.prototype = {
  11183. add: function (b) {
  11184. this.notifications.push(b);
  11185. this.element.append(b.element);
  11186. 1 == this.element.getChildCount() && (CKEDITOR.document.getBody().append(this.element), this._attachListeners());
  11187. this._layout()
  11188. }, remove: function (b) {
  11189. var a = CKEDITOR.tools.indexOf(this.notifications,
  11190. b);
  11191. 0 > a || (this.notifications.splice(a, 1), b.element.remove(), this.element.getChildCount() || (this._removeListeners(), this.element.remove()))
  11192. }, _createElement: function () {
  11193. var b = this.editor, a = b.config, c = new CKEDITOR.dom.element("div");
  11194. c.addClass("cke_notifications_area");
  11195. c.setAttribute("id", "cke_notifications_area_" + b.name);
  11196. c.setStyle("z-index", a.baseFloatZIndex - 2);
  11197. return c
  11198. }, _attachListeners: function () {
  11199. var b = CKEDITOR.document.getWindow(), a = this.editor;
  11200. b.on("scroll", this._uiBuffer.input);
  11201. b.on("resize", this._uiBuffer.input);
  11202. a.on("change", this._changeBuffer.input);
  11203. a.on("floatingSpaceLayout", this._layout, this, null, 20);
  11204. a.on("blur", this._layout, this, null, 20)
  11205. }, _removeListeners: function () {
  11206. var b = CKEDITOR.document.getWindow(), a = this.editor;
  11207. b.removeListener("scroll", this._uiBuffer.input);
  11208. b.removeListener("resize", this._uiBuffer.input);
  11209. a.removeListener("change", this._changeBuffer.input);
  11210. a.removeListener("floatingSpaceLayout", this._layout);
  11211. a.removeListener("blur", this._layout)
  11212. }, _layout: function () {
  11213. function b() {
  11214. a.setStyle("left",
  11215. k(n + d.width - g - h))
  11216. }
  11217. var a = this.element, c = this.editor, d = c.ui.contentsElement.getClientRect(),
  11218. e = c.ui.contentsElement.getDocumentPosition(), f, l, u = a.getClientRect(), m,
  11219. g = this._notificationWidth, h = this._notificationMargin;
  11220. m = CKEDITOR.document.getWindow();
  11221. var p = m.getScrollPosition(), t = m.getViewPaneSize(), q = CKEDITOR.document.getBody(),
  11222. r = q.getDocumentPosition(), k = CKEDITOR.tools.cssLength;
  11223. g && h || (m = this.element.getChild(0), g = this._notificationWidth = m.getClientRect().width, h = this._notificationMargin = parseInt(m.getComputedStyle("margin-left"),
  11224. 10) + parseInt(m.getComputedStyle("margin-right"), 10));
  11225. c.toolbar && (f = c.ui.space("top"), l = f.getClientRect());
  11226. f && f.isVisible() && l.bottom > d.top && l.bottom < d.bottom - u.height ? a.setStyles({
  11227. position: "fixed",
  11228. top: k(l.bottom)
  11229. }) : 0 < d.top ? a.setStyles({
  11230. position: "absolute",
  11231. top: k(e.y)
  11232. }) : e.y + d.height - u.height > p.y ? a.setStyles({
  11233. position: "fixed",
  11234. top: 0
  11235. }) : a.setStyles({position: "absolute", top: k(e.y + d.height - u.height)});
  11236. var n = "fixed" == a.getStyle("position") ? d.left : "static" != q.getComputedStyle("position") ? e.x - r.x : e.x;
  11237. d.width <
  11238. g + h ? e.x + g + h > p.x + t.width ? b() : a.setStyle("left", k(n)) : e.x + g + h > p.x + t.width ? a.setStyle("left", k(n)) : e.x + d.width / 2 + g / 2 + h > p.x + t.width ? a.setStyle("left", k(n - e.x + p.x + t.width - g - h)) : 0 > d.left + d.width - g - h ? b() : 0 > d.left + d.width / 2 - g / 2 ? a.setStyle("left", k(n - e.x + p.x)) : a.setStyle("left", k(n + d.width / 2 - g / 2 - h / 2))
  11239. }
  11240. };
  11241. CKEDITOR.plugins.notification = q
  11242. })();
  11243. (function () {
  11244. var c = '\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href\x3d\"javascript:void('{titleJs}')\"") + ' 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}"';
  11245. CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  11246. CKEDITOR.env.gecko && (c +=
  11247. ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  11248. var k = "";
  11249. CKEDITOR.env.ie && (k = 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');
  11250. var c = c + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"' + k + 'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"') +
  11251. '\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{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',
  11252. v = CKEDITOR.addTemplate("buttonArrow", '\x3cspan class\x3d"cke_button_arrow"\x3e' + (CKEDITOR.env.hc ? "\x26#9660;" : "") + "\x3c/span\x3e"),
  11253. w = CKEDITOR.addTemplate("button", c);
  11254. CKEDITOR.plugins.add("button", {
  11255. beforeInit: function (a) {
  11256. a.ui.addHandler(CKEDITOR.UI_BUTTON,
  11257. CKEDITOR.ui.button.handler)
  11258. }
  11259. });
  11260. CKEDITOR.UI_BUTTON = "button";
  11261. CKEDITOR.ui.button = function (a) {
  11262. CKEDITOR.tools.extend(this, a, {
  11263. title: a.label, click: a.click || function (b) {
  11264. b.execCommand(a.command)
  11265. }
  11266. });
  11267. this._ = {}
  11268. };
  11269. CKEDITOR.ui.button.handler = {
  11270. create: function (a) {
  11271. return new CKEDITOR.ui.button(a)
  11272. }
  11273. };
  11274. CKEDITOR.ui.button.prototype = {
  11275. render: function (a, b) {
  11276. function c() {
  11277. var f = a.mode;
  11278. f && (f = this.modes[f] ? void 0 !== p[f] ? p[f] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, f = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED :
  11279. f, this.setState(f), this.refresh && this.refresh())
  11280. }
  11281. var p = null, q = CKEDITOR.env, r = this._.id = CKEDITOR.tools.getNextId(), g = "", d = this.command, k,
  11282. l, m;
  11283. this._.editor = a;
  11284. var e = {
  11285. id: r, button: this, editor: a, focus: function () {
  11286. CKEDITOR.document.getById(r).focus()
  11287. }, execute: function () {
  11288. this.button.click(a)
  11289. }, attach: function (a) {
  11290. this.button.attach(a)
  11291. }
  11292. }, x = CKEDITOR.tools.addFunction(function (a) {
  11293. if (e.onkey) return a = new CKEDITOR.dom.event(a), !1 !== e.onkey(e, a.getKeystroke())
  11294. }), y = CKEDITOR.tools.addFunction(function (a) {
  11295. var b;
  11296. e.onfocus &&
  11297. (b = !1 !== e.onfocus(e, new CKEDITOR.dom.event(a)));
  11298. return b
  11299. }), u = 0;
  11300. e.clickFn = k = CKEDITOR.tools.addFunction(function () {
  11301. u && (a.unlockSelection(1), u = 0);
  11302. e.execute();
  11303. q.iOS && a.focus()
  11304. });
  11305. this.modes ? (p = {}, a.on("beforeModeUnload", function () {
  11306. a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (p[a.mode] = this._.state)
  11307. }, this), a.on("activeFilterChange", c, this), a.on("mode", c, this), !this.readOnly && a.on("readOnly", c, this)) : d && (d = a.getCommand(d)) && (d.on("state", function () {
  11308. this.setState(d.state)
  11309. }, this), g += d.state == CKEDITOR.TRISTATE_ON ?
  11310. "on" : d.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off");
  11311. var n;
  11312. if (this.directional) a.on("contentDirChanged", function (b) {
  11313. var c = CKEDITOR.document.getById(this._.id), d = c.getFirst();
  11314. b = b.data;
  11315. b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl");
  11316. d.setAttribute("style", CKEDITOR.skin.getIconStyle(n, "rtl" == b, this.icon, this.iconOffset))
  11317. }, this);
  11318. d ? (l = a.getCommandKeystroke(d)) && (m = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, l)) : g += "off";
  11319. l = this.name || this.command;
  11320. var h =
  11321. null, t = this.icon;
  11322. n = l;
  11323. this.icon && !/\./.test(this.icon) ? (n = this.icon, t = null) : (this.icon && (h = this.icon), CKEDITOR.env.hidpi && this.iconHiDpi && (h = this.iconHiDpi));
  11324. h ? (CKEDITOR.skin.addIcon(h, h), t = null) : h = n;
  11325. g = {
  11326. id: r,
  11327. name: l,
  11328. iconName: n,
  11329. label: this.label,
  11330. cls: (this.hasArrow ? "cke_button_expandable " : "") + (this.className || ""),
  11331. state: g,
  11332. ariaDisabled: "disabled" == g ? "true" : "false",
  11333. title: this.title + (m ? " (" + m.display + ")" : ""),
  11334. ariaShortcut: m ? a.lang.common.keyboardShortcut + " " + m.aria : "",
  11335. titleJs: q.gecko && !q.hc ? "" : (this.title ||
  11336. "").replace("'", ""),
  11337. hasArrow: "string" === typeof this.hasArrow && this.hasArrow || (this.hasArrow ? "true" : "false"),
  11338. keydownFn: x,
  11339. focusFn: y,
  11340. clickFn: k,
  11341. style: CKEDITOR.skin.getIconStyle(h, "rtl" == a.lang.dir, t, this.iconOffset),
  11342. arrowHtml: this.hasArrow ? v.output() : ""
  11343. };
  11344. w.output(g, b);
  11345. if (this.onRender) this.onRender();
  11346. return e
  11347. }, setState: function (a) {
  11348. if (this._.state == a) return !1;
  11349. this._.state = a;
  11350. var b = CKEDITOR.document.getById(this._.id);
  11351. return b ? (b.setState(a, "cke_button"), b.setAttribute("aria-disabled", a == CKEDITOR.TRISTATE_DISABLED),
  11352. this.hasArrow ? b.setAttribute("aria-expanded", a == CKEDITOR.TRISTATE_ON) : a === CKEDITOR.TRISTATE_ON ? b.setAttribute("aria-pressed", !0) : b.removeAttribute("aria-pressed"), !0) : !1
  11353. }, getState: function () {
  11354. return this._.state
  11355. }, toFeature: function (a) {
  11356. if (this._.feature) return this._.feature;
  11357. var b = this;
  11358. this.allowedContent || this.requiredContent || !this.command || (b = a.getCommand(this.command) || b);
  11359. return this._.feature = b
  11360. }
  11361. };
  11362. CKEDITOR.ui.prototype.addButton = function (a, b) {
  11363. this.add(a, CKEDITOR.UI_BUTTON, b)
  11364. }
  11365. })();
  11366. (function () {
  11367. function D(a) {
  11368. function d() {
  11369. for (var b = f(), e = CKEDITOR.tools.clone(a.config.toolbarGroups) || v(a), n = 0; n < e.length; n++) {
  11370. var g = e[n];
  11371. if ("/" != g) {
  11372. "string" == typeof g && (g = e[n] = {name: g});
  11373. var l, d = g.groups;
  11374. if (d) for (var h = 0; h < d.length; h++) l = d[h], (l = b[l]) && c(g, l);
  11375. (l = b[g.name]) && c(g, l)
  11376. }
  11377. }
  11378. return e
  11379. }
  11380. function f() {
  11381. var b = {}, c, e, g;
  11382. for (c in a.ui.items) e = a.ui.items[c], g = e.toolbar || "others", g = g.split(","), e = g[0], g = parseInt(g[1] || -1, 10), b[e] || (b[e] = []), b[e].push({
  11383. name: c,
  11384. order: g
  11385. });
  11386. for (e in b) b[e] = b[e].sort(function (b,
  11387. a) {
  11388. return b.order == a.order ? 0 : 0 > a.order ? -1 : 0 > b.order ? 1 : b.order < a.order ? -1 : 1
  11389. });
  11390. return b
  11391. }
  11392. function c(c, e) {
  11393. if (e.length) {
  11394. c.items ? c.items.push(a.ui.create("-")) : c.items = [];
  11395. for (var d; d = e.shift();) d = "string" == typeof d ? d : d.name, b && -1 != CKEDITOR.tools.indexOf(b, d) || (d = a.ui.create(d)) && a.addFeature(d) && c.items.push(d)
  11396. }
  11397. }
  11398. function h(b) {
  11399. var a = [], e, d, h;
  11400. for (e = 0; e < b.length; ++e) d = b[e], h = {}, "/" == d ? a.push(d) : CKEDITOR.tools.isArray(d) ? (c(h, CKEDITOR.tools.clone(d)), a.push(h)) : d.items && (c(h, CKEDITOR.tools.clone(d.items)),
  11401. h.name = d.name, a.push(h));
  11402. return a
  11403. }
  11404. var b = a.config.removeButtons, b = b && b.split(","), e = a.config.toolbar;
  11405. "string" == typeof e && (e = a.config["toolbar_" + e]);
  11406. return a.toolbar = e ? h(e) : d()
  11407. }
  11408. function v(a) {
  11409. return a._.toolbarGroups || (a._.toolbarGroups = [{
  11410. name: "document",
  11411. groups: ["mode", "document", "doctools"]
  11412. }, {name: "clipboard", groups: ["clipboard", "undo"]}, {
  11413. name: "editing",
  11414. groups: ["find", "selection", "spellchecker"]
  11415. }, {name: "forms"}, "/", {name: "basicstyles", groups: ["basicstyles", "cleanup"]}, {
  11416. name: "paragraph", groups: ["list",
  11417. "indent", "blocks", "align", "bidi"]
  11418. }, {name: "links"}, {name: "insert"}, "/", {name: "styles"}, {name: "colors"}, {name: "tools"}, {name: "others"}, {name: "about"}])
  11419. }
  11420. var z = function () {
  11421. this.toolbars = [];
  11422. this.focusCommandExecuted = !1
  11423. };
  11424. z.prototype.focus = function () {
  11425. for (var a = 0, d; d = this.toolbars[a++];) for (var f = 0, c; c = d.items[f++];) if (c.focus) {
  11426. c.focus();
  11427. return
  11428. }
  11429. };
  11430. var E = {
  11431. modes: {wysiwyg: 1, source: 1}, readOnly: 1, exec: function (a) {
  11432. a.toolbox && (a.toolbox.focusCommandExecuted = !0, CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function () {
  11433. a.toolbox.focus()
  11434. },
  11435. 100) : a.toolbox.focus())
  11436. }
  11437. };
  11438. CKEDITOR.plugins.add("toolbar", {
  11439. requires: "button", init: function (a) {
  11440. var d, f = function (c, h) {
  11441. var b, e = "rtl" == a.lang.dir, k = a.config.toolbarGroupCycling, q = e ? 37 : 39, e = e ? 39 : 37,
  11442. k = void 0 === k || k;
  11443. switch (h) {
  11444. case 9:
  11445. case CKEDITOR.SHIFT + 9:
  11446. for (; !b || !b.items.length;) if (b = 9 == h ? (b ? b.next : c.toolbar.next) || a.toolbox.toolbars[0] : (b ? b.previous : c.toolbar.previous) || a.toolbox.toolbars[a.toolbox.toolbars.length - 1], b.items.length) for (c = b.items[d ? b.items.length - 1 : 0]; c && !c.focus;) (c = d ? c.previous : c.next) ||
  11447. (b = 0);
  11448. c && c.focus();
  11449. return !1;
  11450. case q:
  11451. b = c;
  11452. do b = b.next, !b && k && (b = c.toolbar.items[0]); while (b && !b.focus);
  11453. b ? b.focus() : f(c, 9);
  11454. return !1;
  11455. case 40:
  11456. return c.button && c.button.hasArrow ? c.execute() : f(c, 40 == h ? q : e), !1;
  11457. case e:
  11458. case 38:
  11459. b = c;
  11460. do b = b.previous, !b && k && (b = c.toolbar.items[c.toolbar.items.length - 1]); while (b && !b.focus);
  11461. b ? b.focus() : (d = 1, f(c, CKEDITOR.SHIFT + 9), d = 0);
  11462. return !1;
  11463. case 27:
  11464. return a.focus(), !1;
  11465. case 13:
  11466. case 32:
  11467. return c.execute(), !1
  11468. }
  11469. return !0
  11470. };
  11471. a.on("uiSpace", function (c) {
  11472. if (c.data.space == a.config.toolbarLocation) {
  11473. c.removeListener();
  11474. a.toolbox = new z;
  11475. var d = CKEDITOR.tools.getNextId(),
  11476. b = ['\x3cspan id\x3d"', d, '" class\x3d"cke_voice_label"\x3e', a.lang.toolbar.toolbars, "\x3c/span\x3e", '\x3cspan id\x3d"' + a.ui.spaceId("toolbox") + '" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"', d, '" onmousedown\x3d"return false;"\x3e'],
  11477. d = !1 !== a.config.toolbarStartupExpanded, e, k;
  11478. a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && b.push('\x3cspan class\x3d"cke_toolbox_main"' + (d ? "\x3e" : ' style\x3d"display:none"\x3e'));
  11479. for (var q = a.toolbox.toolbars, n = D(a), g = n.length, l = 0; l < g; l++) {
  11480. var r, m = 0, w, p = n[l], v = "/" !== p && ("/" === n[l + 1] || l == g - 1), x;
  11481. if (p) if (e && (b.push("\x3c/span\x3e"), k = e = 0), "/" === p) b.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e'); else {
  11482. x = p.items || p;
  11483. for (var y = 0; y < x.length; y++) {
  11484. var t = x[y], A;
  11485. if (t) {
  11486. var B = function (c) {
  11487. c = c.render(a, b);
  11488. u = m.items.push(c) - 1;
  11489. 0 < u && (c.previous = m.items[u - 1], c.previous.next = c);
  11490. c.toolbar = m;
  11491. c.onkey = f;
  11492. c.onfocus = function () {
  11493. a.toolbox.focusCommandExecuted || a.focus()
  11494. }
  11495. };
  11496. if (t.type == CKEDITOR.UI_SEPARATOR) k =
  11497. e && t; else {
  11498. A = !1 !== t.canGroup;
  11499. if (!m) {
  11500. r = CKEDITOR.tools.getNextId();
  11501. m = {id: r, items: []};
  11502. w = p.name && (a.lang.toolbar.toolbarGroups[p.name] || p.name);
  11503. b.push('\x3cspan id\x3d"', r, '" class\x3d"cke_toolbar' + (v ? ' cke_toolbar_last"' : '"'), w ? ' aria-labelledby\x3d"' + r + '_label"' : "", ' role\x3d"toolbar"\x3e');
  11504. w && b.push('\x3cspan id\x3d"', r, '_label" class\x3d"cke_voice_label"\x3e', w, "\x3c/span\x3e");
  11505. b.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');
  11506. var u = q.push(m) - 1;
  11507. 0 < u && (m.previous = q[u - 1], m.previous.next =
  11508. m)
  11509. }
  11510. A ? e || (b.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'), e = 1) : e && (b.push("\x3c/span\x3e"), e = 0);
  11511. k && (B(k), k = 0);
  11512. B(t)
  11513. }
  11514. }
  11515. }
  11516. e && (b.push("\x3c/span\x3e"), k = e = 0);
  11517. m && b.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')
  11518. }
  11519. }
  11520. a.config.toolbarCanCollapse && b.push("\x3c/span\x3e");
  11521. if (a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  11522. var C = CKEDITOR.tools.addFunction(function () {
  11523. a.execCommand("toolbarCollapse")
  11524. });
  11525. a.on("destroy", function () {
  11526. CKEDITOR.tools.removeFunction(C)
  11527. });
  11528. a.addCommand("toolbarCollapse", {
  11529. readOnly: 1, exec: function (b) {
  11530. var a = b.ui.space("toolbar_collapser"), c = a.getPrevious(),
  11531. d = b.ui.space("contents"), e = c.getParent(),
  11532. h = parseInt(d.$.style.height, 10), g = e.$.offsetHeight,
  11533. f = a.hasClass("cke_toolbox_collapser_min");
  11534. f ? (c.show(), a.removeClass("cke_toolbox_collapser_min"), a.setAttribute("title", b.lang.toolbar.toolbarCollapse)) : (c.hide(), a.addClass("cke_toolbox_collapser_min"), a.setAttribute("title", b.lang.toolbar.toolbarExpand));
  11535. a.getFirst().setText(f ? "▲" : "◀");
  11536. d.setStyle("height",
  11537. h - (e.$.offsetHeight - g) + "px");
  11538. b.fire("resize", {
  11539. outerHeight: b.container.$.offsetHeight,
  11540. contentsHeight: d.$.offsetHeight,
  11541. outerWidth: b.container.$.offsetWidth
  11542. })
  11543. }, modes: {wysiwyg: 1, source: 1}
  11544. });
  11545. a.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse");
  11546. b.push('\x3ca title\x3d"' + (d ? a.lang.toolbar.toolbarCollapse : a.lang.toolbar.toolbarExpand) + '" id\x3d"' + a.ui.spaceId("toolbar_collapser") + '" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');
  11547. d || b.push(" cke_toolbox_collapser_min");
  11548. b.push('" onclick\x3d"CKEDITOR.tools.callFunction(' + C + ')"\x3e', '\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e', "\x3c/a\x3e")
  11549. }
  11550. b.push("\x3c/span\x3e");
  11551. c.data.html += b.join("")
  11552. }
  11553. });
  11554. a.on("destroy", function () {
  11555. if (this.toolbox) {
  11556. var a, d = 0, b, e, f;
  11557. for (a = this.toolbox.toolbars; d < a.length; d++) for (e = a[d].items, b = 0; b < e.length; b++) f = e[b], f.clickFn && CKEDITOR.tools.removeFunction(f.clickFn), f.keyDownFn && CKEDITOR.tools.removeFunction(f.keyDownFn)
  11558. }
  11559. });
  11560. a.on("uiReady", function () {
  11561. var c = a.ui.space("toolbox");
  11562. c && a.focusManager.add(c,
  11563. 1)
  11564. });
  11565. a.addCommand("toolbarFocus", E);
  11566. a.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
  11567. a.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
  11568. a.ui.addHandler(CKEDITOR.UI_SEPARATOR, {
  11569. create: function () {
  11570. return {
  11571. render: function (a, d) {
  11572. d.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');
  11573. return {}
  11574. }
  11575. }
  11576. }
  11577. })
  11578. }
  11579. });
  11580. CKEDITOR.ui.prototype.addToolbarGroup = function (a, d, f) {
  11581. var c = v(this.editor), h = 0 === d, b = {name: a};
  11582. if (f) {
  11583. if (f = CKEDITOR.tools.search(c, function (a) {
  11584. return a.name == f
  11585. })) {
  11586. !f.groups && (f.groups = []);
  11587. if (d &&
  11588. (d = CKEDITOR.tools.indexOf(f.groups, d), 0 <= d)) {
  11589. f.groups.splice(d + 1, 0, a);
  11590. return
  11591. }
  11592. h ? f.groups.splice(0, 0, a) : f.groups.push(a);
  11593. return
  11594. }
  11595. d = null
  11596. }
  11597. d && (d = CKEDITOR.tools.indexOf(c, function (a) {
  11598. return a.name == d
  11599. }));
  11600. h ? c.splice(0, 0, a) : "number" == typeof d ? c.splice(d + 1, 0, b) : c.push(a)
  11601. }
  11602. })();
  11603. CKEDITOR.UI_SEPARATOR = "separator";
  11604. CKEDITOR.config.toolbarLocation = "top";
  11605. (function () {
  11606. function r(a, b, c) {
  11607. b.type || (b.type = "auto");
  11608. if (c && !1 === a.fire("beforePaste", b) || !b.dataValue && b.dataTransfer.isEmpty()) return !1;
  11609. b.dataValue || (b.dataValue = "");
  11610. if (CKEDITOR.env.gecko && "drop" == b.method && a.toolbox) a.once("afterPaste", function () {
  11611. a.toolbox.focus()
  11612. });
  11613. return a.fire("paste", b)
  11614. }
  11615. function w(a) {
  11616. function b() {
  11617. var b = a.editable();
  11618. if (CKEDITOR.plugins.clipboard.isCustomCopyCutSupported) {
  11619. var c = function (b) {
  11620. a.getSelection().isCollapsed() || (a.readOnly && "cut" == b.name || p.initPasteDataTransfer(b,
  11621. a), b.data.preventDefault())
  11622. };
  11623. b.on("copy", c);
  11624. b.on("cut", c);
  11625. b.on("cut", function () {
  11626. a.readOnly || a.extractSelectedHtml()
  11627. }, null, null, 999)
  11628. }
  11629. b.on(p.mainPasteEvent, function (a) {
  11630. "beforepaste" == p.mainPasteEvent && m || k(a)
  11631. });
  11632. "beforepaste" == p.mainPasteEvent && (b.on("paste", function (a) {
  11633. u || (g(), a.data.preventDefault(), k(a), e("paste"))
  11634. }), b.on("contextmenu", h, null, null, 0), b.on("beforepaste", function (a) {
  11635. !a.data || a.data.$.ctrlKey || a.data.$.shiftKey || h()
  11636. }, null, null, 0));
  11637. b.on("beforecut", function () {
  11638. !m && f(a)
  11639. });
  11640. var d;
  11641. b.attachListener(CKEDITOR.env.ie ?
  11642. b : a.document.getDocumentElement(), "mouseup", function () {
  11643. d = setTimeout(t, 0)
  11644. });
  11645. a.on("destroy", function () {
  11646. clearTimeout(d)
  11647. });
  11648. b.on("keyup", t)
  11649. }
  11650. function c(b) {
  11651. return {
  11652. type: b,
  11653. canUndo: "cut" == b,
  11654. startDisabled: !0,
  11655. fakeKeystroke: "cut" == b ? CKEDITOR.CTRL + 88 : CKEDITOR.CTRL + 67,
  11656. exec: function () {
  11657. "cut" == this.type && f();
  11658. var b;
  11659. var c = this.type;
  11660. if (CKEDITOR.env.ie) b = e(c); else try {
  11661. b = a.document.$.execCommand(c, !1, null)
  11662. } catch (d) {
  11663. b = !1
  11664. }
  11665. b || a.showNotification(a.lang.clipboard[this.type + "Error"]);
  11666. return b
  11667. }
  11668. }
  11669. }
  11670. function d() {
  11671. return {
  11672. canUndo: !1,
  11673. async: !0, fakeKeystroke: CKEDITOR.CTRL + 86, exec: function (a, b) {
  11674. function c(b, h) {
  11675. h = "undefined" !== typeof h ? h : !0;
  11676. b ? (b.method = "paste", b.dataTransfer || (b.dataTransfer = p.initPasteDataTransfer()), r(a, b, h)) : e && !a._.forcePasteDialog && a.showNotification(n, "info", a.config.clipboard_notificationDuration);
  11677. a._.forcePasteDialog = !1;
  11678. a.fire("afterCommandExec", {name: "paste", command: d, returnValue: !!b})
  11679. }
  11680. b = "undefined" !== typeof b && null !== b ? b : {};
  11681. var d = this, e = "undefined" !== typeof b.notification ? b.notification : !0, h = b.type,
  11682. f = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,
  11683. a.getCommandKeystroke(this)),
  11684. n = "string" === typeof e ? e : a.lang.clipboard.pasteNotification.replace(/%1/, '\x3ckbd aria-label\x3d"' + f.aria + '"\x3e' + f.display + "\x3c/kbd\x3e"),
  11685. f = "string" === typeof b ? b : b.dataValue;
  11686. h && !0 !== a.config.forcePasteAsPlainText && "allow-word" !== a.config.forcePasteAsPlainText ? a._.nextPasteType = h : delete a._.nextPasteType;
  11687. "string" === typeof f ? c({dataValue: f}) : a.getClipboardData(c)
  11688. }
  11689. }
  11690. }
  11691. function g() {
  11692. u = 1;
  11693. setTimeout(function () {
  11694. u = 0
  11695. }, 100)
  11696. }
  11697. function h() {
  11698. m = 1;
  11699. setTimeout(function () {
  11700. m = 0
  11701. }, 10)
  11702. }
  11703. function e(b) {
  11704. var c =
  11705. a.document, d = c.getBody(), e = !1, h = function () {
  11706. e = !0
  11707. };
  11708. d.on(b, h);
  11709. 7 < CKEDITOR.env.version ? c.$.execCommand(b) : c.$.selection.createRange().execCommand(b);
  11710. d.removeListener(b, h);
  11711. return e
  11712. }
  11713. function f() {
  11714. if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  11715. var b = a.getSelection(), c, d, e;
  11716. b.getType() == CKEDITOR.SELECTION_ELEMENT && (c = b.getSelectedElement()) && (d = b.getRanges()[0], e = a.document.createText(""), e.insertBefore(c), d.setStartBefore(e), d.setEndAfter(c), b.selectRanges([d]), setTimeout(function () {
  11717. c.getParent() && (e.remove(), b.selectElement(c))
  11718. },
  11719. 0))
  11720. }
  11721. }
  11722. function l(b, c) {
  11723. var d = a.document, e = a.editable(), h = function (a) {
  11724. a.cancel()
  11725. }, f;
  11726. if (!d.getById("cke_pastebin")) {
  11727. var n = a.getSelection(), g = n.createBookmarks();
  11728. CKEDITOR.env.ie && n.root.fire("selectionchange");
  11729. var k = new CKEDITOR.dom.element(!CKEDITOR.env.webkit && !e.is("body") || CKEDITOR.env.ie ? "div" : "body", d);
  11730. k.setAttributes({id: "cke_pastebin", "data-cke-temp": "1"});
  11731. var l = 0, d = d.getWindow();
  11732. CKEDITOR.env.webkit ? (e.append(k), k.addClass("cke_editable"), e.is("body") || (l = "static" != e.getComputedStyle("position") ?
  11733. e : CKEDITOR.dom.element.get(e.$.offsetParent), l = l.getDocumentPosition().y)) : e.getAscendant(CKEDITOR.env.ie ? "body" : "html", 1).append(k);
  11734. k.setStyles({
  11735. position: "absolute",
  11736. top: d.getScrollPosition().y - l + 10 + "px",
  11737. width: "1px",
  11738. height: Math.max(1, d.getViewPaneSize().height - 20) + "px",
  11739. overflow: "hidden",
  11740. margin: 0,
  11741. padding: 0
  11742. });
  11743. CKEDITOR.env.safari && k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text"));
  11744. (l = k.getParent().isReadOnly()) ? (k.setOpacity(0), k.setAttribute("contenteditable", !0)) : k.setStyle("ltr" == a.config.contentsLangDirection ?
  11745. "left" : "right", "-10000px");
  11746. a.on("selectionChange", h, null, null, 0);
  11747. if (CKEDITOR.env.webkit || CKEDITOR.env.gecko) f = e.once("blur", h, null, null, -100);
  11748. l && k.focus();
  11749. l = new CKEDITOR.dom.range(k);
  11750. l.selectNodeContents(k);
  11751. var t = l.select();
  11752. CKEDITOR.env.ie && (f = e.once("blur", function () {
  11753. a.lockSelection(t)
  11754. }));
  11755. var q = CKEDITOR.document.getWindow().getScrollPosition().y;
  11756. setTimeout(function () {
  11757. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = q);
  11758. f && f.removeListener();
  11759. CKEDITOR.env.ie && e.focus();
  11760. n.selectBookmarks(g);
  11761. k.remove();
  11762. var b;
  11763. CKEDITOR.env.webkit && (b = k.getFirst()) && b.is && b.hasClass("Apple-style-span") && (k = b);
  11764. a.removeListener("selectionChange", h);
  11765. c(k.getHtml())
  11766. }, 0)
  11767. }
  11768. }
  11769. function x() {
  11770. if ("paste" == p.mainPasteEvent) return a.fire("beforePaste", {type: "auto", method: "paste"}), !1;
  11771. a.focus();
  11772. g();
  11773. var b = a.focusManager;
  11774. b.lock();
  11775. if (a.editable().fire(p.mainPasteEvent) && !e("paste")) return b.unlock(), !1;
  11776. b.unlock();
  11777. return !0
  11778. }
  11779. function n(b) {
  11780. if ("wysiwyg" == a.mode) switch (b.data.keyCode) {
  11781. case CKEDITOR.CTRL + 86:
  11782. case CKEDITOR.SHIFT + 45:
  11783. b =
  11784. a.editable();
  11785. g();
  11786. "paste" == p.mainPasteEvent && b.fire("beforepaste");
  11787. break;
  11788. case CKEDITOR.CTRL + 88:
  11789. case CKEDITOR.SHIFT + 46:
  11790. a.fire("saveSnapshot"), setTimeout(function () {
  11791. a.fire("saveSnapshot")
  11792. }, 50)
  11793. }
  11794. }
  11795. function k(b) {
  11796. var c = {type: "auto", method: "paste", dataTransfer: p.initPasteDataTransfer(b)};
  11797. c.dataTransfer.cacheData();
  11798. var d = !1 !== a.fire("beforePaste", c);
  11799. d && p.canClipboardApiBeTrusted(c.dataTransfer, a) ? (b.data.preventDefault(), setTimeout(function () {
  11800. r(a, c)
  11801. }, 0)) : l(b, function (b) {
  11802. c.dataValue = b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,
  11803. "");
  11804. d && r(a, c)
  11805. })
  11806. }
  11807. function t() {
  11808. if ("wysiwyg" == a.mode) {
  11809. var b = q("paste");
  11810. a.getCommand("cut").setState(q("cut"));
  11811. a.getCommand("copy").setState(q("copy"));
  11812. a.getCommand("paste").setState(b);
  11813. a.fire("pasteState", b)
  11814. }
  11815. }
  11816. function q(b) {
  11817. var c = a.getSelection(), c = c && c.getRanges()[0];
  11818. if ((a.readOnly || c && c.checkReadOnly()) && b in {
  11819. paste: 1,
  11820. cut: 1
  11821. }) return CKEDITOR.TRISTATE_DISABLED;
  11822. if ("paste" == b) return CKEDITOR.TRISTATE_OFF;
  11823. b = a.getSelection();
  11824. c = b.getRanges();
  11825. return b.getType() == CKEDITOR.SELECTION_NONE || 1 == c.length && c[0].collapsed ?
  11826. CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF
  11827. }
  11828. var p = CKEDITOR.plugins.clipboard, m = 0, u = 0;
  11829. (function () {
  11830. a.on("key", n);
  11831. a.on("contentDom", b);
  11832. a.on("selectionChange", t);
  11833. if (a.contextMenu) {
  11834. a.contextMenu.addListener(function () {
  11835. return {cut: q("cut"), copy: q("copy"), paste: q("paste")}
  11836. });
  11837. var c = null;
  11838. a.on("menuShow", function () {
  11839. c && (c.removeListener(), c = null);
  11840. var b = a.contextMenu.findItemByCommandName("paste");
  11841. b && b.element && (c = b.element.on("touchend", function () {
  11842. a._.forcePasteDialog = !0
  11843. }))
  11844. })
  11845. }
  11846. if (a.ui.addButton) a.once("instanceReady",
  11847. function () {
  11848. a._.pasteButtons && CKEDITOR.tools.array.forEach(a._.pasteButtons, function (b) {
  11849. if (b = a.ui.get(b)) if (b = CKEDITOR.document.getById(b._.id)) b.on("touchend", function () {
  11850. a._.forcePasteDialog = !0
  11851. })
  11852. })
  11853. })
  11854. })();
  11855. (function () {
  11856. function b(c, d, e, h, f) {
  11857. var n = a.lang.clipboard[d];
  11858. a.addCommand(d, e);
  11859. a.ui.addButton && a.ui.addButton(c, {label: n, command: d, toolbar: "clipboard," + h});
  11860. a.addMenuItems && a.addMenuItem(d, {label: n, command: d, group: "clipboard", order: f})
  11861. }
  11862. b("Cut", "cut", c("cut"), 10, 1);
  11863. b("Copy", "copy", c("copy"), 20, 4);
  11864. b("Paste",
  11865. "paste", d(), 30, 8);
  11866. a._.pasteButtons || (a._.pasteButtons = []);
  11867. a._.pasteButtons.push("Paste")
  11868. })();
  11869. a.getClipboardData = function (b, c) {
  11870. function d(a) {
  11871. a.removeListener();
  11872. a.cancel();
  11873. c(a.data)
  11874. }
  11875. function e(a) {
  11876. a.removeListener();
  11877. a.cancel();
  11878. c({type: f, dataValue: a.data.dataValue, dataTransfer: a.data.dataTransfer, method: "paste"})
  11879. }
  11880. var h = !1, f = "auto";
  11881. c || (c = b, b = null);
  11882. a.on("beforePaste", function (a) {
  11883. a.removeListener();
  11884. h = !0;
  11885. f = a.data.type
  11886. }, null, null, 1E3);
  11887. a.on("paste", d, null, null, 0);
  11888. !1 === x() && (a.removeListener("paste", d), a._.forcePasteDialog &&
  11889. h && a.fire("pasteDialog") ? (a.on("pasteDialogCommit", e), a.on("dialogHide", function (a) {
  11890. a.removeListener();
  11891. a.data.removeListener("pasteDialogCommit", e);
  11892. a.data._.committed || c(null)
  11893. })) : c(null))
  11894. }
  11895. }
  11896. function y(a) {
  11897. if (CKEDITOR.env.webkit) {
  11898. if (!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html"
  11899. } else if (CKEDITOR.env.ie) {
  11900. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi) && !a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html"
  11901. } else if (CKEDITOR.env.gecko) {
  11902. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html"
  11903. } else return "html";
  11904. return "htmlifiedtext"
  11905. }
  11906. function z(a, b) {
  11907. function c(a) {
  11908. return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e", ~~(a / 2)) + (1 == a % 2 ? "\x3cbr\x3e" : "")
  11909. }
  11910. b = b.replace(/(?!\u3000)\s+/g, " ").replace(/> +</g, "\x3e\x3c").replace(/<br ?\/>/gi, "\x3cbr\x3e");
  11911. b = b.replace(/<\/?[A-Z]+>/g, function (a) {
  11912. return a.toLowerCase()
  11913. });
  11914. if (b.match(/^[^<]$/)) return b;
  11915. CKEDITOR.env.webkit && -1 < b.indexOf("\x3cdiv\x3e") && (b = b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "\x3cbr\x3e").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g, "\x3cdiv\x3e\x3c/div\x3e"),
  11916. b.match(/<div>(<br>|)<\/div>/) && (b = "\x3cp\x3e" + b.replace(/(<div>(<br>|)<\/div>)+/g, function (a) {
  11917. return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length + 1)
  11918. }) + "\x3c/p\x3e"), b = b.replace(/<\/div><div>/g, "\x3cbr\x3e"), b = b.replace(/<\/?div>/g, ""));
  11919. CKEDITOR.env.gecko && a.enterMode != CKEDITOR.ENTER_BR && (CKEDITOR.env.gecko && (b = b.replace(/^<br><br>$/, "\x3cbr\x3e")), -1 < b.indexOf("\x3cbr\x3e\x3cbr\x3e") && (b = "\x3cp\x3e" + b.replace(/(<br>){2,}/g, function (a) {
  11920. return c(a.length / 4)
  11921. }) + "\x3c/p\x3e"));
  11922. return A(a, b)
  11923. }
  11924. function B(a) {
  11925. function b() {
  11926. var a =
  11927. {}, b;
  11928. for (b in CKEDITOR.dtd) "$" != b.charAt(0) && "div" != b && "span" != b && (a[b] = 1);
  11929. return a
  11930. }
  11931. var c = {};
  11932. return {
  11933. get: function (d) {
  11934. return "plain-text" == d ? c.plainText || (c.plainText = new CKEDITOR.filter(a, "br")) : "semantic-content" == d ? ((d = c.semanticContent) || (d = new CKEDITOR.filter(a, {}), d.allow({
  11935. $1: {
  11936. elements: b(),
  11937. attributes: !0,
  11938. styles: !1,
  11939. classes: !1
  11940. }
  11941. }), d = c.semanticContent = d), d) : d ? new CKEDITOR.filter(a, d) : null
  11942. }
  11943. }
  11944. }
  11945. function v(a, b, c) {
  11946. b = CKEDITOR.htmlParser.fragment.fromHtml(b);
  11947. var d = new CKEDITOR.htmlParser.basicWriter;
  11948. c.applyTo(b,
  11949. !0, !1, a.activeEnterMode);
  11950. b.writeHtml(d);
  11951. return d.getHtml()
  11952. }
  11953. function A(a, b) {
  11954. a.enterMode == CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function (a) {
  11955. return CKEDITOR.tools.repeat("\x3cbr\x3e", a.length / 7 * 2)
  11956. }).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, "\x3c$1div\x3e"));
  11957. return b
  11958. }
  11959. function C(a) {
  11960. a.data.preventDefault();
  11961. a.data.$.dataTransfer.dropEffect = "none"
  11962. }
  11963. function D(a) {
  11964. var b = CKEDITOR.plugins.clipboard;
  11965. a.on("contentDom", function () {
  11966. function c(b, c, d) {
  11967. c.select();
  11968. r(a, {
  11969. dataTransfer: d,
  11970. method: "drop"
  11971. }, 1);
  11972. d.sourceEditor.fire("saveSnapshot");
  11973. d.sourceEditor.editable().extractHtmlFromRange(b);
  11974. d.sourceEditor.getSelection().selectRanges([b]);
  11975. d.sourceEditor.fire("saveSnapshot")
  11976. }
  11977. function d(c, d) {
  11978. c.select();
  11979. r(a, {dataTransfer: d, method: "drop"}, 1);
  11980. b.resetDragDataTransfer()
  11981. }
  11982. function g(b, c, d) {
  11983. var e = {$: b.data.$, target: b.data.getTarget()};
  11984. c && (e.dragRange = c);
  11985. d && (e.dropRange = d);
  11986. !1 === a.fire(b.name, e) && b.data.preventDefault()
  11987. }
  11988. function h(a) {
  11989. a.type != CKEDITOR.NODE_ELEMENT && (a = a.getParent());
  11990. return a.getChildCount()
  11991. }
  11992. var e = a.editable(), f = CKEDITOR.plugins.clipboard.getDropTarget(a), l = a.ui.space("top"),
  11993. m = a.ui.space("bottom");
  11994. b.preventDefaultDropOnElement(l);
  11995. b.preventDefaultDropOnElement(m);
  11996. e.attachListener(f, "dragstart", g);
  11997. e.attachListener(a, "dragstart", b.resetDragDataTransfer, b, null, 1);
  11998. e.attachListener(a, "dragstart", function (c) {
  11999. b.initDragDataTransfer(c, a)
  12000. }, null, null, 2);
  12001. e.attachListener(a, "dragstart", function () {
  12002. var c = b.dragRange = a.getSelection().getRanges()[0];
  12003. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (b.dragStartContainerChildCount =
  12004. c ? h(c.startContainer) : null, b.dragEndContainerChildCount = c ? h(c.endContainer) : null)
  12005. }, null, null, 100);
  12006. e.attachListener(f, "dragend", g);
  12007. e.attachListener(a, "dragend", b.initDragDataTransfer, b, null, 1);
  12008. e.attachListener(a, "dragend", b.resetDragDataTransfer, b, null, 100);
  12009. e.attachListener(f, "dragover", function (a) {
  12010. if (CKEDITOR.env.edge) a.data.preventDefault(); else {
  12011. var b = a.data.getTarget();
  12012. b && b.is && b.is("html") ? a.data.preventDefault() : CKEDITOR.env.ie && CKEDITOR.plugins.clipboard.isFileApiSupported && a.data.$.dataTransfer.types.contains("Files") &&
  12013. a.data.preventDefault()
  12014. }
  12015. });
  12016. e.attachListener(f, "drop", function (c) {
  12017. if (!c.data.$.defaultPrevented) {
  12018. c.data.preventDefault();
  12019. var d = c.data.getTarget();
  12020. if (!d.isReadOnly() || d.type == CKEDITOR.NODE_ELEMENT && d.is("html")) {
  12021. var d = b.getRangeAtDropPosition(c, a), e = b.dragRange;
  12022. d && g(c, e, d)
  12023. }
  12024. }
  12025. }, null, null, 9999);
  12026. e.attachListener(a, "drop", b.initDragDataTransfer, b, null, 1);
  12027. e.attachListener(a, "drop", function (e) {
  12028. if (e = e.data) {
  12029. var h = e.dropRange, f = e.dragRange, g = e.dataTransfer;
  12030. g.getTransferType(a) == CKEDITOR.DATA_TRANSFER_INTERNAL ?
  12031. setTimeout(function () {
  12032. b.internalDrop(f, h, g, a)
  12033. }, 0) : g.getTransferType(a) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c(f, h, g) : d(h, g)
  12034. }
  12035. }, null, null, 9999)
  12036. })
  12037. }
  12038. var m;
  12039. CKEDITOR.plugins.add("clipboard", {
  12040. requires: "dialog,notification,toolbar", init: function (a) {
  12041. var b, c = B(a);
  12042. a.config.forcePasteAsPlainText ? b = "plain-text" : a.config.pasteFilter ? b = a.config.pasteFilter : !CKEDITOR.env.webkit || "pasteFilter" in a.config || (b = "semantic-content");
  12043. a.pasteFilter = c.get(b);
  12044. w(a);
  12045. D(a);
  12046. CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path +
  12047. "dialogs/paste.js"));
  12048. if (CKEDITOR.env.gecko) {
  12049. var d = ["image/png", "image/jpeg", "image/gif"], g;
  12050. a.on("paste", function (b) {
  12051. var c = b.data, f = c.dataTransfer;
  12052. if (!c.dataValue && "paste" == c.method && f && 1 == f.getFilesCount() && g != f.id && (f = f.getFile(0), -1 != CKEDITOR.tools.indexOf(d, f.type))) {
  12053. var l = new FileReader;
  12054. l.addEventListener("load", function () {
  12055. b.data.dataValue = '\x3cimg src\x3d"' + l.result + '" /\x3e';
  12056. a.fire("paste", b.data)
  12057. }, !1);
  12058. l.addEventListener("abort", function () {
  12059. a.fire("paste", b.data)
  12060. }, !1);
  12061. l.addEventListener("error",
  12062. function () {
  12063. a.fire("paste", b.data)
  12064. }, !1);
  12065. l.readAsDataURL(f);
  12066. g = c.dataTransfer.id;
  12067. b.stop()
  12068. }
  12069. }, null, null, 1)
  12070. }
  12071. a.on("paste", function (b) {
  12072. b.data.dataTransfer || (b.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer);
  12073. if (!b.data.dataValue) {
  12074. var c = b.data.dataTransfer, d = c.getData("text/html");
  12075. if (d) b.data.dataValue = d, b.data.type = "html"; else if (d = c.getData("text/plain")) b.data.dataValue = a.editable().transformPlainTextToHtml(d), b.data.type = "text"
  12076. }
  12077. }, null, null, 1);
  12078. a.on("paste", function (a) {
  12079. var b = a.data.dataValue,
  12080. c = CKEDITOR.dtd.$block;
  12081. -1 < b.indexOf("Apple-") && (b = b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi, " "), "html" != a.data.type && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function (a, b) {
  12082. return b.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;")
  12083. })), -1 < b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e') && (a.data.startsWithEOL = 1, a.data.preSniffing = "html", b = b.replace(/<br class="Apple-interchange-newline">/, "")), b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi, "$1"));
  12084. if (b.match(/^<[^<]+cke_(editable|contents)/i)) {
  12085. var d, g, n = new CKEDITOR.dom.element("div");
  12086. for (n.setHtml(b); 1 == n.getChildCount() && (d = n.getFirst()) && d.type == CKEDITOR.NODE_ELEMENT && (d.hasClass("cke_editable") || d.hasClass("cke_contents"));) n = g = d;
  12087. g && (b = g.getHtml().replace(/<br>$/i, ""))
  12088. }
  12089. CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function (b, d) {
  12090. return d.toLowerCase() in c ? (a.data.preSniffing = "html", "\x3c" + d) : b
  12091. }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function (b, d) {
  12092. return d in
  12093. c ? (a.data.endsWithEOL = 1, "\x3c/" + d + "\x3e") : b
  12094. }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
  12095. a.data.dataValue = b
  12096. }, null, null, 3);
  12097. a.on("paste", function (b) {
  12098. b = b.data;
  12099. var d = a._.nextPasteType || b.type, f = b.dataValue, g,
  12100. m = a.config.clipboard_defaultContentType || "html",
  12101. n = b.dataTransfer.getTransferType(a) == CKEDITOR.DATA_TRANSFER_EXTERNAL,
  12102. k = !0 === a.config.forcePasteAsPlainText;
  12103. g = "html" == d || "html" == b.preSniffing ? "html" : y(f);
  12104. delete a._.nextPasteType;
  12105. "htmlifiedtext" == g && (f = z(a.config, f));
  12106. if ("text" == d && "html" == g) f =
  12107. v(a, f, c.get("plain-text")); else if (n && a.pasteFilter && !b.dontFilter || k) f = v(a, f, a.pasteFilter);
  12108. b.startsWithEOL && (f = '\x3cbr data-cke-eol\x3d"1"\x3e' + f);
  12109. b.endsWithEOL && (f += '\x3cbr data-cke-eol\x3d"1"\x3e');
  12110. "auto" == d && (d = "html" == g || "html" == m ? "html" : "text");
  12111. b.type = d;
  12112. b.dataValue = f;
  12113. delete b.preSniffing;
  12114. delete b.startsWithEOL;
  12115. delete b.endsWithEOL
  12116. }, null, null, 6);
  12117. a.on("paste", function (b) {
  12118. b = b.data;
  12119. b.dataValue && (a.insertHtml(b.dataValue, b.type, b.range), setTimeout(function () {
  12120. a.fire("afterPaste")
  12121. }, 0))
  12122. }, null, null,
  12123. 1E3);
  12124. a.on("pasteDialog", function (b) {
  12125. setTimeout(function () {
  12126. a.openDialog("paste", b.data)
  12127. }, 0)
  12128. })
  12129. }
  12130. });
  12131. CKEDITOR.plugins.clipboard = {
  12132. isCustomCopyCutSupported: (!CKEDITOR.env.ie || 16 <= CKEDITOR.env.version) && !CKEDITOR.env.iOS,
  12133. isCustomDataTypesSupported: !CKEDITOR.env.ie || 16 <= CKEDITOR.env.version,
  12134. isFileApiSupported: !CKEDITOR.env.ie || 9 < CKEDITOR.env.version,
  12135. mainPasteEvent: CKEDITOR.env.ie && !CKEDITOR.env.edge ? "beforepaste" : "paste",
  12136. addPasteButton: function (a, b, c) {
  12137. a.ui.addButton && (a.ui.addButton(b, c), a._.pasteButtons ||
  12138. (a._.pasteButtons = []), a._.pasteButtons.push(b))
  12139. },
  12140. canClipboardApiBeTrusted: function (a, b) {
  12141. return a.getTransferType(b) != CKEDITOR.DATA_TRANSFER_EXTERNAL || CKEDITOR.env.chrome && !a.isEmpty() || CKEDITOR.env.gecko && (a.getData("text/html") || a.getFilesCount()) || CKEDITOR.env.safari && 603 <= CKEDITOR.env.version && !CKEDITOR.env.iOS || CKEDITOR.env.edge && 16 <= CKEDITOR.env.version ? !0 : !1
  12142. },
  12143. getDropTarget: function (a) {
  12144. var b = a.editable();
  12145. return CKEDITOR.env.ie && 9 > CKEDITOR.env.version || b.isInline() ? b : a.document
  12146. },
  12147. fixSplitNodesAfterDrop: function (a,
  12148. b, c, d) {
  12149. function g(a, c, d) {
  12150. var g = a;
  12151. g.type == CKEDITOR.NODE_TEXT && (g = a.getParent());
  12152. if (g.equals(c) && d != c.getChildCount()) return a = b.startContainer.getChild(b.startOffset - 1), c = b.startContainer.getChild(b.startOffset), a && a.type == CKEDITOR.NODE_TEXT && c && c.type == CKEDITOR.NODE_TEXT && (d = a.getLength(), a.setText(a.getText() + c.getText()), c.remove(), b.setStart(a, d), b.collapse(!0)), !0
  12153. }
  12154. var h = b.startContainer;
  12155. "number" == typeof d && "number" == typeof c && h.type == CKEDITOR.NODE_ELEMENT && (g(a.startContainer, h, c) || g(a.endContainer,
  12156. h, d))
  12157. },
  12158. isDropRangeAffectedByDragRange: function (a, b) {
  12159. var c = b.startContainer, d = b.endOffset;
  12160. return a.endContainer.equals(c) && a.endOffset <= d || a.startContainer.getParent().equals(c) && a.startContainer.getIndex() < d || a.endContainer.getParent().equals(c) && a.endContainer.getIndex() < d ? !0 : !1
  12161. },
  12162. internalDrop: function (a, b, c, d) {
  12163. var g = CKEDITOR.plugins.clipboard, h = d.editable(), e, f;
  12164. d.fire("saveSnapshot");
  12165. d.fire("lockSnapshot", {dontUpdate: 1});
  12166. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && this.fixSplitNodesAfterDrop(a, b, g.dragStartContainerChildCount,
  12167. g.dragEndContainerChildCount);
  12168. (f = this.isDropRangeAffectedByDragRange(a, b)) || (e = a.createBookmark(!1));
  12169. g = b.clone().createBookmark(!1);
  12170. f && (e = a.createBookmark(!1));
  12171. a = e.startNode;
  12172. b = e.endNode;
  12173. f = g.startNode;
  12174. b && a.getPosition(f) & CKEDITOR.POSITION_PRECEDING && b.getPosition(f) & CKEDITOR.POSITION_FOLLOWING && f.insertBefore(a);
  12175. a = d.createRange();
  12176. a.moveToBookmark(e);
  12177. h.extractHtmlFromRange(a, 1);
  12178. b = d.createRange();
  12179. g.startNode.getCommonAncestor(h) || (g = d.getSelection().createBookmarks()[0]);
  12180. b.moveToBookmark(g);
  12181. r(d, {
  12182. dataTransfer: c,
  12183. method: "drop", range: b
  12184. }, 1);
  12185. d.fire("unlockSnapshot")
  12186. },
  12187. getRangeAtDropPosition: function (a, b) {
  12188. var c = a.data.$, d = c.clientX, g = c.clientY, h = b.getSelection(!0).getRanges()[0],
  12189. e = b.createRange();
  12190. if (a.data.testRange) return a.data.testRange;
  12191. if (document.caretRangeFromPoint && b.document.$.caretRangeFromPoint(d, g)) c = b.document.$.caretRangeFromPoint(d, g), e.setStart(CKEDITOR.dom.node(c.startContainer), c.startOffset), e.collapse(!0); else if (c.rangeParent) e.setStart(CKEDITOR.dom.node(c.rangeParent), c.rangeOffset), e.collapse(!0);
  12192. else {
  12193. if (CKEDITOR.env.ie && 8 < CKEDITOR.env.version && h && b.editable().hasFocus) return h;
  12194. if (document.body.createTextRange) {
  12195. b.focus();
  12196. c = b.document.getBody().$.createTextRange();
  12197. try {
  12198. for (var f = !1, l = 0; 20 > l && !f; l++) {
  12199. if (!f) try {
  12200. c.moveToPoint(d, g - l), f = !0
  12201. } catch (m) {
  12202. }
  12203. if (!f) try {
  12204. c.moveToPoint(d, g + l), f = !0
  12205. } catch (n) {
  12206. }
  12207. }
  12208. if (f) {
  12209. var k = "cke-temp-" + (new Date).getTime();
  12210. c.pasteHTML('\x3cspan id\x3d"' + k + '"\x3e​\x3c/span\x3e');
  12211. var t = b.document.getById(k);
  12212. e.moveToPosition(t, CKEDITOR.POSITION_BEFORE_START);
  12213. t.remove()
  12214. } else {
  12215. var q = b.document.$.elementFromPoint(d,
  12216. g), p = new CKEDITOR.dom.element(q), r;
  12217. if (p.equals(b.editable()) || "html" == p.getName()) return h && h.startContainer && !h.startContainer.equals(b.editable()) ? h : null;
  12218. r = p.getClientRect();
  12219. d < r.left ? e.setStartAt(p, CKEDITOR.POSITION_AFTER_START) : e.setStartAt(p, CKEDITOR.POSITION_BEFORE_END);
  12220. e.collapse(!0)
  12221. }
  12222. } catch (u) {
  12223. return null
  12224. }
  12225. } else return null
  12226. }
  12227. return e
  12228. },
  12229. initDragDataTransfer: function (a, b) {
  12230. var c = a.data.$ ? a.data.$.dataTransfer : null, d = new this.dataTransfer(c, b);
  12231. "dragstart" === a.name && d.storeId();
  12232. c ? this.dragData && d.id ==
  12233. this.dragData.id ? d = this.dragData : this.dragData = d : this.dragData ? d = this.dragData : this.dragData = d;
  12234. a.data.dataTransfer = d
  12235. },
  12236. resetDragDataTransfer: function () {
  12237. this.dragData = null
  12238. },
  12239. initPasteDataTransfer: function (a, b) {
  12240. if (this.isCustomCopyCutSupported) {
  12241. if (a && a.data && a.data.$) {
  12242. var c = a.data.$.clipboardData, d = new this.dataTransfer(c, b);
  12243. "copy" !== a.name && "cut" !== a.name || d.storeId();
  12244. this.copyCutData && d.id == this.copyCutData.id ? (d = this.copyCutData, d.$ = c) : this.copyCutData = d;
  12245. return d
  12246. }
  12247. return new this.dataTransfer(null,
  12248. b)
  12249. }
  12250. return new this.dataTransfer(CKEDITOR.env.edge && a && a.data.$ && a.data.$.clipboardData || null, b)
  12251. },
  12252. preventDefaultDropOnElement: function (a) {
  12253. a && a.on("dragover", C)
  12254. }
  12255. };
  12256. m = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? "cke/id" : "Text";
  12257. CKEDITOR.plugins.clipboard.dataTransfer = function (a, b) {
  12258. a && (this.$ = a);
  12259. this._ = {
  12260. metaRegExp: /^<meta.*?>/i,
  12261. bodyRegExp: /<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,
  12262. fragmentRegExp: /\x3c!--(?:Start|End)Fragment--\x3e/g,
  12263. data: {},
  12264. files: [],
  12265. nativeHtmlCache: "",
  12266. normalizeType: function (a) {
  12267. a =
  12268. a.toLowerCase();
  12269. return "text" == a || "text/plain" == a ? "Text" : "url" == a ? "URL" : a
  12270. }
  12271. };
  12272. this._.fallbackDataTransfer = new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);
  12273. this.id = this.getData(m);
  12274. this.id || (this.id = "Text" == m ? "" : "cke-" + CKEDITOR.tools.getUniqueId());
  12275. b && (this.sourceEditor = b, this.setData("text/html", b.getSelectedHtml(1)), "Text" == m || this.getData("text/plain") || this.setData("text/plain", b.getSelection().getSelectedText()))
  12276. };
  12277. CKEDITOR.DATA_TRANSFER_INTERNAL = 1;
  12278. CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2;
  12279. CKEDITOR.DATA_TRANSFER_EXTERNAL =
  12280. 3;
  12281. CKEDITOR.plugins.clipboard.dataTransfer.prototype = {
  12282. getData: function (a, b) {
  12283. a = this._.normalizeType(a);
  12284. var c = "text/html" == a && b ? this._.nativeHtmlCache : this._.data[a];
  12285. if (void 0 === c || null === c || "" === c) {
  12286. if (this._.fallbackDataTransfer.isRequired()) c = this._.fallbackDataTransfer.getData(a, b); else try {
  12287. c = this.$.getData(a) || ""
  12288. } catch (d) {
  12289. c = ""
  12290. }
  12291. "text/html" != a || b || (c = this._stripHtml(c))
  12292. }
  12293. "Text" == a && CKEDITOR.env.gecko && this.getFilesCount() && "file://" == c.substring(0, 7) && (c = "");
  12294. if ("string" === typeof c) var g = c.indexOf("\x3c/html\x3e"),
  12295. c = -1 !== g ? c.substring(0, g + 7) : c;
  12296. return c
  12297. }, setData: function (a, b) {
  12298. a = this._.normalizeType(a);
  12299. "text/html" == a ? (this._.data[a] = this._stripHtml(b), this._.nativeHtmlCache = b) : this._.data[a] = b;
  12300. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || "URL" == a || "Text" == a) if ("Text" == m && "Text" == a && (this.id = b), this._.fallbackDataTransfer.isRequired()) this._.fallbackDataTransfer.setData(a, b); else try {
  12301. this.$.setData(a, b)
  12302. } catch (c) {
  12303. }
  12304. }, storeId: function () {
  12305. "Text" !== m && this.setData(m, this.id)
  12306. }, getTransferType: function (a) {
  12307. return this.sourceEditor ?
  12308. this.sourceEditor == a ? CKEDITOR.DATA_TRANSFER_INTERNAL : CKEDITOR.DATA_TRANSFER_CROSS_EDITORS : CKEDITOR.DATA_TRANSFER_EXTERNAL
  12309. }, cacheData: function () {
  12310. function a(a) {
  12311. a = b._.normalizeType(a);
  12312. var c = b.getData(a);
  12313. "text/html" == a && (b._.nativeHtmlCache = b.getData(a, !0), c = b._stripHtml(c));
  12314. c && (b._.data[a] = c)
  12315. }
  12316. if (this.$) {
  12317. var b = this, c, d;
  12318. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  12319. if (this.$.types) for (c = 0; c < this.$.types.length; c++) a(this.$.types[c])
  12320. } else a("Text"), a("URL");
  12321. d = this._getImageFromClipboard();
  12322. if (this.$ &&
  12323. this.$.files || d) {
  12324. this._.files = [];
  12325. if (this.$.files && this.$.files.length) for (c = 0; c < this.$.files.length; c++) this._.files.push(this.$.files[c]);
  12326. 0 === this._.files.length && d && this._.files.push(d)
  12327. }
  12328. }
  12329. }, getFilesCount: function () {
  12330. return this._.files.length ? this._.files.length : this.$ && this.$.files && this.$.files.length ? this.$.files.length : this._getImageFromClipboard() ? 1 : 0
  12331. }, getFile: function (a) {
  12332. return this._.files.length ? this._.files[a] : this.$ && this.$.files && this.$.files.length ? this.$.files[a] : 0 === a ? this._getImageFromClipboard() :
  12333. void 0
  12334. }, isEmpty: function () {
  12335. var a = {}, b;
  12336. if (this.getFilesCount()) return !1;
  12337. CKEDITOR.tools.array.forEach(CKEDITOR.tools.objectKeys(this._.data), function (b) {
  12338. a[b] = 1
  12339. });
  12340. if (this.$) if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  12341. if (this.$.types) for (var c = 0; c < this.$.types.length; c++) a[this.$.types[c]] = 1
  12342. } else a.Text = 1, a.URL = 1;
  12343. "Text" != m && (a[m] = 0);
  12344. for (b in a) if (a[b] && "" !== this.getData(b)) return !1;
  12345. return !0
  12346. }, _getImageFromClipboard: function () {
  12347. var a;
  12348. try {
  12349. if (this.$ && this.$.items && this.$.items[0] && (a = this.$.items[0].getAsFile()) &&
  12350. a.type) return a
  12351. } catch (b) {
  12352. }
  12353. }, _stripHtml: function (a) {
  12354. if (a && a.length) {
  12355. a = a.replace(this._.metaRegExp, "");
  12356. var b = this._.bodyRegExp.exec(a);
  12357. b && b.length && (a = b[1], a = a.replace(this._.fragmentRegExp, ""))
  12358. }
  12359. return a
  12360. }
  12361. };
  12362. CKEDITOR.plugins.clipboard.fallbackDataTransfer = function (a) {
  12363. this._dataTransfer = a;
  12364. this._customDataFallbackType = "text/html"
  12365. };
  12366. CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported = null;
  12367. CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes = [];
  12368. CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype =
  12369. {
  12370. isRequired: function () {
  12371. var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer, b = this._dataTransfer.$;
  12372. if (null === a._isCustomMimeTypeSupported) if (b) {
  12373. a._isCustomMimeTypeSupported = !1;
  12374. if (CKEDITOR.env.edge && 17 <= CKEDITOR.env.version) return !0;
  12375. try {
  12376. b.setData("cke/mimetypetest", "cke test value"), a._isCustomMimeTypeSupported = "cke test value" === b.getData("cke/mimetypetest"), b.clearData("cke/mimetypetest")
  12377. } catch (c) {
  12378. }
  12379. } else return !1;
  12380. return !a._isCustomMimeTypeSupported
  12381. }, getData: function (a, b) {
  12382. var c = this._getData(this._customDataFallbackType,
  12383. !0);
  12384. if (b) return c;
  12385. var c = this._extractDataComment(c), d = null,
  12386. d = a === this._customDataFallbackType ? c.content : c.data && c.data[a] ? c.data[a] : this._getData(a, !0);
  12387. return null !== d ? d : ""
  12388. }, setData: function (a, b) {
  12389. var c = a === this._customDataFallbackType;
  12390. c && (b = this._applyDataComment(b, this._getFallbackTypeData()));
  12391. var d = b, g = this._dataTransfer.$;
  12392. try {
  12393. g.setData(a, d), c && (this._dataTransfer._.nativeHtmlCache = d)
  12394. } catch (h) {
  12395. if (this._isUnsupportedMimeTypeError(h)) {
  12396. c = CKEDITOR.plugins.clipboard.fallbackDataTransfer;
  12397. -1 === CKEDITOR.tools.indexOf(c._customTypes,
  12398. a) && c._customTypes.push(a);
  12399. var c = this._getFallbackTypeContent(), e = this._getFallbackTypeData();
  12400. e[a] = d;
  12401. try {
  12402. d = this._applyDataComment(c, e), g.setData(this._customDataFallbackType, d), this._dataTransfer._.nativeHtmlCache = d
  12403. } catch (f) {
  12404. d = ""
  12405. }
  12406. }
  12407. }
  12408. return d
  12409. }, _getData: function (a, b) {
  12410. var c = this._dataTransfer._.data;
  12411. if (!b && c[a]) return c[a];
  12412. try {
  12413. return this._dataTransfer.$.getData(a)
  12414. } catch (d) {
  12415. return null
  12416. }
  12417. }, _getFallbackTypeContent: function () {
  12418. var a = this._dataTransfer._.data[this._customDataFallbackType];
  12419. a || (a = this._extractDataComment(this._getData(this._customDataFallbackType,
  12420. !0)).content);
  12421. return a
  12422. }, _getFallbackTypeData: function () {
  12423. var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes,
  12424. b = this._extractDataComment(this._getData(this._customDataFallbackType, !0)).data || {},
  12425. c = this._dataTransfer._.data;
  12426. CKEDITOR.tools.array.forEach(a, function (a) {
  12427. void 0 !== c[a] ? b[a] = c[a] : void 0 !== b[a] && (b[a] = b[a])
  12428. }, this);
  12429. return b
  12430. }, _isUnsupportedMimeTypeError: function (a) {
  12431. return a.message && -1 !== a.message.search(/element not found/gi)
  12432. }, _extractDataComment: function (a) {
  12433. var b = {
  12434. data: null, content: a ||
  12435. ""
  12436. };
  12437. if (a && 16 < a.length) {
  12438. var c;
  12439. (c = /\x3c!--cke-data:(.*?)--\x3e/g.exec(a)) && c[1] && (b.data = JSON.parse(decodeURIComponent(c[1])), b.content = a.replace(c[0], ""))
  12440. }
  12441. return b
  12442. }, _applyDataComment: function (a, b) {
  12443. var c = "";
  12444. b && CKEDITOR.tools.objectKeys(b).length && (c = "\x3c!--cke-data:" + encodeURIComponent(JSON.stringify(b)) + "--\x3e");
  12445. return c + (a && a.length ? a : "")
  12446. }
  12447. }
  12448. })();
  12449. CKEDITOR.config.clipboard_notificationDuration = 1E4;
  12450. CKEDITOR.plugins.add("panelbutton", {
  12451. requires: "button", onLoad: function () {
  12452. function e(c) {
  12453. var a = this._;
  12454. a.state != CKEDITOR.TRISTATE_DISABLED && (this.createPanel(c), a.on ? a.panel.hide() : a.panel.showBlock(this._.id, this.document.getById(this._.id), 4))
  12455. }
  12456. CKEDITOR.ui.panelButton = CKEDITOR.tools.createClass({
  12457. base: CKEDITOR.ui.button, $: function (c) {
  12458. var a = c.panel || {};
  12459. delete c.panel;
  12460. this.base(c);
  12461. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  12462. a.block = {attributes: a.attributes};
  12463. a.toolbarRelated = !0;
  12464. this.hasArrow =
  12465. "listbox";
  12466. this.click = e;
  12467. this._ = {panelDefinition: a}
  12468. }, statics: {
  12469. handler: {
  12470. create: function (c) {
  12471. return new CKEDITOR.ui.panelButton(c)
  12472. }
  12473. }
  12474. }, proto: {
  12475. createPanel: function (c) {
  12476. var a = this._;
  12477. if (!a.panel) {
  12478. var f = this._.panelDefinition, e = this._.panelDefinition.block,
  12479. g = f.parent || CKEDITOR.document.getBody(),
  12480. d = this._.panel = new CKEDITOR.ui.floatPanel(c, g, f), f = d.addBlock(a.id, e),
  12481. b = this;
  12482. d.onShow = function () {
  12483. b.className && this.element.addClass(b.className + "_panel");
  12484. b.setState(CKEDITOR.TRISTATE_ON);
  12485. a.on = 1;
  12486. b.editorFocus && c.focus();
  12487. if (b.onOpen) b.onOpen()
  12488. };
  12489. d.onHide = function (d) {
  12490. b.className && this.element.getFirst().removeClass(b.className + "_panel");
  12491. b.setState(b.modes && b.modes[c.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  12492. a.on = 0;
  12493. if (!d && b.onClose) b.onClose()
  12494. };
  12495. d.onEscape = function () {
  12496. d.hide(1);
  12497. b.document.getById(a.id).focus()
  12498. };
  12499. if (this.onBlock) this.onBlock(d, f);
  12500. f.onHide = function () {
  12501. a.on = 0;
  12502. b.setState(CKEDITOR.TRISTATE_OFF)
  12503. }
  12504. }
  12505. }
  12506. }
  12507. })
  12508. }, beforeInit: function (e) {
  12509. e.ui.addHandler(CKEDITOR.UI_PANELBUTTON, CKEDITOR.ui.panelButton.handler)
  12510. }
  12511. });
  12512. CKEDITOR.UI_PANELBUTTON = "panelbutton";
  12513. (function () {
  12514. CKEDITOR.plugins.add("panel", {
  12515. beforeInit: function (a) {
  12516. a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler)
  12517. }
  12518. });
  12519. CKEDITOR.UI_PANEL = "panel";
  12520. CKEDITOR.ui.panel = function (a, b) {
  12521. b && CKEDITOR.tools.extend(this, b);
  12522. CKEDITOR.tools.extend(this, {className: "", css: []});
  12523. this.id = CKEDITOR.tools.getNextId();
  12524. this.document = a;
  12525. this.isFramed = this.forceIFrame || this.css.length;
  12526. this._ = {blocks: {}}
  12527. };
  12528. CKEDITOR.ui.panel.handler = {
  12529. create: function (a) {
  12530. return new CKEDITOR.ui.panel(a)
  12531. }
  12532. };
  12533. var g = CKEDITOR.addTemplate("panel",
  12534. '\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'),
  12535. h = CKEDITOR.addTemplate("panel-frame", '\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'),
  12536. k = CKEDITOR.addTemplate("panel-frame-inner", '\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');
  12537. CKEDITOR.ui.panel.prototype = {
  12538. render: function (a, b) {
  12539. var e = {
  12540. editorId: a.id,
  12541. id: this.id,
  12542. langCode: a.langCode,
  12543. dir: a.lang.dir,
  12544. cls: this.className,
  12545. frame: "",
  12546. env: CKEDITOR.env.cssClass,
  12547. "z-index": a.config.baseFloatZIndex + 1
  12548. };
  12549. this.getHolderElement = function () {
  12550. var a = this._.holder;
  12551. if (!a) {
  12552. if (this.isFramed) {
  12553. var a = this.document.getById(this.id + "_frame"), b = a.getParent(),
  12554. a = a.getFrameDocument();
  12555. CKEDITOR.env.iOS && b.setStyles({
  12556. overflow: "scroll",
  12557. "-webkit-overflow-scrolling": "touch"
  12558. });
  12559. b = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function () {
  12560. this.isLoaded =
  12561. !0;
  12562. if (this.onLoad) this.onLoad()
  12563. }, this));
  12564. a.write(k.output(CKEDITOR.tools.extend({
  12565. css: CKEDITOR.tools.buildStyleHtml(this.css),
  12566. onload: "window.parent.CKEDITOR.tools.callFunction(" + b + ");"
  12567. }, e)));
  12568. a.getWindow().$.CKEDITOR = CKEDITOR;
  12569. a.on("keydown", function (a) {
  12570. var b = a.data.getKeystroke(), c = this.document.getById(this.id).getAttribute("dir");
  12571. if ("input" !== a.data.getTarget().getName() || 37 !== b && 39 !== b) this._.onKeyDown && !1 === this._.onKeyDown(b) ? "input" === a.data.getTarget().getName() && 32 === b || a.data.preventDefault() :
  12572. (27 == b || b == ("rtl" == c ? 39 : 37)) && this.onEscape && !1 === this.onEscape(b) && a.data.preventDefault()
  12573. }, this);
  12574. a = a.getBody();
  12575. a.unselectable();
  12576. CKEDITOR.env.air && CKEDITOR.tools.callFunction(b)
  12577. } else a = this.document.getById(this.id);
  12578. this._.holder = a
  12579. }
  12580. return a
  12581. };
  12582. if (this.isFramed) {
  12583. var d = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ? "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : "";
  12584. e.frame = h.output({
  12585. id: this.id + "_frame",
  12586. src: d
  12587. })
  12588. }
  12589. d = g.output(e);
  12590. b && b.push(d);
  12591. return d
  12592. }, addBlock: function (a, b) {
  12593. b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(), b);
  12594. this._.currentBlock || this.showBlock(a);
  12595. return b
  12596. }, getBlock: function (a) {
  12597. return this._.blocks[a]
  12598. }, showBlock: function (a) {
  12599. a = this._.blocks[a];
  12600. var b = this._.currentBlock,
  12601. e = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + "_frame");
  12602. b && b.hide();
  12603. this._.currentBlock = a;
  12604. CKEDITOR.fire("ariaWidget", e);
  12605. a._.focusIndex =
  12606. -1;
  12607. this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
  12608. a.show();
  12609. return a
  12610. }, destroy: function () {
  12611. this.element && this.element.remove()
  12612. }
  12613. };
  12614. CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass({
  12615. $: function (a, b) {
  12616. this.element = a.append(a.getDocument().createElement("div", {
  12617. attributes: {
  12618. tabindex: -1,
  12619. "class": "cke_panel_block"
  12620. }, styles: {display: "none"}
  12621. }));
  12622. b && CKEDITOR.tools.extend(this, b);
  12623. this.element.setAttributes({
  12624. role: this.attributes.role || "presentation",
  12625. "aria-label": this.attributes["aria-label"],
  12626. title: this.attributes.title ||
  12627. this.attributes["aria-label"]
  12628. });
  12629. this.keys = {};
  12630. this._.focusIndex = -1;
  12631. this.element.disableContextMenu()
  12632. }, _: {
  12633. markItem: function (a) {
  12634. -1 != a && (a = this._.getItems().getItem(this._.focusIndex = a), CKEDITOR.env.webkit && a.getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a))
  12635. }, markFirstDisplayed: function (a) {
  12636. for (var b = function (a) {
  12637. return a.type == CKEDITOR.NODE_ELEMENT && "none" == a.getStyle("display")
  12638. }, e = this._.getItems(), d, c, f = e.count() - 1; 0 <= f; f--) if (d = e.getItem(f), d.getAscendant(b) || (c = d, this._.focusIndex =
  12639. f), "true" == d.getAttribute("aria-selected")) {
  12640. c = d;
  12641. this._.focusIndex = f;
  12642. break
  12643. }
  12644. c && (a && a(), CKEDITOR.env.webkit && c.getDocument().getWindow().focus(), c.focus(), this.onMark && this.onMark(c))
  12645. }, getItems: function () {
  12646. return this.element.find("a,input")
  12647. }
  12648. }, proto: {
  12649. show: function () {
  12650. this.element.setStyle("display", "")
  12651. }, hide: function () {
  12652. this.onHide && !0 === this.onHide.call(this) || this.element.setStyle("display", "none")
  12653. }, onKeyDown: function (a, b) {
  12654. var e = this.keys[a];
  12655. switch (e) {
  12656. case "next":
  12657. for (var d = this._.focusIndex, e = this._.getItems(),
  12658. c; c = e.getItem(++d);) if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
  12659. this._.focusIndex = d;
  12660. c.focus(!0);
  12661. break
  12662. }
  12663. return c || b ? !1 : (this._.focusIndex = -1, this.onKeyDown(a, 1));
  12664. case "prev":
  12665. d = this._.focusIndex;
  12666. for (e = this._.getItems(); 0 < d && (c = e.getItem(--d));) {
  12667. if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
  12668. this._.focusIndex = d;
  12669. c.focus(!0);
  12670. break
  12671. }
  12672. c = null
  12673. }
  12674. return c || b ? !1 : (this._.focusIndex = e.count(), this.onKeyDown(a, 1));
  12675. case "click":
  12676. case "mouseup":
  12677. return d = this._.focusIndex, (c = 0 <= d && this._.getItems().getItem(d)) &&
  12678. (c.$[e] ? c.$[e]() : c.$["on" + e]()), !1
  12679. }
  12680. return !0
  12681. }
  12682. }
  12683. })
  12684. })();
  12685. CKEDITOR.plugins.add("floatpanel", {requires: "panel"});
  12686. (function () {
  12687. function v(a, b, c, m, h) {
  12688. h = CKEDITOR.tools.genKey(b.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || "", m.css || "", h || "");
  12689. var g = f[h];
  12690. g || (g = f[h] = new CKEDITOR.ui.panel(b, m), g.element = c.append(CKEDITOR.dom.element.createFromHtml(g.render(a), b)), g.element.setStyles({
  12691. display: "none",
  12692. position: "absolute"
  12693. }));
  12694. return g
  12695. }
  12696. var f = {};
  12697. CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
  12698. $: function (a, b, c, m) {
  12699. function h() {
  12700. e.hide()
  12701. }
  12702. c.forceIFrame = 1;
  12703. c.toolbarRelated && a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE &&
  12704. (b = CKEDITOR.document.getById("cke_" + a.name));
  12705. var g = b.getDocument();
  12706. m = v(a, g, b, c, m || 0);
  12707. var n = m.element, k = n.getFirst(), e = this;
  12708. n.disableContextMenu();
  12709. this.element = n;
  12710. this._ = {
  12711. editor: a,
  12712. panel: m,
  12713. parentElement: b,
  12714. definition: c,
  12715. document: g,
  12716. iframe: k,
  12717. children: [],
  12718. dir: a.lang.dir,
  12719. showBlockParams: null,
  12720. markFirst: void 0 !== c.markFirst ? c.markFirst : !0
  12721. };
  12722. a.on("mode", h);
  12723. a.on("resize", h);
  12724. g.getWindow().on("resize", function () {
  12725. this.reposition()
  12726. }, this)
  12727. }, proto: {
  12728. addBlock: function (a, b) {
  12729. return this._.panel.addBlock(a, b)
  12730. }, addListBlock: function (a,
  12731. b) {
  12732. return this._.panel.addListBlock(a, b)
  12733. }, getBlock: function (a) {
  12734. return this._.panel.getBlock(a)
  12735. }, showBlock: function (a, b, c, m, h, g) {
  12736. var n = this._.panel, k = n.showBlock(a);
  12737. this._.showBlockParams = [].slice.call(arguments);
  12738. this.allowBlur(!1);
  12739. var e = this._.editor.editable();
  12740. this._.returnFocus = e.hasFocus ? e : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
  12741. this._.hideTimeout = 0;
  12742. var l = this.element, e = this._.iframe,
  12743. e = CKEDITOR.env.ie && !CKEDITOR.env.edge ? e : new CKEDITOR.dom.window(e.$.contentWindow),
  12744. f = l.getDocument(),
  12745. r = this._.parentElement.getPositionedAncestor(), t = b.getDocumentPosition(f),
  12746. f = r ? r.getDocumentPosition(f) : {x: 0, y: 0}, q = "rtl" == this._.dir,
  12747. d = t.x + (m || 0) - f.x, p = t.y + (h || 0) - f.y;
  12748. !q || 1 != c && 4 != c ? q || 2 != c && 3 != c || (d += b.$.offsetWidth - 1) : d += b.$.offsetWidth;
  12749. if (3 == c || 4 == c) p += b.$.offsetHeight - 1;
  12750. this._.panel._.offsetParentId = b.getId();
  12751. l.setStyles({top: p + "px", left: 0, display: ""});
  12752. l.setOpacity(0);
  12753. l.getFirst().removeStyle("width");
  12754. this._.editor.focusManager.add(e);
  12755. this._.blurSet || (CKEDITOR.event.useCapture = !0, e.on("blur",
  12756. function (a) {
  12757. function u() {
  12758. delete this._.returnFocus;
  12759. this.hide()
  12760. }
  12761. this.allowBlur() && a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !this._.activeChild && (CKEDITOR.env.iOS ? this._.hideTimeout || (this._.hideTimeout = CKEDITOR.tools.setTimeout(u, 0, this)) : u.call(this))
  12762. }, this), e.on("focus", function () {
  12763. this._.focused = !0;
  12764. this.hideChild();
  12765. this.allowBlur(!0)
  12766. }, this), CKEDITOR.env.iOS && (e.on("touchstart", function () {
  12767. clearTimeout(this._.hideTimeout)
  12768. }, this), e.on("touchend", function () {
  12769. this._.hideTimeout =
  12770. 0;
  12771. this.focus()
  12772. }, this)), CKEDITOR.event.useCapture = !1, this._.blurSet = 1);
  12773. n.onEscape = CKEDITOR.tools.bind(function (a) {
  12774. if (this.onEscape && !1 === this.onEscape(a)) return !1
  12775. }, this);
  12776. CKEDITOR.tools.setTimeout(function () {
  12777. var a = CKEDITOR.tools.bind(function () {
  12778. var a = l;
  12779. a.removeStyle("width");
  12780. if (k.autoSize) {
  12781. var b = k.element.getDocument(),
  12782. b = (CKEDITOR.env.webkit || CKEDITOR.env.edge ? k.element : b.getBody()).$.scrollWidth;
  12783. CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetWidth || 0) - (a.$.clientWidth || 0) + 3);
  12784. a.setStyle("width",
  12785. b + 10 + "px");
  12786. b = k.element.$.scrollHeight;
  12787. CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetHeight || 0) - (a.$.clientHeight || 0) + 3);
  12788. a.setStyle("height", b + "px");
  12789. n._.currentBlock.element.setStyle("display", "none").removeStyle("display")
  12790. } else a.removeStyle("height");
  12791. q && (d -= l.$.offsetWidth);
  12792. l.setStyle("left", d + "px");
  12793. var b = n.element.getWindow(), a = l.$.getBoundingClientRect(), b = b.getViewPaneSize(),
  12794. c = a.width || a.right - a.left, e = a.height || a.bottom - a.top,
  12795. m = q ? a.right : b.width - a.left, h = q ? b.width - a.right : a.left;
  12796. q ? m < c && (d = h > c ? d + c : b.width > c ? d - a.left : d - a.right + b.width) : m < c && (d = h > c ? d - c : b.width > c ? d - a.right + b.width : d - a.left);
  12797. c = a.top;
  12798. b.height - a.top < e && (p = c > e ? p - e : b.height > e ? p - a.bottom + b.height : p - a.top);
  12799. CKEDITOR.env.ie && !CKEDITOR.env.edge && (b = a = new CKEDITOR.dom.element(l.$.offsetParent), "html" == b.getName() && (b = b.getDocument().getBody()), "rtl" == b.getComputedStyle("direction") && (d = CKEDITOR.env.ie8Compat ? d - 2 * l.getDocument().getDocumentElement().$.scrollLeft : d - (a.$.scrollWidth - a.$.clientWidth)));
  12800. var a = l.getFirst(), f;
  12801. (f = a.getCustomData("activePanel")) && f.onHide && f.onHide.call(this, 1);
  12802. a.setCustomData("activePanel", this);
  12803. l.setStyles({top: p + "px", left: d + "px"});
  12804. l.setOpacity(1);
  12805. g && g()
  12806. }, this);
  12807. n.isLoaded ? a() : n.onLoad = a;
  12808. CKEDITOR.tools.setTimeout(function () {
  12809. var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
  12810. this.focus();
  12811. k.element.focus();
  12812. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a);
  12813. this.allowBlur(!0);
  12814. this._.markFirst && (CKEDITOR.env.ie ? CKEDITOR.tools.setTimeout(function () {
  12815. k.markFirstDisplayed ?
  12816. k.markFirstDisplayed() : k._.markFirstDisplayed()
  12817. }, 0) : k.markFirstDisplayed ? k.markFirstDisplayed() : k._.markFirstDisplayed());
  12818. this._.editor.fire("panelShow", this)
  12819. }, 0, this)
  12820. }, CKEDITOR.env.air ? 200 : 0, this);
  12821. this.visible = 1;
  12822. this.onShow && this.onShow.call(this)
  12823. }, reposition: function () {
  12824. var a = this._.showBlockParams;
  12825. this.visible && this._.showBlockParams && (this.hide(), this.showBlock.apply(this, a))
  12826. }, focus: function () {
  12827. if (CKEDITOR.env.webkit) {
  12828. var a = CKEDITOR.document.getActive();
  12829. a && !a.equals(this._.iframe) && a.$.blur()
  12830. }
  12831. (this._.lastFocused ||
  12832. this._.iframe.getFrameDocument().getWindow()).focus()
  12833. }, blur: function () {
  12834. var a = this._.iframe.getFrameDocument().getActive();
  12835. a && a.is("a") && (this._.lastFocused = a)
  12836. }, hide: function (a) {
  12837. if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) {
  12838. this.hideChild();
  12839. CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
  12840. this.element.setStyle("display", "none");
  12841. this.visible = 0;
  12842. this.element.getFirst().removeCustomData("activePanel");
  12843. if (a = a && this._.returnFocus) CKEDITOR.env.webkit && a.type && a.getWindow().$.focus(),
  12844. a.focus();
  12845. delete this._.lastFocused;
  12846. this._.showBlockParams = null;
  12847. this._.editor.fire("panelHide", this)
  12848. }
  12849. }, allowBlur: function (a) {
  12850. var b = this._.panel;
  12851. void 0 !== a && (b.allowBlur = a);
  12852. return b.allowBlur
  12853. }, showAsChild: function (a, b, c, f, h, g) {
  12854. if (this._.activeChild != a || a._.panel._.offsetParentId != c.getId()) this.hideChild(), a.onHide = CKEDITOR.tools.bind(function () {
  12855. CKEDITOR.tools.setTimeout(function () {
  12856. this._.focused || this.hide()
  12857. }, 0, this)
  12858. }, this), this._.activeChild = a, this._.focused = !1, a.showBlock(b, c, f, h, g), this.blur(),
  12859. (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function () {
  12860. a.element.getChild(0).$.style.cssText += ""
  12861. }, 100)
  12862. }, hideChild: function (a) {
  12863. var b = this._.activeChild;
  12864. b && (delete b.onHide, delete this._.activeChild, b.hide(), a && this.focus())
  12865. }
  12866. }
  12867. });
  12868. CKEDITOR.on("instanceDestroyed", function () {
  12869. var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances), b;
  12870. for (b in f) {
  12871. var c = f[b];
  12872. a ? c.destroy() : c.element.hide()
  12873. }
  12874. a && (f = {})
  12875. })
  12876. })();
  12877. CKEDITOR.plugins.add("colorbutton", {
  12878. requires: "panelbutton,floatpanel", init: function (e) {
  12879. function t(a, d, g, r, k) {
  12880. var p = new CKEDITOR.style(l["colorButton_" + d + "Style"]),
  12881. m = CKEDITOR.tools.getNextId() + "_colorBox", q;
  12882. k = k || {};
  12883. e.ui.add(a, CKEDITOR.UI_PANELBUTTON, {
  12884. label: g,
  12885. title: g,
  12886. modes: {wysiwyg: 1},
  12887. editorFocus: 0,
  12888. toolbar: "colors," + r,
  12889. allowedContent: p,
  12890. requiredContent: p,
  12891. contentTransformations: k.contentTransformations,
  12892. panel: {
  12893. css: CKEDITOR.skin.getPath("editor"),
  12894. attributes: {role: "listbox", "aria-label": h.panelTitle}
  12895. },
  12896. onBlock: function (a,
  12897. b) {
  12898. q = b;
  12899. b.autoSize = !0;
  12900. b.element.addClass("cke_colorblock");
  12901. b.element.setHtml(y(a, d, m));
  12902. b.element.getDocument().getBody().setStyle("overflow", "hidden");
  12903. CKEDITOR.ui.fire("ready", this);
  12904. var c = b.keys, f = "rtl" == e.lang.dir;
  12905. c[f ? 37 : 39] = "next";
  12906. c[40] = "next";
  12907. c[9] = "next";
  12908. c[f ? 39 : 37] = "prev";
  12909. c[38] = "prev";
  12910. c[CKEDITOR.SHIFT + 9] = "prev";
  12911. c[32] = "click"
  12912. },
  12913. refresh: function () {
  12914. e.activeFilter.check(p) || this.setState(CKEDITOR.TRISTATE_DISABLED)
  12915. },
  12916. onOpen: function () {
  12917. var a = e.getSelection(), b = a && a.getStartElement(), c = e.elementPath(b);
  12918. if (c) {
  12919. b = c.block || c.blockLimit || e.document.getBody();
  12920. do c = b && b.getComputedStyle("back" == d ? "background-color" : "color") || "transparent"; while ("back" == d && "transparent" == c && b && (b = b.getParent()));
  12921. c && "transparent" != c || (c = "#ffffff");
  12922. !1 !== l.colorButton_enableAutomatic && this._.panel._.iframe.getFrameDocument().getById(m).setStyle("background-color", c);
  12923. if (b = a && a.getRanges()[0]) {
  12924. for (var a = new CKEDITOR.dom.walker(b), f = b.collapsed ? b.startContainer : a.next(), b = ""; f;) {
  12925. f.type !== CKEDITOR.NODE_ELEMENT && (f = f.getParent());
  12926. f = u(f.getComputedStyle("back" == d ? "background-color" : "color"));
  12927. b = b || f;
  12928. if (b !== f) {
  12929. b = "";
  12930. break
  12931. }
  12932. f = a.next()
  12933. }
  12934. a = b;
  12935. b = q._.getItems();
  12936. for (f = 0; f < b.count(); f++) {
  12937. var g = b.getItem(f);
  12938. g.removeAttribute("aria-selected");
  12939. a && a == u(g.getAttribute("data-value")) && g.setAttribute("aria-selected", !0)
  12940. }
  12941. }
  12942. return c
  12943. }
  12944. }
  12945. })
  12946. }
  12947. function y(a, d, g) {
  12948. a = [];
  12949. var r = l.colorButton_colors.split(","), k = l.colorButton_colorsPerRow || 6,
  12950. p = e.plugins.colordialog && !1 !== l.colorButton_enableMore, m = r.length + (p ? 2 : 1),
  12951. q = CKEDITOR.tools.addFunction(function (a, b) {
  12952. function c(a) {
  12953. var d =
  12954. l["colorButton_" + b + "Style"];
  12955. e.removeStyle(new CKEDITOR.style(d, {color: "inherit"}));
  12956. d.childRule = "back" == b ? function (a) {
  12957. return v(a)
  12958. } : function (a) {
  12959. return !(a.is("a") || a.getElementsByTag("a").count()) || v(a)
  12960. };
  12961. e.focus();
  12962. a && e.applyStyle(new CKEDITOR.style(d, {color: a}));
  12963. e.fire("saveSnapshot")
  12964. }
  12965. e.focus();
  12966. e.fire("saveSnapshot");
  12967. if ("?" == a) e.getColorFromDialog(function (a) {
  12968. if (a) return c(a)
  12969. }); else return c(a)
  12970. });
  12971. !1 !== l.colorButton_enableAutomatic && a.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
  12972. h.auto, '" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(', q, ",null,'", d, "');return false;\" href\x3d\"javascript:void('", h.auto, '\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"', m, '"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"' + k + '" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"', g, '"\x3e\x3c/span\x3e', h.auto, "\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/a\x3e");
  12973. a.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e');
  12974. for (g = 0; g < r.length; g++) {
  12975. 0 === g % k && a.push("\x3c/tr\x3e\x3ctr\x3e");
  12976. var n = r[g].split("/"), b = n[0], c = n[1] || b;
  12977. n[1] ? n = b : (b = "#" + b.replace(/^(.)(.)(.)$/, "$1$1$2$2$3$3"), n = e.lang.colorbutton.colors[c] || c);
  12978. a.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', n, '" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(', q, ",'", b, "','", d,
  12979. "'); return false;\" href\x3d\"javascript:void('", n, '\')" data-value\x3d"' + c + '" role\x3d"option" aria-posinset\x3d"', g + 2, '" aria-setsize\x3d"', m, '"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#', c, '"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')
  12980. }
  12981. p && a.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"' + k + '" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', h.more, '" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',
  12982. q, ",'?','", d, "');return false;\" href\x3d\"javascript:void('", h.more, "')\"", ' role\x3d"option" aria-posinset\x3d"', m, '" aria-setsize\x3d"', m, '"\x3e', h.more, "\x3c/a\x3e\x3c/td\x3e");
  12983. a.push("\x3c/tr\x3e\x3c/table\x3e");
  12984. return a.join("")
  12985. }
  12986. function v(a) {
  12987. return "false" == a.getAttribute("contentEditable") || a.getAttribute("data-nostyle")
  12988. }
  12989. function u(a) {
  12990. return CKEDITOR.tools.normalizeHex("#" + CKEDITOR.tools.convertRgbToHex(a || "")).replace(/#/g, "")
  12991. }
  12992. var l = e.config, h = e.lang.colorbutton;
  12993. if (!CKEDITOR.env.hc) {
  12994. t("TextColor",
  12995. "fore", h.textColorTitle, 10, {
  12996. contentTransformations: [[{
  12997. element: "font",
  12998. check: "span{color}",
  12999. left: function (a) {
  13000. return !!a.attributes.color
  13001. },
  13002. right: function (a) {
  13003. a.name = "span";
  13004. a.attributes.color && (a.styles.color = a.attributes.color);
  13005. delete a.attributes.color
  13006. }
  13007. }]]
  13008. });
  13009. var w = {}, x = e.config.colorButton_normalizeBackground;
  13010. if (void 0 === x || x) w.contentTransformations = [[{
  13011. element: "span", left: function (a) {
  13012. var d = CKEDITOR.tools;
  13013. if ("span" != a.name || !a.styles || !a.styles.background) return !1;
  13014. a = d.style.parse.background(a.styles.background);
  13015. return a.color && 1 === d.objectKeys(a).length
  13016. }, right: function (a) {
  13017. var d = (new CKEDITOR.style(e.config.colorButton_backStyle, {color: a.styles.background})).getDefinition();
  13018. a.name = d.element;
  13019. a.styles = d.styles;
  13020. a.attributes = d.attributes || {};
  13021. return a
  13022. }
  13023. }]];
  13024. t("BGColor", "back", h.bgColorTitle, 20, w)
  13025. }
  13026. }
  13027. });
  13028. CKEDITOR.config.colorButton_colors = "1ABC9C,2ECC71,3498DB,9B59B6,4E5F70,F1C40F,16A085,27AE60,2980B9,8E44AD,2C3E50,F39C12,E67E22,E74C3C,ECF0F1,95A5A6,DDD,FFF,D35400,C0392B,BDC3C7,7F8C8D,999,000";
  13029. CKEDITOR.config.colorButton_foreStyle = {
  13030. element: "span",
  13031. styles: {color: "#(color)"},
  13032. overrides: [{element: "font", attributes: {color: null}}]
  13033. };
  13034. CKEDITOR.config.colorButton_backStyle = {element: "span", styles: {"background-color": "#(color)"}};
  13035. CKEDITOR.plugins.colordialog = {
  13036. requires: "dialog", init: function (b) {
  13037. var d = new CKEDITOR.dialogCommand("colordialog");
  13038. d.editorFocus = !1;
  13039. b.addCommand("colordialog", d);
  13040. CKEDITOR.dialog.add("colordialog", this.path + "dialogs/colordialog.js");
  13041. b.getColorFromDialog = function (d, g) {
  13042. var c, f, e;
  13043. c = function (a) {
  13044. f(this);
  13045. a = "ok" == a.name ? this.getValueOf("picker", "selectedColor") : null;
  13046. /^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(a) && (a = "#" + a);
  13047. d.call(g, a)
  13048. };
  13049. f = function (a) {
  13050. a.removeListener("ok", c);
  13051. a.removeListener("cancel", c)
  13052. };
  13053. e = function (a) {
  13054. a.on("ok",
  13055. c);
  13056. a.on("cancel", c)
  13057. };
  13058. b.execCommand("colordialog");
  13059. if (b._.storedDialogs && b._.storedDialogs.colordialog) e(b._.storedDialogs.colordialog); else CKEDITOR.on("dialogDefinition", function (a) {
  13060. if ("colordialog" == a.data.name) {
  13061. var b = a.data.definition;
  13062. a.removeListener();
  13063. b.onLoad = CKEDITOR.tools.override(b.onLoad, function (a) {
  13064. return function () {
  13065. e(this);
  13066. b.onLoad = a;
  13067. "function" == typeof a && a.call(this)
  13068. }
  13069. })
  13070. }
  13071. })
  13072. }
  13073. }
  13074. };
  13075. CKEDITOR.plugins.add("colordialog", CKEDITOR.plugins.colordialog);
  13076. (function () {
  13077. CKEDITOR.plugins.add("templates", {
  13078. requires: "dialog", init: function (a) {
  13079. CKEDITOR.dialog.add("templates", CKEDITOR.getUrl(this.path + "dialogs/templates.js"));
  13080. a.addCommand("templates", new CKEDITOR.dialogCommand("templates"));
  13081. a.ui.addButton && a.ui.addButton("Templates", {
  13082. label: a.lang.templates.button,
  13083. command: "templates",
  13084. toolbar: "doctools,10"
  13085. })
  13086. }
  13087. });
  13088. var c = {}, f = {};
  13089. CKEDITOR.addTemplates = function (a, d) {
  13090. c[a] = d
  13091. };
  13092. CKEDITOR.getTemplates = function (a) {
  13093. return c[a]
  13094. };
  13095. CKEDITOR.loadTemplates = function (a, d) {
  13096. for (var e =
  13097. [], b = 0, c = a.length; b < c; b++) f[a[b]] || (e.push(a[b]), f[a[b]] = 1);
  13098. e.length ? CKEDITOR.scriptLoader.load(e, d) : setTimeout(d, 0)
  13099. }
  13100. })();
  13101. CKEDITOR.config.templates_files = [CKEDITOR.getUrl("plugins/templates/templates/default.js")];
  13102. CKEDITOR.config.templates_replaceContent = !0;
  13103. CKEDITOR.plugins.add("menu", {
  13104. requires: "floatpanel", beforeInit: function (l) {
  13105. for (var h = l.config.menu_groups.split(","), r = l._.menuGroups = {}, t = l._.menuItems = {}, n = 0; n < h.length; n++) r[h[n]] = n + 1;
  13106. l.addMenuGroup = function (a, b) {
  13107. r[a] = b || 100
  13108. };
  13109. l.addMenuItem = function (a, b) {
  13110. r[b.group] && (t[a] = new CKEDITOR.menuItem(this, a, b))
  13111. };
  13112. l.addMenuItems = function (a) {
  13113. for (var b in a) this.addMenuItem(b, a[b])
  13114. };
  13115. l.getMenuItem = function (a) {
  13116. return t[a]
  13117. };
  13118. l.removeMenuItem = function (a) {
  13119. delete t[a]
  13120. }
  13121. }
  13122. });
  13123. (function () {
  13124. function l(a) {
  13125. a.sort(function (a, d) {
  13126. return a.group < d.group ? -1 : a.group > d.group ? 1 : a.order < d.order ? -1 : a.order > d.order ? 1 : 0
  13127. })
  13128. }
  13129. var h = '\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"{label}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"';
  13130. CKEDITOR.env.gecko && CKEDITOR.env.mac && (h += ' onkeypress\x3d"return false;"');
  13131. CKEDITOR.env.gecko && (h += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');
  13132. var h = h + (' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" ' + (CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e'),
  13133. r = CKEDITOR.addTemplate("menuItem",
  13134. h + '\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'),
  13135. t = CKEDITOR.addTemplate("menuArrow", '\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),
  13136. n = CKEDITOR.addTemplate("menuShortcut", '\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');
  13137. CKEDITOR.menu = CKEDITOR.tools.createClass({
  13138. $: function (a, b) {
  13139. b = this._.definition = b || {};
  13140. this.id = CKEDITOR.tools.getNextId();
  13141. this.editor = a;
  13142. this.items = [];
  13143. this._.listeners = [];
  13144. this._.level = b.level || 1;
  13145. var d = CKEDITOR.tools.extend({}, b.panel, {
  13146. css: [CKEDITOR.skin.getPath("editor")],
  13147. level: this._.level - 1,
  13148. block: {}
  13149. }), m = d.block.attributes = d.attributes || {};
  13150. !m.role && (m.role = "menu");
  13151. this._.panelDefinition =
  13152. d
  13153. }, _: {
  13154. onShow: function () {
  13155. var a = this.editor.getSelection(), b = a && a.getStartElement(), d = this.editor.elementPath(),
  13156. m = this._.listeners;
  13157. this.removeAll();
  13158. for (var g = 0; g < m.length; g++) {
  13159. var k = m[g](b, a, d);
  13160. if (k) for (var e in k) {
  13161. var f = this.editor.getMenuItem(e);
  13162. !f || f.command && !this.editor.getCommand(f.command).state || (f.state = k[e], this.add(f))
  13163. }
  13164. }
  13165. }, onClick: function (a) {
  13166. this.hide();
  13167. if (a.onClick) a.onClick(); else a.command && this.editor.execCommand(a.command)
  13168. }, onEscape: function (a) {
  13169. var b = this.parent;
  13170. b ? b._.panel.hideChild(1) :
  13171. 27 == a && this.hide(1);
  13172. return !1
  13173. }, onHide: function () {
  13174. this.onHide && this.onHide()
  13175. }, showSubMenu: function (a) {
  13176. var b = this._.subMenu, d = this.items[a];
  13177. if (d = d.getItems && d.getItems()) {
  13178. b ? b.removeAll() : (b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, {level: this._.level + 1}, !0)), b.parent = this, b._.onClick = CKEDITOR.tools.bind(this._.onClick, this));
  13179. for (var m in d) {
  13180. var g = this.editor.getMenuItem(m);
  13181. g && (g.state = d[m], b.add(g))
  13182. }
  13183. var k = this._.panel.getBlock(this.id).element.getDocument().getById(this.id +
  13184. String(a));
  13185. setTimeout(function () {
  13186. b.show(k, 2)
  13187. }, 0)
  13188. } else this._.panel.hideChild(1)
  13189. }
  13190. }, proto: {
  13191. add: function (a) {
  13192. a.order || (a.order = this.items.length);
  13193. this.items.push(a)
  13194. }, removeAll: function () {
  13195. this.items = []
  13196. }, show: function (a, b, d, m) {
  13197. if (!this.parent && (this._.onShow(), !this.items.length)) return;
  13198. b = b || ("rtl" == this.editor.lang.dir ? 2 : 1);
  13199. var g = this.items, k = this.editor, e = this._.panel, f = this._.element;
  13200. if (!e) {
  13201. e = this._.panel = new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level);
  13202. e.onEscape = CKEDITOR.tools.bind(function (a) {
  13203. if (!1 === this._.onEscape(a)) return !1
  13204. }, this);
  13205. e.onShow = function () {
  13206. e._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")
  13207. };
  13208. e.onHide = CKEDITOR.tools.bind(function () {
  13209. this._.onHide && this._.onHide()
  13210. }, this);
  13211. f = e.addBlock(this.id, this._.panelDefinition.block);
  13212. f.autoSize = !0;
  13213. var c = f.keys;
  13214. c[40] = "next";
  13215. c[9] = "next";
  13216. c[38] = "prev";
  13217. c[CKEDITOR.SHIFT + 9] = "prev";
  13218. c["rtl" == k.lang.dir ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click";
  13219. c[32] = CKEDITOR.env.ie ? "mouseup" :
  13220. "click";
  13221. CKEDITOR.env.ie && (c[13] = "mouseup");
  13222. f = this._.element = f.element;
  13223. c = f.getDocument();
  13224. c.getBody().setStyle("overflow", "hidden");
  13225. c.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden");
  13226. this._.itemOverFn = CKEDITOR.tools.addFunction(function (a) {
  13227. clearTimeout(this._.showSubTimeout);
  13228. this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, k.config.menu_subMenuDelay || 400, this, [a])
  13229. }, this);
  13230. this._.itemOutFn = CKEDITOR.tools.addFunction(function () {
  13231. clearTimeout(this._.showSubTimeout)
  13232. }, this);
  13233. this._.itemClickFn = CKEDITOR.tools.addFunction(function (a) {
  13234. var b = this.items[a];
  13235. if (b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1); else if (b.getItems) this._.showSubMenu(a); else this._.onClick(b)
  13236. }, this)
  13237. }
  13238. l(g);
  13239. for (var c = k.elementPath(), c = ['\x3cdiv class\x3d"cke_menu' + (c && c.direction() != k.lang.dir ? " cke_mixed_dir_content" : "") + '" role\x3d"presentation"\x3e'], h = g.length, n = h && g[0].group, q = 0; q < h; q++) {
  13240. var p = g[q];
  13241. n != p.group && (c.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),
  13242. n = p.group);
  13243. p.render(this, q, c)
  13244. }
  13245. c.push("\x3c/div\x3e");
  13246. f.setHtml(c.join(""));
  13247. CKEDITOR.ui.fire("ready", this);
  13248. this.parent ? this.parent._.panel.showAsChild(e, this.id, a, b, d, m) : e.showBlock(this.id, a, b, d, m);
  13249. k.fire("menuShow", [e])
  13250. }, addListener: function (a) {
  13251. this._.listeners.push(a)
  13252. }, hide: function (a) {
  13253. this._.onHide && this._.onHide();
  13254. this._.panel && this._.panel.hide(a)
  13255. }, findItemByCommandName: function (a) {
  13256. var b = CKEDITOR.tools.array.filter(this.items, function (b) {
  13257. return a === b.command
  13258. });
  13259. return b.length ? (b = b[0], {
  13260. item: b,
  13261. element: this._.element.findOne("." + b.className)
  13262. }) : null
  13263. }
  13264. }
  13265. });
  13266. CKEDITOR.menuItem = CKEDITOR.tools.createClass({
  13267. $: function (a, b, d) {
  13268. CKEDITOR.tools.extend(this, d, {order: 0, className: "cke_menubutton__" + b});
  13269. this.group = a._.menuGroups[this.group];
  13270. this.editor = a;
  13271. this.name = b
  13272. }, proto: {
  13273. render: function (a, b, d) {
  13274. var h = a.id + String(b), g = "undefined" == typeof this.state ? CKEDITOR.TRISTATE_OFF : this.state,
  13275. k = "", e = this.editor, f, c,
  13276. l = g == CKEDITOR.TRISTATE_ON ? "on" : g == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off";
  13277. this.role in {
  13278. menuitemcheckbox: 1,
  13279. menuitemradio: 1
  13280. } && (k = ' aria-checked\x3d"' + (g == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"');
  13281. var u = this.getItems, q = "\x26#" + ("rtl" == this.editor.lang.dir ? "9668" : "9658") + ";",
  13282. p = this.name;
  13283. this.icon && !/\./.test(this.icon) && (p = this.icon);
  13284. this.command && (f = e.getCommand(this.command), (f = e.getCommandKeystroke(f)) && (c = CKEDITOR.tools.keystrokeToString(e.lang.common.keyboard, f)));
  13285. a = {
  13286. id: h,
  13287. name: this.name,
  13288. iconName: p,
  13289. label: this.label,
  13290. cls: this.className || "",
  13291. state: l,
  13292. hasPopup: u ? "true" : "false",
  13293. disabled: g == CKEDITOR.TRISTATE_DISABLED,
  13294. title: this.label + (c ? " (" + c.display + ")" : ""),
  13295. ariaShortcut: c ? e.lang.common.keyboardShortcut + " " + c.aria : "",
  13296. href: "javascript:void('" + (this.label || "").replace("'") + "')",
  13297. hoverFn: a._.itemOverFn,
  13298. moveOutFn: a._.itemOutFn,
  13299. clickFn: a._.itemClickFn,
  13300. index: b,
  13301. iconStyle: CKEDITOR.skin.getIconStyle(p, "rtl" == this.editor.lang.dir, p == this.icon ? null : this.icon, this.iconOffset),
  13302. shortcutHtml: c ? n.output({shortcut: c.display}) : "",
  13303. arrowHtml: u ? t.output({label: q}) : "",
  13304. role: this.role ? this.role : "menuitem",
  13305. ariaChecked: k
  13306. };
  13307. r.output(a, d)
  13308. }
  13309. }
  13310. })
  13311. })();
  13312. CKEDITOR.config.menu_groups = "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";
  13313. CKEDITOR.plugins.add("contextmenu", {
  13314. requires: "menu", onLoad: function () {
  13315. CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({
  13316. base: CKEDITOR.menu, $: function (a) {
  13317. this.base.call(this, a, {
  13318. panel: {
  13319. css: a.config.contextmenu_contentsCss,
  13320. className: "cke_menu_panel",
  13321. attributes: {"aria-label": a.lang.contextmenu.options}
  13322. }
  13323. })
  13324. }, proto: {
  13325. addTarget: function (a, f) {
  13326. function c() {
  13327. e = !1
  13328. }
  13329. var d, e;
  13330. a.on("contextmenu", function (a) {
  13331. a = a.data;
  13332. var b = CKEDITOR.env.webkit ? d : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey;
  13333. if (!f || !b) if (a.preventDefault(),
  13334. !e) {
  13335. if (CKEDITOR.env.mac && CKEDITOR.env.webkit) {
  13336. var b = this.editor,
  13337. c = (new CKEDITOR.dom.elementPath(a.getTarget(), b.editable())).contains(function (a) {
  13338. return a.hasAttribute("contenteditable")
  13339. }, !0);
  13340. c && "false" == c.getAttribute("contenteditable") && b.getSelection().fake(c)
  13341. }
  13342. var c = a.getTarget().getDocument(),
  13343. g = a.getTarget().getDocument().getDocumentElement(),
  13344. b = !c.equals(CKEDITOR.document), c = c.getWindow().getScrollPosition(),
  13345. h = b ? a.$.clientX : a.$.pageX || c.x + a.$.clientX,
  13346. k = b ? a.$.clientY : a.$.pageY || c.y + a.$.clientY;
  13347. CKEDITOR.tools.setTimeout(function () {
  13348. this.open(g, null, h, k)
  13349. }, CKEDITOR.env.ie ? 200 : 0, this)
  13350. }
  13351. }, this);
  13352. if (CKEDITOR.env.webkit) {
  13353. var b = function () {
  13354. d = 0
  13355. };
  13356. a.on("keydown", function (a) {
  13357. d = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey
  13358. });
  13359. a.on("keyup", b);
  13360. a.on("contextmenu", b)
  13361. }
  13362. CKEDITOR.env.gecko && !CKEDITOR.env.mac && (a.on("keydown", function (a) {
  13363. a.data.$.shiftKey && 121 === a.data.$.keyCode && (e = !0)
  13364. }, null, null, 0), a.on("keyup", c), a.on("contextmenu", c))
  13365. }, open: function (a, f, c, d) {
  13366. !1 !== this.editor.config.enableContextMenu && this.editor.getSelection().getType() !==
  13367. CKEDITOR.SELECTION_NONE && (this.editor.focus(), a = a || CKEDITOR.document.getDocumentElement(), this.editor.selectionChange(1), this.show(a, f, c, d))
  13368. }
  13369. }
  13370. })
  13371. }, beforeInit: function (a) {
  13372. var f = a.contextMenu = new CKEDITOR.plugins.contextMenu(a);
  13373. a.on("contentDom", function () {
  13374. f.addTarget(a.editable(), !1 !== a.config.browserContextMenuOnCtrl)
  13375. });
  13376. a.addCommand("contextMenu", {
  13377. exec: function (a) {
  13378. var d = 0, e = 0, b = a.getSelection().getRanges(),
  13379. b = b[b.length - 1].getClientRects(a.editable().isInline());
  13380. if (b = b[b.length - 1]) d = b["rtl" === a.lang.dir ?
  13381. "left" : "right"], e = b.bottom;
  13382. a.contextMenu.open(a.document.getBody().getParent(), null, d, e)
  13383. }
  13384. });
  13385. a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu");
  13386. a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu")
  13387. }
  13388. });
  13389. (function () {
  13390. function k(a, b, e, d) {
  13391. var c = new CKEDITOR.dom.walker(a);
  13392. if (a = a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) if (e(a), d) return;
  13393. for (; a = c.next();) if (a = a.getAscendant(b, !0)) if (e(a), d) break
  13394. }
  13395. function u(a, b) {
  13396. var e = {ul: "ol", ol: "ul"};
  13397. return -1 !== l(b, function (b) {
  13398. return b.element === a || b.element === e[a]
  13399. })
  13400. }
  13401. function q(a) {
  13402. this.styles = null;
  13403. this.sticky = !1;
  13404. this.editor = a;
  13405. this.filter = new CKEDITOR.filter(a, a.config.copyFormatting_allowRules);
  13406. !0 === a.config.copyFormatting_allowRules && (this.filter.disabled =
  13407. !0);
  13408. a.config.copyFormatting_disallowRules && this.filter.disallow(a.config.copyFormatting_disallowRules)
  13409. }
  13410. var l = CKEDITOR.tools.indexOf, r = CKEDITOR.tools.getMouseButton, t = !1;
  13411. CKEDITOR.plugins.add("copyformatting", {
  13412. lang: "az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn",
  13413. icons: "copyformatting",
  13414. hidpi: !0,
  13415. init: function (a) {
  13416. var b = CKEDITOR.plugins.copyformatting;
  13417. b._addScreenReaderContainer();
  13418. t || (CKEDITOR.document.appendStyleSheet(this.path + "styles/copyformatting.css"), t = !0);
  13419. a.addContentsCss && a.addContentsCss(this.path +
  13420. "styles/copyformatting.css");
  13421. a.copyFormatting = new b.state(a);
  13422. a.addCommand("copyFormatting", b.commands.copyFormatting);
  13423. a.addCommand("applyFormatting", b.commands.applyFormatting);
  13424. a.ui.addButton("CopyFormatting", {
  13425. label: a.lang.copyformatting.label,
  13426. command: "copyFormatting",
  13427. toolbar: "cleanup,0"
  13428. });
  13429. a.on("contentDom", function () {
  13430. var b = a.getCommand("copyFormatting"), d = a.editable(), c = d.isInline() ? d : a.document,
  13431. f = a.ui.get("CopyFormatting");
  13432. d.attachListener(c, "mouseup", function (d) {
  13433. r(d) === CKEDITOR.MOUSE_BUTTON_LEFT &&
  13434. b.state === CKEDITOR.TRISTATE_ON && a.execCommand("applyFormatting")
  13435. });
  13436. d.attachListener(CKEDITOR.document, "mouseup", function (c) {
  13437. r(c) !== CKEDITOR.MOUSE_BUTTON_LEFT || b.state !== CKEDITOR.TRISTATE_ON || d.contains(c.data.getTarget()) || a.execCommand("copyFormatting")
  13438. });
  13439. f && (c = CKEDITOR.document.getById(f._.id), d.attachListener(c, "dblclick", function () {
  13440. a.execCommand("copyFormatting", {sticky: !0})
  13441. }), d.attachListener(c, "mouseup", function (a) {
  13442. a.data.stopPropagation()
  13443. }))
  13444. });
  13445. a.config.copyFormatting_keystrokeCopy && a.setKeystroke(a.config.copyFormatting_keystrokeCopy,
  13446. "copyFormatting");
  13447. a.on("key", function (b) {
  13448. var d = a.getCommand("copyFormatting");
  13449. b = b.data.domEvent;
  13450. b.getKeystroke && 27 === b.getKeystroke() && d.state === CKEDITOR.TRISTATE_ON && a.execCommand("copyFormatting")
  13451. });
  13452. a.copyFormatting.on("extractFormatting", function (e) {
  13453. var d = e.data.element;
  13454. if (d.contains(a.editable()) || d.equals(a.editable())) return e.cancel();
  13455. d = b._convertElementToStyleDef(d);
  13456. if (!a.copyFormatting.filter.check(new CKEDITOR.style(d), !0, !0)) return e.cancel();
  13457. e.data.styleDef = d
  13458. });
  13459. a.copyFormatting.on("applyFormatting",
  13460. function (e) {
  13461. if (!e.data.preventFormatStripping) {
  13462. var d = e.data.range, c = b._extractStylesFromRange(a, d), f = b._determineContext(d), g, h;
  13463. if (a.copyFormatting._isContextAllowed(f)) for (h = 0; h < c.length; h++) f = c[h], g = d.createBookmark(), -1 === l(b.preservedElements, f.element) ? CKEDITOR.env.webkit && !CKEDITOR.env.chrome ? c[h].removeFromRange(e.data.range, e.editor) : c[h].remove(e.editor) : u(f.element, e.data.styles) && b._removeStylesFromElementInRange(d, f.element), d.moveToBookmark(g)
  13464. }
  13465. });
  13466. a.copyFormatting.on("applyFormatting",
  13467. function (b) {
  13468. var d = CKEDITOR.plugins.copyformatting, c = d._determineContext(b.data.range);
  13469. "list" === c && a.copyFormatting._isContextAllowed("list") ? d._applyStylesToListContext(b.editor, b.data.range, b.data.styles) : "table" === c && a.copyFormatting._isContextAllowed("table") ? d._applyStylesToTableContext(b.editor, b.data.range, b.data.styles) : a.copyFormatting._isContextAllowed("text") && d._applyStylesToTextContext(b.editor, b.data.range, b.data.styles)
  13470. }, null, null, 999)
  13471. }
  13472. });
  13473. q.prototype._isContextAllowed = function (a) {
  13474. var b =
  13475. this.editor.config.copyFormatting_allowedContexts;
  13476. return !0 === b || -1 !== l(b, a)
  13477. };
  13478. CKEDITOR.event.implementOn(q.prototype);
  13479. CKEDITOR.plugins.copyformatting = {
  13480. state: q,
  13481. inlineBoundary: "h1 h2 h3 h4 h5 h6 p div".split(" "),
  13482. excludedAttributes: ["id", "style", "href", "data-cke-saved-href", "dir"],
  13483. elementsForInlineTransform: ["li"],
  13484. excludedElementsFromInlineTransform: ["table", "thead", "tbody", "ul", "ol"],
  13485. excludedAttributesFromInlineTransform: ["value", "type"],
  13486. preservedElements: "ul ol li td th tr thead tbody table".split(" "),
  13487. breakOnElements: ["ul", "ol", "table"],
  13488. _initialKeystrokePasteCommand: null,
  13489. commands: {
  13490. copyFormatting: {
  13491. exec: function (a, b) {
  13492. var e = CKEDITOR.plugins.copyformatting, d = a.copyFormatting,
  13493. c = b ? "keystrokeHandler" == b.from : !1, f = b ? b.sticky || c : !1,
  13494. g = e._getCursorContainer(a), h = CKEDITOR.document.getDocumentElement();
  13495. if (this.state === CKEDITOR.TRISTATE_ON) return d.styles = null, d.sticky = !1, g.removeClass("cke_copyformatting_active"), h.removeClass("cke_copyformatting_disabled"), h.removeClass("cke_copyformatting_tableresize_cursor"),
  13496. e._putScreenReaderMessage(a, "canceled"), e._detachPasteKeystrokeHandler(a), this.setState(CKEDITOR.TRISTATE_OFF);
  13497. d.styles = e._extractStylesFromElement(a, a.elementPath().lastElement);
  13498. this.setState(CKEDITOR.TRISTATE_ON);
  13499. c || (g.addClass("cke_copyformatting_active"), h.addClass("cke_copyformatting_tableresize_cursor"), a.config.copyFormatting_outerCursor && h.addClass("cke_copyformatting_disabled"));
  13500. d.sticky = f;
  13501. e._putScreenReaderMessage(a, "copied");
  13502. e._attachPasteKeystrokeHandler(a)
  13503. }
  13504. }, applyFormatting: {
  13505. editorFocus: CKEDITOR.env.ie &&
  13506. !CKEDITOR.env.edge ? !1 : !0, exec: function (a, b) {
  13507. var e = a.getCommand("copyFormatting"), d = b ? "keystrokeHandler" == b.from : !1,
  13508. c = CKEDITOR.plugins.copyformatting, f = a.copyFormatting, g = c._getCursorContainer(a),
  13509. h = CKEDITOR.document.getDocumentElement();
  13510. if (d && !f.styles) return c._putScreenReaderMessage(a, "failed"), c._detachPasteKeystrokeHandler(a), !1;
  13511. d = c._applyFormat(a, f.styles);
  13512. f.sticky || (f.styles = null, g.removeClass("cke_copyformatting_active"), h.removeClass("cke_copyformatting_disabled"), h.removeClass("cke_copyformatting_tableresize_cursor"),
  13513. e.setState(CKEDITOR.TRISTATE_OFF), c._detachPasteKeystrokeHandler(a));
  13514. c._putScreenReaderMessage(a, d ? "applied" : "canceled")
  13515. }
  13516. }
  13517. },
  13518. _getCursorContainer: function (a) {
  13519. return a.elementMode === CKEDITOR.ELEMENT_MODE_INLINE ? a.editable() : a.editable().getParent()
  13520. },
  13521. _convertElementToStyleDef: function (a) {
  13522. var b = CKEDITOR.tools, e = a.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes),
  13523. b = b.parseCssText(a.getAttribute("style"), !0, !0);
  13524. return {element: a.getName(), type: CKEDITOR.STYLE_INLINE, attributes: e, styles: b}
  13525. },
  13526. _extractStylesFromElement: function (a, b) {
  13527. var e = {}, d = [];
  13528. do if (b.type === CKEDITOR.NODE_ELEMENT && !b.hasAttribute("data-cke-bookmark") && (e.element = b, a.copyFormatting.fire("extractFormatting", e, a) && e.styleDef && d.push(new CKEDITOR.style(e.styleDef)), b.getName && -1 !== l(CKEDITOR.plugins.copyformatting.breakOnElements, b.getName()))) break; while ((b = b.getParent()) && b.type === CKEDITOR.NODE_ELEMENT);
  13529. return d
  13530. },
  13531. _extractStylesFromRange: function (a, b) {
  13532. for (var e = [], d = new CKEDITOR.dom.walker(b), c; c = d.next();) e = e.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a,
  13533. c));
  13534. return e
  13535. },
  13536. _removeStylesFromElementInRange: function (a, b) {
  13537. for (var e = -1 !== l(["ol", "ul", "table"], b), d = new CKEDITOR.dom.walker(a), c; c = d.next();) if (c = c.getAscendant(b, !0)) if (c.removeAttributes(c.getAttributes()), e) break
  13538. },
  13539. _getSelectedWordOffset: function (a) {
  13540. function b(a, b) {
  13541. return a[b ? "getPrevious" : "getNext"](function (a) {
  13542. return a.type !== CKEDITOR.NODE_COMMENT
  13543. })
  13544. }
  13545. function e(a) {
  13546. return a.type == CKEDITOR.NODE_ELEMENT ? (a = a.getHtml().replace(/<span.*?>&nbsp;<\/span>/g, ""), a.replace(/<.*?>/g, "")) : a.getText()
  13547. }
  13548. function d(a,
  13549. c) {
  13550. var f = a, g = /\s/g, h = "p br ol ul li td th div caption body".split(" "), m = !1, k = !1, p, n;
  13551. do {
  13552. for (p = b(f, c); !p && f.getParent();) {
  13553. f = f.getParent();
  13554. if (-1 !== l(h, f.getName())) {
  13555. k = m = !0;
  13556. break
  13557. }
  13558. p = b(f, c)
  13559. }
  13560. if (p && p.getName && -1 !== l(h, p.getName())) {
  13561. m = !0;
  13562. break
  13563. }
  13564. f = p
  13565. } while (f && f.getStyle && ("none" == f.getStyle("display") || !f.getText()));
  13566. for (f || (f = a); f.type !== CKEDITOR.NODE_TEXT;) f = !m || c || k ? f.getChild(0) : f.getChild(f.getChildCount() - 1);
  13567. for (h = e(f); null != (k = g.exec(h)) && (n = k.index, c);) ;
  13568. if ("number" !== typeof n && !m) return d(f, c);
  13569. if (m) c ?
  13570. n = 0 : (g = /([\.\b]*$)/, n = (k = g.exec(h)) ? k.index : h.length); else if (c && (n += 1, n > h.length)) return d(f);
  13571. return {node: f, offset: n}
  13572. }
  13573. var c = /\b\w+\b/ig, f, g, h, m, k;
  13574. h = m = k = a.startContainer;
  13575. for (f = e(h); null != (g = c.exec(f));) if (g.index + g[0].length >= a.startOffset) return a = g.index, c = g.index + g[0].length, 0 === g.index && (g = d(h, !0), m = g.node, a = g.offset), c >= f.length && (f = d(h), k = f.node, c = f.offset), {
  13576. startNode: m,
  13577. startOffset: a,
  13578. endNode: k,
  13579. endOffset: c
  13580. };
  13581. return null
  13582. },
  13583. _filterStyles: function (a) {
  13584. var b = CKEDITOR.tools.isEmpty, e = [], d, c;
  13585. for (c = 0; c <
  13586. a.length; c++) d = a[c]._.definition, -1 !== CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary, d.element) && (d.element = a[c].element = "span"), "span" === d.element && b(d.attributes) && b(d.styles) || e.push(a[c]);
  13587. return e
  13588. },
  13589. _determineContext: function (a) {
  13590. function b(b) {
  13591. var d = new CKEDITOR.dom.walker(a), c;
  13592. if (a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) return !0;
  13593. for (; c = d.next();) if (c.getAscendant(b, !0)) return !0
  13594. }
  13595. return b({ul: 1, ol: 1}) ? "list" : b("table") ? "table" : "text"
  13596. },
  13597. _applyStylesToTextContext: function (a,
  13598. b, e) {
  13599. var d = CKEDITOR.plugins.copyformatting, c = d.excludedAttributesFromInlineTransform, f, g;
  13600. CKEDITOR.env.webkit && !CKEDITOR.env.chrome && a.getSelection().selectRanges([b]);
  13601. for (f = 0; f < e.length; f++) if (b = e[f], -1 === l(d.excludedElementsFromInlineTransform, b.element)) {
  13602. if (-1 !== l(d.elementsForInlineTransform, b.element)) for (b.element = b._.definition.element = "span", g = 0; g < c.length; g++) b._.definition.attributes[c[g]] && delete b._.definition.attributes[c[g]];
  13603. b.apply(a)
  13604. }
  13605. },
  13606. _applyStylesToListContext: function (a, b, e) {
  13607. var d,
  13608. c, f;
  13609. for (f = 0; f < e.length; f++) d = e[f], c = b.createBookmark(), "ol" === d.element || "ul" === d.element ? k(b, {
  13610. ul: 1,
  13611. ol: 1
  13612. }, function (a) {
  13613. var b = d;
  13614. a.getName() !== b.element && a.renameNode(b.element);
  13615. b.applyToObject(a)
  13616. }, !0) : "li" === d.element ? k(b, "li", function (a) {
  13617. d.applyToObject(a)
  13618. }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [d]), b.moveToBookmark(c)
  13619. },
  13620. _applyStylesToTableContext: function (a, b, e) {
  13621. function d(a, b) {
  13622. a.getName() !== b.element && (b = b.getDefinition(), b.element = a.getName(), b = new CKEDITOR.style(b));
  13623. b.applyToObject(a)
  13624. }
  13625. var c, f, g;
  13626. for (g = 0; g < e.length; g++) c = e[g], f = b.createBookmark(), -1 !== l(["table", "tr"], c.element) ? k(b, c.element, function (a) {
  13627. c.applyToObject(a)
  13628. }) : -1 !== l(["td", "th"], c.element) ? k(b, {td: 1, th: 1}, function (a) {
  13629. d(a, c)
  13630. }) : -1 !== l(["thead", "tbody"], c.element) ? k(b, {thead: 1, tbody: 1}, function (a) {
  13631. d(a, c)
  13632. }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [c]), b.moveToBookmark(f)
  13633. },
  13634. _applyFormat: function (a, b) {
  13635. var e = a.getSelection().getRanges()[0], d = CKEDITOR.plugins.copyformatting, c, f;
  13636. if (!e) return !1;
  13637. if (e.collapsed) {
  13638. f =
  13639. a.getSelection().createBookmarks();
  13640. if (!(c = d._getSelectedWordOffset(e))) return;
  13641. e = a.createRange();
  13642. e.setStart(c.startNode, c.startOffset);
  13643. e.setEnd(c.endNode, c.endOffset);
  13644. e.select()
  13645. }
  13646. b = d._filterStyles(b);
  13647. if (!a.copyFormatting.fire("applyFormatting", {
  13648. styles: b,
  13649. range: e,
  13650. preventFormatStripping: !1
  13651. }, a)) return !1;
  13652. f && a.getSelection().selectBookmarks(f);
  13653. return !0
  13654. },
  13655. _putScreenReaderMessage: function (a, b) {
  13656. var e = this._getScreenReaderContainer();
  13657. e && e.setText(a.lang.copyformatting.notification[b])
  13658. },
  13659. _addScreenReaderContainer: function () {
  13660. if (this._getScreenReaderContainer()) return this._getScreenReaderContainer();
  13661. if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) return CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_screen_reader_only cke_copyformatting_notification"\x3e\x3cdiv aria-live\x3d"polite"\x3e\x3c/div\x3e\x3c/div\x3e')).getChild(0)
  13662. },
  13663. _getScreenReaderContainer: function () {
  13664. if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) return CKEDITOR.document.getBody().findOne(".cke_copyformatting_notification div[aria-live]")
  13665. },
  13666. _attachPasteKeystrokeHandler: function (a) {
  13667. var b =
  13668. a.config.copyFormatting_keystrokePaste;
  13669. b && (this._initialKeystrokePasteCommand = a.keystrokeHandler.keystrokes[b], a.setKeystroke(b, "applyFormatting"))
  13670. },
  13671. _detachPasteKeystrokeHandler: function (a) {
  13672. var b = a.config.copyFormatting_keystrokePaste;
  13673. b && a.setKeystroke(b, this._initialKeystrokePasteCommand || !1)
  13674. }
  13675. };
  13676. CKEDITOR.config.copyFormatting_outerCursor = !0;
  13677. CKEDITOR.config.copyFormatting_allowRules = "b s u i em strong span p div td th ol ul li(*)[*]{*}";
  13678. CKEDITOR.config.copyFormatting_disallowRules = "*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)";
  13679. CKEDITOR.config.copyFormatting_allowedContexts = !0;
  13680. CKEDITOR.config.copyFormatting_keystrokeCopy = CKEDITOR.CTRL + CKEDITOR.SHIFT + 67;
  13681. CKEDITOR.config.copyFormatting_keystrokePaste = CKEDITOR.CTRL + CKEDITOR.SHIFT + 86
  13682. })();
  13683. (function () {
  13684. CKEDITOR.plugins.add("div", {
  13685. requires: "dialog", init: function (a) {
  13686. if (!a.blockless) {
  13687. var c = a.lang.div, b = "div(*)";
  13688. CKEDITOR.dialog.isTabEnabled(a, "editdiv", "advanced") && (b += ";div[dir,id,lang,title]{*}");
  13689. a.addCommand("creatediv", new CKEDITOR.dialogCommand("creatediv", {
  13690. allowedContent: b,
  13691. requiredContent: "div",
  13692. contextSensitive: !0,
  13693. contentTransformations: [["div: alignmentToStyle"]],
  13694. refresh: function (a, c) {
  13695. this.setState("div" in (a.config.div_wrapTable ? c.root : c.blockLimit).getDtd() ? CKEDITOR.TRISTATE_OFF :
  13696. CKEDITOR.TRISTATE_DISABLED)
  13697. }
  13698. }));
  13699. a.addCommand("editdiv", new CKEDITOR.dialogCommand("editdiv", {requiredContent: "div"}));
  13700. a.addCommand("removediv", {
  13701. requiredContent: "div", exec: function (a) {
  13702. function c(b) {
  13703. (b = CKEDITOR.plugins.div.getSurroundDiv(a, b)) && !b.data("cke-div-added") && (f.push(b), b.data("cke-div-added"))
  13704. }
  13705. for (var b = a.getSelection(), g = b && b.getRanges(), e, h = b.createBookmarks(), f = [], d = 0; d < g.length; d++) e = g[d], e.collapsed ? c(b.getStartElement()) : (e = new CKEDITOR.dom.walker(e), e.evaluator = c, e.lastForward());
  13706. for (d = 0; d < f.length; d++) f[d].remove(!0);
  13707. b.selectBookmarks(h)
  13708. }
  13709. });
  13710. a.ui.addButton && a.ui.addButton("CreateDiv", {
  13711. label: c.toolbar,
  13712. command: "creatediv",
  13713. toolbar: "blocks,50"
  13714. });
  13715. a.addMenuItems && (a.addMenuItems({
  13716. editdiv: {
  13717. label: c.edit,
  13718. command: "editdiv",
  13719. group: "div",
  13720. order: 1
  13721. }, removediv: {label: c.remove, command: "removediv", group: "div", order: 5}
  13722. }), a.contextMenu && a.contextMenu.addListener(function (b) {
  13723. return !b || b.isReadOnly() ? null : CKEDITOR.plugins.div.getSurroundDiv(a) ? {
  13724. editdiv: CKEDITOR.TRISTATE_OFF,
  13725. removediv: CKEDITOR.TRISTATE_OFF
  13726. } :
  13727. null
  13728. }));
  13729. CKEDITOR.dialog.add("creatediv", this.path + "dialogs/div.js");
  13730. CKEDITOR.dialog.add("editdiv", this.path + "dialogs/div.js")
  13731. }
  13732. }
  13733. });
  13734. CKEDITOR.plugins.div = {
  13735. getSurroundDiv: function (a, c) {
  13736. var b = a.elementPath(c);
  13737. return a.elementPath(b.blockLimit).contains(function (a) {
  13738. return a.is("div") && !a.isReadOnly()
  13739. }, 1)
  13740. }
  13741. }
  13742. })();
  13743. CKEDITOR.plugins.add("resize", {
  13744. init: function (b) {
  13745. function f(d) {
  13746. var e = c.width, m = c.height, f = e + (d.data.$.screenX - n.x) * ("rtl" == g ? -1 : 1);
  13747. d = m + (d.data.$.screenY - n.y);
  13748. h && (e = Math.max(a.resize_minWidth, Math.min(f, a.resize_maxWidth)));
  13749. p && (m = Math.max(a.resize_minHeight, Math.min(d, a.resize_maxHeight)));
  13750. b.resize(h ? e : null, m)
  13751. }
  13752. function k() {
  13753. CKEDITOR.document.removeListener("mousemove", f);
  13754. CKEDITOR.document.removeListener("mouseup", k);
  13755. b.document && (b.document.removeListener("mousemove", f), b.document.removeListener("mouseup",
  13756. k))
  13757. }
  13758. var a = b.config, r = b.ui.spaceId("resizer"), g = b.element ? b.element.getDirection(1) : "ltr";
  13759. !a.resize_dir && (a.resize_dir = "vertical");
  13760. void 0 === a.resize_maxWidth && (a.resize_maxWidth = 3E3);
  13761. void 0 === a.resize_maxHeight && (a.resize_maxHeight = 3E3);
  13762. void 0 === a.resize_minWidth && (a.resize_minWidth = 750);
  13763. void 0 === a.resize_minHeight && (a.resize_minHeight = 250);
  13764. if (!1 !== a.resize_enabled) {
  13765. var l = null, n, c,
  13766. h = ("both" == a.resize_dir || "horizontal" == a.resize_dir) && a.resize_minWidth != a.resize_maxWidth,
  13767. p = ("both" == a.resize_dir || "vertical" ==
  13768. a.resize_dir) && a.resize_minHeight != a.resize_maxHeight,
  13769. q = CKEDITOR.tools.addFunction(function (d) {
  13770. l || (l = b.getResizable());
  13771. c = {width: l.$.offsetWidth || 0, height: l.$.offsetHeight || 0};
  13772. n = {x: d.screenX, y: d.screenY};
  13773. a.resize_minWidth > c.width && (a.resize_minWidth = c.width);
  13774. a.resize_minHeight > c.height && (a.resize_minHeight = c.height);
  13775. CKEDITOR.document.on("mousemove", f);
  13776. CKEDITOR.document.on("mouseup", k);
  13777. b.document && (b.document.on("mousemove", f), b.document.on("mouseup", k));
  13778. d.preventDefault && d.preventDefault()
  13779. });
  13780. b.on("destroy",
  13781. function () {
  13782. CKEDITOR.tools.removeFunction(q)
  13783. });
  13784. b.on("uiSpace", function (a) {
  13785. if ("bottom" == a.data.space) {
  13786. var e = "";
  13787. h && !p && (e = " cke_resizer_horizontal");
  13788. !h && p && (e = " cke_resizer_vertical");
  13789. var c = '\x3cspan id\x3d"' + r + '" class\x3d"cke_resizer' + e + " cke_resizer_" + g + '" title\x3d"' + CKEDITOR.tools.htmlEncode(b.lang.common.resize) + '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + q + ', event)"\x3e' + ("ltr" == g ? "◢" : "◣") + "\x3c/span\x3e";
  13790. "ltr" == g && "ltr" == e ? a.data.html += c : a.data.html = c + a.data.html
  13791. }
  13792. }, b, null, 100);
  13793. b.on("maximize",
  13794. function (a) {
  13795. b.ui.space("resizer")[a.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]()
  13796. })
  13797. }
  13798. }
  13799. });
  13800. (function () {
  13801. function q(a, c) {
  13802. function k(b) {
  13803. b = h.list[b];
  13804. var e;
  13805. b.equals(a.editable()) || "true" == b.getAttribute("contenteditable") ? (e = a.createRange(), e.selectNodeContents(b), e = e.select()) : (e = a.getSelection(), e.selectElement(b));
  13806. CKEDITOR.env.ie && a.fire("selectionChange", {selection: e, path: new CKEDITOR.dom.elementPath(b)});
  13807. a.focus()
  13808. }
  13809. function l() {
  13810. m && m.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  13811. delete h.list
  13812. }
  13813. var n = a.ui.spaceId("path"), m, h = a._.elementsPath, q = h.idBase;
  13814. c.html += '\x3cspan id\x3d"' +
  13815. n + '_label" class\x3d"cke_voice_label"\x3e' + a.lang.elementspath.eleLabel + '\x3c/span\x3e\x3cspan id\x3d"' + n + '" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"' + n + '_label"\x3e\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e\x3c/span\x3e';
  13816. a.on("uiReady", function () {
  13817. var b = a.ui.space("path");
  13818. b && a.focusManager.add(b, 1)
  13819. });
  13820. h.onClick = k;
  13821. var v = CKEDITOR.tools.addFunction(k), w = CKEDITOR.tools.addFunction(function (b, e) {
  13822. var g = h.idBase, d;
  13823. e = new CKEDITOR.dom.event(e);
  13824. d = "rtl" == a.lang.dir;
  13825. switch (e.getKeystroke()) {
  13826. case d ?
  13827. 39 : 37:
  13828. case 9:
  13829. return (d = CKEDITOR.document.getById(g + (b + 1))) || (d = CKEDITOR.document.getById(g + "0")), d.focus(), !1;
  13830. case d ? 37 : 39:
  13831. case CKEDITOR.SHIFT + 9:
  13832. return (d = CKEDITOR.document.getById(g + (b - 1))) || (d = CKEDITOR.document.getById(g + (h.list.length - 1))), d.focus(), !1;
  13833. case 27:
  13834. return a.focus(), !1;
  13835. case 13:
  13836. case 32:
  13837. return k(b), !1
  13838. }
  13839. return !0
  13840. });
  13841. a.on("selectionChange", function (b) {
  13842. for (var e = [], g = h.list = [], d = [], c = h.filters, p = !0, k = b.data.path.elements, u = k.length; u--;) {
  13843. var f = k[u], r = 0;
  13844. b = f.data("cke-display-name") ? f.data("cke-display-name") :
  13845. f.data("cke-real-element-type") ? f.data("cke-real-element-type") : f.getName();
  13846. (p = f.hasAttribute("contenteditable") ? "true" == f.getAttribute("contenteditable") : p) || f.hasAttribute("contenteditable") || (r = 1);
  13847. for (var t = 0; t < c.length; t++) {
  13848. var l = c[t](f, b);
  13849. if (!1 === l) {
  13850. r = 1;
  13851. break
  13852. }
  13853. b = l || b
  13854. }
  13855. r || (g.unshift(f), d.unshift(b))
  13856. }
  13857. g = g.length;
  13858. for (c = 0; c < g; c++) b = d[c], p = a.lang.elementspath.eleTitle.replace(/%1/, b), b = x.output({
  13859. id: q + c,
  13860. label: p,
  13861. text: b,
  13862. jsTitle: "javascript:void('" + b + "')",
  13863. index: c,
  13864. keyDownFn: w,
  13865. clickFn: v
  13866. }), e.unshift(b);
  13867. m ||
  13868. (m = CKEDITOR.document.getById(n));
  13869. d = m;
  13870. d.setHtml(e.join("") + '\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  13871. a.fire("elementsPathUpdate", {space: d})
  13872. });
  13873. a.on("readOnly", l);
  13874. a.on("contentDomUnload", l);
  13875. a.addCommand("elementsPathFocus", y.toolbarFocus);
  13876. a.setKeystroke(CKEDITOR.ALT + 122, "elementsPathFocus")
  13877. }
  13878. var y = {
  13879. toolbarFocus: {
  13880. editorFocus: !1, readOnly: 1, exec: function (a) {
  13881. (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air)
  13882. }
  13883. }
  13884. }, c = "";
  13885. CKEDITOR.env.gecko &&
  13886. CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  13887. CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  13888. var x = CKEDITOR.addTemplate("pathItem", '\x3ca id\x3d"{id}" href\x3d"{jsTitle}" tabindex\x3d"-1" class\x3d"cke_path_item" title\x3d"{label}"' + c + ' 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');
  13889. CKEDITOR.plugins.add("elementspath", {
  13890. init: function (a) {
  13891. a._.elementsPath = {idBase: "cke_elementspath_" + CKEDITOR.tools.getNextNumber() + "_", filters: []};
  13892. a.on("uiSpace", function (c) {
  13893. "bottom" == c.data.space && q(a, c.data)
  13894. })
  13895. }
  13896. })
  13897. })();
  13898. (function () {
  13899. function x(a, e, b) {
  13900. b = a.config.forceEnterMode || b;
  13901. if ("wysiwyg" == a.mode) {
  13902. e || (e = a.activeEnterMode);
  13903. var l = a.elementPath();
  13904. l && !l.isContextFor("p") && (e = CKEDITOR.ENTER_BR, b = 1);
  13905. a.fire("saveSnapshot");
  13906. e == CKEDITOR.ENTER_BR ? u(a, e, null, b) : r(a, e, null, b);
  13907. a.fire("saveSnapshot")
  13908. }
  13909. }
  13910. function y(a) {
  13911. a = a.getSelection().getRanges(!0);
  13912. for (var e = a.length - 1; 0 < e; e--) a[e].deleteContents();
  13913. return a[0]
  13914. }
  13915. function z(a) {
  13916. var e = a.startContainer.getAscendant(function (a) {
  13917. return a.type == CKEDITOR.NODE_ELEMENT && "true" == a.getAttribute("contenteditable")
  13918. },
  13919. !0);
  13920. if (a.root.equals(e)) return a;
  13921. e = new CKEDITOR.dom.range(e);
  13922. e.moveToRange(a);
  13923. return e
  13924. }
  13925. CKEDITOR.plugins.add("enterkey", {
  13926. init: function (a) {
  13927. a.addCommand("enter", {
  13928. modes: {wysiwyg: 1}, editorFocus: !1, exec: function (a) {
  13929. x(a)
  13930. }
  13931. });
  13932. a.addCommand("shiftEnter", {
  13933. modes: {wysiwyg: 1}, editorFocus: !1, exec: function (a) {
  13934. x(a, a.activeShiftEnterMode, 1)
  13935. }
  13936. });
  13937. a.setKeystroke([[13, "enter"], [CKEDITOR.SHIFT + 13, "shiftEnter"]])
  13938. }
  13939. });
  13940. var A = CKEDITOR.dom.walker.whitespaces(), B = CKEDITOR.dom.walker.bookmark(), v, u, r, w;
  13941. CKEDITOR.plugins.enterkey =
  13942. {
  13943. enterBlock: function (a, e, b, l) {
  13944. function n(a) {
  13945. var b;
  13946. if (a === CKEDITOR.ENTER_BR || -1 === CKEDITOR.tools.indexOf(["td", "th"], p.lastElement.getName()) || 1 !== p.lastElement.getChildCount()) return !1;
  13947. a = p.lastElement.getChild(0).clone(!0);
  13948. (b = a.getBogus()) && b.remove();
  13949. return a.getText().length ? !1 : !0
  13950. }
  13951. if (b = b || y(a)) {
  13952. b = z(b);
  13953. var g = b.document, f = b.checkStartOfBlock(), k = b.checkEndOfBlock(),
  13954. p = a.elementPath(b.startContainer), c = p.block, m = e == CKEDITOR.ENTER_DIV ? "div" : "p",
  13955. d;
  13956. if (c && f && k) {
  13957. f = c.getParent();
  13958. if (f.is("li") && 1 < f.getChildCount()) {
  13959. g =
  13960. new CKEDITOR.dom.element("li");
  13961. d = a.createRange();
  13962. g.insertAfter(f);
  13963. c.remove();
  13964. d.setStart(g, 0);
  13965. a.getSelection().selectRanges([d]);
  13966. return
  13967. }
  13968. if (c.is("li") || c.getParent().is("li")) {
  13969. c.is("li") || (c = c.getParent(), f = c.getParent());
  13970. d = f.getParent();
  13971. b = !c.hasPrevious();
  13972. var h = !c.hasNext();
  13973. l = a.getSelection();
  13974. var m = l.createBookmarks(), t = c.getDirection(1), k = c.getAttribute("class"),
  13975. q = c.getAttribute("style"), r = d.getDirection(1) != t;
  13976. a = a.enterMode != CKEDITOR.ENTER_BR || r || q || k;
  13977. if (d.is("li")) b || h ? (b && h && f.remove(), c[h ? "insertAfter" :
  13978. "insertBefore"](d)) : c.breakParent(d); else {
  13979. if (a) if (p.block.is("li") ? (d = g.createElement(e == CKEDITOR.ENTER_P ? "p" : "div"), r && d.setAttribute("dir", t), q && d.setAttribute("style", q), k && d.setAttribute("class", k), c.moveChildren(d)) : d = p.block, b || h) d[b ? "insertBefore" : "insertAfter"](f); else c.breakParent(f), d.insertAfter(f); else if (c.appendBogus(!0), b || h) for (; g = c[b ? "getFirst" : "getLast"]();) g[b ? "insertBefore" : "insertAfter"](f); else for (c.breakParent(f); g = c.getLast();) g.insertAfter(f);
  13980. c.remove()
  13981. }
  13982. l.selectBookmarks(m);
  13983. return
  13984. }
  13985. if (c && c.getParent().is("blockquote")) {
  13986. c.breakParent(c.getParent());
  13987. c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getPrevious().remove();
  13988. c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getNext().remove();
  13989. b.moveToElementEditStart(c);
  13990. b.select();
  13991. return
  13992. }
  13993. } else if (c && c.is("pre") && !k) {
  13994. u(a, e, b, l);
  13995. return
  13996. }
  13997. if (q = b.splitBlock(m)) {
  13998. a = q.previousBlock;
  13999. c = q.nextBlock;
  14000. f = q.wasStartOfBlock;
  14001. k = q.wasEndOfBlock;
  14002. c ? (h = c.getParent(), h.is("li") && (c.breakParent(h), c.move(c.getNext(), 1))) : a && (h = a.getParent()) &&
  14003. h.is("li") && (a.breakParent(h), h = a.getNext(), b.moveToElementEditStart(h), a.move(a.getPrevious()));
  14004. if (f || k) if (n(e)) b.moveToElementEditStart(b.getTouchedStartNode()); else {
  14005. if (a) {
  14006. if (a.is("li") || !w.test(a.getName()) && !a.is("pre")) d = a.clone()
  14007. } else c && (d = c.clone());
  14008. d ? l && !d.is("li") && d.renameNode(m) : h && h.is("li") ? d = h : (d = g.createElement(m), a && (t = a.getDirection()) && d.setAttribute("dir", t));
  14009. if (g = q.elementPath) for (e = 0, l = g.elements.length; e < l; e++) {
  14010. m = g.elements[e];
  14011. if (m.equals(g.block) || m.equals(g.blockLimit)) break;
  14012. CKEDITOR.dtd.$removeEmpty[m.getName()] && (m = m.clone(), d.moveChildren(m), d.append(m))
  14013. }
  14014. d.appendBogus();
  14015. d.getParent() || b.insertNode(d);
  14016. d.is("li") && d.removeAttribute("value");
  14017. !CKEDITOR.env.ie || !f || k && a.getChildCount() || (b.moveToElementEditStart(k ? a : d), b.select());
  14018. b.moveToElementEditStart(f && !k ? c : d)
  14019. } else c.is("li") && (d = b.clone(), d.selectNodeContents(c), d = new CKEDITOR.dom.walker(d), d.evaluator = function (a) {
  14020. return !(B(a) || A(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in
  14021. CKEDITOR.dtd.$empty))
  14022. }, (h = d.next()) && h.type == CKEDITOR.NODE_ELEMENT && h.is("ul", "ol") && (CKEDITOR.env.needsBrFiller ? g.createElement("br") : g.createText(" ")).insertBefore(h)), c && b.moveToElementEditStart(c);
  14023. b.select();
  14024. b.scrollIntoView()
  14025. }
  14026. }
  14027. }, enterBr: function (a, e, b, l) {
  14028. if (b = b || y(a)) {
  14029. var n = b.document, g = b.checkEndOfBlock(),
  14030. f = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()), k = f.block,
  14031. p = k && f.block.getName();
  14032. l || "li" != p ? (!l && g && w.test(p) ? (g = k.getDirection()) ? (n = n.createElement("div"), n.setAttribute("dir",
  14033. g), n.insertAfter(k), b.setStart(n, 0)) : (n.createElement("br").insertAfter(k), CKEDITOR.env.gecko && n.createText("").insertAfter(k), b.setStartAt(k.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)) : (a = "pre" == p && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? n.createText("\r") : n.createElement("br"), b.deleteContents(), b.insertNode(a), CKEDITOR.env.needsBrFiller ? (n.createText("").insertAfter(a), g && (k || f.blockLimit).appendBogus(), a.getNext().$.nodeValue = "", b.setStartAt(a.getNext(),
  14034. CKEDITOR.POSITION_AFTER_START)) : b.setStartAt(a, CKEDITOR.POSITION_AFTER_END)), b.collapse(!0), b.select(), b.scrollIntoView()) : r(a, e, b, l)
  14035. }
  14036. }
  14037. };
  14038. v = CKEDITOR.plugins.enterkey;
  14039. u = v.enterBr;
  14040. r = v.enterBlock;
  14041. w = /^h[1-6]$/
  14042. })();
  14043. (function () {
  14044. function k(a, f) {
  14045. var g = {}, c = [], e = {nbsp: " ", shy: "­", gt: "\x3e", lt: "\x3c", amp: "\x26", apos: "'", quot: '"'};
  14046. a = a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function (a, b) {
  14047. var d = f ? "\x26" + b + ";" : e[b];
  14048. g[d] = f ? e[b] : "\x26" + b + ";";
  14049. c.push(d);
  14050. return ""
  14051. });
  14052. a = a.replace(/,$/, "");
  14053. if (!f && a) {
  14054. a = a.split(",");
  14055. var b = document.createElement("div"), d;
  14056. b.innerHTML = "\x26" + a.join(";\x26") + ";";
  14057. d = b.innerHTML;
  14058. b = null;
  14059. for (b = 0; b < d.length; b++) {
  14060. var h = d.charAt(b);
  14061. g[h] = "\x26" + a[b] + ";";
  14062. c.push(h)
  14063. }
  14064. }
  14065. g.regex = c.join(f ? "|" : "");
  14066. return g
  14067. }
  14068. CKEDITOR.plugins.add("entities", {
  14069. afterInit: function (a) {
  14070. function f(b) {
  14071. return h[b]
  14072. }
  14073. function g(a) {
  14074. return "force" != c.entities_processNumerical && b[a] ? b[a] : "\x26#" + a.charCodeAt(0) + ";"
  14075. }
  14076. var c = a.config;
  14077. if (a = (a = a.dataProcessor) && a.htmlFilter) {
  14078. var e = [];
  14079. !1 !== c.basicEntities && e.push("nbsp,gt,lt,amp");
  14080. c.entities && (e.length && e.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"),
  14081. c.entities_latin && e.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"), c.entities_greek && e.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"),
  14082. c.entities_additional && e.push(c.entities_additional));
  14083. var b = k(e.join(",")), d = b.regex ? "[" + b.regex + "]" : "a^";
  14084. delete b.regex;
  14085. c.entities && c.entities_processNumerical && (d = "[^ -~]|" + d);
  14086. var d = new RegExp(d, "g"), h = k("nbsp,gt,lt,amp,shy", !0), l = new RegExp(h.regex, "g");
  14087. a.addRules({
  14088. text: function (a) {
  14089. return a.replace(l, f).replace(d, g)
  14090. }
  14091. }, {applyToAll: !0, excludeNestedEditable: !0})
  14092. }
  14093. }
  14094. })
  14095. })();
  14096. CKEDITOR.config.basicEntities = !0;
  14097. CKEDITOR.config.entities = !0;
  14098. CKEDITOR.config.entities_latin = !0;
  14099. CKEDITOR.config.entities_greek = !0;
  14100. CKEDITOR.config.entities_additional = "#39";
  14101. CKEDITOR.plugins.add("popup");
  14102. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  14103. popup: function (e, a, b, d) {
  14104. a = a || "80%";
  14105. b = b || "70%";
  14106. "string" == typeof a && 1 < a.length && "%" == a.substr(a.length - 1, 1) && (a = parseInt(window.screen.width * parseInt(a, 10) / 100, 10));
  14107. "string" == typeof b && 1 < b.length && "%" == b.substr(b.length - 1, 1) && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10));
  14108. 640 > a && (a = 640);
  14109. 420 > b && (b = 420);
  14110. var f = parseInt((window.screen.height - b) / 2, 10), g = parseInt((window.screen.width - a) / 2, 10);
  14111. d = (d || "location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes") + ",width\x3d" +
  14112. a + ",height\x3d" + b + ",top\x3d" + f + ",left\x3d" + g;
  14113. var c = window.open("", null, d, !0);
  14114. if (!c) return !1;
  14115. try {
  14116. -1 == navigator.userAgent.toLowerCase().indexOf(" chrome/") && (c.moveTo(g, f), c.resizeTo(a, b)), c.focus(), c.location.href = e
  14117. } catch (h) {
  14118. window.open(e, null, d, !0)
  14119. }
  14120. return !0
  14121. }
  14122. });
  14123. (function () {
  14124. function k(a) {
  14125. this.editor = a;
  14126. this.loaders = []
  14127. }
  14128. function l(a, c, b) {
  14129. var d = a.config.fileTools_defaultFileName;
  14130. this.editor = a;
  14131. this.lang = a.lang;
  14132. "string" === typeof c ? (this.data = c, this.file = n(this.data), this.loaded = this.total = this.file.size) : (this.data = null, this.file = c, this.total = this.file.size, this.loaded = 0);
  14133. b ? this.fileName = b : this.file.name ? this.fileName = this.file.name : (a = this.file.type.split("/"), d && (a[0] = d), this.fileName = a.join("."));
  14134. this.uploaded = 0;
  14135. this.responseData = this.uploadTotal = null;
  14136. this.status =
  14137. "created";
  14138. this.abort = function () {
  14139. this.changeStatus("abort")
  14140. }
  14141. }
  14142. function n(a) {
  14143. var c = a.match(m)[1];
  14144. a = a.replace(m, "");
  14145. a = atob(a);
  14146. var b = [], d, f, g, e;
  14147. for (d = 0; d < a.length; d += 512) {
  14148. f = a.slice(d, d + 512);
  14149. g = Array(f.length);
  14150. for (e = 0; e < f.length; e++) g[e] = f.charCodeAt(e);
  14151. f = new Uint8Array(g);
  14152. b.push(f)
  14153. }
  14154. return new Blob(b, {type: c})
  14155. }
  14156. CKEDITOR.plugins.add("filetools", {
  14157. beforeInit: function (a) {
  14158. a.uploadRepository = new k(a);
  14159. a.on("fileUploadRequest", function (a) {
  14160. var b = a.data.fileLoader;
  14161. b.xhr.open("POST", b.uploadUrl, !0);
  14162. a.data.requestData.upload =
  14163. {file: b.file, name: b.fileName}
  14164. }, null, null, 5);
  14165. a.on("fileUploadRequest", function (c) {
  14166. var b = c.data.fileLoader, d = new FormData;
  14167. c = c.data.requestData;
  14168. var f = a.config.fileTools_requestHeaders, g, e;
  14169. for (e in c) {
  14170. var h = c[e];
  14171. "object" === typeof h && h.file ? d.append(e, h.file, h.name) : d.append(e, h)
  14172. }
  14173. d.append("ckCsrfToken", CKEDITOR.tools.getCsrfToken());
  14174. if (f) for (g in f) b.xhr.setRequestHeader(g, f[g]);
  14175. b.xhr.send(d)
  14176. }, null, null, 999);
  14177. a.on("fileUploadResponse", function (a) {
  14178. var b = a.data.fileLoader, d = b.xhr, f = a.data;
  14179. try {
  14180. var g = JSON.parse(d.responseText);
  14181. g.error && g.error.message && (f.message = g.error.message);
  14182. if (g.uploaded) for (var e in g) f[e] = g[e]; else a.cancel()
  14183. } catch (h) {
  14184. f.message = b.lang.filetools.responseError, CKEDITOR.warn("filetools-response-error", {responseText: d.responseText}), a.cancel()
  14185. }
  14186. }, null, null, 999)
  14187. }
  14188. });
  14189. k.prototype = {
  14190. create: function (a, c, b) {
  14191. b = b || l;
  14192. var d = this.loaders.length;
  14193. a = new b(this.editor, a, c);
  14194. a.id = d;
  14195. this.loaders[d] = a;
  14196. this.fire("instanceCreated", a);
  14197. return a
  14198. }, isFinished: function () {
  14199. for (var a = 0; a < this.loaders.length; ++a) if (!this.loaders[a].isFinished()) return !1;
  14200. return !0
  14201. }
  14202. };
  14203. l.prototype = {
  14204. loadAndUpload: function (a, c) {
  14205. var b = this;
  14206. this.once("loaded", function (d) {
  14207. d.cancel();
  14208. b.once("update", function (a) {
  14209. a.cancel()
  14210. }, null, null, 0);
  14211. b.upload(a, c)
  14212. }, null, null, 0);
  14213. this.load()
  14214. }, load: function () {
  14215. var a = this, c = this.reader = new FileReader;
  14216. a.changeStatus("loading");
  14217. this.abort = function () {
  14218. a.reader.abort()
  14219. };
  14220. c.onabort = function () {
  14221. a.changeStatus("abort")
  14222. };
  14223. c.onerror = function () {
  14224. a.message = a.lang.filetools.loadError;
  14225. a.changeStatus("error")
  14226. };
  14227. c.onprogress = function (b) {
  14228. a.loaded = b.loaded;
  14229. a.update()
  14230. };
  14231. c.onload = function () {
  14232. a.loaded = a.total;
  14233. a.data = c.result;
  14234. a.changeStatus("loaded")
  14235. };
  14236. c.readAsDataURL(this.file)
  14237. }, upload: function (a, c) {
  14238. var b = c || {};
  14239. a ? (this.uploadUrl = a, this.xhr = new XMLHttpRequest, this.attachRequestListeners(), this.editor.fire("fileUploadRequest", {
  14240. fileLoader: this,
  14241. requestData: b
  14242. }) && this.changeStatus("uploading")) : (this.message = this.lang.filetools.noUrlError, this.changeStatus("error"))
  14243. }, attachRequestListeners: function () {
  14244. function a() {
  14245. "error" != b.status && (b.message = b.lang.filetools.networkError,
  14246. b.changeStatus("error"))
  14247. }
  14248. function c() {
  14249. "abort" != b.status && b.changeStatus("abort")
  14250. }
  14251. var b = this, d = this.xhr;
  14252. b.abort = function () {
  14253. d.abort();
  14254. c()
  14255. };
  14256. d.onerror = a;
  14257. d.onabort = c;
  14258. d.upload ? (d.upload.onprogress = function (a) {
  14259. a.lengthComputable && (b.uploadTotal || (b.uploadTotal = a.total), b.uploaded = a.loaded, b.update())
  14260. }, d.upload.onerror = a, d.upload.onabort = c) : (b.uploadTotal = b.total, b.update());
  14261. d.onload = function () {
  14262. b.update();
  14263. if ("abort" != b.status) if (b.uploaded = b.uploadTotal, 200 > d.status || 299 < d.status) b.message = b.lang.filetools["httpError" +
  14264. d.status], b.message || (b.message = b.lang.filetools.httpError.replace("%1", d.status)), b.changeStatus("error"); else {
  14265. for (var a = {fileLoader: b}, c = ["message", "fileName", "url"], e = b.editor.fire("fileUploadResponse", a), h = 0; h < c.length; h++) {
  14266. var k = c[h];
  14267. "string" === typeof a[k] && (b[k] = a[k])
  14268. }
  14269. b.responseData = a;
  14270. delete b.responseData.fileLoader;
  14271. !1 === e ? b.changeStatus("error") : b.changeStatus("uploaded")
  14272. }
  14273. }
  14274. }, changeStatus: function (a) {
  14275. this.status = a;
  14276. if ("error" == a || "abort" == a || "loaded" == a || "uploaded" == a) this.abort = function () {
  14277. };
  14278. this.fire(a);
  14279. this.update()
  14280. }, update: function () {
  14281. this.fire("update")
  14282. }, isFinished: function () {
  14283. return !!this.status.match(/^(?:loaded|uploaded|error|abort)$/)
  14284. }
  14285. };
  14286. CKEDITOR.event.implementOn(k.prototype);
  14287. CKEDITOR.event.implementOn(l.prototype);
  14288. var m = /^data:(\S*?);base64,/;
  14289. CKEDITOR.fileTools || (CKEDITOR.fileTools = {});
  14290. CKEDITOR.tools.extend(CKEDITOR.fileTools, {
  14291. uploadRepository: k,
  14292. fileLoader: l,
  14293. getUploadUrl: function (a, c) {
  14294. var b = CKEDITOR.tools.capitalize;
  14295. return c && a[c + "UploadUrl"] ? a[c + "UploadUrl"] : a.uploadUrl ? a.uploadUrl :
  14296. c && a["filebrowser" + b(c, 1) + "UploadUrl"] ? a["filebrowser" + b(c, 1) + "UploadUrl"] + "\x26responseType\x3djson" : a.filebrowserUploadUrl ? a.filebrowserUploadUrl + "\x26responseType\x3djson" : null
  14297. },
  14298. isTypeSupported: function (a, c) {
  14299. return !!a.type.match(c)
  14300. },
  14301. isFileUploadSupported: "function" === typeof FileReader && "function" === typeof (new FileReader).readAsDataURL && "function" === typeof FormData && "function" === typeof (new FormData).append && "function" === typeof XMLHttpRequest && "function" === typeof Blob
  14302. })
  14303. })();
  14304. (function () {
  14305. function g(a, b) {
  14306. var d = [];
  14307. if (b) for (var c in b) d.push(c + "\x3d" + encodeURIComponent(b[c])); else return a;
  14308. return a + (-1 != a.indexOf("?") ? "\x26" : "?") + d.join("\x26")
  14309. }
  14310. function p(a) {
  14311. return !a.match(/command=QuickUpload/) || a.match(/(\?|&)responseType=json/) ? a : g(a, {responseType: "json"})
  14312. }
  14313. function k(a) {
  14314. a += "";
  14315. return a.charAt(0).toUpperCase() + a.substr(1)
  14316. }
  14317. function q() {
  14318. var a = this.getDialog(), b = a.getParentEditor();
  14319. b._.filebrowserSe = this;
  14320. var d = b.config["filebrowser" + k(a.getName()) + "WindowWidth"] || b.config.filebrowserWindowWidth ||
  14321. "80%",
  14322. a = b.config["filebrowser" + k(a.getName()) + "WindowHeight"] || b.config.filebrowserWindowHeight || "70%",
  14323. c = this.filebrowser.params || {};
  14324. c.CKEditor = b.name;
  14325. c.CKEditorFuncNum = b._.filebrowserFn;
  14326. c.langCode || (c.langCode = b.langCode);
  14327. c = g(this.filebrowser.url, c);
  14328. b.popup(c, d, a, b.config.filebrowserWindowFeatures || b.config.fileBrowserWindowFeatures)
  14329. }
  14330. function r(a) {
  14331. var b = new CKEDITOR.dom.element(a.$.form);
  14332. b && ((a = b.$.elements.ckCsrfToken) ? a = new CKEDITOR.dom.element(a) : (a = new CKEDITOR.dom.element("input"), a.setAttributes({
  14333. name: "ckCsrfToken",
  14334. type: "hidden"
  14335. }), b.append(a)), a.setAttribute("value", CKEDITOR.tools.getCsrfToken()))
  14336. }
  14337. function t() {
  14338. var a = this.getDialog();
  14339. a.getParentEditor()._.filebrowserSe = this;
  14340. return a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value && a.getContentElement(this["for"][0], this["for"][1]).getAction() ? !0 : !1
  14341. }
  14342. function u(a, b, d) {
  14343. var c = d.params || {};
  14344. c.CKEditor = a.name;
  14345. c.CKEditorFuncNum = a._.filebrowserFn;
  14346. c.langCode || (c.langCode = a.langCode);
  14347. b.action = g(d.url, c);
  14348. b.filebrowser = d
  14349. }
  14350. function l(a, b, d, c) {
  14351. if (c &&
  14352. c.length) for (var e, g = c.length; g--;) if (e = c[g], "hbox" != e.type && "vbox" != e.type && "fieldset" != e.type || l(a, b, d, e.children), e.filebrowser) if ("string" == typeof e.filebrowser && (e.filebrowser = {
  14353. action: "fileButton" == e.type ? "QuickUpload" : "Browse",
  14354. target: e.filebrowser
  14355. }), "Browse" == e.filebrowser.action) {
  14356. var f = e.filebrowser.url;
  14357. void 0 === f && (f = a.config["filebrowser" + k(b) + "BrowseUrl"], void 0 === f && (f = a.config.filebrowserBrowseUrl));
  14358. f && (e.onClick = q, e.filebrowser.url = f, e.hidden = !1)
  14359. } else if ("QuickUpload" == e.filebrowser.action &&
  14360. e["for"] && (f = e.filebrowser.url, void 0 === f && (f = a.config["filebrowser" + k(b) + "UploadUrl"], void 0 === f && (f = a.config.filebrowserUploadUrl)), f)) {
  14361. var h = e.onClick;
  14362. e.onClick = function (b) {
  14363. var c = b.sender,
  14364. d = c.getDialog().getContentElement(this["for"][0], this["for"][1]).getInputElement(),
  14365. e = CKEDITOR.fileTools && CKEDITOR.fileTools.isFileUploadSupported;
  14366. if (h && !1 === h.call(c, b)) return !1;
  14367. if (t.call(c, b)) {
  14368. if ("form" !== a.config.filebrowserUploadMethod && e) return b = a.uploadRepository.create(d.$.files[0]), b.on("uploaded", function (a) {
  14369. var b =
  14370. a.sender.responseData;
  14371. m.call(a.sender.editor, b.url, b.message)
  14372. }), b.on("error", n.bind(this)), b.on("abort", n.bind(this)), b.loadAndUpload(p(f)), "xhr";
  14373. r(d);
  14374. return !0
  14375. }
  14376. return !1
  14377. };
  14378. e.filebrowser.url = f;
  14379. e.hidden = !1;
  14380. u(a, d.getContents(e["for"][0]).get(e["for"][1]), e.filebrowser)
  14381. }
  14382. }
  14383. function n(a) {
  14384. var b = {};
  14385. try {
  14386. b = JSON.parse(a.sender.xhr.response) || {}
  14387. } catch (d) {
  14388. }
  14389. this.enable();
  14390. alert(b.error ? b.error.message : a.sender.message)
  14391. }
  14392. function h(a, b, d) {
  14393. if (-1 !== d.indexOf(";")) {
  14394. d = d.split(";");
  14395. for (var c = 0; c < d.length; c++) if (h(a, b, d[c])) return !0;
  14396. return !1
  14397. }
  14398. return (a = a.getContents(b).get(d).filebrowser) && a.url
  14399. }
  14400. function m(a, b) {
  14401. var d = this._.filebrowserSe.getDialog(), c = this._.filebrowserSe["for"],
  14402. e = this._.filebrowserSe.filebrowser.onSelect;
  14403. c && d.getContentElement(c[0], c[1]).reset();
  14404. if ("function" != typeof b || !1 !== b.call(this._.filebrowserSe)) if (!e || !1 !== e.call(this._.filebrowserSe, a, b)) if ("string" == typeof b && b && alert(b), a && (c = this._.filebrowserSe, d = c.getDialog(), c = c.filebrowser.target || null)) if (c = c.split(":"), e = d.getContentElement(c[0], c[1])) e.setValue(a),
  14405. d.selectPage(c[0])
  14406. }
  14407. CKEDITOR.plugins.add("filebrowser", {
  14408. requires: "popup,filetools", init: function (a) {
  14409. a._.filebrowserFn = CKEDITOR.tools.addFunction(m, a);
  14410. a.on("destroy", function () {
  14411. CKEDITOR.tools.removeFunction(this._.filebrowserFn)
  14412. })
  14413. }
  14414. });
  14415. CKEDITOR.on("dialogDefinition", function (a) {
  14416. if (a.editor.plugins.filebrowser) for (var b = a.data.definition, d, c = 0; c < b.contents.length; ++c) if (d = b.contents[c]) l(a.editor, a.data.name, b, d.elements), d.hidden && d.filebrowser && (d.hidden = !h(b, d.id, d.filebrowser))
  14417. })
  14418. })();
  14419. CKEDITOR.plugins.add("find", {
  14420. requires: "dialog", init: function (a) {
  14421. var b = a.addCommand("find", new CKEDITOR.dialogCommand("find")),
  14422. c = a.addCommand("replace", new CKEDITOR.dialogCommand("find", {tabId: "replace"}));
  14423. b.canUndo = !1;
  14424. b.readOnly = 1;
  14425. c.canUndo = !1;
  14426. a.ui.addButton && (a.ui.addButton("Find", {
  14427. label: a.lang.find.find,
  14428. command: "find",
  14429. toolbar: "find,10"
  14430. }), a.ui.addButton("Replace", {label: a.lang.find.replace, command: "replace", toolbar: "find,20"}));
  14431. CKEDITOR.dialog.add("find", this.path + "dialogs/find.js")
  14432. }
  14433. });
  14434. CKEDITOR.config.find_highlight = {element: "span", styles: {"background-color": "#004", color: "#fff"}};
  14435. (function () {
  14436. function g(a, b) {
  14437. var c = l.exec(a), d = l.exec(b);
  14438. if (c) {
  14439. if (!c[2] && "px" == d[2]) return d[1];
  14440. if ("px" == c[2] && !d[2]) return d[1] + "px"
  14441. }
  14442. return b
  14443. }
  14444. var k = CKEDITOR.htmlParser.cssStyle, h = CKEDITOR.tools.cssLength, l = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,
  14445. m = {
  14446. elements: {
  14447. $: function (a) {
  14448. var b = a.attributes;
  14449. if ((b = (b = (b = b && b["data-cke-realelement"]) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b))) && b.children[0]) && a.attributes["data-cke-resizable"]) {
  14450. var c = (new k(a)).rules;
  14451. a = b.attributes;
  14452. var d = c.width,
  14453. c = c.height;
  14454. d && (a.width = g(a.width, d));
  14455. c && (a.height = g(a.height, c))
  14456. }
  14457. return b
  14458. }
  14459. }
  14460. };
  14461. CKEDITOR.plugins.add("fakeobjects", {
  14462. init: function (a) {
  14463. a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}", "fakeobjects")
  14464. }, afterInit: function (a) {
  14465. (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(m, {applyToAll: !0})
  14466. }
  14467. });
  14468. CKEDITOR.editor.prototype.createFakeElement = function (a, b, c, d) {
  14469. var e = this.lang.fakeobjects, e = e[c] || e.unknown;
  14470. b = {
  14471. "class": b,
  14472. "data-cke-realelement": encodeURIComponent(a.getOuterHtml()),
  14473. "data-cke-real-node-type": a.type,
  14474. alt: e,
  14475. title: e,
  14476. align: a.getAttribute("align") || ""
  14477. };
  14478. CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData);
  14479. c && (b["data-cke-real-element-type"] = c);
  14480. d && (b["data-cke-resizable"] = d, c = new k, d = a.getAttribute("width"), a = a.getAttribute("height"), d && (c.rules.width = h(d)), a && (c.rules.height = h(a)), c.populate(b));
  14481. return this.document.createElement("img", {attributes: b})
  14482. };
  14483. CKEDITOR.editor.prototype.createFakeParserElement = function (a, b, c, d) {
  14484. var e = this.lang.fakeobjects, e = e[c] || e.unknown, f;
  14485. f = new CKEDITOR.htmlParser.basicWriter;
  14486. a.writeHtml(f);
  14487. f = f.getHtml();
  14488. b = {
  14489. "class": b,
  14490. "data-cke-realelement": encodeURIComponent(f),
  14491. "data-cke-real-node-type": a.type,
  14492. alt: e,
  14493. title: e,
  14494. align: a.attributes.align || ""
  14495. };
  14496. CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData);
  14497. c && (b["data-cke-real-element-type"] = c);
  14498. d && (b["data-cke-resizable"] = d, d = a.attributes, a = new k, c = d.width, d = d.height, void 0 !== c && (a.rules.width = h(c)), void 0 !== d && (a.rules.height = h(d)), a.populate(b));
  14499. return new CKEDITOR.htmlParser.element("img", b)
  14500. };
  14501. CKEDITOR.editor.prototype.restoreRealElement =
  14502. function (a) {
  14503. if (a.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null;
  14504. var b = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")), this.document);
  14505. if (a.data("cke-resizable")) {
  14506. var c = a.getStyle("width");
  14507. a = a.getStyle("height");
  14508. c && b.setAttribute("width", g(b.getAttribute("width"), c));
  14509. a && b.setAttribute("height", g(b.getAttribute("height"), a))
  14510. }
  14511. return b
  14512. }
  14513. })();
  14514. (function () {
  14515. function d(a) {
  14516. a = a.attributes;
  14517. return "application/x-shockwave-flash" == a.type || f.test(a.src || "")
  14518. }
  14519. function e(a, b) {
  14520. return a.createFakeParserElement(b, "cke_flash", "flash", !0)
  14521. }
  14522. var f = /\.swf(?:$|\?)/i;
  14523. CKEDITOR.plugins.add("flash", {
  14524. requires: "dialog,fakeobjects", onLoad: function () {
  14525. CKEDITOR.addCss("img.cke_flash{background-image: url(" + CKEDITOR.getUrl(this.path + "images/placeholder.png") + ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")
  14526. },
  14527. init: function (a) {
  14528. var b = "object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]";
  14529. CKEDITOR.dialog.isTabEnabled(a, "flash", "properties") && (b += ";object[align]; embed[allowscriptaccess,quality,scale,wmode]");
  14530. CKEDITOR.dialog.isTabEnabled(a, "flash", "advanced") && (b += ";object[id]{*}; embed[bgcolor]{*}(*)");
  14531. a.addCommand("flash", new CKEDITOR.dialogCommand("flash", {
  14532. allowedContent: b,
  14533. requiredContent: "embed"
  14534. }));
  14535. a.ui.addButton && a.ui.addButton("Flash",
  14536. {label: a.lang.common.flash, command: "flash", toolbar: "insert,20"});
  14537. CKEDITOR.dialog.add("flash", this.path + "dialogs/flash.js");
  14538. a.addMenuItems && a.addMenuItems({
  14539. flash: {
  14540. label: a.lang.flash.properties,
  14541. command: "flash",
  14542. group: "flash"
  14543. }
  14544. });
  14545. a.on("doubleclick", function (a) {
  14546. var b = a.data.element;
  14547. b.is("img") && "flash" == b.data("cke-real-element-type") && (a.data.dialog = "flash")
  14548. });
  14549. a.contextMenu && a.contextMenu.addListener(function (a) {
  14550. if (a && a.is("img") && !a.isReadOnly() && "flash" == a.data("cke-real-element-type")) return {flash: CKEDITOR.TRISTATE_OFF}
  14551. })
  14552. },
  14553. afterInit: function (a) {
  14554. var b = a.dataProcessor;
  14555. (b = b && b.dataFilter) && b.addRules({
  14556. elements: {
  14557. "cke:object": function (b) {
  14558. var c = b.attributes;
  14559. if (!(c.classid && String(c.classid).toLowerCase() || d(b))) {
  14560. for (c = 0; c < b.children.length; c++) if ("cke:embed" == b.children[c].name) {
  14561. if (!d(b.children[c])) break;
  14562. return e(a, b)
  14563. }
  14564. return null
  14565. }
  14566. return e(a, b)
  14567. }, "cke:embed": function (b) {
  14568. return d(b) ? e(a, b) : null
  14569. }
  14570. }
  14571. }, 5)
  14572. }
  14573. })
  14574. })();
  14575. CKEDITOR.tools.extend(CKEDITOR.config, {flashEmbedTagOnly: !1, flashAddEmbedTag: !0, flashConvertOnEdit: !1});
  14576. (function () {
  14577. function k(a) {
  14578. var l = a.config, p = a.fire("uiSpace", {space: "top", html: ""}).html, t = function () {
  14579. function f(a, c, e) {
  14580. b.setStyle(c, w(e));
  14581. b.setStyle("position", a)
  14582. }
  14583. function e(a) {
  14584. var b = k.getDocumentPosition();
  14585. switch (a) {
  14586. case "top":
  14587. f("absolute", "top", b.y - q - r);
  14588. break;
  14589. case "pin":
  14590. f("fixed", "top", x);
  14591. break;
  14592. case "bottom":
  14593. f("absolute", "top", b.y + (c.height || c.bottom - c.top) + r)
  14594. }
  14595. m = a
  14596. }
  14597. var m, k, n, c, h, q, v, p = l.floatSpaceDockedOffsetX || 0, r = l.floatSpaceDockedOffsetY || 0,
  14598. u = l.floatSpacePinnedOffsetX || 0, x = l.floatSpacePinnedOffsetY ||
  14599. 0;
  14600. return function (d) {
  14601. if (k = a.editable()) {
  14602. var f = d && "focus" == d.name;
  14603. f && b.show();
  14604. a.fire("floatingSpaceLayout", {show: f});
  14605. b.removeStyle("left");
  14606. b.removeStyle("right");
  14607. n = b.getClientRect();
  14608. c = k.getClientRect();
  14609. h = g.getViewPaneSize();
  14610. q = n.height;
  14611. v = "pageXOffset" in g.$ ? g.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft;
  14612. m ? (q + r <= c.top ? e("top") : q + r > h.height - c.bottom ? e("pin") : e("bottom"), d = h.width / 2, d = l.floatSpacePreferRight ? "right" : 0 < c.left && c.right < h.width && c.width > n.width ? "rtl" == l.contentsLangDirection ?
  14613. "right" : "left" : d - c.left > c.right - d ? "left" : "right", n.width > h.width ? (d = "left", f = 0) : (f = "left" == d ? 0 < c.left ? c.left : 0 : c.right < h.width ? h.width - c.right : 0, f + n.width > h.width && (d = "left" == d ? "right" : "left", f = 0)), b.setStyle(d, w(("pin" == m ? u : p) + f + ("pin" == m ? 0 : "left" == d ? v : -v)))) : (m = "pin", e("pin"), t(d))
  14614. }
  14615. }
  14616. }();
  14617. if (p) {
  14618. var k = new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" title\x3d"' + (CKEDITOR.env.gecko ?
  14619. " " : "") + '" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"' + (a.title ? ' aria-labelledby\x3d"cke_{name}_arialbl"' : " ") + "\x3e" + (a.title ? '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' : " ") + '\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'),
  14620. b = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({
  14621. content: p,
  14622. id: a.id,
  14623. langDir: a.lang.dir,
  14624. langCode: a.langCode,
  14625. name: a.name,
  14626. style: "display:none;z-index:" + (l.baseFloatZIndex - 1),
  14627. topId: a.ui.spaceId("top"),
  14628. voiceLabel: a.title
  14629. }))), u = CKEDITOR.tools.eventsBuffer(500, t), e = CKEDITOR.tools.eventsBuffer(100, t);
  14630. b.unselectable();
  14631. b.on("mousedown", function (a) {
  14632. a = a.data;
  14633. a.getTarget().hasAscendant("a", 1) || a.preventDefault()
  14634. });
  14635. a.on("focus", function (b) {
  14636. t(b);
  14637. a.on("change", u.input);
  14638. g.on("scroll", e.input);
  14639. g.on("resize", e.input)
  14640. });
  14641. a.on("blur", function () {
  14642. b.hide();
  14643. a.removeListener("change", u.input);
  14644. g.removeListener("scroll",
  14645. e.input);
  14646. g.removeListener("resize", e.input)
  14647. });
  14648. a.on("destroy", function () {
  14649. g.removeListener("scroll", e.input);
  14650. g.removeListener("resize", e.input);
  14651. b.clearCustomData();
  14652. b.remove()
  14653. });
  14654. a.focusManager.hasFocus && b.show();
  14655. a.focusManager.add(b, 1)
  14656. }
  14657. }
  14658. var g = CKEDITOR.document.getWindow(), w = CKEDITOR.tools.cssLength;
  14659. CKEDITOR.plugins.add("floatingspace", {
  14660. init: function (a) {
  14661. a.on("loaded", function () {
  14662. k(this)
  14663. }, null, null, 20)
  14664. }
  14665. })
  14666. })();
  14667. CKEDITOR.plugins.add("listblock", {
  14668. requires: "panel", onLoad: function () {
  14669. var f = CKEDITOR.addTemplate("panel-list", '\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),
  14670. g = CKEDITOR.addTemplate("panel-list-item", '\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}\')" {onclick}\x3d"CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),
  14671. h = CKEDITOR.addTemplate("panel-list-group", '\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),
  14672. k = /\'/g;
  14673. CKEDITOR.ui.panel.prototype.addListBlock = function (a, b) {
  14674. return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b))
  14675. };
  14676. CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
  14677. base: CKEDITOR.ui.panel.block, $: function (a, b) {
  14678. b = b || {};
  14679. var c = b.attributes || (b.attributes = {});
  14680. (this.multiSelect = !!b.multiSelect) &&
  14681. (c["aria-multiselectable"] = !0);
  14682. !c.role && (c.role = "listbox");
  14683. this.base.apply(this, arguments);
  14684. this.element.setAttribute("role", c.role);
  14685. c = this.keys;
  14686. c[40] = "next";
  14687. c[9] = "next";
  14688. c[38] = "prev";
  14689. c[CKEDITOR.SHIFT + 9] = "prev";
  14690. c[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  14691. CKEDITOR.env.ie && (c[13] = "mouseup");
  14692. this._.pendingHtml = [];
  14693. this._.pendingList = [];
  14694. this._.items = {};
  14695. this._.groups = {}
  14696. }, _: {
  14697. close: function () {
  14698. if (this._.started) {
  14699. var a = f.output({items: this._.pendingList.join("")});
  14700. this._.pendingList = [];
  14701. this._.pendingHtml.push(a);
  14702. delete this._.started
  14703. }
  14704. }, getClick: function () {
  14705. this._.click || (this._.click = CKEDITOR.tools.addFunction(function (a) {
  14706. var b = this.toggle(a);
  14707. if (this.onClick) this.onClick(a, b)
  14708. }, this));
  14709. return this._.click
  14710. }
  14711. }, proto: {
  14712. add: function (a, b, c) {
  14713. var d = CKEDITOR.tools.getNextId();
  14714. this._.started || (this._.started = 1, this._.size = this._.size || 0);
  14715. this._.items[a] = d;
  14716. var e;
  14717. e = CKEDITOR.tools.htmlEncodeAttr(a).replace(k, "\\'");
  14718. a = {
  14719. id: d,
  14720. val: e,
  14721. onclick: CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick",
  14722. clickFn: this._.getClick(),
  14723. title: CKEDITOR.tools.htmlEncodeAttr(c || a),
  14724. text: b || a
  14725. };
  14726. this._.pendingList.push(g.output(a))
  14727. }, startGroup: function (a) {
  14728. this._.close();
  14729. var b = CKEDITOR.tools.getNextId();
  14730. this._.groups[a] = b;
  14731. this._.pendingHtml.push(h.output({id: b, label: a}))
  14732. }, commit: function () {
  14733. this._.close();
  14734. this.element.appendHtml(this._.pendingHtml.join(""));
  14735. delete this._.size;
  14736. this._.pendingHtml = []
  14737. }, toggle: function (a) {
  14738. var b = this.isMarked(a);
  14739. b ? this.unmark(a) : this.mark(a);
  14740. return !b
  14741. }, hideGroup: function (a) {
  14742. var b = (a = this.element.getDocument().getById(this._.groups[a])) &&
  14743. a.getNext();
  14744. a && (a.setStyle("display", "none"), b && "ul" == b.getName() && b.setStyle("display", "none"))
  14745. }, hideItem: function (a) {
  14746. this.element.getDocument().getById(this._.items[a]).setStyle("display", "none")
  14747. }, showAll: function () {
  14748. var a = this._.items, b = this._.groups, c = this.element.getDocument(), d;
  14749. for (d in a) c.getById(a[d]).setStyle("display", "");
  14750. for (var e in b) a = c.getById(b[e]), d = a.getNext(), a.setStyle("display", ""), d && "ul" == d.getName() && d.setStyle("display", "")
  14751. }, mark: function (a) {
  14752. this.multiSelect || this.unmarkAll();
  14753. a = this._.items[a];
  14754. var b = this.element.getDocument().getById(a);
  14755. b.addClass("cke_selected");
  14756. this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", !0);
  14757. this.onMark && this.onMark(b)
  14758. }, markFirstDisplayed: function () {
  14759. var a = this;
  14760. this._.markFirstDisplayed(function () {
  14761. a.multiSelect || a.unmarkAll()
  14762. })
  14763. }, unmark: function (a) {
  14764. var b = this.element.getDocument();
  14765. a = this._.items[a];
  14766. var c = b.getById(a);
  14767. c.removeClass("cke_selected");
  14768. b.getById(a + "_option").removeAttribute("aria-selected");
  14769. this.onUnmark && this.onUnmark(c)
  14770. },
  14771. unmarkAll: function () {
  14772. var a = this._.items, b = this.element.getDocument(), c;
  14773. for (c in a) {
  14774. var d = a[c];
  14775. b.getById(d).removeClass("cke_selected");
  14776. b.getById(d + "_option").removeAttribute("aria-selected")
  14777. }
  14778. this.onUnmark && this.onUnmark()
  14779. }, isMarked: function (a) {
  14780. return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")
  14781. }, focus: function (a) {
  14782. this._.focusIndex = -1;
  14783. var b = this.element.getElementsByTag("a"), c, d = -1;
  14784. if (a) for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++d);) {
  14785. if (a.equals(c)) {
  14786. this._.focusIndex =
  14787. d;
  14788. break
  14789. }
  14790. } else this.element.focus();
  14791. c && setTimeout(function () {
  14792. c.focus()
  14793. }, 0)
  14794. }
  14795. }
  14796. })
  14797. }
  14798. });
  14799. CKEDITOR.plugins.add("richcombo", {
  14800. requires: "floatpanel,listblock,button", beforeInit: function (c) {
  14801. c.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler)
  14802. }
  14803. });
  14804. (function () {
  14805. var c = '\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"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href\x3d\"javascript:void('{titleJs}')\"") + ' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"';
  14806. CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  14807. CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  14808. var c = c + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"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' +
  14809. (CKEDITOR.env.hc ? "\x26#9660;" : CKEDITOR.env.air ? "\x26nbsp;" : "") + "\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),
  14810. k = CKEDITOR.addTemplate("combo", c);
  14811. CKEDITOR.UI_RICHCOMBO = "richcombo";
  14812. CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({
  14813. $: function (a) {
  14814. CKEDITOR.tools.extend(this, a, {canGroup: !1, title: a.label, modes: {wysiwyg: 1}, editorFocus: 1});
  14815. a = this.panel || {};
  14816. delete this.panel;
  14817. this.id = CKEDITOR.tools.getNextNumber();
  14818. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  14819. a.className = "cke_combopanel";
  14820. a.block = {multiSelect: a.multiSelect, attributes: a.attributes};
  14821. a.toolbarRelated = !0;
  14822. this._ = {panelDefinition: a, items: {}, listeners: []}
  14823. }, proto: {
  14824. renderHtml: function (a) {
  14825. var b = [];
  14826. this.render(a, b);
  14827. return b.join("")
  14828. }, render: function (a, b) {
  14829. function f() {
  14830. if (this.getState() != CKEDITOR.TRISTATE_ON) {
  14831. var b = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  14832. a.readOnly && !this.readOnly && (b = CKEDITOR.TRISTATE_DISABLED);
  14833. this.setState(b);
  14834. this.setValue("");
  14835. b != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
  14836. }
  14837. }
  14838. var c = CKEDITOR.env, h = "cke_" + this.id, e = CKEDITOR.tools.addFunction(function (b) {
  14839. l && (a.unlockSelection(1), l = 0);
  14840. g.execute(b)
  14841. }, this), d = this, g = {
  14842. id: h, combo: this, focus: function () {
  14843. CKEDITOR.document.getById(h).getChild(1).focus()
  14844. }, execute: function (b) {
  14845. var c = d._;
  14846. if (c.state != CKEDITOR.TRISTATE_DISABLED) if (d.createPanel(a), c.on) c.panel.hide(); else {
  14847. d.commit();
  14848. var f = d.getValue();
  14849. f ? c.list.mark(f) : c.list.unmarkAll();
  14850. c.panel.showBlock(d.id, new CKEDITOR.dom.element(b), 4)
  14851. }
  14852. }, clickFn: e
  14853. };
  14854. this._.listeners.push(a.on("activeFilterChange",
  14855. f, this));
  14856. this._.listeners.push(a.on("mode", f, this));
  14857. this._.listeners.push(a.on("selectionChange", f, this));
  14858. !this.readOnly && this._.listeners.push(a.on("readOnly", f, this));
  14859. var m = CKEDITOR.tools.addFunction(function (a, b) {
  14860. a = new CKEDITOR.dom.event(a);
  14861. var d = a.getKeystroke();
  14862. switch (d) {
  14863. case 13:
  14864. case 32:
  14865. case 40:
  14866. CKEDITOR.tools.callFunction(e, b);
  14867. break;
  14868. default:
  14869. g.onkey(g, d)
  14870. }
  14871. a.preventDefault()
  14872. }), n = CKEDITOR.tools.addFunction(function () {
  14873. g.onfocus && g.onfocus()
  14874. }), l = 0;
  14875. g.keyDownFn = m;
  14876. c = {
  14877. id: h,
  14878. name: this.name || this.command,
  14879. label: this.label,
  14880. title: this.title,
  14881. cls: this.className || "",
  14882. titleJs: c.gecko && !c.hc ? "" : (this.title || "").replace("'", ""),
  14883. keydownFn: m,
  14884. focusFn: n,
  14885. clickFn: e
  14886. };
  14887. k.output(c, b);
  14888. if (this.onRender) this.onRender();
  14889. return g
  14890. }, createPanel: function (a) {
  14891. if (!this._.panel) {
  14892. var b = this._.panelDefinition, c = this._.panelDefinition.block,
  14893. k = b.parent || CKEDITOR.document.getBody(), h = "cke_combopanel__" + this.name,
  14894. e = new CKEDITOR.ui.floatPanel(a, k, b), b = e.addListBlock(this.id, c), d = this;
  14895. e.onShow = function () {
  14896. this.element.addClass(h);
  14897. d.setState(CKEDITOR.TRISTATE_ON);
  14898. d._.on = 1;
  14899. d.editorFocus && !a.focusManager.hasFocus && a.focus();
  14900. if (d.onOpen) d.onOpen()
  14901. };
  14902. e.onHide = function (b) {
  14903. this.element.removeClass(h);
  14904. d.setState(d.modes && d.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  14905. d._.on = 0;
  14906. if (!b && d.onClose) d.onClose()
  14907. };
  14908. e.onEscape = function () {
  14909. e.hide(1)
  14910. };
  14911. b.onClick = function (a, b) {
  14912. d.onClick && d.onClick.call(d, a, b);
  14913. e.hide()
  14914. };
  14915. this._.panel = e;
  14916. this._.list = b;
  14917. e.getBlock(this.id).onHide = function () {
  14918. d._.on = 0;
  14919. d.setState(CKEDITOR.TRISTATE_OFF)
  14920. };
  14921. this.init && this.init()
  14922. }
  14923. }, setValue: function (a,
  14924. b) {
  14925. this._.value = a;
  14926. var c = this.document.getById("cke_" + this.id + "_text");
  14927. c && (a || b ? c.removeClass("cke_combo_inlinelabel") : (b = this.label, c.addClass("cke_combo_inlinelabel")), c.setText("undefined" != typeof b ? b : a))
  14928. }, getValue: function () {
  14929. return this._.value || ""
  14930. }, unmarkAll: function () {
  14931. this._.list.unmarkAll()
  14932. }, mark: function (a) {
  14933. this._.list.mark(a)
  14934. }, hideItem: function (a) {
  14935. this._.list.hideItem(a)
  14936. }, hideGroup: function (a) {
  14937. this._.list.hideGroup(a)
  14938. }, showAll: function () {
  14939. this._.list.showAll()
  14940. }, add: function (a, b, c) {
  14941. this._.items[a] =
  14942. c || a;
  14943. this._.list.add(a, b, c)
  14944. }, startGroup: function (a) {
  14945. this._.list.startGroup(a)
  14946. }, commit: function () {
  14947. this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire("ready", this));
  14948. this._.committed = 1
  14949. }, setState: function (a) {
  14950. if (this._.state != a) {
  14951. var b = this.document.getById("cke_" + this.id);
  14952. b.setState(a, "cke_combo");
  14953. a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled");
  14954. this._.state = a
  14955. }
  14956. }, getState: function () {
  14957. return this._.state
  14958. }, enable: function () {
  14959. this._.state ==
  14960. CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
  14961. }, disable: function () {
  14962. this._.state != CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(CKEDITOR.TRISTATE_DISABLED))
  14963. }, destroy: function () {
  14964. CKEDITOR.tools.array.forEach(this._.listeners, function (a) {
  14965. a.removeListener()
  14966. });
  14967. this._.listeners = []
  14968. }
  14969. }, statics: {
  14970. handler: {
  14971. create: function (a) {
  14972. return new CKEDITOR.ui.richCombo(a)
  14973. }
  14974. }
  14975. }
  14976. });
  14977. CKEDITOR.ui.prototype.addRichCombo = function (a, b) {
  14978. this.add(a, CKEDITOR.UI_RICHCOMBO, b)
  14979. }
  14980. })();
  14981. (function () {
  14982. function p(b, f, e, d, r, p, t, x) {
  14983. var y = b.config, u = new CKEDITOR.style(t), g = r.split(";");
  14984. r = [];
  14985. for (var k = {}, l = 0; l < g.length; l++) {
  14986. var m = g[l];
  14987. if (m) {
  14988. var m = m.split("/"), w = {}, q = g[l] = m[0];
  14989. w[e] = r[l] = m[1] || q;
  14990. k[q] = new CKEDITOR.style(t, w);
  14991. k[q]._.definition.name = q
  14992. } else g.splice(l--, 1)
  14993. }
  14994. b.ui.addRichCombo(f, {
  14995. label: d.label,
  14996. title: d.panelTitle,
  14997. toolbar: "styles," + x,
  14998. defaultValue: "cke-default",
  14999. allowedContent: u,
  15000. requiredContent: u,
  15001. contentTransformations: "span" === t.element ? [[{
  15002. element: "font", check: "span", left: function (a) {
  15003. return !!a.attributes.size ||
  15004. !!a.attributes.align || !!a.attributes.face
  15005. }, right: function (a) {
  15006. var b = " x-small small medium large x-large xx-large 48px".split(" ");
  15007. a.name = "span";
  15008. a.attributes.size && (a.styles["font-size"] = b[a.attributes.size], delete a.attributes.size);
  15009. a.attributes.align && (a.styles["text-align"] = a.attributes.align, delete a.attributes.align);
  15010. a.attributes.face && (a.styles["font-family"] = a.attributes.face, delete a.attributes.face)
  15011. }
  15012. }]] : null,
  15013. panel: {
  15014. css: [CKEDITOR.skin.getPath("editor")].concat(y.contentsCss), multiSelect: !1,
  15015. attributes: {"aria-label": d.panelTitle}
  15016. },
  15017. init: function () {
  15018. var fName = b.element.$.style.fontFamily;
  15019. var a;
  15020. a = "(" + (fName || b.lang.common.optionDefault) + ")";
  15021. this.startGroup(d.panelTitle);
  15022. this.add(this.defaultValue, a, a);
  15023. for (var c = 0; c < g.length; c++) a = g[c], this.add(a, k[a].buildPreview(), a)
  15024. },
  15025. onClick: function (a) {
  15026. b.focus();
  15027. b.fire("saveSnapshot");
  15028. var c = this.getValue(), f = k[a], e, n, h, d, g;
  15029. if (c && a != c) if (e = k[c], c = b.getSelection().getRanges()[0], c.collapsed) {
  15030. if (n = b.elementPath(), h = n.contains(function (a) {
  15031. return e.checkElementRemovable(a)
  15032. })) {
  15033. d = c.checkBoundaryOfElement(h,
  15034. CKEDITOR.START);
  15035. g = c.checkBoundaryOfElement(h, CKEDITOR.END);
  15036. if (d && g) {
  15037. for (d = c.createBookmark(); n = h.getFirst();) n.insertBefore(h);
  15038. h.remove();
  15039. c.moveToBookmark(d)
  15040. } else d || g ? c.moveToPosition(h, d ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_END) : (c.splitElement(h), c.moveToPosition(h, CKEDITOR.POSITION_AFTER_END)), v(c, n.elements.slice(), h);
  15041. b.getSelection().selectRanges([c])
  15042. }
  15043. } else b.removeStyle(e);
  15044. a === this.defaultValue ? e && b.removeStyle(e) : b.applyStyle(f);
  15045. b.fire("saveSnapshot")
  15046. },
  15047. onRender: function () {
  15048. b.on("selectionChange",
  15049. function (a) {
  15050. var c = this.getValue();
  15051. a = a.data.path.elements;
  15052. for (var d = 0, f; d < a.length; d++) {
  15053. f = a[d];
  15054. for (var e in k) if (k[e].checkElementMatch(f, !0, b)) {
  15055. e != c && this.setValue(e);
  15056. return
  15057. }
  15058. }
  15059. this.setValue("", p)
  15060. }, this)
  15061. },
  15062. refresh: function () {
  15063. b.activeFilter.check(u) || this.setState(CKEDITOR.TRISTATE_DISABLED)
  15064. }
  15065. })
  15066. }
  15067. function v(b, f, e) {
  15068. var d = f.pop();
  15069. if (d) {
  15070. if (e) return v(b, f, d.equals(e) ? null : e);
  15071. e = d.clone();
  15072. b.insertNode(e);
  15073. b.moveToPosition(e, CKEDITOR.POSITION_AFTER_START);
  15074. v(b, f)
  15075. }
  15076. }
  15077. CKEDITOR.plugins.add("font", {
  15078. requires: "richcombo",
  15079. init: function (b) {
  15080. var f = b.config;
  15081. p(b, "Font", "family", b.lang.font, f.font_names, f.font_defaultLabel, f.font_style, 30);
  15082. p(b, "FontSize", "size", b.lang.font.fontSize, f.fontSize_sizes, f.fontSize_defaultLabel, f.fontSize_style, 40)
  15083. }
  15084. })
  15085. })();
  15086. CKEDITOR.config.font_names = "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";
  15087. CKEDITOR.config.font_defaultLabel = "";
  15088. CKEDITOR.config.font_style = {
  15089. element: "span",
  15090. styles: {"font-family": "#(family)"},
  15091. overrides: [{element: "font", attributes: {face: null}}]
  15092. };
  15093. CKEDITOR.config.fontSize_sizes = "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";
  15094. CKEDITOR.config.fontSize_defaultLabel = "";
  15095. CKEDITOR.config.fontSize_style = {
  15096. element: "span",
  15097. styles: {"font-size": "#(size)"},
  15098. overrides: [{element: "font", attributes: {size: null}}]
  15099. };
  15100. CKEDITOR.plugins.add("forms", {
  15101. requires: "dialog,fakeobjects", onLoad: function () {
  15102. CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n");
  15103. CKEDITOR.addCss("img.cke_hidden{background-image: url(" + CKEDITOR.getUrl(this.path + "images/hiddenfield.gif") + ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}")
  15104. }, init: function (b) {
  15105. var a = b.lang, g = 0, h = {email: 1, password: 1, search: 1, tel: 1, text: 1, url: 1}, l = {
  15106. checkbox: "input[type,name,checked,required]",
  15107. radio: "input[type,name,checked,required]",
  15108. textfield: "input[type,name,value,size,maxlength,required]",
  15109. textarea: "textarea[cols,rows,name,required]",
  15110. select: "select[name,size,multiple,required]; option[value,selected]",
  15111. button: "input[type,name,value]",
  15112. form: "form[action,name,id,enctype,target,method]",
  15113. hiddenfield: "input[type,name,value]",
  15114. imagebutton: "input[type,alt,src]{width,height,border,border-width,border-style,margin,float}"
  15115. }, m = {
  15116. checkbox: "input", radio: "input", textfield: "input", textarea: "textarea",
  15117. select: "select", button: "input", form: "form", hiddenfield: "input", imagebutton: "input"
  15118. }, d = function (f, c, d) {
  15119. var h = {allowedContent: l[c], requiredContent: m[c]};
  15120. "form" == c && (h.context = "form");
  15121. b.addCommand(c, new CKEDITOR.dialogCommand(c, h));
  15122. b.ui.addButton && b.ui.addButton(f, {
  15123. label: a.common[f.charAt(0).toLowerCase() + f.slice(1)],
  15124. command: c,
  15125. toolbar: "forms," + (g += 10)
  15126. });
  15127. CKEDITOR.dialog.add(c, d)
  15128. }, e = this.path + "dialogs/";
  15129. !b.blockless && d("Form", "form", e + "form.js");
  15130. d("Checkbox", "checkbox", e + "checkbox.js");
  15131. d("Radio", "radio",
  15132. e + "radio.js");
  15133. d("TextField", "textfield", e + "textfield.js");
  15134. d("Textarea", "textarea", e + "textarea.js");
  15135. d("Select", "select", e + "select.js");
  15136. d("Button", "button", e + "button.js");
  15137. var k = b.plugins.image;
  15138. k && !b.plugins.image2 && d("ImageButton", "imagebutton", CKEDITOR.plugins.getPath("image") + "dialogs/image.js");
  15139. d("HiddenField", "hiddenfield", e + "hiddenfield.js");
  15140. b.addMenuItems && (d = {
  15141. checkbox: {label: a.forms.checkboxAndRadio.checkboxTitle, command: "checkbox", group: "checkbox"},
  15142. radio: {
  15143. label: a.forms.checkboxAndRadio.radioTitle,
  15144. command: "radio", group: "radio"
  15145. },
  15146. textfield: {label: a.forms.textfield.title, command: "textfield", group: "textfield"},
  15147. hiddenfield: {label: a.forms.hidden.title, command: "hiddenfield", group: "hiddenfield"},
  15148. button: {label: a.forms.button.title, command: "button", group: "button"},
  15149. select: {label: a.forms.select.title, command: "select", group: "select"},
  15150. textarea: {label: a.forms.textarea.title, command: "textarea", group: "textarea"}
  15151. }, k && (d.imagebutton = {
  15152. label: a.image.titleButton,
  15153. command: "imagebutton",
  15154. group: "imagebutton"
  15155. }), !b.blockless &&
  15156. (d.form = {label: a.forms.form.menu, command: "form", group: "form"}), b.addMenuItems(d));
  15157. b.contextMenu && (!b.blockless && b.contextMenu.addListener(function (f, c, b) {
  15158. if ((f = b.contains("form", 1)) && !f.isReadOnly()) return {form: CKEDITOR.TRISTATE_OFF}
  15159. }), b.contextMenu.addListener(function (b) {
  15160. if (b && !b.isReadOnly()) {
  15161. var c = b.getName();
  15162. if ("select" == c) return {select: CKEDITOR.TRISTATE_OFF};
  15163. if ("textarea" == c) return {textarea: CKEDITOR.TRISTATE_OFF};
  15164. if ("input" == c) {
  15165. var a = b.getAttribute("type") || "text";
  15166. switch (a) {
  15167. case "button":
  15168. case "submit":
  15169. case "reset":
  15170. return {button: CKEDITOR.TRISTATE_OFF};
  15171. case "checkbox":
  15172. return {checkbox: CKEDITOR.TRISTATE_OFF};
  15173. case "radio":
  15174. return {radio: CKEDITOR.TRISTATE_OFF};
  15175. case "image":
  15176. return k ? {imagebutton: CKEDITOR.TRISTATE_OFF} : null
  15177. }
  15178. if (h[a]) return {textfield: CKEDITOR.TRISTATE_OFF}
  15179. }
  15180. if ("img" == c && "hiddenfield" == b.data("cke-real-element-type")) return {hiddenfield: CKEDITOR.TRISTATE_OFF}
  15181. }
  15182. }));
  15183. b.on("doubleclick", function (a) {
  15184. var c = a.data.element;
  15185. if (!b.blockless && c.is("form")) a.data.dialog = "form"; else if (c.is("select")) a.data.dialog = "select"; else if (c.is("textarea")) a.data.dialog =
  15186. "textarea"; else if (c.is("img") && "hiddenfield" == c.data("cke-real-element-type")) a.data.dialog = "hiddenfield"; else if (c.is("input")) {
  15187. c = c.getAttribute("type") || "text";
  15188. switch (c) {
  15189. case "button":
  15190. case "submit":
  15191. case "reset":
  15192. a.data.dialog = "button";
  15193. break;
  15194. case "checkbox":
  15195. a.data.dialog = "checkbox";
  15196. break;
  15197. case "radio":
  15198. a.data.dialog = "radio";
  15199. break;
  15200. case "image":
  15201. a.data.dialog = "imagebutton"
  15202. }
  15203. h[c] && (a.data.dialog = "textfield")
  15204. }
  15205. })
  15206. }, afterInit: function (b) {
  15207. var a = b.dataProcessor, g = a && a.htmlFilter, a = a && a.dataFilter;
  15208. CKEDITOR.env.ie &&
  15209. g && g.addRules({
  15210. elements: {
  15211. input: function (a) {
  15212. a = a.attributes;
  15213. var b = a.type;
  15214. b || (a.type = "text");
  15215. "checkbox" != b && "radio" != b || "on" != a.value || delete a.value
  15216. }
  15217. }
  15218. }, {applyToAll: !0});
  15219. a && a.addRules({
  15220. elements: {
  15221. input: function (a) {
  15222. if ("hidden" == a.attributes.type) return b.createFakeParserElement(a, "cke_hidden", "hiddenfield")
  15223. }
  15224. }
  15225. }, {applyToAll: !0})
  15226. }
  15227. });
  15228. CKEDITOR.plugins.forms = {
  15229. _setupRequiredAttribute: function (b) {
  15230. this.setValue(b.hasAttribute("required"))
  15231. }
  15232. };
  15233. CKEDITOR.plugins.add("format", {
  15234. requires: "richcombo", init: function (a) {
  15235. if (!a.blockless) {
  15236. for (var f = a.config, c = a.lang.format, l = f.format_tags.split(";"), d = {}, m = 0, n = [], g = 0; g < l.length; g++) {
  15237. var h = l[g], k = new CKEDITOR.style(f["format_" + h]);
  15238. if (!a.filter.customConfig || a.filter.check(k)) m++, d[h] = k, d[h]._.enterMode = a.config.enterMode, n.push(k)
  15239. }
  15240. 0 !== m && a.ui.addRichCombo("Format", {
  15241. label: c.label, title: c.panelTitle, toolbar: "styles,20", allowedContent: n, panel: {
  15242. css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
  15243. multiSelect: !1, attributes: {"aria-label": c.panelTitle}
  15244. }, init: function () {
  15245. this.startGroup(c.panelTitle);
  15246. for (var a in d) {
  15247. var e = c["tag_" + a];
  15248. this.add(a, d[a].buildPreview(e), e)
  15249. }
  15250. }, onClick: function (b) {
  15251. a.focus();
  15252. a.fire("saveSnapshot");
  15253. b = d[b];
  15254. var e = a.elementPath();
  15255. b.checkActive(e, a) || a.applyStyle(b);
  15256. setTimeout(function () {
  15257. a.fire("saveSnapshot")
  15258. }, 0)
  15259. }, onRender: function () {
  15260. a.on("selectionChange", function (b) {
  15261. var e = this.getValue();
  15262. b = b.data.path;
  15263. this.refresh();
  15264. for (var c in d) if (d[c].checkActive(b, a)) {
  15265. c != e && this.setValue(c,
  15266. a.lang.format["tag_" + c]);
  15267. return
  15268. }
  15269. this.setValue("")
  15270. }, this)
  15271. }, onOpen: function () {
  15272. this.showAll();
  15273. for (var b in d) a.activeFilter.check(d[b]) || this.hideItem(b)
  15274. }, refresh: function () {
  15275. var b = a.elementPath();
  15276. if (b) {
  15277. if (b.isContextFor("p")) for (var c in d) if (a.activeFilter.check(d[c])) return;
  15278. this.setState(CKEDITOR.TRISTATE_DISABLED)
  15279. }
  15280. }
  15281. })
  15282. }
  15283. }
  15284. });
  15285. CKEDITOR.config.format_tags = "p;h1;h2;h3;h4;h5;h6;pre;address;div";
  15286. CKEDITOR.config.format_p = {element: "p"};
  15287. CKEDITOR.config.format_div = {element: "div"};
  15288. CKEDITOR.config.format_pre = {element: "pre"};
  15289. CKEDITOR.config.format_address = {element: "address"};
  15290. CKEDITOR.config.format_h1 = {element: "h1"};
  15291. CKEDITOR.config.format_h2 = {element: "h2"};
  15292. CKEDITOR.config.format_h3 = {element: "h3"};
  15293. CKEDITOR.config.format_h4 = {element: "h4"};
  15294. CKEDITOR.config.format_h5 = {element: "h5"};
  15295. CKEDITOR.config.format_h6 = {element: "h6"};
  15296. (function () {
  15297. var b = {
  15298. canUndo: !1, exec: function (a) {
  15299. var b = a.document.createElement("hr");
  15300. a.insertElement(b)
  15301. }, allowedContent: "hr", requiredContent: "hr"
  15302. };
  15303. CKEDITOR.plugins.add("horizontalrule", {
  15304. init: function (a) {
  15305. a.blockless || (a.addCommand("horizontalrule", b), a.ui.addButton && a.ui.addButton("HorizontalRule", {
  15306. label: a.lang.horizontalrule.toolbar,
  15307. command: "horizontalrule",
  15308. toolbar: "insert,40"
  15309. }))
  15310. }
  15311. })
  15312. })();
  15313. CKEDITOR.plugins.add("htmlwriter", {
  15314. init: function (b) {
  15315. var a = new CKEDITOR.htmlWriter;
  15316. a.forceSimpleAmpersand = b.config.forceSimpleAmpersand;
  15317. a.indentationChars = b.config.dataIndentationChars || "\t";
  15318. b.dataProcessor.writer = a
  15319. }
  15320. });
  15321. CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({
  15322. base: CKEDITOR.htmlParser.basicWriter, $: function () {
  15323. this.base();
  15324. this.indentationChars = "\t";
  15325. this.selfClosingEnd = " /\x3e";
  15326. this.lineBreakChars = "\n";
  15327. this.sortAttributes = 1;
  15328. this._.indent = 0;
  15329. this._.indentation = "";
  15330. this._.inPre = 0;
  15331. this._.rules = {};
  15332. var b = CKEDITOR.dtd, a;
  15333. for (a in CKEDITOR.tools.extend({}, b.$nonBodyContent, b.$block, b.$listItem, b.$tableContent)) this.setRules(a, {
  15334. indent: !b[a]["#"],
  15335. breakBeforeOpen: 1,
  15336. breakBeforeClose: !b[a]["#"],
  15337. breakAfterClose: 1,
  15338. needsSpace: a in
  15339. b.$block && !(a in {li: 1, dt: 1, dd: 1})
  15340. });
  15341. this.setRules("br", {breakAfterOpen: 1});
  15342. this.setRules("title", {indent: 0, breakAfterOpen: 0});
  15343. this.setRules("style", {indent: 0, breakBeforeClose: 1});
  15344. this.setRules("pre", {breakAfterOpen: 1, indent: 0})
  15345. }, proto: {
  15346. openTag: function (b) {
  15347. var a = this._.rules[b];
  15348. this._.afterCloser && a && a.needsSpace && this._.needsSpace && this._.output.push("\n");
  15349. this._.indent ? this.indentation() : a && a.breakBeforeOpen && (this.lineBreak(), this.indentation());
  15350. this._.output.push("\x3c", b);
  15351. this._.afterCloser = 0
  15352. },
  15353. openTagClose: function (b, a) {
  15354. var c = this._.rules[b];
  15355. a ? (this._.output.push(this.selfClosingEnd), c && c.breakAfterClose && (this._.needsSpace = c.needsSpace)) : (this._.output.push("\x3e"), c && c.indent && (this._.indentation += this.indentationChars));
  15356. c && c.breakAfterOpen && this.lineBreak();
  15357. "pre" == b && (this._.inPre = 1)
  15358. }, attribute: function (b, a) {
  15359. "string" == typeof a && (a = CKEDITOR.tools.htmlEncodeAttr(a), this.forceSimpleAmpersand && (a = a.replace(/&amp;/g, "\x26")));
  15360. this._.output.push(" ", b, '\x3d"', a, '"')
  15361. }, closeTag: function (b) {
  15362. var a =
  15363. this._.rules[b];
  15364. a && a.indent && (this._.indentation = this._.indentation.substr(this.indentationChars.length));
  15365. this._.indent ? this.indentation() : a && a.breakBeforeClose && (this.lineBreak(), this.indentation());
  15366. this._.output.push("\x3c/", b, "\x3e");
  15367. "pre" == b && (this._.inPre = 0);
  15368. a && a.breakAfterClose && (this.lineBreak(), this._.needsSpace = a.needsSpace);
  15369. this._.afterCloser = 1
  15370. }, text: function (b) {
  15371. this._.indent && (this.indentation(), !this._.inPre && (b = CKEDITOR.tools.ltrim(b)));
  15372. this._.output.push(b)
  15373. }, comment: function (b) {
  15374. this._.indent &&
  15375. this.indentation();
  15376. this._.output.push("\x3c!--", b, "--\x3e")
  15377. }, lineBreak: function () {
  15378. !this._.inPre && 0 < this._.output.length && this._.output.push(this.lineBreakChars);
  15379. this._.indent = 1
  15380. }, indentation: function () {
  15381. !this._.inPre && this._.indentation && this._.output.push(this._.indentation);
  15382. this._.indent = 0
  15383. }, reset: function () {
  15384. this._.output = [];
  15385. this._.indent = 0;
  15386. this._.indentation = "";
  15387. this._.afterCloser = 0;
  15388. this._.inPre = 0;
  15389. this._.needsSpace = 0
  15390. }, setRules: function (b, a) {
  15391. var c = this._.rules[b];
  15392. c ? CKEDITOR.tools.extend(c, a, !0) : this._.rules[b] =
  15393. a
  15394. }
  15395. }
  15396. });
  15397. (function () {
  15398. CKEDITOR.plugins.add("iframe", {
  15399. requires: "dialog,fakeobjects", onLoad: function () {
  15400. CKEDITOR.addCss("img.cke_iframe{background-image: url(" + CKEDITOR.getUrl(this.path + "images/placeholder.png") + ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")
  15401. }, init: function (a) {
  15402. var b = a.lang.iframe, c = "iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]";
  15403. a.plugins.dialogadvtab && (c += ";iframe" + a.plugins.dialogadvtab.allowedContent({
  15404. id: 1,
  15405. classes: 1, styles: 1
  15406. }));
  15407. CKEDITOR.dialog.add("iframe", this.path + "dialogs/iframe.js");
  15408. a.addCommand("iframe", new CKEDITOR.dialogCommand("iframe", {
  15409. allowedContent: c,
  15410. requiredContent: "iframe"
  15411. }));
  15412. a.ui.addButton && a.ui.addButton("Iframe", {label: b.toolbar, command: "iframe", toolbar: "insert,80"});
  15413. a.on("doubleclick", function (a) {
  15414. var b = a.data.element;
  15415. b.is("img") && "iframe" == b.data("cke-real-element-type") && (a.data.dialog = "iframe")
  15416. });
  15417. a.addMenuItems && a.addMenuItems({iframe: {label: b.title, command: "iframe", group: "image"}});
  15418. a.contextMenu && a.contextMenu.addListener(function (a) {
  15419. if (a && a.is("img") && "iframe" == a.data("cke-real-element-type")) return {iframe: CKEDITOR.TRISTATE_OFF}
  15420. })
  15421. }, afterInit: function (a) {
  15422. var b = a.dataProcessor;
  15423. (b = b && b.dataFilter) && b.addRules({
  15424. elements: {
  15425. iframe: function (b) {
  15426. return a.createFakeParserElement(b, "cke_iframe", "iframe", !0)
  15427. }
  15428. }
  15429. })
  15430. }
  15431. })
  15432. })();
  15433. (function () {
  15434. function m(a) {
  15435. function f(a) {
  15436. var b = !1;
  15437. g.attachListener(g, "keydown", function () {
  15438. var d = c.getBody().getElementsByTag(a);
  15439. if (!b) {
  15440. for (var e = 0; e < d.count(); e++) d.getItem(e).setCustomData("retain", !0);
  15441. b = !0
  15442. }
  15443. }, null, null, 1);
  15444. g.attachListener(g, "keyup", function () {
  15445. var d = c.getElementsByTag(a);
  15446. b && (1 == d.count() && !d.getItem(0).getCustomData("retain") && CKEDITOR.tools.isEmpty(d.getItem(0).getAttributes()) && d.getItem(0).remove(1), b = !1)
  15447. })
  15448. }
  15449. var b = this.editor, c = a.document, d = c.body, e = c.getElementById("cke_actscrpt");
  15450. e && e.parentNode.removeChild(e);
  15451. (e = c.getElementById("cke_shimscrpt")) && e.parentNode.removeChild(e);
  15452. (e = c.getElementById("cke_basetagscrpt")) && e.parentNode.removeChild(e);
  15453. d.contentEditable = !0;
  15454. CKEDITOR.env.ie && (d.hideFocus = !0, d.disabled = !0, d.removeAttribute("disabled"));
  15455. delete this._.isLoadingData;
  15456. this.$ = d;
  15457. c = new CKEDITOR.dom.document(c);
  15458. this.setup();
  15459. this.fixInitialSelection();
  15460. var g = this;
  15461. CKEDITOR.env.ie && !CKEDITOR.env.edge && c.getDocumentElement().addClass(c.$.compatMode);
  15462. CKEDITOR.env.ie && !CKEDITOR.env.edge &&
  15463. b.enterMode != CKEDITOR.ENTER_P ? f("p") : CKEDITOR.env.edge && 15 > CKEDITOR.env.version && b.enterMode != CKEDITOR.ENTER_DIV && f("div");
  15464. if (CKEDITOR.env.webkit || CKEDITOR.env.ie && 10 < CKEDITOR.env.version) c.getDocumentElement().on("mousedown", function (a) {
  15465. a.data.getTarget().is("html") && setTimeout(function () {
  15466. b.editable().focus()
  15467. })
  15468. });
  15469. n(b);
  15470. try {
  15471. b.document.$.execCommand("2D-position", !1, !0)
  15472. } catch (h) {
  15473. }
  15474. (CKEDITOR.env.gecko || CKEDITOR.env.ie && "CSS1Compat" == b.document.$.compatMode) && this.attachListener(this, "keydown", function (a) {
  15475. var c =
  15476. a.data.getKeystroke();
  15477. if (33 == c || 34 == c) if (CKEDITOR.env.ie) setTimeout(function () {
  15478. b.getSelection().scrollIntoView()
  15479. }, 0); else if (b.window.$.innerHeight > this.$.offsetHeight) {
  15480. var d = b.createRange();
  15481. d[33 == c ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
  15482. d.select();
  15483. a.data.preventDefault()
  15484. }
  15485. });
  15486. CKEDITOR.env.ie && this.attachListener(c, "blur", function () {
  15487. try {
  15488. c.$.selection.empty()
  15489. } catch (a) {
  15490. }
  15491. });
  15492. CKEDITOR.env.iOS && this.attachListener(c, "touchend", function () {
  15493. a.focus()
  15494. });
  15495. d = b.document.getElementsByTag("title").getItem(0);
  15496. d.data("cke-title", d.getText());
  15497. CKEDITOR.env.ie && (b.document.$.title = this._.docTitle);
  15498. CKEDITOR.tools.setTimeout(function () {
  15499. "unloaded" == this.status && (this.status = "ready");
  15500. b.fire("contentDom");
  15501. this._.isPendingFocus && (b.focus(), this._.isPendingFocus = !1);
  15502. setTimeout(function () {
  15503. b.fire("dataReady")
  15504. }, 0)
  15505. }, 0, this)
  15506. }
  15507. function n(a) {
  15508. function f() {
  15509. var c;
  15510. a.editable().attachListener(a, "selectionChange", function () {
  15511. var d = a.getSelection().getSelectedElement();
  15512. d && (c && (c.detachEvent("onresizestart", b), c = null), d.$.attachEvent("onresizestart",
  15513. b), c = d.$)
  15514. })
  15515. }
  15516. function b(a) {
  15517. a.returnValue = !1
  15518. }
  15519. if (CKEDITOR.env.gecko) try {
  15520. var c = a.document.$;
  15521. c.execCommand("enableObjectResizing", !1, !a.config.disableObjectResizing);
  15522. c.execCommand("enableInlineTableEditing", !1, !a.config.disableNativeTableHandles)
  15523. } catch (d) {
  15524. } else CKEDITOR.env.ie && 11 > CKEDITOR.env.version && a.config.disableObjectResizing && f(a)
  15525. }
  15526. function p() {
  15527. var a = [];
  15528. if (8 <= CKEDITOR.document.$.documentMode) {
  15529. a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");
  15530. var f = [], b;
  15531. for (b in CKEDITOR.dtd.$removeEmpty) f.push("html.CSS1Compat " +
  15532. b + "[contenteditable\x3dfalse]");
  15533. a.push(f.join(",") + "{display:inline-block}")
  15534. } else CKEDITOR.env.gecko && (a.push("html{height:100% !important}"), a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));
  15535. a.push("html{cursor:text;*cursor:auto}");
  15536. a.push("img,input,textarea{cursor:default}");
  15537. return a.join("\n")
  15538. }
  15539. var l;
  15540. CKEDITOR.plugins.add("wysiwygarea", {
  15541. init: function (a) {
  15542. a.config.fullPage && a.addFeature({
  15543. allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]",
  15544. requiredContent: "body"
  15545. });
  15546. a.addMode("wysiwyg", function (f) {
  15547. function b(b) {
  15548. b && b.removeListener();
  15549. a.editable(new l(a, d.$.contentWindow.document.body));
  15550. a.setData(a.getData(1), f)
  15551. }
  15552. var c = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();",
  15553. c = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ? "javascript:void(function(){" + encodeURIComponent(c) + "}())" : "",
  15554. d = CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"' + c + '" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');
  15555. d.setStyles({width: "100%", height: "100%"});
  15556. d.addClass("cke_wysiwyg_frame").addClass("cke_reset");
  15557. c = a.ui.space("contents");
  15558. c.append(d);
  15559. var e = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.gecko;
  15560. if (e) d.on("load", b);
  15561. var g = a.title, h = a.fire("ariaEditorHelpLabel", {}).label;
  15562. g && (CKEDITOR.env.ie && h && (g += ", " + h), d.setAttribute("title", g));
  15563. if (h) {
  15564. var g = CKEDITOR.tools.getNextId(),
  15565. k = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + g + '" class\x3d"cke_voice_label"\x3e' + h + "\x3c/span\x3e");
  15566. c.append(k, 1);
  15567. d.setAttribute("aria-describedby",
  15568. g)
  15569. }
  15570. a.on("beforeModeUnload", function (a) {
  15571. a.removeListener();
  15572. k && k.remove()
  15573. });
  15574. d.setAttributes({tabIndex: a.tabIndex, allowTransparency: "true"});
  15575. !e && b();
  15576. a.fire("ariaWidget", d)
  15577. })
  15578. }
  15579. });
  15580. CKEDITOR.editor.prototype.addContentsCss = function (a) {
  15581. var f = this.config, b = f.contentsCss;
  15582. CKEDITOR.tools.isArray(b) || (f.contentsCss = b ? [b] : []);
  15583. f.contentsCss.push(a)
  15584. };
  15585. l = CKEDITOR.tools.createClass({
  15586. $: function () {
  15587. this.base.apply(this, arguments);
  15588. this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function (a) {
  15589. CKEDITOR.tools.setTimeout(m,
  15590. 0, this, a)
  15591. }, this);
  15592. this._.docTitle = this.getWindow().getFrame().getAttribute("title")
  15593. }, base: CKEDITOR.editable, proto: {
  15594. setData: function (a, f) {
  15595. var b = this.editor;
  15596. if (f) this.setHtml(a), this.fixInitialSelection(), b.fire("dataReady"); else {
  15597. this._.isLoadingData = !0;
  15598. b._.dataStore = {id: 1};
  15599. var c = b.config, d = c.fullPage, e = c.docType,
  15600. g = CKEDITOR.tools.buildStyleHtml(p()).replace(/<style>/, '\x3cstyle data-cke-temp\x3d"1"\x3e');
  15601. d || (g += CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));
  15602. var h = c.baseHref ? '\x3cbase href\x3d"' +
  15603. c.baseHref + '" data-cke-temp\x3d"1" /\x3e' : "";
  15604. d && (a = a.replace(/<!DOCTYPE[^>]*>/i, function (a) {
  15605. b.docType = e = a;
  15606. return ""
  15607. }).replace(/<\?xml\s[^\?]*\?>/i, function (a) {
  15608. b.xmlDeclaration = a;
  15609. return ""
  15610. }));
  15611. a = b.dataProcessor.toHtml(a);
  15612. d ? (/<body[\s|>]/.test(a) || (a = "\x3cbody\x3e" + a), /<html[\s|>]/.test(a) || (a = "\x3chtml\x3e" + a + "\x3c/html\x3e"), /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (a = a.replace(/<head[^>]*>/, "$\x26\x3ctitle\x3e\x3c/title\x3e")) : a = a.replace(/<html[^>]*>/, "$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),
  15613. h && (a = a.replace(/<head[^>]*?>/, "$\x26" + h)), a = a.replace(/<\/head\s*>/, g + "$\x26"), a = e + a) : a = c.docType + '\x3chtml dir\x3d"' + c.contentsLangDirection + '" lang\x3d"' + (c.contentsLanguage || b.langCode) + '"\x3e\x3chead\x3e\x3ctitle\x3e' + this._.docTitle + "\x3c/title\x3e" + h + g + "\x3c/head\x3e\x3cbody" + (c.bodyId ? ' id\x3d"' + c.bodyId + '"' : "") + (c.bodyClass ? ' class\x3d"' + c.bodyClass + '"' : "") + "\x3e" + a + "\x3c/body\x3e\x3c/html\x3e";
  15614. CKEDITOR.env.gecko && (a = a.replace(/<body/, '\x3cbody contenteditable\x3d"true" '), 2E4 > CKEDITOR.env.version &&
  15615. (a = a.replace(/<body[^>]*>/, "$\x26\x3c!-- cke-content-start --\x3e")));
  15616. c = '\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"' + (CKEDITOR.env.ie ? ' defer\x3d"defer" ' : "") + "\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction(" + this._.frameLoadedHandler + ",window);wasLoaded\x3d1;}" + (CKEDITOR.env.ie ? "onload();" : 'document.addEventListener("DOMContentLoaded", onload, false );') + "\x3c/script\x3e";
  15617. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (c += '\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
  15618. h && CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (c += '\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');
  15619. a = a.replace(/(?=\s*<\/(:?head)>)/, c);
  15620. this.clearCustomData();
  15621. this.clearListeners();
  15622. b.fire("contentDomUnload");
  15623. var k = this.getDocument();
  15624. try {
  15625. k.write(a)
  15626. } catch (l) {
  15627. setTimeout(function () {
  15628. k.write(a)
  15629. }, 0)
  15630. }
  15631. }
  15632. }, getData: function (a) {
  15633. if (a) return this.getHtml();
  15634. a = this.editor;
  15635. var f = a.config, b = f.fullPage, c = b && a.docType, d = b && a.xmlDeclaration,
  15636. e = this.getDocument(), b = b ? e.getDocumentElement().getOuterHtml() : e.getBody().getHtml();
  15637. CKEDITOR.env.gecko && f.enterMode != CKEDITOR.ENTER_BR && (b = b.replace(/<br>(?=\s*(:?$|<\/body>))/, ""));
  15638. b = a.dataProcessor.toDataFormat(b);
  15639. d && (b = d + "\n" + b);
  15640. c && (b = c + "\n" + b);
  15641. return b
  15642. }, focus: function () {
  15643. this._.isLoadingData ? this._.isPendingFocus = !0 : l.baseProto.focus.call(this)
  15644. }, detach: function () {
  15645. var a = this.editor, f = a.document, b;
  15646. try {
  15647. b = a.window.getFrame()
  15648. } catch (c) {
  15649. }
  15650. l.baseProto.detach.call(this);
  15651. this.clearCustomData();
  15652. f.getDocumentElement().clearCustomData();
  15653. CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
  15654. b && b.getParent() ? (b.clearCustomData(), (a = b.removeCustomData("onResize")) && a.removeListener(), b.remove()) : CKEDITOR.warn("editor-destroy-iframe")
  15655. }
  15656. }
  15657. })
  15658. })();
  15659. CKEDITOR.config.disableObjectResizing = !1;
  15660. CKEDITOR.config.disableNativeTableHandles = !0;
  15661. CKEDITOR.config.disableNativeSpellChecker = !0;
  15662. (function () {
  15663. function e(b, a) {
  15664. a || (a = b.getSelection().getSelectedElement());
  15665. if (a && a.is("img") && !a.data("cke-realelement") && !a.isReadOnly()) return a
  15666. }
  15667. function f(b) {
  15668. var a = b.getStyle("float");
  15669. if ("inherit" == a || "none" == a) a = 0;
  15670. a || (a = b.getAttribute("align"));
  15671. return a
  15672. }
  15673. CKEDITOR.plugins.add("image", {
  15674. requires: "dialog", init: function (b) {
  15675. if (!b.plugins.detectConflict("image", ["easyimage", "image2"])) {
  15676. CKEDITOR.dialog.add("image", this.path + "dialogs/image.js");
  15677. var a = "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
  15678. CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (a = "img[data-orgid,data-enablepreview,data-id,alt,dir,id,lang,longdesc,!src,title]{*}(*)");
  15679. b.addCommand("image", new CKEDITOR.dialogCommand("image", {
  15680. allowedContent: a,
  15681. requiredContent: "img[alt,src]",
  15682. contentTransformations: [["img{width}: sizeToStyle", "img[width]: sizeToAttribute"], ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"]]
  15683. }));
  15684. b.ui.addButton && b.ui.addButton("Image", {
  15685. label: b.lang.common.image,
  15686. command: "image",
  15687. toolbar: "insert,10"
  15688. });
  15689. b.on("doubleclick", function (b) {
  15690. var a =
  15691. b.data.element;
  15692. !a.is("img") || a.data("cke-realelement") || a.isReadOnly() || (b.data.dialog = "image")
  15693. });
  15694. b.addMenuItems && b.addMenuItems({
  15695. image: {
  15696. label: b.lang.image.menu,
  15697. command: "image",
  15698. group: "image"
  15699. }
  15700. });
  15701. b.contextMenu && b.contextMenu.addListener(function (a) {
  15702. if (e(b, a)) return {image: CKEDITOR.TRISTATE_OFF}
  15703. })
  15704. }
  15705. }, afterInit: function (b) {
  15706. function a(a) {
  15707. var d = b.getCommand("justify" + a);
  15708. if (d) {
  15709. if ("left" == a || "right" == a) d.on("exec", function (d) {
  15710. var c = e(b), g;
  15711. c && (g = f(c), g == a ? (c.removeStyle("float"), a == f(c) && c.removeAttribute("align")) :
  15712. c.setStyle("float", a), d.cancel())
  15713. });
  15714. d.on("refresh", function (d) {
  15715. var c = e(b);
  15716. c && (c = f(c), this.setState(c == a ? CKEDITOR.TRISTATE_ON : "right" == a || "left" == a ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED), d.cancel())
  15717. })
  15718. }
  15719. }
  15720. b.plugins.image2 || (a("left"), a("right"), a("center"), a("block"))
  15721. }
  15722. })
  15723. })();
  15724. CKEDITOR.config.image_removeLinkByEmptyURL = !0;
  15725. (function () {
  15726. function m(a, b) {
  15727. var e, f;
  15728. b.on("refresh", function (a) {
  15729. var b = [k], c;
  15730. for (c in a.data.states) b.push(a.data.states[c]);
  15731. this.setState(CKEDITOR.tools.search(b, p) ? p : k)
  15732. }, b, null, 100);
  15733. b.on("exec", function (b) {
  15734. e = a.getSelection();
  15735. f = e.createBookmarks(1);
  15736. b.data || (b.data = {});
  15737. b.data.done = !1
  15738. }, b, null, 0);
  15739. b.on("exec", function () {
  15740. a.forceNextSelectionCheck();
  15741. e.selectBookmarks(f)
  15742. }, b, null, 100)
  15743. }
  15744. var k = CKEDITOR.TRISTATE_DISABLED, p = CKEDITOR.TRISTATE_OFF;
  15745. CKEDITOR.plugins.add("indent", {
  15746. init: function (a) {
  15747. var b = CKEDITOR.plugins.indent.genericDefinition;
  15748. m(a, a.addCommand("indent", new b(!0)));
  15749. m(a, a.addCommand("outdent", new b));
  15750. a.ui.addButton && (a.ui.addButton("Indent", {
  15751. label: a.lang.indent.indent,
  15752. command: "indent",
  15753. directional: !0,
  15754. toolbar: "indent,20"
  15755. }), a.ui.addButton("Outdent", {
  15756. label: a.lang.indent.outdent,
  15757. command: "outdent",
  15758. directional: !0,
  15759. toolbar: "indent,10"
  15760. }));
  15761. a.on("dirChanged", function (b) {
  15762. var f = a.createRange(), l = b.data.node;
  15763. f.setStartBefore(l);
  15764. f.setEndAfter(l);
  15765. for (var n = new CKEDITOR.dom.walker(f), c; c = n.next();) if (c.type == CKEDITOR.NODE_ELEMENT) if (!c.equals(l) &&
  15766. c.getDirection()) f.setStartAfter(c), n = new CKEDITOR.dom.walker(f); else {
  15767. var d = a.config.indentClasses;
  15768. if (d) for (var g = "ltr" == b.data.dir ? ["_rtl", ""] : ["", "_rtl"], h = 0; h < d.length; h++) c.hasClass(d[h] + g[0]) && (c.removeClass(d[h] + g[0]), c.addClass(d[h] + g[1]));
  15769. d = c.getStyle("margin-right");
  15770. g = c.getStyle("margin-left");
  15771. d ? c.setStyle("margin-left", d) : c.removeStyle("margin-left");
  15772. g ? c.setStyle("margin-right", g) : c.removeStyle("margin-right")
  15773. }
  15774. })
  15775. }
  15776. });
  15777. CKEDITOR.plugins.indent = {
  15778. genericDefinition: function (a) {
  15779. this.isIndent = !!a;
  15780. this.startDisabled = !this.isIndent
  15781. }, specificDefinition: function (a, b, e) {
  15782. this.name = b;
  15783. this.editor = a;
  15784. this.jobs = {};
  15785. this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
  15786. this.isIndent = !!e;
  15787. this.relatedGlobal = e ? "indent" : "outdent";
  15788. this.indentKey = e ? 9 : CKEDITOR.SHIFT + 9;
  15789. this.database = {}
  15790. }, registerCommands: function (a, b) {
  15791. a.on("pluginsLoaded", function () {
  15792. for (var a in b) (function (a, b) {
  15793. var e = a.getCommand(b.relatedGlobal), c;
  15794. for (c in b.jobs) e.on("exec", function (d) {
  15795. d.data.done || (a.fire("lockSnapshot"), b.execJob(a, c) && (d.data.done =
  15796. !0), a.fire("unlockSnapshot"), CKEDITOR.dom.element.clearAllMarkers(b.database))
  15797. }, this, null, c), e.on("refresh", function (d) {
  15798. d.data.states || (d.data.states = {});
  15799. d.data.states[b.name + "@" + c] = b.refreshJob(a, c, d.data.path)
  15800. }, this, null, c);
  15801. a.addFeature(b)
  15802. })(this, b[a])
  15803. })
  15804. }
  15805. };
  15806. CKEDITOR.plugins.indent.genericDefinition.prototype = {
  15807. context: "p", exec: function () {
  15808. }
  15809. };
  15810. CKEDITOR.plugins.indent.specificDefinition.prototype = {
  15811. execJob: function (a, b) {
  15812. var e = this.jobs[b];
  15813. if (e.state != k) return e.exec.call(this, a)
  15814. }, refreshJob: function (a,
  15815. b, e) {
  15816. b = this.jobs[b];
  15817. a.activeFilter.checkFeature(this) ? b.state = b.refresh.call(this, a, e) : b.state = k;
  15818. return b.state
  15819. }, getContext: function (a) {
  15820. return a.contains(this.context)
  15821. }
  15822. }
  15823. })();
  15824. (function () {
  15825. function f(b, c, a) {
  15826. if (!b.getCustomData("indent_processed")) {
  15827. var d = this.editor, l = this.isIndent;
  15828. if (c) {
  15829. d = b.$.className.match(this.classNameRegex);
  15830. a = 0;
  15831. d && (d = d[1], a = CKEDITOR.tools.indexOf(c, d) + 1);
  15832. if (0 > (a += l ? 1 : -1)) return;
  15833. a = Math.min(a, c.length);
  15834. a = Math.max(a, 0);
  15835. b.$.className = CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex, ""));
  15836. 0 < a && b.addClass(c[a - 1])
  15837. } else {
  15838. c = m(b, a);
  15839. a = parseInt(b.getStyle(c), 10);
  15840. var g = d.config.indentOffset || 40;
  15841. isNaN(a) && (a = 0);
  15842. a += (l ? 1 : -1) * g;
  15843. if (0 > a) return;
  15844. a = Math.max(a,
  15845. 0);
  15846. a = Math.ceil(a / g) * g;
  15847. b.setStyle(c, a ? a + (d.config.indentUnit || "px") : "");
  15848. "" === b.getAttribute("style") && b.removeAttribute("style")
  15849. }
  15850. CKEDITOR.dom.element.setMarker(this.database, b, "indent_processed", 1)
  15851. }
  15852. }
  15853. function m(b, c) {
  15854. return "ltr" == (c || b.getComputedStyle("direction")) ? "margin-left" : "margin-right"
  15855. }
  15856. var h = CKEDITOR.dtd.$listItem, p = CKEDITOR.dtd.$list, k = CKEDITOR.TRISTATE_DISABLED,
  15857. n = CKEDITOR.TRISTATE_OFF;
  15858. CKEDITOR.plugins.add("indentblock", {
  15859. requires: "indent", init: function (b) {
  15860. function c() {
  15861. a.specificDefinition.apply(this,
  15862. arguments);
  15863. this.allowedContent = {
  15864. "div h1 h2 h3 h4 h5 h6 ol p pre ul": {
  15865. propertiesOnly: !0,
  15866. styles: d ? null : "margin-left,margin-right",
  15867. classes: d || null
  15868. }
  15869. };
  15870. this.contentTransformations = [["div: splitMarginShorthand"], ["h1: splitMarginShorthand"], ["h2: splitMarginShorthand"], ["h3: splitMarginShorthand"], ["h4: splitMarginShorthand"], ["h5: splitMarginShorthand"], ["h6: splitMarginShorthand"], ["ol: splitMarginShorthand"], ["p: splitMarginShorthand"], ["pre: splitMarginShorthand"], ["ul: splitMarginShorthand"]];
  15871. this.enterBr &&
  15872. (this.allowedContent.div = !0);
  15873. this.requiredContent = (this.enterBr ? "div" : "p") + (d ? "(" + d.join(",") + ")" : "{margin-left}");
  15874. this.jobs = {
  15875. 20: {
  15876. refresh: function (a, b) {
  15877. var e = b.block || b.blockLimit;
  15878. if (!e.is(h)) var c = e.getAscendant(h), e = c && b.contains(c) || e;
  15879. e.is(h) && (e = e.getParent());
  15880. if (this.enterBr || this.getContext(b)) {
  15881. if (d) {
  15882. var c = d, e = e.$.className.match(this.classNameRegex), f = this.isIndent,
  15883. c = e ? f ? e[1] != c.slice(-1) : !0 : f;
  15884. return c ? n : k
  15885. }
  15886. return this.isIndent ? n : e ? CKEDITOR[0 >= (parseInt(e.getStyle(m(e)), 10) || 0) ? "TRISTATE_DISABLED" :
  15887. "TRISTATE_OFF"] : k
  15888. }
  15889. return k
  15890. }, exec: function (a) {
  15891. var b = a.getSelection(), b = b && b.getRanges()[0], c;
  15892. if (c = a.elementPath().contains(p)) f.call(this, c, d); else for (b = b.createIterator(), a = a.config.enterMode, b.enforceRealBlocks = !0, b.enlargeBr = a != CKEDITOR.ENTER_BR; c = b.getNextParagraph(a == CKEDITOR.ENTER_P ? "p" : "div");) c.isReadOnly() || f.call(this, c, d);
  15893. return !0
  15894. }
  15895. }
  15896. }
  15897. }
  15898. var a = CKEDITOR.plugins.indent, d = b.config.indentClasses;
  15899. a.registerCommands(b, {
  15900. indentblock: new c(b, "indentblock", !0),
  15901. outdentblock: new c(b, "outdentblock")
  15902. });
  15903. CKEDITOR.tools.extend(c.prototype, a.specificDefinition.prototype, {
  15904. context: {
  15905. div: 1,
  15906. dl: 1,
  15907. h1: 1,
  15908. h2: 1,
  15909. h3: 1,
  15910. h4: 1,
  15911. h5: 1,
  15912. h6: 1,
  15913. ul: 1,
  15914. ol: 1,
  15915. p: 1,
  15916. pre: 1,
  15917. table: 1
  15918. }, classNameRegex: d ? new RegExp("(?:^|\\s+)(" + d.join("|") + ")(?\x3d$|\\s)") : null
  15919. })
  15920. }
  15921. })
  15922. })();
  15923. (function () {
  15924. function w(f) {
  15925. function g(b) {
  15926. for (var e = c.startContainer, a = c.endContainer; e && !e.getParent().equals(b);) e = e.getParent();
  15927. for (; a && !a.getParent().equals(b);) a = a.getParent();
  15928. if (!e || !a) return !1;
  15929. for (var d = [], h = !1; !h;) e.equals(a) && (h = !0), d.push(e), e = e.getNext();
  15930. if (1 > d.length) return !1;
  15931. e = b.getParents(!0);
  15932. for (a = 0; a < e.length; a++) if (e[a].getName && p[e[a].getName()]) {
  15933. b = e[a];
  15934. break
  15935. }
  15936. for (var e = k.isIndent ? 1 : -1, a = d[0], d = d[d.length - 1], h = CKEDITOR.plugins.list.listToArray(b, q), m = h[d.getCustomData("listarray_index")].indent,
  15937. a = a.getCustomData("listarray_index"); a <= d.getCustomData("listarray_index"); a++) if (h[a].indent += e, 0 < e) {
  15938. for (var g = h[a].parent, n = a - 1; 0 <= n; n--) if (h[n].indent === e) {
  15939. g = h[n].parent;
  15940. break
  15941. }
  15942. h[a].parent = new CKEDITOR.dom.element(g.getName(), g.getDocument())
  15943. }
  15944. for (a = d.getCustomData("listarray_index") + 1; a < h.length && h[a].indent > m; a++) h[a].indent += e;
  15945. e = CKEDITOR.plugins.list.arrayToList(h, q, null, f.config.enterMode, b.getDirection());
  15946. if (!k.isIndent) {
  15947. var t;
  15948. if ((t = b.getParent()) && t.is("li")) for (var d = e.listNode.getChildren(),
  15949. r = [], l, a = d.count() - 1; 0 <= a; a--) (l = d.getItem(a)) && l.is && l.is("li") && r.push(l)
  15950. }
  15951. e && e.listNode.replace(b);
  15952. if (r && r.length) for (a = 0; a < r.length; a++) {
  15953. for (l = b = r[a]; (l = l.getNext()) && l.is && l.getName() in p;) CKEDITOR.env.needsNbspFiller && !b.getFirst(x) && b.append(c.document.createText(" ")), b.append(l);
  15954. b.insertAfter(t)
  15955. }
  15956. e && f.fire("contentDomInvalidated");
  15957. return !0
  15958. }
  15959. for (var k = this, q = this.database, p = this.context, c, m = f.getSelection(), m = (m && m.getRanges()).createIterator(); c = m.getNextRange();) {
  15960. for (var b = c.getCommonAncestor(); b &&
  15961. (b.type != CKEDITOR.NODE_ELEMENT || !p[b.getName()]);) {
  15962. if (f.editable().equals(b)) {
  15963. b = !1;
  15964. break
  15965. }
  15966. b = b.getParent()
  15967. }
  15968. b || (b = c.startPath().contains(p)) && c.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
  15969. if (!b) {
  15970. var d = c.getEnclosedNode();
  15971. d && d.type == CKEDITOR.NODE_ELEMENT && d.getName() in p && (c.setStartAt(d, CKEDITOR.POSITION_AFTER_START), c.setEndAt(d, CKEDITOR.POSITION_BEFORE_END), b = d)
  15972. }
  15973. b && c.startContainer.type == CKEDITOR.NODE_ELEMENT && c.startContainer.getName() in p && (d = new CKEDITOR.dom.walker(c), d.evaluator = n, c.startContainer =
  15974. d.next());
  15975. b && c.endContainer.type == CKEDITOR.NODE_ELEMENT && c.endContainer.getName() in p && (d = new CKEDITOR.dom.walker(c), d.evaluator = n, c.endContainer = d.previous());
  15976. if (b) return g(b)
  15977. }
  15978. return 0
  15979. }
  15980. function n(f) {
  15981. return f.type == CKEDITOR.NODE_ELEMENT && f.is("li")
  15982. }
  15983. function x(f) {
  15984. return y(f) && z(f)
  15985. }
  15986. var y = CKEDITOR.dom.walker.whitespaces(!0), z = CKEDITOR.dom.walker.bookmark(!1, !0),
  15987. u = CKEDITOR.TRISTATE_DISABLED, v = CKEDITOR.TRISTATE_OFF;
  15988. CKEDITOR.plugins.add("indentlist", {
  15989. requires: "indent", init: function (f) {
  15990. function g(f) {
  15991. k.specificDefinition.apply(this,
  15992. arguments);
  15993. this.requiredContent = ["ul", "ol"];
  15994. f.on("key", function (g) {
  15995. var c = f.elementPath();
  15996. if ("wysiwyg" == f.mode && g.data.keyCode == this.indentKey && c) {
  15997. var m = this.getContext(c);
  15998. !m || this.isIndent && CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, m) || (f.execCommand(this.relatedGlobal), g.cancel())
  15999. }
  16000. }, this);
  16001. this.jobs[this.isIndent ? 10 : 30] = {
  16002. refresh: this.isIndent ? function (f, c) {
  16003. var g = this.getContext(c),
  16004. b = CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, g);
  16005. return g && this.isIndent && !b ? v : u
  16006. } : function (f,
  16007. c) {
  16008. return !this.getContext(c) || this.isIndent ? u : v
  16009. }, exec: CKEDITOR.tools.bind(w, this)
  16010. }
  16011. }
  16012. var k = CKEDITOR.plugins.indent;
  16013. k.registerCommands(f, {indentlist: new g(f, "indentlist", !0), outdentlist: new g(f, "outdentlist")});
  16014. CKEDITOR.tools.extend(g.prototype, k.specificDefinition.prototype, {context: {ol: 1, ul: 1}})
  16015. }
  16016. });
  16017. CKEDITOR.plugins.indentList = {};
  16018. CKEDITOR.plugins.indentList.firstItemInPath = function (f, g, k) {
  16019. var q = g.contains(n);
  16020. k || (k = g.contains(f));
  16021. return k && q && q.equals(k.getFirst(n))
  16022. }
  16023. })();
  16024. CKEDITOR.plugins.add("smiley", {
  16025. requires: "dialog", init: function (a) {
  16026. a.config.smiley_path = a.config.smiley_path || this.path + "images/";
  16027. a.addCommand("smiley", new CKEDITOR.dialogCommand("smiley", {
  16028. allowedContent: "img[alt,height,!src,title,width]",
  16029. requiredContent: "img"
  16030. }));
  16031. a.ui.addButton && a.ui.addButton("Smiley", {
  16032. label: a.lang.smiley.toolbar,
  16033. command: "smiley",
  16034. toolbar: "insert,50"
  16035. });
  16036. CKEDITOR.dialog.add("smiley", this.path + "dialogs/smiley.js")
  16037. }
  16038. });
  16039. CKEDITOR.config.smiley_images = "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".split(" ");
  16040. CKEDITOR.config.smiley_descriptions = "smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail".split(";");
  16041. (function () {
  16042. function q(a, c) {
  16043. c = void 0 === c || c;
  16044. var b;
  16045. if (c) b = a.getComputedStyle("text-align"); else {
  16046. for (; !a.hasAttribute || !a.hasAttribute("align") && !a.getStyle("text-align");) {
  16047. b = a.getParent();
  16048. if (!b) break;
  16049. a = b
  16050. }
  16051. b = a.getStyle("text-align") || a.getAttribute("align") || ""
  16052. }
  16053. b && (b = b.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i, ""));
  16054. !b && c && (b = "rtl" == a.getComputedStyle("direction") ? "right" : "left");
  16055. return b
  16056. }
  16057. function h(a, c, b) {
  16058. this.editor = a;
  16059. this.name = c;
  16060. this.value = b;
  16061. this.context = "p";
  16062. c = a.config.justifyClasses;
  16063. var f = a.config.enterMode ==
  16064. CKEDITOR.ENTER_P ? "p" : "div";
  16065. if (c) {
  16066. switch (b) {
  16067. case "left":
  16068. this.cssClassName = c[0];
  16069. break;
  16070. case "center":
  16071. this.cssClassName = c[1];
  16072. break;
  16073. case "right":
  16074. this.cssClassName = c[2];
  16075. break;
  16076. case "justify":
  16077. this.cssClassName = c[3]
  16078. }
  16079. this.cssClassRegex = new RegExp("(?:^|\\s+)(?:" + c.join("|") + ")(?\x3d$|\\s)");
  16080. this.requiredContent = f + "(" + this.cssClassName + ")"
  16081. } else this.requiredContent = f + "{text-align}";
  16082. this.allowedContent = {
  16083. "caption div h1 h2 h3 h4 h5 h6 p pre td th li": {
  16084. propertiesOnly: !0, styles: this.cssClassName ? null : "text-align",
  16085. classes: this.cssClassName || null
  16086. }
  16087. };
  16088. a.config.enterMode == CKEDITOR.ENTER_BR && (this.allowedContent.div = !0)
  16089. }
  16090. function m(a) {
  16091. var c = a.editor, b = c.createRange();
  16092. b.setStartBefore(a.data.node);
  16093. b.setEndAfter(a.data.node);
  16094. for (var f = new CKEDITOR.dom.walker(b), d; d = f.next();) if (d.type == CKEDITOR.NODE_ELEMENT) if (!d.equals(a.data.node) && d.getDirection()) b.setStartAfter(d), f = new CKEDITOR.dom.walker(b); else {
  16095. var e = c.config.justifyClasses;
  16096. e && (d.hasClass(e[0]) ? (d.removeClass(e[0]), d.addClass(e[2])) : d.hasClass(e[2]) && (d.removeClass(e[2]),
  16097. d.addClass(e[0])));
  16098. e = d.getStyle("text-align");
  16099. "left" == e ? d.setStyle("text-align", "right") : "right" == e && d.setStyle("text-align", "left")
  16100. }
  16101. }
  16102. h.prototype = {
  16103. exec: function (a) {
  16104. var c = a.getSelection(), b = a.config.enterMode;
  16105. if (c) {
  16106. for (var f = c.createBookmarks(), d = c.getRanges(), e = this.cssClassName, h, g, k = a.config.useComputedState, k = void 0 === k || k, n = d.length - 1; 0 <= n; n--) for (h = d[n].createIterator(), h.enlargeBr = b != CKEDITOR.ENTER_BR; g = h.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");) if (!g.isReadOnly()) {
  16107. var l = g.getName(),
  16108. p;
  16109. p = a.activeFilter.check(l + "{text-align}");
  16110. if ((l = a.activeFilter.check(l + "(" + e + ")")) || p) {
  16111. g.removeAttribute("align");
  16112. g.removeStyle("text-align");
  16113. var m = e && (g.$.className = CKEDITOR.tools.ltrim(g.$.className.replace(this.cssClassRegex, ""))),
  16114. r = this.state == CKEDITOR.TRISTATE_OFF && (!k || q(g, !0) != this.value);
  16115. e && l ? r ? g.addClass(e) : m || g.removeAttribute("class") : r && p && g.setStyle("text-align", this.value)
  16116. }
  16117. }
  16118. a.focus();
  16119. a.forceNextSelectionCheck();
  16120. c.selectBookmarks(f)
  16121. }
  16122. }, refresh: function (a, c) {
  16123. var b = c.block || c.blockLimit,
  16124. f = b.getName(), d = b.equals(a.editable()),
  16125. f = this.cssClassName ? a.activeFilter.check(f + "(" + this.cssClassName + ")") : a.activeFilter.check(f + "{text-align}");
  16126. d && !CKEDITOR.dtd.$list[c.lastElement.getName()] ? this.setState(CKEDITOR.TRISTATE_OFF) : !d && f ? this.setState(q(b, this.editor.config.useComputedState) == this.value ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  16127. }
  16128. };
  16129. CKEDITOR.plugins.add("justify", {
  16130. init: function (a) {
  16131. if (!a.blockless) {
  16132. var c = new h(a, "justifyleft", "left"), b = new h(a,
  16133. "justifycenter", "center"), f = new h(a, "justifyright", "right"),
  16134. d = new h(a, "justifyblock", "justify");
  16135. a.addCommand("justifyleft", c);
  16136. a.addCommand("justifycenter", b);
  16137. a.addCommand("justifyright", f);
  16138. a.addCommand("justifyblock", d);
  16139. a.ui.addButton && (a.ui.addButton("JustifyLeft", {
  16140. label: a.lang.common.alignLeft,
  16141. command: "justifyleft",
  16142. toolbar: "align,10"
  16143. }), a.ui.addButton("JustifyCenter", {
  16144. label: a.lang.common.center,
  16145. command: "justifycenter",
  16146. toolbar: "align,20"
  16147. }), a.ui.addButton("JustifyRight", {
  16148. label: a.lang.common.alignRight,
  16149. command: "justifyright", toolbar: "align,30"
  16150. }), a.ui.addButton("JustifyBlock", {
  16151. label: a.lang.common.justify,
  16152. command: "justifyblock",
  16153. toolbar: "align,40"
  16154. }));
  16155. a.on("dirChanged", m)
  16156. }
  16157. }
  16158. })
  16159. })();
  16160. CKEDITOR.plugins.add("menubutton", {
  16161. requires: "button,menu", onLoad: function () {
  16162. var d = function (c) {
  16163. var a = this._, b = a.menu;
  16164. a.state !== CKEDITOR.TRISTATE_DISABLED && (a.on && b ? b.hide() : (a.previousState = a.state, b || (b = a.menu = new CKEDITOR.menu(c, {
  16165. panel: {
  16166. className: "cke_menu_panel",
  16167. attributes: {"aria-label": c.lang.common.options}
  16168. }
  16169. }), b.onHide = CKEDITOR.tools.bind(function () {
  16170. var b = this.command ? c.getCommand(this.command).modes : this.modes;
  16171. this.setState(!b || b[c.mode] ? a.previousState : CKEDITOR.TRISTATE_DISABLED);
  16172. a.on = 0
  16173. }, this),
  16174. this.onMenu && b.addListener(this.onMenu)), this.setState(CKEDITOR.TRISTATE_ON), a.on = 1, setTimeout(function () {
  16175. b.show(CKEDITOR.document.getById(a.id), 4)
  16176. }, 0)))
  16177. };
  16178. CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({
  16179. base: CKEDITOR.ui.button, $: function (c) {
  16180. delete c.panel;
  16181. this.base(c);
  16182. this.hasArrow = "menu";
  16183. this.click = d
  16184. }, statics: {
  16185. handler: {
  16186. create: function (c) {
  16187. return new CKEDITOR.ui.menuButton(c)
  16188. }
  16189. }
  16190. }
  16191. })
  16192. }, beforeInit: function (d) {
  16193. d.ui.addHandler(CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler)
  16194. }
  16195. });
  16196. CKEDITOR.UI_MENUBUTTON = "menubutton";
  16197. (function () {
  16198. CKEDITOR.plugins.add("language", {
  16199. requires: "menubutton", init: function (a) {
  16200. var b = a.config.language_list || ["ar:Arabic:rtl", "fr:French", "es:Spanish"], c = this,
  16201. d = a.lang.language, e = {}, g, h, k, f;
  16202. a.addCommand("language", {
  16203. allowedContent: "span[!lang,!dir]",
  16204. requiredContent: "span[lang,dir]",
  16205. contextSensitive: !0,
  16206. exec: function (a, b) {
  16207. var c = e["language_" + b];
  16208. if (c) a[c.style.checkActive(a.elementPath(), a) ? "removeStyle" : "applyStyle"](c.style)
  16209. },
  16210. refresh: function (a) {
  16211. this.setState(c.getCurrentLangElement(a) ? CKEDITOR.TRISTATE_ON :
  16212. CKEDITOR.TRISTATE_OFF)
  16213. }
  16214. });
  16215. for (f = 0; f < b.length; f++) g = b[f].split(":"), h = g[0], k = "language_" + h, e[k] = {
  16216. label: g[1],
  16217. langId: h,
  16218. group: "language",
  16219. order: f,
  16220. ltr: "rtl" != ("" + g[2]).toLowerCase(),
  16221. onClick: function () {
  16222. a.execCommand("language", this.langId)
  16223. },
  16224. role: "menuitemcheckbox"
  16225. }, e[k].style = new CKEDITOR.style({
  16226. element: "span",
  16227. attributes: {lang: h, dir: e[k].ltr ? "ltr" : "rtl"}
  16228. });
  16229. e.language_remove = {
  16230. label: d.remove,
  16231. group: "language_remove",
  16232. state: CKEDITOR.TRISTATE_DISABLED,
  16233. order: e.length,
  16234. onClick: function () {
  16235. var b = c.getCurrentLangElement(a);
  16236. b && a.execCommand("language", b.getAttribute("lang"))
  16237. }
  16238. };
  16239. a.addMenuGroup("language", 1);
  16240. a.addMenuGroup("language_remove");
  16241. a.addMenuItems(e);
  16242. a.ui.add("Language", CKEDITOR.UI_MENUBUTTON, {
  16243. label: d.button,
  16244. allowedContent: "span[!lang,!dir]",
  16245. requiredContent: "span[lang,dir]",
  16246. toolbar: "bidi,30",
  16247. command: "language",
  16248. onMenu: function () {
  16249. var b = {}, d = c.getCurrentLangElement(a), f;
  16250. for (f in e) b[f] = CKEDITOR.TRISTATE_OFF;
  16251. b.language_remove = d ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  16252. d && (b["language_" + d.getAttribute("lang")] =
  16253. CKEDITOR.TRISTATE_ON);
  16254. return b
  16255. }
  16256. });
  16257. a.addRemoveFormatFilter && a.addRemoveFormatFilter(function (a) {
  16258. return !(a.is("span") && a.getAttribute("dir") && a.getAttribute("lang"))
  16259. })
  16260. }, getCurrentLangElement: function (a) {
  16261. var b = a.elementPath();
  16262. a = b && b.elements;
  16263. var c;
  16264. if (b) for (var d = 0; d < a.length; d++) b = a[d], !c && "span" == b.getName() && b.hasAttribute("dir") && b.hasAttribute("lang") && (c = b);
  16265. return c
  16266. }
  16267. })
  16268. })();
  16269. (function () {
  16270. function p(c) {
  16271. return c.replace(/'/g, "\\$\x26")
  16272. }
  16273. function q(c) {
  16274. for (var b, a = c.length, d = [], f = 0; f < a; f++) b = c.charCodeAt(f), d.push(b);
  16275. return "String.fromCharCode(" + d.join(",") + ")"
  16276. }
  16277. function r(c, b) {
  16278. var a = c.plugins.link, d = a.compiledProtectionFunction.params, f, e;
  16279. e = [a.compiledProtectionFunction.name, "("];
  16280. for (var g = 0; g < d.length; g++) a = d[g].toLowerCase(), f = b[a], 0 < g && e.push(","), e.push("'", f ? p(encodeURIComponent(b[a])) : "", "'");
  16281. e.push(")");
  16282. return e.join("")
  16283. }
  16284. function n(c) {
  16285. c = c.config.emailProtection || "";
  16286. var b;
  16287. c && "encode" != c && (b = {}, c.replace(/^([^(]+)\(([^)]+)\)$/, function (a, c, f) {
  16288. b.name = c;
  16289. b.params = [];
  16290. f.replace(/[^,\s]+/g, function (a) {
  16291. b.params.push(a)
  16292. })
  16293. }));
  16294. return b
  16295. }
  16296. CKEDITOR.plugins.add("link", {
  16297. requires: "dialog,fakeobjects", onLoad: function () {
  16298. function c(b) {
  16299. return a.replace(/%1/g, "rtl" == b ? "right" : "left").replace(/%2/g, "cke_contents_" + b)
  16300. }
  16301. var b = "background:url(" + CKEDITOR.getUrl(this.path + "images" + (CKEDITOR.env.hidpi ? "/hidpi" : "") + "/anchor.png") + ") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
  16302. a = ".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{" + b + "padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{" + b + "width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
  16303. CKEDITOR.addCss(c("ltr") + c("rtl"))
  16304. }, init: function (c) {
  16305. var b = "a[!href]";
  16306. CKEDITOR.dialog.isTabEnabled(c, "link", "advanced") && (b = b.replace("]", ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)"));
  16307. CKEDITOR.dialog.isTabEnabled(c, "link", "target") &&
  16308. (b = b.replace("]", ",target,onclick]"));
  16309. c.addCommand("link", new CKEDITOR.dialogCommand("link", {
  16310. allowedContent: b,
  16311. requiredContent: "a[href]"
  16312. }));
  16313. c.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", {
  16314. allowedContent: "a[!name,id]",
  16315. requiredContent: "a[name]"
  16316. }));
  16317. c.addCommand("unlink", new CKEDITOR.unlinkCommand);
  16318. c.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand);
  16319. c.setKeystroke(CKEDITOR.CTRL + 76, "link");
  16320. c.setKeystroke(CKEDITOR.CTRL + 75, "link");
  16321. c.ui.addButton && (c.ui.addButton("Link", {
  16322. label: c.lang.link.toolbar,
  16323. command: "link", toolbar: "links,10"
  16324. }), c.ui.addButton("Unlink", {
  16325. label: c.lang.link.unlink,
  16326. command: "unlink",
  16327. toolbar: "links,20"
  16328. }), c.ui.addButton("Anchor", {
  16329. label: c.lang.link.anchor.toolbar,
  16330. command: "anchor",
  16331. toolbar: "links,30"
  16332. }));
  16333. CKEDITOR.dialog.add("link", this.path + "dialogs/link.js");
  16334. CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js");
  16335. c.on("doubleclick", function (a) {
  16336. var b = a.data.element.getAscendant({a: 1, img: 1}, !0);
  16337. b && !b.isReadOnly() && (b.is("a") ? (a.data.dialog = !b.getAttribute("name") || b.getAttribute("href") &&
  16338. b.getChildCount() ? "link" : "anchor", a.data.link = b) : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, b) && (a.data.dialog = "anchor"))
  16339. }, null, null, 0);
  16340. c.on("doubleclick", function (a) {
  16341. a.data.dialog in {link: 1, anchor: 1} && a.data.link && c.getSelection().selectElement(a.data.link)
  16342. }, null, null, 20);
  16343. c.addMenuItems && c.addMenuItems({
  16344. anchor: {label: c.lang.link.anchor.menu, command: "anchor", group: "anchor", order: 1},
  16345. removeAnchor: {
  16346. label: c.lang.link.anchor.remove,
  16347. command: "removeAnchor",
  16348. group: "anchor",
  16349. order: 5
  16350. },
  16351. link: {
  16352. label: c.lang.link.menu,
  16353. command: "link", group: "link", order: 1
  16354. },
  16355. unlink: {label: c.lang.link.unlink, command: "unlink", group: "link", order: 5}
  16356. });
  16357. c.contextMenu && c.contextMenu.addListener(function (a) {
  16358. if (!a || a.isReadOnly()) return null;
  16359. a = CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a);
  16360. if (!a && !(a = CKEDITOR.plugins.link.getSelectedLink(c))) return null;
  16361. var b = {};
  16362. a.getAttribute("href") && a.getChildCount() && (b = {
  16363. link: CKEDITOR.TRISTATE_OFF,
  16364. unlink: CKEDITOR.TRISTATE_OFF
  16365. });
  16366. a && a.hasAttribute("name") && (b.anchor = b.removeAnchor = CKEDITOR.TRISTATE_OFF);
  16367. return b
  16368. });
  16369. this.compiledProtectionFunction = n(c)
  16370. }, afterInit: function (c) {
  16371. c.dataProcessor.dataFilter.addRules({
  16372. elements: {
  16373. a: function (a) {
  16374. return a.attributes.name ? a.children.length ? null : c.createFakeParserElement(a, "cke_anchor", "anchor") : null
  16375. }
  16376. }
  16377. });
  16378. var b = c._.elementsPath && c._.elementsPath.filters;
  16379. b && b.push(function (a, b) {
  16380. if ("a" == b && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a) || a.getAttribute("name") && (!a.getAttribute("href") || !a.getChildCount()))) return "anchor"
  16381. })
  16382. }
  16383. });
  16384. var t = /^javascript:/, u = /^mailto:([^?]+)(?:\?(.+))?$/,
  16385. v = /subject=([^;?:@&=$,\/]*)/i, w = /body=([^;?:@&=$,\/]*)/i, x = /^#(.*)$/,
  16386. y = /^((?:http|https|ftp|news):\/\/)?(.*)$/, z = /^(_(?:self|top|parent|blank))$/,
  16387. A = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
  16388. B = /^javascript:([^(]+)\(([^)]+)\)$/,
  16389. C = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
  16390. D = /(?:^|,)([^=]+)=(\d+|yes|no)/gi, E = /^tel:(.*)$/, m = {
  16391. id: "advId",
  16392. dir: "advLangDir",
  16393. accessKey: "advAccessKey",
  16394. name: "advName",
  16395. lang: "advLangCode",
  16396. tabindex: "advTabIndex",
  16397. title: "advTitle",
  16398. type: "advContentType",
  16399. "class": "advCSSClasses",
  16400. charset: "advCharset",
  16401. style: "advStyles",
  16402. rel: "advRel"
  16403. };
  16404. CKEDITOR.plugins.link = {
  16405. getSelectedLink: function (c, b) {
  16406. var a = c.getSelection(), d = a.getSelectedElement(), f = a.getRanges(), e = [], g;
  16407. if (!b && d && d.is("a")) return d;
  16408. for (d = 0; d < f.length; d++) if (g = a.getRanges()[d], g.shrink(CKEDITOR.SHRINK_ELEMENT, !0, {skipBogus: !0}), (g = c.elementPath(g.getCommonAncestor()).contains("a", 1)) && b) e.push(g); else if (g) return g;
  16409. return b ?
  16410. e : null
  16411. }, getEditorAnchors: function (c) {
  16412. for (var b = c.editable(), a = b.isInline() && !c.plugins.divarea ? c.document : b, b = a.getElementsByTag("a"), a = a.getElementsByTag("img"), d = [], f = 0, e; e = b.getItem(f++);) (e.data("cke-saved-name") || e.hasAttribute("name")) && d.push({
  16413. name: e.data("cke-saved-name") || e.getAttribute("name"),
  16414. id: e.getAttribute("id")
  16415. });
  16416. for (f = 0; e = a.getItem(f++);) (e = this.tryRestoreFakeAnchor(c, e)) && d.push({
  16417. name: e.getAttribute("name"),
  16418. id: e.getAttribute("id")
  16419. });
  16420. return d
  16421. }, fakeAnchor: !0, tryRestoreFakeAnchor: function (c,
  16422. b) {
  16423. if (b && b.data("cke-real-element-type") && "anchor" == b.data("cke-real-element-type")) {
  16424. var a = c.restoreRealElement(b);
  16425. if (a.data("cke-saved-name")) return a
  16426. }
  16427. }, parseLinkAttributes: function (c, b) {
  16428. var a = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "",
  16429. d = c.plugins.link.compiledProtectionFunction, f = c.config.emailProtection, e, g = {};
  16430. a.match(t) && ("encode" == f ? a = a.replace(A, function (a, b, c) {
  16431. c = c || "";
  16432. return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + c.replace(/\\'/g, "'")
  16433. }) : f && a.replace(B, function (a,
  16434. b, c) {
  16435. if (b == d.name) {
  16436. g.type = "email";
  16437. a = g.email = {};
  16438. b = /(^')|('$)/g;
  16439. c = c.match(/[^,\s]+/g);
  16440. for (var e = c.length, f, h, k = 0; k < e; k++) f = decodeURIComponent, h = c[k].replace(b, "").replace(/\\'/g, "'"), h = f(h), f = d.params[k].toLowerCase(), a[f] = h;
  16441. a.address = [a.name, a.domain].join("@")
  16442. }
  16443. }));
  16444. if (!g.type) if (f = a.match(x)) g.type = "anchor", g.anchor = {}, g.anchor.name = g.anchor.id = f[1]; else if (f = a.match(E)) g.type = "tel", g.tel = f[1]; else if (f = a.match(u)) {
  16445. e = a.match(v);
  16446. a = a.match(w);
  16447. g.type = "email";
  16448. var k = g.email = {};
  16449. k.address = f[1];
  16450. e && (k.subject =
  16451. decodeURIComponent(e[1]));
  16452. a && (k.body = decodeURIComponent(a[1]))
  16453. } else a && (e = a.match(y)) && (g.type = "url", g.url = {}, g.url.protocol = e[1], g.url.url = e[2]);
  16454. if (b) {
  16455. if (a = b.getAttribute("target")) g.target = {
  16456. type: a.match(z) ? a : "frame",
  16457. name: a
  16458. }; else if (a = (a = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && a.match(C)) for (g.target = {
  16459. type: "popup",
  16460. name: a[1]
  16461. }; f = D.exec(a[2]);) "yes" != f[2] && "1" != f[2] || f[1] in {
  16462. height: 1,
  16463. width: 1,
  16464. top: 1,
  16465. left: 1
  16466. } ? isFinite(f[2]) && (g.target[f[1]] = f[2]) : g.target[f[1]] = !0;
  16467. null !== b.getAttribute("download") &&
  16468. (g.download = !0);
  16469. var a = {}, h;
  16470. for (h in m) (f = b.getAttribute(h)) && (a[m[h]] = f);
  16471. if (h = b.data("cke-saved-name") || a.advName) a.advName = h;
  16472. CKEDITOR.tools.isEmpty(a) || (g.advanced = a)
  16473. }
  16474. return g
  16475. }, getLinkAttributes: function (c, b) {
  16476. var a = c.config.emailProtection || "", d = {};
  16477. switch (b.type) {
  16478. case "url":
  16479. var a = b.url && void 0 !== b.url.protocol ? b.url.protocol : "http://",
  16480. f = b.url && CKEDITOR.tools.trim(b.url.url) || "";
  16481. d["data-cke-saved-href"] = 0 === f.indexOf("/") ? f : a + f;
  16482. break;
  16483. case "anchor":
  16484. a = b.anchor && b.anchor.id;
  16485. d["data-cke-saved-href"] =
  16486. "#" + (b.anchor && b.anchor.name || a || "");
  16487. break;
  16488. case "email":
  16489. var e = b.email, f = e.address;
  16490. switch (a) {
  16491. case "":
  16492. case "encode":
  16493. var g = encodeURIComponent(e.subject || ""), k = encodeURIComponent(e.body || ""),
  16494. e = [];
  16495. g && e.push("subject\x3d" + g);
  16496. k && e.push("body\x3d" + k);
  16497. e = e.length ? "?" + e.join("\x26") : "";
  16498. "encode" == a ? (a = ["javascript:void(location.href\x3d'mailto:'+", q(f)], e && a.push("+'", p(e), "'"), a.push(")")) : a = ["mailto:", f, e];
  16499. break;
  16500. default:
  16501. a = f.split("@", 2), e.name = a[0], e.domain = a[1], a = ["javascript:", r(c, e)]
  16502. }
  16503. d["data-cke-saved-href"] =
  16504. a.join("");
  16505. break;
  16506. case "tel":
  16507. d["data-cke-saved-href"] = "tel:" + b.tel
  16508. }
  16509. if (b.target) if ("popup" == b.target.type) {
  16510. for (var a = ["window.open(this.href, '", b.target.name || "", "', '"], h = "resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "), f = h.length, g = function (a) {
  16511. b.target[a] && h.push(a + "\x3d" + b.target[a])
  16512. }, e = 0; e < f; e++) h[e] += b.target[h[e]] ? "\x3dyes" : "\x3dno";
  16513. g("width");
  16514. g("left");
  16515. g("height");
  16516. g("top");
  16517. a.push(h.join(","), "'); return false;");
  16518. d["data-cke-pa-onclick"] = a.join("")
  16519. } else "notSet" !=
  16520. b.target.type && b.target.name && (d.target = b.target.name);
  16521. b.download && (d.download = "");
  16522. if (b.advanced) {
  16523. for (var l in m) (a = b.advanced[m[l]]) && (d[l] = a);
  16524. d.name && (d["data-cke-saved-name"] = d.name)
  16525. }
  16526. d["data-cke-saved-href"] && (d.href = d["data-cke-saved-href"]);
  16527. l = {target: 1, onclick: 1, "data-cke-pa-onclick": 1, "data-cke-saved-name": 1, download: 1};
  16528. b.advanced && CKEDITOR.tools.extend(l, m);
  16529. for (var n in d) delete l[n];
  16530. return {set: d, removed: CKEDITOR.tools.objectKeys(l)}
  16531. }, showDisplayTextForElement: function (c, b) {
  16532. var a = {
  16533. img: 1, table: 1,
  16534. tbody: 1, thead: 1, tfoot: 1, input: 1, select: 1, textarea: 1
  16535. }, d = b.getSelection();
  16536. return b.widgets && b.widgets.focused || d && 1 < d.getRanges().length ? !1 : !c || !c.getName || !c.is(a)
  16537. }
  16538. };
  16539. CKEDITOR.unlinkCommand = function () {
  16540. };
  16541. CKEDITOR.unlinkCommand.prototype = {
  16542. exec: function (c) {
  16543. if (CKEDITOR.env.ie) {
  16544. var b = c.getSelection().getRanges()[0],
  16545. a = b.getPreviousEditableNode() && b.getPreviousEditableNode().getAscendant("a", !0) || b.getNextEditableNode() && b.getNextEditableNode().getAscendant("a", !0),
  16546. d;
  16547. b.collapsed && a && (d = b.createBookmark(),
  16548. b.selectNodeContents(a), b.select())
  16549. }
  16550. a = new CKEDITOR.style({element: "a", type: CKEDITOR.STYLE_INLINE, alwaysRemoveElement: 1});
  16551. c.removeStyle(a);
  16552. d && (b.moveToBookmark(d), b.select())
  16553. }, refresh: function (c, b) {
  16554. var a = b.lastElement && b.lastElement.getAscendant("a", !0);
  16555. a && "a" == a.getName() && a.getAttribute("href") && a.getChildCount() ? this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  16556. }, contextSensitive: 1, startDisabled: 1, requiredContent: "a[href]", editorFocus: 1
  16557. };
  16558. CKEDITOR.removeAnchorCommand =
  16559. function () {
  16560. };
  16561. CKEDITOR.removeAnchorCommand.prototype = {
  16562. exec: function (c) {
  16563. var b = c.getSelection(), a = b.createBookmarks(), d;
  16564. if (b && (d = b.getSelectedElement()) && (d.getChildCount() ? d.is("a") : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, d))) d.remove(1); else if (d = CKEDITOR.plugins.link.getSelectedLink(c)) d.hasAttribute("href") ? (d.removeAttributes({
  16565. name: 1,
  16566. "data-cke-saved-name": 1
  16567. }), d.removeClass("cke_anchor")) : d.remove(1);
  16568. b.selectBookmarks(a)
  16569. }, requiredContent: "a[name]"
  16570. };
  16571. CKEDITOR.tools.extend(CKEDITOR.config, {
  16572. linkShowAdvancedTab: !0,
  16573. linkShowTargetTab: !0
  16574. })
  16575. })();
  16576. (function () {
  16577. function K(a, l, d, f) {
  16578. for (var e = CKEDITOR.plugins.list.listToArray(l.root, d), g = [], b = 0; b < l.contents.length; b++) {
  16579. var h = l.contents[b];
  16580. (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (g.push(h), CKEDITOR.dom.element.setMarker(d, h, "list_item_processed", !0))
  16581. }
  16582. for (var h = l.root.getDocument(), k, c, b = 0; b < g.length; b++) {
  16583. var p = g[b].getCustomData("listarray_index");
  16584. k = e[p].parent;
  16585. k.is(this.type) || (c = h.createElement(this.type), k.copyAttributes(c, {
  16586. start: 1,
  16587. type: 1
  16588. }), c.removeStyle("list-style-type"),
  16589. e[p].parent = c)
  16590. }
  16591. d = CKEDITOR.plugins.list.arrayToList(e, d, null, a.config.enterMode);
  16592. for (var m, e = d.listNode.getChildCount(), b = 0; b < e && (m = d.listNode.getChild(b)); b++) m.getName() == this.type && f.push(m);
  16593. d.listNode.replace(l.root);
  16594. a.fire("contentDomInvalidated")
  16595. }
  16596. function L(a, l, d) {
  16597. var f = l.contents, e = l.root.getDocument(), g = [];
  16598. if (1 == f.length && f[0].equals(l.root)) {
  16599. var b = e.createElement("div");
  16600. f[0].moveChildren && f[0].moveChildren(b);
  16601. f[0].append(b);
  16602. f[0] = b
  16603. }
  16604. l = l.contents[0].getParent();
  16605. for (b = 0; b < f.length; b++) l = l.getCommonAncestor(f[b].getParent());
  16606. a = a.config.useComputedState;
  16607. var h, k;
  16608. a = void 0 === a || a;
  16609. for (b = 0; b < f.length; b++) for (var c = f[b], p; p = c.getParent();) {
  16610. if (p.equals(l)) {
  16611. g.push(c);
  16612. !k && c.getDirection() && (k = 1);
  16613. c = c.getDirection(a);
  16614. null !== h && (h = h && h != c ? null : c);
  16615. break
  16616. }
  16617. c = p
  16618. }
  16619. if (!(1 > g.length)) {
  16620. f = g[g.length - 1].getNext();
  16621. b = e.createElement(this.type);
  16622. for (d.push(b); g.length;) d = g.shift(), a = e.createElement("li"), c = d, c.is("pre") || M.test(c.getName()) || "false" == c.getAttribute("contenteditable") ? d.appendTo(a) : (d.copyAttributes(a), h && d.getDirection() && (a.removeStyle("direction"),
  16623. a.removeAttribute("dir")), d.moveChildren(a), d.remove()), a.appendTo(b);
  16624. h && k && b.setAttribute("dir", h);
  16625. f ? b.insertBefore(f) : b.appendTo(l)
  16626. }
  16627. }
  16628. function N(a, l, d) {
  16629. function f(b) {
  16630. if (!(!(c = k[b ? "getFirst" : "getLast"]()) || c.is && c.isBlockBoundary() || !(p = l.root[b ? "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(!0))) || p.is && p.isBlockBoundary({br: 1}))) a.document.createElement("br")[b ? "insertBefore" : "insertAfter"](c)
  16631. }
  16632. for (var e = CKEDITOR.plugins.list.listToArray(l.root, d), g = [], b = 0; b < l.contents.length; b++) {
  16633. var h =
  16634. l.contents[b];
  16635. (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (g.push(h), CKEDITOR.dom.element.setMarker(d, h, "list_item_processed", !0))
  16636. }
  16637. h = null;
  16638. for (b = 0; b < g.length; b++) h = g[b].getCustomData("listarray_index"), e[h].indent = -1;
  16639. for (b = h + 1; b < e.length; b++) if (e[b].indent > e[b - 1].indent + 1) {
  16640. g = e[b - 1].indent + 1 - e[b].indent;
  16641. for (h = e[b].indent; e[b] && e[b].indent >= h;) e[b].indent += g, b++;
  16642. b--
  16643. }
  16644. var k = CKEDITOR.plugins.list.arrayToList(e, d, null, a.config.enterMode, l.root.getAttribute("dir")).listNode,
  16645. c, p;
  16646. f(!0);
  16647. f();
  16648. k.replace(l.root);
  16649. a.fire("contentDomInvalidated")
  16650. }
  16651. function C(a, l) {
  16652. this.name = a;
  16653. this.context = this.type = l;
  16654. this.allowedContent = l + " li";
  16655. this.requiredContent = l
  16656. }
  16657. function F(a, l, d, f) {
  16658. for (var e, g; e = a[f ? "getLast" : "getFirst"](O);) (g = e.getDirection(1)) !== l.getDirection(1) && e.setAttribute("dir", g), e.remove(), d ? e[f ? "insertBefore" : "insertAfter"](d) : l.append(e, f), d = e
  16659. }
  16660. function G(a) {
  16661. function l(d) {
  16662. var f = a[d ? "getPrevious" : "getNext"](t);
  16663. f && f.type == CKEDITOR.NODE_ELEMENT && f.is(a.getName()) && (F(a, f, null, !d), a.remove(),
  16664. a = f)
  16665. }
  16666. l();
  16667. l(1)
  16668. }
  16669. function H(a) {
  16670. return a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in CKEDITOR.dtd.$block || a.getName() in CKEDITOR.dtd.$listItem) && CKEDITOR.dtd[a.getName()]["#"]
  16671. }
  16672. function D(a, l, d) {
  16673. a.fire("saveSnapshot");
  16674. d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
  16675. var f = d.extractContents();
  16676. l.trim(!1, !0);
  16677. var e = l.createBookmark(), g = new CKEDITOR.dom.elementPath(l.startContainer), b = g.block,
  16678. g = g.lastElement.getAscendant("li", 1) || b, h = new CKEDITOR.dom.elementPath(d.startContainer),
  16679. k = h.contains(CKEDITOR.dtd.$listItem),
  16680. h = h.contains(CKEDITOR.dtd.$list);
  16681. b ? (b = b.getBogus()) && b.remove() : h && (b = h.getPrevious(t)) && z(b) && b.remove();
  16682. (b = f.getLast()) && b.type == CKEDITOR.NODE_ELEMENT && b.is("br") && b.remove();
  16683. (b = l.startContainer.getChild(l.startOffset)) ? f.insertBefore(b) : l.startContainer.append(f);
  16684. k && (f = A(k)) && (g.contains(k) ? (F(f, k.getParent(), k), f.remove()) : g.append(f));
  16685. for (; d.checkStartOfBlock() && d.checkEndOfBlock();) {
  16686. h = d.startPath();
  16687. f = h.block;
  16688. if (!f) break;
  16689. f.is("li") && (g = f.getParent(), f.equals(g.getLast(t)) && f.equals(g.getFirst(t)) &&
  16690. (f = g));
  16691. d.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START);
  16692. f.remove()
  16693. }
  16694. d = d.clone();
  16695. f = a.editable();
  16696. d.setEndAt(f, CKEDITOR.POSITION_BEFORE_END);
  16697. d = new CKEDITOR.dom.walker(d);
  16698. d.evaluator = function (a) {
  16699. return t(a) && !z(a)
  16700. };
  16701. (d = d.next()) && d.type == CKEDITOR.NODE_ELEMENT && d.getName() in CKEDITOR.dtd.$list && G(d);
  16702. l.moveToBookmark(e);
  16703. l.select();
  16704. a.fire("saveSnapshot")
  16705. }
  16706. function A(a) {
  16707. return (a = a.getLast(t)) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in u ? a : null
  16708. }
  16709. var u = {ol: 1, ul: 1}, P = CKEDITOR.dom.walker.whitespaces(), I = CKEDITOR.dom.walker.bookmark(),
  16710. t = function (a) {
  16711. return !(P(a) || I(a))
  16712. }, z = CKEDITOR.dom.walker.bogus();
  16713. CKEDITOR.plugins.list = {
  16714. listToArray: function (a, l, d, f, e) {
  16715. if (!u[a.getName()]) return [];
  16716. f || (f = 0);
  16717. d || (d = []);
  16718. for (var g = 0, b = a.getChildCount(); g < b; g++) {
  16719. var h = a.getChild(g);
  16720. h.type == CKEDITOR.NODE_ELEMENT && h.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(h, l, d, f + 1);
  16721. if ("li" == h.$.nodeName.toLowerCase()) {
  16722. var k = {parent: a, indent: f, element: h, contents: []};
  16723. e ? k.grandparent = e : (k.grandparent = a.getParent(), k.grandparent && "li" == k.grandparent.$.nodeName.toLowerCase() &&
  16724. (k.grandparent = k.grandparent.getParent()));
  16725. l && CKEDITOR.dom.element.setMarker(l, h, "listarray_index", d.length);
  16726. d.push(k);
  16727. for (var c = 0, p = h.getChildCount(), m; c < p; c++) m = h.getChild(c), m.type == CKEDITOR.NODE_ELEMENT && u[m.getName()] ? CKEDITOR.plugins.list.listToArray(m, l, d, f + 1, k.grandparent) : k.contents.push(m)
  16728. }
  16729. }
  16730. return d
  16731. }, arrayToList: function (a, l, d, f, e) {
  16732. d || (d = 0);
  16733. if (!a || a.length < d + 1) return null;
  16734. for (var g, b = a[d].parent.getDocument(), h = new CKEDITOR.dom.documentFragment(b), k = null, c = d, p = Math.max(a[d].indent, 0), m =
  16735. null, n, r, y = f == CKEDITOR.ENTER_P ? "p" : "div"; ;) {
  16736. var q = a[c];
  16737. g = q.grandparent;
  16738. n = q.element.getDirection(1);
  16739. if (q.indent == p) {
  16740. k && a[c].parent.getName() == k.getName() || (k = a[c].parent.clone(!1, 1), e && k.setAttribute("dir", e), h.append(k));
  16741. m = k.append(q.element.clone(0, 1));
  16742. n != k.getDirection(1) && m.setAttribute("dir", n);
  16743. for (g = 0; g < q.contents.length; g++) m.append(q.contents[g].clone(1, 1));
  16744. c++
  16745. } else if (q.indent == Math.max(p, 0) + 1) q = a[c - 1].element.getDirection(1), c = CKEDITOR.plugins.list.arrayToList(a, null, c, f, q != n ? n : null), !m.getChildCount() &&
  16746. CKEDITOR.env.needsNbspFiller && 7 >= b.$.documentMode && m.append(b.createText(" ")), m.append(c.listNode), c = c.nextIndex; else if (-1 == q.indent && !d && g) {
  16747. u[g.getName()] ? (m = q.element.clone(!1, !0), n != g.getDirection(1) && m.setAttribute("dir", n)) : m = new CKEDITOR.dom.documentFragment(b);
  16748. var k = g.getDirection(1) != n, w = q.element, B = w.getAttribute("class"),
  16749. E = w.getAttribute("style"),
  16750. J = m.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (f != CKEDITOR.ENTER_BR || k || E || B), v,
  16751. z = q.contents.length, x;
  16752. for (g = 0; g < z; g++) if (v = q.contents[g], I(v) &&
  16753. 1 < z) J ? x = v.clone(1, 1) : m.append(v.clone(1, 1)); else if (v.type == CKEDITOR.NODE_ELEMENT && v.isBlockBoundary()) {
  16754. k && !v.getDirection() && v.setAttribute("dir", n);
  16755. r = v;
  16756. var A = w.getAttribute("style");
  16757. A && r.setAttribute("style", A.replace(/([^;])$/, "$1;") + (r.getAttribute("style") || ""));
  16758. B && v.addClass(B);
  16759. r = null;
  16760. x && (m.append(x), x = null);
  16761. m.append(v.clone(1, 1))
  16762. } else J ? (r || (r = b.createElement(y), m.append(r), k && r.setAttribute("dir", n)), E && r.setAttribute("style", E), B && r.setAttribute("class", B), x && (r.append(x), x = null), r.append(v.clone(1,
  16763. 1))) : m.append(v.clone(1, 1));
  16764. x && ((r || m).append(x), x = null);
  16765. m.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && c != a.length - 1 && (CKEDITOR.env.needsBrFiller && (n = m.getLast()) && n.type == CKEDITOR.NODE_ELEMENT && n.is("br") && n.remove(), (n = m.getLast(t)) && n.type == CKEDITOR.NODE_ELEMENT && n.is(CKEDITOR.dtd.$block) || m.append(b.createElement("br")));
  16766. n = m.$.nodeName.toLowerCase();
  16767. "div" != n && "p" != n || m.appendBogus();
  16768. h.append(m);
  16769. k = null;
  16770. c++
  16771. } else return null;
  16772. r = null;
  16773. if (a.length <= c || Math.max(a[c].indent, 0) < p) break
  16774. }
  16775. if (l) for (a = h.getFirst(); a;) {
  16776. if (a.type ==
  16777. CKEDITOR.NODE_ELEMENT && (CKEDITOR.dom.element.clearMarkers(l, a), a.getName() in CKEDITOR.dtd.$listItem && (d = a, b = e = f = void 0, f = d.getDirection()))) {
  16778. for (e = d.getParent(); e && !(b = e.getDirection());) e = e.getParent();
  16779. f == b && d.removeAttribute("dir")
  16780. }
  16781. a = a.getNextSourceNode()
  16782. }
  16783. return {listNode: h, nextIndex: c}
  16784. }
  16785. };
  16786. var M = /^h[1-6]$/, O = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
  16787. C.prototype = {
  16788. exec: function (a) {
  16789. function l(a) {
  16790. return u[a.root.getName()] && !d(a.root, [CKEDITOR.NODE_COMMENT])
  16791. }
  16792. function d(a, b) {
  16793. return CKEDITOR.tools.array.filter(a.getChildren().toArray(),
  16794. function (a) {
  16795. return -1 === CKEDITOR.tools.array.indexOf(b, a.type)
  16796. }).length
  16797. }
  16798. function f(a) {
  16799. var b = !0;
  16800. if (0 === a.getChildCount()) return !1;
  16801. a.forEach(function (a) {
  16802. if (a.type !== CKEDITOR.NODE_COMMENT) return b = !1
  16803. }, null, !0);
  16804. return b
  16805. }
  16806. this.refresh(a, a.elementPath());
  16807. var e = a.config, g = a.getSelection(), b = g && g.getRanges();
  16808. if (this.state == CKEDITOR.TRISTATE_OFF) {
  16809. var h = a.editable();
  16810. if (h.getFirst(t)) {
  16811. var k = 1 == b.length && b[0];
  16812. (e = k && k.getEnclosedNode()) && e.is && this.type == e.getName() && this.setState(CKEDITOR.TRISTATE_ON)
  16813. } else e.enterMode ==
  16814. CKEDITOR.ENTER_BR ? h.appendBogus() : b[0].fixBlock(1, e.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), g.selectRanges(b)
  16815. }
  16816. for (var e = g.createBookmarks(!0), h = [], c = {}, b = b.createIterator(), p = 0; (k = b.getNextRange()) && ++p;) {
  16817. var m = k.getBoundaryNodes(), n = m.startNode, r = m.endNode;
  16818. n.type == CKEDITOR.NODE_ELEMENT && "td" == n.getName() && k.setStartAt(m.startNode, CKEDITOR.POSITION_AFTER_START);
  16819. r.type == CKEDITOR.NODE_ELEMENT && "td" == r.getName() && k.setEndAt(m.endNode, CKEDITOR.POSITION_BEFORE_END);
  16820. k = k.createIterator();
  16821. for (k.forceBrBreak =
  16822. this.state == CKEDITOR.TRISTATE_OFF; m = k.getNextParagraph();) if (!m.getCustomData("list_block") && !f(m)) {
  16823. CKEDITOR.dom.element.setMarker(c, m, "list_block", 1);
  16824. for (var y = a.elementPath(m), n = y.elements, r = 0, y = y.blockLimit, q, w = n.length - 1; 0 <= w && (q = n[w]); w--) if (u[q.getName()] && y.contains(q)) {
  16825. y.removeCustomData("list_group_object_" + p);
  16826. (n = q.getCustomData("list_group_object")) ? n.contents.push(m) : (n = {
  16827. root: q,
  16828. contents: [m]
  16829. }, h.push(n), CKEDITOR.dom.element.setMarker(c, q, "list_group_object", n));
  16830. r = 1;
  16831. break
  16832. }
  16833. r || (r = y, r.getCustomData("list_group_object_" +
  16834. p) ? r.getCustomData("list_group_object_" + p).contents.push(m) : (n = {
  16835. root: r,
  16836. contents: [m]
  16837. }, CKEDITOR.dom.element.setMarker(c, r, "list_group_object_" + p, n), h.push(n)))
  16838. }
  16839. }
  16840. for (q = []; 0 < h.length;) n = h.shift(), this.state == CKEDITOR.TRISTATE_OFF ? l(n) || (u[n.root.getName()] ? K.call(this, a, n, c, q) : L.call(this, a, n, q)) : this.state == CKEDITOR.TRISTATE_ON && u[n.root.getName()] && !l(n) && N.call(this, a, n, c);
  16841. for (w = 0; w < q.length; w++) G(q[w]);
  16842. CKEDITOR.dom.element.clearAllMarkers(c);
  16843. g.selectBookmarks(e);
  16844. a.focus()
  16845. }, refresh: function (a, l) {
  16846. var d =
  16847. l.contains(u, 1), f = l.blockLimit || l.root;
  16848. d && f.contains(d) ? this.setState(d.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF)
  16849. }
  16850. };
  16851. CKEDITOR.plugins.add("list", {
  16852. requires: "indentlist", init: function (a) {
  16853. a.blockless || (a.addCommand("numberedlist", new C("numberedlist", "ol")), a.addCommand("bulletedlist", new C("bulletedlist", "ul")), a.ui.addButton && (a.ui.addButton("NumberedList", {
  16854. label: a.lang.list.numberedlist,
  16855. command: "numberedlist",
  16856. directional: !0,
  16857. toolbar: "list,10"
  16858. }), a.ui.addButton("BulletedList",
  16859. {
  16860. label: a.lang.list.bulletedlist,
  16861. command: "bulletedlist",
  16862. directional: !0,
  16863. toolbar: "list,20"
  16864. })), a.on("key", function (l) {
  16865. var d = l.data.domEvent.getKey(), f;
  16866. if ("wysiwyg" == a.mode && d in {8: 1, 46: 1}) {
  16867. var e = a.getSelection().getRanges()[0], g = e && e.startPath();
  16868. if (e && e.collapsed) {
  16869. var b = 8 == d, h = a.editable(), k = new CKEDITOR.dom.walker(e.clone());
  16870. k.evaluator = function (a) {
  16871. return t(a) && !z(a)
  16872. };
  16873. k.guard = function (a, b) {
  16874. return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table"))
  16875. };
  16876. d = e.clone();
  16877. if (b) {
  16878. var c;
  16879. (c = g.contains(u)) && e.checkBoundaryOfElement(c,
  16880. CKEDITOR.START) && (c = c.getParent()) && c.is("li") && (c = A(c)) ? (f = c, c = c.getPrevious(t), d.moveToPosition(c && z(c) ? c : f, CKEDITOR.POSITION_BEFORE_START)) : (k.range.setStartAt(h, CKEDITOR.POSITION_AFTER_START), k.range.setEnd(e.startContainer, e.startOffset), (c = k.previous()) && c.type == CKEDITOR.NODE_ELEMENT && (c.getName() in u || c.is("li")) && (c.is("li") || (k.range.selectNodeContents(c), k.reset(), k.evaluator = H, c = k.previous()), f = c, d.moveToElementEditEnd(f), d.moveToPosition(d.endPath().block, CKEDITOR.POSITION_BEFORE_END)));
  16881. if (f) D(a, d, e), l.cancel(); else {
  16882. var p = g.contains(u);
  16883. p && e.checkBoundaryOfElement(p, CKEDITOR.START) && (f = p.getFirst(t), e.checkBoundaryOfElement(f, CKEDITOR.START) && (c = p.getPrevious(t), A(f) ? c && (e.moveToElementEditEnd(c), e.select()) : a.execCommand("outdent"), l.cancel()))
  16884. }
  16885. } else if (f = g.contains("li")) {
  16886. if (k.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), b = (h = f.getLast(t)) && H(h) ? h : f, g = 0, (c = k.next()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in u && c.equals(h) ? (g = 1, c = k.next()) : e.checkBoundaryOfElement(b, CKEDITOR.END) &&
  16887. (g = 2), g && c) {
  16888. e = e.clone();
  16889. e.moveToElementEditStart(c);
  16890. if (1 == g && (d.optimize(), !d.startContainer.equals(f))) {
  16891. for (f = d.startContainer; f.is(CKEDITOR.dtd.$inline);) p = f, f = f.getParent();
  16892. p && d.moveToPosition(p, CKEDITOR.POSITION_AFTER_END)
  16893. }
  16894. 2 == g && (d.moveToPosition(d.endPath().block, CKEDITOR.POSITION_BEFORE_END), e.endPath().block && e.moveToPosition(e.endPath().block, CKEDITOR.POSITION_AFTER_START));
  16895. D(a, d, e);
  16896. l.cancel()
  16897. }
  16898. } else k.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), (c = k.next()) && c.type == CKEDITOR.NODE_ELEMENT &&
  16899. c.is(u) && (c = c.getFirst(t), g.block && e.checkStartOfBlock() && e.checkEndOfBlock() ? (g.block.remove(), e.moveToElementEditStart(c), e.select()) : A(c) ? (e.moveToElementEditStart(c), e.select()) : (e = e.clone(), e.moveToElementEditStart(c), D(a, d, e)), l.cancel());
  16900. setTimeout(function () {
  16901. a.selectionChange(1)
  16902. })
  16903. }
  16904. }
  16905. }))
  16906. }
  16907. })
  16908. })();
  16909. (function () {
  16910. CKEDITOR.plugins.liststyle = {
  16911. requires: "dialog,contextmenu", init: function (a) {
  16912. if (!a.blockless) {
  16913. var b;
  16914. b = new CKEDITOR.dialogCommand("numberedListStyle", {
  16915. requiredContent: "ol",
  16916. allowedContent: "ol{list-style-type}[start]; li{list-style-type}[value]",
  16917. contentTransformations: [["ol: listTypeToStyle"]]
  16918. });
  16919. b = a.addCommand("numberedListStyle", b);
  16920. a.addFeature(b);
  16921. CKEDITOR.dialog.add("numberedListStyle", this.path + "dialogs/liststyle.js");
  16922. b = new CKEDITOR.dialogCommand("bulletedListStyle", {
  16923. requiredContent: "ul",
  16924. allowedContent: "ul{list-style-type}", contentTransformations: [["ul: listTypeToStyle"]]
  16925. });
  16926. b = a.addCommand("bulletedListStyle", b);
  16927. a.addFeature(b);
  16928. CKEDITOR.dialog.add("bulletedListStyle", this.path + "dialogs/liststyle.js");
  16929. a.addMenuGroup("list", 108);
  16930. a.addMenuItems({
  16931. numberedlist: {
  16932. label: a.lang.liststyle.numberedTitle,
  16933. group: "list",
  16934. command: "numberedListStyle"
  16935. },
  16936. bulletedlist: {
  16937. label: a.lang.liststyle.bulletedTitle,
  16938. group: "list",
  16939. command: "bulletedListStyle"
  16940. }
  16941. });
  16942. a.contextMenu.addListener(function (a) {
  16943. if (!a || a.isReadOnly()) return null;
  16944. for (; a;) {
  16945. var b = a.getName();
  16946. if ("ol" == b) return {numberedlist: CKEDITOR.TRISTATE_OFF};
  16947. if ("ul" == b) return {bulletedlist: CKEDITOR.TRISTATE_OFF};
  16948. a = a.getParent()
  16949. }
  16950. return null
  16951. })
  16952. }
  16953. }
  16954. };
  16955. CKEDITOR.plugins.add("liststyle", CKEDITOR.plugins.liststyle)
  16956. })();
  16957. (function () {
  16958. function V(a, c, d) {
  16959. return n(c) && n(d) && d.equals(c.getNext(function (a) {
  16960. return !(E(a) || F(a) || u(a))
  16961. }))
  16962. }
  16963. function z(a) {
  16964. this.upper = a[0];
  16965. this.lower = a[1];
  16966. this.set.apply(this, a.slice(2))
  16967. }
  16968. function O(a) {
  16969. var c = a.element;
  16970. if (c && n(c) && (c = c.getAscendant(a.triggers, !0)) && a.editable.contains(c)) {
  16971. var d = P(c);
  16972. if ("true" == d.getAttribute("contenteditable")) return c;
  16973. if (d.is(a.triggers)) return d
  16974. }
  16975. return null
  16976. }
  16977. function ka(a, c, d) {
  16978. r(a, c);
  16979. r(a, d);
  16980. a = c.size.bottom;
  16981. d = d.size.top;
  16982. return a && d ? 0 | (a + d) / 2 : a || d
  16983. }
  16984. function w(a, c, d) {
  16985. return c =
  16986. c[d ? "getPrevious" : "getNext"](function (b) {
  16987. return b && b.type == CKEDITOR.NODE_TEXT && !E(b) || n(b) && !u(b) && !A(a, b)
  16988. })
  16989. }
  16990. function q(a, c, d) {
  16991. return a > c && a < d
  16992. }
  16993. function P(a, c) {
  16994. if (a.data("cke-editable")) return null;
  16995. for (c || (a = a.getParent()); a && !a.data("cke-editable");) {
  16996. if (a.hasAttribute("contenteditable")) return a;
  16997. a = a.getParent()
  16998. }
  16999. return null
  17000. }
  17001. function la(a) {
  17002. var c = a.doc,
  17003. d = G('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"' + Q + "position:absolute;border-top:1px dashed " + a.boxColor + '"\x3e\x3c/span\x3e',
  17004. c),
  17005. b = CKEDITOR.getUrl(this.path + "images/" + (t.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") + ".png");
  17006. v(d, {
  17007. attach: function () {
  17008. this.wrap.getParent() || this.wrap.appendTo(a.editable, !0);
  17009. return this
  17010. },
  17011. lineChildren: [v(G('\x3cspan title\x3d"' + a.editor.lang.magicline.title + '" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e', c), {
  17012. base: Q + "height:17px;width:17px;" + (a.rtl ? "left" : "right") + ":17px;background:url(" + b + ") center no-repeat " + a.boxColor + ";cursor:pointer;" + (t.hc ? "font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;" :
  17013. "") + (t.hidpi ? "background-size: 9px 10px;" : ""),
  17014. looks: ["top:-8px; border-radius: 2px;", "top:-17px; border-radius: 2px 2px 0px 0px;", "top:-1px; border-radius: 0px 0px 2px 2px;"]
  17015. }), v(G(W, c), {
  17016. base: X + "left:0px;border-left-color:" + a.boxColor + ";",
  17017. looks: ["border-width:8px 0 8px 8px;top:-8px", "border-width:8px 0 0 8px;top:-8px", "border-width:0 0 8px 8px;top:0px"]
  17018. }), v(G(W, c), {
  17019. base: X + "right:0px;border-right-color:" + a.boxColor + ";",
  17020. looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px",
  17021. "border-width:0 8px 8px 0;top:0px"]
  17022. })],
  17023. detach: function () {
  17024. this.wrap.getParent() && this.wrap.remove();
  17025. return this
  17026. },
  17027. mouseNear: function () {
  17028. r(a, this);
  17029. var b = a.holdDistance, c = this.size;
  17030. return c && q(a.mouse.y, c.top - b, c.bottom + b) && q(a.mouse.x, c.left - b, c.right + b) ? !0 : !1
  17031. },
  17032. place: function () {
  17033. var b = a.view, c = a.editable, d = a.trigger, h = d.upper, g = d.lower, l = h || g,
  17034. p = l.getParent(), m = {};
  17035. this.trigger = d;
  17036. h && r(a, h, !0);
  17037. g && r(a, g, !0);
  17038. r(a, p, !0);
  17039. a.inInlineMode && H(a, !0);
  17040. p.equals(c) ? (m.left = b.scroll.x, m.right = -b.scroll.x, m.width = "") : (m.left =
  17041. l.size.left - l.size.margin.left + b.scroll.x - (a.inInlineMode ? b.editable.left + b.editable.border.left : 0), m.width = l.size.outerWidth + l.size.margin.left + l.size.margin.right + b.scroll.x, m.right = "");
  17042. h && g ? m.top = h.size.margin.bottom === g.size.margin.top ? 0 | h.size.bottom + h.size.margin.bottom / 2 : h.size.margin.bottom < g.size.margin.top ? h.size.bottom + h.size.margin.bottom : h.size.bottom + h.size.margin.bottom - g.size.margin.top : h ? g || (m.top = h.size.bottom + h.size.margin.bottom) : m.top = g.size.top - g.size.margin.top;
  17043. d.is(C) || q(m.top,
  17044. b.scroll.y - 15, b.scroll.y + 5) ? (m.top = a.inInlineMode ? 0 : b.scroll.y, this.look(C)) : d.is(D) || q(m.top, b.pane.bottom - 5, b.pane.bottom + 15) ? (m.top = a.inInlineMode ? b.editable.height + b.editable.padding.top + b.editable.padding.bottom : b.pane.bottom - 1, this.look(D)) : (a.inInlineMode && (m.top -= b.editable.top + b.editable.border.top), this.look(x));
  17045. a.inInlineMode && (m.top--, m.top += b.editable.scroll.top, m.left += b.editable.scroll.left);
  17046. for (var n in m) m[n] = CKEDITOR.tools.cssLength(m[n]);
  17047. this.setStyles(m)
  17048. },
  17049. look: function (a) {
  17050. if (this.oldLook !=
  17051. a) {
  17052. for (var b = this.lineChildren.length, c; b--;) (c = this.lineChildren[b]).setAttribute("style", c.base + c.looks[0 | a / 2]);
  17053. this.oldLook = a
  17054. }
  17055. },
  17056. wrap: new R("span", a.doc)
  17057. });
  17058. for (c = d.lineChildren.length; c--;) d.lineChildren[c].appendTo(d);
  17059. d.look(x);
  17060. d.appendTo(d.wrap);
  17061. d.unselectable();
  17062. d.lineChildren[0].on("mouseup", function (b) {
  17063. d.detach();
  17064. S(a, function (b) {
  17065. var c = a.line.trigger;
  17066. b[c.is(I) ? "insertBefore" : "insertAfter"](c.is(I) ? c.lower : c.upper)
  17067. }, !0);
  17068. a.editor.focus();
  17069. t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  17070. b.data.preventDefault(!0)
  17071. });
  17072. d.on("mousedown", function (a) {
  17073. a.data.preventDefault(!0)
  17074. });
  17075. a.line = d
  17076. }
  17077. function S(a, c, d) {
  17078. var b = new CKEDITOR.dom.range(a.doc), e = a.editor, f;
  17079. t.ie && a.enterMode == CKEDITOR.ENTER_BR ? f = a.doc.createText(J) : (f = (f = P(a.element, !0)) && f.data("cke-enter-mode") || a.enterMode, f = new R(K[f], a.doc), f.is("br") || a.doc.createText(J).appendTo(f));
  17080. d && e.fire("saveSnapshot");
  17081. c(f);
  17082. b.moveToPosition(f, CKEDITOR.POSITION_AFTER_START);
  17083. e.getSelection().selectRanges([b]);
  17084. a.hotNode = f;
  17085. d && e.fire("saveSnapshot")
  17086. }
  17087. function Y(a, c) {
  17088. return {
  17089. canUndo: !0, modes: {wysiwyg: 1}, exec: function () {
  17090. function d(b) {
  17091. var d = t.ie && 9 > t.version ? " " : J,
  17092. f = a.hotNode && a.hotNode.getText() == d && a.element.equals(a.hotNode) && a.lastCmdDirection === !!c;
  17093. S(a, function (d) {
  17094. f && a.hotNode && a.hotNode.remove();
  17095. d[c ? "insertAfter" : "insertBefore"](b);
  17096. d.setAttributes({"data-cke-magicline-hot": 1, "data-cke-magicline-dir": !!c});
  17097. a.lastCmdDirection = !!c
  17098. });
  17099. t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  17100. a.line.detach()
  17101. }
  17102. return function (b) {
  17103. b = b.getSelection().getStartElement();
  17104. var e;
  17105. b = b.getAscendant(Z, 1);
  17106. if (!aa(a, b) && b && !b.equals(a.editable) && !b.contains(a.editable)) {
  17107. (e = P(b)) && "false" == e.getAttribute("contenteditable") && (b = e);
  17108. a.element = b;
  17109. e = w(a, b, !c);
  17110. var f;
  17111. n(e) && e.is(a.triggers) && e.is(ma) && (!w(a, e, !c) || (f = w(a, e, !c)) && n(f) && f.is(a.triggers)) ? d(e) : (f = O(a, b), n(f) && (w(a, f, !c) ? (b = w(a, f, !c)) && n(b) && b.is(a.triggers) && d(f) : d(f)))
  17112. }
  17113. }
  17114. }()
  17115. }
  17116. }
  17117. function A(a, c) {
  17118. if (!c || c.type != CKEDITOR.NODE_ELEMENT || !c.$) return !1;
  17119. var d = a.line;
  17120. return d.wrap.equals(c) || d.wrap.contains(c)
  17121. }
  17122. function n(a) {
  17123. return a &&
  17124. a.type == CKEDITOR.NODE_ELEMENT && a.$
  17125. }
  17126. function u(a) {
  17127. if (!n(a)) return !1;
  17128. var c;
  17129. (c = ba(a)) || (n(a) ? (c = {
  17130. left: 1,
  17131. right: 1,
  17132. center: 1
  17133. }, c = !(!c[a.getComputedStyle("float")] && !c[a.getAttribute("align")])) : c = !1);
  17134. return c
  17135. }
  17136. function ba(a) {
  17137. return !!{absolute: 1, fixed: 1}[a.getComputedStyle("position")]
  17138. }
  17139. function L(a, c) {
  17140. return n(c) ? c.is(a.triggers) : null
  17141. }
  17142. function aa(a, c) {
  17143. if (!c) return !1;
  17144. for (var d = c.getParents(1), b = d.length; b--;) for (var e = a.tabuList.length; e--;) if (d[b].hasAttribute(a.tabuList[e])) return !0;
  17145. return !1
  17146. }
  17147. function na(a,
  17148. c, d) {
  17149. c = c[d ? "getLast" : "getFirst"](function (b) {
  17150. return a.isRelevant(b) && !b.is(oa)
  17151. });
  17152. if (!c) return !1;
  17153. r(a, c);
  17154. return d ? c.size.top > a.mouse.y : c.size.bottom < a.mouse.y
  17155. }
  17156. function ca(a) {
  17157. var c = a.editable, d = a.mouse, b = a.view, e = a.triggerOffset;
  17158. H(a);
  17159. var f = d.y > (a.inInlineMode ? b.editable.top + b.editable.height / 2 : Math.min(b.editable.height, b.pane.height) / 2),
  17160. c = c[f ? "getLast" : "getFirst"](function (a) {
  17161. return !(E(a) || F(a))
  17162. });
  17163. if (!c) return null;
  17164. A(a, c) && (c = a.line.wrap[f ? "getPrevious" : "getNext"](function (a) {
  17165. return !(E(a) || F(a))
  17166. }));
  17167. if (!n(c) || u(c) || !L(a, c)) return null;
  17168. r(a, c);
  17169. return !f && 0 <= c.size.top && q(d.y, 0, c.size.top + e) ? (a = a.inInlineMode || 0 === b.scroll.y ? C : x, new z([null, c, I, M, a])) : f && c.size.bottom <= b.pane.height && q(d.y, c.size.bottom - e, b.pane.height) ? (a = a.inInlineMode || q(c.size.bottom, b.pane.height - e, b.pane.height) ? D : x, new z([c, null, da, M, a])) : null
  17170. }
  17171. function ea(a) {
  17172. var c = a.mouse, d = a.view, b = a.triggerOffset, e = O(a);
  17173. if (!e) return null;
  17174. r(a, e);
  17175. var b = Math.min(b, 0 | e.size.outerHeight / 2), f = [], k, h;
  17176. if (q(c.y, e.size.top - 1, e.size.top + b)) h = !1; else if (q(c.y,
  17177. e.size.bottom - b, e.size.bottom + 1)) h = !0; else return null;
  17178. if (u(e) || na(a, e, h) || e.getParent().is(fa)) return null;
  17179. var g = w(a, e, !h);
  17180. if (g) {
  17181. if (g && g.type == CKEDITOR.NODE_TEXT) return null;
  17182. if (n(g)) {
  17183. if (u(g) || !L(a, g) || g.getParent().is(fa)) return null;
  17184. f = [g, e][h ? "reverse" : "concat"]().concat([T, M])
  17185. }
  17186. } else e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? (H(a), h && q(c.y, e.size.bottom - b, d.pane.height) && q(e.size.bottom, d.pane.height - b, d.pane.height) ? k = D : q(c.y, 0, e.size.top + b) && (k = C)) : k = x, f = [null, e][h ? "reverse" :
  17187. "concat"]().concat([h ? da : I, M, k, e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? h ? D : C : x]);
  17188. return 0 in f ? new z(f) : null
  17189. }
  17190. function U(a, c, d, b) {
  17191. for (var e = c.getDocumentPosition(), f = {}, k = {}, h = {}, g = {}, l = y.length; l--;) f[y[l]] = parseInt(c.getComputedStyle.call(c, "border-" + y[l] + "-width"), 10) || 0, h[y[l]] = parseInt(c.getComputedStyle.call(c, "padding-" + y[l]), 10) || 0, k[y[l]] = parseInt(c.getComputedStyle.call(c, "margin-" + y[l]), 10) || 0;
  17192. d && !b || N(a, b);
  17193. g.top = e.y - (d ? 0 : a.view.scroll.y);
  17194. g.left = e.x - (d ? 0 : a.view.scroll.x);
  17195. g.outerWidth = c.$.offsetWidth;
  17196. g.outerHeight = c.$.offsetHeight;
  17197. g.height = g.outerHeight - (h.top + h.bottom + f.top + f.bottom);
  17198. g.width = g.outerWidth - (h.left + h.right + f.left + f.right);
  17199. g.bottom = g.top + g.outerHeight;
  17200. g.right = g.left + g.outerWidth;
  17201. a.inInlineMode && (g.scroll = {top: c.$.scrollTop, left: c.$.scrollLeft});
  17202. return v({border: f, padding: h, margin: k, ignoreScroll: d}, g, !0)
  17203. }
  17204. function r(a, c, d) {
  17205. if (!n(c)) return c.size = null;
  17206. if (!c.size) c.size = {}; else if (c.size.ignoreScroll == d && c.size.date > new Date - ga) return null;
  17207. return v(c.size,
  17208. U(a, c, d), {date: +new Date}, !0)
  17209. }
  17210. function H(a, c) {
  17211. a.view.editable = U(a, a.editable, c, !0)
  17212. }
  17213. function N(a, c) {
  17214. a.view || (a.view = {});
  17215. var d = a.view;
  17216. if (!(!c && d && d.date > new Date - ga)) {
  17217. var b = a.win, d = b.getScrollPosition(), b = b.getViewPaneSize();
  17218. v(a.view, {
  17219. scroll: {
  17220. x: d.x,
  17221. y: d.y,
  17222. width: a.doc.$.documentElement.scrollWidth - b.width,
  17223. height: a.doc.$.documentElement.scrollHeight - b.height
  17224. }, pane: {width: b.width, height: b.height, bottom: b.height + d.y}, date: +new Date
  17225. }, !0)
  17226. }
  17227. }
  17228. function pa(a, c, d, b) {
  17229. for (var e = b, f = b, k = 0, h = !1, g = !1, l = a.view.pane.height,
  17230. p = a.mouse; p.y + k < l && 0 < p.y - k;) {
  17231. h || (h = c(e, b));
  17232. g || (g = c(f, b));
  17233. !h && 0 < p.y - k && (e = d(a, {x: p.x, y: p.y - k}));
  17234. !g && p.y + k < l && (f = d(a, {x: p.x, y: p.y + k}));
  17235. if (h && g) break;
  17236. k += 2
  17237. }
  17238. return new z([e, f, null, null])
  17239. }
  17240. CKEDITOR.plugins.add("magicline", {
  17241. init: function (a) {
  17242. var c = a.config, d = c.magicline_triggerOffset || 30, b = {
  17243. editor: a,
  17244. enterMode: c.enterMode,
  17245. triggerOffset: d,
  17246. holdDistance: 0 | d * (c.magicline_holdDistance || .5),
  17247. boxColor: c.magicline_color || "#ff0000",
  17248. rtl: "rtl" == c.contentsLangDirection,
  17249. tabuList: ["data-cke-hidden-sel"].concat(c.magicline_tabuList ||
  17250. []),
  17251. triggers: c.magicline_everywhere ? Z : {
  17252. table: 1,
  17253. hr: 1,
  17254. div: 1,
  17255. ul: 1,
  17256. ol: 1,
  17257. dl: 1,
  17258. form: 1,
  17259. blockquote: 1
  17260. }
  17261. }, e, f, k;
  17262. b.isRelevant = function (a) {
  17263. return n(a) && !A(b, a) && !u(a)
  17264. };
  17265. a.on("contentDom", function () {
  17266. var d = a.editable(), g = a.document, l = a.window;
  17267. v(b, {editable: d, inInlineMode: d.isInline(), doc: g, win: l, hotNode: null}, !0);
  17268. b.boundary = b.inInlineMode ? b.editable : b.doc.getDocumentElement();
  17269. d.is(B.$inline) || (b.inInlineMode && !ba(d) && d.setStyles({
  17270. position: "relative",
  17271. top: null,
  17272. left: null
  17273. }), la.call(this, b), N(b), d.attachListener(a, "beforeUndoImage",
  17274. function () {
  17275. b.line.detach()
  17276. }), d.attachListener(a, "beforeGetData", function () {
  17277. b.line.wrap.getParent() && (b.line.detach(), a.once("getData", function () {
  17278. b.line.attach()
  17279. }, null, null, 1E3))
  17280. }, null, null, 0), d.attachListener(b.inInlineMode ? g : g.getWindow().getFrame(), "mouseout", function (c) {
  17281. if ("wysiwyg" == a.mode) if (b.inInlineMode) {
  17282. var d = c.data.$.clientX;
  17283. c = c.data.$.clientY;
  17284. N(b);
  17285. H(b, !0);
  17286. var e = b.view.editable, f = b.view.scroll;
  17287. d > e.left - f.x && d < e.right - f.x && c > e.top - f.y && c < e.bottom - f.y || (clearTimeout(k), k = null, b.line.detach())
  17288. } else clearTimeout(k),
  17289. k = null, b.line.detach()
  17290. }), d.attachListener(d, "keyup", function () {
  17291. b.hiddenMode = 0
  17292. }), d.attachListener(d, "keydown", function (c) {
  17293. if ("wysiwyg" == a.mode) switch (c.data.getKeystroke()) {
  17294. case 2228240:
  17295. case 16:
  17296. b.hiddenMode = 1, b.line.detach()
  17297. }
  17298. }), d.attachListener(b.inInlineMode ? d : g, "mousemove", function (c) {
  17299. f = !0;
  17300. if ("wysiwyg" == a.mode && !a.readOnly && !k) {
  17301. var d = {x: c.data.$.clientX, y: c.data.$.clientY};
  17302. k = setTimeout(function () {
  17303. b.mouse = d;
  17304. k = b.trigger = null;
  17305. N(b);
  17306. f && !b.hiddenMode && a.focusManager.hasFocus && !b.line.mouseNear() && (b.element =
  17307. ha(b, !0)) && ((b.trigger = ca(b) || ea(b) || ia(b)) && !aa(b, b.trigger.upper || b.trigger.lower) ? b.line.attach().place() : (b.trigger = null, b.line.detach()), f = !1)
  17308. }, 30)
  17309. }
  17310. }), d.attachListener(l, "scroll", function () {
  17311. "wysiwyg" == a.mode && (b.line.detach(), t.webkit && (b.hiddenMode = 1, clearTimeout(e), e = setTimeout(function () {
  17312. b.mouseDown || (b.hiddenMode = 0)
  17313. }, 50)))
  17314. }), d.attachListener(ja ? g : l, "mousedown", function () {
  17315. "wysiwyg" == a.mode && (b.line.detach(), b.hiddenMode = 1, b.mouseDown = 1)
  17316. }), d.attachListener(ja ? g : l, "mouseup", function () {
  17317. b.hiddenMode =
  17318. 0;
  17319. b.mouseDown = 0
  17320. }), a.addCommand("accessPreviousSpace", Y(b)), a.addCommand("accessNextSpace", Y(b, !0)), a.setKeystroke([[c.magicline_keystrokePrevious, "accessPreviousSpace"], [c.magicline_keystrokeNext, "accessNextSpace"]]), a.on("loadSnapshot", function () {
  17321. var c, d, e, f;
  17322. for (f in {
  17323. p: 1,
  17324. br: 1,
  17325. div: 1
  17326. }) for (c = a.document.getElementsByTag(f), e = c.count(); e--;) if ((d = c.getItem(e)).data("cke-magicline-hot")) {
  17327. b.hotNode = d;
  17328. b.lastCmdDirection = "true" === d.data("cke-magicline-dir") ? !0 : !1;
  17329. return
  17330. }
  17331. }), a._.magiclineBackdoor = {
  17332. accessFocusSpace: S,
  17333. boxTrigger: z,
  17334. isLine: A,
  17335. getAscendantTrigger: O,
  17336. getNonEmptyNeighbour: w,
  17337. getSize: U,
  17338. that: b,
  17339. triggerEdge: ea,
  17340. triggerEditable: ca,
  17341. triggerExpand: ia
  17342. })
  17343. }, this)
  17344. }
  17345. });
  17346. var v = CKEDITOR.tools.extend, R = CKEDITOR.dom.element, G = R.createFromHtml, t = CKEDITOR.env,
  17347. ja = CKEDITOR.env.ie && 9 > CKEDITOR.env.version, B = CKEDITOR.dtd, K = {}, I = 128, da = 64, T = 32,
  17348. M = 16, C = 4, D = 2, x = 1, J = " ", fa = B.$listItem, oa = B.$tableContent,
  17349. ma = v({}, B.$nonEditable, B.$empty), Z = B.$block, ga = 100,
  17350. Q = "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
  17351. X = Q + "border-color:transparent;display:block;border-style:solid;",
  17352. W = "\x3cspan\x3e" + J + "\x3c/span\x3e";
  17353. K[CKEDITOR.ENTER_BR] = "br";
  17354. K[CKEDITOR.ENTER_P] = "p";
  17355. K[CKEDITOR.ENTER_DIV] = "div";
  17356. z.prototype = {
  17357. set: function (a, c, d) {
  17358. this.properties = a + c + (d || x);
  17359. return this
  17360. }, is: function (a) {
  17361. return (this.properties & a) == a
  17362. }
  17363. };
  17364. var ha = function () {
  17365. function a(a, d) {
  17366. var b = a.$.elementFromPoint(d.x, d.y);
  17367. return b && b.nodeType ? new CKEDITOR.dom.element(b) : null
  17368. }
  17369. return function (c, d, b) {
  17370. if (!c.mouse) return null;
  17371. var e = c.doc, f = c.line.wrap;
  17372. b = b || c.mouse;
  17373. var k = a(e, b);
  17374. d && A(c, k) && (f.hide(), k = a(e, b), f.show());
  17375. return !k || k.type != CKEDITOR.NODE_ELEMENT || !k.$ || t.ie && 9 > t.version && !c.boundary.equals(k) && !c.boundary.contains(k) ? null : k
  17376. }
  17377. }(), E = CKEDITOR.dom.walker.whitespaces(), F = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),
  17378. ia = function () {
  17379. function a(a) {
  17380. var b = a.element, e, f, k;
  17381. if (!n(b) || b.contains(a.editable) || b.isReadOnly()) return null;
  17382. k = pa(a, function (a, b) {
  17383. return !b.equals(a)
  17384. }, function (a, b) {
  17385. return ha(a, !0, b)
  17386. }, b);
  17387. e = k.upper;
  17388. f = k.lower;
  17389. if (V(a, e, f)) return k.set(T,
  17390. 8);
  17391. if (e && b.contains(e)) for (; !e.getParent().equals(b);) e = e.getParent(); else e = b.getFirst(function (b) {
  17392. return c(a, b)
  17393. });
  17394. if (f && b.contains(f)) for (; !f.getParent().equals(b);) f = f.getParent(); else f = b.getLast(function (b) {
  17395. return c(a, b)
  17396. });
  17397. if (!e || !f) return null;
  17398. r(a, e);
  17399. r(a, f);
  17400. if (!q(a.mouse.y, e.size.top, f.size.bottom)) return null;
  17401. for (var b = Number.MAX_VALUE, h, g, l, p; f && !f.equals(e) && (g = e.getNext(a.isRelevant));) h = Math.abs(ka(a, e, g) - a.mouse.y), h < b && (b = h, l = e, p = g), e = g, r(a, e);
  17402. if (!l || !p || !q(a.mouse.y, l.size.top, p.size.bottom)) return null;
  17403. k.upper = l;
  17404. k.lower = p;
  17405. return k.set(T, 8)
  17406. }
  17407. function c(a, b) {
  17408. return !(b && b.type == CKEDITOR.NODE_TEXT || F(b) || u(b) || A(a, b) || b.type == CKEDITOR.NODE_ELEMENT && b.$ && b.is("br"))
  17409. }
  17410. return function (c) {
  17411. var b = a(c), e;
  17412. if (e = b) {
  17413. e = b.upper;
  17414. var f = b.lower;
  17415. e = !e || !f || u(f) || u(e) || f.equals(e) || e.equals(f) || f.contains(e) || e.contains(f) ? !1 : L(c, e) && L(c, f) && V(c, e, f) ? !0 : !1
  17416. }
  17417. return e ? b : null
  17418. }
  17419. }(), y = ["top", "left", "right", "bottom"]
  17420. })();
  17421. CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51;
  17422. CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52;
  17423. (function () {
  17424. function n(a) {
  17425. if (!a || a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) return [];
  17426. for (var e = [], f = ["style", "className"], b = 0; b < f.length; b++) {
  17427. var c = a.$.elements.namedItem(f[b]);
  17428. c && (c = new CKEDITOR.dom.element(c), e.push([c, c.nextSibling]), c.remove())
  17429. }
  17430. return e
  17431. }
  17432. function t(a, e) {
  17433. if (a && a.type == CKEDITOR.NODE_ELEMENT && "form" == a.getName() && 0 < e.length) for (var f = e.length - 1; 0 <= f; f--) {
  17434. var b = e[f][0], c = e[f][1];
  17435. c ? b.insertBefore(c) : b.appendTo(a)
  17436. }
  17437. }
  17438. function r(a, e) {
  17439. var f = n(a), b = {}, c = a.$;
  17440. e || (b["class"] = c.className ||
  17441. "", c.className = "");
  17442. b.inline = c.style.cssText || "";
  17443. e || (c.style.cssText = "position: static; overflow: visible");
  17444. t(f);
  17445. return b
  17446. }
  17447. function u(a, e) {
  17448. var f = n(a), b = a.$;
  17449. "class" in e && (b.className = e["class"]);
  17450. "inline" in e && (b.style.cssText = e.inline);
  17451. t(f)
  17452. }
  17453. function v(a) {
  17454. if (!a.editable().isInline()) {
  17455. var e = CKEDITOR.instances, f;
  17456. for (f in e) {
  17457. var b = e[f];
  17458. "wysiwyg" != b.mode || b.readOnly || (b = b.document.getBody(), b.setAttribute("contentEditable", !1), b.setAttribute("contentEditable", !0))
  17459. }
  17460. a.editable().hasFocus && (a.toolbox.focus(),
  17461. a.focus())
  17462. }
  17463. }
  17464. CKEDITOR.plugins.add("maximize", {
  17465. init: function (a) {
  17466. function e() {
  17467. var b = c.getViewPaneSize();
  17468. a.resize(b.width, b.height, null, !0)
  17469. }
  17470. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  17471. var f = a.lang, b = CKEDITOR.document, c = b.getWindow(), l, m, p, n = CKEDITOR.TRISTATE_OFF;
  17472. a.addCommand("maximize", {
  17473. modes: {wysiwyg: !CKEDITOR.env.iOS, source: !CKEDITOR.env.iOS},
  17474. readOnly: 1,
  17475. editorFocus: !1,
  17476. exec: function () {
  17477. var h = a.container.getFirst(function (a) {
  17478. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  17479. }), g = a.ui.space("contents");
  17480. if ("wysiwyg" == a.mode) {
  17481. var d = a.getSelection();
  17482. l = d && d.getRanges();
  17483. m = c.getScrollPosition()
  17484. } else {
  17485. var k = a.editable().$;
  17486. l = !CKEDITOR.env.ie && [k.selectionStart, k.selectionEnd];
  17487. m = [k.scrollLeft, k.scrollTop]
  17488. }
  17489. if (this.state == CKEDITOR.TRISTATE_OFF) {
  17490. c.on("resize", e);
  17491. p = c.getScrollPosition();
  17492. for (d = a.container; d = d.getParent();) d.setCustomData("maximize_saved_styles", r(d)), d.setStyle("z-index", a.config.baseFloatZIndex - 5);
  17493. g.setCustomData("maximize_saved_styles", r(g, !0));
  17494. h.setCustomData("maximize_saved_styles", r(h, !0));
  17495. g = {overflow: CKEDITOR.env.webkit ? "" : "hidden", width: 0, height: 0};
  17496. b.getDocumentElement().setStyles(g);
  17497. !CKEDITOR.env.gecko && b.getDocumentElement().setStyle("position", "fixed");
  17498. CKEDITOR.env.gecko && CKEDITOR.env.quirks || b.getBody().setStyles(g);
  17499. CKEDITOR.env.ie ? setTimeout(function () {
  17500. c.$.scrollTo(0, 0)
  17501. }, 0) : c.$.scrollTo(0, 0);
  17502. h.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute");
  17503. h.$.offsetLeft;
  17504. h.setStyles({"z-index": a.config.baseFloatZIndex - 5, left: "0px", top: "0px"});
  17505. h.addClass("cke_maximized");
  17506. e();
  17507. g = h.getDocumentPosition();
  17508. h.setStyles({left: -1 * g.x + "px", top: -1 * g.y + "px"});
  17509. CKEDITOR.env.gecko && v(a)
  17510. } else if (this.state == CKEDITOR.TRISTATE_ON) {
  17511. c.removeListener("resize", e);
  17512. for (var d = [g, h], q = 0; q < d.length; q++) u(d[q], d[q].getCustomData("maximize_saved_styles")), d[q].removeCustomData("maximize_saved_styles");
  17513. for (d = a.container; d = d.getParent();) u(d, d.getCustomData("maximize_saved_styles")), d.removeCustomData("maximize_saved_styles");
  17514. CKEDITOR.env.ie ? setTimeout(function () {
  17515. c.$.scrollTo(p.x, p.y)
  17516. }, 0) : c.$.scrollTo(p.x,
  17517. p.y);
  17518. h.removeClass("cke_maximized");
  17519. CKEDITOR.env.webkit && (h.setStyle("display", "inline"), setTimeout(function () {
  17520. h.setStyle("display", "block")
  17521. }, 0));
  17522. a.fire("resize", {
  17523. outerHeight: a.container.$.offsetHeight,
  17524. contentsHeight: g.$.offsetHeight,
  17525. outerWidth: a.container.$.offsetWidth
  17526. })
  17527. }
  17528. this.toggleState();
  17529. if (d = this.uiItems[0]) g = this.state == CKEDITOR.TRISTATE_OFF ? f.maximize.maximize : f.maximize.minimize, d = CKEDITOR.document.getById(d._.id), d.getChild(1).setHtml(g), d.setAttribute("title", g), d.setAttribute("href", 'javascript:void("' +
  17530. g + '");');
  17531. "wysiwyg" == a.mode ? l ? (CKEDITOR.env.gecko && v(a), a.getSelection().selectRanges(l), (k = a.getSelection().getStartElement()) && k.scrollIntoView(!0)) : c.$.scrollTo(m.x, m.y) : (l && (k.selectionStart = l[0], k.selectionEnd = l[1]), k.scrollLeft = m[0], k.scrollTop = m[1]);
  17532. l = m = null;
  17533. n = this.state;
  17534. a.fire("maximize", this.state)
  17535. },
  17536. canUndo: !1
  17537. });
  17538. a.ui.addButton && a.ui.addButton("Maximize", {
  17539. label: f.maximize.maximize,
  17540. command: "maximize",
  17541. toolbar: "tools,10"
  17542. });
  17543. a.on("mode", function () {
  17544. var b = a.getCommand("maximize");
  17545. b.setState(b.state ==
  17546. CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : n)
  17547. }, null, null, 100)
  17548. }
  17549. }
  17550. })
  17551. })();
  17552. CKEDITOR.plugins.add("newpage", {
  17553. init: function (a) {
  17554. a.addCommand("newpage", {
  17555. modes: {wysiwyg: 1, source: 1}, exec: function (b) {
  17556. var a = this;
  17557. b.setData(b.config.newpage_html || "", function () {
  17558. b.focus();
  17559. setTimeout(function () {
  17560. b.fire("afterCommandExec", {name: "newpage", command: a});
  17561. b.selectionChange()
  17562. }, 200)
  17563. })
  17564. }, async: !0
  17565. });
  17566. a.ui.addButton && a.ui.addButton("NewPage", {
  17567. label: a.lang.newpage.toolbar,
  17568. command: "newpage",
  17569. toolbar: "document,20"
  17570. })
  17571. }
  17572. });
  17573. (function () {
  17574. function e(a) {
  17575. return {
  17576. "aria-label": a,
  17577. "class": "cke_pagebreak",
  17578. contenteditable: "false",
  17579. "data-cke-display-name": "pagebreak",
  17580. "data-cke-pagebreak": 1,
  17581. style: "page-break-after: always",
  17582. title: a
  17583. }
  17584. }
  17585. CKEDITOR.plugins.add("pagebreak", {
  17586. requires: "fakeobjects", onLoad: function () {
  17587. var a = ("background:url(" + CKEDITOR.getUrl(this.path + "images/pagebreak.gif") + ") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:7px;cursor:default;").replace(/;/g,
  17588. " !important;");
  17589. CKEDITOR.addCss("div.cke_pagebreak{" + a + "}")
  17590. }, init: function (a) {
  17591. a.blockless || (a.addCommand("pagebreak", CKEDITOR.plugins.pagebreakCmd), a.ui.addButton && a.ui.addButton("PageBreak", {
  17592. label: a.lang.pagebreak.toolbar,
  17593. command: "pagebreak",
  17594. toolbar: "insert,70"
  17595. }), CKEDITOR.env.webkit && a.on("contentDom", function () {
  17596. a.document.on("click", function (b) {
  17597. b = b.data.getTarget();
  17598. b.is("div") && b.hasClass("cke_pagebreak") && a.getSelection().selectElement(b)
  17599. })
  17600. }))
  17601. }, afterInit: function (a) {
  17602. function b(f) {
  17603. CKEDITOR.tools.extend(f.attributes,
  17604. e(a.lang.pagebreak.alt), !0);
  17605. f.children.length = 0
  17606. }
  17607. var c = a.dataProcessor, g = c && c.dataFilter, c = c && c.htmlFilter,
  17608. h = /page-break-after\s*:\s*always/i, k = /display\s*:\s*none/i;
  17609. c && c.addRules({
  17610. attributes: {
  17611. "class": function (a, b) {
  17612. var c = a.replace("cke_pagebreak", "");
  17613. if (c != a) {
  17614. var d = CKEDITOR.htmlParser.fragment.fromHtml('\x3cspan style\x3d"display: none;"\x3e\x26nbsp;\x3c/span\x3e').children[0];
  17615. b.children.length = 0;
  17616. b.add(d);
  17617. d = b.attributes;
  17618. delete d["aria-label"];
  17619. delete d.contenteditable;
  17620. delete d.title
  17621. }
  17622. return c
  17623. }
  17624. }
  17625. }, {
  17626. applyToAll: !0,
  17627. priority: 5
  17628. });
  17629. g && g.addRules({
  17630. elements: {
  17631. div: function (a) {
  17632. if (a.attributes["data-cke-pagebreak"]) b(a); else if (h.test(a.attributes.style)) {
  17633. var c = a.children[0];
  17634. c && "span" == c.name && k.test(c.attributes.style) && b(a)
  17635. }
  17636. }
  17637. }
  17638. })
  17639. }
  17640. });
  17641. CKEDITOR.plugins.pagebreakCmd = {
  17642. exec: function (a) {
  17643. var b = a.document.createElement("div", {attributes: e(a.lang.pagebreak.alt)});
  17644. a.insertElement(b)
  17645. }, context: "div", allowedContent: {
  17646. div: {styles: "!page-break-after"}, span: {
  17647. match: function (a) {
  17648. return (a = a.parent) && "div" == a.name && a.styles && a.styles["page-break-after"]
  17649. },
  17650. styles: "display"
  17651. }
  17652. }, requiredContent: "div{page-break-after}"
  17653. }
  17654. })();
  17655. (function () {
  17656. var f = {
  17657. canUndo: !1, async: !0, exec: function (a, b) {
  17658. var c = a.lang,
  17659. e = CKEDITOR.tools.keystrokeToString(c.common.keyboard, a.getCommandKeystroke(CKEDITOR.env.ie ? a.commands.paste : this)),
  17660. d = b && "undefined" !== typeof b.notification ? b.notification : !b || !b.from || "keystrokeHandler" === b.from && CKEDITOR.env.ie,
  17661. c = d && "string" === typeof d ? d : c.pastetext.pasteNotification.replace(/%1/, '\x3ckbd aria-label\x3d"' + e.aria + '"\x3e' + e.display + "\x3c/kbd\x3e");
  17662. a.execCommand("paste", {type: "text", notification: d ? c : !1})
  17663. }
  17664. };
  17665. CKEDITOR.plugins.add("pastetext",
  17666. {
  17667. requires: "clipboard", init: function (a) {
  17668. var b = CKEDITOR.env.safari ? CKEDITOR.CTRL + CKEDITOR.ALT + CKEDITOR.SHIFT + 86 : CKEDITOR.CTRL + CKEDITOR.SHIFT + 86;
  17669. a.addCommand("pastetext", f);
  17670. a.setKeystroke(b, "pastetext");
  17671. CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteText", {
  17672. label: a.lang.pastetext.button,
  17673. command: "pastetext",
  17674. toolbar: "clipboard,40"
  17675. });
  17676. if (a.config.forcePasteAsPlainText) a.on("beforePaste", function (a) {
  17677. "html" != a.data.type && (a.data.type = "text")
  17678. });
  17679. a.on("pasteState", function (b) {
  17680. a.getCommand("pastetext").setState(b.data)
  17681. })
  17682. }
  17683. })
  17684. })();
  17685. (function () {
  17686. function l(a, f, e) {
  17687. var h = CKEDITOR.cleanWord;
  17688. h ? e() : (a = CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile || f + "filter/default.js"), CKEDITOR.scriptLoader.load(a, e, null, !0));
  17689. return !h
  17690. }
  17691. CKEDITOR.plugins.add("pastefromword", {
  17692. requires: "clipboard", init: function (a) {
  17693. function f(a) {
  17694. var b = CKEDITOR.plugins.pastefromword && CKEDITOR.plugins.pastefromword.images, c, d = [];
  17695. if (b && a.editor.filter.check("img[src]") && (c = b.extractTagsFromHtml(a.data.dataValue), 0 !== c.length && (b = b.extractFromRtf(a.data.dataTransfer["text/rtf"]),
  17696. 0 !== b.length && (CKEDITOR.tools.array.forEach(b, function (a) {
  17697. d.push(a.type ? "data:" + a.type + ";base64," + CKEDITOR.tools.convertBytesToBase64(CKEDITOR.tools.convertHexStringToBytes(a.hex)) : null)
  17698. }, this), c.length === d.length)))) for (b = 0; b < c.length; b++) 0 === c[b].indexOf("file://") && d[b] && (a.data.dataValue = a.data.dataValue.replace(c[b], d[b]))
  17699. }
  17700. var e = 0, h = this.path,
  17701. m = void 0 === a.config.pasteFromWord_inlineImages ? !0 : a.config.pasteFromWord_inlineImages;
  17702. a.addCommand("pastefromword", {
  17703. canUndo: !1, async: !0, exec: function (a,
  17704. b) {
  17705. e = 1;
  17706. a.execCommand("paste", {
  17707. type: "html",
  17708. notification: b && "undefined" !== typeof b.notification ? b.notification : !0
  17709. })
  17710. }
  17711. });
  17712. CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteFromWord", {
  17713. label: a.lang.pastefromword.toolbar,
  17714. command: "pastefromword",
  17715. toolbar: "clipboard,50"
  17716. });
  17717. a.on("paste", function (f) {
  17718. var b = f.data,
  17719. c = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? b.dataTransfer.getData("text/html", !0) : null,
  17720. d = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? b.dataTransfer.getData("text/rtf") : null,
  17721. c = c ||
  17722. b.dataValue, g = {dataValue: c, dataTransfer: {"text/rtf": d}},
  17723. d = /(class=\"?Mso|style=(?:\"|\')[^\"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,
  17724. d = /<meta\s*name=(?:\"|\')?generator(?:\"|\')?\s*content=(?:\"|\')?microsoft/gi.test(c) || d.test(c);
  17725. if (c && (e || d) && (!1 !== a.fire("pasteFromWord", g) || e)) {
  17726. b.dontFilter = !0;
  17727. var k = l(a, h, function () {
  17728. if (k) a.fire("paste", b); else if (!a.config.pasteFromWordPromptCleanup || e || confirm(a.lang.pastefromword.confirmCleanup)) g.dataValue = CKEDITOR.cleanWord(g.dataValue, a), a.fire("afterPasteFromWord",
  17729. g), b.dataValue = g.dataValue, !0 === a.config.forcePasteAsPlainText ? b.type = "text" : CKEDITOR.plugins.clipboard.isCustomCopyCutSupported || "allow-word" !== a.config.forcePasteAsPlainText || (b.type = "html");
  17730. e = 0
  17731. });
  17732. k && f.cancel()
  17733. }
  17734. }, null, null, 3);
  17735. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported && m) a.on("afterPasteFromWord", f)
  17736. }
  17737. })
  17738. })();
  17739. (function () {
  17740. var h, k = {
  17741. modes: {wysiwyg: 1, source: 1}, canUndo: !1, readOnly: 1, exec: function (a) {
  17742. var g, b = a.config, f = b.baseHref ? '\x3cbase href\x3d"' + b.baseHref + '"/\x3e' : "";
  17743. if (b.fullPage) g = a.getData().replace(/<head>/, "$\x26" + f).replace(/[^>]*(?=<\/title>)/, "$\x26 \x26mdash; " + a.lang.preview.preview); else {
  17744. var b = "\x3cbody ", d = a.document && a.document.getBody();
  17745. d && (d.getAttribute("id") && (b += 'id\x3d"' + d.getAttribute("id") + '" '), d.getAttribute("class") && (b += 'class\x3d"' + d.getAttribute("class") + '" '));
  17746. b += "\x3e";
  17747. g = a.config.docType +
  17748. '\x3chtml dir\x3d"' + a.config.contentsLangDirection + '"\x3e\x3chead\x3e' + f + "\x3ctitle\x3e" + a.lang.preview.preview + "\x3c/title\x3e" + CKEDITOR.tools.buildStyleHtml(a.config.contentsCss) + "\x3c/head\x3e" + b + a.getData() + "\x3c/body\x3e\x3c/html\x3e"
  17749. }
  17750. f = 640;
  17751. b = 420;
  17752. d = 80;
  17753. try {
  17754. var c = window.screen, f = Math.round(.8 * c.width), b = Math.round(.7 * c.height),
  17755. d = Math.round(.1 * c.width)
  17756. } catch (k) {
  17757. }
  17758. if (!1 === a.fire("contentPreview", a = {dataValue: g})) return !1;
  17759. var c = "", e;
  17760. CKEDITOR.env.ie && (window._cke_htmlToLoad = a.dataValue, e = "javascript:void( (function(){document.open();" +
  17761. ("(" + CKEDITOR.tools.fixDomain + ")();").replace(/\/\/.*?\n/g, "").replace(/parent\./g, "window.opener.") + "document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad \x3d null;})() )", c = "");
  17762. CKEDITOR.env.gecko && (window._cke_htmlToLoad = a.dataValue, c = CKEDITOR.getUrl(h + "preview.html"));
  17763. c = window.open(c, null, "toolbar\x3dyes,location\x3dno,status\x3dyes,menubar\x3dyes,scrollbars\x3dyes,resizable\x3dyes,width\x3d" + f + ",height\x3d" + b + ",left\x3d" + d);
  17764. CKEDITOR.env.ie && c && (c.location =
  17765. e);
  17766. CKEDITOR.env.ie || CKEDITOR.env.gecko || (e = c.document, e.open(), e.write(a.dataValue), e.close());
  17767. return !0
  17768. }
  17769. };
  17770. CKEDITOR.plugins.add("preview", {
  17771. init: function (a) {
  17772. a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (h = this.path, a.addCommand("preview", k), a.ui.addButton && a.ui.addButton("Preview", {
  17773. label: a.lang.preview.preview,
  17774. command: "preview",
  17775. toolbar: "document,40"
  17776. }))
  17777. }
  17778. })
  17779. })();
  17780. CKEDITOR.plugins.add("print", {
  17781. init: function (a) {
  17782. a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (a.addCommand("print", CKEDITOR.plugins.print), a.ui.addButton && a.ui.addButton("Print", {
  17783. label: a.lang.print.toolbar,
  17784. command: "print",
  17785. toolbar: "document,50"
  17786. }))
  17787. }
  17788. });
  17789. CKEDITOR.plugins.print = {
  17790. exec: function (a) {
  17791. CKEDITOR.env.gecko ? a.window.$.print() : a.document.$.execCommand("Print")
  17792. }, canUndo: !1, readOnly: 1, modes: {wysiwyg: 1}
  17793. };
  17794. CKEDITOR.plugins.add("removeformat", {
  17795. init: function (a) {
  17796. a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
  17797. a.ui.addButton && a.ui.addButton("RemoveFormat", {
  17798. label: a.lang.removeformat.toolbar,
  17799. command: "removeFormat",
  17800. toolbar: "cleanup,10"
  17801. })
  17802. }
  17803. });
  17804. CKEDITOR.plugins.removeformat = {
  17805. commands: {
  17806. removeformat: {
  17807. exec: function (a) {
  17808. for (var h = a._.removeFormatRegex || (a._.removeFormatRegex = new RegExp("^(?:" + a.config.removeFormatTags.replace(/,/g, "|") + ")$", "i")), d = a._.removeAttributes || (a._.removeAttributes = a.config.removeFormatAttributes.split(",")), f = CKEDITOR.plugins.removeformat.filter, p = a.getSelection().getRanges().createIterator(), q = function (a) {
  17809. return a.type == CKEDITOR.NODE_ELEMENT
  17810. }, n = [], c; c = p.getNextRange();) {
  17811. var k = c.createBookmark();
  17812. c = a.createRange();
  17813. c.setStartBefore(k.startNode);
  17814. k.endNode && c.setEndAfter(k.endNode);
  17815. c.collapsed || c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  17816. var e = c.createBookmark(), b = e.startNode, l = e.endNode, m = function (b) {
  17817. for (var c = a.elementPath(b), e = c.elements, d = 1, g; (g = e[d]) && !g.equals(c.block) && !g.equals(c.blockLimit); d++) h.test(g.getName()) && f(a, g) && b.breakParent(g)
  17818. };
  17819. m(b);
  17820. if (l) for (m(l), b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); b && !b.equals(l);) if (b.isReadOnly()) {
  17821. if (b.getPosition(l) & CKEDITOR.POSITION_CONTAINS) break;
  17822. b = b.getNext(q)
  17823. } else m =
  17824. b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT), "img" == b.getName() && b.data("cke-realelement") || b.hasAttribute("data-cke-bookmark") || !f(a, b) || (h.test(b.getName()) ? b.remove(1) : (b.removeAttributes(d), a.fire("removeFormatCleanup", b))), b = m;
  17825. e.startNode.remove();
  17826. e.endNode && e.endNode.remove();
  17827. c.moveToBookmark(k);
  17828. n.push(c)
  17829. }
  17830. a.forceNextSelectionCheck();
  17831. a.getSelection().selectRanges(n)
  17832. }
  17833. }
  17834. }, filter: function (a, h) {
  17835. for (var d = a._.removeFormatFilters || [], f = 0; f < d.length; f++) if (!1 === d[f](h)) return !1;
  17836. return !0
  17837. }
  17838. };
  17839. CKEDITOR.editor.prototype.addRemoveFormatFilter = function (a) {
  17840. this._.removeFormatFilters || (this._.removeFormatFilters = []);
  17841. this._.removeFormatFilters.push(a)
  17842. };
  17843. CKEDITOR.config.removeFormatTags = "b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
  17844. CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign";
  17845. (function () {
  17846. var b = {
  17847. readOnly: 1, modes: {wysiwyg: 1, source: 1}, exec: function (a) {
  17848. if (a.fire("save") && (a = a.element.$.form)) try {
  17849. a.submit()
  17850. } catch (b) {
  17851. a.submit.click && a.submit.click()
  17852. }
  17853. }
  17854. };
  17855. CKEDITOR.plugins.add("save", {
  17856. init: function (a) {
  17857. a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a.addCommand("save", b).startDisabled = !a.element.$.form, a.ui.addButton && a.ui.addButton("Save", {
  17858. label: a.lang.save.toolbar,
  17859. command: "save",
  17860. toolbar: "document,10"
  17861. }))
  17862. }
  17863. })
  17864. })();
  17865. (function () {
  17866. CKEDITOR.plugins.add("selectall", {
  17867. init: function (b) {
  17868. b.addCommand("selectAll", {
  17869. modes: {wysiwyg: 1, source: 1}, exec: function (a) {
  17870. var b = a.editable();
  17871. if (b.is("textarea")) a = b.$, CKEDITOR.env.ie && a.createTextRange ? a.createTextRange().execCommand("SelectAll") : (a.selectionStart = 0, a.selectionEnd = a.value.length), a.focus(); else {
  17872. if (b.is("body")) a.document.$.execCommand("SelectAll", !1, null); else {
  17873. var c = a.createRange();
  17874. c.selectNodeContents(b);
  17875. c.select()
  17876. }
  17877. a.forceNextSelectionCheck();
  17878. a.selectionChange()
  17879. }
  17880. }, canUndo: !1
  17881. });
  17882. b.ui.addButton && b.ui.addButton("SelectAll", {
  17883. label: b.lang.selectall.toolbar,
  17884. command: "selectAll",
  17885. toolbar: "selection,10"
  17886. })
  17887. }
  17888. })
  17889. })();
  17890. (function () {
  17891. var k = {
  17892. readOnly: 1, preserveState: !0, editorFocus: !1, exec: function (a) {
  17893. this.toggleState();
  17894. this.refresh(a)
  17895. }, refresh: function (a) {
  17896. if (a.document) {
  17897. var c = this.state != CKEDITOR.TRISTATE_ON || a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && !a.focusManager.hasFocus ? "removeClass" : "attachClass";
  17898. a.editable()[c]("cke_show_blocks")
  17899. }
  17900. }
  17901. };
  17902. CKEDITOR.plugins.add("showblocks", {
  17903. onLoad: function () {
  17904. var a = "p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "), c, b, e, f,
  17905. k = CKEDITOR.getUrl(this.path), l = !(CKEDITOR.env.ie &&
  17906. 9 > CKEDITOR.env.version),
  17907. g = l ? ":not([contenteditable\x3dfalse]):not(.cke_show_blocks_off)" : "", d, h;
  17908. for (c = b = e = f = ""; d = a.pop();) h = a.length ? "," : "", c += ".cke_show_blocks " + d + g + h, e += ".cke_show_blocks.cke_contents_ltr " + d + g + h, f += ".cke_show_blocks.cke_contents_rtl " + d + g + h, b += ".cke_show_blocks " + d + g + "{background-image:url(" + CKEDITOR.getUrl(k + "images/block_" + d + ".png") + ")}";
  17909. CKEDITOR.addCss((c + "{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(b, e + "{background-position:top left;padding-left:8px}",
  17910. f + "{background-position:top right;padding-right:8px}"));
  17911. l || CKEDITOR.addCss(".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}")
  17912. }, init: function (a) {
  17913. function c() {
  17914. b.refresh(a)
  17915. }
  17916. if (!a.blockless) {
  17917. var b = a.addCommand("showblocks", k);
  17918. b.canUndo = !1;
  17919. a.config.startupOutlineBlocks && b.setState(CKEDITOR.TRISTATE_ON);
  17920. a.ui.addButton && a.ui.addButton("ShowBlocks", {
  17921. label: a.lang.showblocks.toolbar,
  17922. command: "showblocks",
  17923. toolbar: "tools,20"
  17924. });
  17925. a.on("mode", function () {
  17926. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  17927. });
  17928. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (a.on("focus", c), a.on("blur", c));
  17929. a.on("contentDom", function () {
  17930. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  17931. })
  17932. }
  17933. }
  17934. })
  17935. })();
  17936. (function () {
  17937. var f = {
  17938. preserveState: !0, editorFocus: !1, readOnly: 1, exec: function (a) {
  17939. this.toggleState();
  17940. this.refresh(a)
  17941. }, refresh: function (a) {
  17942. if (a.document) {
  17943. var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass";
  17944. a.editable()[b]("cke_show_borders")
  17945. }
  17946. }
  17947. };
  17948. CKEDITOR.plugins.add("showborders", {
  17949. modes: {wysiwyg: 1}, onLoad: function () {
  17950. var a;
  17951. a = (CKEDITOR.env.ie6Compat ? [".%1 table.%2,", ".%1 table.%2 td, .%1 table.%2 th", "{", "border : #d3d3d3 1px dotted", "}"] : ".%1 table.%2,;.%1 table.%2 \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;}".split(";")).join("").replace(/%2/g,
  17952. "cke_show_border").replace(/%1/g, "cke_show_borders ");
  17953. CKEDITOR.addCss(a)
  17954. }, init: function (a) {
  17955. var b = a.addCommand("showborders", f);
  17956. b.canUndo = !1;
  17957. !1 !== a.config.startupShowBorders && b.setState(CKEDITOR.TRISTATE_ON);
  17958. a.on("mode", function () {
  17959. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  17960. }, null, null, 100);
  17961. a.on("contentDom", function () {
  17962. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  17963. });
  17964. a.on("removeFormatCleanup", function (d) {
  17965. d = d.data;
  17966. a.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && d.is("table") && (!d.hasAttribute("border") ||
  17967. 0 >= parseInt(d.getAttribute("border"), 10)) && d.addClass("cke_show_border")
  17968. })
  17969. }, afterInit: function (a) {
  17970. var b = a.dataProcessor;
  17971. a = b && b.dataFilter;
  17972. b = b && b.htmlFilter;
  17973. a && a.addRules({
  17974. elements: {
  17975. table: function (a) {
  17976. a = a.attributes;
  17977. var b = a["class"], c = parseInt(a.border, 10);
  17978. c && !(0 >= c) || b && -1 != b.indexOf("cke_show_border") || (a["class"] = (b || "") + " cke_show_border")
  17979. }
  17980. }
  17981. });
  17982. b && b.addRules({
  17983. elements: {
  17984. table: function (a) {
  17985. a = a.attributes;
  17986. var b = a["class"];
  17987. b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(/^\s+|\s+$/,
  17988. ""))
  17989. }
  17990. }
  17991. })
  17992. }
  17993. });
  17994. CKEDITOR.on("dialogDefinition", function (a) {
  17995. var b = a.data.name;
  17996. if ("table" == b || "tableProperties" == b) if (a = a.data.definition, b = a.getContents("info").get("txtBorder"), b.commit = CKEDITOR.tools.override(b.commit, function (a) {
  17997. return function (b, c) {
  17998. a.apply(this, arguments);
  17999. var e = parseInt(this.getValue(), 10);
  18000. c[!e || 0 >= e ? "addClass" : "removeClass"]("cke_show_border")
  18001. }
  18002. }), a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) a.setup = CKEDITOR.tools.override(a.setup, function (a) {
  18003. return function () {
  18004. a.apply(this,
  18005. arguments);
  18006. this.setValue(this.getValue().replace(/cke_show_border/, ""))
  18007. }
  18008. }), a.commit = CKEDITOR.tools.override(a.commit, function (a) {
  18009. return function (b, c) {
  18010. a.apply(this, arguments);
  18011. parseInt(c.getAttribute("border"), 10) || c.addClass("cke_show_border")
  18012. }
  18013. })
  18014. })
  18015. })();
  18016. (function () {
  18017. CKEDITOR.plugins.add("sourcearea", {
  18018. init: function (a) {
  18019. function d() {
  18020. var a = e && this.equals(CKEDITOR.document.getActive());
  18021. this.hide();
  18022. this.setStyle("height", this.getParent().$.clientHeight + "px");
  18023. this.setStyle("width", this.getParent().$.clientWidth + "px");
  18024. this.show();
  18025. a && this.focus()
  18026. }
  18027. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  18028. var f = CKEDITOR.plugins.sourcearea;
  18029. a.addMode("source", function (e) {
  18030. var b = a.ui.space("contents").getDocument().createElement("textarea");
  18031. b.setStyles(CKEDITOR.tools.extend({
  18032. width: CKEDITOR.env.ie7Compat ?
  18033. "99%" : "100%", height: "100%", resize: "none", outline: "none", "text-align": "left"
  18034. }, CKEDITOR.tools.cssVendorPrefix("tab-size", a.config.sourceAreaTabSize || 4)));
  18035. b.setAttribute("dir", "ltr");
  18036. b.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");
  18037. a.ui.space("contents").append(b);
  18038. b = a.editable(new c(a, b));
  18039. b.setData(a.getData(1));
  18040. CKEDITOR.env.ie && (b.attachListener(a, "resize", d, b), b.attachListener(CKEDITOR.document.getWindow(), "resize", d, b), CKEDITOR.tools.setTimeout(d, 0, b));
  18041. a.fire("ariaWidget",
  18042. this);
  18043. e()
  18044. });
  18045. a.addCommand("source", f.commands.source);
  18046. a.ui.addButton && a.ui.addButton("Source", {
  18047. label: a.lang.sourcearea.toolbar,
  18048. command: "source",
  18049. toolbar: "mode,10"
  18050. });
  18051. a.on("mode", function () {
  18052. a.getCommand("source").setState("source" == a.mode ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
  18053. });
  18054. var e = CKEDITOR.env.ie && 9 == CKEDITOR.env.version
  18055. }
  18056. }
  18057. });
  18058. var c = CKEDITOR.tools.createClass({
  18059. base: CKEDITOR.editable, proto: {
  18060. setData: function (a) {
  18061. this.setValue(a);
  18062. this.status = "ready";
  18063. this.editor.fire("dataReady")
  18064. }, getData: function () {
  18065. return this.getValue()
  18066. },
  18067. insertHtml: function () {
  18068. }, insertElement: function () {
  18069. }, insertText: function () {
  18070. }, setReadOnly: function (a) {
  18071. this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly")
  18072. }, detach: function () {
  18073. c.baseProto.detach.call(this);
  18074. this.clearCustomData();
  18075. this.remove()
  18076. }
  18077. }
  18078. })
  18079. })();
  18080. CKEDITOR.plugins.sourcearea = {
  18081. commands: {
  18082. source: {
  18083. modes: {wysiwyg: 1, source: 1},
  18084. editorFocus: !1,
  18085. readOnly: 1,
  18086. exec: function (c) {
  18087. "wysiwyg" == c.mode && c.fire("saveSnapshot");
  18088. c.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
  18089. c.setMode("source" == c.mode ? "wysiwyg" : "source")
  18090. },
  18091. canUndo: !1
  18092. }
  18093. }
  18094. };
  18095. CKEDITOR.plugins.add("specialchar", {
  18096. availableLangs: {
  18097. af: 1,
  18098. ar: 1,
  18099. az: 1,
  18100. bg: 1,
  18101. ca: 1,
  18102. cs: 1,
  18103. cy: 1,
  18104. da: 1,
  18105. de: 1,
  18106. "de-ch": 1,
  18107. el: 1,
  18108. en: 1,
  18109. "en-au": 1,
  18110. "en-ca": 1,
  18111. "en-gb": 1,
  18112. eo: 1,
  18113. es: 1,
  18114. "es-mx": 1,
  18115. et: 1,
  18116. eu: 1,
  18117. fa: 1,
  18118. fi: 1,
  18119. fr: 1,
  18120. "fr-ca": 1,
  18121. gl: 1,
  18122. he: 1,
  18123. hr: 1,
  18124. hu: 1,
  18125. id: 1,
  18126. it: 1,
  18127. ja: 1,
  18128. km: 1,
  18129. ko: 1,
  18130. ku: 1,
  18131. lt: 1,
  18132. lv: 1,
  18133. nb: 1,
  18134. nl: 1,
  18135. no: 1,
  18136. oc: 1,
  18137. pl: 1,
  18138. pt: 1,
  18139. "pt-br": 1,
  18140. ro: 1,
  18141. ru: 1,
  18142. si: 1,
  18143. sk: 1,
  18144. sl: 1,
  18145. sq: 1,
  18146. sr: 1,
  18147. "sr-latn": 1,
  18148. sv: 1,
  18149. th: 1,
  18150. tr: 1,
  18151. tt: 1,
  18152. ug: 1,
  18153. uk: 1,
  18154. vi: 1,
  18155. zh: 1,
  18156. "zh-cn": 1
  18157. }, requires: "dialog", init: function (a) {
  18158. var c = this;
  18159. CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js");
  18160. a.addCommand("specialchar", {
  18161. exec: function () {
  18162. var b = a.langCode,
  18163. b = c.availableLangs[b] ? b : c.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  18164. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + b + ".js"), function () {
  18165. CKEDITOR.tools.extend(a.lang.specialchar, c.langEntries[b]);
  18166. a.openDialog("specialchar")
  18167. })
  18168. }, modes: {wysiwyg: 1}, canUndo: !1
  18169. });
  18170. a.ui.addButton && a.ui.addButton("SpecialChar", {
  18171. label: a.lang.specialchar.toolbar,
  18172. command: "specialchar",
  18173. toolbar: "insert,50"
  18174. })
  18175. }
  18176. });
  18177. CKEDITOR.config.specialChars = "! \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;".split(" ");
  18178. CKEDITOR.plugins.add("scayt", {
  18179. requires: "menubutton,dialog", tabToOpen: null, dialogName: "scaytDialog", onLoad: function (a) {
  18180. "moono-lisa" == (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path + "skins/" + CKEDITOR.skin.name + "/scayt.css"));
  18181. CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path + "dialogs/dialog.css"))
  18182. }, init: function (a) {
  18183. var c = this, d = CKEDITOR.plugins.scayt;
  18184. this.bindEvents(a);
  18185. this.parseConfig(a);
  18186. this.addRule(a);
  18187. CKEDITOR.dialog.add(this.dialogName,
  18188. CKEDITOR.getUrl(this.path + "dialogs/options.js"));
  18189. this.addMenuItems(a);
  18190. var b = a.lang.scayt, e = CKEDITOR.env;
  18191. a.ui.add("Scayt", CKEDITOR.UI_MENUBUTTON, {
  18192. label: b.text_title,
  18193. title: a.plugins.wsc ? a.lang.wsc.title : b.text_title,
  18194. modes: {wysiwyg: !(e.ie && (8 > e.version || e.quirks))},
  18195. toolbar: "spellchecker,20",
  18196. refresh: function () {
  18197. var b = a.ui.instances.Scayt.getState();
  18198. a.scayt && (b = d.state.scayt[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
  18199. a.fire("scaytButtonState", b)
  18200. },
  18201. onRender: function () {
  18202. var b = this;
  18203. a.on("scaytButtonState",
  18204. function (a) {
  18205. void 0 !== typeof a.data && b.setState(a.data)
  18206. })
  18207. },
  18208. onMenu: function () {
  18209. var b = a.scayt;
  18210. a.getMenuItem("scaytToggle").label = a.lang.scayt[b && d.state.scayt[a.name] ? "btn_disable" : "btn_enable"];
  18211. var c = {
  18212. scaytToggle: CKEDITOR.TRISTATE_OFF,
  18213. scaytOptions: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18214. scaytLangs: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18215. scaytDict: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18216. scaytAbout: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18217. WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF :
  18218. CKEDITOR.TRISTATE_DISABLED
  18219. };
  18220. a.config.scayt_uiTabs[0] || delete c.scaytOptions;
  18221. a.config.scayt_uiTabs[1] || delete c.scaytLangs;
  18222. a.config.scayt_uiTabs[2] || delete c.scaytDict;
  18223. b && !CKEDITOR.plugins.scayt.isNewUdSupported(b) && (delete c.scaytDict, a.config.scayt_uiTabs[2] = 0, CKEDITOR.plugins.scayt.alarmCompatibilityMessage());
  18224. return c
  18225. }
  18226. });
  18227. a.contextMenu && a.addMenuItems && (a.contextMenu.addListener(function (b, d) {
  18228. var e = a.scayt, l, m;
  18229. e && (m = e.getSelectionNode()) && (l = c.menuGenerator(a, m), e.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" .")));
  18230. return l
  18231. }), a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function (b) {
  18232. return function () {
  18233. var d = a.scayt;
  18234. d && d.hideBanner();
  18235. return b.apply(this)
  18236. }
  18237. }))
  18238. }, addMenuItems: function (a) {
  18239. var c = this, d = CKEDITOR.plugins.scayt;
  18240. a.addMenuGroup("scaytButton");
  18241. for (var b = a.config.scayt_contextMenuItemsOrder.split("|"), e = 0; e < b.length; e++) b[e] = "scayt_" + b[e];
  18242. if ((b = ["grayt_description", "grayt_suggest", "grayt_control"].concat(b)) && b.length) for (e = 0; e < b.length; e++) a.addMenuGroup(b[e], e - 10);
  18243. a.addCommand("scaytToggle",
  18244. {
  18245. exec: function (a) {
  18246. var b = a.scayt;
  18247. d.state.scayt[a.name] = !d.state.scayt[a.name];
  18248. !0 === d.state.scayt[a.name] ? b || d.createScayt(a) : b && d.destroy(a)
  18249. }
  18250. });
  18251. a.addCommand("scaytAbout", {
  18252. exec: function (a) {
  18253. a.scayt.tabToOpen = "about";
  18254. d.openDialog(c.dialogName, a)
  18255. }
  18256. });
  18257. a.addCommand("scaytOptions", {
  18258. exec: function (a) {
  18259. a.scayt.tabToOpen = "options";
  18260. d.openDialog(c.dialogName, a)
  18261. }
  18262. });
  18263. a.addCommand("scaytLangs", {
  18264. exec: function (a) {
  18265. a.scayt.tabToOpen = "langs";
  18266. d.openDialog(c.dialogName, a)
  18267. }
  18268. });
  18269. a.addCommand("scaytDict", {
  18270. exec: function (a) {
  18271. a.scayt.tabToOpen =
  18272. "dictionaries";
  18273. d.openDialog(c.dialogName, a)
  18274. }
  18275. });
  18276. b = {
  18277. scaytToggle: {label: a.lang.scayt.btn_enable, group: "scaytButton", command: "scaytToggle"},
  18278. scaytAbout: {label: a.lang.scayt.btn_about, group: "scaytButton", command: "scaytAbout"},
  18279. scaytOptions: {label: a.lang.scayt.btn_options, group: "scaytButton", command: "scaytOptions"},
  18280. scaytLangs: {label: a.lang.scayt.btn_langs, group: "scaytButton", command: "scaytLangs"},
  18281. scaytDict: {label: a.lang.scayt.btn_dictionaries, group: "scaytButton", command: "scaytDict"}
  18282. };
  18283. a.plugins.wsc && (b.WSC =
  18284. {
  18285. label: a.lang.wsc.toolbar, group: "scaytButton", onClick: function () {
  18286. var b = CKEDITOR.plugins.scayt, d = a.scayt,
  18287. c = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  18288. (c = c.replace(/\s/g, "")) ? (d && b.state.scayt[a.name] && d.setMarkupPaused && d.setMarkupPaused(!0), a.lockSelection(), a.execCommand("checkspell")) : alert("Nothing to check!")
  18289. }
  18290. });
  18291. a.addMenuItems(b)
  18292. }, bindEvents: function (a) {
  18293. var c = CKEDITOR.plugins.scayt, d = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE, b = function () {
  18294. c.destroy(a)
  18295. },
  18296. e = function () {
  18297. !c.state.scayt[a.name] || a.readOnly || a.scayt || c.createScayt(a)
  18298. }, f = function () {
  18299. var b = a.editable();
  18300. b.attachListener(b, "focus", function (b) {
  18301. CKEDITOR.plugins.scayt && !a.scayt && setTimeout(e, 0);
  18302. b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[a.name] && a.scayt;
  18303. var c, k;
  18304. if ((d || b) && a._.savedSelection) {
  18305. b = a._.savedSelection.getSelectedElement();
  18306. b = !b && a._.savedSelection.getRanges();
  18307. for (var h = 0; h < b.length; h++) k = b[h], "string" === typeof k.startContainer.$.nodeValue && (c = k.startContainer.getText().length,
  18308. (c < k.startOffset || c < k.endOffset) && a.unlockSelection(!1))
  18309. }
  18310. }, this, null, -10)
  18311. }, g = function () {
  18312. d ? a.config.scayt_inlineModeImmediateMarkup ? e() : (a.on("blur", function () {
  18313. setTimeout(b, 0)
  18314. }), a.on("focus", e), a.focusManager.hasFocus && e()) : e();
  18315. f();
  18316. var c = a.editable();
  18317. c.attachListener(c, "mousedown", function (b) {
  18318. b = b.data.getTarget();
  18319. var d = a.widgets && a.widgets.getByElement(b);
  18320. d && (d.wrapper = b.getAscendant(function (a) {
  18321. return a.hasAttribute("data-cke-widget-wrapper")
  18322. }, !0))
  18323. }, this, null, -10)
  18324. };
  18325. a.on("contentDom", g);
  18326. a.on("beforeCommandExec",
  18327. function (b) {
  18328. var d = a.scayt, e = !1, f = !1, h = !0;
  18329. b.data.name in c.options.disablingCommandExec && "wysiwyg" == a.mode ? d && (c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)) : "bold" !== b.data.name && "italic" !== b.data.name && "underline" !== b.data.name && "strike" !== b.data.name && "subscript" !== b.data.name && "superscript" !== b.data.name && "enter" !== b.data.name && "cut" !== b.data.name && "language" !== b.data.name || !d || ("cut" === b.data.name && (h = !1, f = !0), "language" === b.data.name && (f = e = !0), a.fire("reloadMarkupScayt",
  18330. {removeOptions: {removeInside: h, forceBookmark: f, language: e}, timeout: 0}))
  18331. });
  18332. a.on("beforeSetMode", function (b) {
  18333. if ("source" == b.data) {
  18334. if (b = a.scayt) c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED);
  18335. a.document && a.document.getBody().removeAttribute("_jquid")
  18336. }
  18337. });
  18338. a.on("afterCommandExec", function (b) {
  18339. "wysiwyg" != a.mode || "undo" != b.data.name && "redo" != b.data.name || setTimeout(function () {
  18340. c.reloadMarkup(a.scayt)
  18341. }, 250)
  18342. });
  18343. a.on("readOnly", function (b) {
  18344. var d;
  18345. b && (d = a.scayt, !0 === b.editor.readOnly ? d && d.fire("removeMarkupInDocument",
  18346. {}) : d ? c.reloadMarkup(d) : "wysiwyg" == b.editor.mode && !0 === c.state.scayt[b.editor.name] && (c.createScayt(a), b.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)))
  18347. });
  18348. a.on("beforeDestroy", b);
  18349. a.on("setData", function () {
  18350. b();
  18351. (a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || a.plugins.divarea) && g()
  18352. }, this, null, 50);
  18353. a.on("reloadMarkupScayt", function (b) {
  18354. var d = b.data && b.data.removeOptions, e = b.data && b.data.timeout, f = b.data && b.data.language,
  18355. h = a.scayt;
  18356. h && setTimeout(function () {
  18357. f && (d.selectionNode = a.plugins.language.getCurrentLangElement(a),
  18358. d.selectionNode = d.selectionNode && d.selectionNode.$ || null);
  18359. h.removeMarkupInSelectionNode(d);
  18360. c.reloadMarkup(h)
  18361. }, e || 0)
  18362. });
  18363. a.on("insertElement", function () {
  18364. a.fire("reloadMarkupScayt", {removeOptions: {forceBookmark: !0}})
  18365. }, this, null, 50);
  18366. a.on("insertHtml", function () {
  18367. a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);
  18368. a.fire("reloadMarkupScayt")
  18369. }, this, null, 50);
  18370. a.on("insertText", function () {
  18371. a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);
  18372. a.fire("reloadMarkupScayt")
  18373. }, this, null, 50);
  18374. a.on("scaytDialogShown", function (b) {
  18375. b.data.selectPage(a.scayt.tabToOpen)
  18376. })
  18377. },
  18378. parseConfig: function (a) {
  18379. var c = CKEDITOR.plugins.scayt;
  18380. c.replaceOldOptionsNames(a.config);
  18381. "boolean" !== typeof a.config.scayt_autoStartup && (a.config.scayt_autoStartup = !1);
  18382. c.state.scayt[a.name] = a.config.scayt_autoStartup;
  18383. "boolean" !== typeof a.config.grayt_autoStartup && (a.config.grayt_autoStartup = !1);
  18384. "boolean" !== typeof a.config.scayt_inlineModeImmediateMarkup && (a.config.scayt_inlineModeImmediateMarkup = !1);
  18385. c.state.grayt[a.name] = a.config.grayt_autoStartup;
  18386. a.config.scayt_contextCommands || (a.config.scayt_contextCommands =
  18387. "ignoreall|add");
  18388. a.config.scayt_contextMenuItemsOrder || (a.config.scayt_contextMenuItemsOrder = "suggest|moresuggest|control");
  18389. a.config.scayt_sLang || (a.config.scayt_sLang = "en_US");
  18390. if (void 0 === a.config.scayt_maxSuggestions || "number" != typeof a.config.scayt_maxSuggestions || 0 > a.config.scayt_maxSuggestions) a.config.scayt_maxSuggestions = 3;
  18391. if (void 0 === a.config.scayt_minWordLength || "number" != typeof a.config.scayt_minWordLength || 1 > a.config.scayt_minWordLength) a.config.scayt_minWordLength = 3;
  18392. if (void 0 === a.config.scayt_customDictionaryIds ||
  18393. "string" !== typeof a.config.scayt_customDictionaryIds) a.config.scayt_customDictionaryIds = "";
  18394. if (void 0 === a.config.scayt_userDictionaryName || "string" !== typeof a.config.scayt_userDictionaryName) a.config.scayt_userDictionaryName = null;
  18395. if ("string" === typeof a.config.scayt_uiTabs && 3 === a.config.scayt_uiTabs.split(",").length) {
  18396. var d = [], b = [];
  18397. a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");
  18398. CKEDITOR.tools.search(a.config.scayt_uiTabs, function (a) {
  18399. 1 === Number(a) || 0 === Number(a) ? (b.push(!0), d.push(Number(a))) :
  18400. b.push(!1)
  18401. });
  18402. null === CKEDITOR.tools.search(b, !1) ? a.config.scayt_uiTabs = d : a.config.scayt_uiTabs = [1, 1, 1]
  18403. } else a.config.scayt_uiTabs = [1, 1, 1];
  18404. "string" != typeof a.config.scayt_serviceProtocol && (a.config.scayt_serviceProtocol = null);
  18405. "string" != typeof a.config.scayt_serviceHost && (a.config.scayt_serviceHost = null);
  18406. "string" != typeof a.config.scayt_servicePort && (a.config.scayt_servicePort = null);
  18407. "string" != typeof a.config.scayt_servicePath && (a.config.scayt_servicePath = null);
  18408. a.config.scayt_moreSuggestions || (a.config.scayt_moreSuggestions =
  18409. "on");
  18410. "string" !== typeof a.config.scayt_customerId && (a.config.scayt_customerId = "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");
  18411. "string" !== typeof a.config.scayt_customPunctuation && (a.config.scayt_customPunctuation = "-");
  18412. "string" !== typeof a.config.scayt_srcUrl && (c = document.location.protocol, c = -1 != c.search(/https?:/) ? c : "http:", a.config.scayt_srcUrl = c + "//svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js");
  18413. "boolean" !== typeof CKEDITOR.config.scayt_handleCheckDirty && (CKEDITOR.config.scayt_handleCheckDirty =
  18414. !0);
  18415. "boolean" !== typeof CKEDITOR.config.scayt_handleUndoRedo && (CKEDITOR.config.scayt_handleUndoRedo = !0);
  18416. CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : !1;
  18417. "boolean" !== typeof a.config.scayt_multiLanguageMode && (a.config.scayt_multiLanguageMode = !1);
  18418. "object" !== typeof a.config.scayt_multiLanguageStyles && (a.config.scayt_multiLanguageStyles = {});
  18419. a.config.scayt_ignoreAllCapsWords && "boolean" !== typeof a.config.scayt_ignoreAllCapsWords && (a.config.scayt_ignoreAllCapsWords =
  18420. !1);
  18421. a.config.scayt_ignoreDomainNames && "boolean" !== typeof a.config.scayt_ignoreDomainNames && (a.config.scayt_ignoreDomainNames = !1);
  18422. a.config.scayt_ignoreWordsWithMixedCases && "boolean" !== typeof a.config.scayt_ignoreWordsWithMixedCases && (a.config.scayt_ignoreWordsWithMixedCases = !1);
  18423. a.config.scayt_ignoreWordsWithNumbers && "boolean" !== typeof a.config.scayt_ignoreWordsWithNumbers && (a.config.scayt_ignoreWordsWithNumbers = !1);
  18424. if (a.config.scayt_disableOptionsStorage) {
  18425. var c = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ?
  18426. a.config.scayt_disableOptionsStorage : "string" === typeof a.config.scayt_disableOptionsStorage ? [a.config.scayt_disableOptionsStorage] : void 0,
  18427. e = "all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),
  18428. f = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
  18429. g = CKEDITOR.tools.search, k = CKEDITOR.tools.indexOf;
  18430. a.config.scayt_disableOptionsStorage = function (a) {
  18431. for (var b = [], d = 0; d <
  18432. a.length; d++) {
  18433. var c = a[d], p = !!g(a, "options");
  18434. if (!g(e, c) || p && g(f, function (a) {
  18435. if ("lang" === a) return !1
  18436. })) return;
  18437. g(f, c) && f.splice(k(f, c), 1);
  18438. if ("all" === c || p && g(a, "lang")) return [];
  18439. "options" === c && (f = ["lang"])
  18440. }
  18441. return b = b.concat(f)
  18442. }(c)
  18443. }
  18444. a.config.scayt_disableCache && "boolean" !== typeof a.config.scayt_disableCache && (a.config.scayt_disableCache = !1);
  18445. if (void 0 === a.config.scayt_cacheSize || "number" != typeof a.config.scayt_cacheSize || 1 > a.config.scayt_cacheSize) a.config.scayt_cacheSize = 4E3
  18446. }, addRule: function (a) {
  18447. var c = CKEDITOR.plugins.scayt,
  18448. d = a.dataProcessor, b = d && d.htmlFilter, e = a._.elementsPath && a._.elementsPath.filters,
  18449. d = d && d.dataFilter, f = a.addRemoveFormatFilter, g = function (b) {
  18450. if (a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute))) return !1
  18451. }, k = function (b) {
  18452. var d = !0;
  18453. a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute)) && (d = !1);
  18454. return d
  18455. };
  18456. e && e.push(g);
  18457. d && d.addRules({
  18458. elements: {
  18459. span: function (a) {
  18460. var b = a.hasClass(c.options.misspelled_word_class) &&
  18461. a.attributes[c.options.data_attribute_name],
  18462. d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];
  18463. c && (b || d) && delete a.name;
  18464. return a
  18465. }
  18466. }
  18467. });
  18468. b && b.addRules({
  18469. elements: {
  18470. span: function (a) {
  18471. var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options.data_attribute_name],
  18472. d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];
  18473. c && (b || d) && delete a.name;
  18474. return a
  18475. }
  18476. }
  18477. });
  18478. f && f.call(a, k)
  18479. }, scaytMenuDefinition: function (a) {
  18480. var c =
  18481. this, d = CKEDITOR.plugins.scayt;
  18482. a = a.scayt;
  18483. return {
  18484. scayt: {
  18485. scayt_ignore: {
  18486. label: a.getLocal("btn_ignore"),
  18487. group: "scayt_control",
  18488. order: 1,
  18489. exec: function (a) {
  18490. a.scayt.ignoreWord()
  18491. }
  18492. },
  18493. scayt_ignoreall: {
  18494. label: a.getLocal("btn_ignoreAll"),
  18495. group: "scayt_control",
  18496. order: 2,
  18497. exec: function (a) {
  18498. a.scayt.ignoreAllWords()
  18499. }
  18500. },
  18501. scayt_add: {
  18502. label: a.getLocal("btn_addWord"), group: "scayt_control", order: 3, exec: function (a) {
  18503. var d = a.scayt;
  18504. setTimeout(function () {
  18505. d.addWordToUserDictionary()
  18506. }, 10)
  18507. }
  18508. },
  18509. scayt_option: {
  18510. label: a.getLocal("btn_options"),
  18511. group: "scayt_control", order: 4, exec: function (a) {
  18512. a.scayt.tabToOpen = "options";
  18513. d.openDialog(c.dialogName, a)
  18514. }, verification: function (a) {
  18515. return 1 == a.config.scayt_uiTabs[0] ? !0 : !1
  18516. }
  18517. },
  18518. scayt_language: {
  18519. label: a.getLocal("btn_langs"),
  18520. group: "scayt_control",
  18521. order: 5,
  18522. exec: function (a) {
  18523. a.scayt.tabToOpen = "langs";
  18524. d.openDialog(c.dialogName, a)
  18525. },
  18526. verification: function (a) {
  18527. return 1 == a.config.scayt_uiTabs[1] ? !0 : !1
  18528. }
  18529. },
  18530. scayt_dictionary: {
  18531. label: a.getLocal("btn_dictionaries"), group: "scayt_control", order: 6, exec: function (a) {
  18532. a.scayt.tabToOpen =
  18533. "dictionaries";
  18534. d.openDialog(c.dialogName, a)
  18535. }, verification: function (a) {
  18536. return 1 == a.config.scayt_uiTabs[2] ? !0 : !1
  18537. }
  18538. },
  18539. scayt_about: {
  18540. label: a.getLocal("btn_about"), group: "scayt_control", order: 7, exec: function (a) {
  18541. a.scayt.tabToOpen = "about";
  18542. d.openDialog(c.dialogName, a)
  18543. }
  18544. }
  18545. }, grayt: {
  18546. grayt_problemdescription: {
  18547. label: "Grammar problem description",
  18548. group: "grayt_description",
  18549. order: 1,
  18550. state: CKEDITOR.TRISTATE_DISABLED,
  18551. exec: function (a) {
  18552. }
  18553. },
  18554. grayt_ignore: {
  18555. label: a.getLocal("btn_ignore"),
  18556. group: "grayt_control",
  18557. order: 2,
  18558. exec: function (a) {
  18559. a.scayt.ignorePhrase()
  18560. }
  18561. },
  18562. grayt_ignoreall: {
  18563. label: a.getLocal("btn_ignoreAll"),
  18564. group: "grayt_control",
  18565. order: 3,
  18566. exec: function (a) {
  18567. a.scayt.ignoreAllPhrases()
  18568. }
  18569. }
  18570. }
  18571. }
  18572. }, buildSuggestionMenuItems: function (a, c, d) {
  18573. var b = {}, e = {}, f = d ? "word" : "phrase", g = d ? "startGrammarCheck" : "startSpellCheck", k = a.scayt;
  18574. if (0 < c.length && "no_any_suggestions" !== c[0]) if (d) for (d = 0; d < c.length; d++) {
  18575. var l = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_");
  18576. a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g));
  18577. d < a.config.scayt_maxSuggestions ?
  18578. (a.addMenuItem(l, {
  18579. label: c[d],
  18580. command: l,
  18581. group: "scayt_suggest",
  18582. order: d + 1
  18583. }), b[l] = CKEDITOR.TRISTATE_OFF) : (a.addMenuItem(l, {
  18584. label: c[d],
  18585. command: l,
  18586. group: "scayt_moresuggest",
  18587. order: d + 1
  18588. }), e[l] = CKEDITOR.TRISTATE_OFF, "on" === a.config.scayt_moreSuggestions && (a.addMenuItem("scayt_moresuggest", {
  18589. label: k.getLocal("btn_moreSuggestions"),
  18590. group: "scayt_moresuggest",
  18591. order: 10,
  18592. getItems: function () {
  18593. return e
  18594. }
  18595. }), b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF))
  18596. } else for (d = 0; d < c.length; d++) l = "grayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ",
  18597. "_"), a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g)), a.addMenuItem(l, {
  18598. label: c[d],
  18599. command: l,
  18600. group: "grayt_suggest",
  18601. order: d + 1
  18602. }), b[l] = CKEDITOR.TRISTATE_OFF; else b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED, a.addCommand("no_scayt_suggest", {
  18603. exec: function () {
  18604. }
  18605. }), a.addMenuItem("no_scayt_suggest", {
  18606. label: k.getLocal("btn_noSuggestions") || "no_scayt_suggest",
  18607. command: "no_scayt_suggest",
  18608. group: "scayt_suggest",
  18609. order: 0
  18610. });
  18611. return b
  18612. }, menuGenerator: function (a, c) {
  18613. var d = a.scayt, b = this.scaytMenuDefinition(a),
  18614. e = {}, f = a.config.scayt_contextCommands.split("|"),
  18615. g = c.getAttribute(d.getLangAttribute()) || d.getLang(), k, l, m, n;
  18616. l = d.isScaytNode(c);
  18617. m = d.isGraytNode(c);
  18618. l ? (b = b.scayt, k = c.getAttribute(d.getScaytNodeAttributeName()), d.fire("getSuggestionsList", {
  18619. lang: g,
  18620. word: k
  18621. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, l)) : m && (b = b.grayt, e = c.getAttribute(d.getGraytNodeAttributeName()), d.getGraytNodeRuleAttributeName ? (k = c.getAttribute(d.getGraytNodeRuleAttributeName()), d.getProblemDescriptionText(e,
  18622. k, g)) : d.getProblemDescriptionText(e, g), n = d.getProblemDescriptionText(e, k, g), b.grayt_problemdescription && n && (n = n.replace(/([.!?])\s/g, "$1\x3cbr\x3e"), b.grayt_problemdescription.label = n), d.fire("getGrammarSuggestionsList", {
  18623. lang: g,
  18624. phrase: e,
  18625. rule: k
  18626. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, l));
  18627. if (l && "off" == a.config.scayt_contextCommands) return e;
  18628. for (var h in b) l && -1 == CKEDITOR.tools.indexOf(f, h.replace("scayt_", "")) && "all" != a.config.scayt_contextCommands || m && "grayt_problemdescription" !==
  18629. h && -1 == CKEDITOR.tools.indexOf(f, h.replace("grayt_", "")) && "all" != a.config.scayt_contextCommands || (e[h] = "undefined" != typeof b[h].state ? b[h].state : CKEDITOR.TRISTATE_OFF, "function" !== typeof b[h].verification || b[h].verification(a) || delete e[h], a.addCommand(h, {exec: b[h].exec}), a.addMenuItem(h, {
  18630. label: a.lang.scayt[b[h].label] || b[h].label,
  18631. command: h,
  18632. group: b[h].group,
  18633. order: b[h].order
  18634. }));
  18635. return e
  18636. }, createCommand: function (a, c, d) {
  18637. return {
  18638. exec: function (b) {
  18639. b = b.scayt;
  18640. var e = {};
  18641. e[c] = a;
  18642. b.replaceSelectionNode(e);
  18643. "startGrammarCheck" ===
  18644. d && b.removeMarkupInSelectionNode({grammarOnly: !0});
  18645. b.fire(d)
  18646. }
  18647. }
  18648. }
  18649. });
  18650. CKEDITOR.plugins.scayt = {
  18651. charsToObserve: [{
  18652. charName: "cke-fillingChar", charCode: function () {
  18653. var a = CKEDITOR.version.match(/^\d(\.\d*)*/), a = a && a[0], c;
  18654. if (a) {
  18655. c = "4.5.7";
  18656. var d, a = a.replace(/\./g, "");
  18657. c = c.replace(/\./g, "");
  18658. d = a.length - c.length;
  18659. d = 0 <= d ? d : 0;
  18660. c = parseInt(a) >= parseInt(c) * Math.pow(10, d)
  18661. }
  18662. return c ? Array(7).join(String.fromCharCode(8203)) : String.fromCharCode(8203)
  18663. }()
  18664. }],
  18665. state: {scayt: {}, grayt: {}},
  18666. warningCounter: 0,
  18667. suggestions: [],
  18668. options: {
  18669. disablingCommandExec: {source: !0, newpage: !0, templates: !0},
  18670. data_attribute_name: "data-scayt-word",
  18671. misspelled_word_class: "scayt-misspell-word",
  18672. problem_grammar_data_attribute: "data-grayt-phrase",
  18673. problem_grammar_class: "gramm-problem"
  18674. },
  18675. backCompatibilityMap: {
  18676. scayt_service_protocol: "scayt_serviceProtocol",
  18677. scayt_service_host: "scayt_serviceHost",
  18678. scayt_service_port: "scayt_servicePort",
  18679. scayt_service_path: "scayt_servicePath",
  18680. scayt_customerid: "scayt_customerId"
  18681. },
  18682. openDialog: function (a, c) {
  18683. var d = c.scayt;
  18684. d.isAllModulesReady && !1 === d.isAllModulesReady() || (c.lockSelection(), c.openDialog(a))
  18685. },
  18686. alarmCompatibilityMessage: function () {
  18687. 5 >
  18688. this.warningCounter && (console.warn("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."), this.warningCounter += 1)
  18689. },
  18690. isNewUdSupported: function (a) {
  18691. return a.getUserDictionary ? !0 : !1
  18692. },
  18693. reloadMarkup: function (a) {
  18694. var c;
  18695. a && (c = a.getScaytLangList(), a.reloadMarkup ? a.reloadMarkup() : (this.alarmCompatibilityMessage(),
  18696. c && c.ltr && c.rtl && a.fire("startSpellCheck, startGrammarCheck")))
  18697. },
  18698. replaceOldOptionsNames: function (a) {
  18699. for (var c in a) c in this.backCompatibilityMap && (a[this.backCompatibilityMap[c]] = a[c], delete a[c])
  18700. },
  18701. createScayt: function (a) {
  18702. var c = this, d = CKEDITOR.plugins.scayt;
  18703. this.loadScaytLibrary(a, function (a) {
  18704. function e(a) {
  18705. return new SCAYT.CKSCAYT(a, function () {
  18706. }, function () {
  18707. })
  18708. }
  18709. var f;
  18710. a.window && (f = "BODY" == a.editable().$.nodeName ? a.window.getFrame() : a.editable());
  18711. if (f) {
  18712. f = {
  18713. lang: a.config.scayt_sLang,
  18714. container: f.$,
  18715. customDictionary: a.config.scayt_customDictionaryIds,
  18716. userDictionaryName: a.config.scayt_userDictionaryName,
  18717. localization: a.langCode,
  18718. customer_id: a.config.scayt_customerId,
  18719. customPunctuation: a.config.scayt_customPunctuation,
  18720. debug: a.config.scayt_debug,
  18721. data_attribute_name: c.options.data_attribute_name,
  18722. misspelled_word_class: c.options.misspelled_word_class,
  18723. problem_grammar_data_attribute: c.options.problem_grammar_data_attribute,
  18724. problem_grammar_class: c.options.problem_grammar_class,
  18725. "options-to-restore": a.config.scayt_disableOptionsStorage,
  18726. focused: a.editable().hasFocus,
  18727. ignoreElementsRegex: a.config.scayt_elementsToIgnore,
  18728. ignoreGraytElementsRegex: a.config.grayt_elementsToIgnore,
  18729. minWordLength: a.config.scayt_minWordLength,
  18730. multiLanguageMode: a.config.scayt_multiLanguageMode,
  18731. multiLanguageStyles: a.config.scayt_multiLanguageStyles,
  18732. graytAutoStartup: a.config.grayt_autoStartup,
  18733. disableCache: a.config.scayt_disableCache,
  18734. cacheSize: a.config.scayt_cacheSize,
  18735. charsToObserve: d.charsToObserve
  18736. };
  18737. a.config.scayt_serviceProtocol && (f.service_protocol = a.config.scayt_serviceProtocol);
  18738. a.config.scayt_serviceHost &&
  18739. (f.service_host = a.config.scayt_serviceHost);
  18740. a.config.scayt_servicePort && (f.service_port = a.config.scayt_servicePort);
  18741. a.config.scayt_servicePath && (f.service_path = a.config.scayt_servicePath);
  18742. "boolean" === typeof a.config.scayt_ignoreAllCapsWords && (f["ignore-all-caps-words"] = a.config.scayt_ignoreAllCapsWords);
  18743. "boolean" === typeof a.config.scayt_ignoreDomainNames && (f["ignore-domain-names"] = a.config.scayt_ignoreDomainNames);
  18744. "boolean" === typeof a.config.scayt_ignoreWordsWithMixedCases && (f["ignore-words-with-mixed-cases"] =
  18745. a.config.scayt_ignoreWordsWithMixedCases);
  18746. "boolean" === typeof a.config.scayt_ignoreWordsWithNumbers && (f["ignore-words-with-numbers"] = a.config.scayt_ignoreWordsWithNumbers);
  18747. var g;
  18748. try {
  18749. g = e(f)
  18750. } catch (k) {
  18751. c.alarmCompatibilityMessage(), delete f.charsToObserve, g = e(f)
  18752. }
  18753. g.subscribe("suggestionListSend", function (a) {
  18754. for (var b = {}, d = [], c = 0; c < a.suggestionList.length; c++) b["word_" + a.suggestionList[c]] || (b["word_" + a.suggestionList[c]] = a.suggestionList[c], d.push(a.suggestionList[c]));
  18755. CKEDITOR.plugins.scayt.suggestions =
  18756. d
  18757. });
  18758. g.subscribe("selectionIsChanged", function (d) {
  18759. a.getSelection().isLocked && "restoreSelection" !== d.action && a.lockSelection();
  18760. "restoreSelection" === d.action && a.selectionChange(!0)
  18761. });
  18762. g.subscribe("graytStateChanged", function (c) {
  18763. d.state.grayt[a.name] = c.state
  18764. });
  18765. g.addMarkupHandler && g.addMarkupHandler(function (d) {
  18766. var c = a.editable(), e = c.getCustomData(d.charName);
  18767. e && (e.$ = d.node, c.setCustomData(d.charName, e))
  18768. });
  18769. a.scayt = g;
  18770. a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON)
  18771. } else d.state.scayt[a.name] =
  18772. !1
  18773. })
  18774. },
  18775. destroy: function (a) {
  18776. a.scayt && a.scayt.destroy();
  18777. delete a.scayt;
  18778. a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF)
  18779. },
  18780. loadScaytLibrary: function (a, c) {
  18781. var d, b = function () {
  18782. CKEDITOR.fireOnce("scaytReady");
  18783. a.scayt || "function" === typeof c && c(a)
  18784. };
  18785. "undefined" === typeof window.SCAYT || "function" !== typeof window.SCAYT.CKSCAYT ? (d = a.config.scayt_srcUrl, CKEDITOR.scriptLoader.load(d, function (a) {
  18786. a && b()
  18787. })) : window.SCAYT && "function" === typeof window.SCAYT.CKSCAYT && b()
  18788. }
  18789. };
  18790. CKEDITOR.on("dialogDefinition", function (a) {
  18791. var c = a.data.name;
  18792. a = a.data.definition.dialog;
  18793. "scaytDialog" !== c && "checkspell" !== c && (a.on("show", function (a) {
  18794. a = a.sender && a.sender.getParentEditor();
  18795. var b = CKEDITOR.plugins.scayt, c = a.scayt;
  18796. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!0)
  18797. }), a.on("hide", function (a) {
  18798. a = a.sender && a.sender.getParentEditor();
  18799. var b = CKEDITOR.plugins.scayt, c = a.scayt;
  18800. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1)
  18801. }));
  18802. if ("scaytDialog" === c) a.on("cancel",
  18803. function (a) {
  18804. return !1
  18805. }, this, null, -1);
  18806. if ("checkspell" === c) a.on("cancel", function (a) {
  18807. a = a.sender && a.sender.getParentEditor();
  18808. var b = CKEDITOR.plugins.scayt, c = a.scayt;
  18809. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1);
  18810. a.unlockSelection()
  18811. }, this, null, -2);
  18812. if ("link" === c) a.on("ok", function (a) {
  18813. var b = a.sender && a.sender.getParentEditor();
  18814. b && setTimeout(function () {
  18815. b.fire("reloadMarkupScayt", {removeOptions: {removeInside: !0, forceBookmark: !0}, timeout: 0})
  18816. }, 0)
  18817. });
  18818. if ("replace" === c) a.on("hide", function (a) {
  18819. a =
  18820. a.sender && a.sender.getParentEditor();
  18821. var b = CKEDITOR.plugins.scayt, c = a.scayt;
  18822. a && setTimeout(function () {
  18823. c && (c.fire("removeMarkupInDocument", {}), b.reloadMarkup(c))
  18824. }, 0)
  18825. })
  18826. });
  18827. CKEDITOR.on("scaytReady", function () {
  18828. if (!0 === CKEDITOR.config.scayt_handleCheckDirty) {
  18829. var a = CKEDITOR.editor.prototype;
  18830. a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function (a) {
  18831. return function () {
  18832. var b = null, c = this.scayt;
  18833. if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt) {
  18834. if (b = "ready" == this.status) var f = c.removeMarkupFromString(this.getSnapshot()),
  18835. c = c.removeMarkupFromString(this._.previousValue), b = b && c !== f
  18836. } else b = a.call(this);
  18837. return b
  18838. }
  18839. });
  18840. a.resetDirty = CKEDITOR.tools.override(a.resetDirty,
  18841. function (a) {
  18842. return function () {
  18843. var b = this.scayt;
  18844. CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt ? this._.previousValue = b.removeMarkupFromString(this.getSnapshot()) : a.call(this)
  18845. }
  18846. })
  18847. }
  18848. if (!0 === CKEDITOR.config.scayt_handleUndoRedo) {
  18849. var a = CKEDITOR.plugins.undo.Image.prototype,
  18850. c = "function" == typeof a.equalsContent ? "equalsContent" : "equals";
  18851. a[c] = CKEDITOR.tools.override(a[c], function (a) {
  18852. return function (b) {
  18853. var c = b.editor.scayt, f = this.contents, g = b.contents, k = null;
  18854. CKEDITOR.plugins.scayt &&
  18855. CKEDITOR.plugins.scayt.state.scayt[b.editor.name] && b.editor.scayt && (this.contents = c.removeMarkupFromString(f) || "", b.contents = c.removeMarkupFromString(g) || "");
  18856. k = a.apply(this, arguments);
  18857. this.contents = f;
  18858. b.contents = g;
  18859. return k
  18860. }
  18861. })
  18862. }
  18863. });
  18864. (function () {
  18865. CKEDITOR.plugins.add("stylescombo", {
  18866. requires: "richcombo", init: function (c) {
  18867. var l = c.config, g = c.lang.stylescombo, f = {}, k = [], m = [];
  18868. c.on("stylesSet", function (a) {
  18869. if (a = a.data.styles) {
  18870. for (var b, h, d, e = 0, n = a.length; e < n; e++) (b = a[e], c.blockless && b.element in CKEDITOR.dtd.$block || "string" == typeof b.type && !CKEDITOR.style.customHandlers[b.type] || (h = b.name, b = new CKEDITOR.style(b), c.filter.customConfig && !c.filter.check(b))) || (b._name = h, b._.enterMode = l.enterMode, b._.type = d = b.assignedTo || b.type, b._.weight =
  18871. e + 1E3 * (d == CKEDITOR.STYLE_OBJECT ? 1 : d == CKEDITOR.STYLE_BLOCK ? 2 : 3), f[h] = b, k.push(b), m.push(b));
  18872. k.sort(function (a, b) {
  18873. return a._.weight - b._.weight
  18874. })
  18875. }
  18876. });
  18877. c.ui.addRichCombo("Styles", {
  18878. label: g.label,
  18879. title: g.panelTitle,
  18880. toolbar: "styles,10",
  18881. allowedContent: m,
  18882. panel: {
  18883. css: [CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),
  18884. multiSelect: !0,
  18885. attributes: {"aria-label": g.panelTitle}
  18886. },
  18887. init: function () {
  18888. var a, b, c, d, e, f;
  18889. e = 0;
  18890. for (f = k.length; e < f; e++) a = k[e], b = a._name, d = a._.type, d != c && (this.startGroup(g["panelTitle" + String(d)]),
  18891. c = d), this.add(b, a.type == CKEDITOR.STYLE_OBJECT ? b : a.buildPreview(), b);
  18892. this.commit()
  18893. },
  18894. onClick: function (a) {
  18895. c.focus();
  18896. c.fire("saveSnapshot");
  18897. a = f[a];
  18898. var b = c.elementPath();
  18899. if (a.group && a.removeStylesFromSameGroup(c)) c.applyStyle(a); else c[a.checkActive(b, c) ? "removeStyle" : "applyStyle"](a);
  18900. c.fire("saveSnapshot")
  18901. },
  18902. onRender: function () {
  18903. c.on("selectionChange", function (a) {
  18904. var b = this.getValue();
  18905. a = a.data.path.elements;
  18906. for (var h = 0, d = a.length, e; h < d; h++) {
  18907. e = a[h];
  18908. for (var g in f) if (f[g].checkElementRemovable(e, !0, c)) {
  18909. g !=
  18910. b && this.setValue(g);
  18911. return
  18912. }
  18913. }
  18914. this.setValue("")
  18915. }, this)
  18916. },
  18917. onOpen: function () {
  18918. var a = c.getSelection(), a = a.getSelectedElement() || a.getStartElement() || c.editable(),
  18919. a = c.elementPath(a), b = [0, 0, 0, 0];
  18920. this.showAll();
  18921. this.unmarkAll();
  18922. for (var h in f) {
  18923. var d = f[h], e = d._.type;
  18924. d.checkApplicable(a, c, c.activeFilter) ? b[e]++ : this.hideItem(h);
  18925. d.checkActive(a, c) && this.mark(h)
  18926. }
  18927. b[CKEDITOR.STYLE_BLOCK] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_BLOCK)]);
  18928. b[CKEDITOR.STYLE_INLINE] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_INLINE)]);
  18929. b[CKEDITOR.STYLE_OBJECT] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_OBJECT)])
  18930. },
  18931. refresh: function () {
  18932. var a = c.elementPath();
  18933. if (a) {
  18934. for (var b in f) if (f[b].checkApplicable(a, c, c.activeFilter)) return;
  18935. this.setState(CKEDITOR.TRISTATE_DISABLED)
  18936. }
  18937. },
  18938. reset: function () {
  18939. f = {};
  18940. k = []
  18941. }
  18942. })
  18943. }
  18944. })
  18945. })();
  18946. (function () {
  18947. function k(c) {
  18948. return {
  18949. editorFocus: !1, canUndo: !1, modes: {wysiwyg: 1}, exec: function (d) {
  18950. if (d.editable().hasFocus) {
  18951. var e = d.getSelection(), b;
  18952. if (b = (new CKEDITOR.dom.elementPath(e.getCommonAncestor(), e.root)).contains({
  18953. td: 1,
  18954. th: 1
  18955. }, 1)) {
  18956. var e = d.createRange(), a = CKEDITOR.tools.tryThese(function () {
  18957. var a = b.getParent().$.cells[b.$.cellIndex + (c ? -1 : 1)];
  18958. a.parentNode.parentNode;
  18959. return a
  18960. }, function () {
  18961. var a = b.getParent(), a = a.getAscendant("table").$.rows[a.$.rowIndex + (c ? -1 : 1)];
  18962. return a.cells[c ? a.cells.length - 1 :
  18963. 0]
  18964. });
  18965. if (a || c) if (a) a = new CKEDITOR.dom.element(a), e.moveToElementEditStart(a), e.checkStartOfBlock() && e.checkEndOfBlock() || e.selectNodeContents(a); else return !0; else {
  18966. for (var f = b.getAscendant("table").$, a = b.getParent().$.cells, f = new CKEDITOR.dom.element(f.insertRow(-1), d.document), g = 0, h = a.length; g < h; g++) f.append((new CKEDITOR.dom.element(a[g], d.document)).clone(!1, !1)).appendBogus();
  18967. e.moveToElementEditStart(f)
  18968. }
  18969. e.select(!0);
  18970. return !0
  18971. }
  18972. }
  18973. return !1
  18974. }
  18975. }
  18976. }
  18977. var h = {editorFocus: !1, modes: {wysiwyg: 1, source: 1}}, g = {
  18978. exec: function (c) {
  18979. c.container.focusNext(!0,
  18980. c.tabIndex)
  18981. }
  18982. }, f = {
  18983. exec: function (c) {
  18984. c.container.focusPrevious(!0, c.tabIndex)
  18985. }
  18986. };
  18987. CKEDITOR.plugins.add("tab", {
  18988. init: function (c) {
  18989. for (var d = !1 !== c.config.enableTabKeyTools, e = c.config.tabSpaces || 0, b = ""; e--;) b += " ";
  18990. if (b) c.on("key", function (a) {
  18991. 9 == a.data.keyCode && (c.insertText(b), a.cancel())
  18992. });
  18993. if (d) c.on("key", function (a) {
  18994. (9 == a.data.keyCode && c.execCommand("selectNextCell") || a.data.keyCode == CKEDITOR.SHIFT + 9 && c.execCommand("selectPreviousCell")) && a.cancel()
  18995. });
  18996. c.addCommand("blur", CKEDITOR.tools.extend(g, h));
  18997. c.addCommand("blurBack",
  18998. CKEDITOR.tools.extend(f, h));
  18999. c.addCommand("selectNextCell", k());
  19000. c.addCommand("selectPreviousCell", k(!0))
  19001. }
  19002. })
  19003. })();
  19004. CKEDITOR.dom.element.prototype.focusNext = function (k, h) {
  19005. var g = void 0 === h ? this.getTabIndex() : h, f, c, d, e, b, a;
  19006. if (0 >= g) for (b = this.getNextSourceNode(k, CKEDITOR.NODE_ELEMENT); b;) {
  19007. if (b.isVisible() && 0 === b.getTabIndex()) {
  19008. d = b;
  19009. break
  19010. }
  19011. b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT)
  19012. } else for (b = this.getDocument().getBody().getFirst(); b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  19013. if (!f) if (!c && b.equals(this)) {
  19014. if (c = !0, k) {
  19015. if (!(b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  19016. f = 1
  19017. }
  19018. } else c && !this.contains(b) &&
  19019. (f = 1);
  19020. if (b.isVisible() && !(0 > (a = b.getTabIndex()))) {
  19021. if (f && a == g) {
  19022. d = b;
  19023. break
  19024. }
  19025. a > g && (!d || !e || a < e) ? (d = b, e = a) : d || 0 !== a || (d = b, e = a)
  19026. }
  19027. }
  19028. d && d.focus()
  19029. };
  19030. CKEDITOR.dom.element.prototype.focusPrevious = function (k, h) {
  19031. for (var g = void 0 === h ? this.getTabIndex() : h, f, c, d, e = 0, b, a = this.getDocument().getBody().getLast(); a = a.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  19032. if (!f) if (!c && a.equals(this)) {
  19033. if (c = !0, k) {
  19034. if (!(a = a.getPreviousSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  19035. f = 1
  19036. }
  19037. } else c && !this.contains(a) && (f = 1);
  19038. if (a.isVisible() && !(0 > (b = a.getTabIndex()))) if (0 >= g) {
  19039. if (f && 0 === b) {
  19040. d = a;
  19041. break
  19042. }
  19043. b > e && (d = a, e = b)
  19044. } else {
  19045. if (f && b == g) {
  19046. d = a;
  19047. break
  19048. }
  19049. b < g && (!d || b > e) && (d = a, e = b)
  19050. }
  19051. }
  19052. d && d.focus()
  19053. };
  19054. CKEDITOR.plugins.add("table", {
  19055. requires: "dialog", init: function (a) {
  19056. function f(c) {
  19057. return CKEDITOR.tools.extend(c || {}, {
  19058. contextSensitive: 1, refresh: function (c, b) {
  19059. this.setState(b.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  19060. }
  19061. })
  19062. }
  19063. if (!a.blockless) {
  19064. var e = a.lang.table;
  19065. a.addCommand("table", new CKEDITOR.dialogCommand("table", {
  19066. context: "table",
  19067. allowedContent: "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];" + (a.plugins.dialogadvtab ?
  19068. "table" + a.plugins.dialogadvtab.allowedContent() : ""),
  19069. requiredContent: "table",
  19070. contentTransformations: [["table{width}: sizeToStyle", "table[width]: sizeToAttribute"], ["td: splitBorderShorthand"], [{
  19071. element: "table", right: function (c) {
  19072. if (c.styles) {
  19073. var a;
  19074. if (c.styles.border) a = CKEDITOR.tools.style.parse.border(c.styles.border); else if (CKEDITOR.env.ie && 8 === CKEDITOR.env.version) {
  19075. var b = c.styles;
  19076. b["border-left"] && b["border-left"] === b["border-right"] && b["border-right"] === b["border-top"] && b["border-top"] === b["border-bottom"] &&
  19077. (a = CKEDITOR.tools.style.parse.border(b["border-top"]))
  19078. }
  19079. a && a.style && "solid" === a.style && a.width && 0 !== parseFloat(a.width) && (c.attributes.border = 1);
  19080. "collapse" == c.styles["border-collapse"] && (c.attributes.cellspacing = 0)
  19081. }
  19082. }
  19083. }]]
  19084. }));
  19085. a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", f()));
  19086. a.addCommand("tableDelete", f({
  19087. exec: function (a) {
  19088. var d = a.elementPath().contains("table", 1);
  19089. if (d) {
  19090. var b = d.getParent(), e = a.editable();
  19091. 1 != b.getChildCount() || b.is("td", "th") || b.equals(e) || (d = b);
  19092. a = a.createRange();
  19093. a.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START);
  19094. d.remove();
  19095. a.select()
  19096. }
  19097. }
  19098. }));
  19099. a.ui.addButton && a.ui.addButton("Table", {label: e.toolbar, command: "table", toolbar: "insert,30"});
  19100. CKEDITOR.dialog.add("table", this.path + "dialogs/table.js");
  19101. CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js");
  19102. a.addMenuItems && a.addMenuItems({
  19103. table: {
  19104. label: e.menu,
  19105. command: "tableProperties",
  19106. group: "table",
  19107. order: 5
  19108. }, tabledelete: {label: e.deleteTable, command: "tableDelete", group: "table", order: 1}
  19109. });
  19110. a.on("doubleclick", function (a) {
  19111. a.data.element.is("table") &&
  19112. (a.data.dialog = "tableProperties")
  19113. });
  19114. a.contextMenu && a.contextMenu.addListener(function () {
  19115. return {tabledelete: CKEDITOR.TRISTATE_OFF, table: CKEDITOR.TRISTATE_OFF}
  19116. })
  19117. }
  19118. }
  19119. });
  19120. (function () {
  19121. function q(d, f) {
  19122. function b(a) {
  19123. return f ? f.contains(a) && a.getAscendant("table", !0).equals(f) : !0
  19124. }
  19125. function c(a) {
  19126. 0 < e.length || a.type != CKEDITOR.NODE_ELEMENT || !F.test(a.getName()) || a.getCustomData("selected_cell") || (CKEDITOR.dom.element.setMarker(g, a, "selected_cell", !0), e.push(a))
  19127. }
  19128. var e = [], g = {};
  19129. if (!d) return e;
  19130. for (var a = d.getRanges(), k = 0; k < a.length; k++) {
  19131. var h = a[k];
  19132. if (h.collapsed) (h = h.getCommonAncestor().getAscendant({
  19133. td: 1,
  19134. th: 1
  19135. }, !0)) && b(h) && e.push(h); else {
  19136. var h = new CKEDITOR.dom.walker(h), l;
  19137. for (h.guard =
  19138. c; l = h.next();) l.type == CKEDITOR.NODE_ELEMENT && l.is(CKEDITOR.dtd.table) || (l = l.getAscendant({
  19139. td: 1,
  19140. th: 1
  19141. }, !0)) && !l.getCustomData("selected_cell") && b(l) && (CKEDITOR.dom.element.setMarker(g, l, "selected_cell", !0), e.push(l))
  19142. }
  19143. }
  19144. CKEDITOR.dom.element.clearAllMarkers(g);
  19145. return e
  19146. }
  19147. function r(d, f) {
  19148. for (var b = D(d) ? d : q(d), c = b[0], e = c.getAscendant("table"), c = c.getDocument(), g = b[0].getParent(), a = g.$.rowIndex, b = b[b.length - 1], k = b.getParent().$.rowIndex + b.$.rowSpan - 1, b = new CKEDITOR.dom.element(e.$.rows[k]), a = f ? a : k, g = f ? g : b,
  19149. b = CKEDITOR.tools.buildTableMap(e), e = b[a], a = f ? b[a - 1] : b[a + 1], b = b[0].length, c = c.createElement("tr"), k = 0; e[k] && k < b; k++) {
  19150. var h;
  19151. 1 < e[k].rowSpan && a && e[k] == a[k] ? (h = e[k], h.rowSpan += 1) : (h = (new CKEDITOR.dom.element(e[k])).clone(), h.removeAttribute("rowSpan"), h.appendBogus(), c.append(h), h = h.$);
  19152. k += h.colSpan - 1
  19153. }
  19154. f ? c.insertBefore(g) : c.insertAfter(g);
  19155. return c
  19156. }
  19157. function B(d) {
  19158. if (d instanceof CKEDITOR.dom.selection) {
  19159. var f = d.getRanges(), b = q(d), c = b[0].getAscendant("table"), e = CKEDITOR.tools.buildTableMap(c),
  19160. g = b[0].getParent().$.rowIndex,
  19161. b = b[b.length - 1], a = b.getParent().$.rowIndex + b.$.rowSpan - 1, b = [];
  19162. d.reset();
  19163. for (d = g; d <= a; d++) {
  19164. for (var k = e[d], h = new CKEDITOR.dom.element(c.$.rows[d]), l = 0; l < k.length; l++) {
  19165. var m = new CKEDITOR.dom.element(k[l]), n = m.getParent().$.rowIndex;
  19166. 1 == m.$.rowSpan ? m.remove() : (--m.$.rowSpan, n == d && (n = e[d + 1], n[l - 1] ? m.insertAfter(new CKEDITOR.dom.element(n[l - 1])) : (new CKEDITOR.dom.element(c.$.rows[d + 1])).append(m, 1)));
  19167. l += m.$.colSpan - 1
  19168. }
  19169. b.push(h)
  19170. }
  19171. e = c.$.rows;
  19172. f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START);
  19173. g = new CKEDITOR.dom.element(e[a +
  19174. 1] || (0 < g ? e[g - 1] : null) || c.$.parentNode);
  19175. for (d = b.length; 0 <= d; d--) B(b[d]);
  19176. return c.$.parentNode ? g : (f[0].select(), null)
  19177. }
  19178. d instanceof CKEDITOR.dom.element && (c = d.getAscendant("table"), 1 == c.$.rows.length ? c.remove() : d.remove());
  19179. return null
  19180. }
  19181. function v(d) {
  19182. for (var f = d.getParent().$.cells, b = 0, c = 0; c < f.length; c++) {
  19183. var e = f[c], b = b + e.colSpan;
  19184. if (e == d.$) break
  19185. }
  19186. return b - 1
  19187. }
  19188. function w(d, f) {
  19189. for (var b = f ? Infinity : 0, c = 0; c < d.length; c++) {
  19190. var e = v(d[c]);
  19191. if (f ? e < b : e > b) b = e
  19192. }
  19193. return b
  19194. }
  19195. function u(d, f) {
  19196. for (var b = D(d) ? d : q(d), c = b[0].getAscendant("table"),
  19197. e = w(b, 1), b = w(b), g = f ? e : b, a = CKEDITOR.tools.buildTableMap(c), c = [], e = [], b = [], k = a.length, h = 0; h < k; h++) c.push(a[h][g]), e.push(f ? a[h][g - 1] : a[h][g + 1]);
  19198. for (h = 0; h < k; h++) c[h] && (1 < c[h].colSpan && e[h] == c[h] ? (a = c[h], a.colSpan += 1) : (g = new CKEDITOR.dom.element(c[h]), a = g.clone(), a.removeAttribute("colSpan"), a.appendBogus(), a[f ? "insertBefore" : "insertAfter"].call(a, g), b.push(a), a = a.$), h += a.rowSpan - 1);
  19199. return b
  19200. }
  19201. function y(d) {
  19202. function f(a) {
  19203. var b, c, d;
  19204. b = a.getRanges();
  19205. if (1 !== b.length) return a;
  19206. b = b[0];
  19207. if (b.collapsed || 0 !== b.endOffset) return a;
  19208. c = b.endContainer;
  19209. d = c.getName().toLowerCase();
  19210. if ("td" !== d && "th" !== d) return a;
  19211. for ((d = c.getPrevious()) || (d = c.getParent().getPrevious().getLast()); d.type !== CKEDITOR.NODE_TEXT && "br" !== d.getName().toLowerCase();) if (d = d.getLast(), !d) return a;
  19212. b.setEndAt(d, CKEDITOR.POSITION_BEFORE_END);
  19213. return b.select()
  19214. }
  19215. CKEDITOR.env.webkit && !d.isFake && (d = f(d));
  19216. var b = d.getRanges(), c = q(d), e = c[0], g = c[c.length - 1], c = e.getAscendant("table"),
  19217. a = CKEDITOR.tools.buildTableMap(c), k, h, l = [];
  19218. d.reset();
  19219. var m = 0;
  19220. for (d = a.length; m < d; m++) for (var n =
  19221. 0, p = a[m].length; n < p; n++) void 0 === k && a[m][n] == e.$ && (k = n), a[m][n] == g.$ && (h = n);
  19222. for (m = k; m <= h; m++) for (n = 0; n < a.length; n++) g = a[n], e = new CKEDITOR.dom.element(c.$.rows[n]), g = new CKEDITOR.dom.element(g[m]), g.$ && (1 == g.$.colSpan ? g.remove() : --g.$.colSpan, n += g.$.rowSpan - 1, e.$.cells.length || l.push(e));
  19223. k = a[0].length - 1 > h ? new CKEDITOR.dom.element(a[0][h + 1]) : k && -1 !== a[0][k - 1].cellIndex ? new CKEDITOR.dom.element(a[0][k - 1]) : new CKEDITOR.dom.element(c.$.parentNode);
  19224. l.length == d && (b[0].moveToPosition(c, CKEDITOR.POSITION_AFTER_END),
  19225. b[0].select(), c.remove());
  19226. return k
  19227. }
  19228. function t(d, f) {
  19229. var b = d.getStartElement().getAscendant({td: 1, th: 1}, !0);
  19230. if (b) {
  19231. var c = b.clone();
  19232. c.appendBogus();
  19233. f ? c.insertBefore(b) : c.insertAfter(b)
  19234. }
  19235. }
  19236. function z(d) {
  19237. if (d instanceof CKEDITOR.dom.selection) {
  19238. var f = d.getRanges(), b = q(d), c = b[0] && b[0].getAscendant("table"), e;
  19239. a:{
  19240. var g = 0;
  19241. e = b.length - 1;
  19242. for (var a = {}, k, h; k = b[g++];) CKEDITOR.dom.element.setMarker(a, k, "delete_cell", !0);
  19243. for (g = 0; k = b[g++];) if ((h = k.getPrevious()) && !h.getCustomData("delete_cell") || (h = k.getNext()) && !h.getCustomData("delete_cell")) {
  19244. CKEDITOR.dom.element.clearAllMarkers(a);
  19245. e = h;
  19246. break a
  19247. }
  19248. CKEDITOR.dom.element.clearAllMarkers(a);
  19249. g = b[0].getParent();
  19250. (g = g.getPrevious()) ? e = g.getLast() : (g = b[e].getParent(), e = (g = g.getNext()) ? g.getChild(0) : null)
  19251. }
  19252. d.reset();
  19253. for (d = b.length - 1; 0 <= d; d--) z(b[d]);
  19254. e ? p(e, !0) : c && (f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START), f[0].select(), c.remove())
  19255. } else d instanceof CKEDITOR.dom.element && (f = d.getParent(), 1 == f.getChildCount() ? f.remove() : d.remove())
  19256. }
  19257. function p(d, f) {
  19258. var b = d.getDocument(), c = CKEDITOR.document;
  19259. CKEDITOR.env.ie && 10 == CKEDITOR.env.version &&
  19260. (c.focus(), b.focus());
  19261. b = new CKEDITOR.dom.range(b);
  19262. b["moveToElementEdit" + (f ? "End" : "Start")](d) || (b.selectNodeContents(d), b.collapse(f ? !1 : !0));
  19263. b.select(!0)
  19264. }
  19265. function A(d, f, b) {
  19266. d = d[f];
  19267. if ("undefined" == typeof b) return d;
  19268. for (f = 0; d && f < d.length; f++) {
  19269. if (b.is && d[f] == b.$) return f;
  19270. if (f == b) return new CKEDITOR.dom.element(d[f])
  19271. }
  19272. return b.is ? -1 : null
  19273. }
  19274. function x(d, f, b) {
  19275. var c = q(d), e;
  19276. if ((f ? 1 != c.length : 2 > c.length) || (e = d.getCommonAncestor()) && e.type == CKEDITOR.NODE_ELEMENT && e.is("table")) return !1;
  19277. var g;
  19278. d = c[0];
  19279. e = d.getAscendant("table");
  19280. var a = CKEDITOR.tools.buildTableMap(e), k = a.length, h = a[0].length, l = d.getParent().$.rowIndex,
  19281. m = A(a, l, d);
  19282. if (f) {
  19283. var n;
  19284. try {
  19285. var p = parseInt(d.getAttribute("rowspan"), 10) || 1;
  19286. g = parseInt(d.getAttribute("colspan"), 10) || 1;
  19287. n = a["up" == f ? l - p : "down" == f ? l + p : l]["left" == f ? m - g : "right" == f ? m + g : m]
  19288. } catch (x) {
  19289. return !1
  19290. }
  19291. if (!n || d.$ == n) return !1;
  19292. c["up" == f || "left" == f ? "unshift" : "push"](new CKEDITOR.dom.element(n))
  19293. }
  19294. f = d.getDocument();
  19295. var r = l, p = n = 0, u = !b && new CKEDITOR.dom.documentFragment(f), w = 0;
  19296. for (f = 0; f < c.length; f++) {
  19297. g = c[f];
  19298. var t = g.getParent(),
  19299. y = g.getFirst(), v = g.$.colSpan, z = g.$.rowSpan, t = t.$.rowIndex, B = A(a, t, g), w = w + v * z,
  19300. p = Math.max(p, B - m + v);
  19301. n = Math.max(n, t - l + z);
  19302. b || (v = g, (z = v.getBogus()) && z.remove(), v.trim(), g.getChildren().count() && (t == r || !y || y.isBlockBoundary && y.isBlockBoundary({br: 1}) || (r = u.getLast(CKEDITOR.dom.walker.whitespaces(!0)), !r || r.is && r.is("br") || u.append("br")), g.moveChildren(u)), f ? g.remove() : g.setHtml(""));
  19303. r = t
  19304. }
  19305. if (b) return n * p == w;
  19306. u.moveChildren(d);
  19307. d.appendBogus();
  19308. p >= h ? d.removeAttribute("rowSpan") : d.$.rowSpan = n;
  19309. n >= k ? d.removeAttribute("colSpan") :
  19310. d.$.colSpan = p;
  19311. b = new CKEDITOR.dom.nodeList(e.$.rows);
  19312. c = b.count();
  19313. for (f = c - 1; 0 <= f; f--) e = b.getItem(f), e.$.cells.length || (e.remove(), c++);
  19314. return d
  19315. }
  19316. function C(d, f) {
  19317. var b = q(d);
  19318. if (1 < b.length) return !1;
  19319. if (f) return !0;
  19320. var b = b[0], c = b.getParent(), e = c.getAscendant("table"), g = CKEDITOR.tools.buildTableMap(e),
  19321. a = c.$.rowIndex, k = A(g, a, b), h = b.$.rowSpan, l;
  19322. if (1 < h) {
  19323. l = Math.ceil(h / 2);
  19324. for (var h = Math.floor(h / 2), c = a + l, e = new CKEDITOR.dom.element(e.$.rows[c]), g = A(g, c), m, c = b.clone(), a = 0; a < g.length; a++) if (m = g[a], m.parentNode == e.$ &&
  19325. a > k) {
  19326. c.insertBefore(new CKEDITOR.dom.element(m));
  19327. break
  19328. } else m = null;
  19329. m || e.append(c)
  19330. } else for (h = l = 1, e = c.clone(), e.insertAfter(c), e.append(c = b.clone()), m = A(g, a), k = 0; k < m.length; k++) m[k].rowSpan++;
  19331. c.appendBogus();
  19332. b.$.rowSpan = l;
  19333. c.$.rowSpan = h;
  19334. 1 == l && b.removeAttribute("rowSpan");
  19335. 1 == h && c.removeAttribute("rowSpan");
  19336. return c
  19337. }
  19338. function E(d, f) {
  19339. var b = q(d);
  19340. if (1 < b.length) return !1;
  19341. if (f) return !0;
  19342. var b = b[0], c = b.getParent(), e = c.getAscendant("table"), e = CKEDITOR.tools.buildTableMap(e),
  19343. g = A(e, c.$.rowIndex, b), a = b.$.colSpan;
  19344. if (1 < a) c = Math.ceil(a / 2), a = Math.floor(a / 2); else {
  19345. for (var a = c = 1, k = [], h = 0; h < e.length; h++) {
  19346. var l = e[h];
  19347. k.push(l[g]);
  19348. 1 < l[g].rowSpan && (h += l[g].rowSpan - 1)
  19349. }
  19350. for (e = 0; e < k.length; e++) k[e].colSpan++
  19351. }
  19352. e = b.clone();
  19353. e.insertAfter(b);
  19354. e.appendBogus();
  19355. b.$.colSpan = c;
  19356. e.$.colSpan = a;
  19357. 1 == c && b.removeAttribute("colSpan");
  19358. 1 == a && e.removeAttribute("colSpan");
  19359. return e
  19360. }
  19361. var F = /^(?:td|th)$/, D = CKEDITOR.tools.isArray;
  19362. CKEDITOR.plugins.tabletools = {
  19363. requires: "table,dialog,contextmenu", init: function (d) {
  19364. function f(a) {
  19365. return CKEDITOR.tools.extend(a ||
  19366. {}, {
  19367. contextSensitive: 1, refresh: function (a, b) {
  19368. this.setState(b.contains({
  19369. td: 1,
  19370. th: 1
  19371. }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  19372. }
  19373. })
  19374. }
  19375. function b(a, b) {
  19376. var c = d.addCommand(a, b);
  19377. d.addFeature(c)
  19378. }
  19379. var c = d.lang.table, e = CKEDITOR.tools.style.parse,
  19380. g = "td{width} td{height} td{border-color} td{background-color} td{white-space} td{vertical-align} td{text-align} td[colspan] td[rowspan] th".split(" ");
  19381. b("cellProperties", new CKEDITOR.dialogCommand("cellProperties", f({
  19382. allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",
  19383. requiredContent: g, contentTransformations: [[{
  19384. element: "td", left: function (a) {
  19385. return a.styles.background && e.background(a.styles.background).color
  19386. }, right: function (a) {
  19387. a.styles["background-color"] = e.background(a.styles.background).color
  19388. }
  19389. }, {
  19390. element: "td", check: "td{vertical-align}", left: function (a) {
  19391. return a.attributes && a.attributes.valign
  19392. }, right: function (a) {
  19393. a.styles["vertical-align"] = a.attributes.valign;
  19394. delete a.attributes.valign
  19395. }
  19396. }], [{
  19397. element: "tr", check: "td{height}", left: function (a) {
  19398. return a.styles && a.styles.height
  19399. },
  19400. right: function (a) {
  19401. CKEDITOR.tools.array.forEach(a.children, function (b) {
  19402. b.name in {td: 1, th: 1} && (b.attributes["cke-row-height"] = a.styles.height)
  19403. });
  19404. delete a.styles.height
  19405. }
  19406. }], [{
  19407. element: "td", check: "td{height}", left: function (a) {
  19408. return (a = a.attributes) && a["cke-row-height"]
  19409. }, right: function (a) {
  19410. a.styles.height = a.attributes["cke-row-height"];
  19411. delete a.attributes["cke-row-height"]
  19412. }
  19413. }]]
  19414. })));
  19415. CKEDITOR.dialog.add("cellProperties", this.path + "dialogs/tableCell.js");
  19416. b("rowDelete", f({
  19417. requiredContent: "table", exec: function (a) {
  19418. a =
  19419. a.getSelection();
  19420. (a = B(a)) && p(a)
  19421. }
  19422. }));
  19423. b("rowInsertBefore", f({
  19424. requiredContent: "table", exec: function (a) {
  19425. a = a.getSelection();
  19426. a = q(a);
  19427. r(a, !0)
  19428. }
  19429. }));
  19430. b("rowInsertAfter", f({
  19431. requiredContent: "table", exec: function (a) {
  19432. a = a.getSelection();
  19433. a = q(a);
  19434. r(a)
  19435. }
  19436. }));
  19437. b("columnDelete", f({
  19438. requiredContent: "table", exec: function (a) {
  19439. a = a.getSelection();
  19440. (a = y(a)) && p(a, !0)
  19441. }
  19442. }));
  19443. b("columnInsertBefore", f({
  19444. requiredContent: "table", exec: function (a) {
  19445. a = a.getSelection();
  19446. a = q(a);
  19447. u(a, !0)
  19448. }
  19449. }));
  19450. b("columnInsertAfter", f({
  19451. requiredContent: "table", exec: function (a) {
  19452. a =
  19453. a.getSelection();
  19454. a = q(a);
  19455. u(a)
  19456. }
  19457. }));
  19458. b("cellDelete", f({
  19459. requiredContent: "table", exec: function (a) {
  19460. a = a.getSelection();
  19461. z(a)
  19462. }
  19463. }));
  19464. b("cellMerge", f({
  19465. allowedContent: "td[colspan,rowspan]",
  19466. requiredContent: "td[colspan,rowspan]",
  19467. exec: function (a, b) {
  19468. b.cell = x(a.getSelection());
  19469. p(b.cell, !0)
  19470. }
  19471. }));
  19472. b("cellMergeRight", f({
  19473. allowedContent: "td[colspan]",
  19474. requiredContent: "td[colspan]",
  19475. exec: function (a, b) {
  19476. b.cell = x(a.getSelection(), "right");
  19477. p(b.cell, !0)
  19478. }
  19479. }));
  19480. b("cellMergeDown", f({
  19481. allowedContent: "td[rowspan]", requiredContent: "td[rowspan]",
  19482. exec: function (a, b) {
  19483. b.cell = x(a.getSelection(), "down");
  19484. p(b.cell, !0)
  19485. }
  19486. }));
  19487. b("cellVerticalSplit", f({
  19488. allowedContent: "td[rowspan]",
  19489. requiredContent: "td[rowspan]",
  19490. exec: function (a) {
  19491. p(E(a.getSelection()))
  19492. }
  19493. }));
  19494. b("cellHorizontalSplit", f({
  19495. allowedContent: "td[colspan]",
  19496. requiredContent: "td[colspan]",
  19497. exec: function (a) {
  19498. p(C(a.getSelection()))
  19499. }
  19500. }));
  19501. b("cellInsertBefore", f({
  19502. requiredContent: "table", exec: function (a) {
  19503. a = a.getSelection();
  19504. t(a, !0)
  19505. }
  19506. }));
  19507. b("cellInsertAfter", f({
  19508. requiredContent: "table", exec: function (a) {
  19509. a = a.getSelection();
  19510. t(a)
  19511. }
  19512. }));
  19513. d.addMenuItems && d.addMenuItems({
  19514. tablecell: {
  19515. label: c.cell.menu, group: "tablecell", order: 1, getItems: function () {
  19516. var a = d.getSelection(), b = q(a), a = {
  19517. tablecell_insertBefore: CKEDITOR.TRISTATE_OFF,
  19518. tablecell_insertAfter: CKEDITOR.TRISTATE_OFF,
  19519. tablecell_delete: CKEDITOR.TRISTATE_OFF,
  19520. tablecell_merge: x(a, null, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  19521. tablecell_merge_right: x(a, "right", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  19522. tablecell_merge_down: x(a, "down", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  19523. tablecell_split_vertical: E(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  19524. tablecell_split_horizontal: C(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  19525. };
  19526. d.filter.check(g) && (a.tablecell_properties = 0 < b.length ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  19527. return a
  19528. }
  19529. },
  19530. tablecell_insertBefore: {
  19531. label: c.cell.insertBefore,
  19532. group: "tablecell",
  19533. command: "cellInsertBefore",
  19534. order: 5
  19535. },
  19536. tablecell_insertAfter: {
  19537. label: c.cell.insertAfter,
  19538. group: "tablecell",
  19539. command: "cellInsertAfter",
  19540. order: 10
  19541. },
  19542. tablecell_delete: {
  19543. label: c.cell.deleteCell,
  19544. group: "tablecell", command: "cellDelete", order: 15
  19545. },
  19546. tablecell_merge: {label: c.cell.merge, group: "tablecell", command: "cellMerge", order: 16},
  19547. tablecell_merge_right: {
  19548. label: c.cell.mergeRight,
  19549. group: "tablecell",
  19550. command: "cellMergeRight",
  19551. order: 17
  19552. },
  19553. tablecell_merge_down: {
  19554. label: c.cell.mergeDown,
  19555. group: "tablecell",
  19556. command: "cellMergeDown",
  19557. order: 18
  19558. },
  19559. tablecell_split_horizontal: {
  19560. label: c.cell.splitHorizontal,
  19561. group: "tablecell",
  19562. command: "cellHorizontalSplit",
  19563. order: 19
  19564. },
  19565. tablecell_split_vertical: {
  19566. label: c.cell.splitVertical, group: "tablecell",
  19567. command: "cellVerticalSplit", order: 20
  19568. },
  19569. tablecell_properties: {
  19570. label: c.cell.title,
  19571. group: "tablecellproperties",
  19572. command: "cellProperties",
  19573. order: 21
  19574. },
  19575. tablerow: {
  19576. label: c.row.menu, group: "tablerow", order: 1, getItems: function () {
  19577. return {
  19578. tablerow_insertBefore: CKEDITOR.TRISTATE_OFF,
  19579. tablerow_insertAfter: CKEDITOR.TRISTATE_OFF,
  19580. tablerow_delete: CKEDITOR.TRISTATE_OFF
  19581. }
  19582. }
  19583. },
  19584. tablerow_insertBefore: {
  19585. label: c.row.insertBefore,
  19586. group: "tablerow",
  19587. command: "rowInsertBefore",
  19588. order: 5
  19589. },
  19590. tablerow_insertAfter: {
  19591. label: c.row.insertAfter, group: "tablerow",
  19592. command: "rowInsertAfter", order: 10
  19593. },
  19594. tablerow_delete: {label: c.row.deleteRow, group: "tablerow", command: "rowDelete", order: 15},
  19595. tablecolumn: {
  19596. label: c.column.menu, group: "tablecolumn", order: 1, getItems: function () {
  19597. return {
  19598. tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF,
  19599. tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF,
  19600. tablecolumn_delete: CKEDITOR.TRISTATE_OFF
  19601. }
  19602. }
  19603. },
  19604. tablecolumn_insertBefore: {
  19605. label: c.column.insertBefore,
  19606. group: "tablecolumn",
  19607. command: "columnInsertBefore",
  19608. order: 5
  19609. },
  19610. tablecolumn_insertAfter: {
  19611. label: c.column.insertAfter,
  19612. group: "tablecolumn", command: "columnInsertAfter", order: 10
  19613. },
  19614. tablecolumn_delete: {
  19615. label: c.column.deleteColumn,
  19616. group: "tablecolumn",
  19617. command: "columnDelete",
  19618. order: 15
  19619. }
  19620. });
  19621. d.contextMenu && d.contextMenu.addListener(function (a, b, c) {
  19622. return (a = c.contains({td: 1, th: 1}, 1)) && !a.isReadOnly() ? {
  19623. tablecell: CKEDITOR.TRISTATE_OFF,
  19624. tablerow: CKEDITOR.TRISTATE_OFF,
  19625. tablecolumn: CKEDITOR.TRISTATE_OFF
  19626. } : null
  19627. })
  19628. }, getCellColIndex: v, insertRow: r, insertColumn: u, getSelectedCells: q
  19629. };
  19630. CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools)
  19631. })();
  19632. CKEDITOR.tools.buildTableMap = function (q, r, B, v, w) {
  19633. q = q.$.rows;
  19634. B = B || 0;
  19635. v = "number" === typeof v ? v : q.length - 1;
  19636. w = "number" === typeof w ? w : -1;
  19637. var u = -1, y = [];
  19638. for (r = r || 0; r <= v; r++) {
  19639. u++;
  19640. !y[u] && (y[u] = []);
  19641. for (var t = -1, z = B; z <= (-1 === w ? q[r].cells.length - 1 : w); z++) {
  19642. var p = q[r].cells[z];
  19643. if (!p) break;
  19644. for (t++; y[u][t];) t++;
  19645. for (var A = isNaN(p.colSpan) ? 1 : p.colSpan, p = isNaN(p.rowSpan) ? 1 : p.rowSpan, x = 0; x < p && !(r + x > v); x++) {
  19646. y[u + x] || (y[u + x] = []);
  19647. for (var C = 0; C < A; C++) y[u + x][t + C] = q[r].cells[z]
  19648. }
  19649. t += A - 1;
  19650. if (-1 !== w && t >= w) break
  19651. }
  19652. }
  19653. return y
  19654. };
  19655. (function () {
  19656. function D(a) {
  19657. return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a)
  19658. }
  19659. function z(a, b) {
  19660. var c = a.getAscendant("table"), d = b.getAscendant("table"), e = CKEDITOR.tools.buildTableMap(c), g = r(a),
  19661. h = r(b), k = [], f = {}, l, p;
  19662. c.contains(d) && (b = b.getAscendant({td: 1, th: 1}), h = r(b));
  19663. g > h && (c = g, g = h, h = c, c = a, a = b, b = c);
  19664. for (c = 0; c < e[g].length; c++) if (a.$ === e[g][c]) {
  19665. l = c;
  19666. break
  19667. }
  19668. for (c = 0; c < e[h].length; c++) if (b.$ === e[h][c]) {
  19669. p = c;
  19670. break
  19671. }
  19672. l > p && (c = l, l = p, p = c);
  19673. for (c = g; c <= h; c++) for (g = l; g <= p; g++) d = new CKEDITOR.dom.element(e[c][g]),
  19674. d.$ && !d.getCustomData("selected_cell") && (k.push(d), CKEDITOR.dom.element.setMarker(f, d, "selected_cell", !0));
  19675. CKEDITOR.dom.element.clearAllMarkers(f);
  19676. return k
  19677. }
  19678. function I(a) {
  19679. if (a) return a = a.clone(), a.enlarge(CKEDITOR.ENLARGE_ELEMENT), (a = a.getEnclosedNode()) && a.is && a.is(CKEDITOR.dtd.$tableContent)
  19680. }
  19681. function J(a) {
  19682. return (a = a.editable().findOne(".cke_table-faked-selection")) && a.getAscendant("table")
  19683. }
  19684. function A(a, b) {
  19685. var c = a.editable().find(".cke_table-faked-selection"), d;
  19686. a.fire("lockSnapshot");
  19687. a.editable().removeClass("cke_table-faked-selection-editor");
  19688. for (d = 0; d < c.count(); d++) c.getItem(d).removeClass("cke_table-faked-selection");
  19689. 0 < c.count() && c.getItem(0).getAscendant("table").data("cke-table-faked-selection-table", !1);
  19690. a.fire("unlockSnapshot");
  19691. b && (m = {active: !1}, a.getSelection().isInTable() && a.getSelection().reset())
  19692. }
  19693. function t(a, b) {
  19694. var c = [], d, e;
  19695. for (e = 0; e < b.length; e++) d = a.createRange(), d.setStartBefore(b[e]), d.setEndAfter(b[e]), c.push(d);
  19696. a.getSelection().selectRanges(c)
  19697. }
  19698. function K(a) {
  19699. var b = a.editable().find(".cke_table-faked-selection");
  19700. 1 > b.count() ||
  19701. (b = z(b.getItem(0), b.getItem(b.count() - 1)), t(a, b))
  19702. }
  19703. function L(a, b, c) {
  19704. var d = v(a.getSelection(!0));
  19705. b = b.is("table") ? null : b;
  19706. var e;
  19707. (e = m.active && !m.first) && !(e = b) && (e = a.getSelection().getRanges(), e = 1 < d.length || e[0] && !e[0].collapsed ? !0 : !1);
  19708. if (e) m.first = b || d[0], m.dirty = b ? !1 : 1 !== d.length; else if (m.active && b && m.first.getAscendant("table").equals(b.getAscendant("table"))) {
  19709. d = z(m.first, b);
  19710. if (!m.dirty && 1 === d.length && !D(c.data.getTarget())) return A(a, "mouseup" === c.name);
  19711. m.dirty = !0;
  19712. m.last = b;
  19713. t(a, d)
  19714. }
  19715. }
  19716. function M(a) {
  19717. var b =
  19718. (a = a.editor || a.sender.editor) && a.getSelection(), c = b && b.getRanges() || [], d;
  19719. if (b && (A(a), b.isInTable() && b.isFake)) {
  19720. 1 === c.length && c[0]._getTableElement() && c[0]._getTableElement().is("table") && (d = c[0]._getTableElement());
  19721. d = v(b, d);
  19722. a.fire("lockSnapshot");
  19723. for (b = 0; b < d.length; b++) d[b].addClass("cke_table-faked-selection");
  19724. 0 < d.length && (a.editable().addClass("cke_table-faked-selection-editor"), d[0].getAscendant("table").data("cke-table-faked-selection-table", ""));
  19725. a.fire("unlockSnapshot")
  19726. }
  19727. }
  19728. function r(a) {
  19729. return a.getAscendant("tr",
  19730. !0).$.rowIndex
  19731. }
  19732. function w(a) {
  19733. function b(a, b) {
  19734. return a && b ? a.equals(b) || a.contains(b) || b.contains(a) || a.getCommonAncestor(b).is(l) : !1
  19735. }
  19736. function c(a) {
  19737. return !a.getAscendant("table", !0) && a.getDocument().equals(e.document)
  19738. }
  19739. function d(a, b, d, e) {
  19740. if ("mousedown" === a.name && (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT || !e)) return !0;
  19741. if (b = a.name === (CKEDITOR.env.gecko ? "mousedown" : "mouseup") && !c(a.data.getTarget())) a = a.data.getTarget().getAscendant({
  19742. td: 1,
  19743. th: 1
  19744. }, !0), b = !(a && a.hasClass("cke_table-faked-selection"));
  19745. return b
  19746. }
  19747. if (a.data.getTarget().getName && ("mouseup" === a.name || !D(a.data.getTarget()))) {
  19748. var e = a.editor || a.listenerData.editor, g = e.getSelection(1), h = J(e), k = a.data.getTarget(),
  19749. f = k && k.getAscendant({td: 1, th: 1}, !0), k = k && k.getAscendant("table", !0),
  19750. l = {table: 1, thead: 1, tbody: 1, tfoot: 1, tr: 1, td: 1, th: 1};
  19751. d(a, g, h, k) && A(e, !0);
  19752. !m.active && "mousedown" === a.name && CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT && k && (m = {active: !0}, CKEDITOR.document.on("mouseup", w, null, {editor: e}));
  19753. (f || k) && L(e, f || k, a);
  19754. "mouseup" ===
  19755. a.name && (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT && (c(a.data.getTarget()) || b(h, k)) && K(e), m = {active: !1}, CKEDITOR.document.removeListener("mouseup", w))
  19756. }
  19757. }
  19758. function N(a) {
  19759. var b = a.data.getTarget().getAscendant({td: 1, th: 1}, !0);
  19760. b && !b.hasClass("cke_table-faked-selection") && (a.cancel(), a.data.preventDefault())
  19761. }
  19762. function O(a, b) {
  19763. function c(a) {
  19764. a.cancel()
  19765. }
  19766. var d = a.getSelection(), e = d.createBookmarks(), g = a.document, h = a.createRange(),
  19767. k = g.getDocumentElement().$, f = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
  19768. l = a.blockless || CKEDITOR.env.ie ? "span" : "div", p, x, n, m;
  19769. g.getById("cke_table_copybin") || (p = g.createElement(l), x = g.createElement(l), x.setAttributes({
  19770. id: "cke_table_copybin",
  19771. "data-cke-temp": "1"
  19772. }), p.setStyles({
  19773. position: "absolute",
  19774. width: "1px",
  19775. height: "1px",
  19776. overflow: "hidden"
  19777. }), p.setStyle("ltr" == a.config.contentsLangDirection ? "left" : "right", "-5000px"), p.setHtml(a.getSelectedHtml(!0)), a.fire("lockSnapshot"), x.append(p), a.editable().append(x), m = a.on("selectionChange", c, null, null, 0), f && (n = k.scrollTop), h.selectNodeContents(p),
  19778. h.select(), f && (k.scrollTop = n), setTimeout(function () {
  19779. x.remove();
  19780. d.selectBookmarks(e);
  19781. m.removeListener();
  19782. a.fire("unlockSnapshot");
  19783. b && (a.extractSelectedHtml(), a.fire("saveSnapshot"))
  19784. }, 100))
  19785. }
  19786. function E(a) {
  19787. var b = a.editor || a.sender.editor;
  19788. b.getSelection().isInTable() && O(b, "cut" === a.name)
  19789. }
  19790. function q(a) {
  19791. this._reset();
  19792. a && this.setSelectedCells(a)
  19793. }
  19794. function B(a, b, c) {
  19795. a.on("beforeCommandExec", function (d) {
  19796. -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && (d.data.selectedCells = v(a.getSelection()))
  19797. });
  19798. a.on("afterCommandExec",
  19799. function (d) {
  19800. -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && c(a, d.data)
  19801. })
  19802. }
  19803. var m = {active: !1}, y, v, C, F, G;
  19804. q.prototype = {};
  19805. q.prototype._reset = function () {
  19806. this.cells = {first: null, last: null, all: []};
  19807. this.rows = {first: null, last: null}
  19808. };
  19809. q.prototype.setSelectedCells = function (a) {
  19810. this._reset();
  19811. a = a.slice(0);
  19812. this._arraySortByDOMOrder(a);
  19813. this.cells.all = a;
  19814. this.cells.first = a[0];
  19815. this.cells.last = a[a.length - 1];
  19816. this.rows.first = a[0].getAscendant("tr");
  19817. this.rows.last = this.cells.last.getAscendant("tr")
  19818. };
  19819. q.prototype.getTableMap =
  19820. function () {
  19821. var a = C(this.cells.first), b;
  19822. a:{
  19823. b = this.cells.last;
  19824. var c = b.getAscendant("table"), d = r(b), c = CKEDITOR.tools.buildTableMap(c), e;
  19825. for (e = 0; e < c[d].length; e++) if ((new CKEDITOR.dom.element(c[d][e])).equals(b)) {
  19826. b = e;
  19827. break a
  19828. }
  19829. b = void 0
  19830. }
  19831. return CKEDITOR.tools.buildTableMap(this._getTable(), r(this.rows.first), a, r(this.rows.last), b)
  19832. };
  19833. q.prototype._getTable = function () {
  19834. return this.rows.first.getAscendant("table")
  19835. };
  19836. q.prototype.insertRow = function (a, b, c) {
  19837. if ("undefined" === typeof a) a = 1; else if (0 >= a) return;
  19838. for (var d =
  19839. this.cells.first.$.cellIndex, e = this.cells.last.$.cellIndex, g = c ? [] : this.cells.all, h, k = 0; k < a; k++) h = F(c ? this.cells.all : g, b), h = CKEDITOR.tools.array.filter(h.find("td, th").toArray(), function (a) {
  19840. return c ? !0 : a.$.cellIndex >= d && a.$.cellIndex <= e
  19841. }), g = b ? h.concat(g) : g.concat(h);
  19842. this.setSelectedCells(g)
  19843. };
  19844. q.prototype.insertColumn = function (a) {
  19845. function b(a) {
  19846. a = r(a);
  19847. return a >= e && a <= g
  19848. }
  19849. if ("undefined" === typeof a) a = 1; else if (0 >= a) return;
  19850. 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.tools.array.filter(G(d),
  19851. b));
  19852. this.setSelectedCells(d)
  19853. };
  19854. q.prototype.emptyCells = function (a) {
  19855. a = a || this.cells.all;
  19856. for (var b = 0; b < a.length; b++) a[b].setHtml("")
  19857. };
  19858. q.prototype._arraySortByDOMOrder = function (a) {
  19859. a.sort(function (a, c) {
  19860. return a.getPosition(c) & CKEDITOR.POSITION_PRECEDING ? -1 : 1
  19861. })
  19862. };
  19863. var H = {
  19864. onPaste: function (a) {
  19865. function b(a) {
  19866. return Math.max.apply(null, CKEDITOR.tools.array.map(a, function (a) {
  19867. return a.length
  19868. }, 0))
  19869. }
  19870. function c(a) {
  19871. var b = d.createRange();
  19872. b.selectNodeContents(a);
  19873. b.select()
  19874. }
  19875. var d = a.editor, e = d.getSelection(), g = v(e), h = this.findTableInPastedContent(d,
  19876. a.data.dataValue), k = e.isInTable(!0) && this.isBoundarySelection(e), f, l;
  19877. !g.length || 1 === g.length && !I(e.getRanges()[0]) && !k || k && !h || (g = g[0].getAscendant("table"), f = new q(v(e, g)), d.once("afterPaste", function () {
  19878. var a;
  19879. if (l) {
  19880. a = new CKEDITOR.dom.element(l[0][0]);
  19881. var b = l[l.length - 1];
  19882. a = z(a, new CKEDITOR.dom.element(b[b.length - 1]))
  19883. } else a = f.cells.all;
  19884. t(d, a)
  19885. }), h ? (a.stop(), k ? (f.insertRow(1, 1 === k, !0), e.selectElement(f.rows.first)) : (f.emptyCells(), t(d, f.cells.all)), a = f.getTableMap(), l = CKEDITOR.tools.buildTableMap(h),
  19886. f.insertRow(l.length - a.length), f.insertColumn(b(l) - b(a)), a = f.getTableMap(), this.pasteTable(f, a, l), d.fire("saveSnapshot"), setTimeout(function () {
  19887. d.fire("afterPaste")
  19888. }, 0)) : (c(f.cells.first), d.once("afterPaste", function () {
  19889. d.fire("lockSnapshot");
  19890. f.emptyCells(f.cells.all.slice(1));
  19891. t(d, f.cells.all);
  19892. d.fire("unlockSnapshot")
  19893. })))
  19894. }, isBoundarySelection: function (a) {
  19895. a = a.getRanges()[0];
  19896. var b = a.endContainer.getAscendant("tr", !0);
  19897. if (b && a.collapsed) {
  19898. if (a.checkBoundaryOfElement(b, CKEDITOR.START)) return 1;
  19899. if (a.checkBoundaryOfElement(b,
  19900. CKEDITOR.END)) return 2
  19901. }
  19902. return 0
  19903. }, findTableInPastedContent: function (a, b) {
  19904. var c = a.dataProcessor, d = new CKEDITOR.dom.element("body");
  19905. c || (c = new CKEDITOR.htmlDataProcessor(a));
  19906. d.setHtml(c.toHtml(b), {fixForBody: !1});
  19907. return 1 < d.getChildCount() ? null : d.findOne("table")
  19908. }, pasteTable: function (a, b, c) {
  19909. var d, e = C(a.cells.first), g = a._getTable(), h = {}, k, f, l, p;
  19910. for (l = 0; l < c.length; l++) for (k = new CKEDITOR.dom.element(g.$.rows[a.rows.first.$.rowIndex + l]), p = 0; p < c[l].length; p++) if (f = new CKEDITOR.dom.element(c[l][p]), d = b[l] &&
  19911. b[l][p] ? new CKEDITOR.dom.element(b[l][p]) : null, f && !f.getCustomData("processed")) {
  19912. if (d && d.getParent()) f.replace(d); else if (0 === p || c[l][p - 1]) (d = 0 !== p ? new CKEDITOR.dom.element(c[l][p - 1]) : null) && k.equals(d.getParent()) ? f.insertAfter(d) : 0 < e ? k.$.cells[e] ? f.insertAfter(new CKEDITOR.dom.element(k.$.cells[e])) : k.append(f) : k.append(f, !0);
  19913. CKEDITOR.dom.element.setMarker(h, f, "processed", !0)
  19914. } else f.getCustomData("processed") && d && d.remove();
  19915. CKEDITOR.dom.element.clearAllMarkers(h)
  19916. }
  19917. };
  19918. CKEDITOR.plugins.tableselection =
  19919. {
  19920. getCellsBetween: z, keyboardIntegration: function (a) {
  19921. function b(a) {
  19922. var b = a.getEnclosedNode();
  19923. b && "function" === typeof b.is && b.is({td: 1, th: 1}) ? b.setText("") : a.deleteContents();
  19924. CKEDITOR.tools.array.forEach(a._find("td"), function (a) {
  19925. a.appendBogus()
  19926. })
  19927. }
  19928. var c = a.editable();
  19929. c.attachListener(c, "keydown", function (a) {
  19930. function c(b, e) {
  19931. if (!e.length) return null;
  19932. var l = a.createRange(), g = CKEDITOR.dom.range.mergeRanges(e);
  19933. CKEDITOR.tools.array.forEach(g, function (a) {
  19934. a.enlarge(CKEDITOR.ENLARGE_ELEMENT)
  19935. });
  19936. var m = g[0].getBoundaryNodes(),
  19937. n = m.startNode, m = m.endNode;
  19938. if (n && n.is && n.is(h)) {
  19939. for (var q = n.getAscendant("table", !0), u = n.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT, q), r = !1, t = function (a) {
  19940. return !n.contains(a) && a.is && a.is("td", "th")
  19941. }; u && !t(u);) u = u.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT, q);
  19942. !u && m && m.is && !m.is("table") && m.getNext() && (u = m.getNext().findOne("td, th"), r = !0);
  19943. if (u) l["moveToElementEdit" + (r ? "Start" : "End")](u); else l.setStartBefore(n.getAscendant("table", !0)), l.collapse(!0);
  19944. g[0].deleteContents();
  19945. return [l]
  19946. }
  19947. if (n) return l.moveToElementEditablePosition(n),
  19948. [l]
  19949. }
  19950. var g = {37: 1, 38: 1, 39: 1, 40: 1, 8: 1, 46: 1, 13: 1},
  19951. h = CKEDITOR.tools.extend({table: 1}, CKEDITOR.dtd.$tableContent);
  19952. delete h.td;
  19953. delete h.th;
  19954. return function (k) {
  19955. var f = k.data.getKey(), l = k.data.getKeystroke(), h, m = 37 === f || 38 == f, n, q, r;
  19956. if (g[f] && !a.readOnly && (h = a.getSelection()) && h.isInTable() && h.isFake) {
  19957. n = h.getRanges();
  19958. q = n[0]._getTableElement();
  19959. r = n[n.length - 1]._getTableElement();
  19960. if (13 !== f || a.plugins.enterkey) k.data.preventDefault(), k.cancel();
  19961. if (36 < f && 41 > f) n[0].moveToElementEditablePosition(m ? q : r, !m), h.selectRanges([n[0]]);
  19962. else if (13 !== f || 13 === l || l === CKEDITOR.SHIFT + 13) {
  19963. for (k = 0; k < n.length; k++) b(n[k]);
  19964. (k = c(q, n)) ? n = k : n[0].moveToElementEditablePosition(q);
  19965. h.selectRanges(n);
  19966. 13 === f && a.plugins.enterkey ? (a.fire("lockSnapshot"), 13 === l ? a.execCommand("enter") : a.execCommand("shiftEnter"), a.fire("unlockSnapshot"), a.fire("saveSnapshot")) : 13 !== f && a.fire("saveSnapshot")
  19967. }
  19968. }
  19969. }
  19970. }(a), null, null, -1);
  19971. c.attachListener(c, "keypress", function (d) {
  19972. var c = a.getSelection(), g = d.data.$.charCode || 13 === d.data.getKey(), h;
  19973. if (!a.readOnly && c && c.isInTable() &&
  19974. c.isFake && g && !(d.data.getKeystroke() & CKEDITOR.CTRL)) {
  19975. d = c.getRanges();
  19976. g = d[0].getEnclosedNode().getAscendant({td: 1, th: 1}, !0);
  19977. for (h = 0; h < d.length; h++) b(d[h]);
  19978. g && (d[0].moveToElementEditablePosition(g), c.selectRanges([d[0]]))
  19979. }
  19980. }, null, null, -1)
  19981. }, isSupportedEnvironment: !(CKEDITOR.env.ie && 11 > CKEDITOR.env.version)
  19982. };
  19983. CKEDITOR.plugins.add("tableselection", {
  19984. requires: "clipboard,tabletools", onLoad: function () {
  19985. y = CKEDITOR.plugins.tabletools;
  19986. v = y.getSelectedCells;
  19987. C = y.getCellColIndex;
  19988. F = y.insertRow;
  19989. G = y.insertColumn;
  19990. CKEDITOR.document.appendStyleSheet(this.path +
  19991. "styles/tableselection.css")
  19992. }, init: function (a) {
  19993. CKEDITOR.plugins.tableselection.isSupportedEnvironment && (a.addContentsCss && a.addContentsCss(this.path + "styles/tableselection.css"), a.on("contentDom", function () {
  19994. var b = a.editable(), c = b.isInline() ? b : a.document, d = {editor: a};
  19995. b.attachListener(c, "mousedown", w, null, d);
  19996. b.attachListener(c, "mousemove", w, null, d);
  19997. b.attachListener(c, "mouseup", w, null, d);
  19998. b.attachListener(b, "dragstart", N);
  19999. b.attachListener(a, "selectionCheck", M);
  20000. CKEDITOR.plugins.tableselection.keyboardIntegration(a);
  20001. CKEDITOR.plugins.clipboard && !CKEDITOR.plugins.clipboard.isCustomCopyCutSupported && (b.attachListener(b, "cut", E), b.attachListener(b, "copy", E))
  20002. }), a.on("paste", H.onPaste, H), B(a, "rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "), function (a, c) {
  20003. t(a, c.selectedCells)
  20004. }), B(a, ["cellMerge", "cellMergeRight", "cellMergeDown"], function (a, c) {
  20005. t(a, [c.commandData.cell])
  20006. }), B(a, ["cellDelete"], function (a) {
  20007. A(a, !0)
  20008. }))
  20009. }
  20010. })
  20011. })();
  20012. (function () {
  20013. var g = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90], n = {8: 1, 46: 1};
  20014. CKEDITOR.plugins.add("undo", {
  20015. init: function (a) {
  20016. function b(a) {
  20017. d.enabled && !1 !== a.data.command.canUndo && d.save()
  20018. }
  20019. function c() {
  20020. d.enabled = a.readOnly ? !1 : "wysiwyg" == a.mode;
  20021. d.onChange()
  20022. }
  20023. var d = a.undoManager = new e(a), l = d.editingHandler = new k(d), f = a.addCommand("undo", {
  20024. exec: function () {
  20025. d.undo() && (a.selectionChange(), this.fire("afterUndo"))
  20026. }, startDisabled: !0, canUndo: !1
  20027. }), h = a.addCommand("redo", {
  20028. exec: function () {
  20029. d.redo() &&
  20030. (a.selectionChange(), this.fire("afterRedo"))
  20031. }, startDisabled: !0, canUndo: !1
  20032. });
  20033. a.setKeystroke([[g[0], "undo"], [g[1], "redo"], [g[2], "redo"]]);
  20034. d.onChange = function () {
  20035. f.setState(d.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  20036. h.setState(d.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  20037. };
  20038. a.on("beforeCommandExec", b);
  20039. a.on("afterCommandExec", b);
  20040. a.on("saveSnapshot", function (a) {
  20041. d.save(a.data && a.data.contentOnly)
  20042. });
  20043. a.on("contentDom", l.attachListeners, l);
  20044. a.on("instanceReady", function () {
  20045. a.fire("saveSnapshot")
  20046. });
  20047. a.on("beforeModeUnload", function () {
  20048. "wysiwyg" == a.mode && d.save(!0)
  20049. });
  20050. a.on("mode", c);
  20051. a.on("readOnly", c);
  20052. a.ui.addButton && (a.ui.addButton("Undo", {
  20053. label: a.lang.undo.undo,
  20054. command: "undo",
  20055. toolbar: "undo,10"
  20056. }), a.ui.addButton("Redo", {label: a.lang.undo.redo, command: "redo", toolbar: "undo,20"}));
  20057. a.resetUndo = function () {
  20058. d.reset();
  20059. a.fire("saveSnapshot")
  20060. };
  20061. a.on("updateSnapshot", function () {
  20062. d.currentImage && d.update()
  20063. });
  20064. a.on("lockSnapshot", function (a) {
  20065. a = a.data;
  20066. d.lock(a && a.dontUpdate, a && a.forceUpdate)
  20067. });
  20068. a.on("unlockSnapshot",
  20069. d.unlock, d)
  20070. }
  20071. });
  20072. CKEDITOR.plugins.undo = {};
  20073. var e = CKEDITOR.plugins.undo.UndoManager = function (a) {
  20074. this.strokesRecorded = [0, 0];
  20075. this.locked = null;
  20076. this.previousKeyGroup = -1;
  20077. this.limit = a.config.undoStackSize || 20;
  20078. this.strokesLimit = 25;
  20079. this.editor = a;
  20080. this.reset()
  20081. };
  20082. e.prototype = {
  20083. type: function (a, b) {
  20084. var c = e.getKeyGroup(a), d = this.strokesRecorded[c] + 1;
  20085. b = b || d >= this.strokesLimit;
  20086. this.typing || (this.hasUndo = this.typing = !0, this.hasRedo = !1, this.onChange());
  20087. b ? (d = 0, this.editor.fire("saveSnapshot")) : this.editor.fire("change");
  20088. this.strokesRecorded[c] =
  20089. d;
  20090. this.previousKeyGroup = c
  20091. }, keyGroupChanged: function (a) {
  20092. return e.getKeyGroup(a) != this.previousKeyGroup
  20093. }, reset: function () {
  20094. this.snapshots = [];
  20095. this.index = -1;
  20096. this.currentImage = null;
  20097. this.hasRedo = this.hasUndo = !1;
  20098. this.locked = null;
  20099. this.resetType()
  20100. }, resetType: function () {
  20101. this.strokesRecorded = [0, 0];
  20102. this.typing = !1;
  20103. this.previousKeyGroup = -1
  20104. }, refreshState: function () {
  20105. this.hasUndo = !!this.getNextImage(!0);
  20106. this.hasRedo = !!this.getNextImage(!1);
  20107. this.resetType();
  20108. this.onChange()
  20109. }, save: function (a, b, c) {
  20110. var d = this.editor;
  20111. if (this.locked ||
  20112. "ready" != d.status || "wysiwyg" != d.mode) return !1;
  20113. var e = d.editable();
  20114. if (!e || "ready" != e.status) return !1;
  20115. e = this.snapshots;
  20116. b || (b = new f(d));
  20117. if (!1 === b.contents) return !1;
  20118. if (this.currentImage) if (b.equalsContent(this.currentImage)) {
  20119. if (a || b.equalsSelection(this.currentImage)) return !1
  20120. } else !1 !== c && d.fire("change");
  20121. e.splice(this.index + 1, e.length - this.index - 1);
  20122. e.length == this.limit && e.shift();
  20123. this.index = e.push(b) - 1;
  20124. this.currentImage = b;
  20125. !1 !== c && this.refreshState();
  20126. return !0
  20127. }, restoreImage: function (a) {
  20128. var b = this.editor,
  20129. c;
  20130. a.bookmarks && (b.focus(), c = b.getSelection());
  20131. this.locked = {level: 999};
  20132. this.editor.loadSnapshot(a.contents);
  20133. a.bookmarks ? c.selectBookmarks(a.bookmarks) : CKEDITOR.env.ie && (c = this.editor.document.getBody().$.createTextRange(), c.collapse(!0), c.select());
  20134. this.locked = null;
  20135. this.index = a.index;
  20136. this.currentImage = this.snapshots[this.index];
  20137. this.update();
  20138. this.refreshState();
  20139. b.fire("change")
  20140. }, getNextImage: function (a) {
  20141. var b = this.snapshots, c = this.currentImage, d;
  20142. if (c) if (a) for (d = this.index - 1; 0 <= d; d--) {
  20143. if (a = b[d], !c.equalsContent(a)) return a.index =
  20144. d, a
  20145. } else for (d = this.index + 1; d < b.length; d++) if (a = b[d], !c.equalsContent(a)) return a.index = d, a;
  20146. return null
  20147. }, redoable: function () {
  20148. return this.enabled && this.hasRedo
  20149. }, undoable: function () {
  20150. return this.enabled && this.hasUndo
  20151. }, undo: function () {
  20152. if (this.undoable()) {
  20153. this.save(!0);
  20154. var a = this.getNextImage(!0);
  20155. if (a) return this.restoreImage(a), !0
  20156. }
  20157. return !1
  20158. }, redo: function () {
  20159. if (this.redoable() && (this.save(!0), this.redoable())) {
  20160. var a = this.getNextImage(!1);
  20161. if (a) return this.restoreImage(a), !0
  20162. }
  20163. return !1
  20164. }, update: function (a) {
  20165. if (!this.locked) {
  20166. a ||
  20167. (a = new f(this.editor));
  20168. for (var b = this.index, c = this.snapshots; 0 < b && this.currentImage.equalsContent(c[b - 1]);) --b;
  20169. c.splice(b, this.index - b + 1, a);
  20170. this.index = b;
  20171. this.currentImage = a
  20172. }
  20173. }, updateSelection: function (a) {
  20174. if (!this.snapshots.length) return !1;
  20175. var b = this.snapshots, c = b[b.length - 1];
  20176. return c.equalsContent(a) && !c.equalsSelection(a) ? (this.currentImage = b[b.length - 1] = a, !0) : !1
  20177. }, lock: function (a, b) {
  20178. if (this.locked) this.locked.level++; else if (a) this.locked = {level: 1}; else {
  20179. var c = null;
  20180. if (b) c = !0; else {
  20181. var d = new f(this.editor,
  20182. !0);
  20183. this.currentImage && this.currentImage.equalsContent(d) && (c = d)
  20184. }
  20185. this.locked = {update: c, level: 1}
  20186. }
  20187. }, unlock: function () {
  20188. if (this.locked && !--this.locked.level) {
  20189. var a = this.locked.update;
  20190. this.locked = null;
  20191. if (!0 === a) this.update(); else if (a) {
  20192. var b = new f(this.editor, !0);
  20193. a.equalsContent(b) || this.update()
  20194. }
  20195. }
  20196. }
  20197. };
  20198. e.navigationKeyCodes = {37: 1, 38: 1, 39: 1, 40: 1, 36: 1, 35: 1, 33: 1, 34: 1};
  20199. e.keyGroups = {PRINTABLE: 0, FUNCTIONAL: 1};
  20200. e.isNavigationKey = function (a) {
  20201. return !!e.navigationKeyCodes[a]
  20202. };
  20203. e.getKeyGroup = function (a) {
  20204. var b = e.keyGroups;
  20205. return n[a] ? b.FUNCTIONAL : b.PRINTABLE
  20206. };
  20207. e.getOppositeKeyGroup = function (a) {
  20208. var b = e.keyGroups;
  20209. return a == b.FUNCTIONAL ? b.PRINTABLE : b.FUNCTIONAL
  20210. };
  20211. e.ieFunctionalKeysBug = function (a) {
  20212. return CKEDITOR.env.ie && e.getKeyGroup(a) == e.keyGroups.FUNCTIONAL
  20213. };
  20214. var f = CKEDITOR.plugins.undo.Image = function (a, b) {
  20215. this.editor = a;
  20216. a.fire("beforeUndoImage");
  20217. var c = a.getSnapshot();
  20218. CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, ""));
  20219. this.contents = c;
  20220. b || (this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(!0));
  20221. a.fire("afterUndoImage")
  20222. },
  20223. h = /\b(?:href|src|name)="[^"]*?"/gi;
  20224. f.prototype = {
  20225. equalsContent: function (a) {
  20226. var b = this.contents;
  20227. a = a.contents;
  20228. CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) && (b = b.replace(h, ""), a = a.replace(h, ""));
  20229. return b != a ? !1 : !0
  20230. }, equalsSelection: function (a) {
  20231. var b = this.bookmarks;
  20232. a = a.bookmarks;
  20233. if (b || a) {
  20234. if (!b || !a || b.length != a.length) return !1;
  20235. for (var c = 0; c < b.length; c++) {
  20236. var d = b[c], e = a[c];
  20237. if (d.startOffset != e.startOffset || d.endOffset != e.endOffset || !CKEDITOR.tools.arrayCompare(d.start, e.start) || !CKEDITOR.tools.arrayCompare(d.end,
  20238. e.end)) return !1
  20239. }
  20240. }
  20241. return !0
  20242. }
  20243. };
  20244. var k = CKEDITOR.plugins.undo.NativeEditingHandler = function (a) {
  20245. this.undoManager = a;
  20246. this.ignoreInputEvent = !1;
  20247. this.keyEventsStack = new m;
  20248. this.lastKeydownImage = null
  20249. };
  20250. k.prototype = {
  20251. onKeydown: function (a) {
  20252. var b = a.data.getKey();
  20253. if (229 !== b) if (-1 < CKEDITOR.tools.indexOf(g, a.data.getKeystroke())) a.data.preventDefault(); else if (this.keyEventsStack.cleanUp(a), a = this.undoManager, this.keyEventsStack.getLast(b) || this.keyEventsStack.push(b), this.lastKeydownImage = new f(a.editor), e.isNavigationKey(b) ||
  20254. this.undoManager.keyGroupChanged(b)) if (a.strokesRecorded[0] || a.strokesRecorded[1]) a.save(!1, this.lastKeydownImage, !1), a.resetType()
  20255. }, onInput: function () {
  20256. if (this.ignoreInputEvent) this.ignoreInputEvent = !1; else {
  20257. var a = this.keyEventsStack.getLast();
  20258. a || (a = this.keyEventsStack.push(0));
  20259. this.keyEventsStack.increment(a.keyCode);
  20260. this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit && (this.undoManager.type(a.keyCode, !0), this.keyEventsStack.resetInputs())
  20261. }
  20262. }, onKeyup: function (a) {
  20263. var b = this.undoManager;
  20264. a = a.data.getKey();
  20265. var c = this.keyEventsStack.getTotalInputs();
  20266. this.keyEventsStack.remove(a);
  20267. if (!(e.ieFunctionalKeysBug(a) && this.lastKeydownImage && this.lastKeydownImage.equalsContent(new f(b.editor, !0)))) if (0 < c) b.type(a); else if (e.isNavigationKey(a)) this.onNavigationKey(!0)
  20268. }, onNavigationKey: function (a) {
  20269. var b = this.undoManager;
  20270. !a && b.save(!0, null, !1) || b.updateSelection(new f(b.editor));
  20271. b.resetType()
  20272. }, ignoreInputEventListener: function () {
  20273. this.ignoreInputEvent = !0
  20274. }, activateInputEventListener: function () {
  20275. this.ignoreInputEvent =
  20276. !1
  20277. }, attachListeners: function () {
  20278. var a = this.undoManager.editor, b = a.editable(), c = this;
  20279. b.attachListener(b, "keydown", function (a) {
  20280. c.onKeydown(a);
  20281. if (e.ieFunctionalKeysBug(a.data.getKey())) c.onInput()
  20282. }, null, null, 999);
  20283. b.attachListener(b, CKEDITOR.env.ie ? "keypress" : "input", c.onInput, c, null, 999);
  20284. b.attachListener(b, "keyup", c.onKeyup, c, null, 999);
  20285. b.attachListener(b, "paste", c.ignoreInputEventListener, c, null, 999);
  20286. b.attachListener(b, "drop", c.ignoreInputEventListener, c, null, 999);
  20287. a.on("afterPaste", c.activateInputEventListener,
  20288. c, null, 999);
  20289. b.attachListener(b.isInline() ? b : a.document.getDocumentElement(), "click", function () {
  20290. c.onNavigationKey()
  20291. }, null, null, 999);
  20292. b.attachListener(this.undoManager.editor, "blur", function () {
  20293. c.keyEventsStack.remove(9)
  20294. }, null, null, 999)
  20295. }
  20296. };
  20297. var m = CKEDITOR.plugins.undo.KeyEventsStack = function () {
  20298. this.stack = []
  20299. };
  20300. m.prototype = {
  20301. push: function (a) {
  20302. a = this.stack.push({keyCode: a, inputs: 0});
  20303. return this.stack[a - 1]
  20304. }, getLastIndex: function (a) {
  20305. if ("number" != typeof a) return this.stack.length - 1;
  20306. for (var b = this.stack.length; b--;) if (this.stack[b].keyCode ==
  20307. a) return b;
  20308. return -1
  20309. }, getLast: function (a) {
  20310. a = this.getLastIndex(a);
  20311. return -1 != a ? this.stack[a] : null
  20312. }, increment: function (a) {
  20313. this.getLast(a).inputs++
  20314. }, remove: function (a) {
  20315. a = this.getLastIndex(a);
  20316. -1 != a && this.stack.splice(a, 1)
  20317. }, resetInputs: function (a) {
  20318. if ("number" == typeof a) this.getLast(a).inputs = 0; else for (a = this.stack.length; a--;) this.stack[a].inputs = 0
  20319. }, getTotalInputs: function () {
  20320. for (var a = this.stack.length, b = 0; a--;) b += this.stack[a].inputs;
  20321. return b
  20322. }, cleanUp: function (a) {
  20323. a = a.data.$;
  20324. a.ctrlKey || a.metaKey || this.remove(17);
  20325. a.shiftKey || this.remove(16);
  20326. a.altKey || this.remove(18)
  20327. }
  20328. }
  20329. })();
  20330. (function () {
  20331. function m(a, d) {
  20332. CKEDITOR.tools.extend(this, {editor: a, editable: a.editable(), doc: a.document, win: a.window}, d, !0);
  20333. this.inline = this.editable.isInline();
  20334. this.inline || (this.frame = this.win.getFrame());
  20335. this.target = this[this.inline ? "editable" : "doc"]
  20336. }
  20337. function n(a, d) {
  20338. CKEDITOR.tools.extend(this, d, {editor: a}, !0)
  20339. }
  20340. function p(a, d) {
  20341. var b = a.editable();
  20342. CKEDITOR.tools.extend(this, {
  20343. editor: a,
  20344. editable: b,
  20345. inline: b.isInline(),
  20346. doc: a.document,
  20347. win: a.window,
  20348. container: CKEDITOR.document.getBody(),
  20349. winTop: CKEDITOR.document.getWindow()
  20350. },
  20351. d, !0);
  20352. this.hidden = {};
  20353. this.visible = {};
  20354. this.inline || (this.frame = this.win.getFrame());
  20355. this.queryViewport();
  20356. var c = CKEDITOR.tools.bind(this.queryViewport, this), e = CKEDITOR.tools.bind(this.hideVisible, this),
  20357. g = CKEDITOR.tools.bind(this.removeAll, this);
  20358. b.attachListener(this.winTop, "resize", c);
  20359. b.attachListener(this.winTop, "scroll", c);
  20360. b.attachListener(this.winTop, "resize", e);
  20361. b.attachListener(this.win, "scroll", e);
  20362. b.attachListener(this.inline ? b : this.frame, "mouseout", function (a) {
  20363. var b = a.data.$.clientX;
  20364. a = a.data.$.clientY;
  20365. this.queryViewport();
  20366. (b <= this.rect.left || b >= this.rect.right || a <= this.rect.top || a >= this.rect.bottom) && this.hideVisible();
  20367. (0 >= b || b >= this.winTopPane.width || 0 >= a || a >= this.winTopPane.height) && this.hideVisible()
  20368. }, this);
  20369. b.attachListener(a, "resize", c);
  20370. b.attachListener(a, "mode", g);
  20371. a.on("destroy", g);
  20372. this.lineTpl = (new CKEDITOR.template('\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')).output({
  20373. lineStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},
  20374. t, this.lineStyle, !0)),
  20375. tipLeftStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, {
  20376. left: "0px",
  20377. "border-left-color": "red",
  20378. "border-width": "6px 0 6px 6px"
  20379. }, this.tipCss, this.tipLeftStyle, !0)),
  20380. tipRightStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, {
  20381. right: "0px",
  20382. "border-right-color": "red",
  20383. "border-width": "6px 6px 6px 0"
  20384. }, this.tipCss, this.tipRightStyle, !0))
  20385. })
  20386. }
  20387. function l(a) {
  20388. var d;
  20389. if (d = a && a.type == CKEDITOR.NODE_ELEMENT) d = !(r[a.getComputedStyle("float")] || r[a.getAttribute("align")]);
  20390. return d &&
  20391. !u[a.getComputedStyle("position")]
  20392. }
  20393. CKEDITOR.plugins.add("lineutils");
  20394. CKEDITOR.LINEUTILS_BEFORE = 1;
  20395. CKEDITOR.LINEUTILS_AFTER = 2;
  20396. CKEDITOR.LINEUTILS_INSIDE = 4;
  20397. m.prototype = {
  20398. start: function (a) {
  20399. var d = this, b = this.editor, c = this.doc, e, g, f, h,
  20400. k = CKEDITOR.tools.eventsBuffer(50, function () {
  20401. b.readOnly || "wysiwyg" != b.mode || (d.relations = {}, (g = c.$.elementFromPoint(f, h)) && g.nodeType && (e = new CKEDITOR.dom.element(g), d.traverseSearch(e), isNaN(f + h) || d.pixelSearch(e, f, h), a && a(d.relations, f, h)))
  20402. });
  20403. this.listener = this.editable.attachListener(this.target,
  20404. "mousemove", function (a) {
  20405. f = a.data.$.clientX;
  20406. h = a.data.$.clientY;
  20407. k.input()
  20408. });
  20409. this.editable.attachListener(this.inline ? this.editable : this.frame, "mouseout", function () {
  20410. k.reset()
  20411. })
  20412. }, stop: function () {
  20413. this.listener && this.listener.removeListener()
  20414. }, getRange: function () {
  20415. var a = {};
  20416. a[CKEDITOR.LINEUTILS_BEFORE] = CKEDITOR.POSITION_BEFORE_START;
  20417. a[CKEDITOR.LINEUTILS_AFTER] = CKEDITOR.POSITION_AFTER_END;
  20418. a[CKEDITOR.LINEUTILS_INSIDE] = CKEDITOR.POSITION_AFTER_START;
  20419. return function (d) {
  20420. var b = this.editor.createRange();
  20421. b.moveToPosition(this.relations[d.uid].element,
  20422. a[d.type]);
  20423. return b
  20424. }
  20425. }(), store: function () {
  20426. function a(a, b, c) {
  20427. var e = a.getUniqueId();
  20428. e in c ? c[e].type |= b : c[e] = {element: a, type: b}
  20429. }
  20430. return function (d, b) {
  20431. var c;
  20432. b & CKEDITOR.LINEUTILS_AFTER && l(c = d.getNext()) && c.isVisible() && (a(c, CKEDITOR.LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_AFTER);
  20433. b & CKEDITOR.LINEUTILS_INSIDE && l(c = d.getFirst()) && c.isVisible() && (a(c, CKEDITOR.LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_INSIDE);
  20434. a(d, b, this.relations)
  20435. }
  20436. }(), traverseSearch: function (a) {
  20437. var d, b, c;
  20438. do if (c = a.$["data-cke-expando"],
  20439. !(c && c in this.relations)) {
  20440. if (a.equals(this.editable)) break;
  20441. if (l(a)) for (d in this.lookups) (b = this.lookups[d](a)) && this.store(a, b)
  20442. } while ((!a || a.type != CKEDITOR.NODE_ELEMENT || "true" != a.getAttribute("contenteditable")) && (a = a.getParent()))
  20443. }, pixelSearch: function () {
  20444. function a(a, c, e, g, f) {
  20445. for (var h = 0, k; f(e);) {
  20446. e += g;
  20447. if (25 == ++h) break;
  20448. if (k = this.doc.$.elementFromPoint(c, e)) if (k == a) h = 0; else if (d(a, k) && (h = 0, l(k = new CKEDITOR.dom.element(k)))) return k
  20449. }
  20450. }
  20451. var d = CKEDITOR.env.ie || CKEDITOR.env.webkit ? function (a, c) {
  20452. return a.contains(c)
  20453. } :
  20454. function (a, c) {
  20455. return !!(a.compareDocumentPosition(c) & 16)
  20456. };
  20457. return function (b, c, d) {
  20458. var g = this.win.getViewPaneSize().height, f = a.call(this, b.$, c, d, -1, function (a) {
  20459. return 0 < a
  20460. });
  20461. c = a.call(this, b.$, c, d, 1, function (a) {
  20462. return a < g
  20463. });
  20464. if (f) for (this.traverseSearch(f); !f.getParent().equals(b);) f = f.getParent();
  20465. if (c) for (this.traverseSearch(c); !c.getParent().equals(b);) c = c.getParent();
  20466. for (; f || c;) {
  20467. f && (f = f.getNext(l));
  20468. if (!f || f.equals(c)) break;
  20469. this.traverseSearch(f);
  20470. c && (c = c.getPrevious(l));
  20471. if (!c || c.equals(f)) break;
  20472. this.traverseSearch(c)
  20473. }
  20474. }
  20475. }(),
  20476. greedySearch: function () {
  20477. this.relations = {};
  20478. for (var a = this.editable.getElementsByTag("*"), d = 0, b, c, e; b = a.getItem(d++);) if (!b.equals(this.editable) && b.type == CKEDITOR.NODE_ELEMENT && (b.hasAttribute("contenteditable") || !b.isReadOnly()) && l(b) && b.isVisible()) for (e in this.lookups) (c = this.lookups[e](b)) && this.store(b, c);
  20479. return this.relations
  20480. }
  20481. };
  20482. n.prototype = {
  20483. locate: function () {
  20484. function a(a, b) {
  20485. var c = a.element[b === CKEDITOR.LINEUTILS_BEFORE ? "getPrevious" : "getNext"]();
  20486. return c && l(c) ? (a.siblingRect = c.getClientRect(),
  20487. b == CKEDITOR.LINEUTILS_BEFORE ? (a.siblingRect.bottom + a.elementRect.top) / 2 : (a.elementRect.bottom + a.siblingRect.top) / 2) : b == CKEDITOR.LINEUTILS_BEFORE ? a.elementRect.top : a.elementRect.bottom
  20488. }
  20489. return function (d) {
  20490. var b;
  20491. this.locations = {};
  20492. for (var c in d) b = d[c], b.elementRect = b.element.getClientRect(), b.type & CKEDITOR.LINEUTILS_BEFORE && this.store(c, CKEDITOR.LINEUTILS_BEFORE, a(b, CKEDITOR.LINEUTILS_BEFORE)), b.type & CKEDITOR.LINEUTILS_AFTER && this.store(c, CKEDITOR.LINEUTILS_AFTER, a(b, CKEDITOR.LINEUTILS_AFTER)), b.type &
  20493. CKEDITOR.LINEUTILS_INSIDE && this.store(c, CKEDITOR.LINEUTILS_INSIDE, (b.elementRect.top + b.elementRect.bottom) / 2);
  20494. return this.locations
  20495. }
  20496. }(), sort: function () {
  20497. var a, d, b, c;
  20498. return function (e, g) {
  20499. a = this.locations;
  20500. d = [];
  20501. for (var f in a) for (var h in a[f]) if (b = Math.abs(e - a[f][h]), d.length) {
  20502. for (c = 0; c < d.length; c++) if (b < d[c].dist) {
  20503. d.splice(c, 0, {uid: +f, type: h, dist: b});
  20504. break
  20505. }
  20506. c == d.length && d.push({uid: +f, type: h, dist: b})
  20507. } else d.push({uid: +f, type: h, dist: b});
  20508. return "undefined" != typeof g ? d.slice(0, g) : d
  20509. }
  20510. }(), store: function (a,
  20511. d, b) {
  20512. this.locations[a] || (this.locations[a] = {});
  20513. this.locations[a][d] = b
  20514. }
  20515. };
  20516. var q = {
  20517. display: "block",
  20518. width: "0px",
  20519. height: "0px",
  20520. "border-color": "transparent",
  20521. "border-style": "solid",
  20522. position: "absolute",
  20523. top: "-6px"
  20524. }, t = {height: "0px", "border-top": "1px dashed red", position: "absolute", "z-index": 9999};
  20525. p.prototype = {
  20526. removeAll: function () {
  20527. for (var a in this.hidden) this.hidden[a].remove(), delete this.hidden[a];
  20528. for (a in this.visible) this.visible[a].remove(), delete this.visible[a]
  20529. }, hideLine: function (a) {
  20530. var d = a.getUniqueId();
  20531. a.hide();
  20532. this.hidden[d] = a;
  20533. delete this.visible[d]
  20534. }, showLine: function (a) {
  20535. var d = a.getUniqueId();
  20536. a.show();
  20537. this.visible[d] = a;
  20538. delete this.hidden[d]
  20539. }, hideVisible: function () {
  20540. for (var a in this.visible) this.hideLine(this.visible[a])
  20541. }, placeLine: function (a, d) {
  20542. var b, c, e;
  20543. if (b = this.getStyle(a.uid, a.type)) {
  20544. for (e in this.visible) if (this.visible[e].getCustomData("hash") !== this.hash) {
  20545. c = this.visible[e];
  20546. break
  20547. }
  20548. if (!c) for (e in this.hidden) if (this.hidden[e].getCustomData("hash") !== this.hash) {
  20549. this.showLine(c = this.hidden[e]);
  20550. break
  20551. }
  20552. c || this.showLine(c = this.addLine());
  20553. c.setCustomData("hash", this.hash);
  20554. this.visible[c.getUniqueId()] = c;
  20555. c.setStyles(b);
  20556. d && d(c)
  20557. }
  20558. }, getStyle: function (a, d) {
  20559. var b = this.relations[a], c = this.locations[a][d], e = {};
  20560. e.width = b.siblingRect ? Math.max(b.siblingRect.width, b.elementRect.width) : b.elementRect.width;
  20561. e.top = this.inline ? c + this.winTopScroll.y - this.rect.relativeY : this.rect.top + this.winTopScroll.y + c;
  20562. if (e.top - this.winTopScroll.y < this.rect.top || e.top - this.winTopScroll.y > this.rect.bottom) return !1;
  20563. this.inline ?
  20564. e.left = b.elementRect.left - this.rect.relativeX : (0 < b.elementRect.left ? e.left = this.rect.left + b.elementRect.left : (e.width += b.elementRect.left, e.left = this.rect.left), 0 < (b = e.left + e.width - (this.rect.left + this.winPane.width)) && (e.width -= b));
  20565. e.left += this.winTopScroll.x;
  20566. for (var g in e) e[g] = CKEDITOR.tools.cssLength(e[g]);
  20567. return e
  20568. }, addLine: function () {
  20569. var a = CKEDITOR.dom.element.createFromHtml(this.lineTpl);
  20570. a.appendTo(this.container);
  20571. return a
  20572. }, prepare: function (a, d) {
  20573. this.relations = a;
  20574. this.locations = d;
  20575. this.hash = Math.random()
  20576. },
  20577. cleanup: function () {
  20578. var a, d;
  20579. for (d in this.visible) a = this.visible[d], a.getCustomData("hash") !== this.hash && this.hideLine(a)
  20580. }, queryViewport: function () {
  20581. this.winPane = this.win.getViewPaneSize();
  20582. this.winTopScroll = this.winTop.getScrollPosition();
  20583. this.winTopPane = this.winTop.getViewPaneSize();
  20584. this.rect = this.getClientRect(this.inline ? this.editable : this.frame)
  20585. }, getClientRect: function (a) {
  20586. a = a.getClientRect();
  20587. var d = this.container.getDocumentPosition(), b = this.container.getComputedStyle("position");
  20588. a.relativeX = a.relativeY =
  20589. 0;
  20590. "static" != b && (a.relativeY = d.y, a.relativeX = d.x, a.top -= a.relativeY, a.bottom -= a.relativeY, a.left -= a.relativeX, a.right -= a.relativeX);
  20591. return a
  20592. }
  20593. };
  20594. var r = {left: 1, right: 1, center: 1}, u = {absolute: 1, fixed: 1};
  20595. CKEDITOR.plugins.lineutils = {finder: m, locator: n, liner: p}
  20596. })();
  20597. (function () {
  20598. function e(a) {
  20599. return a.getName && !a.hasAttribute("data-cke-temp")
  20600. }
  20601. CKEDITOR.plugins.add("widgetselection", {
  20602. init: function (a) {
  20603. if (CKEDITOR.env.webkit) {
  20604. var b = CKEDITOR.plugins.widgetselection;
  20605. a.on("contentDom", function (a) {
  20606. a = a.editor;
  20607. var c = a.editable();
  20608. c.attachListener(c, "keydown", function (a) {
  20609. a.data.getKeystroke() == CKEDITOR.CTRL + 65 && CKEDITOR.tools.setTimeout(function () {
  20610. b.addFillers(c) || b.removeFillers(c)
  20611. }, 0)
  20612. }, null, null, -1);
  20613. a.on("selectionCheck", function (a) {
  20614. b.removeFillers(a.editor.editable())
  20615. });
  20616. a.on("paste", function (a) {
  20617. a.data.dataValue = b.cleanPasteData(a.data.dataValue)
  20618. });
  20619. "selectall" in a.plugins && b.addSelectAllIntegration(a)
  20620. })
  20621. }
  20622. }
  20623. });
  20624. CKEDITOR.plugins.widgetselection = {
  20625. startFiller: null,
  20626. endFiller: null,
  20627. fillerAttribute: "data-cke-filler-webkit",
  20628. fillerContent: "\x26nbsp;",
  20629. fillerTagName: "div",
  20630. addFillers: function (a) {
  20631. var b = a.editor;
  20632. if (!this.isWholeContentSelected(a) && 0 < a.getChildCount()) {
  20633. var d = a.getFirst(e), c = a.getLast(e);
  20634. d && d.type == CKEDITOR.NODE_ELEMENT && !d.isEditable() && (this.startFiller = this.createFiller(),
  20635. a.append(this.startFiller, 1));
  20636. c && c.type == CKEDITOR.NODE_ELEMENT && !c.isEditable() && (this.endFiller = this.createFiller(!0), a.append(this.endFiller, 0));
  20637. if (this.hasFiller(a)) return b = b.createRange(), b.selectNodeContents(a), b.select(), !0
  20638. }
  20639. return !1
  20640. },
  20641. removeFillers: function (a) {
  20642. if (this.hasFiller(a) && !this.isWholeContentSelected(a)) {
  20643. var b = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dstart]"),
  20644. d = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dend]");
  20645. this.startFiller && b && this.startFiller.equals(b) ?
  20646. this.removeFiller(this.startFiller, a) : this.startFiller = b;
  20647. this.endFiller && d && this.endFiller.equals(d) ? this.removeFiller(this.endFiller, a) : this.endFiller = d
  20648. }
  20649. },
  20650. cleanPasteData: function (a) {
  20651. a && a.length && (a = a.replace(this.createFillerRegex(), "").replace(this.createFillerRegex(!0), ""));
  20652. return a
  20653. },
  20654. isWholeContentSelected: function (a) {
  20655. var b = a.editor.getSelection().getRanges()[0];
  20656. return !b || b && b.collapsed ? !1 : (b = b.clone(), b.enlarge(CKEDITOR.ENLARGE_ELEMENT), !!(b && a && b.startContainer && b.endContainer && 0 === b.startOffset &&
  20657. b.endOffset === a.getChildCount() && b.startContainer.equals(a) && b.endContainer.equals(a)))
  20658. },
  20659. hasFiller: function (a) {
  20660. return 0 < a.find(this.fillerTagName + "[" + this.fillerAttribute + "]").count()
  20661. },
  20662. createFiller: function (a) {
  20663. var b = new CKEDITOR.dom.element(this.fillerTagName);
  20664. b.setHtml(this.fillerContent);
  20665. b.setAttribute(this.fillerAttribute, a ? "end" : "start");
  20666. b.setAttribute("data-cke-temp", 1);
  20667. b.setStyles({
  20668. display: "block",
  20669. width: 0,
  20670. height: 0,
  20671. padding: 0,
  20672. border: 0,
  20673. margin: 0,
  20674. position: "absolute",
  20675. top: 0,
  20676. left: "-9999px",
  20677. opacity: 0,
  20678. overflow: "hidden"
  20679. });
  20680. return b
  20681. },
  20682. removeFiller: function (a, b) {
  20683. if (a) {
  20684. var d = b.editor, c = b.editor.getSelection().getRanges()[0].startPath(), f = d.createRange(), g, e;
  20685. c.contains(a) && (g = a.getHtml(), e = !0);
  20686. c = "start" == a.getAttribute(this.fillerAttribute);
  20687. a.remove();
  20688. g && 0 < g.length && g != this.fillerContent ? (b.insertHtmlIntoRange(g, d.getSelection().getRanges()[0]), f.setStartAt(b.getChild(b.getChildCount() - 1), CKEDITOR.POSITION_BEFORE_END), d.getSelection().selectRanges([f])) : e && (c ? f.setStartAt(b.getFirst().getNext(), CKEDITOR.POSITION_AFTER_START) :
  20689. f.setEndAt(b.getLast().getPrevious(), CKEDITOR.POSITION_BEFORE_END), b.editor.getSelection().selectRanges([f]))
  20690. }
  20691. },
  20692. createFillerRegex: function (a) {
  20693. var b = this.createFiller(a).getOuterHtml().replace(/style="[^"]*"/gi, 'style\x3d"[^"]*"').replace(/>[^<]*</gi, "\x3e[^\x3c]*\x3c");
  20694. return new RegExp((a ? "" : "^") + b + (a ? "$" : ""))
  20695. },
  20696. addSelectAllIntegration: function (a) {
  20697. var b = this;
  20698. a.editable().attachListener(a, "beforeCommandExec", function (d) {
  20699. var c = a.editable();
  20700. "selectAll" == d.data.name && c && b.addFillers(c)
  20701. }, null, null, 9999)
  20702. }
  20703. }
  20704. })();
  20705. (function () {
  20706. function q(a) {
  20707. this.editor = a;
  20708. this.registered = {};
  20709. this.instances = {};
  20710. this.selected = [];
  20711. this.widgetHoldingFocusedEditable = this.focused = null;
  20712. this._ = {nextId: 0, upcasts: [], upcastCallbacks: [], filters: {}};
  20713. M(this);
  20714. N(this);
  20715. this.on("checkWidgets", O);
  20716. this.editor.on("contentDomInvalidated", this.checkWidgets, this);
  20717. P(this);
  20718. Q(this);
  20719. R(this);
  20720. S(this);
  20721. T(this)
  20722. }
  20723. function g(a, b, c, d, e) {
  20724. var f = a.editor;
  20725. CKEDITOR.tools.extend(this, d, {
  20726. editor: f,
  20727. id: b,
  20728. inline: "span" == c.getParent().getName(),
  20729. element: c,
  20730. data: CKEDITOR.tools.extend({},
  20731. "function" == typeof d.defaults ? d.defaults() : d.defaults),
  20732. dataReady: !1,
  20733. inited: !1,
  20734. ready: !1,
  20735. edit: g.prototype.edit,
  20736. focusedEditable: null,
  20737. definition: d,
  20738. repository: a,
  20739. draggable: !1 !== d.draggable,
  20740. _: {downcastFn: d.downcast && "string" == typeof d.downcast ? d.downcasts[d.downcast] : d.downcast}
  20741. }, !0);
  20742. a.fire("instanceCreated", this);
  20743. U(this, d);
  20744. this.init && this.init();
  20745. this.inited = !0;
  20746. (a = this.element.data("cke-widget-data")) && this.setData(JSON.parse(decodeURIComponent(a)));
  20747. e && this.setData(e);
  20748. this.data.classes || this.setData("classes",
  20749. this.getClasses());
  20750. this.dataReady = !0;
  20751. u(this);
  20752. this.fire("data", this.data);
  20753. this.isInited() && f.editable().contains(this.wrapper) && (this.ready = !0, this.fire("ready"))
  20754. }
  20755. function t(a, b, c) {
  20756. CKEDITOR.dom.element.call(this, b.$);
  20757. this.editor = a;
  20758. this._ = {};
  20759. b = this.filter = c.filter;
  20760. CKEDITOR.dtd[this.getName()].p ? (this.enterMode = b ? b.getAllowedEnterMode(a.enterMode) : a.enterMode, this.shiftEnterMode = b ? b.getAllowedEnterMode(a.shiftEnterMode, !0) : a.shiftEnterMode) : this.enterMode = this.shiftEnterMode = CKEDITOR.ENTER_BR
  20761. }
  20762. function V(a,
  20763. b) {
  20764. a.addCommand(b.name, {
  20765. exec: function (a, d) {
  20766. function e() {
  20767. a.widgets.finalizeCreation(k)
  20768. }
  20769. var f = a.widgets.focused;
  20770. if (f && f.name == b.name) f.edit(); else if (b.insert) b.insert({
  20771. editor: a,
  20772. commandData: d
  20773. }); else if (b.template) {
  20774. var f = "function" == typeof b.defaults ? b.defaults() : b.defaults,
  20775. f = CKEDITOR.dom.element.createFromHtml(b.template.output(f)), h,
  20776. l = a.widgets.wrapElement(f, b.name),
  20777. k = new CKEDITOR.dom.documentFragment(l.getDocument());
  20778. k.append(l);
  20779. (h = a.widgets.initOn(f, b, d && d.startupData)) ? (f = h.once("edit", function (b) {
  20780. if (b.data.dialog) h.once("dialog",
  20781. function (b) {
  20782. b = b.data;
  20783. var d, f;
  20784. d = b.once("ok", e, null, null, 20);
  20785. f = b.once("cancel", function (b) {
  20786. b.data && !1 === b.data.hide || a.widgets.destroy(h, !0)
  20787. });
  20788. b.once("hide", function () {
  20789. d.removeListener();
  20790. f.removeListener()
  20791. })
  20792. }); else e()
  20793. }, null, null, 999), h.edit(), f.removeListener()) : e()
  20794. }
  20795. },
  20796. allowedContent: b.allowedContent,
  20797. requiredContent: b.requiredContent,
  20798. contentForms: b.contentForms,
  20799. contentTransformations: b.contentTransformations
  20800. })
  20801. }
  20802. function W(a, b) {
  20803. function c(a, c) {
  20804. var e = b.upcast.split(","), d, f;
  20805. for (f = 0; f < e.length; f++) if (d =
  20806. e[f], d === a.name) return b.upcasts[d].call(this, a, c);
  20807. return !1
  20808. }
  20809. function d(b, c, e) {
  20810. var d = CKEDITOR.tools.getIndex(a._.upcasts, function (a) {
  20811. return a[2] > e
  20812. });
  20813. 0 > d && (d = a._.upcasts.length);
  20814. a._.upcasts.splice(d, 0, [CKEDITOR.tools.bind(b, c), c.name, e])
  20815. }
  20816. var e = b.upcast, f = b.upcastPriority || 10;
  20817. e && ("string" == typeof e ? d(c, b, f) : d(e, b, f))
  20818. }
  20819. function w(a, b) {
  20820. a.focused = null;
  20821. if (b.isInited()) {
  20822. var c = b.editor.checkDirty();
  20823. a.fire("widgetBlurred", {widget: b});
  20824. b.setFocused(!1);
  20825. !c && b.editor.resetDirty()
  20826. }
  20827. }
  20828. function O(a) {
  20829. a = a.data;
  20830. if ("wysiwyg" ==
  20831. this.editor.mode) {
  20832. var b = this.editor.editable(), c = this.instances, d, e, f, h;
  20833. if (b) {
  20834. for (d in c) c[d].isReady() && !b.contains(c[d].wrapper) && this.destroy(c[d], !0);
  20835. if (a && a.initOnlyNew) c = this.initOnAll(); else {
  20836. var l = b.find(".cke_widget_wrapper"), c = [];
  20837. d = 0;
  20838. for (e = l.count(); d < e; d++) {
  20839. f = l.getItem(d);
  20840. if (h = !this.getByElement(f, !0)) {
  20841. a:{
  20842. h = X;
  20843. for (var k = f; k = k.getParent();) if (h(k)) {
  20844. h = !0;
  20845. break a
  20846. }
  20847. h = !1
  20848. }
  20849. h = !h
  20850. }
  20851. h && b.contains(f) && (f.addClass("cke_widget_new"), c.push(this.initOn(f.getFirst(g.isDomWidgetElement))))
  20852. }
  20853. }
  20854. a && a.focusInited &&
  20855. 1 == c.length && c[0].focus()
  20856. }
  20857. }
  20858. }
  20859. function x(a) {
  20860. if ("undefined" != typeof a.attributes && a.attributes["data-widget"]) {
  20861. var b = y(a), c = z(a), d = !1;
  20862. b && b.value && b.value.match(/^\s/g) && (b.parent.attributes["data-cke-white-space-first"] = 1, b.value = b.value.replace(/^\s/g, "\x26nbsp;"), d = !0);
  20863. c && c.value && c.value.match(/\s$/g) && (c.parent.attributes["data-cke-white-space-last"] = 1, c.value = c.value.replace(/\s$/g, "\x26nbsp;"), d = !0);
  20864. d && (a.attributes["data-cke-widget-white-space"] = 1)
  20865. }
  20866. }
  20867. function y(a) {
  20868. return a.find(function (a) {
  20869. return 3 ===
  20870. a.type
  20871. }, !0).shift()
  20872. }
  20873. function z(a) {
  20874. return a.find(function (a) {
  20875. return 3 === a.type
  20876. }, !0).pop()
  20877. }
  20878. function A(a, b, c) {
  20879. if (!c.allowedContent && !c.disallowedContent) return null;
  20880. var d = this._.filters[a];
  20881. d || (this._.filters[a] = d = {});
  20882. a = d[b];
  20883. a || (a = c.allowedContent ? new CKEDITOR.filter(c.allowedContent) : this.editor.filter.clone(), d[b] = a, c.disallowedContent && a.disallow(c.disallowedContent));
  20884. return a
  20885. }
  20886. function Y(a) {
  20887. var b = [], c = a._.upcasts, d = a._.upcastCallbacks;
  20888. return {
  20889. toBeWrapped: b, iterator: function (a) {
  20890. var f, h, l, k, m;
  20891. if ("data-cke-widget-wrapper" in
  20892. a.attributes) return (a = a.getFirst(g.isParserWidgetElement)) && b.push([a]), !1;
  20893. if ("data-widget" in a.attributes) return b.push([a]), !1;
  20894. if (m = c.length) {
  20895. if (a.attributes["data-cke-widget-upcasted"]) return !1;
  20896. k = 0;
  20897. for (f = d.length; k < f; ++k) if (!1 === d[k](a)) return;
  20898. for (k = 0; k < m; ++k) if (f = c[k], l = {}, h = f[0](a, l)) return h instanceof CKEDITOR.htmlParser.element && (a = h), a.attributes["data-cke-widget-data"] = encodeURIComponent(JSON.stringify(l)), a.attributes["data-cke-widget-upcasted"] = 1, b.push([a, f[1]]), !1
  20899. }
  20900. }
  20901. }
  20902. }
  20903. function B(a, b) {
  20904. return {
  20905. tabindex: -1,
  20906. contenteditable: "false",
  20907. "data-cke-widget-wrapper": 1,
  20908. "data-cke-filter": "off",
  20909. "class": "cke_widget_wrapper cke_widget_new cke_widget_" + (a ? "inline" : "block") + (b ? " cke_widget_" + b : "")
  20910. }
  20911. }
  20912. function C(a, b, c) {
  20913. if (a.type == CKEDITOR.NODE_ELEMENT) {
  20914. var d = CKEDITOR.dtd[a.name];
  20915. if (d && !d[c.name]) {
  20916. var d = a.split(b), e = a.parent;
  20917. b = d.getIndex();
  20918. a.children.length || (--b, a.remove());
  20919. d.children.length || d.remove();
  20920. return C(e, b, c)
  20921. }
  20922. }
  20923. a.add(c, b)
  20924. }
  20925. function D(a, b) {
  20926. return "boolean" == typeof a.inline ? a.inline : !!CKEDITOR.dtd.$inline[b]
  20927. }
  20928. function X(a) {
  20929. return a.hasAttribute("data-cke-temp")
  20930. }
  20931. function p(a, b, c, d) {
  20932. var e = a.editor;
  20933. e.fire("lockSnapshot");
  20934. c ? (d = c.data("cke-widget-editable"), d = b.editables[d], a.widgetHoldingFocusedEditable = b, b.focusedEditable = d, c.addClass("cke_widget_editable_focused"), d.filter && e.setActiveFilter(d.filter), e.setActiveEnterMode(d.enterMode, d.shiftEnterMode)) : (d || b.focusedEditable.removeClass("cke_widget_editable_focused"), b.focusedEditable = null, a.widgetHoldingFocusedEditable = null, e.setActiveFilter(null), e.setActiveEnterMode(null, null));
  20935. e.fire("unlockSnapshot")
  20936. }
  20937. function Z(a) {
  20938. a.contextMenu && a.contextMenu.addListener(function (b) {
  20939. if (b = a.widgets.getByElement(b, !0)) return b.fire("contextMenu", {})
  20940. })
  20941. }
  20942. function aa(a, b) {
  20943. return CKEDITOR.tools.trim(b)
  20944. }
  20945. function S(a) {
  20946. var b = a.editor, c = CKEDITOR.plugins.lineutils;
  20947. b.on("dragstart", function (c) {
  20948. var e = c.data.target;
  20949. g.isDomDragHandler(e) && (e = a.getByElement(e), c.data.dataTransfer.setData("cke/widget-id", e.id), b.focus(), e.focus())
  20950. });
  20951. b.on("drop", function (c) {
  20952. var e = c.data.dataTransfer, f = e.getData("cke/widget-id"), h = e.getTransferType(b),
  20953. e = b.createRange();
  20954. "" !== f && h === CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c.cancel() : "" !== f && h == CKEDITOR.DATA_TRANSFER_INTERNAL && (f = a.instances[f]) && (e.setStartBefore(f.wrapper), e.setEndAfter(f.wrapper), c.data.dragRange = e, delete CKEDITOR.plugins.clipboard.dragStartContainerChildCount, delete CKEDITOR.plugins.clipboard.dragEndContainerChildCount, c.data.dataTransfer.setData("text/html", b.editable().getHtmlFromRange(e).getHtml()), b.widgets.destroy(f, !0))
  20955. });
  20956. b.on("contentDom", function () {
  20957. var d = b.editable();
  20958. CKEDITOR.tools.extend(a,
  20959. {
  20960. finder: new c.finder(b, {
  20961. lookups: {
  20962. "default": function (b) {
  20963. if (!b.is(CKEDITOR.dtd.$listItem) && b.is(CKEDITOR.dtd.$block) && !g.isDomNestedEditable(b) && !a._.draggedWidget.wrapper.contains(b)) {
  20964. var c = g.getNestedEditable(d, b);
  20965. if (c) {
  20966. b = a._.draggedWidget;
  20967. if (a.getByElement(c) == b) return;
  20968. c = CKEDITOR.filter.instances[c.data("cke-filter")];
  20969. b = b.requiredContent;
  20970. if (c && b && !c.check(b)) return
  20971. }
  20972. return CKEDITOR.LINEUTILS_BEFORE | CKEDITOR.LINEUTILS_AFTER
  20973. }
  20974. }
  20975. }
  20976. }), locator: new c.locator(b), liner: new c.liner(b, {
  20977. lineStyle: {
  20978. cursor: "move !important",
  20979. "border-top-color": "#666"
  20980. },
  20981. tipLeftStyle: {"border-left-color": "#666"},
  20982. tipRightStyle: {"border-right-color": "#666"}
  20983. })
  20984. }, !0)
  20985. })
  20986. }
  20987. function Q(a) {
  20988. var b = a.editor;
  20989. b.on("contentDom", function () {
  20990. var c = b.editable(), d = c.isInline() ? c : b.document, e, f;
  20991. c.attachListener(d, "mousedown", function (c) {
  20992. var d = c.data.getTarget();
  20993. e = d instanceof CKEDITOR.dom.element ? a.getByElement(d) : null;
  20994. f = 0;
  20995. e && (e.inline && d.type == CKEDITOR.NODE_ELEMENT && d.hasAttribute("data-cke-widget-drag-handler") ? (f = 1, a.focused != e && b.getSelection().removeAllRanges()) :
  20996. g.getNestedEditable(e.wrapper, d) ? e = null : (c.data.preventDefault(), CKEDITOR.env.ie || e.focus()))
  20997. });
  20998. c.attachListener(d, "mouseup", function () {
  20999. f && e && e.wrapper && (f = 0, e.focus())
  21000. });
  21001. CKEDITOR.env.ie && c.attachListener(d, "mouseup", function () {
  21002. setTimeout(function () {
  21003. e && e.wrapper && c.contains(e.wrapper) && (e.focus(), e = null)
  21004. })
  21005. })
  21006. });
  21007. b.on("doubleclick", function (b) {
  21008. var d = a.getByElement(b.data.element);
  21009. if (d && !g.getNestedEditable(d.wrapper, b.data.element)) return d.fire("doubleclick", {element: b.data.element})
  21010. }, null, null, 1)
  21011. }
  21012. function R(a) {
  21013. a.editor.on("key", function (b) {
  21014. var c = a.focused, d = a.widgetHoldingFocusedEditable, e;
  21015. c ? e = c.fire("key", {keyCode: b.data.keyCode}) : d && (c = b.data.keyCode, b = d.focusedEditable, c == CKEDITOR.CTRL + 65 ? (c = b.getBogus(), d = d.editor.createRange(), d.selectNodeContents(b), c && d.setEndAt(c, CKEDITOR.POSITION_BEFORE_START), d.select(), e = !1) : 8 == c || 46 == c ? (e = d.editor.getSelection().getRanges(), d = e[0], e = !(1 == e.length && d.collapsed && d.checkBoundaryOfElement(b, CKEDITOR[8 == c ? "START" : "END"]))) : e = void 0);
  21016. return e
  21017. }, null,
  21018. null, 1)
  21019. }
  21020. function T(a) {
  21021. function b(b) {
  21022. a.focused && E(a.focused, "cut" == b.name)
  21023. }
  21024. var c = a.editor;
  21025. c.on("contentDom", function () {
  21026. var a = c.editable();
  21027. a.attachListener(a, "copy", b);
  21028. a.attachListener(a, "cut", b)
  21029. })
  21030. }
  21031. function P(a) {
  21032. var b = a.editor;
  21033. b.on("selectionCheck", function () {
  21034. a.fire("checkSelection")
  21035. });
  21036. a.on("checkSelection", a.checkSelection, a);
  21037. b.on("selectionChange", function (c) {
  21038. var d = (c = g.getNestedEditable(b.editable(), c.data.selection.getStartElement())) && a.getByElement(c),
  21039. e = a.widgetHoldingFocusedEditable;
  21040. e ? e === d &&
  21041. e.focusedEditable.equals(c) || (p(a, e, null), d && c && p(a, d, c)) : d && c && p(a, d, c)
  21042. });
  21043. b.on("dataReady", function () {
  21044. F(a).commit()
  21045. });
  21046. b.on("blur", function () {
  21047. var b;
  21048. (b = a.focused) && w(a, b);
  21049. (b = a.widgetHoldingFocusedEditable) && p(a, b, null)
  21050. })
  21051. }
  21052. function N(a) {
  21053. var b = a.editor, c = {};
  21054. b.on("toDataFormat", function (b) {
  21055. var e = CKEDITOR.tools.getNextNumber(), f = [];
  21056. b.data.downcastingSessionId = e;
  21057. c[e] = f;
  21058. b.data.dataValue.forEach(function (b) {
  21059. var c = b.attributes, e;
  21060. if ("data-cke-widget-white-space" in c) {
  21061. e = y(b);
  21062. var d = z(b);
  21063. e.parent.attributes["data-cke-white-space-first"] &&
  21064. (e.value = e.value.replace(/^&nbsp;/g, " "));
  21065. d.parent.attributes["data-cke-white-space-last"] && (d.value = d.value.replace(/&nbsp;$/g, " "))
  21066. }
  21067. if ("data-cke-widget-id" in c) {
  21068. if (c = a.instances[c["data-cke-widget-id"]]) e = b.getFirst(g.isParserWidgetElement), f.push({
  21069. wrapper: b,
  21070. element: e,
  21071. widget: c,
  21072. editables: {}
  21073. }), "1" != e.attributes["data-cke-widget-keep-attr"] && delete e.attributes["data-widget"]
  21074. } else if ("data-cke-widget-editable" in c) return f[f.length - 1].editables[c["data-cke-widget-editable"]] = b, !1
  21075. }, CKEDITOR.NODE_ELEMENT,
  21076. !0)
  21077. }, null, null, 8);
  21078. b.on("toDataFormat", function (a) {
  21079. if (a.data.downcastingSessionId) {
  21080. a = c[a.data.downcastingSessionId];
  21081. for (var b, f, h, l, k, g; b = a.shift();) {
  21082. f = b.widget;
  21083. h = b.element;
  21084. l = f._.downcastFn && f._.downcastFn.call(f, h);
  21085. for (g in b.editables) k = b.editables[g], delete k.attributes.contenteditable, k.setHtml(f.editables[g].getData());
  21086. l || (l = h);
  21087. b.wrapper.replaceWith(l)
  21088. }
  21089. }
  21090. }, null, null, 13);
  21091. b.on("contentDomUnload", function () {
  21092. a.destroyAll(!0)
  21093. })
  21094. }
  21095. function M(a) {
  21096. var b = a.editor, c, d;
  21097. b.on("toHtml", function (b) {
  21098. var d = Y(a), h;
  21099. for (b.data.dataValue.forEach(d.iterator, CKEDITOR.NODE_ELEMENT, !0); h = d.toBeWrapped.pop();) {
  21100. var l = h[0], k = l.parent;
  21101. k.type == CKEDITOR.NODE_ELEMENT && k.attributes["data-cke-widget-wrapper"] && k.replaceWith(l);
  21102. a.wrapElement(h[0], h[1])
  21103. }
  21104. c = b.data.protectedWhitespaces ? 3 == b.data.dataValue.children.length && g.isParserWidgetWrapper(b.data.dataValue.children[1]) : 1 == b.data.dataValue.children.length && g.isParserWidgetWrapper(b.data.dataValue.children[0])
  21105. }, null, null, 8);
  21106. b.on("dataReady", function () {
  21107. if (d) for (var c = b.editable().find(".cke_widget_wrapper"),
  21108. f, h, l = 0, k = c.count(); l < k; ++l) f = c.getItem(l), h = f.getFirst(g.isDomWidgetElement), h.type == CKEDITOR.NODE_ELEMENT && h.data("widget") ? (h.replace(f), a.wrapElement(h)) : f.remove();
  21109. d = 0;
  21110. a.destroyAll(!0);
  21111. a.initOnAll()
  21112. });
  21113. b.on("loadSnapshot", function (b) {
  21114. /data-cke-widget/.test(b.data) && (d = 1);
  21115. a.destroyAll(!0)
  21116. }, null, null, 9);
  21117. b.on("paste", function (a) {
  21118. a = a.data;
  21119. a.dataValue = a.dataValue.replace(ba, aa);
  21120. a.range && (a = g.getNestedEditable(b.editable(), a.range.startContainer)) && (a = CKEDITOR.filter.instances[a.data("cke-filter")]) &&
  21121. b.setActiveFilter(a)
  21122. });
  21123. b.on("afterInsertHtml", function (d) {
  21124. d.data.intoRange ? a.checkWidgets({initOnlyNew: !0}) : (b.fire("lockSnapshot"), a.checkWidgets({
  21125. initOnlyNew: !0,
  21126. focusInited: c
  21127. }), b.fire("unlockSnapshot"))
  21128. })
  21129. }
  21130. function F(a) {
  21131. var b = a.selected, c = [], d = b.slice(0), e = null;
  21132. return {
  21133. select: function (a) {
  21134. 0 > CKEDITOR.tools.indexOf(b, a) && c.push(a);
  21135. a = CKEDITOR.tools.indexOf(d, a);
  21136. 0 <= a && d.splice(a, 1);
  21137. return this
  21138. }, focus: function (a) {
  21139. e = a;
  21140. return this
  21141. }, commit: function () {
  21142. var f = a.focused !== e, h, l;
  21143. a.editor.fire("lockSnapshot");
  21144. for (f &&
  21145. (h = a.focused) && w(a, h); h = d.pop();) b.splice(CKEDITOR.tools.indexOf(b, h), 1), h.isInited() && (l = h.editor.checkDirty(), h.setSelected(!1), !l && h.editor.resetDirty());
  21146. f && e && (l = a.editor.checkDirty(), a.focused = e, a.fire("widgetFocused", {widget: e}), e.setFocused(!0), !l && a.editor.resetDirty());
  21147. for (; h = c.pop();) b.push(h), h.setSelected(!0);
  21148. a.editor.fire("unlockSnapshot")
  21149. }
  21150. }
  21151. }
  21152. function G(a, b, c) {
  21153. var d = 0;
  21154. b = H(b);
  21155. var e = a.data.classes || {}, f;
  21156. if (b) {
  21157. for (e = CKEDITOR.tools.clone(e); f = b.pop();) c ? e[f] || (d = e[f] = 1) : e[f] && (delete e[f],
  21158. d = 1);
  21159. d && a.setData("classes", e)
  21160. }
  21161. }
  21162. function I(a) {
  21163. a.cancel()
  21164. }
  21165. function E(a, b) {
  21166. var c = a.editor, d = c.document, e = CKEDITOR.env.edge && 16 <= CKEDITOR.env.version;
  21167. if (!d.getById("cke_copybin")) {
  21168. var f = !c.blockless && !CKEDITOR.env.ie || e ? "div" : "span", e = d.createElement(f),
  21169. h = d.createElement(f), f = CKEDITOR.env.ie && 9 > CKEDITOR.env.version;
  21170. h.setAttributes({id: "cke_copybin", "data-cke-temp": "1"});
  21171. e.setStyles({position: "absolute", width: "1px", height: "1px", overflow: "hidden"});
  21172. e.setStyle("ltr" == c.config.contentsLangDirection ? "left" :
  21173. "right", "-5000px");
  21174. var l = c.createRange();
  21175. l.setStartBefore(a.wrapper);
  21176. l.setEndAfter(a.wrapper);
  21177. e.setHtml('\x3cspan data-cke-copybin-start\x3d"1"\x3e​\x3c/span\x3e' + c.editable().getHtmlFromRange(l).getHtml() + '\x3cspan data-cke-copybin-end\x3d"1"\x3e​\x3c/span\x3e');
  21178. c.fire("saveSnapshot");
  21179. c.fire("lockSnapshot");
  21180. h.append(e);
  21181. c.editable().append(h);
  21182. var g = c.on("selectionChange", I, null, null, 0),
  21183. m = a.repository.on("checkSelection", I, null, null, 0);
  21184. if (f) var n = d.getDocumentElement().$, r = n.scrollTop;
  21185. l = c.createRange();
  21186. l.selectNodeContents(e);
  21187. l.select();
  21188. f && (n.scrollTop = r);
  21189. setTimeout(function () {
  21190. b || a.focus();
  21191. h.remove();
  21192. g.removeListener();
  21193. m.removeListener();
  21194. c.fire("unlockSnapshot");
  21195. b && !c.readOnly && (a.repository.del(a), c.fire("saveSnapshot"))
  21196. }, 100)
  21197. }
  21198. }
  21199. function H(a) {
  21200. return (a = (a = a.getDefinition().attributes) && a["class"]) ? a.split(/\s+/) : null
  21201. }
  21202. function J() {
  21203. var a = CKEDITOR.document.getActive(), b = this.editor, c = b.editable();
  21204. (c.isInline() ? c : b.document.getWindow().getFrame()).equals(a) && b.focusManager.focus(c)
  21205. }
  21206. function K() {
  21207. CKEDITOR.env.gecko &&
  21208. this.editor.unlockSelection();
  21209. CKEDITOR.env.webkit || (this.editor.forceNextSelectionCheck(), this.editor.selectionChange(1))
  21210. }
  21211. function ca(a) {
  21212. var b = null;
  21213. a.on("data", function () {
  21214. var a = this.data.classes, d;
  21215. if (b != a) {
  21216. for (d in b) a && a[d] || this.removeClass(d);
  21217. for (d in a) this.addClass(d);
  21218. b = a
  21219. }
  21220. })
  21221. }
  21222. function da(a) {
  21223. a.on("data", function () {
  21224. if (a.wrapper) {
  21225. var b = this.getLabel ? this.getLabel() : this.editor.lang.widget.label.replace(/%1/, this.pathName || this.element.getName());
  21226. a.wrapper.setAttribute("role", "region");
  21227. a.wrapper.setAttribute("aria-label",
  21228. b)
  21229. }
  21230. }, null, null, 9999)
  21231. }
  21232. function ea(a) {
  21233. if (a.draggable) {
  21234. var b = a.editor, c = a.wrapper.getLast(g.isDomDragHandlerContainer), d;
  21235. c ? d = c.findOne("img") : (c = new CKEDITOR.dom.element("span", b.document), c.setAttributes({
  21236. "class": "cke_reset cke_widget_drag_handler_container",
  21237. style: "background:rgba(220,220,220,0.5);background-image:url(" + b.plugins.widget.path + "images/handle.png)"
  21238. }), d = new CKEDITOR.dom.element("img", b.document), d.setAttributes({
  21239. "class": "cke_reset cke_widget_drag_handler",
  21240. "data-cke-widget-drag-handler": "1",
  21241. src: CKEDITOR.tools.transparentImageData,
  21242. width: 15,
  21243. title: b.lang.widget.move,
  21244. height: 15,
  21245. role: "presentation"
  21246. }), a.inline && d.setAttribute("draggable", "true"), c.append(d), a.wrapper.append(c));
  21247. a.wrapper.on("dragover", function (a) {
  21248. a.data.preventDefault()
  21249. });
  21250. a.wrapper.on("mouseenter", a.updateDragHandlerPosition, a);
  21251. setTimeout(function () {
  21252. a.on("data", a.updateDragHandlerPosition, a)
  21253. }, 50);
  21254. if (!a.inline && (d.on("mousedown", fa, a), CKEDITOR.env.ie && 9 > CKEDITOR.env.version)) d.on("dragstart", function (a) {
  21255. a.data.preventDefault(!0)
  21256. });
  21257. a.dragHandlerContainer = c
  21258. }
  21259. }
  21260. function fa(a) {
  21261. function b() {
  21262. var b;
  21263. for (v.reset(); b = g.pop();) b.removeListener();
  21264. var c = k;
  21265. b = a.sender;
  21266. var d = this.repository.finder, e = this.repository.liner, f = this.editor, h = this.editor.editable();
  21267. CKEDITOR.tools.isEmpty(e.visible) || (c = d.getRange(c[0]), this.focus(), f.fire("drop", {
  21268. dropRange: c,
  21269. target: c.startContainer
  21270. }));
  21271. h.removeClass("cke_widget_dragging");
  21272. e.hideVisible();
  21273. f.fire("dragend", {target: b})
  21274. }
  21275. if (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT) {
  21276. var c = this.repository.finder,
  21277. d = this.repository.locator, e = this.repository.liner, f = this.editor, h = f.editable(), g = [],
  21278. k = [], m, n;
  21279. this.repository._.draggedWidget = this;
  21280. var r = c.greedySearch(), v = CKEDITOR.tools.eventsBuffer(50, function () {
  21281. m = d.locate(r);
  21282. k = d.sort(n, 1);
  21283. k.length && (e.prepare(r, m), e.placeLine(k[0]), e.cleanup())
  21284. });
  21285. h.addClass("cke_widget_dragging");
  21286. g.push(h.on("mousemove", function (a) {
  21287. n = a.data.$.clientY;
  21288. v.input()
  21289. }));
  21290. f.fire("dragstart", {target: a.sender});
  21291. g.push(f.document.once("mouseup", b, this));
  21292. h.isInline() || g.push(CKEDITOR.document.once("mouseup",
  21293. b, this))
  21294. }
  21295. }
  21296. function ga(a) {
  21297. var b, c, d = a.editables;
  21298. a.editables = {};
  21299. if (a.editables) for (b in d) c = d[b], a.initEditable(b, "string" == typeof c ? {selector: c} : c)
  21300. }
  21301. function ha(a) {
  21302. if (a.mask) {
  21303. var b = a.wrapper.findOne(".cke_widget_mask");
  21304. b || (b = new CKEDITOR.dom.element("img", a.editor.document), b.setAttributes({
  21305. src: CKEDITOR.tools.transparentImageData,
  21306. "class": "cke_reset cke_widget_mask"
  21307. }), a.wrapper.append(b));
  21308. a.mask = b
  21309. }
  21310. }
  21311. function ia(a) {
  21312. if (a.parts) {
  21313. var b = {}, c, d;
  21314. for (d in a.parts) c = a.wrapper.findOne(a.parts[d]), b[d] = c;
  21315. a.parts =
  21316. b
  21317. }
  21318. }
  21319. function U(a, b) {
  21320. ja(a);
  21321. ia(a);
  21322. ga(a);
  21323. ha(a);
  21324. ea(a);
  21325. ca(a);
  21326. da(a);
  21327. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version) a.wrapper.on("dragstart", function (b) {
  21328. var d = b.data.getTarget();
  21329. g.getNestedEditable(a, d) || a.inline && g.isDomDragHandler(d) || b.data.preventDefault()
  21330. });
  21331. a.wrapper.removeClass("cke_widget_new");
  21332. a.element.addClass("cke_widget_element");
  21333. a.on("key", function (b) {
  21334. b = b.data.keyCode;
  21335. if (13 == b) a.edit(); else {
  21336. if (b == CKEDITOR.CTRL + 67 || b == CKEDITOR.CTRL + 88) {
  21337. E(a, b == CKEDITOR.CTRL + 88);
  21338. return
  21339. }
  21340. if (b in L || CKEDITOR.CTRL & b || CKEDITOR.ALT &
  21341. b) return
  21342. }
  21343. return !1
  21344. }, null, null, 999);
  21345. a.on("doubleclick", function (b) {
  21346. a.edit() && b.cancel()
  21347. });
  21348. if (b.data) a.on("data", b.data);
  21349. if (b.edit) a.on("edit", b.edit)
  21350. }
  21351. function ja(a) {
  21352. (a.wrapper = a.element.getParent()).setAttribute("data-cke-widget-id", a.id)
  21353. }
  21354. function u(a) {
  21355. a.element.data("cke-widget-data", encodeURIComponent(JSON.stringify(a.data)))
  21356. }
  21357. function ka() {
  21358. function a() {
  21359. }
  21360. function b(a, b, c) {
  21361. return c && this.checkElement(a) ? (a = c.widgets.getByElement(a, !0)) && a.checkStyleActive(this) : !1
  21362. }
  21363. function c(a) {
  21364. function b(a, c, d) {
  21365. for (var e =
  21366. a.length, f = 0; f < e;) {
  21367. if (c.call(d, a[f], f, a)) return a[f];
  21368. f++
  21369. }
  21370. }
  21371. function c(a) {
  21372. function b(a, c) {
  21373. var d = CKEDITOR.tools.objectKeys(a), e = CKEDITOR.tools.objectKeys(c);
  21374. if (d.length !== e.length) return !1;
  21375. for (var f in a) if (("object" !== typeof a[f] || "object" !== typeof c[f] || !b(a[f], c[f])) && a[f] !== c[f]) return !1;
  21376. return !0
  21377. }
  21378. return function (c) {
  21379. return b(a.getDefinition(), c.getDefinition())
  21380. }
  21381. }
  21382. var g = a.widget, k;
  21383. d[g] || (d[g] = {});
  21384. for (var m = 0, n = a.group.length; m < n; m++) k = a.group[m], d[g][k] || (d[g][k] = []), k = d[g][k], b(k, c(a)) || k.push(a)
  21385. }
  21386. var d = {};
  21387. CKEDITOR.style.addCustomHandler({
  21388. type: "widget", setup: function (a) {
  21389. this.widget = a.widget;
  21390. (this.group = "string" == typeof a.group ? [a.group] : a.group) && c(this)
  21391. }, apply: function (a) {
  21392. var b;
  21393. a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(), a) && (b = a.widgets.focused, this.group && this.removeStylesFromSameGroup(a), b.applyStyle(this))
  21394. }, remove: function (a) {
  21395. a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(), a) && a.widgets.focused.removeStyle(this)
  21396. }, removeStylesFromSameGroup: function (a) {
  21397. var b,
  21398. c, g = !1;
  21399. if (!(a instanceof CKEDITOR.editor)) return !1;
  21400. c = a.elementPath();
  21401. if (this.checkApplicable(c, a)) for (var k = 0, m = this.group.length; k < m; k++) {
  21402. b = d[this.widget][this.group[k]];
  21403. for (var n = 0; n < b.length; n++) b[n] !== this && b[n].checkActive(c, a) && (a.widgets.focused.removeStyle(b[n]), g = !0)
  21404. }
  21405. return g
  21406. }, checkActive: function (a, b) {
  21407. return this.checkElementMatch(a.lastElement, 0, b)
  21408. }, checkApplicable: function (a, b) {
  21409. return b instanceof CKEDITOR.editor ? this.checkElement(a.lastElement) : !1
  21410. }, checkElementMatch: b, checkElementRemovable: b,
  21411. checkElement: function (a) {
  21412. return g.isDomWidgetWrapper(a) ? (a = a.getFirst(g.isDomWidgetElement)) && a.data("widget") == this.widget : !1
  21413. }, buildPreview: function (a) {
  21414. return a || this._.definition.name
  21415. }, toAllowedContentRules: function (a) {
  21416. if (!a) return null;
  21417. a = a.widgets.registered[this.widget];
  21418. var b, c = {};
  21419. if (!a) return null;
  21420. if (a.styleableElements) {
  21421. b = this.getClassesArray();
  21422. if (!b) return null;
  21423. c[a.styleableElements] = {classes: b, propertiesOnly: !0};
  21424. return c
  21425. }
  21426. return a.styleToAllowedContentRules ? a.styleToAllowedContentRules(this) :
  21427. null
  21428. }, getClassesArray: function () {
  21429. var a = this._.definition.attributes && this._.definition.attributes["class"];
  21430. return a ? CKEDITOR.tools.trim(a).split(/\s+/) : null
  21431. }, applyToRange: a, removeFromRange: a, applyToObject: a
  21432. })
  21433. }
  21434. CKEDITOR.plugins.add("widget", {
  21435. requires: "lineutils,clipboard,widgetselection", onLoad: function () {
  21436. void 0 !== CKEDITOR.document.$.querySelectorAll && (CKEDITOR.addCss(".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:none;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}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_editable.cke_widget_dragging, .cke_editable.cke_widget_dragging *{cursor:move !important}"),
  21437. ka())
  21438. }, beforeInit: function (a) {
  21439. void 0 !== CKEDITOR.document.$.querySelectorAll && (a.widgets = new q(a))
  21440. }, afterInit: function (a) {
  21441. if (void 0 !== CKEDITOR.document.$.querySelectorAll) {
  21442. var b = a.widgets.registered, c, d, e;
  21443. for (d in b) c = b[d], (e = c.button) && a.ui.addButton && a.ui.addButton(CKEDITOR.tools.capitalize(c.name, !0), {
  21444. label: e,
  21445. command: c.name,
  21446. toolbar: "insert,10"
  21447. });
  21448. Z(a)
  21449. }
  21450. }
  21451. });
  21452. q.prototype = {
  21453. MIN_SELECTION_CHECK_INTERVAL: 500, add: function (a, b) {
  21454. b = CKEDITOR.tools.prototypedCopy(b);
  21455. b.name = a;
  21456. b._ = b._ || {};
  21457. this.editor.fire("widgetDefinition",
  21458. b);
  21459. b.template && (b.template = new CKEDITOR.template(b.template));
  21460. V(this.editor, b);
  21461. W(this, b);
  21462. return this.registered[a] = b
  21463. }, addUpcastCallback: function (a) {
  21464. this._.upcastCallbacks.push(a)
  21465. }, checkSelection: function () {
  21466. var a = this.editor.getSelection(), b = a.getSelectedElement(), c = F(this), d;
  21467. if (b && (d = this.getByElement(b, !0))) return c.focus(d).select(d).commit();
  21468. a = a.getRanges()[0];
  21469. if (!a || a.collapsed) return c.commit();
  21470. a = new CKEDITOR.dom.walker(a);
  21471. for (a.evaluator = g.isDomWidgetWrapper; b = a.next();) c.select(this.getByElement(b));
  21472. c.commit()
  21473. }, checkWidgets: function (a) {
  21474. this.fire("checkWidgets", CKEDITOR.tools.copy(a || {}))
  21475. }, del: function (a) {
  21476. if (this.focused === a) {
  21477. var b = a.editor, c = b.createRange(), d;
  21478. (d = c.moveToClosestEditablePosition(a.wrapper, !0)) || (d = c.moveToClosestEditablePosition(a.wrapper, !1));
  21479. d && b.getSelection().selectRanges([c])
  21480. }
  21481. a.wrapper.remove();
  21482. this.destroy(a, !0)
  21483. }, destroy: function (a, b) {
  21484. this.widgetHoldingFocusedEditable === a && p(this, a, null, b);
  21485. a.destroy(b);
  21486. delete this.instances[a.id];
  21487. this.fire("instanceDestroyed", a)
  21488. }, destroyAll: function (a,
  21489. b) {
  21490. var c, d, e = this.instances;
  21491. if (b && !a) {
  21492. d = b.find(".cke_widget_wrapper");
  21493. for (var e = d.count(), f = 0; f < e; ++f) (c = this.getByElement(d.getItem(f), !0)) && this.destroy(c)
  21494. } else for (d in e) c = e[d], this.destroy(c, a)
  21495. }, finalizeCreation: function (a) {
  21496. (a = a.getFirst()) && g.isDomWidgetWrapper(a) && (this.editor.insertElement(a), a = this.getByElement(a), a.ready = !0, a.fire("ready"), a.focus())
  21497. }, getByElement: function () {
  21498. function a(a) {
  21499. return a.is(b) && a.data("cke-widget-id")
  21500. }
  21501. var b = {div: 1, span: 1};
  21502. return function (b, d) {
  21503. if (!b) return null;
  21504. var e = a(b);
  21505. if (!d && !e) {
  21506. var f = this.editor.editable();
  21507. do b = b.getParent(); while (b && !b.equals(f) && !(e = a(b)))
  21508. }
  21509. return this.instances[e] || null
  21510. }
  21511. }(), initOn: function (a, b, c) {
  21512. b ? "string" == typeof b && (b = this.registered[b]) : b = this.registered[a.data("widget")];
  21513. if (!b) return null;
  21514. var d = this.wrapElement(a, b.name);
  21515. return d ? d.hasClass("cke_widget_new") ? (a = new g(this, this._.nextId++, a, b, c), a.isInited() ? this.instances[a.id] = a : null) : this.getByElement(a) : null
  21516. }, initOnAll: function (a) {
  21517. a = (a || this.editor.editable()).find(".cke_widget_new");
  21518. for (var b = [], c, d = a.count(); d--;) (c = this.initOn(a.getItem(d).getFirst(g.isDomWidgetElement))) && b.push(c);
  21519. return b
  21520. }, onWidget: function (a) {
  21521. var b = Array.prototype.slice.call(arguments);
  21522. b.shift();
  21523. for (var c in this.instances) {
  21524. var d = this.instances[c];
  21525. d.name == a && d.on.apply(d, b)
  21526. }
  21527. this.on("instanceCreated", function (c) {
  21528. c = c.data;
  21529. c.name == a && c.on.apply(c, b)
  21530. })
  21531. }, parseElementClasses: function (a) {
  21532. if (!a) return null;
  21533. a = CKEDITOR.tools.trim(a).split(/\s+/);
  21534. for (var b, c = {}, d = 0; b = a.pop();) -1 == b.indexOf("cke_") && (c[b] = d = 1);
  21535. return d ?
  21536. c : null
  21537. }, wrapElement: function (a, b) {
  21538. var c = null, d, e;
  21539. if (a instanceof CKEDITOR.dom.element) {
  21540. b = b || a.data("widget");
  21541. d = this.registered[b];
  21542. if (!d) return null;
  21543. if ((c = a.getParent()) && c.type == CKEDITOR.NODE_ELEMENT && c.data("cke-widget-wrapper")) return c;
  21544. a.hasAttribute("data-cke-widget-keep-attr") || a.data("cke-widget-keep-attr", a.data("widget") ? 1 : 0);
  21545. a.data("widget", b);
  21546. (e = D(d, a.getName())) && x(a);
  21547. c = new CKEDITOR.dom.element(e ? "span" : "div");
  21548. c.setAttributes(B(e, b));
  21549. c.data("cke-display-name", d.pathName ? d.pathName : a.getName());
  21550. a.getParent(!0) && c.replace(a);
  21551. a.appendTo(c)
  21552. } else if (a instanceof CKEDITOR.htmlParser.element) {
  21553. b = b || a.attributes["data-widget"];
  21554. d = this.registered[b];
  21555. if (!d) return null;
  21556. if ((c = a.parent) && c.type == CKEDITOR.NODE_ELEMENT && c.attributes["data-cke-widget-wrapper"]) return c;
  21557. "data-cke-widget-keep-attr" in a.attributes || (a.attributes["data-cke-widget-keep-attr"] = a.attributes["data-widget"] ? 1 : 0);
  21558. b && (a.attributes["data-widget"] = b);
  21559. (e = D(d, a.name)) && x(a);
  21560. c = new CKEDITOR.htmlParser.element(e ? "span" : "div", B(e, b));
  21561. c.attributes["data-cke-display-name"] =
  21562. d.pathName ? d.pathName : a.name;
  21563. d = a.parent;
  21564. var f;
  21565. d && (f = a.getIndex(), a.remove());
  21566. c.add(a);
  21567. d && C(d, f, c)
  21568. }
  21569. return c
  21570. }, _tests_createEditableFilter: A
  21571. };
  21572. CKEDITOR.event.implementOn(q.prototype);
  21573. g.prototype = {
  21574. addClass: function (a) {
  21575. this.element.addClass(a);
  21576. this.wrapper.addClass(g.WRAPPER_CLASS_PREFIX + a)
  21577. }, applyStyle: function (a) {
  21578. G(this, a, 1)
  21579. }, checkStyleActive: function (a) {
  21580. a = H(a);
  21581. var b;
  21582. if (!a) return !1;
  21583. for (; b = a.pop();) if (!this.hasClass(b)) return !1;
  21584. return !0
  21585. }, destroy: function (a) {
  21586. this.fire("destroy");
  21587. if (this.editables) for (var b in this.editables) this.destroyEditable(b,
  21588. a);
  21589. a || ("0" == this.element.data("cke-widget-keep-attr") && this.element.removeAttribute("data-widget"), this.element.removeAttributes(["data-cke-widget-data", "data-cke-widget-keep-attr"]), this.element.removeClass("cke_widget_element"), this.element.replace(this.wrapper));
  21590. this.wrapper = null
  21591. }, destroyEditable: function (a, b) {
  21592. var c = this.editables[a], d = !0;
  21593. c.removeListener("focus", K);
  21594. c.removeListener("blur", J);
  21595. this.editor.focusManager.remove(c);
  21596. if (c.filter) {
  21597. for (var e in this.repository.instances) {
  21598. var f = this.repository.instances[e];
  21599. f.editables && (f = f.editables[a]) && f !== c && c.filter === f.filter && (d = !1)
  21600. }
  21601. d && (c.filter.destroy(), (d = this.repository._.filters[this.name]) && delete d[a])
  21602. }
  21603. b || (this.repository.destroyAll(!1, c), c.removeClass("cke_widget_editable"), c.removeClass("cke_widget_editable_focused"), c.removeAttributes(["contenteditable", "data-cke-widget-editable", "data-cke-enter-mode"]));
  21604. delete this.editables[a]
  21605. }, edit: function () {
  21606. var a = {dialog: this.dialog}, b = this;
  21607. if (!1 === this.fire("edit", a) || !a.dialog) return !1;
  21608. this.editor.openDialog(a.dialog,
  21609. function (a) {
  21610. var d, e;
  21611. !1 !== b.fire("dialog", a) && (d = a.on("show", function () {
  21612. a.setupContent(b)
  21613. }), e = a.on("ok", function () {
  21614. var d, e = b.on("data", function (a) {
  21615. d = 1;
  21616. a.cancel()
  21617. }, null, null, 0);
  21618. b.editor.fire("saveSnapshot");
  21619. a.commitContent(b);
  21620. e.removeListener();
  21621. d && (b.fire("data", b.data), b.editor.fire("saveSnapshot"))
  21622. }), a.once("hide", function () {
  21623. d.removeListener();
  21624. e.removeListener()
  21625. }))
  21626. });
  21627. return !0
  21628. }, getClasses: function () {
  21629. return this.repository.parseElementClasses(this.element.getAttribute("class"))
  21630. }, hasClass: function (a) {
  21631. return this.element.hasClass(a)
  21632. },
  21633. initEditable: function (a, b) {
  21634. var c = this._findOneNotNested(b.selector);
  21635. return c && c.is(CKEDITOR.dtd.$editable) ? (c = new t(this.editor, c, {filter: A.call(this.repository, this.name, a, b)}), this.editables[a] = c, c.setAttributes({
  21636. contenteditable: "true",
  21637. "data-cke-widget-editable": a,
  21638. "data-cke-enter-mode": c.enterMode
  21639. }), c.filter && c.data("cke-filter", c.filter.id), c.addClass("cke_widget_editable"), c.removeClass("cke_widget_editable_focused"), b.pathName && c.data("cke-display-name", b.pathName), this.editor.focusManager.add(c),
  21640. c.on("focus", K, this), CKEDITOR.env.ie && c.on("blur", J, this), c._.initialSetData = !0, c.setData(c.getHtml()), !0) : !1
  21641. }, _findOneNotNested: function (a) {
  21642. a = this.wrapper.find(a);
  21643. for (var b, c, d = 0; d < a.count(); d++) if (b = a.getItem(d), c = b.getAscendant(g.isDomWidgetWrapper), this.wrapper.equals(c)) return b;
  21644. return null
  21645. }, isInited: function () {
  21646. return !(!this.wrapper || !this.inited)
  21647. }, isReady: function () {
  21648. return this.isInited() && this.ready
  21649. }, focus: function () {
  21650. var a = this.editor.getSelection();
  21651. if (a) {
  21652. var b = this.editor.checkDirty();
  21653. a.fake(this.wrapper);
  21654. !b && this.editor.resetDirty()
  21655. }
  21656. this.editor.focus()
  21657. }, removeClass: function (a) {
  21658. this.element.removeClass(a);
  21659. this.wrapper.removeClass(g.WRAPPER_CLASS_PREFIX + a)
  21660. }, removeStyle: function (a) {
  21661. G(this, a, 0)
  21662. }, setData: function (a, b) {
  21663. var c = this.data, d = 0;
  21664. if ("string" == typeof a) c[a] !== b && (c[a] = b, d = 1); else {
  21665. var e = a;
  21666. for (a in e) c[a] !== e[a] && (d = 1, c[a] = e[a])
  21667. }
  21668. d && this.dataReady && (u(this), this.fire("data", c));
  21669. return this
  21670. }, setFocused: function (a) {
  21671. this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_focused");
  21672. this.fire(a ? "focus" : "blur");
  21673. return this
  21674. }, setSelected: function (a) {
  21675. this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_selected");
  21676. this.fire(a ? "select" : "deselect");
  21677. return this
  21678. }, updateDragHandlerPosition: function () {
  21679. var a = this.editor, b = this.element.$, c = this._.dragHandlerOffset,
  21680. b = {x: b.offsetLeft, y: b.offsetTop - 15};
  21681. c && b.x == c.x && b.y == c.y || (c = a.checkDirty(), a.fire("lockSnapshot"), this.dragHandlerContainer.setStyles({
  21682. top: b.y + "px",
  21683. left: b.x + "px",
  21684. display: "block"
  21685. }), a.fire("unlockSnapshot"), !c && a.resetDirty(), this._.dragHandlerOffset = b)
  21686. }
  21687. };
  21688. CKEDITOR.event.implementOn(g.prototype);
  21689. g.getNestedEditable = function (a, b) {
  21690. return !b || b.equals(a) ? null : g.isDomNestedEditable(b) ? b : g.getNestedEditable(a, b.getParent())
  21691. };
  21692. g.isDomDragHandler = function (a) {
  21693. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-drag-handler")
  21694. };
  21695. g.isDomDragHandlerContainer = function (a) {
  21696. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_widget_drag_handler_container")
  21697. };
  21698. g.isDomNestedEditable = function (a) {
  21699. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-editable")
  21700. };
  21701. g.isDomWidgetElement = function (a) {
  21702. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-widget")
  21703. };
  21704. g.isDomWidgetWrapper = function (a) {
  21705. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-wrapper")
  21706. };
  21707. g.isDomWidget = function (a) {
  21708. return a ? this.isDomWidgetWrapper(a) || this.isDomWidgetElement(a) : !1
  21709. };
  21710. g.isParserWidgetElement = function (a) {
  21711. return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-widget"]
  21712. };
  21713. g.isParserWidgetWrapper = function (a) {
  21714. return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-cke-widget-wrapper"]
  21715. };
  21716. g.WRAPPER_CLASS_PREFIX = "cke_widget_wrapper_";
  21717. t.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.dom.element.prototype), {
  21718. setData: function (a) {
  21719. this._.initialSetData || this.editor.widgets.destroyAll(!1, this);
  21720. this._.initialSetData = !1;
  21721. a = this.editor.dataProcessor.toHtml(a, {
  21722. context: this.getName(),
  21723. filter: this.filter,
  21724. enterMode: this.enterMode
  21725. });
  21726. this.setHtml(a);
  21727. this.editor.widgets.initOnAll(this)
  21728. }, getData: function () {
  21729. return this.editor.dataProcessor.toDataFormat(this.getHtml(), {
  21730. context: this.getName(),
  21731. filter: this.filter, enterMode: this.enterMode
  21732. })
  21733. }
  21734. });
  21735. var ba = /^(?:<(?: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,
  21736. L = {37: 1, 38: 1, 39: 1, 40: 1, 8: 1, 46: 1};
  21737. L[CKEDITOR.SHIFT + 121] = 1;
  21738. CKEDITOR.plugins.widget = g;
  21739. g.repository = q;
  21740. g.nestedEditable = t
  21741. })();
  21742. (function () {
  21743. function e(a, b, c) {
  21744. this.editor = a;
  21745. this.notification = null;
  21746. this._message = new CKEDITOR.template(b);
  21747. this._singularMessage = c ? new CKEDITOR.template(c) : null;
  21748. this._tasks = [];
  21749. this._doneTasks = this._doneWeights = this._totalWeights = 0
  21750. }
  21751. function d(a) {
  21752. this._weight = a || 1;
  21753. this._doneWeight = 0;
  21754. this._isCanceled = !1
  21755. }
  21756. CKEDITOR.plugins.add("notificationaggregator", {requires: "notification"});
  21757. e.prototype = {
  21758. createTask: function (a) {
  21759. a = a || {};
  21760. var b = !this.notification, c;
  21761. b && (this.notification = this._createNotification());
  21762. c = this._addTask(a);
  21763. c.on("updated", this._onTaskUpdate, this);
  21764. c.on("done", this._onTaskDone, this);
  21765. c.on("canceled", function () {
  21766. this._removeTask(c)
  21767. }, this);
  21768. this.update();
  21769. b && this.notification.show();
  21770. return c
  21771. }, update: function () {
  21772. this._updateNotification();
  21773. this.isFinished() && this.fire("finished")
  21774. }, getPercentage: function () {
  21775. return 0 === this.getTaskCount() ? 1 : this._doneWeights / this._totalWeights
  21776. }, isFinished: function () {
  21777. return this.getDoneTaskCount() === this.getTaskCount()
  21778. }, getTaskCount: function () {
  21779. return this._tasks.length
  21780. }, getDoneTaskCount: function () {
  21781. return this._doneTasks
  21782. },
  21783. _updateNotification: function () {
  21784. this.notification.update({message: this._getNotificationMessage(), progress: this.getPercentage()})
  21785. }, _getNotificationMessage: function () {
  21786. var a = this.getTaskCount(),
  21787. b = {current: this.getDoneTaskCount(), max: a, percentage: Math.round(100 * this.getPercentage())};
  21788. return (1 == a && this._singularMessage ? this._singularMessage : this._message).output(b)
  21789. }, _createNotification: function () {
  21790. return new CKEDITOR.plugins.notification(this.editor, {type: "progress"})
  21791. }, _addTask: function (a) {
  21792. a = new d(a.weight);
  21793. this._tasks.push(a);
  21794. this._totalWeights += a._weight;
  21795. return a
  21796. }, _removeTask: function (a) {
  21797. var b = CKEDITOR.tools.indexOf(this._tasks, a);
  21798. -1 !== b && (a._doneWeight && (this._doneWeights -= a._doneWeight), this._totalWeights -= a._weight, this._tasks.splice(b, 1), this.update())
  21799. }, _onTaskUpdate: function (a) {
  21800. this._doneWeights += a.data;
  21801. this.update()
  21802. }, _onTaskDone: function () {
  21803. this._doneTasks += 1;
  21804. this.update()
  21805. }
  21806. };
  21807. CKEDITOR.event.implementOn(e.prototype);
  21808. d.prototype = {
  21809. done: function () {
  21810. this.update(this._weight)
  21811. }, update: function (a) {
  21812. if (!this.isDone() &&
  21813. !this.isCanceled()) {
  21814. a = Math.min(this._weight, a);
  21815. var b = a - this._doneWeight;
  21816. this._doneWeight = a;
  21817. this.fire("updated", b);
  21818. this.isDone() && this.fire("done")
  21819. }
  21820. }, cancel: function () {
  21821. this.isDone() || this.isCanceled() || (this._isCanceled = !0, this.fire("canceled"))
  21822. }, isDone: function () {
  21823. return this._weight === this._doneWeight
  21824. }, isCanceled: function () {
  21825. return this._isCanceled
  21826. }
  21827. };
  21828. CKEDITOR.event.implementOn(d.prototype);
  21829. CKEDITOR.plugins.notificationAggregator = e;
  21830. CKEDITOR.plugins.notificationAggregator.task = d
  21831. })();
  21832. (function () {
  21833. CKEDITOR.plugins.add("uploadwidget", {
  21834. requires: "widget,clipboard,filetools,notificationaggregator",
  21835. init: function (a) {
  21836. a.filter.allow("*[!data-widget,!data-cke-upload-id]")
  21837. }
  21838. });
  21839. CKEDITOR.fileTools || (CKEDITOR.fileTools = {});
  21840. CKEDITOR.tools.extend(CKEDITOR.fileTools, {
  21841. addUploadWidget: function (a, c, f) {
  21842. var h = CKEDITOR.fileTools, b = a.uploadRepository, m = f.supportedTypes ? 10 : 20;
  21843. if (f.fileToElement) a.on("paste", function (d) {
  21844. d = d.data;
  21845. var l = a.widgets.registered[c], k = d.dataTransfer, f = k.getFilesCount(), g = l.loadMethod ||
  21846. "loadAndUpload", e, n;
  21847. if (!d.dataValue && f) for (n = 0; n < f; n++) if (e = k.getFile(n), !l.supportedTypes || h.isTypeSupported(e, l.supportedTypes)) {
  21848. var m = l.fileToElement(e);
  21849. e = b.create(e, void 0, l.loaderType);
  21850. m && (e[g](l.uploadUrl, l.additionalRequestParameters), CKEDITOR.fileTools.markElement(m, c, e.id), "loadAndUpload" != g && "upload" != g || l.skipNotifications || CKEDITOR.fileTools.bindNotifications(a, e), d.dataValue += m.getOuterHtml())
  21851. }
  21852. }, null, null, m);
  21853. CKEDITOR.tools.extend(f, {
  21854. downcast: function () {
  21855. return new CKEDITOR.htmlParser.text("")
  21856. },
  21857. init: function () {
  21858. var d = this, c = this.wrapper.findOne("[data-cke-upload-id]").data("cke-upload-id"),
  21859. k = b.loaders[c], f = CKEDITOR.tools.capitalize, g, e;
  21860. k.on("update", function (b) {
  21861. if ("abort" === k.status && "function" === typeof d.onAbort) d.onAbort(k);
  21862. if (d.wrapper && d.wrapper.getParent()) {
  21863. a.fire("lockSnapshot");
  21864. b = "on" + f(k.status);
  21865. if ("abort" === k.status || "function" !== typeof d[b] || !1 !== d[b](k)) e = "cke_upload_" + k.status, d.wrapper && e != g && (g && d.wrapper.removeClass(g), d.wrapper.addClass(e), g = e), "error" != k.status && "abort" !=
  21866. k.status || a.widgets.del(d);
  21867. a.fire("unlockSnapshot")
  21868. } else CKEDITOR.instances[a.name] && a.editable().find('[data-cke-upload-id\x3d"' + c + '"]').count() || k.abort(), b.removeListener()
  21869. });
  21870. k.update()
  21871. }, replaceWith: function (d, c) {
  21872. if ("" === d.trim()) a.widgets.del(this); else {
  21873. var b = this == a.widgets.focused, f = a.editable(), g = a.createRange(), e, h;
  21874. b || (h = a.getSelection().createBookmarks());
  21875. g.setStartBefore(this.wrapper);
  21876. g.setEndAfter(this.wrapper);
  21877. b && (e = g.createBookmark());
  21878. f.insertHtmlIntoRange(d, g, c);
  21879. a.widgets.checkWidgets({initOnlyNew: !0});
  21880. a.widgets.destroy(this, !0);
  21881. b ? (g.moveToBookmark(e), g.select()) : a.getSelection().selectBookmarks(h)
  21882. }
  21883. }, _getLoader: function () {
  21884. var a = this.wrapper.findOne("[data-cke-upload-id]");
  21885. return a ? this.editor.uploadRepository.loaders[a.data("cke-upload-id")] : null
  21886. }
  21887. });
  21888. a.widgets.add(c, f)
  21889. }, markElement: function (a, c, f) {
  21890. a.setAttributes({"data-cke-upload-id": f, "data-widget": c})
  21891. }, bindNotifications: function (a, c) {
  21892. function f() {
  21893. h = a._.uploadWidgetNotificaionAggregator;
  21894. if (!h || h.isFinished()) h = a._.uploadWidgetNotificaionAggregator =
  21895. new CKEDITOR.plugins.notificationAggregator(a, a.lang.uploadwidget.uploadMany, a.lang.uploadwidget.uploadOne), h.once("finished", function () {
  21896. var b = h.getTaskCount();
  21897. 0 === b ? h.notification.hide() : h.notification.update({
  21898. message: 1 == b ? a.lang.uploadwidget.doneOne : a.lang.uploadwidget.doneMany.replace("%1", b),
  21899. type: "success",
  21900. important: 1
  21901. })
  21902. })
  21903. }
  21904. var h, b = null;
  21905. c.on("update", function () {
  21906. !b && c.uploadTotal && (f(), b = h.createTask({weight: c.uploadTotal}));
  21907. b && "uploading" == c.status && b.update(c.uploaded)
  21908. });
  21909. c.on("uploaded", function () {
  21910. b &&
  21911. b.done()
  21912. });
  21913. c.on("error", function () {
  21914. b && b.cancel();
  21915. a.showNotification(c.message, "warning")
  21916. });
  21917. c.on("abort", function () {
  21918. b && b.cancel();
  21919. CKEDITOR.instances[a.name] && a.showNotification(a.lang.uploadwidget.abort, "info")
  21920. })
  21921. }
  21922. })
  21923. })();
  21924. (function () {
  21925. function l(c) {
  21926. 9 >= c && (c = "0" + c);
  21927. return String(c)
  21928. }
  21929. function n(c) {
  21930. var a = new Date,
  21931. a = [a.getFullYear(), a.getMonth() + 1, a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds()];
  21932. e += 1;
  21933. return "image-" + CKEDITOR.tools.array.map(a, l).join("") + "-" + e + "." + c
  21934. }
  21935. var e = 0;
  21936. CKEDITOR.plugins.add("uploadimage", {
  21937. requires: "uploadwidget", onLoad: function () {
  21938. CKEDITOR.addCss(".cke_upload_uploading img{opacity: 0.3}")
  21939. }, init: function (c) {
  21940. if (CKEDITOR.plugins.clipboard.isFileApiSupported) {
  21941. var a = CKEDITOR.fileTools, e = a.getUploadUrl(c.config,
  21942. "image");
  21943. e && (a.addUploadWidget(c, "uploadimage", {
  21944. supportedTypes: /image\/(jpeg|png|gif|bmp)/, uploadUrl: e, fileToElement: function () {
  21945. var b = new CKEDITOR.dom.element("img");
  21946. b.setAttribute("src", "data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs\x3d");
  21947. return b
  21948. }, parts: {img: "img"}, onUploading: function (b) {
  21949. this.parts.img.setAttribute("src", b.data)
  21950. }, onUploaded: function (b) {
  21951. var a = this.parts.img.$;
  21952. this.replaceWith('\x3cimg src\x3d"' + b.url + '" width\x3d"' + (b.responseData.width ||
  21953. a.naturalWidth) + '" height\x3d"' + (b.responseData.height || a.naturalHeight) + '"\x3e')
  21954. }
  21955. }), c.on("paste", function (b) {
  21956. if (b.data.dataValue.match(/<img[\s\S]+data:/i)) {
  21957. b = b.data;
  21958. var f = document.implementation.createHTMLDocument(""),
  21959. f = new CKEDITOR.dom.element(f.body), m, g, k;
  21960. f.data("cke-editable", 1);
  21961. f.appendHtml(b.dataValue);
  21962. m = f.find("img");
  21963. for (k = 0; k < m.count(); k++) {
  21964. g = m.getItem(k);
  21965. var d = g.getAttribute("src"), h = d && "data:" == d.substring(0, 5),
  21966. l = null === g.data("cke-realelement");
  21967. h && l && !g.data("cke-upload-id") && !g.isReadOnly(1) &&
  21968. (h = (h = d.match(/image\/([a-z]+?);/i)) && h[1] || "jpg", d = c.uploadRepository.create(d, n(h)), d.upload(e), a.markElement(g, "uploadimage", d.id), a.bindNotifications(c, d))
  21969. }
  21970. b.dataValue = f.getHtml()
  21971. }
  21972. }))
  21973. }
  21974. }
  21975. })
  21976. })();
  21977. CKEDITOR.plugins.add("wsc", {
  21978. requires: "dialog", parseApi: function (a) {
  21979. a.config.wsc_onFinish = "function" === typeof a.config.wsc_onFinish ? a.config.wsc_onFinish : function () {
  21980. };
  21981. a.config.wsc_onClose = "function" === typeof a.config.wsc_onClose ? a.config.wsc_onClose : function () {
  21982. }
  21983. }, parseConfig: function (a) {
  21984. a.config.wsc_customerId = a.config.wsc_customerId || CKEDITOR.config.wsc_customerId || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";
  21985. a.config.wsc_customDictionaryIds = a.config.wsc_customDictionaryIds ||
  21986. CKEDITOR.config.wsc_customDictionaryIds || "";
  21987. a.config.wsc_userDictionaryName = a.config.wsc_userDictionaryName || CKEDITOR.config.wsc_userDictionaryName || "";
  21988. a.config.wsc_customLoaderScript = a.config.wsc_customLoaderScript || CKEDITOR.config.wsc_customLoaderScript;
  21989. a.config.wsc_interfaceLang = a.config.wsc_interfaceLang;
  21990. CKEDITOR.config.wsc_cmd = a.config.wsc_cmd || CKEDITOR.config.wsc_cmd || "spell";
  21991. CKEDITOR.config.wsc_version = "v4.3.0-master-d769233";
  21992. CKEDITOR.config.wsc_removeGlobalVariable = !0
  21993. }, onLoad: function (a) {
  21994. "moono-lisa" ==
  21995. (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path + "skins/" + CKEDITOR.skin.name + "/wsc.css"))
  21996. }, init: function (a) {
  21997. var b = CKEDITOR.env;
  21998. this.parseConfig(a);
  21999. this.parseApi(a);
  22000. a.addCommand("checkspell", new CKEDITOR.dialogCommand("checkspell")).modes = {wysiwyg: !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname && !(b.ie && (8 > b.version || b.quirks))};
  22001. "undefined" == typeof a.plugins.scayt && a.ui.addButton && a.ui.addButton("SpellChecker", {
  22002. label: a.lang.wsc.toolbar,
  22003. click: function (a) {
  22004. var b = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  22005. (b = b.replace(/\s/g, "")) ? a.execCommand("checkspell") : alert("Nothing to check!")
  22006. }, toolbar: "spellchecker,10"
  22007. });
  22008. CKEDITOR.dialog.add("checkspell", this.path + (CKEDITOR.env.ie && 7 >= CKEDITOR.env.version ? "dialogs/wsc_ie.js" : window.postMessage ? "dialogs/wsc.js" : "dialogs/wsc_ie.js"))
  22009. }
  22010. });
  22011. CKEDITOR.config.plugins = 'dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,notification,button,toolbar,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,copyformatting,div,resize,elementspath,enterkey,entities,popup,filetools,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,horizontalrule,htmlwriter,iframe,wysiwygarea,image,indent,indentblock,indentlist,smiley,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,scayt,stylescombo,tab,table,tabletools,tableselection,undo,lineutils,widgetselection,widget,notificationaggregator,uploadwidget,uploadimage,wsc';
  22012. CKEDITOR.config.skin = 'moono-lisa';
  22013. (function () {
  22014. var setIcons = function (icons, strip) {
  22015. var path = CKEDITOR.getUrl('plugins/' + strip);
  22016. icons = icons.split(',');
  22017. for (var i = 0; i < icons.length; i++) CKEDITOR.skin.icons[icons[i]] = {
  22018. path: path,
  22019. offset: -icons[++i],
  22020. bgsize: icons[++i]
  22021. };
  22022. };
  22023. if (CKEDITOR.env.hidpi) setIcons('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,,find-rtl,528,,find,552,,replace,576,,flash,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,,spellchecker,2040,', 'icons_hidpi.png'); else setIcons('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,find-rtl,528,auto,find,552,auto,replace,576,auto,flash,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,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,spellchecker,2040,auto', 'icons.png');
  22024. })();
  22025. CKEDITOR.lang.languages = {
  22026. "af": 1,
  22027. "sq": 1,
  22028. "ar": 1,
  22029. "az": 1,
  22030. "eu": 1,
  22031. "bn": 1,
  22032. "bs": 1,
  22033. "bg": 1,
  22034. "ca": 1,
  22035. "zh-cn": 1,
  22036. "zh": 1,
  22037. "hr": 1,
  22038. "cs": 1,
  22039. "da": 1,
  22040. "nl": 1,
  22041. "en": 1,
  22042. "en-au": 1,
  22043. "en-ca": 1,
  22044. "en-gb": 1,
  22045. "eo": 1,
  22046. "et": 1,
  22047. "fo": 1,
  22048. "fi": 1,
  22049. "fr": 1,
  22050. "fr-ca": 1,
  22051. "gl": 1,
  22052. "ka": 1,
  22053. "de": 1,
  22054. "de-ch": 1,
  22055. "el": 1,
  22056. "gu": 1,
  22057. "he": 1,
  22058. "hi": 1,
  22059. "hu": 1,
  22060. "is": 1,
  22061. "id": 1,
  22062. "it": 1,
  22063. "ja": 1,
  22064. "km": 1,
  22065. "ko": 1,
  22066. "ku": 1,
  22067. "lv": 1,
  22068. "lt": 1,
  22069. "mk": 1,
  22070. "ms": 1,
  22071. "mn": 1,
  22072. "no": 1,
  22073. "nb": 1,
  22074. "oc": 1,
  22075. "fa": 1,
  22076. "pl": 1,
  22077. "pt-br": 1,
  22078. "pt": 1,
  22079. "ro": 1,
  22080. "ru": 1,
  22081. "sr": 1,
  22082. "sr-latn": 1,
  22083. "si": 1,
  22084. "sk": 1,
  22085. "sl": 1,
  22086. "es": 1,
  22087. "es-mx": 1,
  22088. "sv": 1,
  22089. "tt": 1,
  22090. "th": 1,
  22091. "tr": 1,
  22092. "ug": 1,
  22093. "uk": 1,
  22094. "vi": 1,
  22095. "cy": 1
  22096. };
  22097. }());