ckeditor_2.js 667 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008
  1. /*
  2. Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.md or http://ckeditor.com/license
  4. */
  5. (function() {
  6. if(!window.CKEDITOR || !window.CKEDITOR.dom) window.CKEDITOR || (window.CKEDITOR = function() {
  7. var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,
  8. e = {
  9. timestamp: "F0RF",
  10. version: "4.4.7 (Standard)",
  11. revision: "3a35b3d",
  12. rnd: Math.floor(900 * Math.random()) + 100,
  13. _: {
  14. pending: [],
  15. basePathSrcPattern: a
  16. },
  17. status: "unloaded",
  18. basePath: function() {
  19. var c = window.CKEDITOR_BASEPATH || "";
  20. if(!c)
  21. for(var d = document.getElementsByTagName("script"), b = 0; b < d.length; b++) {
  22. var f = d[b].src.match(a);
  23. if(f) {
  24. c = f[1];
  25. break
  26. }
  27. } - 1 == c.indexOf(":/") &&
  28. "//" != c.slice(0, 2) && (c = 0 === c.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] + c : location.href.match(/^[^\?]*\/(?:)/)[0] + c);
  29. if(!c) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
  30. return c
  31. }(),
  32. getUrl: function(a) {
  33. -1 == a.indexOf(":/") && 0 !== a.indexOf("/") && (a = this.basePath + a);
  34. this.timestamp && ("/" != a.charAt(a.length - 1) && !/[&?]t=/.test(a)) && (a += (0 <= a.indexOf("?") ? "&" : "?") + "t=" + this.timestamp);
  35. return a
  36. },
  37. domReady: function() {
  38. function a() {
  39. try {
  40. document.addEventListener ? (document.removeEventListener("DOMContentLoaded", a, !1), d()) : document.attachEvent && "complete" === document.readyState && (document.detachEvent("onreadystatechange", a), d())
  41. } catch(b) {}
  42. }
  43. function d() {
  44. for(var a; a = b.shift();) a()
  45. }
  46. var b = [];
  47. return function(d) {
  48. function g() {
  49. try {
  50. document.documentElement.doScroll("left")
  51. } catch(k) {
  52. setTimeout(g, 1);
  53. return
  54. }
  55. a()
  56. }
  57. b.push(d);
  58. "complete" === document.readyState && setTimeout(a, 1);
  59. if(1 == b.length)
  60. if(document.addEventListener) document.addEventListener("DOMContentLoaded",
  61. a, !1), window.addEventListener("load", a, !1);
  62. else if(document.attachEvent) {
  63. document.attachEvent("onreadystatechange", a);
  64. window.attachEvent("onload", a);
  65. d = !1;
  66. try {
  67. d = !window.frameElement
  68. } catch(e) {}
  69. document.documentElement.doScroll && d && g()
  70. }
  71. }
  72. }()
  73. },
  74. b = window.CKEDITOR_GETURL;
  75. if(b) {
  76. var g = e.getUrl;
  77. e.getUrl = function(a) {
  78. return b.call(e, a) || g.call(e, a)
  79. }
  80. }
  81. return e
  82. }()), CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(a) {
  83. var e = CKEDITOR.event.prototype,
  84. b;
  85. for(b in e) a[b] == null && (a[b] = e[b])
  86. },
  87. CKEDITOR.event.prototype = function() {
  88. function a(a) {
  89. var c = e(this);
  90. return c[a] || (c[a] = new b(a))
  91. }
  92. var e = function(a) {
  93. a = a.getPrivate && a.getPrivate() || a._ || (a._ = {});
  94. return a.events || (a.events = {})
  95. },
  96. b = function(a) {
  97. this.name = a;
  98. this.listeners = []
  99. };
  100. b.prototype = {
  101. getListenerIndex: function(a) {
  102. for(var c = 0, d = this.listeners; c < d.length; c++)
  103. if(d[c].fn == a) return c;
  104. return -1
  105. }
  106. };
  107. return {
  108. define: function(b, c) {
  109. var d = a.call(this, b);
  110. CKEDITOR.tools.extend(d, c, true)
  111. },
  112. on: function(b, c, d, j, f) {
  113. function h(a, k, f, h) {
  114. a = {
  115. name: b,
  116. sender: this,
  117. editor: a,
  118. data: k,
  119. listenerData: j,
  120. stop: f,
  121. cancel: h,
  122. removeListener: e
  123. };
  124. return c.call(d, a) === false ? false : a.data
  125. }
  126. function e() {
  127. n.removeListener(b, c)
  128. }
  129. var k = a.call(this, b);
  130. if(k.getListenerIndex(c) < 0) {
  131. k = k.listeners;
  132. d || (d = this);
  133. isNaN(f) && (f = 10);
  134. var n = this;
  135. h.fn = c;
  136. h.priority = f;
  137. for(var o = k.length - 1; o >= 0; o--)
  138. if(k[o].priority <= f) {
  139. k.splice(o + 1, 0, h);
  140. return {
  141. removeListener: e
  142. }
  143. }
  144. k.unshift(h)
  145. }
  146. return {
  147. removeListener: e
  148. }
  149. },
  150. once: function() {
  151. var a = Array.prototype.slice.call(arguments),
  152. c = a[1];
  153. a[1] = function(a) {
  154. a.removeListener();
  155. return c.apply(this,
  156. arguments)
  157. };
  158. return this.on.apply(this, a)
  159. },
  160. capture: function() {
  161. CKEDITOR.event.useCapture = 1;
  162. var a = this.on.apply(this, arguments);
  163. CKEDITOR.event.useCapture = 0;
  164. return a
  165. },
  166. fire: function() {
  167. var a = 0,
  168. c = function() {
  169. a = 1
  170. },
  171. d = 0,
  172. b = function() {
  173. d = 1
  174. };
  175. return function(f, h, i) {
  176. var k = e(this)[f],
  177. f = a,
  178. n = d;
  179. a = d = 0;
  180. if(k) {
  181. var o = k.listeners;
  182. if(o.length)
  183. for(var o = o.slice(0), q, m = 0; m < o.length; m++) {
  184. if(k.errorProof) try {
  185. q = o[m].call(this, i, h, c, b)
  186. } catch(l) {} else q = o[m].call(this, i, h, c, b);
  187. q === false ? d = 1 : typeof q != "undefined" && (h = q);
  188. if(a || d) break
  189. }
  190. }
  191. h =
  192. d ? false : typeof h == "undefined" ? true : h;
  193. a = f;
  194. d = n;
  195. return h
  196. }
  197. }(),
  198. fireOnce: function(a, c, d) {
  199. c = this.fire(a, c, d);
  200. delete e(this)[a];
  201. return c
  202. },
  203. removeListener: function(a, c) {
  204. var d = e(this)[a];
  205. if(d) {
  206. var b = d.getListenerIndex(c);
  207. b >= 0 && d.listeners.splice(b, 1)
  208. }
  209. },
  210. removeAllListeners: function() {
  211. var a = e(this),
  212. c;
  213. for(c in a) delete a[c]
  214. },
  215. hasListeners: function(a) {
  216. return(a = e(this)[a]) && a.listeners.length > 0
  217. }
  218. }
  219. }()), CKEDITOR.editor || (CKEDITOR.editor = function() {
  220. CKEDITOR._.pending.push([this, arguments]);
  221. CKEDITOR.event.call(this)
  222. }, CKEDITOR.editor.prototype.fire =
  223. function(a, e) {
  224. a in {
  225. instanceReady: 1,
  226. loaded: 1
  227. } && (this[a] = true);
  228. return CKEDITOR.event.prototype.fire.call(this, a, e, this)
  229. }, CKEDITOR.editor.prototype.fireOnce = function(a, e) {
  230. a in {
  231. instanceReady: 1,
  232. loaded: 1
  233. } && (this[a] = true);
  234. return CKEDITOR.event.prototype.fireOnce.call(this, a, e, this)
  235. }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)), CKEDITOR.env || (CKEDITOR.env = function() {
  236. var a = navigator.userAgent.toLowerCase(),
  237. e = {
  238. ie: a.indexOf("trident/") > -1,
  239. webkit: a.indexOf(" applewebkit/") > -1,
  240. air: a.indexOf(" adobeair/") >
  241. -1,
  242. mac: a.indexOf("macintosh") > -1,
  243. quirks: document.compatMode == "BackCompat" && (!document.documentMode || document.documentMode < 10),
  244. mobile: a.indexOf("mobile") > -1,
  245. iOS: /(ipad|iphone|ipod)/.test(a),
  246. isCustomDomain: function() {
  247. if(!this.ie) return false;
  248. var a = document.domain,
  249. d = window.location.hostname;
  250. return a != d && a != "[" + d + "]"
  251. },
  252. secure: location.protocol == "https:"
  253. };
  254. e.gecko = navigator.product == "Gecko" && !e.webkit && !e.ie;
  255. if(e.webkit) a.indexOf("chrome") > -1 ? e.chrome = true : e.safari = true;
  256. var b = 0;
  257. if(e.ie) {
  258. b = e.quirks || !document.documentMode ?
  259. parseFloat(a.match(/msie (\d+)/)[1]) : document.documentMode;
  260. e.ie9Compat = b == 9;
  261. e.ie8Compat = b == 8;
  262. e.ie7Compat = b == 7;
  263. e.ie6Compat = b < 7 || e.quirks
  264. }
  265. if(e.gecko) {
  266. var g = a.match(/rv:([\d\.]+)/);
  267. if(g) {
  268. g = g[1].split(".");
  269. b = g[0] * 1E4 + (g[1] || 0) * 100 + (g[2] || 0) * 1
  270. }
  271. }
  272. e.air && (b = parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
  273. e.webkit && (b = parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
  274. e.version = b;
  275. e.isCompatible = e.iOS && b >= 534 || !e.mobile && (e.ie && b > 6 || e.gecko && b >= 2E4 || e.air && b >= 1 || e.webkit && b >= 522 || false);
  276. e.hidpi = window.devicePixelRatio >=
  277. 2;
  278. e.needsBrFiller = e.gecko || e.webkit || e.ie && b > 10;
  279. e.needsNbspFiller = e.ie && b < 11;
  280. e.cssClass = "cke_browser_" + (e.ie ? "ie" : e.gecko ? "gecko" : e.webkit ? "webkit" : "unknown");
  281. if(e.quirks) e.cssClass = e.cssClass + " cke_browser_quirks";
  282. if(e.ie) e.cssClass = e.cssClass + (" cke_browser_ie" + (e.quirks ? "6 cke_browser_iequirks" : e.version));
  283. if(e.air) e.cssClass = e.cssClass + " cke_browser_air";
  284. if(e.iOS) e.cssClass = e.cssClass + " cke_browser_ios";
  285. if(e.hidpi) e.cssClass = e.cssClass + " cke_hidpi";
  286. return e
  287. }()), "unloaded" == CKEDITOR.status && function() {
  288. CKEDITOR.event.implementOn(CKEDITOR);
  289. CKEDITOR.loadFullCore = function() {
  290. if(CKEDITOR.status != "basic_ready") CKEDITOR.loadFullCore._load = 1;
  291. else {
  292. delete CKEDITOR.loadFullCore;
  293. var a = document.createElement("script");
  294. a.type = "text/javascript";
  295. a.src = CKEDITOR.basePath + "ckeditor.js";
  296. document.getElementsByTagName("head")[0].appendChild(a)
  297. }
  298. };
  299. CKEDITOR.loadFullCoreTimeout = 0;
  300. CKEDITOR.add = function(a) {
  301. (this._.pending || (this._.pending = [])).push(a)
  302. };
  303. (function() {
  304. CKEDITOR.domReady(function() {
  305. var a = CKEDITOR.loadFullCore,
  306. e = CKEDITOR.loadFullCoreTimeout;
  307. if(a) {
  308. CKEDITOR.status =
  309. "basic_ready";
  310. a && a._load ? a() : e && setTimeout(function() {
  311. CKEDITOR.loadFullCore && CKEDITOR.loadFullCore()
  312. }, e * 1E3)
  313. }
  314. })
  315. })();
  316. CKEDITOR.status = "basic_loaded"
  317. }(), CKEDITOR.dom = {},
  318. function() {
  319. var a = [],
  320. e = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "",
  321. b = /&/g,
  322. g = />/g,
  323. c = /</g,
  324. d = /"/g,
  325. j = /&amp;/g,
  326. f = /&gt;/g,
  327. h = /&lt;/g,
  328. i = /&quot;/g;
  329. CKEDITOR.on("reset", function() {
  330. a = []
  331. });
  332. CKEDITOR.tools = {
  333. arrayCompare: function(a, c) {
  334. if(!a && !c) return true;
  335. if(!a || !c || a.length != c.length) return false;
  336. for(var d = 0; d <
  337. a.length; d++)
  338. if(a[d] != c[d]) return false;
  339. return true
  340. },
  341. clone: function(a) {
  342. var c;
  343. if(a && a instanceof Array) {
  344. c = [];
  345. for(var d = 0; d < a.length; d++) c[d] = CKEDITOR.tools.clone(a[d]);
  346. return c
  347. }
  348. if(a === null || typeof a != "object" || a instanceof String || a instanceof Number || a instanceof Boolean || a instanceof Date || a instanceof RegExp || a.nodeType || a.window === a) return a;
  349. c = new a.constructor;
  350. for(d in a) c[d] = CKEDITOR.tools.clone(a[d]);
  351. return c
  352. },
  353. capitalize: function(a, c) {
  354. return a.charAt(0).toUpperCase() + (c ? a.slice(1) : a.slice(1).toLowerCase())
  355. },
  356. extend: function(a) {
  357. var c = arguments.length,
  358. d, b;
  359. if(typeof(d = arguments[c - 1]) == "boolean") c--;
  360. else if(typeof(d = arguments[c - 2]) == "boolean") {
  361. b = arguments[c - 1];
  362. c = c - 2
  363. }
  364. for(var f = 1; f < c; f++) {
  365. var g = arguments[f],
  366. j;
  367. for(j in g)
  368. if(d === true || a[j] == null)
  369. if(!b || j in b) a[j] = g[j]
  370. }
  371. return a
  372. },
  373. prototypedCopy: function(a) {
  374. var c = function() {};
  375. c.prototype = a;
  376. return new c
  377. },
  378. copy: function(a) {
  379. var c = {},
  380. d;
  381. for(d in a) c[d] = a[d];
  382. return c
  383. },
  384. isArray: function(a) {
  385. return Object.prototype.toString.call(a) == "[object Array]"
  386. },
  387. isEmpty: function(a) {
  388. for(var c in a)
  389. if(a.hasOwnProperty(c)) return false;
  390. return true
  391. },
  392. cssVendorPrefix: function(a, c, d) {
  393. if(d) return e + a + ":" + c + ";" + a + ":" + c;
  394. d = {};
  395. d[a] = c;
  396. d[e + a] = c;
  397. return d
  398. },
  399. cssStyleToDomStyle: function() {
  400. var a = document.createElement("div").style,
  401. c = typeof a.cssFloat != "undefined" ? "cssFloat" : typeof a.styleFloat != "undefined" ? "styleFloat" : "float";
  402. return function(a) {
  403. return a == "float" ? c : a.replace(/-./g, function(a) {
  404. return a.substr(1).toUpperCase()
  405. })
  406. }
  407. }(),
  408. buildStyleHtml: function(a) {
  409. for(var a = [].concat(a), c, d = [], b = 0; b < a.length; b++)
  410. if(c = a[b]) /@import|[{}]/.test(c) ? d.push("<style>" +
  411. c + "</style>") : d.push('<link type="text/css" rel=stylesheet href="' + c + '">');
  412. return d.join("")
  413. },
  414. htmlEncode: function(a) {
  415. return("" + a).replace(b, "&amp;").replace(g, "&gt;").replace(c, "&lt;")
  416. },
  417. htmlDecode: function(a) {
  418. return a.replace(j, "&").replace(f, ">").replace(h, "<")
  419. },
  420. htmlEncodeAttr: function(a) {
  421. return a.replace(d, "&quot;").replace(c, "&lt;").replace(g, "&gt;")
  422. },
  423. htmlDecodeAttr: function(a) {
  424. return a.replace(i, '"').replace(h, "<").replace(f, ">")
  425. },
  426. getNextNumber: function() {
  427. var a = 0;
  428. return function() {
  429. return ++a
  430. }
  431. }(),
  432. getNextId: function() {
  433. return "cke_" + this.getNextNumber()
  434. },
  435. override: function(a, c) {
  436. var d = c(a);
  437. d.prototype = a.prototype;
  438. return d
  439. },
  440. setTimeout: function(a, c, d, b, f) {
  441. f || (f = window);
  442. d || (d = f);
  443. return f.setTimeout(function() {
  444. b ? a.apply(d, [].concat(b)) : a.apply(d)
  445. }, c || 0)
  446. },
  447. trim: function() {
  448. var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
  449. return function(c) {
  450. return c.replace(a, "")
  451. }
  452. }(),
  453. ltrim: function() {
  454. var a = /^[ \t\n\r]+/g;
  455. return function(c) {
  456. return c.replace(a, "")
  457. }
  458. }(),
  459. rtrim: function() {
  460. var a = /[ \t\n\r]+$/g;
  461. return function(c) {
  462. return c.replace(a,
  463. "")
  464. }
  465. }(),
  466. indexOf: function(a, c) {
  467. if(typeof c == "function")
  468. for(var d = 0, b = a.length; d < b; d++) {
  469. if(c(a[d])) return d
  470. } else {
  471. if(a.indexOf) return a.indexOf(c);
  472. d = 0;
  473. for(b = a.length; d < b; d++)
  474. if(a[d] === c) return d
  475. }
  476. return -1
  477. },
  478. search: function(a, c) {
  479. var d = CKEDITOR.tools.indexOf(a, c);
  480. return d >= 0 ? a[d] : null
  481. },
  482. bind: function(a, c) {
  483. return function() {
  484. return a.apply(c, arguments)
  485. }
  486. },
  487. createClass: function(a) {
  488. var c = a.$,
  489. d = a.base,
  490. b = a.privates || a._,
  491. f = a.proto,
  492. a = a.statics;
  493. !c && (c = function() {
  494. d && this.base.apply(this, arguments)
  495. });
  496. if(b) var g = c,
  497. c = function() {
  498. var a =
  499. this._ || (this._ = {}),
  500. c;
  501. for(c in b) {
  502. var d = b[c];
  503. a[c] = typeof d == "function" ? CKEDITOR.tools.bind(d, this) : d
  504. }
  505. g.apply(this, arguments)
  506. };
  507. if(d) {
  508. c.prototype = this.prototypedCopy(d.prototype);
  509. c.prototype.constructor = c;
  510. c.base = d;
  511. c.baseProto = d.prototype;
  512. c.prototype.base = function() {
  513. this.base = d.prototype.base;
  514. d.apply(this, arguments);
  515. this.base = arguments.callee
  516. }
  517. }
  518. f && this.extend(c.prototype, f, true);
  519. a && this.extend(c, a, true);
  520. return c
  521. },
  522. addFunction: function(c, d) {
  523. return a.push(function() {
  524. return c.apply(d || this, arguments)
  525. }) - 1
  526. },
  527. removeFunction: function(c) {
  528. a[c] = null
  529. },
  530. callFunction: function(c) {
  531. var d = a[c];
  532. return d && d.apply(window, Array.prototype.slice.call(arguments, 1))
  533. },
  534. cssLength: function() {
  535. var a = /^-?\d+\.?\d*px$/,
  536. c;
  537. return function(d) {
  538. c = CKEDITOR.tools.trim(d + "") + "px";
  539. return a.test(c) ? c : d || ""
  540. }
  541. }(),
  542. convertToPx: function() {
  543. var a;
  544. return function(c) {
  545. if(!a) {
  546. a = CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>', CKEDITOR.document);
  547. CKEDITOR.document.getBody().append(a)
  548. }
  549. if(!/%$/.test(c)) {
  550. a.setStyle("width",
  551. c);
  552. return a.$.clientWidth
  553. }
  554. return c
  555. }
  556. }(),
  557. repeat: function(a, c) {
  558. return Array(c + 1).join(a)
  559. },
  560. tryThese: function() {
  561. for(var a, c = 0, d = arguments.length; c < d; c++) {
  562. var b = arguments[c];
  563. try {
  564. a = b();
  565. break
  566. } catch(f) {}
  567. }
  568. return a
  569. },
  570. genKey: function() {
  571. return Array.prototype.slice.call(arguments).join("-")
  572. },
  573. defer: function(a) {
  574. return function() {
  575. var c = arguments,
  576. d = this;
  577. window.setTimeout(function() {
  578. a.apply(d, c)
  579. }, 0)
  580. }
  581. },
  582. normalizeCssText: function(a, c) {
  583. var d = [],
  584. b, f = CKEDITOR.tools.parseCssText(a, true, c);
  585. for(b in f) d.push(b + ":" + f[b]);
  586. d.sort();
  587. return d.length ? d.join(";") + ";" : ""
  588. },
  589. convertRgbToHex: function(a) {
  590. return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function(a, c, d, b) {
  591. a = [c, d, b];
  592. for(c = 0; c < 3; c++) a[c] = ("0" + parseInt(a[c], 10).toString(16)).slice(-2);
  593. return "#" + a.join("")
  594. })
  595. },
  596. parseCssText: function(a, c, d) {
  597. var b = {};
  598. if(d) {
  599. d = new CKEDITOR.dom.element("span");
  600. d.setAttribute("style", a);
  601. a = CKEDITOR.tools.convertRgbToHex(d.getAttribute("style") || "")
  602. }
  603. if(!a || a == ";") return b;
  604. a.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
  605. function(a, d, f) {
  606. if(c) {
  607. d = d.toLowerCase();
  608. d == "font-family" && (f = f.toLowerCase().replace(/["']/g, "").replace(/\s*,\s*/g, ","));
  609. f = CKEDITOR.tools.trim(f)
  610. }
  611. b[d] = f
  612. });
  613. return b
  614. },
  615. writeCssText: function(a, c) {
  616. var d, b = [];
  617. for(d in a) b.push(d + ":" + a[d]);
  618. c && b.sort();
  619. return b.join("; ")
  620. },
  621. objectCompare: function(a, c, d) {
  622. var b;
  623. if(!a && !c) return true;
  624. if(!a || !c) return false;
  625. for(b in a)
  626. if(a[b] != c[b]) return false;
  627. if(!d)
  628. for(b in c)
  629. if(a[b] != c[b]) return false;
  630. return true
  631. },
  632. objectKeys: function(a) {
  633. var c = [],
  634. d;
  635. for(d in a) c.push(d);
  636. return c
  637. },
  638. convertArrayToObject: function(a, c) {
  639. var d = {};
  640. arguments.length == 1 && (c = true);
  641. for(var b = 0, f = a.length; b < f; ++b) d[a[b]] = c;
  642. return d
  643. },
  644. fixDomain: function() {
  645. for(var a;;) try {
  646. a = window.parent.document.domain;
  647. break
  648. } catch(c) {
  649. a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain;
  650. if(!a) break;
  651. document.domain = a
  652. }
  653. return !!a
  654. },
  655. eventsBuffer: function(a, c) {
  656. function d() {
  657. f = (new Date).getTime();
  658. b = false;
  659. c()
  660. }
  661. var b, f = 0;
  662. return {
  663. input: function() {
  664. if(!b) {
  665. var c = (new Date).getTime() - f;
  666. c < a ? b = setTimeout(d, a - c) : d()
  667. }
  668. },
  669. reset: function() {
  670. b && clearTimeout(b);
  671. b = f = 0
  672. }
  673. }
  674. },
  675. enableHtml5Elements: function(a, c) {
  676. for(var d = ["abbr", "article", "aside", "audio", "bdi", "canvas", "data", "datalist", "details", "figcaption", "figure", "footer", "header", "hgroup", "mark", "meter", "nav", "output", "progress", "section", "summary", "time", "video"], b = d.length, f; b--;) {
  677. f = a.createElement(d[b]);
  678. c && a.appendChild(f)
  679. }
  680. },
  681. checkIfAnyArrayItemMatches: function(a, c) {
  682. for(var d = 0, b = a.length; d < b; ++d)
  683. if(a[d].match(c)) return true;
  684. return false
  685. },
  686. checkIfAnyObjectPropertyMatches: function(a, c) {
  687. for(var d in a)
  688. if(d.match(c)) return true;
  689. return false
  690. },
  691. transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="
  692. }
  693. }(), CKEDITOR.dtd = function() {
  694. var a = CKEDITOR.tools.extend,
  695. e = function(a, c) {
  696. for(var d = CKEDITOR.tools.clone(a), b = 1; b < arguments.length; b++) {
  697. var c = arguments[b],
  698. f;
  699. for(f in c) delete d[f]
  700. }
  701. return d
  702. },
  703. b = {},
  704. g = {},
  705. c = {
  706. address: 1,
  707. article: 1,
  708. aside: 1,
  709. blockquote: 1,
  710. details: 1,
  711. div: 1,
  712. dl: 1,
  713. fieldset: 1,
  714. figure: 1,
  715. footer: 1,
  716. form: 1,
  717. h1: 1,
  718. h2: 1,
  719. h3: 1,
  720. h4: 1,
  721. h5: 1,
  722. h6: 1,
  723. header: 1,
  724. hgroup: 1,
  725. hr: 1,
  726. main: 1,
  727. menu: 1,
  728. nav: 1,
  729. ol: 1,
  730. p: 1,
  731. pre: 1,
  732. section: 1,
  733. table: 1,
  734. ul: 1
  735. },
  736. d = {
  737. command: 1,
  738. link: 1,
  739. meta: 1,
  740. noscript: 1,
  741. script: 1,
  742. style: 1
  743. },
  744. j = {},
  745. f = {
  746. "#": 1
  747. },
  748. h = {
  749. center: 1,
  750. dir: 1,
  751. noframes: 1
  752. };
  753. a(b, {
  754. a: 1,
  755. abbr: 1,
  756. area: 1,
  757. audio: 1,
  758. b: 1,
  759. bdi: 1,
  760. bdo: 1,
  761. br: 1,
  762. button: 1,
  763. canvas: 1,
  764. cite: 1,
  765. code: 1,
  766. command: 1,
  767. datalist: 1,
  768. del: 1,
  769. dfn: 1,
  770. em: 1,
  771. embed: 1,
  772. i: 1,
  773. iframe: 1,
  774. img: 1,
  775. input: 1,
  776. ins: 1,
  777. kbd: 1,
  778. keygen: 1,
  779. label: 1,
  780. map: 1,
  781. mark: 1,
  782. meter: 1,
  783. noscript: 1,
  784. object: 1,
  785. output: 1,
  786. progress: 1,
  787. q: 1,
  788. ruby: 1,
  789. s: 1,
  790. samp: 1,
  791. script: 1,
  792. select: 1,
  793. small: 1,
  794. span: 1,
  795. strong: 1,
  796. sub: 1,
  797. sup: 1,
  798. textarea: 1,
  799. time: 1,
  800. u: 1,
  801. "var": 1,
  802. video: 1,
  803. wbr: 1
  804. }, f, {
  805. acronym: 1,
  806. applet: 1,
  807. basefont: 1,
  808. big: 1,
  809. font: 1,
  810. isindex: 1,
  811. strike: 1,
  812. style: 1,
  813. tt: 1
  814. });
  815. a(g, c, b, h);
  816. e = {
  817. a: e(b, {
  818. a: 1,
  819. button: 1
  820. }),
  821. abbr: b,
  822. address: g,
  823. area: j,
  824. article: g,
  825. aside: g,
  826. audio: a({
  827. source: 1,
  828. track: 1
  829. }, g),
  830. b: b,
  831. base: j,
  832. bdi: b,
  833. bdo: b,
  834. blockquote: g,
  835. body: g,
  836. br: j,
  837. button: e(b, {
  838. a: 1,
  839. button: 1
  840. }),
  841. canvas: b,
  842. caption: g,
  843. cite: b,
  844. code: b,
  845. col: j,
  846. colgroup: {
  847. col: 1
  848. },
  849. command: j,
  850. datalist: a({
  851. option: 1
  852. }, b),
  853. dd: g,
  854. del: b,
  855. details: a({
  856. summary: 1
  857. }, g),
  858. dfn: b,
  859. div: g,
  860. dl: {
  861. dt: 1,
  862. dd: 1
  863. },
  864. dt: g,
  865. em: b,
  866. embed: j,
  867. fieldset: a({
  868. legend: 1
  869. }, g),
  870. figcaption: g,
  871. figure: a({
  872. figcaption: 1
  873. }, g),
  874. footer: g,
  875. form: g,
  876. h1: b,
  877. h2: b,
  878. h3: b,
  879. h4: b,
  880. h5: b,
  881. h6: b,
  882. head: a({
  883. title: 1,
  884. base: 1
  885. }, d),
  886. header: g,
  887. hgroup: {
  888. h1: 1,
  889. h2: 1,
  890. h3: 1,
  891. h4: 1,
  892. h5: 1,
  893. h6: 1
  894. },
  895. hr: j,
  896. html: a({
  897. head: 1,
  898. body: 1
  899. }, g, d),
  900. i: b,
  901. iframe: f,
  902. img: j,
  903. input: j,
  904. ins: b,
  905. kbd: b,
  906. keygen: j,
  907. label: b,
  908. legend: b,
  909. li: g,
  910. link: j,
  911. main: g,
  912. map: g,
  913. mark: b,
  914. menu: a({
  915. li: 1
  916. }, g),
  917. meta: j,
  918. meter: e(b, {
  919. meter: 1
  920. }),
  921. nav: g,
  922. noscript: a({
  923. link: 1,
  924. meta: 1,
  925. style: 1
  926. }, b),
  927. object: a({
  928. param: 1
  929. }, b),
  930. ol: {
  931. li: 1
  932. },
  933. optgroup: {
  934. option: 1
  935. },
  936. option: f,
  937. output: b,
  938. p: b,
  939. param: j,
  940. pre: b,
  941. progress: e(b, {
  942. progress: 1
  943. }),
  944. q: b,
  945. rp: b,
  946. rt: b,
  947. ruby: a({
  948. rp: 1,
  949. rt: 1
  950. }, b),
  951. s: b,
  952. samp: b,
  953. script: f,
  954. section: g,
  955. select: {
  956. optgroup: 1,
  957. option: 1
  958. },
  959. small: b,
  960. source: j,
  961. span: b,
  962. strong: b,
  963. style: f,
  964. sub: b,
  965. summary: b,
  966. sup: b,
  967. table: {
  968. caption: 1,
  969. colgroup: 1,
  970. thead: 1,
  971. tfoot: 1,
  972. tbody: 1,
  973. tr: 1
  974. },
  975. tbody: {
  976. tr: 1
  977. },
  978. td: g,
  979. textarea: f,
  980. tfoot: {
  981. tr: 1
  982. },
  983. th: g,
  984. thead: {
  985. tr: 1
  986. },
  987. time: e(b, {
  988. time: 1
  989. }),
  990. title: f,
  991. tr: {
  992. th: 1,
  993. td: 1
  994. },
  995. track: j,
  996. u: b,
  997. ul: {
  998. li: 1
  999. },
  1000. "var": b,
  1001. video: a({
  1002. source: 1,
  1003. track: 1
  1004. }, g),
  1005. wbr: j,
  1006. acronym: b,
  1007. applet: a({
  1008. param: 1
  1009. }, g),
  1010. basefont: j,
  1011. big: b,
  1012. center: g,
  1013. dialog: j,
  1014. dir: {
  1015. li: 1
  1016. },
  1017. font: b,
  1018. isindex: j,
  1019. noframes: g,
  1020. strike: b,
  1021. tt: b
  1022. };
  1023. a(e, {
  1024. $block: a({
  1025. audio: 1,
  1026. dd: 1,
  1027. dt: 1,
  1028. figcaption: 1,
  1029. li: 1,
  1030. video: 1
  1031. },
  1032. c, h),
  1033. $blockLimit: {
  1034. article: 1,
  1035. aside: 1,
  1036. audio: 1,
  1037. body: 1,
  1038. caption: 1,
  1039. details: 1,
  1040. dir: 1,
  1041. div: 1,
  1042. dl: 1,
  1043. fieldset: 1,
  1044. figcaption: 1,
  1045. figure: 1,
  1046. footer: 1,
  1047. form: 1,
  1048. header: 1,
  1049. hgroup: 1,
  1050. main: 1,
  1051. menu: 1,
  1052. nav: 1,
  1053. ol: 1,
  1054. section: 1,
  1055. table: 1,
  1056. td: 1,
  1057. th: 1,
  1058. tr: 1,
  1059. ul: 1,
  1060. video: 1
  1061. },
  1062. $cdata: {
  1063. script: 1,
  1064. style: 1
  1065. },
  1066. $editable: {
  1067. address: 1,
  1068. article: 1,
  1069. aside: 1,
  1070. blockquote: 1,
  1071. body: 1,
  1072. details: 1,
  1073. div: 1,
  1074. fieldset: 1,
  1075. figcaption: 1,
  1076. footer: 1,
  1077. form: 1,
  1078. h1: 1,
  1079. h2: 1,
  1080. h3: 1,
  1081. h4: 1,
  1082. h5: 1,
  1083. h6: 1,
  1084. header: 1,
  1085. hgroup: 1,
  1086. main: 1,
  1087. nav: 1,
  1088. p: 1,
  1089. pre: 1,
  1090. section: 1
  1091. },
  1092. $empty: {
  1093. area: 1,
  1094. base: 1,
  1095. basefont: 1,
  1096. br: 1,
  1097. col: 1,
  1098. command: 1,
  1099. dialog: 1,
  1100. embed: 1,
  1101. hr: 1,
  1102. img: 1,
  1103. input: 1,
  1104. isindex: 1,
  1105. keygen: 1,
  1106. link: 1,
  1107. meta: 1,
  1108. param: 1,
  1109. source: 1,
  1110. track: 1,
  1111. wbr: 1
  1112. },
  1113. $inline: b,
  1114. $list: {
  1115. dl: 1,
  1116. ol: 1,
  1117. ul: 1
  1118. },
  1119. $listItem: {
  1120. dd: 1,
  1121. dt: 1,
  1122. li: 1
  1123. },
  1124. $nonBodyContent: a({
  1125. body: 1,
  1126. head: 1,
  1127. html: 1
  1128. }, e.head),
  1129. $nonEditable: {
  1130. applet: 1,
  1131. audio: 1,
  1132. button: 1,
  1133. embed: 1,
  1134. iframe: 1,
  1135. map: 1,
  1136. object: 1,
  1137. option: 1,
  1138. param: 1,
  1139. script: 1,
  1140. textarea: 1,
  1141. video: 1
  1142. },
  1143. $object: {
  1144. applet: 1,
  1145. audio: 1,
  1146. button: 1,
  1147. hr: 1,
  1148. iframe: 1,
  1149. img: 1,
  1150. input: 1,
  1151. object: 1,
  1152. select: 1,
  1153. table: 1,
  1154. textarea: 1,
  1155. video: 1
  1156. },
  1157. $removeEmpty: {
  1158. abbr: 1,
  1159. acronym: 1,
  1160. b: 1,
  1161. bdi: 1,
  1162. bdo: 1,
  1163. big: 1,
  1164. cite: 1,
  1165. code: 1,
  1166. del: 1,
  1167. dfn: 1,
  1168. em: 1,
  1169. font: 1,
  1170. i: 1,
  1171. ins: 1,
  1172. label: 1,
  1173. kbd: 1,
  1174. mark: 1,
  1175. meter: 1,
  1176. output: 1,
  1177. q: 1,
  1178. ruby: 1,
  1179. s: 1,
  1180. samp: 1,
  1181. small: 1,
  1182. span: 1,
  1183. strike: 1,
  1184. strong: 1,
  1185. sub: 1,
  1186. sup: 1,
  1187. time: 1,
  1188. tt: 1,
  1189. u: 1,
  1190. "var": 1
  1191. },
  1192. $tabIndex: {
  1193. a: 1,
  1194. area: 1,
  1195. button: 1,
  1196. input: 1,
  1197. object: 1,
  1198. select: 1,
  1199. textarea: 1
  1200. },
  1201. $tableContent: {
  1202. caption: 1,
  1203. col: 1,
  1204. colgroup: 1,
  1205. tbody: 1,
  1206. td: 1,
  1207. tfoot: 1,
  1208. th: 1,
  1209. thead: 1,
  1210. tr: 1
  1211. },
  1212. $transparent: {
  1213. a: 1,
  1214. audio: 1,
  1215. canvas: 1,
  1216. del: 1,
  1217. ins: 1,
  1218. map: 1,
  1219. noscript: 1,
  1220. object: 1,
  1221. video: 1
  1222. },
  1223. $intermediate: {
  1224. caption: 1,
  1225. colgroup: 1,
  1226. dd: 1,
  1227. dt: 1,
  1228. figcaption: 1,
  1229. legend: 1,
  1230. li: 1,
  1231. optgroup: 1,
  1232. option: 1,
  1233. rp: 1,
  1234. rt: 1,
  1235. summary: 1,
  1236. tbody: 1,
  1237. td: 1,
  1238. tfoot: 1,
  1239. th: 1,
  1240. thead: 1,
  1241. tr: 1
  1242. }
  1243. });
  1244. return e
  1245. }(), CKEDITOR.dom.event = function(a) {
  1246. this.$ = a
  1247. }, CKEDITOR.dom.event.prototype = {
  1248. getKey: function() {
  1249. return this.$.keyCode || this.$.which
  1250. },
  1251. getKeystroke: function() {
  1252. var a = this.getKey();
  1253. if(this.$.ctrlKey || this.$.metaKey) a = a + CKEDITOR.CTRL;
  1254. this.$.shiftKey && (a = a + CKEDITOR.SHIFT);
  1255. this.$.altKey && (a = a + CKEDITOR.ALT);
  1256. return a
  1257. },
  1258. preventDefault: function(a) {
  1259. var e = this.$;
  1260. e.preventDefault ? e.preventDefault() : e.returnValue = false;
  1261. a && this.stopPropagation()
  1262. },
  1263. stopPropagation: function() {
  1264. var a =
  1265. this.$;
  1266. a.stopPropagation ? a.stopPropagation() : a.cancelBubble = true
  1267. },
  1268. getTarget: function() {
  1269. var a = this.$.target || this.$.srcElement;
  1270. return a ? new CKEDITOR.dom.node(a) : null
  1271. },
  1272. getPhase: function() {
  1273. return this.$.eventPhase || 2
  1274. },
  1275. getPageOffset: function() {
  1276. var a = this.getTarget().getDocument().$;
  1277. return {
  1278. x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft),
  1279. y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop)
  1280. }
  1281. }
  1282. }, CKEDITOR.CTRL = 1114112, CKEDITOR.SHIFT = 2228224, CKEDITOR.ALT =
  1283. 4456448, CKEDITOR.EVENT_PHASE_CAPTURING = 1, CKEDITOR.EVENT_PHASE_AT_TARGET = 2, CKEDITOR.EVENT_PHASE_BUBBLING = 3, CKEDITOR.dom.domObject = function(a) {
  1284. if(a) this.$ = a
  1285. }, CKEDITOR.dom.domObject.prototype = function() {
  1286. var a = function(a, b) {
  1287. return function(g) {
  1288. typeof CKEDITOR != "undefined" && a.fire(b, new CKEDITOR.dom.event(g))
  1289. }
  1290. };
  1291. return {
  1292. getPrivate: function() {
  1293. var a;
  1294. if(!(a = this.getCustomData("_"))) this.setCustomData("_", a = {});
  1295. return a
  1296. },
  1297. on: function(e) {
  1298. var b = this.getCustomData("_cke_nativeListeners");
  1299. if(!b) {
  1300. b = {};
  1301. this.setCustomData("_cke_nativeListeners",
  1302. b)
  1303. }
  1304. if(!b[e]) {
  1305. b = b[e] = a(this, e);
  1306. this.$.addEventListener ? this.$.addEventListener(e, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" + e, b)
  1307. }
  1308. return CKEDITOR.event.prototype.on.apply(this, arguments)
  1309. },
  1310. removeListener: function(a) {
  1311. CKEDITOR.event.prototype.removeListener.apply(this, arguments);
  1312. if(!this.hasListeners(a)) {
  1313. var b = this.getCustomData("_cke_nativeListeners"),
  1314. g = b && b[a];
  1315. if(g) {
  1316. this.$.removeEventListener ? this.$.removeEventListener(a, g, false) : this.$.detachEvent && this.$.detachEvent("on" +
  1317. a, g);
  1318. delete b[a]
  1319. }
  1320. }
  1321. },
  1322. removeAllListeners: function() {
  1323. var a = this.getCustomData("_cke_nativeListeners"),
  1324. b;
  1325. for(b in a) {
  1326. var g = a[b];
  1327. this.$.detachEvent ? this.$.detachEvent("on" + b, g) : this.$.removeEventListener && this.$.removeEventListener(b, g, false);
  1328. delete a[b]
  1329. }
  1330. CKEDITOR.event.prototype.removeAllListeners.call(this)
  1331. }
  1332. }
  1333. }(),
  1334. function(a) {
  1335. var e = {};
  1336. CKEDITOR.on("reset", function() {
  1337. e = {}
  1338. });
  1339. a.equals = function(a) {
  1340. try {
  1341. return a && a.$ === this.$
  1342. } catch(g) {
  1343. return false
  1344. }
  1345. };
  1346. a.setCustomData = function(a, g) {
  1347. var c = this.getUniqueId();
  1348. (e[c] ||
  1349. (e[c] = {}))[a] = g;
  1350. return this
  1351. };
  1352. a.getCustomData = function(a) {
  1353. var g = this.$["data-cke-expando"];
  1354. return(g = g && e[g]) && a in g ? g[a] : null
  1355. };
  1356. a.removeCustomData = function(a) {
  1357. var g = this.$["data-cke-expando"],
  1358. g = g && e[g],
  1359. c, d;
  1360. if(g) {
  1361. c = g[a];
  1362. d = a in g;
  1363. delete g[a]
  1364. }
  1365. return d ? c : null
  1366. };
  1367. a.clearCustomData = function() {
  1368. this.removeAllListeners();
  1369. var a = this.$["data-cke-expando"];
  1370. a && delete e[a]
  1371. };
  1372. a.getUniqueId = function() {
  1373. return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber())
  1374. };
  1375. CKEDITOR.event.implementOn(a)
  1376. }(CKEDITOR.dom.domObject.prototype),
  1377. CKEDITOR.dom.node = function(a) {
  1378. 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
  1379. }, CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject, CKEDITOR.NODE_ELEMENT = 1, CKEDITOR.NODE_DOCUMENT = 9, CKEDITOR.NODE_TEXT = 3, CKEDITOR.NODE_COMMENT = 8, CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11, CKEDITOR.POSITION_IDENTICAL =
  1380. 0, CKEDITOR.POSITION_DISCONNECTED = 1, CKEDITOR.POSITION_FOLLOWING = 2, CKEDITOR.POSITION_PRECEDING = 4, CKEDITOR.POSITION_IS_CONTAINED = 8, CKEDITOR.POSITION_CONTAINS = 16, CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, {
  1381. appendTo: function(a, e) {
  1382. a.append(this, e);
  1383. return a
  1384. },
  1385. clone: function(a, e) {
  1386. var b = this.$.cloneNode(a),
  1387. g = function(c) {
  1388. c["data-cke-expando"] && (c["data-cke-expando"] = false);
  1389. if(c.nodeType == CKEDITOR.NODE_ELEMENT) {
  1390. e || c.removeAttribute("id", false);
  1391. if(a)
  1392. for(var c = c.childNodes, d = 0; d < c.length; d++) g(c[d])
  1393. }
  1394. };
  1395. g(b);
  1396. return new CKEDITOR.dom.node(b)
  1397. },
  1398. hasPrevious: function() {
  1399. return !!this.$.previousSibling
  1400. },
  1401. hasNext: function() {
  1402. return !!this.$.nextSibling
  1403. },
  1404. insertAfter: function(a) {
  1405. a.$.parentNode.insertBefore(this.$, a.$.nextSibling);
  1406. return a
  1407. },
  1408. insertBefore: function(a) {
  1409. a.$.parentNode.insertBefore(this.$, a.$);
  1410. return a
  1411. },
  1412. insertBeforeMe: function(a) {
  1413. this.$.parentNode.insertBefore(a.$, this.$);
  1414. return a
  1415. },
  1416. getAddress: function(a) {
  1417. for(var e = [], b = this.getDocument().$.documentElement, g = this.$; g && g != b;) {
  1418. var c = g.parentNode;
  1419. c && e.unshift(this.getIndex.call({
  1420. $: g
  1421. },
  1422. a));
  1423. g = c
  1424. }
  1425. return e
  1426. },
  1427. getDocument: function() {
  1428. return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument)
  1429. },
  1430. getIndex: function(a) {
  1431. function e(a, c) {
  1432. var b = c ? a.nextSibling : a.previousSibling;
  1433. return !b || b.nodeType != CKEDITOR.NODE_TEXT ? null : b.nodeValue ? b : e(b, c)
  1434. }
  1435. var b = this.$,
  1436. g = -1,
  1437. c;
  1438. if(!this.$.parentNode || a && b.nodeType == CKEDITOR.NODE_TEXT && !b.nodeValue && !e(b) && !e(b, true)) return -1;
  1439. do
  1440. if(!a || !(b != this.$ && b.nodeType == CKEDITOR.NODE_TEXT && (c || !b.nodeValue))) {
  1441. g++;
  1442. c = b.nodeType == CKEDITOR.NODE_TEXT
  1443. }
  1444. while(b =
  1445. b.previousSibling);
  1446. return g
  1447. },
  1448. getNextSourceNode: function(a, e, b) {
  1449. if(b && !b.call) var g = b,
  1450. b = function(a) {
  1451. return !a.equals(g)
  1452. };
  1453. var a = !a && this.getFirst && this.getFirst(),
  1454. c;
  1455. if(!a) {
  1456. if(this.type == CKEDITOR.NODE_ELEMENT && b && b(this, true) === false) return null;
  1457. a = this.getNext()
  1458. }
  1459. for(; !a && (c = (c || this).getParent());) {
  1460. if(b && b(c, true) === false) return null;
  1461. a = c.getNext()
  1462. }
  1463. return !a || b && b(a) === false ? null : e && e != a.type ? a.getNextSourceNode(false, e, b) : a
  1464. },
  1465. getPreviousSourceNode: function(a, e, b) {
  1466. if(b && !b.call) var g = b,
  1467. b = function(a) {
  1468. return !a.equals(g)
  1469. };
  1470. var a = !a && this.getLast && this.getLast(),
  1471. c;
  1472. if(!a) {
  1473. if(this.type == CKEDITOR.NODE_ELEMENT && b && b(this, true) === false) return null;
  1474. a = this.getPrevious()
  1475. }
  1476. for(; !a && (c = (c || this).getParent());) {
  1477. if(b && b(c, true) === false) return null;
  1478. a = c.getPrevious()
  1479. }
  1480. return !a || b && b(a) === false ? null : e && a.type != e ? a.getPreviousSourceNode(false, e, b) : a
  1481. },
  1482. getPrevious: function(a) {
  1483. var e = this.$,
  1484. b;
  1485. do b = (e = e.previousSibling) && e.nodeType != 10 && new CKEDITOR.dom.node(e); while (b && a && !a(b));
  1486. return b
  1487. },
  1488. getNext: function(a) {
  1489. var e = this.$,
  1490. b;
  1491. do b = (e = e.nextSibling) &&
  1492. new CKEDITOR.dom.node(e); while (b && a && !a(b));
  1493. return b
  1494. },
  1495. getParent: function(a) {
  1496. var e = this.$.parentNode;
  1497. return e && (e.nodeType == CKEDITOR.NODE_ELEMENT || a && e.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ? new CKEDITOR.dom.node(e) : null
  1498. },
  1499. getParents: function(a) {
  1500. var e = this,
  1501. b = [];
  1502. do b[a ? "push" : "unshift"](e); while (e = e.getParent());
  1503. return b
  1504. },
  1505. getCommonAncestor: function(a) {
  1506. if(a.equals(this)) return this;
  1507. if(a.contains && a.contains(this)) return a;
  1508. var e = this.contains ? this : this.getParent();
  1509. do
  1510. if(e.contains(a)) return e;
  1511. while(e =
  1512. e.getParent());
  1513. return null
  1514. },
  1515. getPosition: function(a) {
  1516. var e = this.$,
  1517. b = a.$;
  1518. if(e.compareDocumentPosition) return e.compareDocumentPosition(b);
  1519. if(e == b) return CKEDITOR.POSITION_IDENTICAL;
  1520. if(this.type == CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) {
  1521. if(e.contains) {
  1522. if(e.contains(b)) return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING;
  1523. if(b.contains(e)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1524. }
  1525. if("sourceIndex" in e) return e.sourceIndex < 0 || b.sourceIndex < 0 ? CKEDITOR.POSITION_DISCONNECTED :
  1526. e.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
  1527. }
  1528. for(var e = this.getAddress(), a = a.getAddress(), b = Math.min(e.length, a.length), g = 0; g <= b - 1; g++)
  1529. if(e[g] != a[g]) {
  1530. if(g < b) return e[g] < a[g] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
  1531. break
  1532. }
  1533. return e.length < a.length ? CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1534. },
  1535. getAscendant: function(a, e) {
  1536. var b = this.$,
  1537. g, c;
  1538. if(!e) b = b.parentNode;
  1539. if(typeof a == "function") {
  1540. c =
  1541. true;
  1542. g = a
  1543. } else {
  1544. c = false;
  1545. g = function(c) {
  1546. c = typeof c.nodeName == "string" ? c.nodeName.toLowerCase() : "";
  1547. return typeof a == "string" ? c == a : c in a
  1548. }
  1549. }
  1550. for(; b;) {
  1551. if(g(c ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b);
  1552. try {
  1553. b = b.parentNode
  1554. } catch(d) {
  1555. b = null
  1556. }
  1557. }
  1558. return null
  1559. },
  1560. hasAscendant: function(a, e) {
  1561. var b = this.$;
  1562. if(!e) b = b.parentNode;
  1563. for(; b;) {
  1564. if(b.nodeName && b.nodeName.toLowerCase() == a) return true;
  1565. b = b.parentNode
  1566. }
  1567. return false
  1568. },
  1569. move: function(a, e) {
  1570. a.append(this.remove(), e)
  1571. },
  1572. remove: function(a) {
  1573. var e = this.$,
  1574. b = e.parentNode;
  1575. if(b) {
  1576. if(a)
  1577. for(; a = e.firstChild;) b.insertBefore(e.removeChild(a), e);
  1578. b.removeChild(e)
  1579. }
  1580. return this
  1581. },
  1582. replace: function(a) {
  1583. this.insertBefore(a);
  1584. a.remove()
  1585. },
  1586. trim: function() {
  1587. this.ltrim();
  1588. this.rtrim()
  1589. },
  1590. ltrim: function() {
  1591. for(var a; this.getFirst && (a = this.getFirst());) {
  1592. if(a.type == CKEDITOR.NODE_TEXT) {
  1593. var e = CKEDITOR.tools.ltrim(a.getText()),
  1594. b = a.getLength();
  1595. if(e) {
  1596. if(e.length < b) {
  1597. a.split(b - e.length);
  1598. this.$.removeChild(this.$.firstChild)
  1599. }
  1600. } else {
  1601. a.remove();
  1602. continue
  1603. }
  1604. }
  1605. break
  1606. }
  1607. },
  1608. rtrim: function() {
  1609. for(var a; this.getLast && (a =
  1610. this.getLast());) {
  1611. if(a.type == CKEDITOR.NODE_TEXT) {
  1612. var e = CKEDITOR.tools.rtrim(a.getText()),
  1613. b = a.getLength();
  1614. if(e) {
  1615. if(e.length < b) {
  1616. a.split(e.length);
  1617. this.$.lastChild.parentNode.removeChild(this.$.lastChild)
  1618. }
  1619. } else {
  1620. a.remove();
  1621. continue
  1622. }
  1623. }
  1624. break
  1625. }
  1626. if(CKEDITOR.env.needsBrFiller)(a = this.$.lastChild) && (a.type == 1 && a.nodeName.toLowerCase() == "br") && a.parentNode.removeChild(a)
  1627. },
  1628. isReadOnly: function() {
  1629. var a = this;
  1630. this.type != CKEDITOR.NODE_ELEMENT && (a = this.getParent());
  1631. if(a && typeof a.$.isContentEditable != "undefined") return !(a.$.isContentEditable ||
  1632. a.data("cke-editable"));
  1633. for(; a;) {
  1634. if(a.data("cke-editable")) break;
  1635. if(a.getAttribute("contentEditable") == "false") return true;
  1636. if(a.getAttribute("contentEditable") == "true") break;
  1637. a = a.getParent()
  1638. }
  1639. return !a
  1640. }
  1641. }), CKEDITOR.dom.window = function(a) {
  1642. CKEDITOR.dom.domObject.call(this, a)
  1643. }, CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject, CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
  1644. focus: function() {
  1645. this.$.focus()
  1646. },
  1647. getViewPaneSize: function() {
  1648. var a = this.$.document,
  1649. e = a.compatMode == "CSS1Compat";
  1650. return {
  1651. width: (e ?
  1652. a.documentElement.clientWidth : a.body.clientWidth) || 0,
  1653. height: (e ? a.documentElement.clientHeight : a.body.clientHeight) || 0
  1654. }
  1655. },
  1656. getScrollPosition: function() {
  1657. var a = this.$;
  1658. if("pageXOffset" in a) return {
  1659. x: a.pageXOffset || 0,
  1660. y: a.pageYOffset || 0
  1661. };
  1662. a = a.document;
  1663. return {
  1664. x: a.documentElement.scrollLeft || a.body.scrollLeft || 0,
  1665. y: a.documentElement.scrollTop || a.body.scrollTop || 0
  1666. }
  1667. },
  1668. getFrame: function() {
  1669. var a = this.$.frameElement;
  1670. return a ? new CKEDITOR.dom.element.get(a) : null
  1671. }
  1672. }), CKEDITOR.dom.document = function(a) {
  1673. CKEDITOR.dom.domObject.call(this,
  1674. a)
  1675. }, CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject, CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
  1676. type: CKEDITOR.NODE_DOCUMENT,
  1677. appendStyleSheet: function(a) {
  1678. if(this.$.createStyleSheet) this.$.createStyleSheet(a);
  1679. else {
  1680. var e = new CKEDITOR.dom.element("link");
  1681. e.setAttributes({
  1682. rel: "stylesheet",
  1683. type: "text/css",
  1684. href: a
  1685. });
  1686. this.getHead().append(e)
  1687. }
  1688. },
  1689. appendStyleText: function(a) {
  1690. if(this.$.createStyleSheet) {
  1691. var e = this.$.createStyleSheet("");
  1692. e.cssText = a
  1693. } else {
  1694. var b = new CKEDITOR.dom.element("style",
  1695. this);
  1696. b.append(new CKEDITOR.dom.text(a, this));
  1697. this.getHead().append(b)
  1698. }
  1699. return e || b.$.sheet
  1700. },
  1701. createElement: function(a, e) {
  1702. var b = new CKEDITOR.dom.element(a, this);
  1703. if(e) {
  1704. e.attributes && b.setAttributes(e.attributes);
  1705. e.styles && b.setStyles(e.styles)
  1706. }
  1707. return b
  1708. },
  1709. createText: function(a) {
  1710. return new CKEDITOR.dom.text(a, this)
  1711. },
  1712. focus: function() {
  1713. this.getWindow().focus()
  1714. },
  1715. getActive: function() {
  1716. var a;
  1717. try {
  1718. a = this.$.activeElement
  1719. } catch(e) {
  1720. return null
  1721. }
  1722. return new CKEDITOR.dom.element(a)
  1723. },
  1724. getById: function(a) {
  1725. return(a = this.$.getElementById(a)) ?
  1726. new CKEDITOR.dom.element(a) : null
  1727. },
  1728. getByAddress: function(a, e) {
  1729. for(var b = this.$.documentElement, g = 0; b && g < a.length; g++) {
  1730. var c = a[g];
  1731. if(e)
  1732. for(var d = -1, j = 0; j < b.childNodes.length; j++) {
  1733. var f = b.childNodes[j];
  1734. if(!(e === true && f.nodeType == 3 && f.previousSibling && f.previousSibling.nodeType == 3)) {
  1735. d++;
  1736. if(d == c) {
  1737. b = f;
  1738. break
  1739. }
  1740. }
  1741. } else b = b.childNodes[c]
  1742. }
  1743. return b ? new CKEDITOR.dom.node(b) : null
  1744. },
  1745. getElementsByTag: function(a, e) {
  1746. !(CKEDITOR.env.ie && document.documentMode <= 8) && e && (a = e + ":" + a);
  1747. return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))
  1748. },
  1749. getHead: function() {
  1750. var a = this.$.getElementsByTagName("head")[0];
  1751. return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), true)
  1752. },
  1753. getBody: function() {
  1754. return new CKEDITOR.dom.element(this.$.body)
  1755. },
  1756. getDocumentElement: function() {
  1757. return new CKEDITOR.dom.element(this.$.documentElement)
  1758. },
  1759. getWindow: function() {
  1760. return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView)
  1761. },
  1762. write: function(a) {
  1763. this.$.open("text/html", "replace");
  1764. CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,
  1765. '$&\n<script data-cke-temp="1">(' + CKEDITOR.tools.fixDomain + ")();<\/script>"));
  1766. this.$.write(a);
  1767. this.$.close()
  1768. },
  1769. find: function(a) {
  1770. return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))
  1771. },
  1772. findOne: function(a) {
  1773. return(a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null
  1774. },
  1775. _getHtml5ShivFrag: function() {
  1776. var a = this.getCustomData("html5ShivFrag");
  1777. if(!a) {
  1778. a = this.$.createDocumentFragment();
  1779. CKEDITOR.tools.enableHtml5Elements(a, true);
  1780. this.setCustomData("html5ShivFrag", a)
  1781. }
  1782. return a
  1783. }
  1784. }), CKEDITOR.dom.nodeList =
  1785. function(a) {
  1786. this.$ = a
  1787. }, CKEDITOR.dom.nodeList.prototype = {
  1788. count: function() {
  1789. return this.$.length
  1790. },
  1791. getItem: function(a) {
  1792. if(a < 0 || a >= this.$.length) return null;
  1793. return(a = this.$[a]) ? new CKEDITOR.dom.node(a) : null
  1794. }
  1795. }, CKEDITOR.dom.element = function(a, e) {
  1796. typeof a == "string" && (a = (e ? e.$ : document).createElement(a));
  1797. CKEDITOR.dom.domObject.call(this, a)
  1798. }, CKEDITOR.dom.element.get = function(a) {
  1799. return(a = typeof a == "string" ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a))
  1800. }, CKEDITOR.dom.element.prototype =
  1801. new CKEDITOR.dom.node, CKEDITOR.dom.element.createFromHtml = function(a, e) {
  1802. var b = new CKEDITOR.dom.element("div", e);
  1803. b.setHtml(a);
  1804. return b.getFirst().remove()
  1805. }, CKEDITOR.dom.element.setMarker = function(a, e, b, g) {
  1806. var c = e.getCustomData("list_marker_id") || e.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
  1807. d = e.getCustomData("list_marker_names") || e.setCustomData("list_marker_names", {}).getCustomData("list_marker_names");
  1808. a[c] = e;
  1809. d[b] = 1;
  1810. return e.setCustomData(b, g)
  1811. }, CKEDITOR.dom.element.clearAllMarkers =
  1812. function(a) {
  1813. for(var e in a) CKEDITOR.dom.element.clearMarkers(a, a[e], 1)
  1814. }, CKEDITOR.dom.element.clearMarkers = function(a, e, b) {
  1815. var g = e.getCustomData("list_marker_names"),
  1816. c = e.getCustomData("list_marker_id"),
  1817. d;
  1818. for(d in g) e.removeCustomData(d);
  1819. e.removeCustomData("list_marker_names");
  1820. if(b) {
  1821. e.removeCustomData("list_marker_id");
  1822. delete a[c]
  1823. }
  1824. },
  1825. function() {
  1826. function a(a) {
  1827. var d = true;
  1828. if(!a.$.id) {
  1829. a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber();
  1830. d = false
  1831. }
  1832. return function() {
  1833. d || a.removeAttribute("id")
  1834. }
  1835. }
  1836. function e(a, d) {
  1837. return "#" +
  1838. a.$.id + " " + d.split(/,\s*/).join(", #" + a.$.id + " ")
  1839. }
  1840. function b(a) {
  1841. for(var d = 0, b = 0, f = g[a].length; b < f; b++) d = d + (parseInt(this.getComputedStyle(g[a][b]) || 0, 10) || 0);
  1842. return d
  1843. }
  1844. CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
  1845. type: CKEDITOR.NODE_ELEMENT,
  1846. addClass: function(a) {
  1847. var d = this.$.className;
  1848. d && (RegExp("(?:^|\\s)" + a + "(?:\\s|$)", "").test(d) || (d = d + (" " + a)));
  1849. this.$.className = d || a;
  1850. return this
  1851. },
  1852. removeClass: function(a) {
  1853. var d = this.getAttribute("class");
  1854. if(d) {
  1855. a = RegExp("(?:^|\\s+)" + a + "(?=\\s|$)", "i");
  1856. if(a.test(d))(d =
  1857. d.replace(a, "").replace(/^\s+/, "")) ? this.setAttribute("class", d) : this.removeAttribute("class")
  1858. }
  1859. return this
  1860. },
  1861. hasClass: function(a) {
  1862. return RegExp("(?:^|\\s+)" + a + "(?=\\s|$)", "").test(this.getAttribute("class"))
  1863. },
  1864. append: function(a, d) {
  1865. typeof a == "string" && (a = this.getDocument().createElement(a));
  1866. d ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$);
  1867. return a
  1868. },
  1869. appendHtml: function(a) {
  1870. if(this.$.childNodes.length) {
  1871. var d = new CKEDITOR.dom.element("div", this.getDocument());
  1872. d.setHtml(a);
  1873. d.moveChildren(this)
  1874. } else this.setHtml(a)
  1875. },
  1876. appendText: function(a) {
  1877. this.$.text != null ? this.$.text = this.$.text + a : this.append(new CKEDITOR.dom.text(a))
  1878. },
  1879. appendBogus: function(a) {
  1880. if(a || CKEDITOR.env.needsBrFiller) {
  1881. for(a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) a = a.getPrevious();
  1882. if(!a || !a.is || !a.is("br")) {
  1883. a = this.getDocument().createElement("br");
  1884. CKEDITOR.env.gecko && a.setAttribute("type", "_moz");
  1885. this.append(a)
  1886. }
  1887. }
  1888. },
  1889. breakParent: function(a) {
  1890. var d = new CKEDITOR.dom.range(this.getDocument());
  1891. d.setStartAfter(this);
  1892. d.setEndAfter(a);
  1893. a = d.extractContents();
  1894. d.insertNode(this.remove());
  1895. a.insertAfterNode(this)
  1896. },
  1897. contains: CKEDITOR.env.ie || CKEDITOR.env.webkit ? function(a) {
  1898. var d = this.$;
  1899. return a.type != CKEDITOR.NODE_ELEMENT ? d.contains(a.getParent().$) : d != a.$ && d.contains(a.$)
  1900. } : function(a) {
  1901. return !!(this.$.compareDocumentPosition(a.$) & 16)
  1902. },
  1903. focus: function() {
  1904. function a() {
  1905. try {
  1906. this.$.focus()
  1907. } catch(c) {}
  1908. }
  1909. return function(d) {
  1910. d ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this)
  1911. }
  1912. }(),
  1913. getHtml: function() {
  1914. var a = this.$.innerHTML;
  1915. return CKEDITOR.env.ie ?
  1916. a.replace(/<\?[^>]*>/g, "") : a
  1917. },
  1918. getOuterHtml: function() {
  1919. if(this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
  1920. var a = this.$.ownerDocument.createElement("div");
  1921. a.appendChild(this.$.cloneNode(true));
  1922. return a.innerHTML
  1923. },
  1924. getClientRect: function() {
  1925. var a = CKEDITOR.tools.extend({}, this.$.getBoundingClientRect());
  1926. !a.width && (a.width = a.right - a.left);
  1927. !a.height && (a.height = a.bottom - a.top);
  1928. return a
  1929. },
  1930. setHtml: CKEDITOR.env.ie && CKEDITOR.env.version < 9 ? function(a) {
  1931. try {
  1932. var d = this.$;
  1933. if(this.getParent()) return d.innerHTML =
  1934. a;
  1935. var b = this.getDocument()._getHtml5ShivFrag();
  1936. b.appendChild(d);
  1937. d.innerHTML = a;
  1938. b.removeChild(d);
  1939. return a
  1940. } catch(f) {
  1941. this.$.innerHTML = "";
  1942. d = new CKEDITOR.dom.element("body", this.getDocument());
  1943. d.$.innerHTML = a;
  1944. for(d = d.getChildren(); d.count();) this.append(d.getItem(0));
  1945. return a
  1946. }
  1947. } : function(a) {
  1948. return this.$.innerHTML = a
  1949. },
  1950. setText: function() {
  1951. var a = document.createElement("p");
  1952. a.innerHTML = "x";
  1953. a = a.textContent;
  1954. return function(d) {
  1955. this.$[a ? "textContent" : "innerText"] = d
  1956. }
  1957. }(),
  1958. getAttribute: function() {
  1959. var a = function(a) {
  1960. return this.$.getAttribute(a,
  1961. 2)
  1962. };
  1963. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  1964. switch(a) {
  1965. case "class":
  1966. a = "className";
  1967. break;
  1968. case "http-equiv":
  1969. a = "httpEquiv";
  1970. break;
  1971. case "name":
  1972. return this.$.name;
  1973. case "tabindex":
  1974. a = this.$.getAttribute(a, 2);
  1975. a !== 0 && this.$.tabIndex === 0 && (a = null);
  1976. return a;
  1977. case "checked":
  1978. a = this.$.attributes.getNamedItem(a);
  1979. return(a.specified ? a.nodeValue : this.$.checked) ? "checked" : null;
  1980. case "hspace":
  1981. case "value":
  1982. return this.$[a];
  1983. case "style":
  1984. return this.$.style.cssText;
  1985. case "contenteditable":
  1986. case "contentEditable":
  1987. return this.$.attributes.getNamedItem("contentEditable").specified ?
  1988. this.$.getAttribute("contentEditable") : null
  1989. }
  1990. return this.$.getAttribute(a, 2)
  1991. } : a
  1992. }(),
  1993. getChildren: function() {
  1994. return new CKEDITOR.dom.nodeList(this.$.childNodes)
  1995. },
  1996. getComputedStyle: CKEDITOR.env.ie ? function(a) {
  1997. return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]
  1998. } : function(a) {
  1999. var d = this.getWindow().$.getComputedStyle(this.$, null);
  2000. return d ? d.getPropertyValue(a) : ""
  2001. },
  2002. getDtd: function() {
  2003. var a = CKEDITOR.dtd[this.getName()];
  2004. this.getDtd = function() {
  2005. return a
  2006. };
  2007. return a
  2008. },
  2009. getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag,
  2010. getTabIndex: CKEDITOR.env.ie ? function() {
  2011. var a = this.$.tabIndex;
  2012. a === 0 && (!CKEDITOR.dtd.$tabIndex[this.getName()] && parseInt(this.getAttribute("tabindex"), 10) !== 0) && (a = -1);
  2013. return a
  2014. } : CKEDITOR.env.webkit ? function() {
  2015. var a = this.$.tabIndex;
  2016. if(a === void 0) {
  2017. a = parseInt(this.getAttribute("tabindex"), 10);
  2018. isNaN(a) && (a = -1)
  2019. }
  2020. return a
  2021. } : function() {
  2022. return this.$.tabIndex
  2023. },
  2024. getText: function() {
  2025. return this.$.textContent || this.$.innerText || ""
  2026. },
  2027. getWindow: function() {
  2028. return this.getDocument().getWindow()
  2029. },
  2030. getId: function() {
  2031. return this.$.id ||
  2032. null
  2033. },
  2034. getNameAtt: function() {
  2035. return this.$.name || null
  2036. },
  2037. getName: function() {
  2038. var a = this.$.nodeName.toLowerCase();
  2039. if(CKEDITOR.env.ie && document.documentMode <= 8) {
  2040. var d = this.$.scopeName;
  2041. d != "HTML" && (a = d.toLowerCase() + ":" + a)
  2042. }
  2043. this.getName = function() {
  2044. return a
  2045. };
  2046. return this.getName()
  2047. },
  2048. getValue: function() {
  2049. return this.$.value
  2050. },
  2051. getFirst: function(a) {
  2052. var d = this.$.firstChild;
  2053. (d = d && new CKEDITOR.dom.node(d)) && (a && !a(d)) && (d = d.getNext(a));
  2054. return d
  2055. },
  2056. getLast: function(a) {
  2057. var d = this.$.lastChild;
  2058. (d = d && new CKEDITOR.dom.node(d)) &&
  2059. (a && !a(d)) && (d = d.getPrevious(a));
  2060. return d
  2061. },
  2062. getStyle: function(a) {
  2063. return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2064. },
  2065. is: function() {
  2066. var a = this.getName();
  2067. if(typeof arguments[0] == "object") return !!arguments[0][a];
  2068. for(var d = 0; d < arguments.length; d++)
  2069. if(arguments[d] == a) return true;
  2070. return false
  2071. },
  2072. isEditable: function(a) {
  2073. var d = this.getName();
  2074. if(this.isReadOnly() || this.getComputedStyle("display") == "none" || this.getComputedStyle("visibility") == "hidden" || CKEDITOR.dtd.$nonEditable[d] || CKEDITOR.dtd.$empty[d] ||
  2075. this.is("a") && (this.data("cke-saved-name") || this.hasAttribute("name")) && !this.getChildCount()) return false;
  2076. if(a !== false) {
  2077. a = CKEDITOR.dtd[d] || CKEDITOR.dtd.span;
  2078. return !(!a || !a["#"])
  2079. }
  2080. return true
  2081. },
  2082. isIdentical: function(a) {
  2083. var d = this.clone(0, 1),
  2084. a = a.clone(0, 1);
  2085. d.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2086. a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2087. if(d.$.isEqualNode) {
  2088. d.$.style.cssText = CKEDITOR.tools.normalizeCssText(d.$.style.cssText);
  2089. a.$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText);
  2090. return d.$.isEqualNode(a.$)
  2091. }
  2092. d = d.getOuterHtml();
  2093. a = a.getOuterHtml();
  2094. if(CKEDITOR.env.ie && CKEDITOR.env.version < 9 && this.is("a")) {
  2095. var b = this.getParent();
  2096. if(b.type == CKEDITOR.NODE_ELEMENT) {
  2097. b = b.clone();
  2098. b.setHtml(d);
  2099. d = b.getHtml();
  2100. b.setHtml(a);
  2101. a = b.getHtml()
  2102. }
  2103. }
  2104. return d == a
  2105. },
  2106. isVisible: function() {
  2107. var a = (this.$.offsetHeight || this.$.offsetWidth) && this.getComputedStyle("visibility") != "hidden",
  2108. d, b;
  2109. if(a && CKEDITOR.env.webkit) {
  2110. d = this.getWindow();
  2111. if(!d.equals(CKEDITOR.document.getWindow()) &&
  2112. (b = d.$.frameElement)) a = (new CKEDITOR.dom.element(b)).isVisible()
  2113. }
  2114. return !!a
  2115. },
  2116. isEmptyInlineRemoveable: function() {
  2117. if(!CKEDITOR.dtd.$removeEmpty[this.getName()]) return false;
  2118. for(var a = this.getChildren(), d = 0, b = a.count(); d < b; d++) {
  2119. var f = a.getItem(d);
  2120. if(!(f.type == CKEDITOR.NODE_ELEMENT && f.data("cke-bookmark")) && (f.type == CKEDITOR.NODE_ELEMENT && !f.isEmptyInlineRemoveable() || f.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(f.getText()))) return false
  2121. }
  2122. return true
  2123. },
  2124. hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat ||
  2125. CKEDITOR.env.quirks) ? function() {
  2126. for(var a = this.$.attributes, d = 0; d < a.length; d++) {
  2127. var b = a[d];
  2128. switch(b.nodeName) {
  2129. case "class":
  2130. if(this.getAttribute("class")) return true;
  2131. case "data-cke-expando":
  2132. continue;
  2133. default:
  2134. if(b.specified) return true
  2135. }
  2136. }
  2137. return false
  2138. } : function() {
  2139. var a = this.$.attributes,
  2140. d = a.length,
  2141. b = {
  2142. "data-cke-expando": 1,
  2143. _moz_dirty: 1
  2144. };
  2145. return d > 0 && (d > 2 || !b[a[0].nodeName] || d == 2 && !b[a[1].nodeName])
  2146. },
  2147. hasAttribute: function() {
  2148. function a(c) {
  2149. var b = this.$.attributes.getNamedItem(c);
  2150. if(this.getName() == "input") switch(c) {
  2151. case "class":
  2152. return this.$.className.length >
  2153. 0;
  2154. case "checked":
  2155. return !!this.$.checked;
  2156. case "value":
  2157. c = this.getAttribute("type");
  2158. return c == "checkbox" || c == "radio" ? this.$.value != "on" : !!this.$.value
  2159. }
  2160. return !b ? false : b.specified
  2161. }
  2162. return CKEDITOR.env.ie ? CKEDITOR.env.version < 8 ? function(d) {
  2163. return d == "name" ? !!this.$.name : a.call(this, d)
  2164. } : a : function(a) {
  2165. return !!this.$.attributes.getNamedItem(a)
  2166. }
  2167. }(),
  2168. hide: function() {
  2169. this.setStyle("display", "none")
  2170. },
  2171. moveChildren: function(a, d) {
  2172. var b = this.$,
  2173. a = a.$;
  2174. if(b != a) {
  2175. var f;
  2176. if(d)
  2177. for(; f = b.lastChild;) a.insertBefore(b.removeChild(f),
  2178. a.firstChild);
  2179. else
  2180. for(; f = b.firstChild;) a.appendChild(b.removeChild(f))
  2181. }
  2182. },
  2183. mergeSiblings: function() {
  2184. function a(c, b, f) {
  2185. if(b && b.type == CKEDITOR.NODE_ELEMENT) {
  2186. for(var g = []; b.data("cke-bookmark") || b.isEmptyInlineRemoveable();) {
  2187. g.push(b);
  2188. b = f ? b.getNext() : b.getPrevious();
  2189. if(!b || b.type != CKEDITOR.NODE_ELEMENT) return
  2190. }
  2191. if(c.isIdentical(b)) {
  2192. for(var e = f ? c.getLast() : c.getFirst(); g.length;) g.shift().move(c, !f);
  2193. b.moveChildren(c, !f);
  2194. b.remove();
  2195. e && e.type == CKEDITOR.NODE_ELEMENT && e.mergeSiblings()
  2196. }
  2197. }
  2198. }
  2199. return function(d) {
  2200. if(d ===
  2201. false || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) {
  2202. a(this, this.getNext(), true);
  2203. a(this, this.getPrevious())
  2204. }
  2205. }
  2206. }(),
  2207. show: function() {
  2208. this.setStyles({
  2209. display: "",
  2210. visibility: ""
  2211. })
  2212. },
  2213. setAttribute: function() {
  2214. var a = function(a, c) {
  2215. this.$.setAttribute(a, c);
  2216. return this
  2217. };
  2218. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(d, b) {
  2219. d == "class" ? this.$.className = b : d == "style" ? this.$.style.cssText = b : d == "tabindex" ? this.$.tabIndex = b : d == "checked" ? this.$.checked = b : d == "contenteditable" ? a.call(this,
  2220. "contentEditable", b) : a.apply(this, arguments);
  2221. return this
  2222. } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(b, g) {
  2223. if(b == "src" && g.match(/^http:\/\//)) try {
  2224. a.apply(this, arguments)
  2225. } catch(f) {} else a.apply(this, arguments);
  2226. return this
  2227. } : a
  2228. }(),
  2229. setAttributes: function(a) {
  2230. for(var b in a) this.setAttribute(b, a[b]);
  2231. return this
  2232. },
  2233. setValue: function(a) {
  2234. this.$.value = a;
  2235. return this
  2236. },
  2237. removeAttribute: function() {
  2238. var a = function(a) {
  2239. this.$.removeAttribute(a)
  2240. };
  2241. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ?
  2242. function(a) {
  2243. a == "class" ? a = "className" : a == "tabindex" ? a = "tabIndex" : a == "contenteditable" && (a = "contentEditable");
  2244. this.$.removeAttribute(a)
  2245. } : a
  2246. }(),
  2247. removeAttributes: function(a) {
  2248. if(CKEDITOR.tools.isArray(a))
  2249. for(var b = 0; b < a.length; b++) this.removeAttribute(a[b]);
  2250. else
  2251. for(b in a) a.hasOwnProperty(b) && this.removeAttribute(b)
  2252. },
  2253. removeStyle: function(a) {
  2254. var b = this.$.style;
  2255. if(!b.removeProperty && (a == "border" || a == "margin" || a == "padding")) {
  2256. var g = ["top", "left", "right", "bottom"],
  2257. f;
  2258. a == "border" && (f = ["color", "style", "width"]);
  2259. for(var b = [], h = 0; h < g.length; h++)
  2260. if(f)
  2261. for(var e = 0; e < f.length; e++) b.push([a, g[h], f[e]].join("-"));
  2262. else b.push([a, g[h]].join("-"));
  2263. for(a = 0; a < b.length; a++) this.removeStyle(b[a])
  2264. } else {
  2265. b.removeProperty ? b.removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a));
  2266. this.$.style.cssText || this.removeAttribute("style")
  2267. }
  2268. },
  2269. setStyle: function(a, b) {
  2270. this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b;
  2271. return this
  2272. },
  2273. setStyles: function(a) {
  2274. for(var b in a) this.setStyle(b, a[b]);
  2275. return this
  2276. },
  2277. setOpacity: function(a) {
  2278. if(CKEDITOR.env.ie &&
  2279. CKEDITOR.env.version < 9) {
  2280. a = Math.round(a * 100);
  2281. this.setStyle("filter", a >= 100 ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity=" + a + ")")
  2282. } else this.setStyle("opacity", a)
  2283. },
  2284. unselectable: function() {
  2285. this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "none"));
  2286. if(CKEDITOR.env.ie) {
  2287. this.setAttribute("unselectable", "on");
  2288. for(var a, b = this.getElementsByTag("*"), g = 0, f = b.count(); g < f; g++) {
  2289. a = b.getItem(g);
  2290. a.setAttribute("unselectable", "on")
  2291. }
  2292. }
  2293. },
  2294. getPositionedAncestor: function() {
  2295. for(var a = this; a.getName() != "html";) {
  2296. if(a.getComputedStyle("position") !=
  2297. "static") return a;
  2298. a = a.getParent()
  2299. }
  2300. return null
  2301. },
  2302. getDocumentPosition: function(a) {
  2303. var b = 0,
  2304. g = 0,
  2305. f = this.getDocument(),
  2306. h = f.getBody(),
  2307. e = CKEDITOR.env.quirks;
  2308. if(document.documentElement.getBoundingClientRect) {
  2309. var k = this.$.getBoundingClientRect(),
  2310. n = f.$.documentElement,
  2311. o = n.clientTop || h.$.clientTop || 0,
  2312. q = n.clientLeft || h.$.clientLeft || 0,
  2313. m = true;
  2314. if(CKEDITOR.env.ie) {
  2315. m = f.getDocumentElement().contains(this);
  2316. f = f.getBody().contains(this);
  2317. m = e && f || !e && m
  2318. }
  2319. if(m) {
  2320. if(CKEDITOR.env.webkit) {
  2321. b = h.$.scrollLeft || n.scrollLeft;
  2322. g = h.$.scrollTop ||
  2323. n.scrollTop
  2324. } else {
  2325. g = e ? h.$ : n;
  2326. b = g.scrollLeft;
  2327. g = g.scrollTop
  2328. }
  2329. b = k.left + b - q;
  2330. g = k.top + g - o
  2331. }
  2332. } else {
  2333. o = this;
  2334. for(q = null; o && !(o.getName() == "body" || o.getName() == "html");) {
  2335. b = b + (o.$.offsetLeft - o.$.scrollLeft);
  2336. g = g + (o.$.offsetTop - o.$.scrollTop);
  2337. if(!o.equals(this)) {
  2338. b = b + (o.$.clientLeft || 0);
  2339. g = g + (o.$.clientTop || 0)
  2340. }
  2341. for(; q && !q.equals(o);) {
  2342. b = b - q.$.scrollLeft;
  2343. g = g - q.$.scrollTop;
  2344. q = q.getParent()
  2345. }
  2346. q = o;
  2347. o = (k = o.$.offsetParent) ? new CKEDITOR.dom.element(k) : null
  2348. }
  2349. }
  2350. if(a) {
  2351. k = this.getWindow();
  2352. o = a.getWindow();
  2353. if(!k.equals(o) && k.$.frameElement) {
  2354. a =
  2355. (new CKEDITOR.dom.element(k.$.frameElement)).getDocumentPosition(a);
  2356. b = b + a.x;
  2357. g = g + a.y
  2358. }
  2359. }
  2360. if(!document.documentElement.getBoundingClientRect && CKEDITOR.env.gecko && !e) {
  2361. b = b + (this.$.clientLeft ? 1 : 0);
  2362. g = g + (this.$.clientTop ? 1 : 0)
  2363. }
  2364. return {
  2365. x: b,
  2366. y: g
  2367. }
  2368. },
  2369. scrollIntoView: function(a) {
  2370. var b = this.getParent();
  2371. if(b) {
  2372. do {
  2373. (b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1);
  2374. if(b.is("html")) {
  2375. var g = b.getWindow();
  2376. try {
  2377. var f = g.$.frameElement;
  2378. f && (b = new CKEDITOR.dom.element(f))
  2379. } catch(h) {}
  2380. }
  2381. } while (b = b.getParent())
  2382. }
  2383. },
  2384. scrollIntoParent: function(a, b, g) {
  2385. var f, h, e, k;
  2386. function n(b, d) {
  2387. if(/body|html/.test(a.getName())) a.getWindow().$.scrollBy(b, d);
  2388. else {
  2389. a.$.scrollLeft = a.$.scrollLeft + b;
  2390. a.$.scrollTop = a.$.scrollTop + d
  2391. }
  2392. }
  2393. function o(a, b) {
  2394. var c = {
  2395. x: 0,
  2396. y: 0
  2397. };
  2398. if(!a.is(m ? "body" : "html")) {
  2399. var d = a.$.getBoundingClientRect();
  2400. c.x = d.left;
  2401. c.y = d.top
  2402. }
  2403. d = a.getWindow();
  2404. if(!d.equals(b)) {
  2405. d = o(CKEDITOR.dom.element.get(d.$.frameElement), b);
  2406. c.x = c.x + d.x;
  2407. c.y = c.y + d.y
  2408. }
  2409. return c
  2410. }
  2411. function q(a,
  2412. b) {
  2413. return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0
  2414. }!a && (a = this.getWindow());
  2415. e = a.getDocument();
  2416. var m = e.$.compatMode == "BackCompat";
  2417. a instanceof CKEDITOR.dom.window && (a = m ? e.getBody() : e.getDocumentElement());
  2418. e = a.getWindow();
  2419. h = o(this, e);
  2420. var l = o(a, e),
  2421. p = this.$.offsetHeight;
  2422. f = this.$.offsetWidth;
  2423. var t = a.$.clientHeight,
  2424. s = a.$.clientWidth;
  2425. e = h.x - q(this, "left") - l.x || 0;
  2426. k = h.y - q(this, "top") - l.y || 0;
  2427. f = h.x + f + q(this, "right") - (l.x + s) || 0;
  2428. h = h.y + p + q(this, "bottom") - (l.y + t) || 0;
  2429. if(k < 0 || h > 0) n(0, b === true ? k : b === false ?
  2430. h : k < 0 ? k : h);
  2431. if(g && (e < 0 || f > 0)) n(e < 0 ? e : f, 0)
  2432. },
  2433. setState: function(a, b, g) {
  2434. b = b || "cke";
  2435. switch(a) {
  2436. case CKEDITOR.TRISTATE_ON:
  2437. this.addClass(b + "_on");
  2438. this.removeClass(b + "_off");
  2439. this.removeClass(b + "_disabled");
  2440. g && this.setAttribute("aria-pressed", true);
  2441. g && this.removeAttribute("aria-disabled");
  2442. break;
  2443. case CKEDITOR.TRISTATE_DISABLED:
  2444. this.addClass(b + "_disabled");
  2445. this.removeClass(b + "_off");
  2446. this.removeClass(b + "_on");
  2447. g && this.setAttribute("aria-disabled", true);
  2448. g && this.removeAttribute("aria-pressed");
  2449. break;
  2450. default:
  2451. this.addClass(b +
  2452. "_off");
  2453. this.removeClass(b + "_on");
  2454. this.removeClass(b + "_disabled");
  2455. g && this.removeAttribute("aria-pressed");
  2456. g && this.removeAttribute("aria-disabled")
  2457. }
  2458. },
  2459. getFrameDocument: function() {
  2460. var a = this.$;
  2461. try {
  2462. a.contentWindow.document
  2463. } catch(b) {
  2464. a.src = a.src
  2465. }
  2466. return a && new CKEDITOR.dom.document(a.contentWindow.document)
  2467. },
  2468. copyAttributes: function(a, b) {
  2469. for(var g = this.$.attributes, b = b || {}, f = 0; f < g.length; f++) {
  2470. var h = g[f],
  2471. e = h.nodeName.toLowerCase(),
  2472. k;
  2473. if(!(e in b))
  2474. if(e == "checked" && (k = this.getAttribute(e))) a.setAttribute(e, k);
  2475. else if(!CKEDITOR.env.ie || this.hasAttribute(e)) {
  2476. k = this.getAttribute(e);
  2477. if(k === null) k = h.nodeValue;
  2478. a.setAttribute(e, k)
  2479. }
  2480. }
  2481. if(this.$.style.cssText !== "") a.$.style.cssText = this.$.style.cssText
  2482. },
  2483. renameNode: function(a) {
  2484. if(this.getName() != a) {
  2485. var b = this.getDocument(),
  2486. a = new CKEDITOR.dom.element(a, b);
  2487. this.copyAttributes(a);
  2488. this.moveChildren(a);
  2489. this.getParent() && this.$.parentNode.replaceChild(a.$, this.$);
  2490. a.$["data-cke-expando"] = this.$["data-cke-expando"];
  2491. this.$ = a.$;
  2492. delete this.getName
  2493. }
  2494. },
  2495. getChild: function() {
  2496. function a(b,
  2497. c) {
  2498. var f = b.childNodes;
  2499. if(c >= 0 && c < f.length) return f[c]
  2500. }
  2501. return function(b) {
  2502. var g = this.$;
  2503. if(b.slice)
  2504. for(; b.length > 0 && g;) g = a(g, b.shift());
  2505. else g = a(g, b);
  2506. return g ? new CKEDITOR.dom.node(g) : null
  2507. }
  2508. }(),
  2509. getChildCount: function() {
  2510. return this.$.childNodes.length
  2511. },
  2512. disableContextMenu: function() {
  2513. this.on("contextmenu", function(a) {
  2514. a.data.getTarget().hasClass("cke_enable_context_menu") || a.data.preventDefault()
  2515. })
  2516. },
  2517. getDirection: function(a) {
  2518. return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() &&
  2519. this.getParent().getDirection(1) || this.getDocument().$.dir || "ltr" : this.getStyle("direction") || this.getAttribute("dir")
  2520. },
  2521. data: function(a, b) {
  2522. a = "data-" + a;
  2523. if(b === void 0) return this.getAttribute(a);
  2524. b === false ? this.removeAttribute(a) : this.setAttribute(a, b);
  2525. return null
  2526. },
  2527. getEditor: function() {
  2528. var a = CKEDITOR.instances,
  2529. b, g;
  2530. for(b in a) {
  2531. g = a[b];
  2532. if(g.element.equals(this) && g.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) return g
  2533. }
  2534. return null
  2535. },
  2536. find: function(b) {
  2537. var d = a(this),
  2538. b = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e(this,
  2539. b)));
  2540. d();
  2541. return b
  2542. },
  2543. findOne: function(b) {
  2544. var d = a(this),
  2545. b = this.$.querySelector(e(this, b));
  2546. d();
  2547. return b ? new CKEDITOR.dom.element(b) : null
  2548. },
  2549. forEach: function(a, b, g) {
  2550. if(!g && (!b || this.type == b)) var f = a(this);
  2551. if(f !== false)
  2552. for(var g = this.getChildren(), h = 0; h < g.count(); h++) {
  2553. f = g.getItem(h);
  2554. f.type == CKEDITOR.NODE_ELEMENT ? f.forEach(a, b) : (!b || f.type == b) && a(f)
  2555. }
  2556. }
  2557. });
  2558. var g = {
  2559. width: ["border-left-width", "border-right-width", "padding-left", "padding-right"],
  2560. height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"]
  2561. };
  2562. CKEDITOR.dom.element.prototype.setSize = function(a, d, g) {
  2563. if(typeof d == "number") {
  2564. if(g && (!CKEDITOR.env.ie || !CKEDITOR.env.quirks)) d = d - b.call(this, a);
  2565. this.setStyle(a, d + "px")
  2566. }
  2567. };
  2568. CKEDITOR.dom.element.prototype.getSize = function(a, d) {
  2569. var g = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0;
  2570. d && (g = g - b.call(this, a));
  2571. return g
  2572. }
  2573. }(), CKEDITOR.dom.documentFragment = function(a) {
  2574. a = a || CKEDITOR.document;
  2575. this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() :
  2576. a
  2577. }, CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, {
  2578. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  2579. insertAfterNode: function(a) {
  2580. a = a.$;
  2581. a.parentNode.insertBefore(this.$, a.nextSibling)
  2582. }
  2583. }, !0, {
  2584. append: 1,
  2585. appendBogus: 1,
  2586. getFirst: 1,
  2587. getLast: 1,
  2588. getParent: 1,
  2589. getNext: 1,
  2590. getPrevious: 1,
  2591. appendTo: 1,
  2592. moveChildren: 1,
  2593. insertBefore: 1,
  2594. insertAfterNode: 1,
  2595. replace: 1,
  2596. trim: 1,
  2597. type: 1,
  2598. ltrim: 1,
  2599. rtrim: 1,
  2600. getDocument: 1,
  2601. getChildCount: 1,
  2602. getChild: 1,
  2603. getChildren: 1
  2604. }),
  2605. function() {
  2606. function a(a, b) {
  2607. var c = this.range;
  2608. if(this._.end) return null;
  2609. if(!this._.start) {
  2610. this._.start = 1;
  2611. if(c.collapsed) {
  2612. this.end();
  2613. return null
  2614. }
  2615. c.optimize()
  2616. }
  2617. var d, f = c.startContainer;
  2618. d = c.endContainer;
  2619. var g = c.startOffset,
  2620. k = c.endOffset,
  2621. h, e = this.guard,
  2622. j = this.type,
  2623. i = a ? "getPreviousSourceNode" : "getNextSourceNode";
  2624. if(!a && !this._.guardLTR) {
  2625. var v = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(),
  2626. r = d.type == CKEDITOR.NODE_ELEMENT ? d.getChild(k) : d.getNext();
  2627. this._.guardLTR = function(a, b) {
  2628. return(!b || !v.equals(a)) && (!r || !a.equals(r)) && (a.type != CKEDITOR.NODE_ELEMENT ||
  2629. !b || !a.equals(c.root))
  2630. }
  2631. }
  2632. if(a && !this._.guardRTL) {
  2633. var y = f.type == CKEDITOR.NODE_ELEMENT ? f : f.getParent(),
  2634. z = f.type == CKEDITOR.NODE_ELEMENT ? g ? f.getChild(g - 1) : null : f.getPrevious();
  2635. this._.guardRTL = function(a, b) {
  2636. return(!b || !y.equals(a)) && (!z || !a.equals(z)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
  2637. }
  2638. }
  2639. var B = a ? this._.guardRTL : this._.guardLTR;
  2640. h = e ? function(a, b) {
  2641. return B(a, b) === false ? false : e(a, b)
  2642. } : B;
  2643. if(this.current) d = this.current[i](false, j, h);
  2644. else {
  2645. if(a) d.type == CKEDITOR.NODE_ELEMENT && (d = k > 0 ? d.getChild(k -
  2646. 1) : h(d, true) === false ? null : d.getPreviousSourceNode(true, j, h));
  2647. else {
  2648. d = f;
  2649. if(d.type == CKEDITOR.NODE_ELEMENT && !(d = d.getChild(g))) d = h(f, true) === false ? null : f.getNextSourceNode(true, j, h)
  2650. }
  2651. d && h(d) === false && (d = null)
  2652. }
  2653. for(; d && !this._.end;) {
  2654. this.current = d;
  2655. if(!this.evaluator || this.evaluator(d) !== false) {
  2656. if(!b) return d
  2657. } else if(b && this.evaluator) return false;
  2658. d = d[i](false, j, h)
  2659. }
  2660. this.end();
  2661. return this.current = null
  2662. }
  2663. function e(b) {
  2664. for(var c, d = null; c = a.call(this, b);) d = c;
  2665. return d
  2666. }
  2667. function b(a) {
  2668. if(i(a)) return false;
  2669. if(a.type ==
  2670. CKEDITOR.NODE_TEXT) return true;
  2671. if(a.type == CKEDITOR.NODE_ELEMENT) {
  2672. if(a.is(CKEDITOR.dtd.$inline) || a.is("hr") || a.getAttribute("contenteditable") == "false") return true;
  2673. var b;
  2674. if(b = !CKEDITOR.env.needsBrFiller)
  2675. if(b = a.is(k)) a: {
  2676. b = 0;
  2677. for(var c = a.getChildCount(); b < c; ++b)
  2678. if(!i(a.getChild(b))) {
  2679. b = false;
  2680. break a
  2681. }
  2682. b = true
  2683. }
  2684. if(b) return true
  2685. }
  2686. return false
  2687. }
  2688. CKEDITOR.dom.walker = CKEDITOR.tools.createClass({
  2689. $: function(a) {
  2690. this.range = a;
  2691. this._ = {}
  2692. },
  2693. proto: {
  2694. end: function() {
  2695. this._.end = 1
  2696. },
  2697. next: function() {
  2698. return a.call(this)
  2699. },
  2700. previous: function() {
  2701. return a.call(this,
  2702. 1)
  2703. },
  2704. checkForward: function() {
  2705. return a.call(this, 0, 1) !== false
  2706. },
  2707. checkBackward: function() {
  2708. return a.call(this, 1, 1) !== false
  2709. },
  2710. lastForward: function() {
  2711. return e.call(this)
  2712. },
  2713. lastBackward: function() {
  2714. return e.call(this, 1)
  2715. },
  2716. reset: function() {
  2717. delete this.current;
  2718. this._ = {}
  2719. }
  2720. }
  2721. });
  2722. var g = {
  2723. block: 1,
  2724. "list-item": 1,
  2725. table: 1,
  2726. "table-row-group": 1,
  2727. "table-header-group": 1,
  2728. "table-footer-group": 1,
  2729. "table-row": 1,
  2730. "table-column-group": 1,
  2731. "table-column": 1,
  2732. "table-cell": 1,
  2733. "table-caption": 1
  2734. },
  2735. c = {
  2736. absolute: 1,
  2737. fixed: 1
  2738. };
  2739. CKEDITOR.dom.element.prototype.isBlockBoundary =
  2740. function(a) {
  2741. return this.getComputedStyle("float") == "none" && !(this.getComputedStyle("position") in c) && g[this.getComputedStyle("display")] ? true : !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a))
  2742. };
  2743. CKEDITOR.dom.walker.blockBoundary = function(a) {
  2744. return function(b) {
  2745. return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a))
  2746. }
  2747. };
  2748. CKEDITOR.dom.walker.listItemBoundary = function() {
  2749. return this.blockBoundary({
  2750. br: 1
  2751. })
  2752. };
  2753. CKEDITOR.dom.walker.bookmark = function(a, b) {
  2754. function c(a) {
  2755. return a && a.getName && a.getName() == "span" &&
  2756. a.data("cke-bookmark")
  2757. }
  2758. return function(d) {
  2759. var f, g;
  2760. f = d && d.type != CKEDITOR.NODE_ELEMENT && (g = d.getParent()) && c(g);
  2761. f = a ? f : f || c(d);
  2762. return !!(b ^ f)
  2763. }
  2764. };
  2765. CKEDITOR.dom.walker.whitespaces = function(a) {
  2766. return function(b) {
  2767. var c;
  2768. b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == "​");
  2769. return !!(a ^ c)
  2770. }
  2771. };
  2772. CKEDITOR.dom.walker.invisible = function(a) {
  2773. var b = CKEDITOR.dom.walker.whitespaces(),
  2774. c = CKEDITOR.env.webkit ? 1 : 0;
  2775. return function(d) {
  2776. if(b(d)) d = 1;
  2777. else {
  2778. d.type == CKEDITOR.NODE_TEXT &&
  2779. (d = d.getParent());
  2780. d = d.$.offsetWidth <= c
  2781. }
  2782. return !!(a ^ d)
  2783. }
  2784. };
  2785. CKEDITOR.dom.walker.nodeType = function(a, b) {
  2786. return function(c) {
  2787. return !!(b ^ c.type == a)
  2788. }
  2789. };
  2790. CKEDITOR.dom.walker.bogus = function(a) {
  2791. function b(a) {
  2792. return !j(a) && !f(a)
  2793. }
  2794. return function(c) {
  2795. var f = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && d.test(c.getText());
  2796. if(f) {
  2797. f = c.getParent();
  2798. c = c.getNext(b);
  2799. f = f.isBlockBoundary() && (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary())
  2800. }
  2801. return !!(a ^ f)
  2802. }
  2803. };
  2804. CKEDITOR.dom.walker.temp = function(a) {
  2805. return function(b) {
  2806. b.type !=
  2807. CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  2808. b = b && b.hasAttribute("data-cke-temp");
  2809. return !!(a ^ b)
  2810. }
  2811. };
  2812. var d = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  2813. j = CKEDITOR.dom.walker.whitespaces(),
  2814. f = CKEDITOR.dom.walker.bookmark(),
  2815. h = CKEDITOR.dom.walker.temp();
  2816. CKEDITOR.dom.walker.ignored = function(a) {
  2817. return function(b) {
  2818. b = j(b) || f(b) || h(b);
  2819. return !!(a ^ b)
  2820. }
  2821. };
  2822. var i = CKEDITOR.dom.walker.ignored(),
  2823. k = function(a) {
  2824. var b = {},
  2825. c;
  2826. for(c in a) CKEDITOR.dtd[c]["#"] && (b[c] = 1);
  2827. return b
  2828. }(CKEDITOR.dtd.$block);
  2829. CKEDITOR.dom.walker.editable = function(a) {
  2830. return function(c) {
  2831. return !!(a ^
  2832. b(c))
  2833. }
  2834. };
  2835. CKEDITOR.dom.element.prototype.getBogus = function() {
  2836. var a = this;
  2837. do a = a.getPreviousSourceNode(); while (f(a) || j(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty));
  2838. return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && d.test(a.getText())) ? a : false
  2839. }
  2840. }(), CKEDITOR.dom.range = function(a) {
  2841. this.endOffset = this.endContainer = this.startOffset = this.startContainer = null;
  2842. this.collapsed = true;
  2843. var e = a instanceof CKEDITOR.dom.document;
  2844. this.document = e ? a : a.getDocument();
  2845. this.root = e ? a.getBody() : a
  2846. },
  2847. function() {
  2848. function a() {
  2849. var a = false,
  2850. b = CKEDITOR.dom.walker.whitespaces(),
  2851. c = CKEDITOR.dom.walker.bookmark(true),
  2852. f = CKEDITOR.dom.walker.bogus();
  2853. return function(g) {
  2854. if(c(g) || b(g)) return true;
  2855. if(f(g) && !a) return a = true;
  2856. return g.type == CKEDITOR.NODE_TEXT && (g.hasAscendant("pre") || CKEDITOR.tools.trim(g.getText()).length) || g.type == CKEDITOR.NODE_ELEMENT && !g.is(d) ? false : true
  2857. }
  2858. }
  2859. function e(a) {
  2860. var b = CKEDITOR.dom.walker.whitespaces(),
  2861. c = CKEDITOR.dom.walker.bookmark(1);
  2862. return function(d) {
  2863. return c(d) ||
  2864. b(d) ? true : !a && j(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty)
  2865. }
  2866. }
  2867. function b(a) {
  2868. return function() {
  2869. var b;
  2870. return this[a ? "getPreviousNode" : "getNextNode"](function(a) {
  2871. !b && i(a) && (b = a);
  2872. return h(a) && !(j(a) && a.equals(b))
  2873. })
  2874. }
  2875. }
  2876. var g = function(a) {
  2877. a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset
  2878. },
  2879. c = function(a, b, c, d) {
  2880. a.optimizeBookmark();
  2881. var f = a.startContainer,
  2882. g = a.endContainer,
  2883. h = a.startOffset,
  2884. e = a.endOffset,
  2885. j, i;
  2886. if(g.type == CKEDITOR.NODE_TEXT) g =
  2887. g.split(e);
  2888. else if(g.getChildCount() > 0)
  2889. if(e >= g.getChildCount()) {
  2890. g = g.append(a.document.createText(""));
  2891. i = true
  2892. } else g = g.getChild(e);
  2893. if(f.type == CKEDITOR.NODE_TEXT) {
  2894. f.split(h);
  2895. f.equals(g) && (g = f.getNext())
  2896. } else if(h)
  2897. if(h >= f.getChildCount()) {
  2898. f = f.append(a.document.createText(""));
  2899. j = true
  2900. } else f = f.getChild(h).getPrevious();
  2901. else {
  2902. f = f.append(a.document.createText(""), 1);
  2903. j = true
  2904. }
  2905. var h = f.getParents(),
  2906. e = g.getParents(),
  2907. w, x, v;
  2908. for(w = 0; w < h.length; w++) {
  2909. x = h[w];
  2910. v = e[w];
  2911. if(!x.equals(v)) break
  2912. }
  2913. for(var r = c, y, z, B, A = w; A < h.length; A++) {
  2914. y =
  2915. h[A];
  2916. r && !y.equals(f) && (z = r.append(y.clone()));
  2917. for(y = y.getNext(); y;) {
  2918. if(y.equals(e[A]) || y.equals(g)) break;
  2919. B = y.getNext();
  2920. if(b == 2) r.append(y.clone(true));
  2921. else {
  2922. y.remove();
  2923. b == 1 && r.append(y)
  2924. }
  2925. y = B
  2926. }
  2927. r && (r = z)
  2928. }
  2929. r = c;
  2930. for(c = w; c < e.length; c++) {
  2931. y = e[c];
  2932. b > 0 && !y.equals(g) && (z = r.append(y.clone()));
  2933. if(!h[c] || y.$.parentNode != h[c].$.parentNode)
  2934. for(y = y.getPrevious(); y;) {
  2935. if(y.equals(h[c]) || y.equals(f)) break;
  2936. B = y.getPrevious();
  2937. if(b == 2) r.$.insertBefore(y.$.cloneNode(true), r.$.firstChild);
  2938. else {
  2939. y.remove();
  2940. b == 1 && r.$.insertBefore(y.$,
  2941. r.$.firstChild)
  2942. }
  2943. y = B
  2944. }
  2945. r && (r = z)
  2946. }
  2947. if(b == 2) {
  2948. x = a.startContainer;
  2949. if(x.type == CKEDITOR.NODE_TEXT) {
  2950. x.$.data = x.$.data + x.$.nextSibling.data;
  2951. x.$.parentNode.removeChild(x.$.nextSibling)
  2952. }
  2953. a = a.endContainer;
  2954. if(a.type == CKEDITOR.NODE_TEXT && a.$.nextSibling) {
  2955. a.$.data = a.$.data + a.$.nextSibling.data;
  2956. a.$.parentNode.removeChild(a.$.nextSibling)
  2957. }
  2958. } else {
  2959. if(x && v && (f.$.parentNode != x.$.parentNode || g.$.parentNode != v.$.parentNode)) {
  2960. b = v.getIndex();
  2961. j && v.$.parentNode == f.$.parentNode && b--;
  2962. if(d && x.type == CKEDITOR.NODE_ELEMENT) {
  2963. d = CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',
  2964. a.document);
  2965. d.insertAfter(x);
  2966. x.mergeSiblings(false);
  2967. a.moveToBookmark({
  2968. startNode: d
  2969. })
  2970. } else a.setStart(v.getParent(), b)
  2971. }
  2972. a.collapse(true)
  2973. }
  2974. j && f.remove();
  2975. i && g.$.parentNode && g.remove()
  2976. },
  2977. d = {
  2978. abbr: 1,
  2979. acronym: 1,
  2980. b: 1,
  2981. bdo: 1,
  2982. big: 1,
  2983. cite: 1,
  2984. code: 1,
  2985. del: 1,
  2986. dfn: 1,
  2987. em: 1,
  2988. font: 1,
  2989. i: 1,
  2990. ins: 1,
  2991. label: 1,
  2992. kbd: 1,
  2993. q: 1,
  2994. samp: 1,
  2995. small: 1,
  2996. span: 1,
  2997. strike: 1,
  2998. strong: 1,
  2999. sub: 1,
  3000. sup: 1,
  3001. tt: 1,
  3002. u: 1,
  3003. "var": 1
  3004. },
  3005. j = CKEDITOR.dom.walker.bogus(),
  3006. f = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  3007. h = CKEDITOR.dom.walker.editable(),
  3008. i = CKEDITOR.dom.walker.ignored(true);
  3009. CKEDITOR.dom.range.prototype = {
  3010. clone: function() {
  3011. var a = new CKEDITOR.dom.range(this.root);
  3012. a._setStartContainer(this.startContainer);
  3013. a.startOffset = this.startOffset;
  3014. a._setEndContainer(this.endContainer);
  3015. a.endOffset = this.endOffset;
  3016. a.collapsed = this.collapsed;
  3017. return a
  3018. },
  3019. collapse: function(a) {
  3020. if(a) {
  3021. this._setEndContainer(this.startContainer);
  3022. this.endOffset = this.startOffset
  3023. } else {
  3024. this._setStartContainer(this.endContainer);
  3025. this.startOffset = this.endOffset
  3026. }
  3027. this.collapsed = true
  3028. },
  3029. cloneContents: function() {
  3030. var a = new CKEDITOR.dom.documentFragment(this.document);
  3031. this.collapsed || c(this, 2, a);
  3032. return a
  3033. },
  3034. deleteContents: function(a) {
  3035. this.collapsed || c(this, 0, null, a)
  3036. },
  3037. extractContents: function(a) {
  3038. var b = new CKEDITOR.dom.documentFragment(this.document);
  3039. this.collapsed || c(this, 1, b, a);
  3040. return b
  3041. },
  3042. createBookmark: function(a) {
  3043. var b, c, d, f, g = this.collapsed;
  3044. b = this.document.createElement("span");
  3045. b.data("cke-bookmark", 1);
  3046. b.setStyle("display", "none");
  3047. b.setHtml("&nbsp;");
  3048. if(a) {
  3049. d = "cke_bm_" + CKEDITOR.tools.getNextNumber();
  3050. b.setAttribute("id", d + (g ? "C" : "S"))
  3051. }
  3052. if(!g) {
  3053. c = b.clone();
  3054. c.setHtml("&nbsp;");
  3055. a && c.setAttribute("id", d + "E");
  3056. f = this.clone();
  3057. f.collapse();
  3058. f.insertNode(c)
  3059. }
  3060. f = this.clone();
  3061. f.collapse(true);
  3062. f.insertNode(b);
  3063. if(c) {
  3064. this.setStartAfter(b);
  3065. this.setEndBefore(c)
  3066. } else this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END);
  3067. return {
  3068. startNode: a ? d + (g ? "C" : "S") : b,
  3069. endNode: a ? d + "E" : c,
  3070. serializable: a,
  3071. collapsed: g
  3072. }
  3073. },
  3074. createBookmark2: function() {
  3075. function a(c) {
  3076. var d = c.container,
  3077. f = c.offset,
  3078. g;
  3079. g = d;
  3080. var h = f;
  3081. g = g.type != CKEDITOR.NODE_ELEMENT || h === 0 || h == g.getChildCount() ? 0 : g.getChild(h - 1).type == CKEDITOR.NODE_TEXT && g.getChild(h).type ==
  3082. CKEDITOR.NODE_TEXT;
  3083. if(g) {
  3084. d = d.getChild(f - 1);
  3085. f = d.getLength()
  3086. }
  3087. d.type == CKEDITOR.NODE_ELEMENT && f > 1 && (f = d.getChild(f - 1).getIndex(true) + 1);
  3088. if(d.type == CKEDITOR.NODE_TEXT) {
  3089. g = d;
  3090. for(h = 0;
  3091. (g = g.getPrevious()) && g.type == CKEDITOR.NODE_TEXT;) h = h + g.getLength();
  3092. g = h;
  3093. if(d.getText()) f = f + g;
  3094. else {
  3095. h = d.getPrevious(b);
  3096. if(g) {
  3097. f = g;
  3098. d = h ? h.getNext() : d.getParent().getFirst()
  3099. } else {
  3100. d = d.getParent();
  3101. f = h ? h.getIndex(true) + 1 : 0
  3102. }
  3103. }
  3104. }
  3105. c.container = d;
  3106. c.offset = f
  3107. }
  3108. var b = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, true);
  3109. return function(b) {
  3110. var c = this.collapsed,
  3111. d = {
  3112. container: this.startContainer,
  3113. offset: this.startOffset
  3114. },
  3115. f = {
  3116. container: this.endContainer,
  3117. offset: this.endOffset
  3118. };
  3119. if(b) {
  3120. a(d);
  3121. c || a(f)
  3122. }
  3123. return {
  3124. start: d.container.getAddress(b),
  3125. end: c ? null : f.container.getAddress(b),
  3126. startOffset: d.offset,
  3127. endOffset: f.offset,
  3128. normalized: b,
  3129. collapsed: c,
  3130. is2: true
  3131. }
  3132. }
  3133. }(),
  3134. moveToBookmark: function(a) {
  3135. if(a.is2) {
  3136. var b = this.document.getByAddress(a.start, a.normalized),
  3137. c = a.startOffset,
  3138. d = a.end && this.document.getByAddress(a.end, a.normalized),
  3139. a = a.endOffset;
  3140. this.setStart(b, c);
  3141. d ? this.setEnd(d, a) :
  3142. this.collapse(true)
  3143. } else {
  3144. b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode;
  3145. a = c ? this.document.getById(a.endNode) : a.endNode;
  3146. this.setStartBefore(b);
  3147. b.remove();
  3148. if(a) {
  3149. this.setEndBefore(a);
  3150. a.remove()
  3151. } else this.collapse(true)
  3152. }
  3153. },
  3154. getBoundaryNodes: function() {
  3155. var a = this.startContainer,
  3156. b = this.endContainer,
  3157. c = this.startOffset,
  3158. d = this.endOffset,
  3159. f;
  3160. if(a.type == CKEDITOR.NODE_ELEMENT) {
  3161. f = a.getChildCount();
  3162. if(f > c) a = a.getChild(c);
  3163. else if(f < 1) a = a.getPreviousSourceNode();
  3164. else {
  3165. for(a = a.$; a.lastChild;) a = a.lastChild;
  3166. a = new CKEDITOR.dom.node(a);
  3167. a = a.getNextSourceNode() || a
  3168. }
  3169. }
  3170. if(b.type == CKEDITOR.NODE_ELEMENT) {
  3171. f = b.getChildCount();
  3172. if(f > d) b = b.getChild(d).getPreviousSourceNode(true);
  3173. else if(f < 1) b = b.getPreviousSourceNode();
  3174. else {
  3175. for(b = b.$; b.lastChild;) b = b.lastChild;
  3176. b = new CKEDITOR.dom.node(b)
  3177. }
  3178. }
  3179. a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b);
  3180. return {
  3181. startNode: a,
  3182. endNode: b
  3183. }
  3184. },
  3185. getCommonAncestor: function(a, b) {
  3186. var c = this.startContainer,
  3187. d = this.endContainer,
  3188. c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset -
  3189. 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d);
  3190. return b && !c.is ? c.getParent() : c
  3191. },
  3192. optimize: function() {
  3193. var a = this.startContainer,
  3194. b = this.startOffset;
  3195. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a));
  3196. a = this.endContainer;
  3197. b = this.endOffset;
  3198. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a))
  3199. },
  3200. optimizeBookmark: function() {
  3201. var a = this.startContainer,
  3202. b = this.endContainer;
  3203. a.is && (a.is("span") && a.data("cke-bookmark")) &&
  3204. this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
  3205. b && (b.is && b.is("span") && b.data("cke-bookmark")) && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
  3206. },
  3207. trim: function(a, b) {
  3208. var c = this.startContainer,
  3209. d = this.startOffset,
  3210. f = this.collapsed;
  3211. if((!a || f) && c && c.type == CKEDITOR.NODE_TEXT) {
  3212. if(d)
  3213. if(d >= c.getLength()) {
  3214. d = c.getIndex() + 1;
  3215. c = c.getParent()
  3216. } else {
  3217. var g = c.split(d),
  3218. d = c.getIndex() + 1,
  3219. c = c.getParent();
  3220. if(this.startContainer.equals(this.endContainer)) this.setEnd(g, this.endOffset - this.startOffset);
  3221. else if(c.equals(this.endContainer)) this.endOffset =
  3222. this.endOffset + 1
  3223. }
  3224. else {
  3225. d = c.getIndex();
  3226. c = c.getParent()
  3227. }
  3228. this.setStart(c, d);
  3229. if(f) {
  3230. this.collapse(true);
  3231. return
  3232. }
  3233. }
  3234. c = this.endContainer;
  3235. d = this.endOffset;
  3236. if(!b && !f && c && c.type == CKEDITOR.NODE_TEXT) {
  3237. if(d) {
  3238. d >= c.getLength() || c.split(d);
  3239. d = c.getIndex() + 1
  3240. } else d = c.getIndex();
  3241. c = c.getParent();
  3242. this.setEnd(c, d)
  3243. }
  3244. },
  3245. enlarge: function(a, b) {
  3246. function c(a) {
  3247. return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a
  3248. }
  3249. var d = RegExp(/[^\s\ufeff]/);
  3250. switch(a) {
  3251. case CKEDITOR.ENLARGE_INLINE:
  3252. var f = 1;
  3253. case CKEDITOR.ENLARGE_ELEMENT:
  3254. if(this.collapsed) break;
  3255. var g = this.getCommonAncestor(),
  3256. h = this.root,
  3257. e, j, i, w, x, v = false,
  3258. r, y;
  3259. r = this.startContainer;
  3260. var z = this.startOffset;
  3261. if(r.type == CKEDITOR.NODE_TEXT) {
  3262. if(z) {
  3263. r = !CKEDITOR.tools.trim(r.substring(0, z)).length && r;
  3264. v = !!r
  3265. }
  3266. if(r && !(w = r.getPrevious())) i = r.getParent()
  3267. } else {
  3268. z && (w = r.getChild(z - 1) || r.getLast());
  3269. w || (i = r)
  3270. }
  3271. for(i = c(i); i || w;) {
  3272. if(i && !w) {
  3273. !x && i.equals(g) && (x = true);
  3274. if(f ? i.isBlockBoundary() : !h.contains(i)) break;
  3275. if(!v || i.getComputedStyle("display") != "inline") {
  3276. v = false;
  3277. x ? e = i : this.setStartBefore(i)
  3278. }
  3279. w = i.getPrevious()
  3280. }
  3281. for(; w;) {
  3282. r =
  3283. false;
  3284. if(w.type == CKEDITOR.NODE_COMMENT) w = w.getPrevious();
  3285. else {
  3286. if(w.type == CKEDITOR.NODE_TEXT) {
  3287. y = w.getText();
  3288. d.test(y) && (w = null);
  3289. r = /[\s\ufeff]$/.test(y)
  3290. } else if((w.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && w.is("br")) && !w.data("cke-bookmark"))
  3291. if(v && CKEDITOR.dtd.$removeEmpty[w.getName()]) {
  3292. y = w.getText();
  3293. if(d.test(y)) w = null;
  3294. else
  3295. for(var z = w.$.getElementsByTagName("*"), B = 0, A; A = z[B++];)
  3296. if(!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]) {
  3297. w = null;
  3298. break
  3299. }
  3300. w && (r = !!y.length)
  3301. } else w = null;
  3302. r && (v ? x ? e = i : i && this.setStartBefore(i) :
  3303. v = true);
  3304. if(w) {
  3305. r = w.getPrevious();
  3306. if(!i && !r) {
  3307. i = w;
  3308. w = null;
  3309. break
  3310. }
  3311. w = r
  3312. } else i = null
  3313. }
  3314. }
  3315. i && (i = c(i.getParent()))
  3316. }
  3317. r = this.endContainer;
  3318. z = this.endOffset;
  3319. i = w = null;
  3320. x = v = false;
  3321. var G = function(a, b) {
  3322. var c = new CKEDITOR.dom.range(h);
  3323. c.setStart(a, b);
  3324. c.setEndAt(h, CKEDITOR.POSITION_BEFORE_END);
  3325. var c = new CKEDITOR.dom.walker(c),
  3326. f;
  3327. for(c.guard = function(a) {
  3328. return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary())
  3329. }; f = c.next();) {
  3330. if(f.type != CKEDITOR.NODE_TEXT) return false;
  3331. y = f != a ? f.getText() : f.substring(b);
  3332. if(d.test(y)) return false
  3333. }
  3334. return true
  3335. };
  3336. if(r.type == CKEDITOR.NODE_TEXT)
  3337. if(CKEDITOR.tools.trim(r.substring(z)).length) v = true;
  3338. else {
  3339. v = !r.getLength();
  3340. if(z == r.getLength()) {
  3341. if(!(w = r.getNext())) i = r.getParent()
  3342. } else G(r, z) && (i = r.getParent())
  3343. }
  3344. else(w = r.getChild(z)) || (i = r);
  3345. for(; i || w;) {
  3346. if(i && !w) {
  3347. !x && i.equals(g) && (x = true);
  3348. if(f ? i.isBlockBoundary() : !h.contains(i)) break;
  3349. if(!v || i.getComputedStyle("display") != "inline") {
  3350. v = false;
  3351. x ? j = i : i && this.setEndAfter(i)
  3352. }
  3353. w = i.getNext()
  3354. }
  3355. for(; w;) {
  3356. r = false;
  3357. if(w.type == CKEDITOR.NODE_TEXT) {
  3358. y = w.getText();
  3359. G(w, 0) || (w = null);
  3360. r = /^[\s\ufeff]/.test(y)
  3361. } else if(w.type ==
  3362. CKEDITOR.NODE_ELEMENT) {
  3363. if((w.$.offsetWidth > 0 || b && w.is("br")) && !w.data("cke-bookmark"))
  3364. if(v && CKEDITOR.dtd.$removeEmpty[w.getName()]) {
  3365. y = w.getText();
  3366. if(d.test(y)) w = null;
  3367. else {
  3368. z = w.$.getElementsByTagName("*");
  3369. for(B = 0; A = z[B++];)
  3370. if(!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]) {
  3371. w = null;
  3372. break
  3373. }
  3374. }
  3375. w && (r = !!y.length)
  3376. } else w = null
  3377. } else r = 1;
  3378. r && v && (x ? j = i : this.setEndAfter(i));
  3379. if(w) {
  3380. r = w.getNext();
  3381. if(!i && !r) {
  3382. i = w;
  3383. w = null;
  3384. break
  3385. }
  3386. w = r
  3387. } else i = null
  3388. }
  3389. i && (i = c(i.getParent()))
  3390. }
  3391. if(e && j) {
  3392. g = e.contains(j) ? j : e;
  3393. this.setStartBefore(g);
  3394. this.setEndAfter(g)
  3395. }
  3396. break;
  3397. case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
  3398. case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
  3399. i = new CKEDITOR.dom.range(this.root);
  3400. h = this.root;
  3401. i.setStartAt(h, CKEDITOR.POSITION_AFTER_START);
  3402. i.setEnd(this.startContainer, this.startOffset);
  3403. i = new CKEDITOR.dom.walker(i);
  3404. var D, J, C = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? {
  3405. br: 1
  3406. } : null),
  3407. F = null,
  3408. E = function(a) {
  3409. if(a.type == CKEDITOR.NODE_ELEMENT && a.getAttribute("contenteditable") == "false")
  3410. if(F) {
  3411. if(F.equals(a)) {
  3412. F = null;
  3413. return
  3414. }
  3415. } else F =
  3416. a;
  3417. else if(F) return;
  3418. var b = C(a);
  3419. b || (D = a);
  3420. return b
  3421. },
  3422. f = function(a) {
  3423. var b = E(a);
  3424. !b && (a.is && a.is("br")) && (J = a);
  3425. return b
  3426. };
  3427. i.guard = E;
  3428. i = i.lastBackward();
  3429. D = D || h;
  3430. this.setStartAt(D, !D.is("br") && (!i && this.checkStartOfBlock() || i && D.contains(i)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
  3431. if(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
  3432. i = this.clone();
  3433. i = new CKEDITOR.dom.walker(i);
  3434. var I = CKEDITOR.dom.walker.whitespaces(),
  3435. L = CKEDITOR.dom.walker.bookmark();
  3436. i.evaluator = function(a) {
  3437. return !I(a) && !L(a)
  3438. };
  3439. if((i = i.previous()) &&
  3440. i.type == CKEDITOR.NODE_ELEMENT && i.is("br")) break
  3441. }
  3442. i = this.clone();
  3443. i.collapse();
  3444. i.setEndAt(h, CKEDITOR.POSITION_BEFORE_END);
  3445. i = new CKEDITOR.dom.walker(i);
  3446. i.guard = a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? f : E;
  3447. D = F = J = null;
  3448. i = i.lastForward();
  3449. D = D || h;
  3450. this.setEndAt(D, !i && this.checkEndOfBlock() || i && D.contains(i) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START);
  3451. J && this.setEndAfter(J)
  3452. }
  3453. },
  3454. shrink: function(a, b, c) {
  3455. if(!this.collapsed) {
  3456. var a = a || CKEDITOR.SHRINK_TEXT,
  3457. d = this.clone(),
  3458. f = this.startContainer,
  3459. g = this.endContainer,
  3460. h = this.startOffset,
  3461. e = this.endOffset,
  3462. i = 1,
  3463. j = 1;
  3464. if(f && f.type == CKEDITOR.NODE_TEXT)
  3465. if(h)
  3466. if(h >= f.getLength()) d.setStartAfter(f);
  3467. else {
  3468. d.setStartBefore(f);
  3469. i = 0
  3470. }
  3471. else d.setStartBefore(f);
  3472. if(g && g.type == CKEDITOR.NODE_TEXT)
  3473. if(e)
  3474. if(e >= g.getLength()) d.setEndAfter(g);
  3475. else {
  3476. d.setEndAfter(g);
  3477. j = 0
  3478. }
  3479. else d.setEndBefore(g);
  3480. var d = new CKEDITOR.dom.walker(d),
  3481. w = CKEDITOR.dom.walker.bookmark();
  3482. d.evaluator = function(b) {
  3483. return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT)
  3484. };
  3485. var x;
  3486. d.guard = function(b, d) {
  3487. if(w(b)) return true;
  3488. if(a == CKEDITOR.SHRINK_ELEMENT && b.type == CKEDITOR.NODE_TEXT || d && b.equals(x) || c === false && b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute("contenteditable")) return false;
  3489. !d && b.type == CKEDITOR.NODE_ELEMENT && (x = b);
  3490. return true
  3491. };
  3492. if(i)(f = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(f, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
  3493. if(j) {
  3494. d.reset();
  3495. (d = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(d,
  3496. b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END)
  3497. }
  3498. return !(!i && !j)
  3499. }
  3500. },
  3501. insertNode: function(a) {
  3502. this.optimizeBookmark();
  3503. this.trim(false, true);
  3504. var b = this.startContainer,
  3505. c = b.getChild(this.startOffset);
  3506. c ? a.insertBefore(c) : b.append(a);
  3507. a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
  3508. this.setStartBefore(a)
  3509. },
  3510. moveToPosition: function(a, b) {
  3511. this.setStartAt(a, b);
  3512. this.collapse(true)
  3513. },
  3514. moveToRange: function(a) {
  3515. this.setStart(a.startContainer, a.startOffset);
  3516. this.setEnd(a.endContainer,
  3517. a.endOffset)
  3518. },
  3519. selectNodeContents: function(a) {
  3520. this.setStart(a, 0);
  3521. this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
  3522. },
  3523. setStart: function(a, b) {
  3524. if(a.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[a.getName()]) {
  3525. b = a.getIndex();
  3526. a = a.getParent()
  3527. }
  3528. this._setStartContainer(a);
  3529. this.startOffset = b;
  3530. if(!this.endContainer) {
  3531. this._setEndContainer(a);
  3532. this.endOffset = b
  3533. }
  3534. g(this)
  3535. },
  3536. setEnd: function(a, b) {
  3537. if(a.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[a.getName()]) {
  3538. b = a.getIndex() + 1;
  3539. a = a.getParent()
  3540. }
  3541. this._setEndContainer(a);
  3542. this.endOffset = b;
  3543. if(!this.startContainer) {
  3544. this._setStartContainer(a);
  3545. this.startOffset = b
  3546. }
  3547. g(this)
  3548. },
  3549. setStartAfter: function(a) {
  3550. this.setStart(a.getParent(), a.getIndex() + 1)
  3551. },
  3552. setStartBefore: function(a) {
  3553. this.setStart(a.getParent(), a.getIndex())
  3554. },
  3555. setEndAfter: function(a) {
  3556. this.setEnd(a.getParent(), a.getIndex() + 1)
  3557. },
  3558. setEndBefore: function(a) {
  3559. this.setEnd(a.getParent(), a.getIndex())
  3560. },
  3561. setStartAt: function(a, b) {
  3562. switch(b) {
  3563. case CKEDITOR.POSITION_AFTER_START:
  3564. this.setStart(a, 0);
  3565. break;
  3566. case CKEDITOR.POSITION_BEFORE_END:
  3567. a.type ==
  3568. CKEDITOR.NODE_TEXT ? this.setStart(a, a.getLength()) : this.setStart(a, a.getChildCount());
  3569. break;
  3570. case CKEDITOR.POSITION_BEFORE_START:
  3571. this.setStartBefore(a);
  3572. break;
  3573. case CKEDITOR.POSITION_AFTER_END:
  3574. this.setStartAfter(a)
  3575. }
  3576. g(this)
  3577. },
  3578. setEndAt: function(a, b) {
  3579. switch(b) {
  3580. case CKEDITOR.POSITION_AFTER_START:
  3581. this.setEnd(a, 0);
  3582. break;
  3583. case CKEDITOR.POSITION_BEFORE_END:
  3584. a.type == CKEDITOR.NODE_TEXT ? this.setEnd(a, a.getLength()) : this.setEnd(a, a.getChildCount());
  3585. break;
  3586. case CKEDITOR.POSITION_BEFORE_START:
  3587. this.setEndBefore(a);
  3588. break;
  3589. case CKEDITOR.POSITION_AFTER_END:
  3590. this.setEndAfter(a)
  3591. }
  3592. g(this)
  3593. },
  3594. fixBlock: function(a, b) {
  3595. var c = this.createBookmark(),
  3596. d = this.document.createElement(b);
  3597. this.collapse(a);
  3598. this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  3599. this.extractContents().appendTo(d);
  3600. d.trim();
  3601. d.appendBogus();
  3602. this.insertNode(d);
  3603. this.moveToBookmark(c);
  3604. return d
  3605. },
  3606. splitBlock: function(a) {
  3607. var b = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
  3608. c = new CKEDITOR.dom.elementPath(this.endContainer, this.root),
  3609. d = b.block,
  3610. f = c.block,
  3611. g = null;
  3612. if(!b.blockLimit.equals(c.blockLimit)) return null;
  3613. if(a != "br") {
  3614. if(!d) {
  3615. d = this.fixBlock(true, a);
  3616. f = (new CKEDITOR.dom.elementPath(this.endContainer, this.root)).block
  3617. }
  3618. f || (f = this.fixBlock(false, a))
  3619. }
  3620. a = d && this.checkStartOfBlock();
  3621. b = f && this.checkEndOfBlock();
  3622. this.deleteContents();
  3623. if(d && d.equals(f))
  3624. if(b) {
  3625. g = new CKEDITOR.dom.elementPath(this.startContainer, this.root);
  3626. this.moveToPosition(f, CKEDITOR.POSITION_AFTER_END);
  3627. f = null
  3628. } else if(a) {
  3629. g = new CKEDITOR.dom.elementPath(this.startContainer, this.root);
  3630. this.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START);
  3631. d = null
  3632. } else {
  3633. f =
  3634. this.splitElement(d);
  3635. d.is("ul", "ol") || d.appendBogus()
  3636. }
  3637. return {
  3638. previousBlock: d,
  3639. nextBlock: f,
  3640. wasStartOfBlock: a,
  3641. wasEndOfBlock: b,
  3642. elementPath: g
  3643. }
  3644. },
  3645. splitElement: function(a) {
  3646. if(!this.collapsed) return null;
  3647. this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
  3648. var b = this.extractContents(),
  3649. c = a.clone(false);
  3650. b.appendTo(c);
  3651. c.insertAfter(a);
  3652. this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  3653. return c
  3654. },
  3655. removeEmptyBlocksAtEnd: function() {
  3656. function a(d) {
  3657. return function(a) {
  3658. return b(a) || (c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable()) ||
  3659. d.is("table") && a.is("caption") ? false : true
  3660. }
  3661. }
  3662. var b = CKEDITOR.dom.walker.whitespaces(),
  3663. c = CKEDITOR.dom.walker.bookmark(false);
  3664. return function(b) {
  3665. for(var c = this.createBookmark(), d = this[b ? "endPath" : "startPath"](), f = d.block || d.blockLimit, g; f && !f.equals(d.root) && !f.getFirst(a(f));) {
  3666. g = f.getParent();
  3667. this[b ? "setEndAt" : "setStartAt"](f, CKEDITOR.POSITION_AFTER_END);
  3668. f.remove(1);
  3669. f = g
  3670. }
  3671. this.moveToBookmark(c)
  3672. }
  3673. }(),
  3674. startPath: function() {
  3675. return new CKEDITOR.dom.elementPath(this.startContainer, this.root)
  3676. },
  3677. endPath: function() {
  3678. return new CKEDITOR.dom.elementPath(this.endContainer,
  3679. this.root)
  3680. },
  3681. checkBoundaryOfElement: function(a, b) {
  3682. var c = b == CKEDITOR.START,
  3683. d = this.clone();
  3684. d.collapse(c);
  3685. d[c ? "setStartAt" : "setEndAt"](a, c ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
  3686. d = new CKEDITOR.dom.walker(d);
  3687. d.evaluator = e(c);
  3688. return d[c ? "checkBackward" : "checkForward"]()
  3689. },
  3690. checkStartOfBlock: function() {
  3691. var b = this.startContainer,
  3692. c = this.startOffset;
  3693. if(CKEDITOR.env.ie && c && b.type == CKEDITOR.NODE_TEXT) {
  3694. b = CKEDITOR.tools.ltrim(b.substring(0, c));
  3695. f.test(b) && this.trim(0, 1)
  3696. }
  3697. this.trim();
  3698. b = new CKEDITOR.dom.elementPath(this.startContainer,
  3699. this.root);
  3700. c = this.clone();
  3701. c.collapse(true);
  3702. c.setStartAt(b.block || b.blockLimit, CKEDITOR.POSITION_AFTER_START);
  3703. b = new CKEDITOR.dom.walker(c);
  3704. b.evaluator = a();
  3705. return b.checkBackward()
  3706. },
  3707. checkEndOfBlock: function() {
  3708. var b = this.endContainer,
  3709. c = this.endOffset;
  3710. if(CKEDITOR.env.ie && b.type == CKEDITOR.NODE_TEXT) {
  3711. b = CKEDITOR.tools.rtrim(b.substring(c));
  3712. f.test(b) && this.trim(1, 0)
  3713. }
  3714. this.trim();
  3715. b = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
  3716. c = this.clone();
  3717. c.collapse(false);
  3718. c.setEndAt(b.block || b.blockLimit, CKEDITOR.POSITION_BEFORE_END);
  3719. b = new CKEDITOR.dom.walker(c);
  3720. b.evaluator = a();
  3721. return b.checkForward()
  3722. },
  3723. getPreviousNode: function(a, b, c) {
  3724. var d = this.clone();
  3725. d.collapse(1);
  3726. d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START);
  3727. c = new CKEDITOR.dom.walker(d);
  3728. c.evaluator = a;
  3729. c.guard = b;
  3730. return c.previous()
  3731. },
  3732. getNextNode: function(a, b, c) {
  3733. var d = this.clone();
  3734. d.collapse();
  3735. d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
  3736. c = new CKEDITOR.dom.walker(d);
  3737. c.evaluator = a;
  3738. c.guard = b;
  3739. return c.next()
  3740. },
  3741. checkReadOnly: function() {
  3742. function a(b, c) {
  3743. for(; b;) {
  3744. if(b.type ==
  3745. CKEDITOR.NODE_ELEMENT) {
  3746. if(b.getAttribute("contentEditable") == "false" && !b.data("cke-editable")) return 0;
  3747. if(b.is("html") || b.getAttribute("contentEditable") == "true" && (b.contains(c) || b.equals(c))) break
  3748. }
  3749. b = b.getParent()
  3750. }
  3751. return 1
  3752. }
  3753. return function() {
  3754. var b = this.startContainer,
  3755. c = this.endContainer;
  3756. return !(a(b, c) && a(c, b))
  3757. }
  3758. }(),
  3759. moveToElementEditablePosition: function(a, b) {
  3760. if(a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(false)) {
  3761. this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START);
  3762. return true
  3763. }
  3764. for(var c =
  3765. 0; a;) {
  3766. if(a.type == CKEDITOR.NODE_TEXT) {
  3767. b && this.endContainer && this.checkEndOfBlock() && f.test(a.getText()) ? this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START) : this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START);
  3768. c = 1;
  3769. break
  3770. }
  3771. if(a.type == CKEDITOR.NODE_ELEMENT)
  3772. if(a.isEditable()) {
  3773. this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START);
  3774. c = 1
  3775. } else if(b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START);
  3776. else if(a.getAttribute("contenteditable") == "false" && a.is(CKEDITOR.dtd.$block)) {
  3777. this.setStartBefore(a);
  3778. this.setEndAfter(a);
  3779. return true
  3780. }
  3781. var d = a,
  3782. g = c,
  3783. h = void 0;
  3784. d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(false) && (h = d[b ? "getLast" : "getFirst"](i));
  3785. !g && !h && (h = d[b ? "getPrevious" : "getNext"](i));
  3786. a = h
  3787. }
  3788. return !!c
  3789. },
  3790. moveToClosestEditablePosition: function(a, b) {
  3791. var c = new CKEDITOR.dom.range(this.root),
  3792. d = 0,
  3793. f, g = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
  3794. c.moveToPosition(a, g[b ? 0 : 1]);
  3795. if(a.is(CKEDITOR.dtd.$block)) {
  3796. if(f =
  3797. c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) {
  3798. d = 1;
  3799. if(f.type == CKEDITOR.NODE_ELEMENT && f.is(CKEDITOR.dtd.$block) && f.getAttribute("contenteditable") == "false") {
  3800. c.setStartAt(f, CKEDITOR.POSITION_BEFORE_START);
  3801. c.setEndAt(f, CKEDITOR.POSITION_AFTER_END)
  3802. } else c.moveToPosition(f, g[b ? 1 : 0])
  3803. }
  3804. } else d = 1;
  3805. d && this.moveToRange(c);
  3806. return !!d
  3807. },
  3808. moveToElementEditStart: function(a) {
  3809. return this.moveToElementEditablePosition(a)
  3810. },
  3811. moveToElementEditEnd: function(a) {
  3812. return this.moveToElementEditablePosition(a, true)
  3813. },
  3814. getEnclosedNode: function() {
  3815. var a =
  3816. this.clone();
  3817. a.optimize();
  3818. if(a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null;
  3819. var a = new CKEDITOR.dom.walker(a),
  3820. b = CKEDITOR.dom.walker.bookmark(false, true),
  3821. c = CKEDITOR.dom.walker.whitespaces(true);
  3822. a.evaluator = function(a) {
  3823. return c(a) && b(a)
  3824. };
  3825. var d = a.next();
  3826. a.reset();
  3827. return d && d.equals(a.previous()) ? d : null
  3828. },
  3829. getTouchedStartNode: function() {
  3830. var a = this.startContainer;
  3831. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a
  3832. },
  3833. getTouchedEndNode: function() {
  3834. var a =
  3835. this.endContainer;
  3836. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
  3837. },
  3838. getNextEditableNode: b(),
  3839. getPreviousEditableNode: b(1),
  3840. scrollIntoView: function() {
  3841. var a = new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", this.document),
  3842. b, c, d, f = this.clone();
  3843. f.optimize();
  3844. if(d = f.startContainer.type == CKEDITOR.NODE_TEXT) {
  3845. c = f.startContainer.getText();
  3846. b = f.startContainer.split(f.startOffset);
  3847. a.insertAfter(f.startContainer)
  3848. } else f.insertNode(a);
  3849. a.scrollIntoView();
  3850. if(d) {
  3851. f.startContainer.setText(c);
  3852. b.remove()
  3853. }
  3854. a.remove()
  3855. },
  3856. _setStartContainer: function(a) {
  3857. this.startContainer = a
  3858. },
  3859. _setEndContainer: function(a) {
  3860. this.endContainer = a
  3861. }
  3862. }
  3863. }(), CKEDITOR.POSITION_AFTER_START = 1, CKEDITOR.POSITION_BEFORE_END = 2, CKEDITOR.POSITION_BEFORE_START = 3, CKEDITOR.POSITION_AFTER_END = 4, CKEDITOR.ENLARGE_ELEMENT = 1, CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2, CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3, CKEDITOR.ENLARGE_INLINE = 4, CKEDITOR.START = 1, CKEDITOR.END = 2, CKEDITOR.SHRINK_ELEMENT = 1, CKEDITOR.SHRINK_TEXT = 2, "use strict",
  3864. function() {
  3865. function a(a) {
  3866. if(!(arguments.length <
  3867. 1)) {
  3868. this.range = a;
  3869. this.forceBrBreak = 0;
  3870. this.enlargeBr = 1;
  3871. this.enforceRealBlocks = 0;
  3872. this._ || (this._ = {})
  3873. }
  3874. }
  3875. function e(a) {
  3876. var b = [];
  3877. a.forEach(function(a) {
  3878. if(a.getAttribute("contenteditable") == "true") {
  3879. b.push(a);
  3880. return false
  3881. }
  3882. }, CKEDITOR.NODE_ELEMENT, true);
  3883. return b
  3884. }
  3885. function b(a, c, d, f) {
  3886. a: {
  3887. f == null && (f = e(d));
  3888. for(var g; g = f.shift();)
  3889. if(g.getDtd().p) {
  3890. f = {
  3891. element: g,
  3892. remaining: f
  3893. };
  3894. break a
  3895. }
  3896. f = null
  3897. }
  3898. if(!f) return 0;
  3899. if((g = CKEDITOR.filter.instances[f.element.data("cke-filter")]) && !g.check(c)) return b(a, c, d, f.remaining);c = new CKEDITOR.dom.range(f.element);
  3900. c.selectNodeContents(f.element);c = c.createIterator();c.enlargeBr = a.enlargeBr;c.enforceRealBlocks = a.enforceRealBlocks;c.activeFilter = c.filter = g;a._.nestedEditable = {
  3901. element: f.element,
  3902. container: d,
  3903. remaining: f.remaining,
  3904. iterator: c
  3905. };
  3906. return 1
  3907. }
  3908. function g(a, b, c) {
  3909. if(!b) return false;
  3910. a = a.clone();
  3911. a.collapse(!c);
  3912. return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END)
  3913. }
  3914. var c = /^[\r\n\t ]+$/,
  3915. d = CKEDITOR.dom.walker.bookmark(false, true),
  3916. j = CKEDITOR.dom.walker.whitespaces(true),
  3917. f = function(a) {
  3918. return d(a) && j(a)
  3919. },
  3920. h = {
  3921. dd: 1,
  3922. dt: 1,
  3923. li: 1
  3924. };
  3925. a.prototype = {
  3926. getNextParagraph: function(a) {
  3927. var e, j, o, q, m, a = a || "p";
  3928. if(this._.nestedEditable) {
  3929. if(e = this._.nestedEditable.iterator.getNextParagraph(a)) {
  3930. this.activeFilter = this._.nestedEditable.iterator.activeFilter;
  3931. return e
  3932. }
  3933. this.activeFilter = this.filter;
  3934. if(b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) {
  3935. this.activeFilter = this._.nestedEditable.iterator.activeFilter;
  3936. return this._.nestedEditable.iterator.getNextParagraph(a)
  3937. }
  3938. this._.nestedEditable = null
  3939. }
  3940. if(!this.range.root.getDtd()[a]) return null;
  3941. if(!this._.started) {
  3942. var l = this.range.clone();
  3943. j = l.startPath();
  3944. var p = l.endPath(),
  3945. t = !l.collapsed && g(l, j.block),
  3946. s = !l.collapsed && g(l, p.block, 1);
  3947. l.shrink(CKEDITOR.SHRINK_ELEMENT, true);
  3948. t && l.setStartAt(j.block, CKEDITOR.POSITION_BEFORE_END);
  3949. s && l.setEndAt(p.block, CKEDITOR.POSITION_AFTER_START);
  3950. j = l.endContainer.hasAscendant("pre", true) || l.startContainer.hasAscendant("pre", true);
  3951. l.enlarge(this.forceBrBreak && !j || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  3952. if(!l.collapsed) {
  3953. j =
  3954. new CKEDITOR.dom.walker(l.clone());
  3955. p = CKEDITOR.dom.walker.bookmark(true, true);
  3956. j.evaluator = p;
  3957. this._.nextNode = j.next();
  3958. j = new CKEDITOR.dom.walker(l.clone());
  3959. j.evaluator = p;
  3960. j = j.previous();
  3961. this._.lastNode = j.getNextSourceNode(true, null, l.root);
  3962. if(this._.lastNode && this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary()) {
  3963. p = this.range.clone();
  3964. p.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END);
  3965. if(p.checkEndOfBlock()) {
  3966. p =
  3967. new CKEDITOR.dom.elementPath(p.endContainer, p.root);
  3968. this._.lastNode = (p.block || p.blockLimit).getNextSourceNode(true)
  3969. }
  3970. }
  3971. if(!this._.lastNode || !l.root.contains(this._.lastNode)) {
  3972. this._.lastNode = this._.docEndMarker = l.document.createText("");
  3973. this._.lastNode.insertAfter(j)
  3974. }
  3975. l = null
  3976. }
  3977. this._.started = 1;
  3978. j = l
  3979. }
  3980. p = this._.nextNode;
  3981. l = this._.lastNode;
  3982. for(this._.nextNode = null; p;) {
  3983. var t = 0,
  3984. s = p.hasAscendant("pre"),
  3985. u = p.type != CKEDITOR.NODE_ELEMENT,
  3986. w = 0;
  3987. if(u) p.type == CKEDITOR.NODE_TEXT && c.test(p.getText()) && (u = 0);
  3988. else {
  3989. var x = p.getName();
  3990. if(CKEDITOR.dtd.$block[x] && p.getAttribute("contenteditable") == "false") {
  3991. e = p;
  3992. b(this, a, e);
  3993. break
  3994. } else if(p.isBlockBoundary(this.forceBrBreak && !s && {
  3995. br: 1
  3996. })) {
  3997. if(x == "br") u = 1;
  3998. else if(!j && !p.getChildCount() && x != "hr") {
  3999. e = p;
  4000. o = p.equals(l);
  4001. break
  4002. }
  4003. if(j) {
  4004. j.setEndAt(p, CKEDITOR.POSITION_BEFORE_START);
  4005. if(x != "br") this._.nextNode = p
  4006. }
  4007. t = 1
  4008. } else {
  4009. if(p.getFirst()) {
  4010. if(!j) {
  4011. j = this.range.clone();
  4012. j.setStartAt(p, CKEDITOR.POSITION_BEFORE_START)
  4013. }
  4014. p = p.getFirst();
  4015. continue
  4016. }
  4017. u = 1
  4018. }
  4019. }
  4020. if(u && !j) {
  4021. j = this.range.clone();
  4022. j.setStartAt(p, CKEDITOR.POSITION_BEFORE_START)
  4023. }
  4024. o =
  4025. (!t || u) && p.equals(l);
  4026. if(j && !t)
  4027. for(; !p.getNext(f) && !o;) {
  4028. x = p.getParent();
  4029. if(x.isBlockBoundary(this.forceBrBreak && !s && {
  4030. br: 1
  4031. })) {
  4032. t = 1;
  4033. u = 0;
  4034. o || x.equals(l);
  4035. j.setEndAt(x, CKEDITOR.POSITION_BEFORE_END);
  4036. break
  4037. }
  4038. p = x;
  4039. u = 1;
  4040. o = p.equals(l);
  4041. w = 1
  4042. }
  4043. u && j.setEndAt(p, CKEDITOR.POSITION_AFTER_END);
  4044. p = this._getNextSourceNode(p, w, l);
  4045. if((o = !p) || t && j) break
  4046. }
  4047. if(!e) {
  4048. if(!j) {
  4049. this._.docEndMarker && this._.docEndMarker.remove();
  4050. return this._.nextNode = null
  4051. }
  4052. e = new CKEDITOR.dom.elementPath(j.startContainer, j.root);
  4053. p = e.blockLimit;
  4054. t = {
  4055. div: 1,
  4056. th: 1,
  4057. td: 1
  4058. };
  4059. e = e.block;
  4060. if(!e && p && !this.enforceRealBlocks && t[p.getName()] && j.checkStartOfBlock() && j.checkEndOfBlock() && !p.equals(j.root)) e = p;
  4061. else if(!e || this.enforceRealBlocks && e.is(h)) {
  4062. e = this.range.document.createElement(a);
  4063. j.extractContents().appendTo(e);
  4064. e.trim();
  4065. j.insertNode(e);
  4066. q = m = true
  4067. } else if(e.getName() != "li") {
  4068. if(!j.checkStartOfBlock() || !j.checkEndOfBlock()) {
  4069. e = e.clone(false);
  4070. j.extractContents().appendTo(e);
  4071. e.trim();
  4072. m = j.splitBlock();
  4073. q = !m.wasStartOfBlock;
  4074. m = !m.wasEndOfBlock;
  4075. j.insertNode(e)
  4076. }
  4077. } else if(!o) this._.nextNode =
  4078. e.equals(l) ? null : this._getNextSourceNode(j.getBoundaryNodes().endNode, 1, l)
  4079. }
  4080. if(q)(q = e.getPrevious()) && q.type == CKEDITOR.NODE_ELEMENT && (q.getName() == "br" ? q.remove() : q.getLast() && q.getLast().$.nodeName.toLowerCase() == "br" && q.getLast().remove());
  4081. if(m)(q = e.getLast()) && q.type == CKEDITOR.NODE_ELEMENT && q.getName() == "br" && (!CKEDITOR.env.needsBrFiller || q.getPrevious(d) || q.getNext(d)) && q.remove();
  4082. if(!this._.nextNode) this._.nextNode = o || e.equals(l) || !l ? null : this._getNextSourceNode(e, 1, l);
  4083. return e
  4084. },
  4085. _getNextSourceNode: function(a,
  4086. b, c) {
  4087. function f(a) {
  4088. return !(a.equals(c) || a.equals(g))
  4089. }
  4090. for(var g = this.range.root, a = a.getNextSourceNode(b, null, f); !d(a);) a = a.getNextSourceNode(b, null, f);
  4091. return a
  4092. }
  4093. };
  4094. CKEDITOR.dom.range.prototype.createIterator = function() {
  4095. return new a(this)
  4096. }
  4097. }(), CKEDITOR.command = function(a, e) {
  4098. this.uiItems = [];
  4099. this.exec = function(b) {
  4100. if(this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return false;
  4101. this.editorFocus && a.focus();
  4102. return this.fire("exec") === false ? true : e.exec.call(this, a, b) !== false
  4103. };
  4104. this.refresh = function(a,
  4105. b) {
  4106. if(!this.readOnly && a.readOnly) return true;
  4107. if(this.context && !b.isContextFor(this.context)) {
  4108. this.disable();
  4109. return true
  4110. }
  4111. if(!this.checkAllowed(true)) {
  4112. this.disable();
  4113. return true
  4114. }
  4115. this.startDisabled || this.enable();
  4116. this.modes && !this.modes[a.mode] && this.disable();
  4117. return this.fire("refresh", {
  4118. editor: a,
  4119. path: b
  4120. }) === false ? true : e.refresh && e.refresh.apply(this, arguments) !== false
  4121. };
  4122. var b;
  4123. this.checkAllowed = function(g) {
  4124. return !g && typeof b == "boolean" ? b : b = a.activeFilter.checkFeature(this)
  4125. };
  4126. CKEDITOR.tools.extend(this,
  4127. e, {
  4128. modes: {
  4129. wysiwyg: 1
  4130. },
  4131. editorFocus: 1,
  4132. contextSensitive: !!e.context,
  4133. state: CKEDITOR.TRISTATE_DISABLED
  4134. });
  4135. CKEDITOR.event.call(this)
  4136. }, CKEDITOR.command.prototype = {
  4137. enable: function() {
  4138. this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(!this.preserveState || typeof this.previousState == "undefined" ? CKEDITOR.TRISTATE_OFF : this.previousState)
  4139. },
  4140. disable: function() {
  4141. this.setState(CKEDITOR.TRISTATE_DISABLED)
  4142. },
  4143. setState: function(a) {
  4144. if(this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return false;
  4145. this.previousState = this.state;
  4146. this.state = a;
  4147. this.fire("state");
  4148. return true
  4149. },
  4150. toggleState: function() {
  4151. this.state == CKEDITOR.TRISTATE_OFF ? this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF)
  4152. }
  4153. }, CKEDITOR.event.implementOn(CKEDITOR.command.prototype), CKEDITOR.ENTER_P = 1, CKEDITOR.ENTER_BR = 2, CKEDITOR.ENTER_DIV = 3, CKEDITOR.config = {
  4154. customConfig: "config.js",
  4155. autoUpdateElement: !0,
  4156. language: "",
  4157. defaultLanguage: "en",
  4158. contentsLangDirection: "",
  4159. enterMode: CKEDITOR.ENTER_P,
  4160. forceEnterMode: !1,
  4161. shiftEnterMode: CKEDITOR.ENTER_BR,
  4162. docType: "<!DOCTYPE html>",
  4163. bodyId: "",
  4164. bodyClass: "",
  4165. fullPage: !1,
  4166. height: 200,
  4167. extraPlugins: "",
  4168. removePlugins: "",
  4169. protectedSource: [],
  4170. tabIndex: 0,
  4171. width: "",
  4172. baseFloatZIndex: 1E4,
  4173. blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85]
  4174. },
  4175. function() {
  4176. function a(a, b, c, d, f) {
  4177. var g, h, a = [];
  4178. for(g in b) {
  4179. h = b[g];
  4180. h = typeof h == "boolean" ? {} : typeof h == "function" ? {
  4181. match: h
  4182. } : G(h);
  4183. if(g.charAt(0) != "$") h.elements = g;
  4184. if(c) h.featureName = c.toLowerCase();
  4185. var e = h;
  4186. e.elements = j(e.elements,
  4187. /\s+/) || null;
  4188. e.propertiesOnly = e.propertiesOnly || e.elements === true;
  4189. var i = /\s*,\s*/,
  4190. p = void 0;
  4191. for(p in F) {
  4192. e[p] = j(e[p], i) || null;
  4193. var m = e,
  4194. k = E[p],
  4195. x = j(e[E[p]], i),
  4196. s = e[p],
  4197. w = [],
  4198. l = true,
  4199. C = void 0;
  4200. x ? l = false : x = {};
  4201. for(C in s)
  4202. if(C.charAt(0) == "!") {
  4203. C = C.slice(1);
  4204. w.push(C);
  4205. x[C] = true;
  4206. l = false
  4207. }
  4208. for(; C = w.pop();) {
  4209. s[C] = s["!" + C];
  4210. delete s["!" + C]
  4211. }
  4212. m[k] = (l ? false : x) || null
  4213. }
  4214. e.match = e.match || null;
  4215. d.push(h);
  4216. a.push(h)
  4217. }
  4218. for(var b = f.elements, f = f.generic, n, c = 0, d = a.length; c < d; ++c) {
  4219. g = G(a[c]);
  4220. h = g.classes === true || g.styles === true || g.attributes ===
  4221. true;
  4222. e = g;
  4223. p = k = i = void 0;
  4224. for(i in F) e[i] = t(e[i]);
  4225. m = true;
  4226. for(p in E) {
  4227. i = E[p];
  4228. k = e[i];
  4229. x = [];
  4230. s = void 0;
  4231. for(s in k) s.indexOf("*") > -1 ? x.push(RegExp("^" + s.replace(/\*/g, ".*") + "$")) : x.push(s);
  4232. k = x;
  4233. if(k.length) {
  4234. e[i] = k;
  4235. m = false
  4236. }
  4237. }
  4238. e.nothingRequired = m;
  4239. e.noProperties = !(e.attributes || e.classes || e.styles);
  4240. if(g.elements === true || g.elements === null) f[h ? "unshift" : "push"](g);
  4241. else {
  4242. e = g.elements;
  4243. delete g.elements;
  4244. for(n in e)
  4245. if(b[n]) b[n][h ? "unshift" : "push"](g);
  4246. else b[n] = [g]
  4247. }
  4248. }
  4249. }
  4250. function e(a, c, d, g) {
  4251. if(!a.match || a.match(c))
  4252. if(g || f(a,
  4253. c)) {
  4254. if(!a.propertiesOnly) d.valid = true;
  4255. if(!d.allAttributes) d.allAttributes = b(a.attributes, c.attributes, d.validAttributes);
  4256. if(!d.allStyles) d.allStyles = b(a.styles, c.styles, d.validStyles);
  4257. if(!d.allClasses) {
  4258. a = a.classes;
  4259. c = c.classes;
  4260. g = d.validClasses;
  4261. if(a)
  4262. if(a === true) a = true;
  4263. else {
  4264. for(var h = 0, e = c.length, j; h < e; ++h) {
  4265. j = c[h];
  4266. g[j] || (g[j] = a(j))
  4267. }
  4268. a = false
  4269. }
  4270. else a = false;
  4271. d.allClasses = a
  4272. }
  4273. }
  4274. }
  4275. function b(a, b, c) {
  4276. if(!a) return false;
  4277. if(a === true) return true;
  4278. for(var d in b) c[d] || (c[d] = a(d));
  4279. return false
  4280. }
  4281. function g(a, b, d) {
  4282. if(!a.match ||
  4283. a.match(b)) {
  4284. if(a.noProperties) return false;
  4285. d.hadInvalidAttribute = c(a.attributes, b.attributes) || d.hadInvalidAttribute;
  4286. d.hadInvalidStyle = c(a.styles, b.styles) || d.hadInvalidStyle;
  4287. a = a.classes;
  4288. b = b.classes;
  4289. if(a) {
  4290. for(var f = false, g = a === true, h = b.length; h--;)
  4291. if(g || a(b[h])) {
  4292. b.splice(h, 1);
  4293. f = true
  4294. }
  4295. a = f
  4296. } else a = false;
  4297. d.hadInvalidClass = a || d.hadInvalidClass
  4298. }
  4299. }
  4300. function c(a, b) {
  4301. if(!a) return false;
  4302. var c = false,
  4303. d = a === true,
  4304. f;
  4305. for(f in b)
  4306. if(d || a(f)) {
  4307. delete b[f];
  4308. c = true
  4309. }
  4310. return c
  4311. }
  4312. function d(a, b, c) {
  4313. if(a.disabled || a.customConfig &&
  4314. !c || !b) return false;
  4315. a._.cachedChecks = {};
  4316. return true
  4317. }
  4318. function j(a, b) {
  4319. if(!a) return false;
  4320. if(a === true) return a;
  4321. if(typeof a == "string") {
  4322. a = D(a);
  4323. return a == "*" ? true : CKEDITOR.tools.convertArrayToObject(a.split(b))
  4324. }
  4325. if(CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : false;
  4326. var c = {},
  4327. d = 0,
  4328. f;
  4329. for(f in a) {
  4330. c[f] = a[f];
  4331. d++
  4332. }
  4333. return d ? c : false
  4334. }
  4335. function f(a, b) {
  4336. if(a.nothingRequired) return true;
  4337. var c, d, f, g;
  4338. if(f = a.requiredClasses) {
  4339. g = b.classes;
  4340. for(c = 0; c < f.length; ++c) {
  4341. d = f[c];
  4342. if(typeof d == "string") {
  4343. if(CKEDITOR.tools.indexOf(g,
  4344. d) == -1) return false
  4345. } else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(g, d)) return false
  4346. }
  4347. }
  4348. return h(b.styles, a.requiredStyles) && h(b.attributes, a.requiredAttributes)
  4349. }
  4350. function h(a, b) {
  4351. if(!b) return true;
  4352. for(var c = 0, d; c < b.length; ++c) {
  4353. d = b[c];
  4354. if(typeof d == "string") {
  4355. if(!(d in a)) return false
  4356. } else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) return false
  4357. }
  4358. return true
  4359. }
  4360. function i(a) {
  4361. if(!a) return {};
  4362. for(var a = a.split(/\s*,\s*/).sort(), b = {}; a.length;) b[a.shift()] = J;
  4363. return b
  4364. }
  4365. function k(a) {
  4366. for(var b, c, d,
  4367. f, g = {}, h = 1, a = D(a); b = a.match(I);) {
  4368. if(c = b[2]) {
  4369. d = n(c, "styles");
  4370. f = n(c, "attrs");
  4371. c = n(c, "classes")
  4372. } else d = f = c = null;
  4373. g["$" + h++] = {
  4374. elements: b[1],
  4375. classes: c,
  4376. styles: d,
  4377. attributes: f
  4378. };
  4379. a = a.slice(b[0].length)
  4380. }
  4381. return g
  4382. }
  4383. function n(a, b) {
  4384. var c = a.match(L[b]);
  4385. return c ? D(c[1]) : null
  4386. }
  4387. function o(a) {
  4388. var b = a.styleBackup = a.attributes.style,
  4389. c = a.classBackup = a.attributes["class"];
  4390. if(!a.styles) a.styles = CKEDITOR.tools.parseCssText(b || "", 1);
  4391. if(!a.classes) a.classes = c ? c.split(/\s+/) : []
  4392. }
  4393. function q(a, b, c, d) {
  4394. var f = 0,
  4395. h;
  4396. if(d.toHtml) b.name = b.name.replace(H,
  4397. "$1");
  4398. if(d.doCallbacks && a.elementCallbacks) {
  4399. a: for(var j = a.elementCallbacks, i = 0, m = j.length, t; i < m; ++i)
  4400. if(t = j[i](b)) {
  4401. h = t;
  4402. break a
  4403. }if(h) return h
  4404. }
  4405. if(d.doTransform)
  4406. if(h = a._.transformations[b.name]) {
  4407. o(b);
  4408. for(j = 0; j < h.length; ++j) x(a, b, h[j]);
  4409. l(b)
  4410. }
  4411. if(d.doFilter) {
  4412. a: {
  4413. j = b.name;i = a._;a = i.allowedRules.elements[j];h = i.allowedRules.generic;j = i.disallowedRules.elements[j];i = i.disallowedRules.generic;m = d.skipRequired;t = {
  4414. valid: false,
  4415. validAttributes: {},
  4416. validClasses: {},
  4417. validStyles: {},
  4418. allAttributes: false,
  4419. allClasses: false,
  4420. allStyles: false,
  4421. hadInvalidAttribute: false,
  4422. hadInvalidClass: false,
  4423. hadInvalidStyle: false
  4424. };
  4425. var k, s;
  4426. if(!a && !h) a = null;
  4427. else {
  4428. o(b);
  4429. if(j) {
  4430. k = 0;
  4431. for(s = j.length; k < s; ++k)
  4432. if(g(j[k], b, t) === false) {
  4433. a = null;
  4434. break a
  4435. }
  4436. }
  4437. if(i) {
  4438. k = 0;
  4439. for(s = i.length; k < s; ++k) g(i[k], b, t)
  4440. }
  4441. if(a) {
  4442. k = 0;
  4443. for(s = a.length; k < s; ++k) e(a[k], b, t, m)
  4444. }
  4445. if(h) {
  4446. k = 0;
  4447. for(s = h.length; k < s; ++k) e(h[k], b, t, m)
  4448. }
  4449. a = t
  4450. }
  4451. }
  4452. if(!a) {
  4453. c.push(b);
  4454. return A
  4455. }
  4456. if(!a.valid) {
  4457. c.push(b);
  4458. return A
  4459. }
  4460. s = a.validAttributes;
  4461. var w = a.validStyles;h = a.validClasses;
  4462. var j = b.attributes,
  4463. C = b.styles,
  4464. i = b.classes,
  4465. m = b.classBackup,
  4466. n = b.styleBackup,
  4467. v, F, r = [];t = [];
  4468. var u = /^data-cke-/;k = false;delete j.style;delete j["class"];delete b.classBackup;delete b.styleBackup;
  4469. if(!a.allAttributes)
  4470. for(v in j)
  4471. if(!s[v])
  4472. if(u.test(v)) {
  4473. if(v != (F = v.replace(/^data-cke-saved-/, "")) && !s[F]) {
  4474. delete j[v];
  4475. k = true
  4476. }
  4477. } else {
  4478. delete j[v];
  4479. k = true
  4480. }
  4481. if(!a.allStyles || a.hadInvalidStyle) {
  4482. for(v in C) a.allStyles || w[v] ? r.push(v + ":" + C[v]) : k = true;
  4483. if(r.length) j.style = r.sort().join("; ")
  4484. } else if(n) j.style = n;
  4485. if(!a.allClasses || a.hadInvalidClass) {
  4486. for(v = 0; v < i.length; ++v)(a.allClasses ||
  4487. h[i[v]]) && t.push(i[v]);
  4488. t.length && (j["class"] = t.sort().join(" "));
  4489. m && t.length < m.split(/\s+/).length && (k = true)
  4490. } else m && (j["class"] = m);k && (f = A);
  4491. if(!d.skipFinalValidation && !p(b)) {
  4492. c.push(b);
  4493. return A
  4494. }
  4495. }
  4496. if(d.toHtml) b.name = b.name.replace(Q, "cke:$1");
  4497. return f
  4498. }
  4499. function m(a) {
  4500. var b = [],
  4501. c;
  4502. for(c in a) c.indexOf("*") > -1 && b.push(c.replace(/\*/g, ".*"));
  4503. return b.length ? RegExp("^(?:" + b.join("|") + ")$") : null
  4504. }
  4505. function l(a) {
  4506. var b = a.attributes,
  4507. c;
  4508. delete b.style;
  4509. delete b["class"];
  4510. if(c = CKEDITOR.tools.writeCssText(a.styles, true)) b.style =
  4511. c;
  4512. a.classes.length && (b["class"] = a.classes.sort().join(" "))
  4513. }
  4514. function p(a) {
  4515. switch(a.name) {
  4516. case "a":
  4517. if(!a.children.length && !a.attributes.name) return false;
  4518. break;
  4519. case "img":
  4520. if(!a.attributes.src) return false
  4521. }
  4522. return true
  4523. }
  4524. function t(a) {
  4525. if(!a) return false;
  4526. if(a === true) return true;
  4527. var b = m(a);
  4528. return function(c) {
  4529. return c in a || b && c.match(b)
  4530. }
  4531. }
  4532. function s() {
  4533. return new CKEDITOR.htmlParser.element("br")
  4534. }
  4535. function u(a) {
  4536. return a.type == CKEDITOR.NODE_ELEMENT && (a.name == "br" || B.$block[a.name])
  4537. }
  4538. function w(a, b, c) {
  4539. var d = a.name;
  4540. if(B.$empty[d] || !a.children.length)
  4541. if(d == "hr" && b == "br") a.replaceWith(s());
  4542. else {
  4543. a.parent && c.push({
  4544. check: "it",
  4545. el: a.parent
  4546. });
  4547. a.remove()
  4548. }
  4549. else if(B.$block[d] || d == "tr")
  4550. if(b == "br") {
  4551. if(a.previous && !u(a.previous)) {
  4552. b = s();
  4553. b.insertBefore(a)
  4554. }
  4555. if(a.next && !u(a.next)) {
  4556. b = s();
  4557. b.insertAfter(a)
  4558. }
  4559. a.replaceWithChildren()
  4560. } else {
  4561. var d = a.children,
  4562. f;
  4563. b: {
  4564. f = B[b];
  4565. for(var g = 0, h = d.length, e; g < h; ++g) {
  4566. e = d[g];
  4567. if(e.type == CKEDITOR.NODE_ELEMENT && !f[e.name]) {
  4568. f = false;
  4569. break b
  4570. }
  4571. }
  4572. f = true
  4573. }
  4574. if(f) {
  4575. a.name = b;
  4576. a.attributes = {};
  4577. c.push({
  4578. check: "parent-down",
  4579. el: a
  4580. })
  4581. } else {
  4582. f = a.parent;
  4583. for(var g = f.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || f.name == "body", j, i, h = d.length; h > 0;) {
  4584. e = d[--h];
  4585. if(g && (e.type == CKEDITOR.NODE_TEXT || e.type == CKEDITOR.NODE_ELEMENT && B.$inline[e.name])) {
  4586. if(!j) {
  4587. j = new CKEDITOR.htmlParser.element(b);
  4588. j.insertAfter(a);
  4589. c.push({
  4590. check: "parent-down",
  4591. el: j
  4592. })
  4593. }
  4594. j.add(e, 0)
  4595. } else {
  4596. j = null;
  4597. i = B[f.name] || B.span;
  4598. e.insertAfter(a);
  4599. f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && (e.type == CKEDITOR.NODE_ELEMENT && !i[e.name]) && c.push({
  4600. check: "el-up",
  4601. el: e
  4602. })
  4603. }
  4604. }
  4605. a.remove()
  4606. }
  4607. }
  4608. else if(d == "style") a.remove();
  4609. else {
  4610. a.parent && c.push({
  4611. check: "it",
  4612. el: a.parent
  4613. });
  4614. a.replaceWithChildren()
  4615. }
  4616. }
  4617. function x(a, b, c) {
  4618. var d, f;
  4619. for(d = 0; d < c.length; ++d) {
  4620. f = c[d];
  4621. if((!f.check || a.check(f.check, false)) && (!f.left || f.left(b))) {
  4622. f.right(b, O);
  4623. break
  4624. }
  4625. }
  4626. }
  4627. function v(a, b) {
  4628. var c = b.getDefinition(),
  4629. d = c.attributes,
  4630. f = c.styles,
  4631. g, h, e, j;
  4632. if(a.name != c.element) return false;
  4633. for(g in d)
  4634. if(g == "class") {
  4635. c = d[g].split(/\s+/);
  4636. for(e = a.classes.join("|"); j = c.pop();)
  4637. if(e.indexOf(j) == -1) return false
  4638. } else if(a.attributes[g] != d[g]) return false;
  4639. for(h in f)
  4640. if(a.styles[h] !=
  4641. f[h]) return false;
  4642. return true
  4643. }
  4644. function r(a, b) {
  4645. var c, d;
  4646. if(typeof a == "string") c = a;
  4647. else if(a instanceof CKEDITOR.style) d = a;
  4648. else {
  4649. c = a[0];
  4650. d = a[1]
  4651. }
  4652. return [{
  4653. element: c,
  4654. left: d,
  4655. right: function(a, c) {
  4656. c.transform(a, b)
  4657. }
  4658. }]
  4659. }
  4660. function y(a) {
  4661. return function(b) {
  4662. return v(b, a)
  4663. }
  4664. }
  4665. function z(a) {
  4666. return function(b, c) {
  4667. c[a](b)
  4668. }
  4669. }
  4670. var B = CKEDITOR.dtd,
  4671. A = 1,
  4672. G = CKEDITOR.tools.copy,
  4673. D = CKEDITOR.tools.trim,
  4674. J = "cke-test",
  4675. C = ["", "p", "br", "div"];
  4676. CKEDITOR.FILTER_SKIP_TREE = 2;
  4677. CKEDITOR.filter = function(a) {
  4678. this.allowedContent = [];
  4679. this.disallowedContent = [];
  4680. this.elementCallbacks = null;
  4681. this.disabled = false;
  4682. this.editor = null;
  4683. this.id = CKEDITOR.tools.getNextNumber();
  4684. this._ = {
  4685. allowedRules: {
  4686. elements: {},
  4687. generic: []
  4688. },
  4689. disallowedRules: {
  4690. elements: {},
  4691. generic: []
  4692. },
  4693. transformations: {},
  4694. cachedTests: {}
  4695. };
  4696. CKEDITOR.filter.instances[this.id] = this;
  4697. if(a instanceof CKEDITOR.editor) {
  4698. a = this.editor = a;
  4699. this.customConfig = true;
  4700. var b = a.config.allowedContent;
  4701. if(b === true) this.disabled = true;
  4702. else {
  4703. if(!b) this.customConfig = false;
  4704. this.allow(b, "config", 1);
  4705. this.allow(a.config.extraAllowedContent, "extra",
  4706. 1);
  4707. this.allow(C[a.enterMode] + " " + C[a.shiftEnterMode], "default", 1);
  4708. this.disallow(a.config.disallowedContent)
  4709. }
  4710. } else {
  4711. this.customConfig = false;
  4712. this.allow(a, "default", 1)
  4713. }
  4714. };
  4715. CKEDITOR.filter.instances = {};
  4716. CKEDITOR.filter.prototype = {
  4717. allow: function(b, c, f) {
  4718. if(!d(this, b, f)) return false;
  4719. var g, h;
  4720. if(typeof b == "string") b = k(b);
  4721. else if(b instanceof CKEDITOR.style) {
  4722. if(b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, f);
  4723. g = b.getDefinition();
  4724. b = {};
  4725. f = g.attributes;
  4726. b[g.element] = g = {
  4727. styles: g.styles,
  4728. requiredStyles: g.styles && CKEDITOR.tools.objectKeys(g.styles)
  4729. };
  4730. if(f) {
  4731. f = G(f);
  4732. g.classes = f["class"] ? f["class"].split(/\s+/) : null;
  4733. g.requiredClasses = g.classes;
  4734. delete f["class"];
  4735. g.attributes = f;
  4736. g.requiredAttributes = f && CKEDITOR.tools.objectKeys(f)
  4737. }
  4738. } else if(CKEDITOR.tools.isArray(b)) {
  4739. for(g = 0; g < b.length; ++g) h = this.allow(b[g], c, f);
  4740. return h
  4741. }
  4742. a(this, b, c, this.allowedContent, this._.allowedRules);
  4743. return true
  4744. },
  4745. applyTo: function(a, b, c, d) {
  4746. if(this.disabled) return false;
  4747. var f = this,
  4748. g = [],
  4749. h = this.editor && this.editor.config.protectedSource,
  4750. e, j = false,
  4751. i = {
  4752. doFilter: !c,
  4753. doTransform: true,
  4754. doCallbacks: true,
  4755. toHtml: b
  4756. };
  4757. a.forEach(function(a) {
  4758. if(a.type == CKEDITOR.NODE_ELEMENT) {
  4759. if(a.attributes["data-cke-filter"] == "off") return false;
  4760. if(!b || !(a.name == "span" && ~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))) {
  4761. e = q(f, a, g, i);
  4762. if(e & A) j = true;
  4763. else if(e & 2) return false
  4764. }
  4765. } else if(a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
  4766. var c;
  4767. a: {
  4768. var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));c = [];
  4769. var p,
  4770. m, t;
  4771. if(h)
  4772. for(m = 0; m < h.length; ++m)
  4773. if((t = d.match(h[m])) && t[0].length == d.length) {
  4774. c = true;
  4775. break a
  4776. }
  4777. d = CKEDITOR.htmlParser.fragment.fromHtml(d);d.children.length == 1 && (p = d.children[0]).type == CKEDITOR.NODE_ELEMENT && q(f, p, c, i);c = !c.length
  4778. }
  4779. c || g.push(a)
  4780. }
  4781. }, null, true);
  4782. g.length && (j = true);
  4783. for(var m, a = [], d = C[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)], t; c = g.pop();) c.type == CKEDITOR.NODE_ELEMENT ? w(c, d, a) : c.remove();
  4784. for(; m = a.pop();) {
  4785. c = m.el;
  4786. if(c.parent) {
  4787. t = B[c.parent.name] || B.span;
  4788. switch(m.check) {
  4789. case "it":
  4790. B.$removeEmpty[c.name] &&
  4791. !c.children.length ? w(c, d, a) : p(c) || w(c, d, a);
  4792. break;
  4793. case "el-up":
  4794. c.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && !t[c.name] && w(c, d, a);
  4795. break;
  4796. case "parent-down":
  4797. c.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && !t[c.name] && w(c.parent, d, a)
  4798. }
  4799. }
  4800. }
  4801. return j
  4802. },
  4803. checkFeature: function(a) {
  4804. if(this.disabled || !a) return true;
  4805. a.toFeature && (a = a.toFeature(this.editor));
  4806. return !a.requiredContent || this.check(a.requiredContent)
  4807. },
  4808. disable: function() {
  4809. this.disabled = true
  4810. },
  4811. disallow: function(b) {
  4812. if(!d(this, b, true)) return false;
  4813. typeof b ==
  4814. "string" && (b = k(b));
  4815. a(this, b, null, this.disallowedContent, this._.disallowedRules);
  4816. return true
  4817. },
  4818. addContentForms: function(a) {
  4819. if(!this.disabled && a) {
  4820. var b, c, d = [],
  4821. f;
  4822. for(b = 0; b < a.length && !f; ++b) {
  4823. c = a[b];
  4824. if((typeof c == "string" || c instanceof CKEDITOR.style) && this.check(c)) f = c
  4825. }
  4826. if(f) {
  4827. for(b = 0; b < a.length; ++b) d.push(r(a[b], f));
  4828. this.addTransformations(d)
  4829. }
  4830. }
  4831. },
  4832. addElementCallback: function(a) {
  4833. if(!this.elementCallbacks) this.elementCallbacks = [];
  4834. this.elementCallbacks.push(a)
  4835. },
  4836. addFeature: function(a) {
  4837. if(this.disabled || !a) return true;
  4838. a.toFeature && (a = a.toFeature(this.editor));
  4839. this.allow(a.allowedContent, a.name);
  4840. this.addTransformations(a.contentTransformations);
  4841. this.addContentForms(a.contentForms);
  4842. return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : true
  4843. },
  4844. addTransformations: function(a) {
  4845. var b, c;
  4846. if(!this.disabled && a) {
  4847. var d = this._.transformations,
  4848. f;
  4849. for(f = 0; f < a.length; ++f) {
  4850. b = a[f];
  4851. var g = void 0,
  4852. h = void 0,
  4853. e = void 0,
  4854. j = void 0,
  4855. i = void 0,
  4856. p = void 0;
  4857. c = [];
  4858. for(h = 0; h < b.length; ++h) {
  4859. e = b[h];
  4860. if(typeof e ==
  4861. "string") {
  4862. e = e.split(/\s*:\s*/);
  4863. j = e[0];
  4864. i = null;
  4865. p = e[1]
  4866. } else {
  4867. j = e.check;
  4868. i = e.left;
  4869. p = e.right
  4870. }
  4871. if(!g) {
  4872. g = e;
  4873. g = g.element ? g.element : j ? j.match(/^([a-z0-9]+)/i)[0] : g.left.getDefinition().element
  4874. }
  4875. i instanceof CKEDITOR.style && (i = y(i));
  4876. c.push({
  4877. check: j == g ? null : j,
  4878. left: i,
  4879. right: typeof p == "string" ? z(p) : p
  4880. })
  4881. }
  4882. b = g;
  4883. d[b] || (d[b] = []);
  4884. d[b].push(c)
  4885. }
  4886. }
  4887. },
  4888. check: function(a, b, c) {
  4889. if(this.disabled) return true;
  4890. if(CKEDITOR.tools.isArray(a)) {
  4891. for(var d = a.length; d--;)
  4892. if(this.check(a[d], b, c)) return true;
  4893. return false
  4894. }
  4895. var f, g;
  4896. if(typeof a == "string") {
  4897. g =
  4898. a + "<" + (b === false ? "0" : "1") + (c ? "1" : "0") + ">";
  4899. if(g in this._.cachedChecks) return this._.cachedChecks[g];
  4900. d = k(a).$1;
  4901. f = d.styles;
  4902. var h = d.classes;
  4903. d.name = d.elements;
  4904. d.classes = h = h ? h.split(/\s*,\s*/) : [];
  4905. d.styles = i(f);
  4906. d.attributes = i(d.attributes);
  4907. d.children = [];
  4908. h.length && (d.attributes["class"] = h.join(" "));
  4909. if(f) d.attributes.style = CKEDITOR.tools.writeCssText(d.styles);
  4910. f = d
  4911. } else {
  4912. d = a.getDefinition();
  4913. f = d.styles;
  4914. h = d.attributes || {};
  4915. if(f) {
  4916. f = G(f);
  4917. h.style = CKEDITOR.tools.writeCssText(f, true)
  4918. } else f = {};
  4919. f = {
  4920. name: d.element,
  4921. attributes: h,
  4922. classes: h["class"] ? h["class"].split(/\s+/) : [],
  4923. styles: f,
  4924. children: []
  4925. }
  4926. }
  4927. var h = CKEDITOR.tools.clone(f),
  4928. e = [],
  4929. j;
  4930. if(b !== false && (j = this._.transformations[f.name])) {
  4931. for(d = 0; d < j.length; ++d) x(this, f, j[d]);
  4932. l(f)
  4933. }
  4934. q(this, h, e, {
  4935. doFilter: true,
  4936. doTransform: b !== false,
  4937. skipRequired: !c,
  4938. skipFinalValidation: !c
  4939. });
  4940. b = e.length > 0 ? false : CKEDITOR.tools.objectCompare(f.attributes, h.attributes, true) ? true : false;
  4941. typeof a == "string" && (this._.cachedChecks[g] = b);
  4942. return b
  4943. },
  4944. getAllowedEnterMode: function() {
  4945. var a = ["p", "div", "br"],
  4946. b = {
  4947. p: CKEDITOR.ENTER_P,
  4948. div: CKEDITOR.ENTER_DIV,
  4949. br: CKEDITOR.ENTER_BR
  4950. };
  4951. return function(c, d) {
  4952. var f = a.slice(),
  4953. g;
  4954. if(this.check(C[c])) return c;
  4955. for(d || (f = f.reverse()); g = f.pop();)
  4956. if(this.check(g)) return b[g];
  4957. return CKEDITOR.ENTER_BR
  4958. }
  4959. }(),
  4960. destroy: function() {
  4961. delete CKEDITOR.filter.instances[this.id];
  4962. delete this._;
  4963. delete this.allowedContent;
  4964. delete this.disallowedContent
  4965. }
  4966. };
  4967. var F = {
  4968. styles: 1,
  4969. attributes: 1,
  4970. classes: 1
  4971. },
  4972. E = {
  4973. styles: "requiredStyles",
  4974. attributes: "requiredAttributes",
  4975. classes: "requiredClasses"
  4976. },
  4977. I = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
  4978. L = {
  4979. styles: /{([^}]+)}/,
  4980. attrs: /\[([^\]]+)\]/,
  4981. classes: /\(([^\)]+)\)/
  4982. },
  4983. H = /^cke:(object|embed|param)$/,
  4984. Q = /^(object|embed|param)$/,
  4985. O = CKEDITOR.filter.transformationsTools = {
  4986. sizeToStyle: function(a) {
  4987. this.lengthToStyle(a, "width");
  4988. this.lengthToStyle(a, "height")
  4989. },
  4990. sizeToAttribute: function(a) {
  4991. this.lengthToAttribute(a, "width");
  4992. this.lengthToAttribute(a, "height")
  4993. },
  4994. lengthToStyle: function(a, b, c) {
  4995. c = c || b;
  4996. if(!(c in a.styles)) {
  4997. var d = a.attributes[b];
  4998. if(d) {
  4999. /^\d+$/.test(d) && (d = d + "px");
  5000. a.styles[c] = d
  5001. }
  5002. }
  5003. delete a.attributes[b]
  5004. },
  5005. lengthToAttribute: function(a, b, c) {
  5006. c = c || b;
  5007. if(!(c in a.attributes)) {
  5008. var d = a.styles[b],
  5009. f = d && d.match(/^(\d+)(?:\.\d*)?px$/);
  5010. f ? a.attributes[c] = f[1] : d == J && (a.attributes[c] = J)
  5011. }
  5012. delete a.styles[b]
  5013. },
  5014. alignmentToStyle: function(a) {
  5015. if(!("float" in a.styles)) {
  5016. var b = a.attributes.align;
  5017. if(b == "left" || b == "right") a.styles["float"] = b
  5018. }
  5019. delete a.attributes.align
  5020. },
  5021. alignmentToAttribute: function(a) {
  5022. if(!("align" in a.attributes)) {
  5023. var b = a.styles["float"];
  5024. if(b == "left" || b == "right") a.attributes.align = b
  5025. }
  5026. delete a.styles["float"]
  5027. },
  5028. matchesStyle: v,
  5029. transform: function(a, b) {
  5030. if(typeof b == "string") a.name = b;
  5031. else {
  5032. var c = b.getDefinition(),
  5033. d = c.styles,
  5034. f = c.attributes,
  5035. g, h, e, j;
  5036. a.name = c.element;
  5037. for(g in f)
  5038. if(g == "class") {
  5039. c = a.classes.join("|");
  5040. for(e = f[g].split(/\s+/); j = e.pop();) c.indexOf(j) == -1 && a.classes.push(j)
  5041. } else a.attributes[g] = f[g];
  5042. for(h in d) a.styles[h] = d[h]
  5043. }
  5044. }
  5045. }
  5046. }(),
  5047. function() {
  5048. CKEDITOR.focusManager = function(a) {
  5049. if(a.focusManager) return a.focusManager;
  5050. this.hasFocus = false;
  5051. this.currentActive = null;
  5052. this._ = {
  5053. editor: a
  5054. };
  5055. return this
  5056. };
  5057. CKEDITOR.focusManager._ = {
  5058. blurDelay: 200
  5059. };
  5060. CKEDITOR.focusManager.prototype = {
  5061. focus: function(a) {
  5062. this._.timer && clearTimeout(this._.timer);
  5063. if(a) this.currentActive = a;
  5064. if(!this.hasFocus && !this._.locked) {
  5065. (a = CKEDITOR.currentInstance) && a.focusManager.blur(1);
  5066. this.hasFocus = true;
  5067. (a = this._.editor.container) && a.addClass("cke_focus");
  5068. this._.editor.fire("focus")
  5069. }
  5070. },
  5071. lock: function() {
  5072. this._.locked = 1
  5073. },
  5074. unlock: function() {
  5075. delete this._.locked
  5076. },
  5077. blur: function(a) {
  5078. function e() {
  5079. if(this.hasFocus) {
  5080. this.hasFocus = false;
  5081. var a = this._.editor.container;
  5082. a && a.removeClass("cke_focus");
  5083. this._.editor.fire("blur")
  5084. }
  5085. }
  5086. if(!this._.locked) {
  5087. this._.timer && clearTimeout(this._.timer);
  5088. var b = CKEDITOR.focusManager._.blurDelay;
  5089. a || !b ? e.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function() {
  5090. delete this._.timer;
  5091. e.call(this)
  5092. }, b, this)
  5093. }
  5094. },
  5095. add: function(a, e) {
  5096. var b = a.getCustomData("focusmanager");
  5097. if(!b || b != this) {
  5098. b && b.remove(a);
  5099. var b = "focus",
  5100. g = "blur";
  5101. if(e)
  5102. if(CKEDITOR.env.ie) {
  5103. b = "focusin";
  5104. g = "focusout"
  5105. } else CKEDITOR.event.useCapture = 1;
  5106. var c = {
  5107. blur: function() {
  5108. a.equals(this.currentActive) && this.blur()
  5109. },
  5110. focus: function() {
  5111. this.focus(a)
  5112. }
  5113. };
  5114. a.on(b, c.focus, this);
  5115. a.on(g, c.blur, this);
  5116. if(e) CKEDITOR.event.useCapture = 0;
  5117. a.setCustomData("focusmanager", this);
  5118. a.setCustomData("focusmanager_handlers", c)
  5119. }
  5120. },
  5121. remove: function(a) {
  5122. a.removeCustomData("focusmanager");
  5123. var e = a.removeCustomData("focusmanager_handlers");
  5124. a.removeListener("blur", e.blur);
  5125. a.removeListener("focus", e.focus)
  5126. }
  5127. }
  5128. }(), CKEDITOR.keystrokeHandler = function(a) {
  5129. if(a.keystrokeHandler) return a.keystrokeHandler;
  5130. this.keystrokes = {};
  5131. this.blockedKeystrokes = {};
  5132. this._ = {
  5133. editor: a
  5134. };
  5135. return this
  5136. },
  5137. function() {
  5138. var a,
  5139. e = function(b) {
  5140. var b = b.data,
  5141. c = b.getKeystroke(),
  5142. d = this.keystrokes[c],
  5143. e = this._.editor;
  5144. a = e.fire("key", {
  5145. keyCode: c,
  5146. domEvent: b
  5147. }) === false;
  5148. if(!a) {
  5149. d && (a = e.execCommand(d, {
  5150. from: "keystrokeHandler"
  5151. }) !== false);
  5152. a || (a = !!this.blockedKeystrokes[c])
  5153. }
  5154. a && b.preventDefault(true);
  5155. return !a
  5156. },
  5157. b = function(b) {
  5158. if(a) {
  5159. a = false;
  5160. b.data.preventDefault(true)
  5161. }
  5162. };
  5163. CKEDITOR.keystrokeHandler.prototype = {
  5164. attach: function(a) {
  5165. a.on("keydown", e, this);
  5166. if(CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this)
  5167. }
  5168. }
  5169. }(),
  5170. function() {
  5171. CKEDITOR.lang = {
  5172. languages: {
  5173. af: 1,
  5174. ar: 1,
  5175. bg: 1,
  5176. bn: 1,
  5177. bs: 1,
  5178. ca: 1,
  5179. cs: 1,
  5180. cy: 1,
  5181. da: 1,
  5182. de: 1,
  5183. el: 1,
  5184. "en-au": 1,
  5185. "en-ca": 1,
  5186. "en-gb": 1,
  5187. en: 1,
  5188. eo: 1,
  5189. es: 1,
  5190. et: 1,
  5191. eu: 1,
  5192. fa: 1,
  5193. fi: 1,
  5194. fo: 1,
  5195. "fr-ca": 1,
  5196. fr: 1,
  5197. gl: 1,
  5198. gu: 1,
  5199. he: 1,
  5200. hi: 1,
  5201. hr: 1,
  5202. hu: 1,
  5203. id: 1,
  5204. is: 1,
  5205. it: 1,
  5206. ja: 1,
  5207. ka: 1,
  5208. km: 1,
  5209. ko: 1,
  5210. ku: 1,
  5211. lt: 1,
  5212. lv: 1,
  5213. mk: 1,
  5214. mn: 1,
  5215. ms: 1,
  5216. nb: 1,
  5217. nl: 1,
  5218. no: 1,
  5219. pl: 1,
  5220. "pt-br": 1,
  5221. pt: 1,
  5222. ro: 1,
  5223. ru: 1,
  5224. si: 1,
  5225. sk: 1,
  5226. sl: 1,
  5227. sq: 1,
  5228. "sr-latn": 1,
  5229. sr: 1,
  5230. sv: 1,
  5231. th: 1,
  5232. tr: 1,
  5233. tt: 1,
  5234. ug: 1,
  5235. uk: 1,
  5236. vi: 1,
  5237. "zh-cn": 1,
  5238. zh: 1
  5239. },
  5240. rtl: {
  5241. ar: 1,
  5242. fa: 1,
  5243. he: 1,
  5244. ku: 1,
  5245. ug: 1
  5246. },
  5247. load: function(a, e, b) {
  5248. if(!a || !CKEDITOR.lang.languages[a]) a = this.detect(e, a);
  5249. var g = this,
  5250. e = function() {
  5251. g[a].dir =
  5252. g.rtl[a] ? "rtl" : "ltr";
  5253. b(a, g[a])
  5254. };
  5255. this[a] ? e() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), e, this)
  5256. },
  5257. detect: function(a, e) {
  5258. var b = this.languages,
  5259. e = e || navigator.userLanguage || navigator.language || a,
  5260. g = e.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
  5261. c = g[1],
  5262. g = g[2];
  5263. b[c + "-" + g] ? c = c + "-" + g : b[c] || (c = null);
  5264. CKEDITOR.lang.detect = c ? function() {
  5265. return c
  5266. } : function(a) {
  5267. return a
  5268. };
  5269. return c || a
  5270. }
  5271. }
  5272. }(), CKEDITOR.scriptLoader = function() {
  5273. var a = {},
  5274. e = {};
  5275. return {
  5276. load: function(b, g, c, d) {
  5277. var j = typeof b == "string";
  5278. j && (b = [b]);
  5279. c || (c = CKEDITOR);
  5280. var f = b.length,
  5281. h = [],
  5282. i = [],
  5283. k = function(a) {
  5284. g && (j ? g.call(c, a) : g.call(c, h, i))
  5285. };
  5286. if(f === 0) k(true);
  5287. else {
  5288. var n = function(a, b) {
  5289. (b ? h : i).push(a);
  5290. if(--f <= 0) {
  5291. d && CKEDITOR.document.getDocumentElement().removeStyle("cursor");
  5292. k(b)
  5293. }
  5294. },
  5295. o = function(b, c) {
  5296. a[b] = 1;
  5297. var d = e[b];
  5298. delete e[b];
  5299. for(var f = 0; f < d.length; f++) d[f](b, c)
  5300. },
  5301. q = function(b) {
  5302. if(a[b]) n(b, true);
  5303. else {
  5304. var c = e[b] || (e[b] = []);
  5305. c.push(n);
  5306. if(!(c.length > 1)) {
  5307. var d = new CKEDITOR.dom.element("script");
  5308. d.setAttributes({
  5309. type: "text/javascript",
  5310. src: b
  5311. });
  5312. if(g)
  5313. if(CKEDITOR.env.ie &&
  5314. CKEDITOR.env.version < 11) d.$.onreadystatechange = function() {
  5315. if(d.$.readyState == "loaded" || d.$.readyState == "complete") {
  5316. d.$.onreadystatechange = null;
  5317. o(b, true)
  5318. }
  5319. };
  5320. else {
  5321. d.$.onload = function() {
  5322. setTimeout(function() {
  5323. o(b, true)
  5324. }, 0)
  5325. };
  5326. d.$.onerror = function() {
  5327. o(b, false)
  5328. }
  5329. }
  5330. d.appendTo(CKEDITOR.document.getHead())
  5331. }
  5332. }
  5333. };
  5334. d && CKEDITOR.document.getDocumentElement().setStyle("cursor", "wait");
  5335. for(var m = 0; m < f; m++) q(b[m])
  5336. }
  5337. },
  5338. queue: function() {
  5339. function a() {
  5340. var b;
  5341. (b = g[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0)
  5342. }
  5343. var g = [];
  5344. return function(c,
  5345. d) {
  5346. var e = this;
  5347. g.push({
  5348. scriptUrl: c,
  5349. callback: function() {
  5350. d && d.apply(this, arguments);
  5351. g.shift();
  5352. a.call(e)
  5353. }
  5354. });
  5355. g.length == 1 && a.call(this)
  5356. }
  5357. }()
  5358. }
  5359. }(), CKEDITOR.resourceManager = function(a, e) {
  5360. this.basePath = a;
  5361. this.fileName = e;
  5362. this.registered = {};
  5363. this.loaded = {};
  5364. this.externals = {};
  5365. this._ = {
  5366. waitingList: {}
  5367. }
  5368. }, CKEDITOR.resourceManager.prototype = {
  5369. add: function(a, e) {
  5370. if(this.registered[a]) throw '[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.';
  5371. var b = this.registered[a] = e || {};
  5372. b.name = a;
  5373. b.path = this.getPath(a);
  5374. CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b);
  5375. return this.get(a)
  5376. },
  5377. get: function(a) {
  5378. return this.registered[a] || null
  5379. },
  5380. getPath: function(a) {
  5381. var e = this.externals[a];
  5382. return CKEDITOR.getUrl(e && e.dir || this.basePath + a + "/")
  5383. },
  5384. getFilePath: function(a) {
  5385. var e = this.externals[a];
  5386. return CKEDITOR.getUrl(this.getPath(a) + (e ? e.file : this.fileName + ".js"))
  5387. },
  5388. addExternal: function(a, e, b) {
  5389. for(var a = a.split(","), g = 0; g < a.length; g++) {
  5390. var c = a[g];
  5391. b || (e = e.replace(/[^\/]+$/, function(a) {
  5392. b = a;
  5393. return ""
  5394. }));
  5395. this.externals[c] = {
  5396. dir: e,
  5397. file: b || this.fileName + ".js"
  5398. }
  5399. }
  5400. },
  5401. load: function(a, e, b) {
  5402. CKEDITOR.tools.isArray(a) || (a = a ? [a] : []);
  5403. for(var g = this.loaded, c = this.registered, d = [], j = {}, f = {}, h = 0; h < a.length; h++) {
  5404. var i = a[h];
  5405. if(i)
  5406. if(!g[i] && !c[i]) {
  5407. var k = this.getFilePath(i);
  5408. d.push(k);
  5409. k in j || (j[k] = []);
  5410. j[k].push(i)
  5411. } else f[i] = this.get(i)
  5412. }
  5413. CKEDITOR.scriptLoader.load(d, function(a, c) {
  5414. if(c.length) throw '[CKEDITOR.resourceManager.load] Resource name "' + j[c[0]].join(",") + '" was not found at "' + c[0] + '".';
  5415. for(var d = 0; d < a.length; d++)
  5416. for(var h = j[a[d]],
  5417. i = 0; i < h.length; i++) {
  5418. var p = h[i];
  5419. f[p] = this.get(p);
  5420. g[p] = 1
  5421. }
  5422. e.call(b, f)
  5423. }, this)
  5424. }
  5425. }, CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin"), CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(a) {
  5426. var e = {};
  5427. return function(b, g, c) {
  5428. var d = {},
  5429. j = function(b) {
  5430. a.call(this, b, function(a) {
  5431. CKEDITOR.tools.extend(d, a);
  5432. var b = [],
  5433. f;
  5434. for(f in a) {
  5435. var n = a[f],
  5436. o = n && n.requires;
  5437. if(!e[f]) {
  5438. if(n.icons)
  5439. for(var q = n.icons.split(","), m = q.length; m--;) CKEDITOR.skin.addIcon(q[m], n.path + "icons/" + (CKEDITOR.env.hidpi &&
  5440. n.hidpi ? "hidpi/" : "") + q[m] + ".png");
  5441. e[f] = 1
  5442. }
  5443. if(o) {
  5444. o.split && (o = o.split(","));
  5445. for(n = 0; n < o.length; n++) d[o[n]] || b.push(o[n])
  5446. }
  5447. }
  5448. if(b.length) j.call(this, b);
  5449. else {
  5450. for(f in d) {
  5451. n = d[f];
  5452. if(n.onLoad && !n.onLoad._called) {
  5453. n.onLoad() === false && delete d[f];
  5454. n.onLoad._called = 1
  5455. }
  5456. }
  5457. g && g.call(c || window, d)
  5458. }
  5459. }, this)
  5460. };
  5461. j.call(this, b)
  5462. }
  5463. }), CKEDITOR.plugins.setLang = function(a, e, b) {
  5464. var g = this.get(a),
  5465. a = g.langEntries || (g.langEntries = {}),
  5466. g = g.lang || (g.lang = []);
  5467. g.split && (g = g.split(","));
  5468. CKEDITOR.tools.indexOf(g, e) == -1 && g.push(e);
  5469. a[e] = b
  5470. }, CKEDITOR.ui =
  5471. function(a) {
  5472. if(a.ui) return a.ui;
  5473. this.items = {};
  5474. this.instances = {};
  5475. this.editor = a;
  5476. this._ = {
  5477. handlers: {}
  5478. };
  5479. return this
  5480. }, CKEDITOR.ui.prototype = {
  5481. add: function(a, e, b) {
  5482. b.name = a.toLowerCase();
  5483. var g = this.items[a] = {
  5484. type: e,
  5485. command: b.command || null,
  5486. args: Array.prototype.slice.call(arguments, 2)
  5487. };
  5488. CKEDITOR.tools.extend(g, b)
  5489. },
  5490. get: function(a) {
  5491. return this.instances[a]
  5492. },
  5493. create: function(a) {
  5494. var e = this.items[a],
  5495. b = e && this._.handlers[e.type],
  5496. g = e && e.command && this.editor.getCommand(e.command),
  5497. b = b && b.create.apply(this, e.args);
  5498. this.instances[a] =
  5499. b;
  5500. g && g.uiItems.push(b);
  5501. if(b && !b.type) b.type = e.type;
  5502. return b
  5503. },
  5504. addHandler: function(a, e) {
  5505. this._.handlers[a] = e
  5506. },
  5507. space: function(a) {
  5508. return CKEDITOR.document.getById(this.spaceId(a))
  5509. },
  5510. spaceId: function(a) {
  5511. return this.editor.id + "_" + a
  5512. }
  5513. }, CKEDITOR.event.implementOn(CKEDITOR.ui),
  5514. function() {
  5515. function a(a, d, f) {
  5516. CKEDITOR.event.call(this);
  5517. a = a && CKEDITOR.tools.clone(a);
  5518. if(d !== void 0) {
  5519. if(d instanceof CKEDITOR.dom.element) {
  5520. if(!f) throw Error("One of the element modes must be specified.");
  5521. } else throw Error("Expect element of type CKEDITOR.dom.element.");
  5522. if(CKEDITOR.env.ie && CKEDITOR.env.quirks && f == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks.");
  5523. if(!(f == CKEDITOR.ELEMENT_MODE_INLINE ? d.is(CKEDITOR.dtd.$editable) || d.is("textarea") : f == CKEDITOR.ELEMENT_MODE_REPLACE ? !d.is(CKEDITOR.dtd.$nonBodyContent) : 1)) throw Error('The specified element mode is not supported on element: "' + d.getName() + '".');
  5524. this.element = d;
  5525. this.elementMode = f;
  5526. this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (d.getId() || d.getNameAtt())
  5527. } else this.elementMode =
  5528. CKEDITOR.ELEMENT_MODE_NONE;
  5529. this._ = {};
  5530. this.commands = {};
  5531. this.templates = {};
  5532. this.name = this.name || e();
  5533. this.id = CKEDITOR.tools.getNextId();
  5534. this.status = "unloaded";
  5535. this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
  5536. this.ui = new CKEDITOR.ui(this);
  5537. this.focusManager = new CKEDITOR.focusManager(this);
  5538. this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
  5539. this.on("readOnly", b);
  5540. this.on("selectionChange", function(a) {
  5541. c(this, a.data.path)
  5542. });
  5543. this.on("activeFilterChange", function() {
  5544. c(this, this.elementPath(), true)
  5545. });
  5546. this.on("mode", b);
  5547. this.on("instanceReady", function() {
  5548. this.config.startupFocus && this.focus()
  5549. });
  5550. CKEDITOR.fire("instanceCreated", null, this);
  5551. CKEDITOR.add(this);
  5552. CKEDITOR.tools.setTimeout(function() {
  5553. j(this, a)
  5554. }, 0, this)
  5555. }
  5556. function e() {
  5557. do var a = "editor" + ++o; while (CKEDITOR.instances[a]);
  5558. return a
  5559. }
  5560. function b() {
  5561. var a = this.commands,
  5562. b;
  5563. for(b in a) g(this, a[b])
  5564. }
  5565. function g(a, b) {
  5566. b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" : b.modes[a.mode] ? "enable" : "disable"]()
  5567. }
  5568. function c(a, b, c) {
  5569. if(b) {
  5570. var d, f, g = a.commands;
  5571. for(f in g) {
  5572. d = g[f];
  5573. (c || d.contextSensitive) && d.refresh(a, b)
  5574. }
  5575. }
  5576. }
  5577. function d(a) {
  5578. var b = a.config.customConfig;
  5579. if(!b) return false;
  5580. var b = CKEDITOR.getUrl(b),
  5581. c = q[b] || (q[b] = {});
  5582. if(c.fn) {
  5583. c.fn.call(a, a.config);
  5584. (CKEDITOR.getUrl(a.config.customConfig) == b || !d(a)) && a.fireOnce("customConfigLoaded")
  5585. } else CKEDITOR.scriptLoader.queue(b, function() {
  5586. c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function() {};
  5587. d(a)
  5588. });
  5589. return true
  5590. }
  5591. function j(a, b) {
  5592. a.on("customConfigLoaded", function() {
  5593. if(b) {
  5594. if(b.on)
  5595. for(var c in b.on) a.on(c, b.on[c]);
  5596. CKEDITOR.tools.extend(a.config, b, true);
  5597. delete a.config.on
  5598. }
  5599. c = a.config;
  5600. a.readOnly = !(!c.readOnly && !(a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is("textarea") ? a.element.hasAttribute("disabled") : a.element.isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && a.element.hasAttribute("disabled")));
  5601. a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) : false;
  5602. a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") ||
  5603. 0;
  5604. a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
  5605. a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
  5606. if(c.skin) CKEDITOR.skinName = c.skin;
  5607. a.fireOnce("configLoaded");
  5608. a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
  5609. a.filter = a.activeFilter = new CKEDITOR.filter(a);
  5610. f(a)
  5611. });
  5612. if(b && b.customConfig != null) a.config.customConfig = b.customConfig;
  5613. d(a) || a.fireOnce("customConfigLoaded")
  5614. }
  5615. function f(a) {
  5616. CKEDITOR.skin.loadPart("editor", function() {
  5617. h(a)
  5618. })
  5619. }
  5620. function h(a) {
  5621. CKEDITOR.lang.load(a.config.language,
  5622. a.config.defaultLanguage,
  5623. function(b, c) {
  5624. var d = a.config.title;
  5625. a.langCode = b;
  5626. a.lang = CKEDITOR.tools.prototypedCopy(c);
  5627. a.title = typeof d == "string" || d === false ? d : [a.lang.editor, a.name].join(", ");
  5628. if(!a.config.contentsLangDirection) a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir;
  5629. a.fire("langLoaded");
  5630. i(a)
  5631. })
  5632. }
  5633. function i(a) {
  5634. a.getStylesSet(function(b) {
  5635. a.once("loaded", function() {
  5636. a.fire("stylesSet", {
  5637. styles: b
  5638. })
  5639. }, null, null, 1);
  5640. k(a)
  5641. })
  5642. }
  5643. function k(a) {
  5644. var b =
  5645. a.config,
  5646. c = b.plugins,
  5647. d = b.extraPlugins,
  5648. f = b.removePlugins;
  5649. if(d) var g = RegExp("(?:^|,)(?:" + d.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
  5650. c = c.replace(g, ""),
  5651. c = c + ("," + d);
  5652. if(f) var h = RegExp("(?:^|,)(?:" + f.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
  5653. c = c.replace(h, "");
  5654. CKEDITOR.env.air && (c = c + ",adobeair");
  5655. CKEDITOR.plugins.load(c.split(","), function(c) {
  5656. var d = [],
  5657. f = [],
  5658. g = [];
  5659. a.plugins = c;
  5660. for(var e in c) {
  5661. var j = c[e],
  5662. i = j.lang,
  5663. p = null,
  5664. t = j.requires,
  5665. k;
  5666. CKEDITOR.tools.isArray(t) && (t = t.join(","));
  5667. if(t && (k = t.match(h)))
  5668. for(; t = k.pop();) CKEDITOR.tools.setTimeout(function(a,
  5669. b) {
  5670. throw Error('Plugin "' + a.replace(",", "") + '" cannot be removed from the plugins list, because it\'s required by "' + b + '" plugin.');
  5671. }, 0, null, [t, e]);
  5672. if(i && !a.lang[e]) {
  5673. i.split && (i = i.split(","));
  5674. if(CKEDITOR.tools.indexOf(i, a.langCode) >= 0) p = a.langCode;
  5675. else {
  5676. p = a.langCode.replace(/-.*/, "");
  5677. p = p != a.langCode && CKEDITOR.tools.indexOf(i, p) >= 0 ? p : CKEDITOR.tools.indexOf(i, "en") >= 0 ? "en" : i[0]
  5678. }
  5679. if(!j.langEntries || !j.langEntries[p]) g.push(CKEDITOR.getUrl(j.path + "lang/" + p + ".js"));
  5680. else {
  5681. a.lang[e] = j.langEntries[p];
  5682. p = null
  5683. }
  5684. }
  5685. f.push(p);
  5686. d.push(j)
  5687. }
  5688. CKEDITOR.scriptLoader.load(g, function() {
  5689. for(var c = ["beforeInit", "init", "afterInit"], g = 0; g < c.length; g++)
  5690. for(var h = 0; h < d.length; h++) {
  5691. var e = d[h];
  5692. g === 0 && (f[h] && e.lang && e.langEntries) && (a.lang[e.name] = e.langEntries[f[h]]);
  5693. if(e[c[g]]) e[c[g]](a)
  5694. }
  5695. a.fireOnce("pluginsLoaded");
  5696. b.keystrokes && a.setKeystroke(a.config.keystrokes);
  5697. for(h = 0; h < a.config.blockedKeystrokes.length; h++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[h]] = 1;
  5698. a.status = "loaded";
  5699. a.fireOnce("loaded");
  5700. CKEDITOR.fire("instanceLoaded",
  5701. null, a)
  5702. })
  5703. })
  5704. }
  5705. function n() {
  5706. var a = this.element;
  5707. if(a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
  5708. var b = this.getData();
  5709. this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
  5710. a.is("textarea") ? a.setValue(b) : a.setHtml(b);
  5711. return true
  5712. }
  5713. return false
  5714. }
  5715. a.prototype = CKEDITOR.editor.prototype;
  5716. CKEDITOR.editor = a;
  5717. var o = 0,
  5718. q = {};
  5719. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  5720. addCommand: function(a, b) {
  5721. b.name = a.toLowerCase();
  5722. var c = new CKEDITOR.command(this, b);
  5723. this.mode && g(this, c);
  5724. return this.commands[a] = c
  5725. },
  5726. _attachToForm: function() {
  5727. function a(d) {
  5728. b.updateElement();
  5729. b._.required && (!c.getValue() && b.fire("required") === false) && d.data.preventDefault()
  5730. }
  5731. var b = this,
  5732. c = b.element,
  5733. d = new CKEDITOR.dom.element(c.$.form);
  5734. if(c.is("textarea") && d) {
  5735. d.on("submit", a);
  5736. if(d.$.submit && d.$.submit.call && d.$.submit.apply) d.$.submit = CKEDITOR.tools.override(d.$.submit, function(b) {
  5737. return function() {
  5738. a();
  5739. b.apply ? b.apply(this) : b()
  5740. }
  5741. });
  5742. b.on("destroy", function() {
  5743. d.removeListener("submit", a)
  5744. })
  5745. }
  5746. },
  5747. destroy: function(a) {
  5748. this.fire("beforeDestroy");
  5749. !a && n.call(this);
  5750. this.editable(null);
  5751. this.filter.destroy();
  5752. delete this.filter;
  5753. delete this.activeFilter;
  5754. this.status = "destroyed";
  5755. this.fire("destroy");
  5756. this.removeAllListeners();
  5757. CKEDITOR.remove(this);
  5758. CKEDITOR.fire("instanceDestroyed", null, this)
  5759. },
  5760. elementPath: function(a) {
  5761. if(!a) {
  5762. a = this.getSelection();
  5763. if(!a) return null;
  5764. a = a.getStartElement()
  5765. }
  5766. return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
  5767. },
  5768. createRange: function() {
  5769. var a = this.editable();
  5770. return a ? new CKEDITOR.dom.range(a) : null
  5771. },
  5772. execCommand: function(a,
  5773. b) {
  5774. var c = this.getCommand(a),
  5775. d = {
  5776. name: a,
  5777. commandData: b,
  5778. command: c
  5779. };
  5780. if(c && c.state != CKEDITOR.TRISTATE_DISABLED && this.fire("beforeCommandExec", d) !== false) {
  5781. d.returnValue = c.exec(d.commandData);
  5782. if(!c.async && this.fire("afterCommandExec", d) !== false) return d.returnValue
  5783. }
  5784. return false
  5785. },
  5786. getCommand: function(a) {
  5787. return this.commands[a]
  5788. },
  5789. getData: function(a) {
  5790. !a && this.fire("beforeGetData");
  5791. var b = this._.data;
  5792. if(typeof b != "string") b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ? b.getValue() :
  5793. b.getHtml() : "";
  5794. b = {
  5795. dataValue: b
  5796. };
  5797. !a && this.fire("getData", b);
  5798. return b.dataValue
  5799. },
  5800. getSnapshot: function() {
  5801. var a = this.fire("getSnapshot");
  5802. if(typeof a != "string") {
  5803. var b = this.element;
  5804. b && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a = b.is("textarea") ? b.getValue() : b.getHtml())
  5805. }
  5806. return a
  5807. },
  5808. loadSnapshot: function(a) {
  5809. this.fire("loadSnapshot", a)
  5810. },
  5811. setData: function(a, b, c) {
  5812. var d = true,
  5813. f = b;
  5814. if(b && typeof b == "object") {
  5815. c = b.internal;
  5816. f = b.callback;
  5817. d = !b.noSnapshot
  5818. }!c && d && this.fire("saveSnapshot");
  5819. if(f || !c) this.once("dataReady",
  5820. function(a) {
  5821. !c && d && this.fire("saveSnapshot");
  5822. f && f.call(a.editor)
  5823. });
  5824. a = {
  5825. dataValue: a
  5826. };
  5827. !c && this.fire("setData", a);
  5828. this._.data = a.dataValue;
  5829. !c && this.fire("afterSetData", a)
  5830. },
  5831. setReadOnly: function(a) {
  5832. a = a == null || a;
  5833. if(this.readOnly != a) {
  5834. this.readOnly = a;
  5835. this.keystrokeHandler.blockedKeystrokes[8] = +a;
  5836. this.editable().setReadOnly(a);
  5837. this.fire("readOnly")
  5838. }
  5839. },
  5840. insertHtml: function(a, b) {
  5841. this.fire("insertHtml", {
  5842. dataValue: a,
  5843. mode: b
  5844. })
  5845. },
  5846. insertText: function(a) {
  5847. this.fire("insertText", a)
  5848. },
  5849. insertElement: function(a) {
  5850. this.fire("insertElement",
  5851. a)
  5852. },
  5853. focus: function() {
  5854. this.fire("beforeFocus")
  5855. },
  5856. checkDirty: function() {
  5857. return this.status == "ready" && this._.previousValue !== this.getSnapshot()
  5858. },
  5859. resetDirty: function() {
  5860. this._.previousValue = this.getSnapshot()
  5861. },
  5862. updateElement: function() {
  5863. return n.call(this)
  5864. },
  5865. setKeystroke: function() {
  5866. for(var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [
  5867. [].slice.call(arguments, 0)
  5868. ], c, d, f = b.length; f--;) {
  5869. c = b[f];
  5870. d = 0;
  5871. if(CKEDITOR.tools.isArray(c)) {
  5872. d = c[1];
  5873. c = c[0]
  5874. }
  5875. d ? a[c] = d : delete a[c]
  5876. }
  5877. },
  5878. addFeature: function(a) {
  5879. return this.filter.addFeature(a)
  5880. },
  5881. setActiveFilter: function(a) {
  5882. if(!a) a = this.filter;
  5883. if(this.activeFilter !== a) {
  5884. this.activeFilter = a;
  5885. this.fire("activeFilterChange");
  5886. a === this.filter ? this.setActiveEnterMode(null, null) : this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode), a.getAllowedEnterMode(this.shiftEnterMode, true))
  5887. }
  5888. },
  5889. setActiveEnterMode: function(a, b) {
  5890. a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
  5891. b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
  5892. if(this.activeEnterMode != a || this.activeShiftEnterMode != b) {
  5893. this.activeEnterMode =
  5894. a;
  5895. this.activeShiftEnterMode = b;
  5896. this.fire("activeEnterModeChange")
  5897. }
  5898. }
  5899. })
  5900. }(), CKEDITOR.ELEMENT_MODE_NONE = 0, CKEDITOR.ELEMENT_MODE_REPLACE = 1, CKEDITOR.ELEMENT_MODE_APPENDTO = 2, CKEDITOR.ELEMENT_MODE_INLINE = 3, CKEDITOR.htmlParser = function() {
  5901. this._ = {
  5902. htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g
  5903. }
  5904. },
  5905. function() {
  5906. var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
  5907. e = {
  5908. checked: 1,
  5909. compact: 1,
  5910. declare: 1,
  5911. defer: 1,
  5912. disabled: 1,
  5913. ismap: 1,
  5914. multiple: 1,
  5915. nohref: 1,
  5916. noresize: 1,
  5917. noshade: 1,
  5918. nowrap: 1,
  5919. readonly: 1,
  5920. selected: 1
  5921. };
  5922. CKEDITOR.htmlParser.prototype = {
  5923. onTagOpen: function() {},
  5924. onTagClose: function() {},
  5925. onText: function() {},
  5926. onCDATA: function() {},
  5927. onComment: function() {},
  5928. parse: function(b) {
  5929. for(var g, c, d = 0, j; g = this._.htmlPartsRegex.exec(b);) {
  5930. c = g.index;
  5931. if(c > d) {
  5932. d = b.substring(d, c);
  5933. if(j) j.push(d);
  5934. else this.onText(d)
  5935. }
  5936. d = this._.htmlPartsRegex.lastIndex;
  5937. if(c = g[1]) {
  5938. c = c.toLowerCase();
  5939. if(j && CKEDITOR.dtd.$cdata[c]) {
  5940. this.onCDATA(j.join(""));
  5941. j = null
  5942. }
  5943. if(!j) {
  5944. this.onTagClose(c);
  5945. continue
  5946. }
  5947. }
  5948. if(j) j.push(g[0]);
  5949. else if(c = g[3]) {
  5950. c = c.toLowerCase();
  5951. if(!/="/.test(c)) {
  5952. var f = {},
  5953. h, i = g[4];
  5954. g = !!g[5];
  5955. if(i)
  5956. for(; h = a.exec(i);) {
  5957. var k = h[1].toLowerCase();
  5958. h = h[2] || h[3] || h[4] || "";
  5959. f[k] = !h && e[k] ? k : CKEDITOR.tools.htmlDecodeAttr(h)
  5960. }
  5961. this.onTagOpen(c, f, g);
  5962. !j && CKEDITOR.dtd.$cdata[c] && (j = [])
  5963. }
  5964. } else if(c = g[2]) this.onComment(c)
  5965. }
  5966. if(b.length > d) this.onText(b.substring(d, b.length))
  5967. }
  5968. }
  5969. }(), CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
  5970. $: function() {
  5971. this._ = {
  5972. output: []
  5973. }
  5974. },
  5975. proto: {
  5976. openTag: function(a) {
  5977. this._.output.push("<", a)
  5978. },
  5979. openTagClose: function(a, e) {
  5980. e ? this._.output.push(" />") : this._.output.push(">")
  5981. },
  5982. attribute: function(a, e) {
  5983. typeof e == "string" && (e = CKEDITOR.tools.htmlEncodeAttr(e));
  5984. this._.output.push(" ", a, '="', e, '"')
  5985. },
  5986. closeTag: function(a) {
  5987. this._.output.push("</", a, ">")
  5988. },
  5989. text: function(a) {
  5990. this._.output.push(a)
  5991. },
  5992. comment: function(a) {
  5993. this._.output.push("<\!--", a, "--\>")
  5994. },
  5995. write: function(a) {
  5996. this._.output.push(a)
  5997. },
  5998. reset: function() {
  5999. this._.output = [];
  6000. this._.indent = false
  6001. },
  6002. getHtml: function(a) {
  6003. var e =
  6004. this._.output.join("");
  6005. a && this.reset();
  6006. return e
  6007. }
  6008. }
  6009. }), "use strict",
  6010. function() {
  6011. CKEDITOR.htmlParser.node = function() {};
  6012. CKEDITOR.htmlParser.node.prototype = {
  6013. remove: function() {
  6014. var a = this.parent.children,
  6015. e = CKEDITOR.tools.indexOf(a, this),
  6016. b = this.previous,
  6017. g = this.next;
  6018. b && (b.next = g);
  6019. g && (g.previous = b);
  6020. a.splice(e, 1);
  6021. this.parent = null
  6022. },
  6023. replaceWith: function(a) {
  6024. var e = this.parent.children,
  6025. b = CKEDITOR.tools.indexOf(e, this),
  6026. g = a.previous = this.previous,
  6027. c = a.next = this.next;
  6028. g && (g.next = a);
  6029. c && (c.previous = a);
  6030. e[b] = a;
  6031. a.parent = this.parent;
  6032. this.parent = null
  6033. },
  6034. insertAfter: function(a) {
  6035. var e = a.parent.children,
  6036. b = CKEDITOR.tools.indexOf(e, a),
  6037. g = a.next;
  6038. e.splice(b + 1, 0, this);
  6039. this.next = a.next;
  6040. this.previous = a;
  6041. a.next = this;
  6042. g && (g.previous = this);
  6043. this.parent = a.parent
  6044. },
  6045. insertBefore: function(a) {
  6046. var e = a.parent.children,
  6047. b = CKEDITOR.tools.indexOf(e, a);
  6048. e.splice(b, 0, this);
  6049. this.next = a;
  6050. (this.previous = a.previous) && (a.previous.next = this);
  6051. a.previous = this;
  6052. this.parent = a.parent
  6053. },
  6054. getAscendant: function(a) {
  6055. var e = typeof a == "function" ? a : typeof a == "string" ? function(b) {
  6056. return b.name ==
  6057. a
  6058. } : function(b) {
  6059. return b.name in a
  6060. },
  6061. b = this.parent;
  6062. for(; b && b.type == CKEDITOR.NODE_ELEMENT;) {
  6063. if(e(b)) return b;
  6064. b = b.parent
  6065. }
  6066. return null
  6067. },
  6068. wrapWith: function(a) {
  6069. this.replaceWith(a);
  6070. a.add(this);
  6071. return a
  6072. },
  6073. getIndex: function() {
  6074. return CKEDITOR.tools.indexOf(this.parent.children, this)
  6075. },
  6076. getFilterContext: function(a) {
  6077. return a || {}
  6078. }
  6079. }
  6080. }(), "use strict", CKEDITOR.htmlParser.comment = function(a) {
  6081. this.value = a;
  6082. this._ = {
  6083. isBlockLike: false
  6084. }
  6085. }, CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6086. type: CKEDITOR.NODE_COMMENT,
  6087. filter: function(a, e) {
  6088. var b = this.value;
  6089. if(!(b = a.onComment(e, b, this))) {
  6090. this.remove();
  6091. return false
  6092. }
  6093. if(typeof b != "string") {
  6094. this.replaceWith(b);
  6095. return false
  6096. }
  6097. this.value = b;
  6098. return true
  6099. },
  6100. writeHtml: function(a, e) {
  6101. e && this.filter(e);
  6102. a.comment(this.value)
  6103. }
  6104. }), "use strict",
  6105. function() {
  6106. CKEDITOR.htmlParser.text = function(a) {
  6107. this.value = a;
  6108. this._ = {
  6109. isBlockLike: false
  6110. }
  6111. };
  6112. CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6113. type: CKEDITOR.NODE_TEXT,
  6114. filter: function(a,
  6115. e) {
  6116. if(!(this.value = a.onText(e, this.value, this))) {
  6117. this.remove();
  6118. return false
  6119. }
  6120. },
  6121. writeHtml: function(a, e) {
  6122. e && this.filter(e);
  6123. a.text(this.value)
  6124. }
  6125. })
  6126. }(), "use strict",
  6127. function() {
  6128. CKEDITOR.htmlParser.cdata = function(a) {
  6129. this.value = a
  6130. };
  6131. CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6132. type: CKEDITOR.NODE_TEXT,
  6133. filter: function() {},
  6134. writeHtml: function(a) {
  6135. a.write(this.value)
  6136. }
  6137. })
  6138. }(), "use strict", CKEDITOR.htmlParser.fragment = function() {
  6139. this.children = [];
  6140. this.parent = null;
  6141. this._ = {
  6142. isBlockLike: true,
  6143. hasInlineStarted: false
  6144. }
  6145. },
  6146. function() {
  6147. function a(a) {
  6148. return a.attributes["data-cke-survive"] ? false : a.name == "a" && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name]
  6149. }
  6150. var e = CKEDITOR.tools.extend({
  6151. table: 1,
  6152. ul: 1,
  6153. ol: 1,
  6154. dl: 1
  6155. }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl),
  6156. b = {
  6157. ol: 1,
  6158. ul: 1
  6159. },
  6160. g = CKEDITOR.tools.extend({}, {
  6161. html: 1
  6162. }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, {
  6163. style: 1,
  6164. script: 1
  6165. }),
  6166. c = {
  6167. ul: "li",
  6168. ol: "li",
  6169. dl: "dd",
  6170. table: "tbody",
  6171. tbody: "tr",
  6172. thead: "tr",
  6173. tfoot: "tr",
  6174. tr: "td"
  6175. };
  6176. CKEDITOR.htmlParser.fragment.fromHtml =
  6177. function(d, j, f) {
  6178. function h(a) {
  6179. var b;
  6180. if(p.length > 0)
  6181. for(var c = 0; c < p.length; c++) {
  6182. var d = p[c],
  6183. f = d.name,
  6184. g = CKEDITOR.dtd[f],
  6185. h = s.name && CKEDITOR.dtd[s.name];
  6186. if((!h || h[f]) && (!a || !g || g[a] || !CKEDITOR.dtd[a])) {
  6187. if(!b) {
  6188. i();
  6189. b = 1
  6190. }
  6191. d = d.clone();
  6192. d.parent = s;
  6193. s = d;
  6194. p.splice(c, 1);
  6195. c--
  6196. } else if(f == s.name) {
  6197. n(s, s.parent, 1);
  6198. c--
  6199. }
  6200. }
  6201. }
  6202. function i() {
  6203. for(; t.length;) n(t.shift(), s)
  6204. }
  6205. function k(a) {
  6206. if(a._.isBlockLike && a.name != "pre" && a.name != "textarea") {
  6207. var b = a.children.length,
  6208. c = a.children[b - 1],
  6209. d;
  6210. if(c && c.type == CKEDITOR.NODE_TEXT)(d = CKEDITOR.tools.rtrim(c.value)) ?
  6211. c.value = d : a.children.length = b - 1
  6212. }
  6213. }
  6214. function n(b, c, d) {
  6215. var c = c || s || l,
  6216. g = s;
  6217. if(b.previous === void 0) {
  6218. if(o(c, b)) {
  6219. s = c;
  6220. m.onTagOpen(f, {});
  6221. b.returnPoint = c = s
  6222. }
  6223. k(b);
  6224. (!a(b) || b.children.length) && c.add(b);
  6225. b.name == "pre" && (w = false);
  6226. b.name == "textarea" && (u = false)
  6227. }
  6228. if(b.returnPoint) {
  6229. s = b.returnPoint;
  6230. delete b.returnPoint
  6231. } else s = d ? c : g
  6232. }
  6233. function o(a, b) {
  6234. if((a == l || a.name == "body") && f && (!a.name || CKEDITOR.dtd[a.name][f])) {
  6235. var c, d;
  6236. return(c = b.attributes && (d = b.attributes["data-cke-real-element-type"]) ? d : b.name) && c in CKEDITOR.dtd.$inline &&
  6237. !(c in CKEDITOR.dtd.head) && !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
  6238. }
  6239. }
  6240. function q(a, b) {
  6241. return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || a == "dt" && b == "dd" || a == "dd" && b == "dt" : false
  6242. }
  6243. var m = new CKEDITOR.htmlParser,
  6244. l = j instanceof CKEDITOR.htmlParser.element ? j : typeof j == "string" ? new CKEDITOR.htmlParser.element(j) : new CKEDITOR.htmlParser.fragment,
  6245. p = [],
  6246. t = [],
  6247. s = l,
  6248. u = l.name == "textarea",
  6249. w = l.name == "pre";
  6250. m.onTagOpen = function(c, d, f, j) {
  6251. d = new CKEDITOR.htmlParser.element(c, d);
  6252. if(d.isUnknown && f) d.isEmpty =
  6253. true;
  6254. d.isOptionalClose = j;
  6255. if(a(d)) p.push(d);
  6256. else {
  6257. if(c == "pre") w = true;
  6258. else {
  6259. if(c == "br" && w) {
  6260. s.add(new CKEDITOR.htmlParser.text("\n"));
  6261. return
  6262. }
  6263. c == "textarea" && (u = true)
  6264. }
  6265. if(c == "br") t.push(d);
  6266. else {
  6267. for(;;) {
  6268. j = (f = s.name) ? CKEDITOR.dtd[f] || (s._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : g;
  6269. if(!d.isUnknown && !s.isUnknown && !j[c])
  6270. if(s.isOptionalClose) m.onTagClose(f);
  6271. else if(c in b && f in b) {
  6272. f = s.children;
  6273. (f = f[f.length - 1]) && f.name == "li" || n(f = new CKEDITOR.htmlParser.element("li"), s);
  6274. !d.returnPoint && (d.returnPoint = s);
  6275. s = f
  6276. } else if(c in CKEDITOR.dtd.$listItem && !q(c, f)) m.onTagOpen(c == "li" ? "ul" : "dl", {}, 0, 1);
  6277. else if(f in e && !q(c, f)) {
  6278. !d.returnPoint && (d.returnPoint = s);
  6279. s = s.parent
  6280. } else {
  6281. f in CKEDITOR.dtd.$inline && p.unshift(s);
  6282. if(s.parent) n(s, s.parent, 1);
  6283. else {
  6284. d.isOrphan = 1;
  6285. break
  6286. }
  6287. } else break
  6288. }
  6289. h(c);
  6290. i();
  6291. d.parent = s;
  6292. d.isEmpty ? n(d) : s = d
  6293. }
  6294. }
  6295. };
  6296. m.onTagClose = function(a) {
  6297. for(var b = p.length - 1; b >= 0; b--)
  6298. if(a == p[b].name) {
  6299. p.splice(b, 1);
  6300. return
  6301. }
  6302. for(var c = [], d = [], g = s; g != l && g.name != a;) {
  6303. g._.isBlockLike || d.unshift(g);
  6304. c.push(g);
  6305. g = g.returnPoint || g.parent
  6306. }
  6307. if(g !=
  6308. l) {
  6309. for(b = 0; b < c.length; b++) {
  6310. var h = c[b];
  6311. n(h, h.parent)
  6312. }
  6313. s = g;
  6314. g._.isBlockLike && i();
  6315. n(g, g.parent);
  6316. if(g == s) s = s.parent;
  6317. p = p.concat(d)
  6318. }
  6319. a == "body" && (f = false)
  6320. };
  6321. m.onText = function(a) {
  6322. if((!s._.hasInlineStarted || t.length) && !w && !u) {
  6323. a = CKEDITOR.tools.ltrim(a);
  6324. if(a.length === 0) return
  6325. }
  6326. var b = s.name,
  6327. d = b ? CKEDITOR.dtd[b] || (s._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : g;
  6328. if(!u && !d["#"] && b in e) {
  6329. m.onTagOpen(c[b] || "");
  6330. m.onText(a)
  6331. } else {
  6332. i();
  6333. h();
  6334. !w && !u && (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
  6335. a = new CKEDITOR.htmlParser.text(a);
  6336. if(o(s, a)) this.onTagOpen(f, {}, 0, 1);
  6337. s.add(a)
  6338. }
  6339. };
  6340. m.onCDATA = function(a) {
  6341. s.add(new CKEDITOR.htmlParser.cdata(a))
  6342. };
  6343. m.onComment = function(a) {
  6344. i();
  6345. h();
  6346. s.add(new CKEDITOR.htmlParser.comment(a))
  6347. };
  6348. m.parse(d);
  6349. for(i(); s != l;) n(s, s.parent, 1);
  6350. k(l);
  6351. return l
  6352. };
  6353. CKEDITOR.htmlParser.fragment.prototype = {
  6354. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  6355. add: function(a, b) {
  6356. isNaN(b) && (b = this.children.length);
  6357. var c = b > 0 ? this.children[b - 1] : null;
  6358. if(c) {
  6359. if(a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT) {
  6360. c.value = CKEDITOR.tools.rtrim(c.value);
  6361. if(c.value.length ===
  6362. 0) {
  6363. this.children.pop();
  6364. this.add(a);
  6365. return
  6366. }
  6367. }
  6368. c.next = a
  6369. }
  6370. a.previous = c;
  6371. a.parent = this;
  6372. this.children.splice(b, 0, a);
  6373. if(!this._.hasInlineStarted) this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike
  6374. },
  6375. filter: function(a, b) {
  6376. b = this.getFilterContext(b);
  6377. a.onRoot(b, this);
  6378. this.filterChildren(a, false, b)
  6379. },
  6380. filterChildren: function(a, b, c) {
  6381. if(this.childrenFilteredBy != a.id) {
  6382. c = this.getFilterContext(c);
  6383. if(b && !this.parent) a.onRoot(c, this);
  6384. this.childrenFilteredBy = a.id;
  6385. for(b = 0; b < this.children.length; b++) this.children[b].filter(a,
  6386. c) === false && b--
  6387. }
  6388. },
  6389. writeHtml: function(a, b) {
  6390. b && this.filter(b);
  6391. this.writeChildrenHtml(a)
  6392. },
  6393. writeChildrenHtml: function(a, b, c) {
  6394. var g = this.getFilterContext();
  6395. if(c && !this.parent && b) b.onRoot(g, this);
  6396. b && this.filterChildren(b, false, g);
  6397. b = 0;
  6398. c = this.children;
  6399. for(g = c.length; b < g; b++) c[b].writeHtml(a)
  6400. },
  6401. forEach: function(a, b, c) {
  6402. if(!c && (!b || this.type == b)) var g = a(this);
  6403. if(g !== false)
  6404. for(var c = this.children, e = 0; e < c.length; e++) {
  6405. g = c[e];
  6406. g.type == CKEDITOR.NODE_ELEMENT ? g.forEach(a, b) : (!b || g.type == b) && a(g)
  6407. }
  6408. },
  6409. getFilterContext: function(a) {
  6410. return a || {}
  6411. }
  6412. }
  6413. }(), "use strict",
  6414. function() {
  6415. function a() {
  6416. this.rules = []
  6417. }
  6418. function e(b, g, c, d) {
  6419. var e, f;
  6420. for(e in g) {
  6421. (f = b[e]) || (f = b[e] = new a);
  6422. f.add(g[e], c, d)
  6423. }
  6424. }
  6425. CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({
  6426. $: function(b) {
  6427. this.id = CKEDITOR.tools.getNextNumber();
  6428. this.elementNameRules = new a;
  6429. this.attributeNameRules = new a;
  6430. this.elementsRules = {};
  6431. this.attributesRules = {};
  6432. this.textRules = new a;
  6433. this.commentRules = new a;
  6434. this.rootRules = new a;
  6435. b && this.addRules(b, 10)
  6436. },
  6437. proto: {
  6438. addRules: function(a, g) {
  6439. var c;
  6440. if(typeof g == "number") c =
  6441. g;
  6442. else if(g && "priority" in g) c = g.priority;
  6443. typeof c != "number" && (c = 10);
  6444. typeof g != "object" && (g = {});
  6445. a.elementNames && this.elementNameRules.addMany(a.elementNames, c, g);
  6446. a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, c, g);
  6447. a.elements && e(this.elementsRules, a.elements, c, g);
  6448. a.attributes && e(this.attributesRules, a.attributes, c, g);
  6449. a.text && this.textRules.add(a.text, c, g);
  6450. a.comment && this.commentRules.add(a.comment, c, g);
  6451. a.root && this.rootRules.add(a.root, c, g)
  6452. },
  6453. applyTo: function(a) {
  6454. a.filter(this)
  6455. },
  6456. onElementName: function(a,
  6457. g) {
  6458. return this.elementNameRules.execOnName(a, g)
  6459. },
  6460. onAttributeName: function(a, g) {
  6461. return this.attributeNameRules.execOnName(a, g)
  6462. },
  6463. onText: function(a, g, c) {
  6464. return this.textRules.exec(a, g, c)
  6465. },
  6466. onComment: function(a, g, c) {
  6467. return this.commentRules.exec(a, g, c)
  6468. },
  6469. onRoot: function(a, g) {
  6470. return this.rootRules.exec(a, g)
  6471. },
  6472. onElement: function(a, g) {
  6473. for(var c = [this.elementsRules["^"], this.elementsRules[g.name], this.elementsRules.$], d, e = 0; e < 3; e++)
  6474. if(d = c[e]) {
  6475. d = d.exec(a, g, this);
  6476. if(d === false) return null;
  6477. if(d && d != g) return this.onNode(a,
  6478. d);
  6479. if(g.parent && !g.name) break
  6480. }
  6481. return g
  6482. },
  6483. onNode: function(a, g) {
  6484. var c = g.type;
  6485. return c == CKEDITOR.NODE_ELEMENT ? this.onElement(a, g) : c == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(a, g.value)) : c == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(a, g.value)) : null
  6486. },
  6487. onAttribute: function(a, g, c, d) {
  6488. return(c = this.attributesRules[c]) ? c.exec(a, d, g, this) : d
  6489. }
  6490. }
  6491. });
  6492. CKEDITOR.htmlParser.filterRulesGroup = a;
  6493. a.prototype = {
  6494. add: function(a, g, c) {
  6495. this.rules.splice(this.findIndex(g), 0, {
  6496. value: a,
  6497. priority: g,
  6498. options: c
  6499. })
  6500. },
  6501. addMany: function(a, g, c) {
  6502. for(var d = [this.findIndex(g), 0], e = 0, f = a.length; e < f; e++) d.push({
  6503. value: a[e],
  6504. priority: g,
  6505. options: c
  6506. });
  6507. this.rules.splice.apply(this.rules, d)
  6508. },
  6509. findIndex: function(a) {
  6510. for(var g = this.rules, c = g.length - 1; c >= 0 && a < g[c].priority;) c--;
  6511. return c + 1
  6512. },
  6513. exec: function(a, g) {
  6514. var c = g instanceof CKEDITOR.htmlParser.node || g instanceof CKEDITOR.htmlParser.fragment,
  6515. d = Array.prototype.slice.call(arguments, 1),
  6516. e = this.rules,
  6517. f = e.length,
  6518. h, i, k, n;
  6519. for(n = 0; n < f; n++) {
  6520. if(c) {
  6521. h = g.type;
  6522. i = g.name
  6523. }
  6524. k = e[n];
  6525. if(!(a.nonEditable &&
  6526. !k.options.applyToAll || a.nestedEditable && k.options.excludeNestedEditable)) {
  6527. k = k.value.apply(null, d);
  6528. if(k === false || c && k && (k.name != i || k.type != h)) return k;
  6529. k != null && (d[0] = g = k)
  6530. }
  6531. }
  6532. return g
  6533. },
  6534. execOnName: function(a, g) {
  6535. for(var c = 0, d = this.rules, e = d.length, f; g && c < e; c++) {
  6536. f = d[c];
  6537. !(a.nonEditable && !f.options.applyToAll || a.nestedEditable && f.options.excludeNestedEditable) && (g = g.replace(f.value[0], f.value[1]))
  6538. }
  6539. return g
  6540. }
  6541. }
  6542. }(),
  6543. function() {
  6544. function a(a, f) {
  6545. function h(a) {
  6546. return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") :
  6547. new CKEDITOR.htmlParser.element("br", {
  6548. "data-cke-bogus": 1
  6549. })
  6550. }
  6551. function e(a, c) {
  6552. return function(f) {
  6553. if(f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  6554. var e = [],
  6555. j = b(f),
  6556. p, k;
  6557. if(j)
  6558. for(i(j, 1) && e.push(j); j;) {
  6559. if(d(j) && (p = g(j)) && i(p))
  6560. if((k = g(p)) && !d(k)) e.push(p);
  6561. else {
  6562. h(t).insertAfter(p);
  6563. p.remove()
  6564. }
  6565. j = j.previous
  6566. }
  6567. for(j = 0; j < e.length; j++) e[j].remove();
  6568. if(e = !a || (typeof c == "function" ? c(f) : c) !== false)
  6569. if(!t && !CKEDITOR.env.needsBrFiller && f.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) e = false;
  6570. else if(!t && !CKEDITOR.env.needsBrFiller && (document.documentMode >
  6571. 7 || f.name in CKEDITOR.dtd.tr || f.name in CKEDITOR.dtd.$listItem)) e = false;
  6572. else {
  6573. e = b(f);
  6574. e = !e || f.name == "form" && e.name == "input"
  6575. }
  6576. e && f.add(h(a))
  6577. }
  6578. }
  6579. }
  6580. function i(a, b) {
  6581. if((!t || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && a.name == "br" && !a.attributes["data-cke-eol"]) return true;
  6582. var c;
  6583. if(a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(p))) {
  6584. if(c.index) {
  6585. (new CKEDITOR.htmlParser.text(a.value.substring(0, c.index))).insertBefore(a);
  6586. a.value = c[0]
  6587. }
  6588. if(!CKEDITOR.env.needsBrFiller && t && (!b || a.parent.name in x)) return true;
  6589. if(!t)
  6590. if((c = a.previous) && c.name == "br" || !c || d(c)) return true
  6591. }
  6592. return false
  6593. }
  6594. var k = {
  6595. elements: {}
  6596. },
  6597. t = f == "html",
  6598. x = CKEDITOR.tools.extend({}, w),
  6599. C;
  6600. for(C in x) "#" in s[C] || delete x[C];
  6601. for(C in x) k.elements[C] = e(t, a.config.fillEmptyBlocks);
  6602. k.root = e(t, false);
  6603. k.elements.br = function(a) {
  6604. return function(b) {
  6605. if(b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  6606. var f = b.attributes;
  6607. if("data-cke-bogus" in f || "data-cke-eol" in f) delete f["data-cke-bogus"];
  6608. else {
  6609. for(f = b.next; f && c(f);) f = f.next;
  6610. var e = g(b);
  6611. !f && d(b.parent) ? j(b.parent,
  6612. h(a)) : d(f) && (e && !d(e)) && h(a).insertBefore(f)
  6613. }
  6614. }
  6615. }
  6616. }(t);
  6617. return k
  6618. }
  6619. function e(a, b) {
  6620. return a != CKEDITOR.ENTER_BR && b !== false ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : false
  6621. }
  6622. function b(a) {
  6623. for(a = a.children[a.children.length - 1]; a && c(a);) a = a.previous;
  6624. return a
  6625. }
  6626. function g(a) {
  6627. for(a = a.previous; a && c(a);) a = a.previous;
  6628. return a
  6629. }
  6630. function c(a) {
  6631. return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"]
  6632. }
  6633. function d(a) {
  6634. return a && (a.type == CKEDITOR.NODE_ELEMENT && a.name in
  6635. w || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  6636. }
  6637. function j(a, b) {
  6638. var c = a.children[a.children.length - 1];
  6639. a.children.push(b);
  6640. b.parent = a;
  6641. if(c) {
  6642. c.next = b;
  6643. b.previous = c
  6644. }
  6645. }
  6646. function f(a) {
  6647. a = a.attributes;
  6648. a.contenteditable != "false" && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
  6649. a.contenteditable = "false"
  6650. }
  6651. function h(a) {
  6652. a = a.attributes;
  6653. switch(a["data-cke-editable"]) {
  6654. case "true":
  6655. a.contenteditable = "true";
  6656. break;
  6657. case "1":
  6658. delete a.contenteditable
  6659. }
  6660. }
  6661. function i(a) {
  6662. return a.replace(z, function(a, b, c) {
  6663. return "<" + b + c.replace(B,
  6664. function(a, b) {
  6665. return A.test(b) && c.indexOf("data-cke-saved-" + b) == -1 ? " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a : a
  6666. }) + ">"
  6667. })
  6668. }
  6669. function k(a, b) {
  6670. return a.replace(b, function(a, b, c) {
  6671. a.indexOf("<textarea") === 0 && (a = b + q(c).replace(/</g, "&lt;").replace(/>/g, "&gt;") + "</textarea>");
  6672. return "<cke:encoded>" + encodeURIComponent(a) + "</cke:encoded>"
  6673. })
  6674. }
  6675. function n(a) {
  6676. return a.replace(J, function(a, b) {
  6677. return decodeURIComponent(b)
  6678. })
  6679. }
  6680. function o(a) {
  6681. return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g, function(a) {
  6682. return "<\!--" +
  6683. t + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\>"
  6684. })
  6685. }
  6686. function q(a) {
  6687. return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g, function(a, b) {
  6688. return decodeURIComponent(b)
  6689. })
  6690. }
  6691. function m(a, b) {
  6692. var c = b._.dataStore;
  6693. return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g, function(a, b) {
  6694. return decodeURIComponent(b)
  6695. }).replace(/\{cke_protected_(\d+)\}/g, function(a, b) {
  6696. return c && c[b] || ""
  6697. })
  6698. }
  6699. function l(a, b) {
  6700. for(var c = [], d = b.config.protectedSource, f = b._.dataStore || (b._.dataStore = {
  6701. id: 1
  6702. }), g = /<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,
  6703. d = [/<script[\s\S]*?<\/script>/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(d), a = a.replace(/<\!--[\s\S]*?--\>/g, function(a) {
  6704. return "<\!--{cke_tempcomment}" + (c.push(a) - 1) + "--\>"
  6705. }), h = 0; h < d.length; h++) a = a.replace(d[h], function(a) {
  6706. a = a.replace(g, function(a, b, d) {
  6707. return c[d]
  6708. });
  6709. return /cke_temp(comment)?/.test(a) ? a : "<\!--{cke_temp}" + (c.push(a) - 1) + "--\>"
  6710. });
  6711. a = a.replace(g, function(a, b, d) {
  6712. return "<\!--" + t + (b ? "{C}" : "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "--\>"
  6713. });
  6714. a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=>]+))+\s*>/g,
  6715. function(a) {
  6716. return a.replace(/<\!--\{cke_protected\}([^>]*)--\>/g, function(a, b) {
  6717. f[f.id] = decodeURIComponent(b);
  6718. return "{cke_protected_" + f.id++ + "}"
  6719. })
  6720. });
  6721. return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function(a, c, d, f) {
  6722. return "<" + c + d + ">" + m(q(f), b) + "</" + c + ">"
  6723. })
  6724. }
  6725. CKEDITOR.htmlDataProcessor = function(b) {
  6726. var c, d, f = this;
  6727. this.editor = b;
  6728. this.dataFilter = c = new CKEDITOR.htmlParser.filter;
  6729. this.htmlFilter = d = new CKEDITOR.htmlParser.filter;
  6730. this.writer = new CKEDITOR.htmlParser.basicWriter;
  6731. c.addRules(x);
  6732. c.addRules(v, {
  6733. applyToAll: true
  6734. });
  6735. c.addRules(a(b, "data"), {
  6736. applyToAll: true
  6737. });
  6738. d.addRules(r);
  6739. d.addRules(y, {
  6740. applyToAll: true
  6741. });
  6742. d.addRules(a(b, "html"), {
  6743. applyToAll: true
  6744. });
  6745. b.on("toHtml", function(a) {
  6746. var a = a.data,
  6747. c = a.dataValue,
  6748. d, c = l(c, b),
  6749. c = k(c, D),
  6750. c = i(c),
  6751. c = k(c, G),
  6752. c = c.replace(C, "$1cke:$2"),
  6753. c = c.replace(E, "<cke:$1$2></cke:$1>"),
  6754. c = c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"),
  6755. c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + CKEDITOR.rnd + "-$2");
  6756. d = a.context || b.editable().getName();
  6757. var f;
  6758. if(CKEDITOR.env.ie &&
  6759. CKEDITOR.env.version < 9 && d == "pre") {
  6760. d = "div";
  6761. c = "<pre>" + c + "</pre>";
  6762. f = 1
  6763. }
  6764. d = b.document.createElement(d);
  6765. d.setHtml("a" + c);
  6766. c = d.getHtml().substr(1);
  6767. c = c.replace(RegExp("data-cke-" + CKEDITOR.rnd + "-", "ig"), "");
  6768. f && (c = c.replace(/^<pre>|<\/pre>$/gi, ""));
  6769. c = c.replace(F, "$1$2");
  6770. c = n(c);
  6771. c = q(c);
  6772. d = a.fixForBody === false ? false : e(a.enterMode, b.config.autoParagraph);
  6773. c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, d);
  6774. if(d) {
  6775. f = c;
  6776. if(!f.children.length && CKEDITOR.dtd[f.name][d]) {
  6777. d = new CKEDITOR.htmlParser.element(d);
  6778. f.add(d)
  6779. }
  6780. }
  6781. a.dataValue =
  6782. c
  6783. }, null, null, 5);
  6784. b.on("toHtml", function(a) {
  6785. a.data.filter.applyTo(a.data.dataValue, true, a.data.dontFilter, a.data.enterMode) && b.fire("dataFiltered")
  6786. }, null, null, 6);
  6787. b.on("toHtml", function(a) {
  6788. a.data.dataValue.filterChildren(f.dataFilter, true)
  6789. }, null, null, 10);
  6790. b.on("toHtml", function(a) {
  6791. var a = a.data,
  6792. b = a.dataValue,
  6793. c = new CKEDITOR.htmlParser.basicWriter;
  6794. b.writeChildrenHtml(c);
  6795. b = c.getHtml(true);
  6796. a.dataValue = o(b)
  6797. }, null, null, 15);
  6798. b.on("toDataFormat", function(a) {
  6799. var c = a.data.dataValue;
  6800. a.data.enterMode != CKEDITOR.ENTER_BR &&
  6801. (c = c.replace(/^<br *\/?>/i, ""));
  6802. a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, e(a.data.enterMode, b.config.autoParagraph))
  6803. }, null, null, 5);
  6804. b.on("toDataFormat", function(a) {
  6805. a.data.dataValue.filterChildren(f.htmlFilter, true)
  6806. }, null, null, 10);
  6807. b.on("toDataFormat", function(a) {
  6808. a.data.filter.applyTo(a.data.dataValue, false, true)
  6809. }, null, null, 11);
  6810. b.on("toDataFormat", function(a) {
  6811. var c = a.data.dataValue,
  6812. d = f.writer;
  6813. d.reset();
  6814. c.writeChildrenHtml(d);
  6815. c = d.getHtml(true);
  6816. c = q(c);
  6817. c = m(c, b);
  6818. a.data.dataValue =
  6819. c
  6820. }, null, null, 15)
  6821. };
  6822. CKEDITOR.htmlDataProcessor.prototype = {
  6823. toHtml: function(a, b, c, d) {
  6824. var f = this.editor,
  6825. g, h, e;
  6826. if(b && typeof b == "object") {
  6827. g = b.context;
  6828. c = b.fixForBody;
  6829. d = b.dontFilter;
  6830. h = b.filter;
  6831. e = b.enterMode
  6832. } else g = b;
  6833. !g && g !== null && (g = f.editable().getName());
  6834. return f.fire("toHtml", {
  6835. dataValue: a,
  6836. context: g,
  6837. fixForBody: c,
  6838. dontFilter: d,
  6839. filter: h || f.filter,
  6840. enterMode: e || f.enterMode
  6841. }).dataValue
  6842. },
  6843. toDataFormat: function(a, b) {
  6844. var c, d, f;
  6845. if(b) {
  6846. c = b.context;
  6847. d = b.filter;
  6848. f = b.enterMode
  6849. }!c && c !== null && (c = this.editor.editable().getName());
  6850. return this.editor.fire("toDataFormat", {
  6851. dataValue: a,
  6852. filter: d || this.editor.filter,
  6853. context: c,
  6854. enterMode: f || this.editor.enterMode
  6855. }).dataValue
  6856. }
  6857. };
  6858. var p = /(?:&nbsp;|\xa0)$/,
  6859. t = "{cke_protected}",
  6860. s = CKEDITOR.dtd,
  6861. u = ["caption", "colgroup", "col", "thead", "tfoot", "tbody"],
  6862. w = CKEDITOR.tools.extend({}, s.$blockLimit, s.$block),
  6863. x = {
  6864. elements: {
  6865. input: f,
  6866. textarea: f
  6867. }
  6868. },
  6869. v = {
  6870. attributeNames: [
  6871. [/^on/, "data-cke-pa-on"],
  6872. [/^data-cke-expando$/, ""]
  6873. ]
  6874. },
  6875. r = {
  6876. elements: {
  6877. embed: function(a) {
  6878. var b = a.parent;
  6879. if(b && b.name == "object") {
  6880. var c = b.attributes.width,
  6881. b = b.attributes.height;
  6882. if(c) a.attributes.width = c;
  6883. if(b) a.attributes.height = b
  6884. }
  6885. },
  6886. a: function(a) {
  6887. if(!a.children.length && !a.attributes.name && !a.attributes["data-cke-saved-name"]) return false
  6888. }
  6889. }
  6890. },
  6891. y = {
  6892. elementNames: [
  6893. [/^cke:/, ""],
  6894. [/^\?xml:namespace$/, ""]
  6895. ],
  6896. attributeNames: [
  6897. [/^data-cke-(saved|pa)-/, ""],
  6898. [/^data-cke-.*/, ""],
  6899. ["hidefocus", ""]
  6900. ],
  6901. elements: {
  6902. $: function(a) {
  6903. var b = a.attributes;
  6904. if(b) {
  6905. if(b["data-cke-temp"]) return false;
  6906. for(var c = ["name", "href", "src"], d, f = 0; f < c.length; f++) {
  6907. d = "data-cke-saved-" + c[f];
  6908. d in b && delete b[c[f]]
  6909. }
  6910. }
  6911. return a
  6912. },
  6913. table: function(a) {
  6914. a.children.slice(0).sort(function(a, b) {
  6915. var c, d;
  6916. if(a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type) {
  6917. c = CKEDITOR.tools.indexOf(u, a.name);
  6918. d = CKEDITOR.tools.indexOf(u, b.name)
  6919. }
  6920. if(!(c > -1 && d > -1 && c != d)) {
  6921. c = a.parent ? a.getIndex() : -1;
  6922. d = b.parent ? b.getIndex() : -1
  6923. }
  6924. return c > d ? 1 : -1
  6925. })
  6926. },
  6927. param: function(a) {
  6928. a.children = [];
  6929. a.isEmpty = true;
  6930. return a
  6931. },
  6932. span: function(a) {
  6933. a.attributes["class"] == "Apple-style-span" && delete a.name
  6934. },
  6935. html: function(a) {
  6936. delete a.attributes.contenteditable;
  6937. delete a.attributes["class"]
  6938. },
  6939. body: function(a) {
  6940. delete a.attributes.spellcheck;
  6941. delete a.attributes.contenteditable
  6942. },
  6943. style: function(a) {
  6944. var b = a.children[0];
  6945. if(b && b.value) b.value = CKEDITOR.tools.trim(b.value);
  6946. if(!a.attributes.type) a.attributes.type = "text/css"
  6947. },
  6948. title: function(a) {
  6949. var b = a.children[0];
  6950. !b && j(a, b = new CKEDITOR.htmlParser.text);
  6951. b.value = a.attributes["data-cke-title"] || ""
  6952. },
  6953. input: h,
  6954. textarea: h
  6955. },
  6956. attributes: {
  6957. "class": function(a) {
  6958. return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || false
  6959. }
  6960. }
  6961. };
  6962. if(CKEDITOR.env.ie) y.attributes.style = function(a) {
  6963. return a.replace(/(^|;)([^\:]+)/g,
  6964. function(a) {
  6965. return a.toLowerCase()
  6966. })
  6967. };
  6968. var z = /<(a|area|img|input|source)\b([^>]*)>/gi,
  6969. B = /([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
  6970. A = /^(href|src|name)$/i,
  6971. G = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
  6972. D = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
  6973. J = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
  6974. C = /(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,
  6975. F = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,
  6976. E = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi
  6977. }(),
  6978. "use strict", CKEDITOR.htmlParser.element = function(a, e) {
  6979. this.name = a;
  6980. this.attributes = e || {};
  6981. this.children = [];
  6982. var b = a || "",
  6983. g = b.match(/^cke:(.*)/);
  6984. g && (b = g[1]);
  6985. b = !(!CKEDITOR.dtd.$nonBodyContent[b] && !CKEDITOR.dtd.$block[b] && !CKEDITOR.dtd.$listItem[b] && !CKEDITOR.dtd.$tableContent[b] && !(CKEDITOR.dtd.$nonEditable[b] || b == "br"));
  6986. this.isEmpty = !!CKEDITOR.dtd.$empty[a];
  6987. this.isUnknown = !CKEDITOR.dtd[a];
  6988. this._ = {
  6989. isBlockLike: b,
  6990. hasInlineStarted: this.isEmpty || !b
  6991. }
  6992. }, CKEDITOR.htmlParser.cssStyle = function(a) {
  6993. var e = {};
  6994. ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || "").replace(/&quot;/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, g, c) {
  6995. g == "font-family" && (c = c.replace(/["']/g, ""));
  6996. e[g.toLowerCase()] = c
  6997. });
  6998. return {
  6999. rules: e,
  7000. populate: function(a) {
  7001. var g = this.toString();
  7002. if(g) a instanceof CKEDITOR.dom.element ? a.setAttribute("style", g) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = g : a.style = g
  7003. },
  7004. toString: function() {
  7005. var a = [],
  7006. g;
  7007. for(g in e) e[g] && a.push(g, ":", e[g], ";");
  7008. return a.join("")
  7009. }
  7010. }
  7011. },
  7012. function() {
  7013. function a(a) {
  7014. return function(b) {
  7015. return b.type ==
  7016. CKEDITOR.NODE_ELEMENT && (typeof a == "string" ? b.name == a : b.name in a)
  7017. }
  7018. }
  7019. var e = function(a, b) {
  7020. a = a[0];
  7021. b = b[0];
  7022. return a < b ? -1 : a > b ? 1 : 0
  7023. },
  7024. b = CKEDITOR.htmlParser.fragment.prototype;
  7025. CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  7026. type: CKEDITOR.NODE_ELEMENT,
  7027. add: b.add,
  7028. clone: function() {
  7029. return new CKEDITOR.htmlParser.element(this.name, this.attributes)
  7030. },
  7031. filter: function(a, b) {
  7032. var d = this,
  7033. e, f, b = d.getFilterContext(b);
  7034. if(b.off) return true;
  7035. if(!d.parent) a.onRoot(b, d);
  7036. for(;;) {
  7037. e = d.name;
  7038. if(!(f = a.onElementName(b, e))) {
  7039. this.remove();
  7040. return false
  7041. }
  7042. d.name = f;
  7043. if(!(d = a.onElement(b, d))) {
  7044. this.remove();
  7045. return false
  7046. }
  7047. if(d !== this) {
  7048. this.replaceWith(d);
  7049. return false
  7050. }
  7051. if(d.name == e) break;
  7052. if(d.type != CKEDITOR.NODE_ELEMENT) {
  7053. this.replaceWith(d);
  7054. return false
  7055. }
  7056. if(!d.name) {
  7057. this.replaceWithChildren();
  7058. return false
  7059. }
  7060. }
  7061. e = d.attributes;
  7062. var h, i;
  7063. for(h in e) {
  7064. i = h;
  7065. for(f = e[h];;)
  7066. if(i = a.onAttributeName(b, h))
  7067. if(i != h) {
  7068. delete e[h];
  7069. h = i
  7070. } else break;
  7071. else {
  7072. delete e[h];
  7073. break
  7074. }
  7075. i && ((f = a.onAttribute(b, d, i, f)) === false ? delete e[i] : e[i] = f)
  7076. }
  7077. d.isEmpty ||
  7078. this.filterChildren(a, false, b);
  7079. return true
  7080. },
  7081. filterChildren: b.filterChildren,
  7082. writeHtml: function(a, b) {
  7083. b && this.filter(b);
  7084. var d = this.name,
  7085. j = [],
  7086. f = this.attributes,
  7087. h, i;
  7088. a.openTag(d, f);
  7089. for(h in f) j.push([h, f[h]]);
  7090. a.sortAttributes && j.sort(e);
  7091. h = 0;
  7092. for(i = j.length; h < i; h++) {
  7093. f = j[h];
  7094. a.attribute(f[0], f[1])
  7095. }
  7096. a.openTagClose(d, this.isEmpty);
  7097. this.writeChildrenHtml(a);
  7098. this.isEmpty || a.closeTag(d)
  7099. },
  7100. writeChildrenHtml: b.writeChildrenHtml,
  7101. replaceWithChildren: function() {
  7102. for(var a = this.children, b = a.length; b;) a[--b].insertAfter(this);
  7103. this.remove()
  7104. },
  7105. forEach: b.forEach,
  7106. getFirst: function(b) {
  7107. if(!b) return this.children.length ? this.children[0] : null;
  7108. typeof b != "function" && (b = a(b));
  7109. for(var c = 0, d = this.children.length; c < d; ++c)
  7110. if(b(this.children[c])) return this.children[c];
  7111. return null
  7112. },
  7113. getHtml: function() {
  7114. var a = new CKEDITOR.htmlParser.basicWriter;
  7115. this.writeChildrenHtml(a);
  7116. return a.getHtml()
  7117. },
  7118. setHtml: function(a) {
  7119. for(var a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children, b = 0, d = a.length; b < d; ++b) a[b].parent = this
  7120. },
  7121. getOuterHtml: function() {
  7122. var a =
  7123. new CKEDITOR.htmlParser.basicWriter;
  7124. this.writeHtml(a);
  7125. return a.getHtml()
  7126. },
  7127. split: function(a) {
  7128. for(var b = this.children.splice(a, this.children.length - a), d = this.clone(), e = 0; e < b.length; ++e) b[e].parent = d;
  7129. d.children = b;
  7130. if(b[0]) b[0].previous = null;
  7131. if(a > 0) this.children[a - 1].next = null;
  7132. this.parent.add(d, this.getIndex() + 1);
  7133. return d
  7134. },
  7135. addClass: function(a) {
  7136. if(!this.hasClass(a)) {
  7137. var b = this.attributes["class"] || "";
  7138. this.attributes["class"] = b + (b ? " " : "") + a
  7139. }
  7140. },
  7141. removeClass: function(a) {
  7142. var b = this.attributes["class"];
  7143. if(b)(b =
  7144. CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)" + a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"]
  7145. },
  7146. hasClass: function(a) {
  7147. var b = this.attributes["class"];
  7148. return !b ? false : RegExp("(?:^|\\s)" + a + "(?=\\s|$)").test(b)
  7149. },
  7150. getFilterContext: function(a) {
  7151. var b = [];
  7152. a || (a = {
  7153. off: false,
  7154. nonEditable: false,
  7155. nestedEditable: false
  7156. });
  7157. !a.off && this.attributes["data-cke-processor"] == "off" && b.push("off", true);
  7158. !a.nonEditable && this.attributes.contenteditable == "false" ? b.push("nonEditable", true) : a.nonEditable &&
  7159. (!a.nestedEditable && this.attributes.contenteditable == "true") && b.push("nestedEditable", true);
  7160. if(b.length)
  7161. for(var a = CKEDITOR.tools.copy(a), d = 0; d < b.length; d = d + 2) a[b[d]] = b[d + 1];
  7162. return a
  7163. }
  7164. }, true)
  7165. }(),
  7166. function() {
  7167. var a = {},
  7168. e = /{([^}]+)}/g,
  7169. b = /([\\'])/g,
  7170. g = /\n/g,
  7171. c = /\r/g;
  7172. CKEDITOR.template = function(d) {
  7173. if(a[d]) this.output = a[d];
  7174. else {
  7175. var j = d.replace(b, "\\$1").replace(g, "\\n").replace(c, "\\r").replace(e, function(a, b) {
  7176. return "',data['" + b + "']==undefined?'{" + b + "}':data['" + b + "'],'"
  7177. });
  7178. this.output = a[d] = Function("data", "buffer",
  7179. "return buffer?buffer.push('" + j + "'):['" + j + "'].join('');")
  7180. }
  7181. }
  7182. }(), delete CKEDITOR.loadFullCore, CKEDITOR.instances = {}, CKEDITOR.document = new CKEDITOR.dom.document(document), CKEDITOR.add = function(a) {
  7183. CKEDITOR.instances[a.name] = a;
  7184. a.on("focus", function() {
  7185. if(CKEDITOR.currentInstance != a) {
  7186. CKEDITOR.currentInstance = a;
  7187. CKEDITOR.fire("currentInstance")
  7188. }
  7189. });
  7190. a.on("blur", function() {
  7191. if(CKEDITOR.currentInstance == a) {
  7192. CKEDITOR.currentInstance = null;
  7193. CKEDITOR.fire("currentInstance")
  7194. }
  7195. });
  7196. CKEDITOR.fire("instance", null, a)
  7197. }, CKEDITOR.remove =
  7198. function(a) {
  7199. delete CKEDITOR.instances[a.name]
  7200. },
  7201. function() {
  7202. var a = {};
  7203. CKEDITOR.addTemplate = function(e, b) {
  7204. var g = a[e];
  7205. if(g) return g;
  7206. g = {
  7207. name: e,
  7208. source: b
  7209. };
  7210. CKEDITOR.fire("template", g);
  7211. return a[e] = new CKEDITOR.template(g.source)
  7212. };
  7213. CKEDITOR.getTemplate = function(e) {
  7214. return a[e]
  7215. }
  7216. }(),
  7217. function() {
  7218. var a = [];
  7219. CKEDITOR.addCss = function(e) {
  7220. a.push(e)
  7221. };
  7222. CKEDITOR.getCss = function() {
  7223. return a.join("\n")
  7224. }
  7225. }(), CKEDITOR.on("instanceDestroyed", function() {
  7226. CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset")
  7227. }), CKEDITOR.TRISTATE_ON =
  7228. 1, CKEDITOR.TRISTATE_OFF = 2, CKEDITOR.TRISTATE_DISABLED = 0,
  7229. function() {
  7230. CKEDITOR.inline = function(a, e) {
  7231. if(!CKEDITOR.env.isCompatible) return null;
  7232. a = CKEDITOR.dom.element.get(a);
  7233. if(a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  7234. var b = new CKEDITOR.editor(e, a, CKEDITOR.ELEMENT_MODE_INLINE),
  7235. g = a.is("textarea") ? a : null;
  7236. if(g) {
  7237. b.setData(g.getValue(), null, true);
  7238. a = CKEDITOR.dom.element.createFromHtml('<div contenteditable="' + !!b.readOnly + '" class="cke_textarea_inline">' +
  7239. g.getValue() + "</div>", CKEDITOR.document);
  7240. a.insertAfter(g);
  7241. g.hide();
  7242. g.$.form && b._attachToForm()
  7243. } else b.setData(a.getHtml(), null, true);
  7244. b.on("loaded", function() {
  7245. b.fire("uiReady");
  7246. b.editable(a);
  7247. b.container = a;
  7248. b.setData(b.getData(1));
  7249. b.resetDirty();
  7250. b.fire("contentDom");
  7251. b.mode = "wysiwyg";
  7252. b.fire("mode");
  7253. b.status = "ready";
  7254. b.fireOnce("instanceReady");
  7255. CKEDITOR.fire("instanceReady", null, b)
  7256. }, null, null, 1E4);
  7257. b.on("destroy", function() {
  7258. if(g) {
  7259. b.container.clearCustomData();
  7260. b.container.remove();
  7261. g.show()
  7262. }
  7263. b.element.clearCustomData();
  7264. delete b.element
  7265. });
  7266. return b
  7267. };
  7268. CKEDITOR.inlineAll = function() {
  7269. var a, e, b;
  7270. for(b in CKEDITOR.dtd.$editable)
  7271. for(var g = CKEDITOR.document.getElementsByTag(b), c = 0, d = g.count(); c < d; c++) {
  7272. a = g.getItem(c);
  7273. if(a.getAttribute("contenteditable") == "true") {
  7274. e = {
  7275. element: a,
  7276. config: {}
  7277. };
  7278. CKEDITOR.fire("inline", e) !== false && CKEDITOR.inline(a, e.config)
  7279. }
  7280. }
  7281. };
  7282. CKEDITOR.domReady(function() {
  7283. !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll()
  7284. })
  7285. }(), CKEDITOR.replaceClass = "ckeditor",
  7286. function() {
  7287. function a(a, c, d, j) {
  7288. if(!CKEDITOR.env.isCompatible) return null;
  7289. a = CKEDITOR.dom.element.get(a);
  7290. if(a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  7291. var f = new CKEDITOR.editor(c, a, j);
  7292. if(j == CKEDITOR.ELEMENT_MODE_REPLACE) {
  7293. a.setStyle("visibility", "hidden");
  7294. f._.required = a.hasAttribute("required");
  7295. a.removeAttribute("required")
  7296. }
  7297. d && f.setData(d, null, true);
  7298. f.on("loaded", function() {
  7299. b(f);
  7300. j == CKEDITOR.ELEMENT_MODE_REPLACE && (f.config.autoUpdateElement && a.$.form) && f._attachToForm();
  7301. f.setMode(f.config.startupMode, function() {
  7302. f.resetDirty();
  7303. f.status = "ready";
  7304. f.fireOnce("instanceReady");
  7305. CKEDITOR.fire("instanceReady", null, f)
  7306. })
  7307. });
  7308. f.on("destroy", e);
  7309. return f
  7310. }
  7311. function e() {
  7312. var a = this.container,
  7313. b = this.element;
  7314. if(a) {
  7315. a.clearCustomData();
  7316. a.remove()
  7317. }
  7318. if(b) {
  7319. b.clearCustomData();
  7320. if(this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE) {
  7321. b.show();
  7322. this._.required && b.setAttribute("required", "required")
  7323. }
  7324. delete this.element
  7325. }
  7326. }
  7327. function b(a) {
  7328. var b = a.name,
  7329. d = a.element,
  7330. e = a.elementMode,
  7331. f = a.fire("uiSpace", {
  7332. space: "top",
  7333. html: ""
  7334. }).html,
  7335. h = a.fire("uiSpace", {
  7336. space: "bottom",
  7337. html: ""
  7338. }).html,
  7339. i = new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir="{langDir}" lang="{langCode}" role="application"' + (a.title ? ' aria-labelledby="cke_{name}_arialbl"' : "") + ">" + (a.title ? '<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>' : "") + '<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'),
  7340. b = CKEDITOR.dom.element.createFromHtml(i.output({
  7341. id: a.id,
  7342. name: b,
  7343. langDir: a.lang.dir,
  7344. langCode: a.langCode,
  7345. voiceLabel: a.title,
  7346. topHtml: f ? '<span id="' + a.ui.spaceId("top") + '" class="cke_top cke_reset_all" role="presentation" style="height:auto">' + f + "</span>" : "",
  7347. contentId: a.ui.spaceId("contents"),
  7348. bottomHtml: h ? '<span id="' + a.ui.spaceId("bottom") + '" class="cke_bottom cke_reset_all" role="presentation">' + h + "</span>" : "",
  7349. outerEl: CKEDITOR.env.ie ? "span" : "div"
  7350. }));
  7351. if(e == CKEDITOR.ELEMENT_MODE_REPLACE) {
  7352. d.hide();
  7353. b.insertAfter(d)
  7354. } else d.append(b);
  7355. a.container = b;
  7356. f && a.ui.space("top").unselectable();
  7357. h && a.ui.space("bottom").unselectable();
  7358. d = a.config.width;
  7359. e = a.config.height;
  7360. d && b.setStyle("width", CKEDITOR.tools.cssLength(d));
  7361. e && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(e));
  7362. b.disableContextMenu();
  7363. CKEDITOR.env.webkit && b.on("focus", function() {
  7364. a.focus()
  7365. });
  7366. a.fireOnce("uiReady")
  7367. }
  7368. CKEDITOR.replace = function(b, c) {
  7369. return a(b, c, null, CKEDITOR.ELEMENT_MODE_REPLACE)
  7370. };
  7371. CKEDITOR.appendTo = function(b, c, d) {
  7372. return a(b, c, d, CKEDITOR.ELEMENT_MODE_APPENDTO)
  7373. };
  7374. CKEDITOR.replaceAll = function() {
  7375. for(var a = document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) {
  7376. var d = null,
  7377. e = a[b];
  7378. if(e.name || e.id) {
  7379. if(typeof arguments[0] == "string") {
  7380. if(!RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)").test(e.className)) continue
  7381. } else if(typeof arguments[0] == "function") {
  7382. d = {};
  7383. if(arguments[0](e, d) === false) continue
  7384. }
  7385. this.replace(e, d)
  7386. }
  7387. }
  7388. };
  7389. CKEDITOR.editor.prototype.addMode = function(a, b) {
  7390. (this._.modes || (this._.modes = {}))[a] = b
  7391. };
  7392. CKEDITOR.editor.prototype.setMode = function(a, b) {
  7393. var d = this,
  7394. e =
  7395. this._.modes;
  7396. if(!(a == d.mode || !e || !e[a])) {
  7397. d.fire("beforeSetMode", a);
  7398. if(d.mode) {
  7399. var f = d.checkDirty(),
  7400. e = d._.previousModeData,
  7401. h, i = 0;
  7402. d.fire("beforeModeUnload");
  7403. d.editable(0);
  7404. d._.previousMode = d.mode;
  7405. d._.previousModeData = h = d.getData(1);
  7406. if(d.mode == "source" && e == h) {
  7407. d.fire("lockSnapshot", {
  7408. forceUpdate: true
  7409. });
  7410. i = 1
  7411. }
  7412. d.ui.space("contents").setHtml("");
  7413. d.mode = ""
  7414. } else d._.previousModeData = d.getData(1);
  7415. this._.modes[a](function() {
  7416. d.mode = a;
  7417. f !== void 0 && !f && d.resetDirty();
  7418. i ? d.fire("unlockSnapshot") : a == "wysiwyg" && d.fire("saveSnapshot");
  7419. setTimeout(function() {
  7420. d.fire("mode");
  7421. b && b.call(d)
  7422. }, 0)
  7423. })
  7424. }
  7425. };
  7426. CKEDITOR.editor.prototype.resize = function(a, b, d, e) {
  7427. var f = this.container,
  7428. h = this.ui.space("contents"),
  7429. i = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement,
  7430. e = e ? this.container.getFirst(function(a) {
  7431. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  7432. }) : f;
  7433. e.setSize("width", a, true);
  7434. i && (i.style.width = "1%");
  7435. h.setStyle("height", Math.max(b - (d ? 0 : (e.$.offsetHeight || 0) - (h.$.clientHeight || 0)), 0) + "px");
  7436. i && (i.style.width =
  7437. "100%");
  7438. this.fire("resize")
  7439. };
  7440. CKEDITOR.editor.prototype.getResizable = function(a) {
  7441. return a ? this.ui.space("contents") : this.container
  7442. };
  7443. CKEDITOR.domReady(function() {
  7444. CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass)
  7445. })
  7446. }(), CKEDITOR.config.startupMode = "wysiwyg",
  7447. function() {
  7448. function a(a) {
  7449. var b = a.editor,
  7450. c = a.data.path,
  7451. d = c.blockLimit,
  7452. f = a.data.selection,
  7453. h = f.getRanges()[0],
  7454. i;
  7455. if(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller)
  7456. if(f = e(f, c)) {
  7457. f.appendBogus();
  7458. i = CKEDITOR.env.ie
  7459. }
  7460. if(j(b, c.block,
  7461. d) && h.collapsed && !h.getCommonAncestor().isReadOnly()) {
  7462. c = h.clone();
  7463. c.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  7464. d = new CKEDITOR.dom.walker(c);
  7465. d.guard = function(a) {
  7466. return !g(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly()
  7467. };
  7468. if(!d.checkForward() || c.checkStartOfBlock() && c.checkEndOfBlock()) {
  7469. b = h.fixBlock(true, b.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p");
  7470. if(!CKEDITOR.env.needsBrFiller)(b = b.getFirst(g)) && (b.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/)) && b.remove();
  7471. i = 1;
  7472. a.cancel()
  7473. }
  7474. }
  7475. i && h.select()
  7476. }
  7477. function e(a, b) {
  7478. if(a.isFake) return 0;
  7479. var c = b.block || b.blockLimit,
  7480. d = c && c.getLast(g);
  7481. if(c && c.isBlockBoundary() && (!d || !(d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary())) && !c.is("pre") && !c.getBogus()) return c
  7482. }
  7483. function b(a) {
  7484. var b = a.data.getTarget();
  7485. if(b.is("input")) {
  7486. b = b.getAttribute("type");
  7487. (b == "submit" || b == "reset") && a.data.preventDefault()
  7488. }
  7489. }
  7490. function g(a) {
  7491. return o(a) && q(a)
  7492. }
  7493. function c(a, b) {
  7494. return function(c) {
  7495. var d = CKEDITOR.dom.element.get(c.data.$.toElement || c.data.$.fromElement ||
  7496. c.data.$.relatedTarget);
  7497. (!d || !b.equals(d) && !b.contains(d)) && a.call(this, c)
  7498. }
  7499. }
  7500. function d(a) {
  7501. function b(a) {
  7502. return function(b, d) {
  7503. d && (b.type == CKEDITOR.NODE_ELEMENT && b.is(f)) && (c = b);
  7504. if(!d && g(b) && (!a || !k(b))) return false
  7505. }
  7506. }
  7507. var c, d = a.getRanges()[0],
  7508. a = a.root,
  7509. f = {
  7510. table: 1,
  7511. ul: 1,
  7512. ol: 1,
  7513. dl: 1
  7514. };
  7515. if(d.startPath().contains(f)) {
  7516. var e = d.clone();
  7517. e.collapse(1);
  7518. e.setStartAt(a, CKEDITOR.POSITION_AFTER_START);
  7519. a = new CKEDITOR.dom.walker(e);
  7520. a.guard = b();
  7521. a.checkBackward();
  7522. if(c) {
  7523. e = d.clone();
  7524. e.collapse();
  7525. e.setEndAt(c, CKEDITOR.POSITION_AFTER_END);
  7526. a = new CKEDITOR.dom.walker(e);
  7527. a.guard = b(true);
  7528. c = false;
  7529. a.checkForward();
  7530. return c
  7531. }
  7532. }
  7533. return null
  7534. }
  7535. function j(a, b, c) {
  7536. return a.config.autoParagraph !== false && a.activeEnterMode != CKEDITOR.ENTER_BR && a.editable().equals(c) && !b || b && b.getAttribute("contenteditable") == "true"
  7537. }
  7538. function f(a) {
  7539. a.editor.focus();
  7540. a.editor.fire("saveSnapshot")
  7541. }
  7542. function h(a) {
  7543. var b = a.editor;
  7544. b.getSelection().scrollIntoView();
  7545. setTimeout(function() {
  7546. b.fire("saveSnapshot")
  7547. }, 0)
  7548. }
  7549. function i(a, b, c) {
  7550. for(var d = a.getCommonAncestor(b), b = a = c ? b : a;
  7551. (a = a.getParent()) &&
  7552. !d.equals(a) && a.getChildCount() == 1;) b = a;
  7553. b.remove()
  7554. }
  7555. CKEDITOR.editable = CKEDITOR.tools.createClass({
  7556. base: CKEDITOR.dom.element,
  7557. $: function(a, b) {
  7558. this.base(b.$ || b);
  7559. this.editor = a;
  7560. this.status = "unloaded";
  7561. this.hasFocus = false;
  7562. this.setup()
  7563. },
  7564. proto: {
  7565. focus: function() {
  7566. var a;
  7567. if(CKEDITOR.env.webkit && !this.hasFocus) {
  7568. a = this.editor._.previousActive || this.getDocument().getActive();
  7569. if(this.contains(a)) {
  7570. a.focus();
  7571. return
  7572. }
  7573. }
  7574. try {
  7575. this.$[CKEDITOR.env.ie && this.getDocument().equals(CKEDITOR.document) ? "setActive" : "focus"]()
  7576. } catch(b) {
  7577. if(!CKEDITOR.env.ie) throw b;
  7578. }
  7579. if(CKEDITOR.env.safari && !this.isInline()) {
  7580. a = CKEDITOR.document.getActive();
  7581. a.equals(this.getWindow().getFrame()) || this.getWindow().focus()
  7582. }
  7583. },
  7584. on: function(a, b) {
  7585. var d = Array.prototype.slice.call(arguments, 0);
  7586. if(CKEDITOR.env.ie && /^focus|blur$/.exec(a)) {
  7587. a = a == "focus" ? "focusin" : "focusout";
  7588. b = c(b, this);
  7589. d[0] = a;
  7590. d[1] = b
  7591. }
  7592. return CKEDITOR.dom.element.prototype.on.apply(this, d)
  7593. },
  7594. attachListener: function(a) {
  7595. !this._.listeners && (this._.listeners = []);
  7596. var b = Array.prototype.slice.call(arguments, 1),
  7597. b = a.on.apply(a, b);
  7598. this._.listeners.push(b);
  7599. return b
  7600. },
  7601. clearListeners: function() {
  7602. var a = this._.listeners;
  7603. try {
  7604. for(; a.length;) a.pop().removeListener()
  7605. } catch(b) {}
  7606. },
  7607. restoreAttrs: function() {
  7608. var a = this._.attrChanges,
  7609. b, c;
  7610. for(c in a)
  7611. if(a.hasOwnProperty(c)) {
  7612. b = a[c];
  7613. b !== null ? this.setAttribute(c, b) : this.removeAttribute(c)
  7614. }
  7615. },
  7616. attachClass: function(a) {
  7617. var b = this.getCustomData("classes");
  7618. if(!this.hasClass(a)) {
  7619. !b && (b = []);
  7620. b.push(a);
  7621. this.setCustomData("classes", b);
  7622. this.addClass(a)
  7623. }
  7624. },
  7625. changeAttr: function(a, b) {
  7626. var c = this.getAttribute(a);
  7627. if(b !== c) {
  7628. !this._.attrChanges &&
  7629. (this._.attrChanges = {});
  7630. a in this._.attrChanges || (this._.attrChanges[a] = c);
  7631. this.setAttribute(a, b)
  7632. }
  7633. },
  7634. insertHtml: function(a, b) {
  7635. f(this);
  7636. m(this, b || "html", a)
  7637. },
  7638. insertText: function(a) {
  7639. f(this);
  7640. var b = this.editor,
  7641. c = b.getSelection().getStartElement().hasAscendant("pre", true) ? CKEDITOR.ENTER_BR : b.activeEnterMode,
  7642. b = c == CKEDITOR.ENTER_BR,
  7643. d = CKEDITOR.tools,
  7644. a = d.htmlEncode(a.replace(/\r\n/g, "\n")),
  7645. a = a.replace(/\t/g, "&nbsp;&nbsp; &nbsp;"),
  7646. c = c == CKEDITOR.ENTER_P ? "p" : "div";
  7647. if(!b) {
  7648. var g = /\n{2}/g;
  7649. if(g.test(a)) var e = "<" + c +
  7650. ">",
  7651. h = "</" + c + ">",
  7652. a = e + a.replace(g, function() {
  7653. return h + e
  7654. }) + h
  7655. }
  7656. a = a.replace(/\n/g, "<br>");
  7657. b || (a = a.replace(RegExp("<br>(?=</" + c + ">)"), function(a) {
  7658. return d.repeat(a, 2)
  7659. }));
  7660. a = a.replace(/^ | $/g, "&nbsp;");
  7661. a = a.replace(/(>|\s) /g, function(a, b) {
  7662. return b + "&nbsp;"
  7663. }).replace(/ (?=<)/g, "&nbsp;");
  7664. m(this, "text", a)
  7665. },
  7666. insertElement: function(a, b) {
  7667. b ? this.insertElementIntoRange(a, b) : this.insertElementIntoSelection(a)
  7668. },
  7669. insertElementIntoRange: function(a, b) {
  7670. var c = this.editor,
  7671. d = c.config.enterMode,
  7672. f = a.getName(),
  7673. g = CKEDITOR.dtd.$block[f];
  7674. if(b.checkReadOnly()) return false;
  7675. b.deleteContents(1);
  7676. b.startContainer.type == CKEDITOR.NODE_ELEMENT && b.startContainer.is({
  7677. tr: 1,
  7678. table: 1,
  7679. tbody: 1,
  7680. thead: 1,
  7681. tfoot: 1
  7682. }) && l(b);
  7683. var e, h;
  7684. if(g)
  7685. for(;
  7686. (e = b.getCommonAncestor(0, 1)) && (h = CKEDITOR.dtd[e.getName()]) && (!h || !h[f]);)
  7687. if(e.getName() in CKEDITOR.dtd.span) b.splitElement(e);
  7688. else if(b.checkStartOfBlock() && b.checkEndOfBlock()) {
  7689. b.setStartBefore(e);
  7690. b.collapse(true);
  7691. e.remove()
  7692. } else b.splitBlock(d == CKEDITOR.ENTER_DIV ? "div" : "p", c.editable());
  7693. b.insertNode(a);
  7694. return true
  7695. },
  7696. insertElementIntoSelection: function(a) {
  7697. f(this);
  7698. var b = this.editor,
  7699. c = b.activeEnterMode,
  7700. b = b.getSelection(),
  7701. d = b.getRanges()[0],
  7702. e = a.getName(),
  7703. e = CKEDITOR.dtd.$block[e];
  7704. if(this.insertElementIntoRange(a, d)) {
  7705. d.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  7706. if(e)
  7707. if((e = a.getNext(function(a) {
  7708. return g(a) && !k(a)
  7709. })) && e.type == CKEDITOR.NODE_ELEMENT && e.is(CKEDITOR.dtd.$block)) e.getDtd()["#"] ? d.moveToElementEditStart(e) : d.moveToElementEditEnd(a);
  7710. else if(!e && c != CKEDITOR.ENTER_BR) {
  7711. e = d.fixBlock(true, c == CKEDITOR.ENTER_DIV ?
  7712. "div" : "p");
  7713. d.moveToElementEditStart(e)
  7714. }
  7715. }
  7716. b.selectRanges([d]);
  7717. h(this)
  7718. },
  7719. setData: function(a, b) {
  7720. b || (a = this.editor.dataProcessor.toHtml(a));
  7721. this.setHtml(a);
  7722. this.fixInitialSelection();
  7723. if(this.status == "unloaded") this.status = "ready";
  7724. this.editor.fire("dataReady")
  7725. },
  7726. getData: function(a) {
  7727. var b = this.getHtml();
  7728. a || (b = this.editor.dataProcessor.toDataFormat(b));
  7729. return b
  7730. },
  7731. setReadOnly: function(a) {
  7732. this.setAttribute("contenteditable", !a)
  7733. },
  7734. detach: function() {
  7735. this.removeClass("cke_editable");
  7736. this.status = "detached";
  7737. var a = this.editor;
  7738. this._.detach();
  7739. delete a.document;
  7740. delete a.window
  7741. },
  7742. isInline: function() {
  7743. return this.getDocument().equals(CKEDITOR.document)
  7744. },
  7745. fixInitialSelection: function() {
  7746. function a() {
  7747. var b = c.getDocument().$,
  7748. d = b.getSelection(),
  7749. f;
  7750. if(d.anchorNode && d.anchorNode == c.$) f = true;
  7751. else if(CKEDITOR.env.webkit) {
  7752. var g = c.getDocument().getActive();
  7753. g && (g.equals(c) && !d.anchorNode) && (f = true)
  7754. }
  7755. if(f) {
  7756. f = new CKEDITOR.dom.range(c);
  7757. f.moveToElementEditStart(c);
  7758. b = b.createRange();
  7759. b.setStart(f.startContainer.$, f.startOffset);
  7760. b.collapse(true);
  7761. d.removeAllRanges();
  7762. d.addRange(b)
  7763. }
  7764. }
  7765. function b() {
  7766. var a = c.getDocument().$,
  7767. d = a.selection,
  7768. f = c.getDocument().getActive();
  7769. if(d.type == "None" && f.equals(c)) {
  7770. d = new CKEDITOR.dom.range(c);
  7771. a = a.body.createTextRange();
  7772. d.moveToElementEditStart(c);
  7773. d = d.startContainer;
  7774. d.type != CKEDITOR.NODE_ELEMENT && (d = d.getParent());
  7775. a.moveToElementText(d.$);
  7776. a.collapse(true);
  7777. a.select()
  7778. }
  7779. }
  7780. var c = this;
  7781. if(CKEDITOR.env.ie && (CKEDITOR.env.version < 9 || CKEDITOR.env.quirks)) {
  7782. if(this.hasFocus) {
  7783. this.focus();
  7784. b()
  7785. }
  7786. } else if(this.hasFocus) {
  7787. this.focus();
  7788. a()
  7789. } else this.once("focus", function() {
  7790. a()
  7791. }, null, null, -999)
  7792. },
  7793. setup: function() {
  7794. var a = this.editor;
  7795. this.attachListener(a, "beforeGetData", function() {
  7796. var b = this.getData();
  7797. this.is("textarea") || a.config.ignoreEmptyParagraph !== false && (b = b.replace(n, function(a, b) {
  7798. return b
  7799. }));
  7800. a.setData(b, null, 1)
  7801. }, this);
  7802. this.attachListener(a, "getSnapshot", function(a) {
  7803. a.data = this.getData(1)
  7804. }, this);
  7805. this.attachListener(a, "afterSetData", function() {
  7806. this.setData(a.getData(1))
  7807. }, this);
  7808. this.attachListener(a, "loadSnapshot", function(a) {
  7809. this.setData(a.data,
  7810. 1)
  7811. }, this);
  7812. this.attachListener(a, "beforeFocus", function() {
  7813. var b = a.getSelection();
  7814. (b = b && b.getNative()) && b.type == "Control" || this.focus()
  7815. }, this);
  7816. this.attachListener(a, "insertHtml", function(a) {
  7817. this.insertHtml(a.data.dataValue, a.data.mode)
  7818. }, this);
  7819. this.attachListener(a, "insertElement", function(a) {
  7820. this.insertElement(a.data)
  7821. }, this);
  7822. this.attachListener(a, "insertText", function(a) {
  7823. this.insertText(a.data)
  7824. }, this);
  7825. this.setReadOnly(a.readOnly);
  7826. this.attachClass("cke_editable");
  7827. this.attachClass(a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ?
  7828. "cke_editable_inline" : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE || a.elementMode == CKEDITOR.ELEMENT_MODE_APPENDTO ? "cke_editable_themed" : "");
  7829. this.attachClass("cke_contents_" + a.config.contentsLangDirection);
  7830. a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly;
  7831. a.keystrokeHandler.attach(this);
  7832. this.on("blur", function() {
  7833. this.hasFocus = false
  7834. }, null, null, -1);
  7835. this.on("focus", function() {
  7836. this.hasFocus = true
  7837. }, null, null, -1);
  7838. a.focusManager.add(this);
  7839. if(this.equals(CKEDITOR.document.getActive())) {
  7840. this.hasFocus = true;
  7841. a.once("contentDom", function() {
  7842. a.focusManager.focus(this)
  7843. }, this)
  7844. }
  7845. this.isInline() && this.changeAttr("tabindex", a.tabIndex);
  7846. if(!this.is("textarea")) {
  7847. a.document = this.getDocument();
  7848. a.window = this.getWindow();
  7849. var c = a.document;
  7850. this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker);
  7851. var f = a.config.contentsLangDirection;
  7852. this.getDirection(1) != f && this.changeAttr("dir", f);
  7853. var e = CKEDITOR.getCss();
  7854. if(e) {
  7855. f = c.getHead();
  7856. if(!f.getCustomData("stylesheet")) {
  7857. e = c.appendStyleText(e);
  7858. e = new CKEDITOR.dom.element(e.ownerNode ||
  7859. e.owningElement);
  7860. f.setCustomData("stylesheet", e);
  7861. e.data("cke-temp", 1)
  7862. }
  7863. }
  7864. f = c.getCustomData("stylesheet_ref") || 0;
  7865. c.setCustomData("stylesheet_ref", f + 1);
  7866. this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling);
  7867. this.attachListener(this, "click", function(a) {
  7868. var a = a.data,
  7869. b = (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a");
  7870. b && (a.$.button != 2 && b.isReadOnly()) && a.preventDefault()
  7871. });
  7872. var h = {
  7873. 8: 1,
  7874. 46: 1
  7875. };
  7876. this.attachListener(a, "key", function(b) {
  7877. if(a.readOnly) return true;
  7878. var c = b.data.domEvent.getKey(),
  7879. f;
  7880. if(c in h) {
  7881. var b = a.getSelection(),
  7882. e, g = b.getRanges()[0],
  7883. i = g.startPath(),
  7884. j, k, t, c = c == 8;
  7885. if(CKEDITOR.env.ie && CKEDITOR.env.version < 11 && (e = b.getSelectedElement()) || (e = d(b))) {
  7886. a.fire("saveSnapshot");
  7887. g.moveToPosition(e, CKEDITOR.POSITION_BEFORE_START);
  7888. e.remove();
  7889. g.select();
  7890. a.fire("saveSnapshot");
  7891. f = 1
  7892. } else if(g.collapsed)
  7893. if((j = i.block) && (t = j[c ? "getPrevious" : "getNext"](o)) && t.type == CKEDITOR.NODE_ELEMENT && t.is("table") && g[c ? "checkStartOfBlock" : "checkEndOfBlock"]()) {
  7894. a.fire("saveSnapshot");
  7895. g[c ? "checkEndOfBlock" :
  7896. "checkStartOfBlock"]() && j.remove();
  7897. g["moveToElementEdit" + (c ? "End" : "Start")](t);
  7898. g.select();
  7899. a.fire("saveSnapshot");
  7900. f = 1
  7901. } else if(i.blockLimit && i.blockLimit.is("td") && (k = i.blockLimit.getAscendant("table")) && g.checkBoundaryOfElement(k, c ? CKEDITOR.START : CKEDITOR.END) && (t = k[c ? "getPrevious" : "getNext"](o))) {
  7902. a.fire("saveSnapshot");
  7903. g["moveToElementEdit" + (c ? "End" : "Start")](t);
  7904. g.checkStartOfBlock() && g.checkEndOfBlock() ? t.remove() : g.select();
  7905. a.fire("saveSnapshot");
  7906. f = 1
  7907. } else if((k = i.contains(["td", "th", "caption"])) &&
  7908. g.checkBoundaryOfElement(k, c ? CKEDITOR.START : CKEDITOR.END)) f = 1
  7909. }
  7910. return !f
  7911. });
  7912. a.blockless && (CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller) && this.attachListener(this, "keyup", function(b) {
  7913. if(b.data.getKeystroke() in h && !this.getFirst(g)) {
  7914. this.appendBogus();
  7915. b = a.createRange();
  7916. b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START);
  7917. b.select()
  7918. }
  7919. });
  7920. this.attachListener(this, "dblclick", function(b) {
  7921. if(a.readOnly) return false;
  7922. b = {
  7923. element: b.data.getTarget()
  7924. };
  7925. a.fire("doubleclick", b)
  7926. });
  7927. CKEDITOR.env.ie && this.attachListener(this,
  7928. "click", b);
  7929. CKEDITOR.env.ie || this.attachListener(this, "mousedown", function(b) {
  7930. var c = b.data.getTarget();
  7931. if(c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly()) {
  7932. a.getSelection().selectElement(c);
  7933. c.is("input", "textarea", "select") && b.data.preventDefault()
  7934. }
  7935. });
  7936. CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(b) {
  7937. if(b.data.$.button == 2) {
  7938. b = b.data.getTarget();
  7939. if(!b.getOuterHtml().replace(n, "")) {
  7940. var c = a.createRange();
  7941. c.moveToElementEditStart(b);
  7942. c.select(true)
  7943. }
  7944. }
  7945. });
  7946. if(CKEDITOR.env.webkit) {
  7947. this.attachListener(this,
  7948. "click",
  7949. function(a) {
  7950. a.data.getTarget().is("input", "select") && a.data.preventDefault()
  7951. });
  7952. this.attachListener(this, "mouseup", function(a) {
  7953. a.data.getTarget().is("input", "textarea") && a.data.preventDefault()
  7954. })
  7955. }
  7956. CKEDITOR.env.webkit && this.attachListener(a, "key", function(b) {
  7957. b = b.data.domEvent.getKey();
  7958. if(b in h) {
  7959. var c = b == 8,
  7960. d = a.getSelection().getRanges()[0],
  7961. b = d.startPath();
  7962. if(d.collapsed) {
  7963. var f;
  7964. a: {
  7965. var g = b.block;
  7966. if(g)
  7967. if(d[c ? "checkStartOfBlock" : "checkEndOfBlock"]())
  7968. if(!d.moveToClosestEditablePosition(g, !c) || !d.collapsed) f =
  7969. false;
  7970. else {
  7971. if(d.startContainer.type == CKEDITOR.NODE_ELEMENT) {
  7972. var e = d.startContainer.getChild(d.startOffset - (c ? 1 : 0));
  7973. if(e && e.type == CKEDITOR.NODE_ELEMENT && e.is("hr")) {
  7974. a.fire("saveSnapshot");
  7975. e.remove();
  7976. f = true;
  7977. break a
  7978. }
  7979. }
  7980. if((d = d.startPath().block) && (!d || !d.contains(g))) {
  7981. a.fire("saveSnapshot");
  7982. var j;
  7983. (j = (c ? d : g).getBogus()) && j.remove();
  7984. f = a.getSelection();
  7985. j = f.createBookmarks();
  7986. (c ? g : d).moveChildren(c ? d : g, false);
  7987. b.lastElement.mergeSiblings();
  7988. i(g, d, !c);
  7989. f.selectBookmarks(j);
  7990. f = true
  7991. }
  7992. }
  7993. else f = false;
  7994. else f = false
  7995. }
  7996. if(!f) return
  7997. } else {
  7998. c =
  7999. d;
  8000. f = b.block;
  8001. j = c.endPath().block;
  8002. if(!f || !j || f.equals(j)) b = false;
  8003. else {
  8004. a.fire("saveSnapshot");
  8005. (g = f.getBogus()) && g.remove();
  8006. c.deleteContents();
  8007. if(j.getParent()) {
  8008. j.moveChildren(f, false);
  8009. b.lastElement.mergeSiblings();
  8010. i(f, j, true)
  8011. }
  8012. c = a.getSelection().getRanges()[0];
  8013. c.collapse(1);
  8014. c.select();
  8015. b = true
  8016. }
  8017. if(!b) return
  8018. }
  8019. a.getSelection().scrollIntoView();
  8020. a.fire("saveSnapshot");
  8021. return false
  8022. }
  8023. }, this, null, 100)
  8024. }
  8025. }
  8026. },
  8027. _: {
  8028. detach: function() {
  8029. this.editor.setData(this.editor.getData(), 0, 1);
  8030. this.clearListeners();
  8031. this.restoreAttrs();
  8032. var a;
  8033. if(a = this.removeCustomData("classes"))
  8034. for(; a.length;) this.removeClass(a.pop());
  8035. if(!this.is("textarea")) {
  8036. a = this.getDocument();
  8037. var b = a.getHead();
  8038. if(b.getCustomData("stylesheet")) {
  8039. var c = a.getCustomData("stylesheet_ref");
  8040. if(--c) a.setCustomData("stylesheet_ref", c);
  8041. else {
  8042. a.removeCustomData("stylesheet_ref");
  8043. b.removeCustomData("stylesheet").remove()
  8044. }
  8045. }
  8046. }
  8047. this.editor.fire("contentDomUnload");
  8048. delete this.editor
  8049. }
  8050. }
  8051. });
  8052. CKEDITOR.editor.prototype.editable = function(a) {
  8053. var b = this._.editable;
  8054. if(b && a) return 0;
  8055. if(arguments.length) b =
  8056. this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null);
  8057. return b
  8058. };
  8059. var k = CKEDITOR.dom.walker.bogus(),
  8060. n = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,
  8061. o = CKEDITOR.dom.walker.whitespaces(true),
  8062. q = CKEDITOR.dom.walker.bookmark(false, true);
  8063. CKEDITOR.on("instanceLoaded", function(b) {
  8064. var c = b.editor;
  8065. c.on("insertElement", function(a) {
  8066. a = a.data;
  8067. if(a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") ||
  8068. a.is("textarea"))) {
  8069. a.getAttribute("contentEditable") != "false" && a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1");
  8070. a.setAttribute("contentEditable", false)
  8071. }
  8072. });
  8073. c.on("selectionChange", function(b) {
  8074. if(!c.readOnly) {
  8075. var d = c.getSelection();
  8076. if(d && !d.isLocked) {
  8077. d = c.checkDirty();
  8078. c.fire("lockSnapshot");
  8079. a(b);
  8080. c.fire("unlockSnapshot");
  8081. !d && c.resetDirty()
  8082. }
  8083. }
  8084. })
  8085. });
  8086. CKEDITOR.on("instanceCreated", function(a) {
  8087. var b = a.editor;
  8088. b.on("mode", function() {
  8089. var a = b.editable();
  8090. if(a && a.isInline()) {
  8091. var c = b.title;
  8092. a.changeAttr("role",
  8093. "textbox");
  8094. a.changeAttr("aria-label", c);
  8095. c && a.changeAttr("title", c);
  8096. var d = b.fire("ariaEditorHelpLabel", {}).label;
  8097. if(d)
  8098. if(c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents")) {
  8099. var f = CKEDITOR.tools.getNextId(),
  8100. d = CKEDITOR.dom.element.createFromHtml('<span id="' + f + '" class="cke_voice_label">' + d + "</span>");
  8101. c.append(d);
  8102. a.changeAttr("aria-describedby", f)
  8103. }
  8104. }
  8105. })
  8106. });
  8107. CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
  8108. var m = function() {
  8109. function a(b) {
  8110. return b.type == CKEDITOR.NODE_ELEMENT
  8111. }
  8112. function b(c, d) {
  8113. var f, g, e, h, j = [],
  8114. k = d.range.startContainer;
  8115. f = d.range.startPath();
  8116. for(var k = i[k.getName()], m = 0, n = c.getChildren(), w = n.count(), s = -1, x = -1, l = 0, r = f.contains(i.$list); m < w; ++m) {
  8117. f = n.getItem(m);
  8118. if(a(f)) {
  8119. e = f.getName();
  8120. if(r && e in CKEDITOR.dtd.$list) j = j.concat(b(f, d));
  8121. else {
  8122. h = !!k[e];
  8123. if(e == "br" && f.data("cke-eol") && (!m || m == w - 1)) {
  8124. l = (g = m ? j[m - 1].node : n.getItem(m + 1)) && (!a(g) || !g.is("br"));
  8125. g = g && a(g) && i.$block[g.getName()]
  8126. }
  8127. s == -1 && !h && (s =
  8128. m);
  8129. h || (x = m);
  8130. j.push({
  8131. isElement: 1,
  8132. isLineBreak: l,
  8133. isBlock: f.isBlockBoundary(),
  8134. hasBlockSibling: g,
  8135. node: f,
  8136. name: e,
  8137. allowed: h
  8138. });
  8139. g = l = 0
  8140. }
  8141. } else j.push({
  8142. isElement: 0,
  8143. node: f,
  8144. allowed: 1
  8145. })
  8146. }
  8147. if(s > -1) j[s].firstNotAllowed = 1;
  8148. if(x > -1) j[x].lastNotAllowed = 1;
  8149. return j
  8150. }
  8151. function c(b, d) {
  8152. var f = [],
  8153. g = b.getChildren(),
  8154. e = g.count(),
  8155. h, j = 0,
  8156. k = i[d],
  8157. m = !b.is(i.$inline) || b.is("br");
  8158. for(m && f.push(" "); j < e; j++) {
  8159. h = g.getItem(j);
  8160. a(h) && !h.is(k) ? f = f.concat(c(h, d)) : f.push(h)
  8161. }
  8162. m && f.push(" ");
  8163. return f
  8164. }
  8165. function d(b) {
  8166. return b && a(b) && (b.is(i.$removeEmpty) ||
  8167. b.is("a") && !b.isBlockBoundary())
  8168. }
  8169. function f(b, c, d, g) {
  8170. var e = b.clone(),
  8171. h, j;
  8172. e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  8173. if((h = (new CKEDITOR.dom.walker(e)).next()) && a(h) && k[h.getName()] && (j = h.getPrevious()) && a(j) && !j.getParent().equals(b.startContainer) && d.contains(j) && g.contains(h) && h.isIdentical(j)) {
  8174. h.moveChildren(j);
  8175. h.remove();
  8176. f(b, c, d, g)
  8177. }
  8178. }
  8179. function e(b, c) {
  8180. function d(b, c) {
  8181. if(c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) {
  8182. b.remove();
  8183. return 1
  8184. }
  8185. }
  8186. var f = c.endContainer.getChild(c.endOffset),
  8187. g = c.endContainer.getChild(c.endOffset -
  8188. 1);
  8189. f && d(f, b[b.length - 1]);
  8190. if(g && d(g, b[0])) {
  8191. c.setEnd(c.endContainer, c.endOffset - 1);
  8192. c.collapse()
  8193. }
  8194. }
  8195. var i = CKEDITOR.dtd,
  8196. k = {
  8197. p: 1,
  8198. div: 1,
  8199. h1: 1,
  8200. h2: 1,
  8201. h3: 1,
  8202. h4: 1,
  8203. h5: 1,
  8204. h6: 1,
  8205. ul: 1,
  8206. ol: 1,
  8207. li: 1,
  8208. pre: 1,
  8209. dl: 1,
  8210. blockquote: 1
  8211. },
  8212. m = {
  8213. p: 1,
  8214. div: 1,
  8215. h1: 1,
  8216. h2: 1,
  8217. h3: 1,
  8218. h4: 1,
  8219. h5: 1,
  8220. h6: 1
  8221. },
  8222. n = CKEDITOR.tools.extend({}, i.$inline);
  8223. delete n.br;
  8224. return function(k, l, r) {
  8225. var q = k.editor,
  8226. o = q.getSelection().getRanges()[0],
  8227. C = false;
  8228. if(l == "unfiltered_html") {
  8229. l = "html";
  8230. C = true
  8231. }
  8232. if(!o.checkReadOnly()) {
  8233. var F = (new CKEDITOR.dom.elementPath(o.startContainer, o.root)).blockLimit ||
  8234. o.root,
  8235. l = {
  8236. type: l,
  8237. dontFilter: C,
  8238. editable: k,
  8239. editor: q,
  8240. range: o,
  8241. blockLimit: F,
  8242. mergeCandidates: [],
  8243. zombies: []
  8244. },
  8245. q = l.range,
  8246. C = l.mergeCandidates,
  8247. E, I, L, H;
  8248. if(l.type == "text" && q.shrink(CKEDITOR.SHRINK_ELEMENT, true, false)) {
  8249. E = CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", q.document);
  8250. q.insertNode(E);
  8251. q.setStartAfter(E)
  8252. }
  8253. I = new CKEDITOR.dom.elementPath(q.startContainer);
  8254. l.endPath = L = new CKEDITOR.dom.elementPath(q.endContainer);
  8255. if(!q.collapsed) {
  8256. var F = L.block || L.blockLimit,
  8257. Q = q.getCommonAncestor();
  8258. F && (!F.equals(Q) &&
  8259. !F.contains(Q) && q.checkEndOfBlock()) && l.zombies.push(F);
  8260. q.deleteContents()
  8261. }
  8262. for(;
  8263. (H = a(q.startContainer) && q.startContainer.getChild(q.startOffset - 1)) && a(H) && H.isBlockBoundary() && I.contains(H);) q.moveToPosition(H, CKEDITOR.POSITION_BEFORE_END);
  8264. f(q, l.blockLimit, I, L);
  8265. if(E) {
  8266. q.setEndBefore(E);
  8267. q.collapse();
  8268. E.remove()
  8269. }
  8270. E = q.startPath();
  8271. if(F = E.contains(d, false, 1)) {
  8272. q.splitElement(F);
  8273. l.inlineStylesRoot = F;
  8274. l.inlineStylesPeak = E.lastElement
  8275. }
  8276. E = q.createBookmark();
  8277. (F = E.startNode.getPrevious(g)) && a(F) && d(F) && C.push(F);
  8278. (F = E.startNode.getNext(g)) && a(F) && d(F) && C.push(F);
  8279. for(F = E.startNode;
  8280. (F = F.getParent()) && d(F);) C.push(F);
  8281. q.moveToBookmark(E);
  8282. if(E = r) {
  8283. E = l.range;
  8284. if(l.type == "text" && l.inlineStylesRoot) {
  8285. H = l.inlineStylesPeak;
  8286. q = H.getDocument().createText("{cke-peak}");
  8287. for(C = l.inlineStylesRoot.getParent(); !H.equals(C);) {
  8288. q = q.appendTo(H.clone());
  8289. H = H.getParent()
  8290. }
  8291. r = q.getOuterHtml().split("{cke-peak}").join(r)
  8292. }
  8293. H = l.blockLimit.getName();
  8294. if(/^\s+|\s+$/.test(r) && "span" in CKEDITOR.dtd[H]) var O = '<span data-cke-marker="1">&nbsp;</span>',
  8295. r = O + r + O;
  8296. r = l.editor.dataProcessor.toHtml(r, {
  8297. context: null,
  8298. fixForBody: false,
  8299. dontFilter: l.dontFilter,
  8300. filter: l.editor.activeFilter,
  8301. enterMode: l.editor.activeEnterMode
  8302. });
  8303. H = E.document.createElement("body");
  8304. H.setHtml(r);
  8305. if(O) {
  8306. H.getFirst().remove();
  8307. H.getLast().remove()
  8308. }
  8309. if((O = E.startPath().block) && !(O.getChildCount() == 1 && O.getBogus())) a: {
  8310. var M;
  8311. if(H.getChildCount() == 1 && a(M = H.getFirst()) && M.is(m)) {
  8312. O = M.getElementsByTag("*");
  8313. E = 0;
  8314. for(C = O.count(); E < C; E++) {
  8315. q = O.getItem(E);
  8316. if(!q.is(n)) break a
  8317. }
  8318. M.moveChildren(M.getParent(1));
  8319. M.remove()
  8320. }
  8321. }
  8322. l.dataWrapper = H;
  8323. E = r
  8324. }
  8325. if(E) {
  8326. M = l.range;
  8327. var O = M.document,
  8328. K, r = l.blockLimit;
  8329. E = 0;
  8330. var R;
  8331. H = [];
  8332. var N, T, C = q = 0,
  8333. P, V;
  8334. I = M.startContainer;
  8335. var F = l.endPath.elements[0],
  8336. W;
  8337. L = F.getPosition(I);
  8338. Q = !!F.getCommonAncestor(I) && L != CKEDITOR.POSITION_IDENTICAL && !(L & CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED);
  8339. I = b(l.dataWrapper, l);
  8340. for(e(I, M); E < I.length; E++) {
  8341. L = I[E];
  8342. if(K = L.isLineBreak) {
  8343. K = M;
  8344. P = r;
  8345. var S = void 0,
  8346. Y = void 0;
  8347. if(L.hasBlockSibling) K = 1;
  8348. else {
  8349. S = K.startContainer.getAscendant(i.$block, 1);
  8350. if(!S || !S.is({
  8351. div: 1,
  8352. p: 1
  8353. })) K = 0;
  8354. else {
  8355. Y = S.getPosition(P);
  8356. if(Y == CKEDITOR.POSITION_IDENTICAL || Y == CKEDITOR.POSITION_CONTAINS) K = 0;
  8357. else {
  8358. P = K.splitElement(S);
  8359. K.moveToPosition(P, CKEDITOR.POSITION_AFTER_START);
  8360. K = 1
  8361. }
  8362. }
  8363. }
  8364. }
  8365. if(K) C = E > 0;
  8366. else {
  8367. K = M.startPath();
  8368. if(!L.isBlock && j(l.editor, K.block, K.blockLimit) && (T = l.editor.activeEnterMode != CKEDITOR.ENTER_BR && l.editor.config.autoParagraph !== false ? l.editor.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : false)) {
  8369. T = O.createElement(T);
  8370. T.appendBogus();
  8371. M.insertNode(T);
  8372. CKEDITOR.env.needsBrFiller && (R = T.getBogus()) &&
  8373. R.remove();
  8374. M.moveToPosition(T, CKEDITOR.POSITION_BEFORE_END)
  8375. }
  8376. if((K = M.startPath().block) && !K.equals(N)) {
  8377. if(R = K.getBogus()) {
  8378. R.remove();
  8379. H.push(K)
  8380. }
  8381. N = K
  8382. }
  8383. L.firstNotAllowed && (q = 1);
  8384. if(q && L.isElement) {
  8385. K = M.startContainer;
  8386. for(P = null; K && !i[K.getName()][L.name];) {
  8387. if(K.equals(r)) {
  8388. K = null;
  8389. break
  8390. }
  8391. P = K;
  8392. K = K.getParent()
  8393. }
  8394. if(K) {
  8395. if(P) {
  8396. V = M.splitElement(P);
  8397. l.zombies.push(V);
  8398. l.zombies.push(P)
  8399. }
  8400. } else {
  8401. P = r.getName();
  8402. W = !E;
  8403. K = E == I.length - 1;
  8404. P = c(L.node, P);
  8405. for(var S = [], Y = P.length, Z = 0, ba = void 0, X = 0, aa = -1; Z < Y; Z++) {
  8406. ba = P[Z];
  8407. if(ba == " ") {
  8408. if(!X &&
  8409. (!W || Z)) {
  8410. S.push(new CKEDITOR.dom.text(" "));
  8411. aa = S.length
  8412. }
  8413. X = 1
  8414. } else {
  8415. S.push(ba);
  8416. X = 0
  8417. }
  8418. }
  8419. K && aa == S.length && S.pop();
  8420. W = S
  8421. }
  8422. }
  8423. if(W) {
  8424. for(; K = W.pop();) M.insertNode(K);
  8425. W = 0
  8426. } else M.insertNode(L.node);
  8427. if(L.lastNotAllowed && E < I.length - 1) {
  8428. (V = Q ? F : V) && M.setEndAt(V, CKEDITOR.POSITION_AFTER_START);
  8429. q = 0
  8430. }
  8431. M.collapse()
  8432. }
  8433. }
  8434. l.dontMoveCaret = C;
  8435. l.bogusNeededBlocks = H
  8436. }
  8437. R = l.range;
  8438. var U;
  8439. V = l.bogusNeededBlocks;
  8440. for(W = R.createBookmark(); N = l.zombies.pop();)
  8441. if(N.getParent()) {
  8442. T = R.clone();
  8443. T.moveToElementEditStart(N);
  8444. T.removeEmptyBlocksAtEnd()
  8445. }
  8446. if(V)
  8447. for(; N =
  8448. V.pop();) CKEDITOR.env.needsBrFiller ? N.appendBogus() : N.append(R.document.createText(" "));
  8449. for(; N = l.mergeCandidates.pop();) N.mergeSiblings();
  8450. R.moveToBookmark(W);
  8451. if(!l.dontMoveCaret) {
  8452. for(N = a(R.startContainer) && R.startContainer.getChild(R.startOffset - 1); N && a(N) && !N.is(i.$empty);) {
  8453. if(N.isBlockBoundary()) R.moveToPosition(N, CKEDITOR.POSITION_BEFORE_END);
  8454. else {
  8455. if(d(N) && N.getHtml().match(/(\s|&nbsp;)$/g)) {
  8456. U = null;
  8457. break
  8458. }
  8459. U = R.clone();
  8460. U.moveToPosition(N, CKEDITOR.POSITION_BEFORE_END)
  8461. }
  8462. N = N.getLast(g)
  8463. }
  8464. U && R.moveToRange(U)
  8465. }
  8466. o.select();
  8467. h(k)
  8468. }
  8469. }
  8470. }(),
  8471. l = function() {
  8472. function a(b) {
  8473. b = new CKEDITOR.dom.walker(b);
  8474. b.guard = function(a, b) {
  8475. if(b) return false;
  8476. if(a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent)
  8477. };
  8478. b.evaluator = function(a) {
  8479. return a.type == CKEDITOR.NODE_ELEMENT
  8480. };
  8481. return b
  8482. }
  8483. function b(a, c, d) {
  8484. c = a.getDocument().createElement(c);
  8485. a.append(c, d);
  8486. return c
  8487. }
  8488. function c(a) {
  8489. var b = a.count(),
  8490. d;
  8491. for(b; b-- > 0;) {
  8492. d = a.getItem(b);
  8493. if(!CKEDITOR.tools.trim(d.getHtml())) {
  8494. d.appendBogus();
  8495. CKEDITOR.env.ie && (CKEDITOR.env.version < 9 && d.getChildCount()) &&
  8496. d.getFirst().remove()
  8497. }
  8498. }
  8499. }
  8500. return function(d) {
  8501. var f = d.startContainer,
  8502. g = f.getAscendant("table", 1),
  8503. e = false;
  8504. c(g.getElementsByTag("td"));
  8505. c(g.getElementsByTag("th"));
  8506. g = d.clone();
  8507. g.setStart(f, 0);
  8508. g = a(g).lastBackward();
  8509. if(!g) {
  8510. g = d.clone();
  8511. g.setEndAt(f, CKEDITOR.POSITION_BEFORE_END);
  8512. g = a(g).lastForward();
  8513. e = true
  8514. }
  8515. g || (g = f);
  8516. if(g.is("table")) {
  8517. d.setStartAt(g, CKEDITOR.POSITION_BEFORE_START);
  8518. d.collapse(true);
  8519. g.remove()
  8520. } else {
  8521. g.is({
  8522. tbody: 1,
  8523. thead: 1,
  8524. tfoot: 1
  8525. }) && (g = b(g, "tr", e));
  8526. g.is("tr") && (g = b(g, g.getParent().is("thead") ? "th" :
  8527. "td", e));
  8528. (f = g.getBogus()) && f.remove();
  8529. d.moveToPosition(g, e ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END)
  8530. }
  8531. }
  8532. }()
  8533. }(),
  8534. function() {
  8535. function a() {
  8536. var a = this._.fakeSelection,
  8537. b;
  8538. if(a) {
  8539. b = this.getSelection(1);
  8540. if(!b || !b.isHidden()) {
  8541. a.reset();
  8542. a = 0
  8543. }
  8544. }
  8545. if(!a) {
  8546. a = b || this.getSelection(1);
  8547. if(!a || a.getType() == CKEDITOR.SELECTION_NONE) return
  8548. }
  8549. this.fire("selectionCheck", a);
  8550. b = this.elementPath();
  8551. if(!b.compare(this._.selectionPreviousPath)) {
  8552. if(CKEDITOR.env.webkit) this._.previousActive = this.document.getActive();
  8553. this._.selectionPreviousPath =
  8554. b;
  8555. this.fire("selectionChange", {
  8556. selection: a,
  8557. path: b
  8558. })
  8559. }
  8560. }
  8561. function e() {
  8562. m = true;
  8563. if(!q) {
  8564. b.call(this);
  8565. q = CKEDITOR.tools.setTimeout(b, 200, this)
  8566. }
  8567. }
  8568. function b() {
  8569. q = null;
  8570. if(m) {
  8571. CKEDITOR.tools.setTimeout(a, 0, this);
  8572. m = false
  8573. }
  8574. }
  8575. function g(a) {
  8576. return l(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? true : false
  8577. }
  8578. function c(a) {
  8579. function b(c, d) {
  8580. return !c || c.type == CKEDITOR.NODE_TEXT ? false : a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c)
  8581. }
  8582. if(!(a.root instanceof CKEDITOR.editable)) return false;
  8583. var c = a.startContainer,
  8584. d = a.getPreviousNode(g, null, c),
  8585. f = a.getNextNode(g, null, c);
  8586. return b(d) || b(f, 1) || !d && !f && !(c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c.getBogus()) ? true : false
  8587. }
  8588. function d(a) {
  8589. return a.getCustomData("cke-fillingChar")
  8590. }
  8591. function j(a, b) {
  8592. var c = a && a.removeCustomData("cke-fillingChar");
  8593. if(c) {
  8594. if(b !== false) {
  8595. var d, g = a.getDocument().getSelection().getNative(),
  8596. e = g && g.type != "None" && g.getRangeAt(0);
  8597. if(c.getLength() > 1 && e && e.intersectsNode(c.$)) {
  8598. d = h(g);
  8599. e = g.focusNode == c.$ && g.focusOffset > 0;
  8600. g.anchorNode == c.$ && g.anchorOffset >
  8601. 0 && d[0].offset--;
  8602. e && d[1].offset--
  8603. }
  8604. }
  8605. c.setText(f(c.getText()));
  8606. d && i(a.getDocument().$, d)
  8607. }
  8608. }
  8609. function f(a) {
  8610. return a.replace(/\u200B( )?/g, function(a) {
  8611. return a[1] ? " " : ""
  8612. })
  8613. }
  8614. function h(a) {
  8615. return [{
  8616. node: a.anchorNode,
  8617. offset: a.anchorOffset
  8618. }, {
  8619. node: a.focusNode,
  8620. offset: a.focusOffset
  8621. }]
  8622. }
  8623. function i(a, b) {
  8624. var c = a.getSelection(),
  8625. d = a.createRange();
  8626. d.setStart(b[0].node, b[0].offset);
  8627. d.collapse(true);
  8628. c.removeAllRanges();
  8629. c.addRange(d);
  8630. c.extend(b[1].node, b[1].offset)
  8631. }
  8632. function k(a) {
  8633. var b = CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="' +
  8634. (CKEDITOR.env.ie ? "display:none" : "position:fixed;top:0;left:-1000px") + '">&nbsp;</div>', a.document);
  8635. a.fire("lockSnapshot");
  8636. a.editable().append(b);
  8637. var c = a.getSelection(1),
  8638. d = a.createRange(),
  8639. f = c.root.on("selectionchange", function(a) {
  8640. a.cancel()
  8641. }, null, null, 0);
  8642. d.setStartAt(b, CKEDITOR.POSITION_AFTER_START);
  8643. d.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
  8644. c.selectRanges([d]);
  8645. f.removeListener();
  8646. a.fire("unlockSnapshot");
  8647. a._.hiddenSelectionContainer = b
  8648. }
  8649. function n(a) {
  8650. var b = {
  8651. 37: 1,
  8652. 39: 1,
  8653. 8: 1,
  8654. 46: 1
  8655. };
  8656. return function(c) {
  8657. var d =
  8658. c.data.getKeystroke();
  8659. if(b[d]) {
  8660. var f = a.getSelection().getRanges(),
  8661. g = f[0];
  8662. if(f.length == 1 && g.collapsed)
  8663. if((d = g[d < 38 ? "getPreviousEditableNode" : "getNextEditableNode"]()) && d.type == CKEDITOR.NODE_ELEMENT && d.getAttribute("contenteditable") == "false") {
  8664. a.getSelection().fake(d);
  8665. c.data.preventDefault();
  8666. c.cancel()
  8667. }
  8668. }
  8669. }
  8670. }
  8671. function o(a) {
  8672. for(var b = 0; b < a.length; b++) {
  8673. var c = a[b];
  8674. c.getCommonAncestor().isReadOnly() && a.splice(b, 1);
  8675. if(!c.collapsed) {
  8676. if(c.startContainer.isReadOnly())
  8677. for(var d = c.startContainer, f; d;) {
  8678. if((f = d.type ==
  8679. CKEDITOR.NODE_ELEMENT) && d.is("body") || !d.isReadOnly()) break;
  8680. f && d.getAttribute("contentEditable") == "false" && c.setStartAfter(d);
  8681. d = d.getParent()
  8682. }
  8683. d = c.startContainer;
  8684. f = c.endContainer;
  8685. var g = c.startOffset,
  8686. e = c.endOffset,
  8687. h = c.clone();
  8688. d && d.type == CKEDITOR.NODE_TEXT && (g >= d.getLength() ? h.setStartAfter(d) : h.setStartBefore(d));
  8689. f && f.type == CKEDITOR.NODE_TEXT && (e ? h.setEndAfter(f) : h.setEndBefore(f));
  8690. d = new CKEDITOR.dom.walker(h);
  8691. d.evaluator = function(d) {
  8692. if(d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) {
  8693. var f = c.clone();
  8694. c.setEndBefore(d);
  8695. c.collapsed && a.splice(b--, 1);
  8696. if(!(d.getPosition(h.endContainer) & CKEDITOR.POSITION_CONTAINS)) {
  8697. f.setStartAfter(d);
  8698. f.collapsed || a.splice(b + 1, 0, f)
  8699. }
  8700. return true
  8701. }
  8702. return false
  8703. };
  8704. d.next()
  8705. }
  8706. }
  8707. return a
  8708. }
  8709. var q, m, l = CKEDITOR.dom.walker.invisible(1),
  8710. p = function() {
  8711. function a(b) {
  8712. return function(a) {
  8713. var c = a.editor.createRange();
  8714. c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
  8715. return false
  8716. }
  8717. }
  8718. function b(a) {
  8719. return function(b) {
  8720. var c = b.editor,
  8721. d = c.createRange(),
  8722. f;
  8723. if(!(f =
  8724. d.moveToClosestEditablePosition(b.selected, a))) f = d.moveToClosestEditablePosition(b.selected, !a);
  8725. f && c.getSelection().selectRanges([d]);
  8726. c.fire("saveSnapshot");
  8727. b.selected.remove();
  8728. if(!f) {
  8729. d.moveToElementEditablePosition(c.editable());
  8730. c.getSelection().selectRanges([d])
  8731. }
  8732. c.fire("saveSnapshot");
  8733. return false
  8734. }
  8735. }
  8736. var c = a(),
  8737. d = a(1);
  8738. return {
  8739. 37: c,
  8740. 38: c,
  8741. 39: d,
  8742. 40: d,
  8743. 8: b(),
  8744. 46: b(1)
  8745. }
  8746. }();
  8747. CKEDITOR.on("instanceCreated", function(b) {
  8748. function c() {
  8749. var a = d.getSelection();
  8750. a && a.removeAllRanges()
  8751. }
  8752. var d = b.editor;
  8753. d.on("contentDom", function() {
  8754. function b() {
  8755. p =
  8756. new CKEDITOR.dom.selection(d.getSelection());
  8757. p.lock()
  8758. }
  8759. function c() {
  8760. g.removeListener("mouseup", c);
  8761. k.removeListener("mouseup", c);
  8762. var a = CKEDITOR.document.$.selection,
  8763. b = a.createRange();
  8764. a.type != "None" && b.parentElement().ownerDocument == f.$ && b.select()
  8765. }
  8766. var f = d.document,
  8767. g = CKEDITOR.document,
  8768. h = d.editable(),
  8769. i = f.getBody(),
  8770. k = f.getDocumentElement(),
  8771. m = h.isInline(),
  8772. C, p;
  8773. CKEDITOR.env.gecko && h.attachListener(h, "focus", function(a) {
  8774. a.removeListener();
  8775. if(C !== 0)
  8776. if((a = d.getSelection().getNative()) && a.isCollapsed && a.anchorNode ==
  8777. h.$) {
  8778. a = d.createRange();
  8779. a.moveToElementEditStart(h);
  8780. a.select()
  8781. }
  8782. }, null, null, -2);
  8783. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  8784. C && CKEDITOR.env.webkit && (C = d._.previousActive && d._.previousActive.equals(f.getActive()));
  8785. d.unlockSelection(C);
  8786. C = 0
  8787. }, null, null, -1);
  8788. h.attachListener(h, "mousedown", function() {
  8789. C = 0
  8790. });
  8791. if(CKEDITOR.env.ie || m) {
  8792. t ? h.attachListener(h, "beforedeactivate", b, null, null, -1) : h.attachListener(d, "selectionCheck", b, null, null, -1);
  8793. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusOut" :
  8794. "blur",
  8795. function() {
  8796. d.lockSelection(p);
  8797. C = 1
  8798. }, null, null, -1);
  8799. h.attachListener(h, "mousedown", function() {
  8800. C = 0
  8801. })
  8802. }
  8803. if(CKEDITOR.env.ie && !m) {
  8804. var s;
  8805. h.attachListener(h, "mousedown", function(a) {
  8806. if(a.data.$.button == 2) {
  8807. a = d.document.getSelection();
  8808. if(!a || a.getType() == CKEDITOR.SELECTION_NONE) s = d.window.getScrollPosition()
  8809. }
  8810. });
  8811. h.attachListener(h, "mouseup", function(a) {
  8812. if(a.data.$.button == 2 && s) {
  8813. d.document.$.documentElement.scrollLeft = s.x;
  8814. d.document.$.documentElement.scrollTop = s.y
  8815. }
  8816. s = null
  8817. });
  8818. if(f.$.compatMode != "BackCompat") {
  8819. if(CKEDITOR.env.ie7Compat ||
  8820. CKEDITOR.env.ie6Compat) k.on("mousedown", function(a) {
  8821. function b(a) {
  8822. a = a.data.$;
  8823. if(d) {
  8824. var c = i.$.createTextRange();
  8825. try {
  8826. c.moveToPoint(a.clientX, a.clientY)
  8827. } catch(f) {}
  8828. d.setEndPoint(e.compareEndPoints("StartToStart", c) < 0 ? "EndToEnd" : "StartToStart", c);
  8829. d.select()
  8830. }
  8831. }
  8832. function c() {
  8833. k.removeListener("mousemove", b);
  8834. g.removeListener("mouseup", c);
  8835. k.removeListener("mouseup", c);
  8836. d.select()
  8837. }
  8838. a = a.data;
  8839. if(a.getTarget().is("html") && a.$.y < k.$.clientHeight && a.$.x < k.$.clientWidth) {
  8840. var d = i.$.createTextRange();
  8841. try {
  8842. d.moveToPoint(a.$.clientX,
  8843. a.$.clientY)
  8844. } catch(f) {}
  8845. var e = d.duplicate();
  8846. k.on("mousemove", b);
  8847. g.on("mouseup", c);
  8848. k.on("mouseup", c)
  8849. }
  8850. });
  8851. if(CKEDITOR.env.version > 7 && CKEDITOR.env.version < 11) k.on("mousedown", function(a) {
  8852. if(a.data.getTarget().is("html")) {
  8853. g.on("mouseup", c);
  8854. k.on("mouseup", c)
  8855. }
  8856. })
  8857. }
  8858. }
  8859. h.attachListener(h, "selectionchange", a, d);
  8860. h.attachListener(h, "keyup", e, d);
  8861. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  8862. d.forceNextSelectionCheck();
  8863. d.selectionChange(1)
  8864. });
  8865. if(m && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
  8866. var l;
  8867. h.attachListener(h, "mousedown", function() {
  8868. l = 1
  8869. });
  8870. h.attachListener(f.getDocumentElement(), "mouseup", function() {
  8871. l && e.call(d);
  8872. l = 0
  8873. })
  8874. } else h.attachListener(CKEDITOR.env.ie ? h : f.getDocumentElement(), "mouseup", e, d);
  8875. CKEDITOR.env.webkit && h.attachListener(f, "keydown", function(a) {
  8876. switch(a.data.getKey()) {
  8877. case 13:
  8878. case 33:
  8879. case 34:
  8880. case 35:
  8881. case 36:
  8882. case 37:
  8883. case 39:
  8884. case 8:
  8885. case 45:
  8886. case 46:
  8887. j(h)
  8888. }
  8889. }, null, null, -1);
  8890. h.attachListener(h, "keydown", n(d), null, null, -1)
  8891. });
  8892. d.on("setData", function() {
  8893. d.unlockSelection();
  8894. CKEDITOR.env.webkit &&
  8895. c()
  8896. });
  8897. d.on("contentDomUnload", function() {
  8898. d.unlockSelection()
  8899. });
  8900. if(CKEDITOR.env.ie9Compat) d.on("beforeDestroy", c, null, null, 9);
  8901. d.on("dataReady", function() {
  8902. delete d._.fakeSelection;
  8903. delete d._.hiddenSelectionContainer;
  8904. d.selectionChange(1)
  8905. });
  8906. d.on("loadSnapshot", function() {
  8907. var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),
  8908. b = d.editable().getLast(a);
  8909. if(b && b.hasAttribute("data-cke-hidden-sel")) {
  8910. b.remove();
  8911. if(CKEDITOR.env.gecko)(a = d.editable().getFirst(a)) && (a.is("br") && a.getAttribute("_moz_editor_bogus_node")) &&
  8912. a.remove()
  8913. }
  8914. }, null, null, 100);
  8915. d.on("key", function(a) {
  8916. if(d.mode == "wysiwyg") {
  8917. var b = d.getSelection();
  8918. if(b.isFake) {
  8919. var c = p[a.data.keyCode];
  8920. if(c) return c({
  8921. editor: d,
  8922. selected: b.getSelectedElement(),
  8923. selection: b,
  8924. keyEvent: a
  8925. })
  8926. }
  8927. }
  8928. })
  8929. });
  8930. CKEDITOR.on("instanceReady", function(a) {
  8931. function b() {
  8932. var a = g.editable();
  8933. if(a)
  8934. if(a = d(a)) {
  8935. var c = g.document.$.getSelection();
  8936. if(c.type != "None" && (c.anchorNode == a.$ || c.focusNode == a.$)) k = h(c);
  8937. e = a.getText();
  8938. a.setText(f(e))
  8939. }
  8940. }
  8941. function c() {
  8942. var a = g.editable();
  8943. if(a)
  8944. if(a = d(a)) {
  8945. a.setText(e);
  8946. if(k) {
  8947. i(g.document.$,
  8948. k);
  8949. k = null
  8950. }
  8951. }
  8952. }
  8953. var g = a.editor,
  8954. e, k;
  8955. if(CKEDITOR.env.webkit) {
  8956. g.on("selectionChange", function() {
  8957. var a = g.editable(),
  8958. b = d(a);
  8959. b && (b.getCustomData("ready") ? j(a) : b.setCustomData("ready", 1))
  8960. }, null, null, -1);
  8961. g.on("beforeSetMode", function() {
  8962. j(g.editable())
  8963. }, null, null, -1);
  8964. g.on("beforeUndoImage", b);
  8965. g.on("afterUndoImage", c);
  8966. g.on("beforeGetData", b, null, null, 0);
  8967. g.on("getData", c)
  8968. }
  8969. });
  8970. CKEDITOR.editor.prototype.selectionChange = function(b) {
  8971. (b ? a : e).call(this)
  8972. };
  8973. CKEDITOR.editor.prototype.getSelection = function(a) {
  8974. if((this._.savedSelection ||
  8975. this._.fakeSelection) && !a) return this._.savedSelection || this._.fakeSelection;
  8976. return(a = this.editable()) && this.mode == "wysiwyg" ? new CKEDITOR.dom.selection(a) : null
  8977. };
  8978. CKEDITOR.editor.prototype.lockSelection = function(a) {
  8979. a = a || this.getSelection(1);
  8980. if(a.getType() != CKEDITOR.SELECTION_NONE) {
  8981. !a.isLocked && a.lock();
  8982. this._.savedSelection = a;
  8983. return true
  8984. }
  8985. return false
  8986. };
  8987. CKEDITOR.editor.prototype.unlockSelection = function(a) {
  8988. var b = this._.savedSelection;
  8989. if(b) {
  8990. b.unlock(a);
  8991. delete this._.savedSelection;
  8992. return true
  8993. }
  8994. return false
  8995. };
  8996. CKEDITOR.editor.prototype.forceNextSelectionCheck = function() {
  8997. delete this._.selectionPreviousPath
  8998. };
  8999. CKEDITOR.dom.document.prototype.getSelection = function() {
  9000. return new CKEDITOR.dom.selection(this)
  9001. };
  9002. CKEDITOR.dom.range.prototype.select = function() {
  9003. var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom.selection(this.root);
  9004. a.selectRanges([this]);
  9005. return a
  9006. };
  9007. CKEDITOR.SELECTION_NONE = 1;
  9008. CKEDITOR.SELECTION_TEXT = 2;
  9009. CKEDITOR.SELECTION_ELEMENT = 3;
  9010. var t = typeof window.getSelection !=
  9011. "function",
  9012. s = 1;
  9013. CKEDITOR.dom.selection = function(a) {
  9014. if(a instanceof CKEDITOR.dom.selection) var b = a,
  9015. a = a.root;
  9016. var c = a instanceof CKEDITOR.dom.element;
  9017. this.rev = b ? b.rev : s++;
  9018. this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
  9019. this.root = c ? a : this.document.getBody();
  9020. this.isLocked = 0;
  9021. this._ = {
  9022. cache: {}
  9023. };
  9024. if(b) {
  9025. CKEDITOR.tools.extend(this._.cache, b._.cache);
  9026. this.isFake = b.isFake;
  9027. this.isLocked = b.isLocked;
  9028. return this
  9029. }
  9030. var a = this.getNative(),
  9031. d, f;
  9032. if(a)
  9033. if(a.getRangeAt) d = (f = a.rangeCount && a.getRangeAt(0)) &&
  9034. new CKEDITOR.dom.node(f.commonAncestorContainer);
  9035. else {
  9036. try {
  9037. f = a.createRange()
  9038. } catch(g) {}
  9039. d = f && CKEDITOR.dom.element.get(f.item && f.item(0) || f.parentElement())
  9040. }
  9041. if(!d || !(d.type == CKEDITOR.NODE_ELEMENT || d.type == CKEDITOR.NODE_TEXT) || !this.root.equals(d) && !this.root.contains(d)) {
  9042. this._.cache.type = CKEDITOR.SELECTION_NONE;
  9043. this._.cache.startElement = null;
  9044. this._.cache.selectedElement = null;
  9045. this._.cache.selectedText = "";
  9046. this._.cache.ranges = new CKEDITOR.dom.rangeList
  9047. }
  9048. return this
  9049. };
  9050. var u = {
  9051. img: 1,
  9052. hr: 1,
  9053. li: 1,
  9054. table: 1,
  9055. tr: 1,
  9056. td: 1,
  9057. th: 1,
  9058. embed: 1,
  9059. object: 1,
  9060. ol: 1,
  9061. ul: 1,
  9062. a: 1,
  9063. input: 1,
  9064. form: 1,
  9065. select: 1,
  9066. textarea: 1,
  9067. button: 1,
  9068. fieldset: 1,
  9069. thead: 1,
  9070. tfoot: 1
  9071. };
  9072. CKEDITOR.dom.selection.prototype = {
  9073. getNative: function() {
  9074. return this._.cache.nativeSel !== void 0 ? this._.cache.nativeSel : this._.cache.nativeSel = t ? this.document.$.selection : this.document.getWindow().$.getSelection()
  9075. },
  9076. getType: t ? function() {
  9077. var a = this._.cache;
  9078. if(a.type) return a.type;
  9079. var b = CKEDITOR.SELECTION_NONE;
  9080. try {
  9081. var c = this.getNative(),
  9082. d = c.type;
  9083. if(d == "Text") b = CKEDITOR.SELECTION_TEXT;
  9084. if(d == "Control") b =
  9085. CKEDITOR.SELECTION_ELEMENT;
  9086. if(c.createRange().parentElement()) b = CKEDITOR.SELECTION_TEXT
  9087. } catch(f) {}
  9088. return a.type = b
  9089. } : function() {
  9090. var a = this._.cache;
  9091. if(a.type) return a.type;
  9092. var b = CKEDITOR.SELECTION_TEXT,
  9093. c = this.getNative();
  9094. if(!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
  9095. else if(c.rangeCount == 1) {
  9096. var c = c.getRangeAt(0),
  9097. d = c.startContainer;
  9098. if(d == c.endContainer && d.nodeType == 1 && c.endOffset - c.startOffset == 1 && u[d.childNodes[c.startOffset].nodeName.toLowerCase()]) b = CKEDITOR.SELECTION_ELEMENT
  9099. }
  9100. return a.type = b
  9101. },
  9102. getRanges: function() {
  9103. var a =
  9104. t ? function() {
  9105. function a(b) {
  9106. return(new CKEDITOR.dom.node(b)).getIndex()
  9107. }
  9108. var b = function(b, c) {
  9109. b = b.duplicate();
  9110. b.collapse(c);
  9111. var d = b.parentElement();
  9112. if(!d.hasChildNodes()) return {
  9113. container: d,
  9114. offset: 0
  9115. };
  9116. for(var f = d.children, g, e, h = b.duplicate(), j = 0, i = f.length - 1, k = -1, m, p; j <= i;) {
  9117. k = Math.floor((j + i) / 2);
  9118. g = f[k];
  9119. h.moveToElementText(g);
  9120. m = h.compareEndPoints("StartToStart", b);
  9121. if(m > 0) i = k - 1;
  9122. else if(m < 0) j = k + 1;
  9123. else return {
  9124. container: d,
  9125. offset: a(g)
  9126. }
  9127. }
  9128. if(k == -1 || k == f.length - 1 && m < 0) {
  9129. h.moveToElementText(d);
  9130. h.setEndPoint("StartToStart",
  9131. b);
  9132. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  9133. f = d.childNodes;
  9134. if(!h) {
  9135. g = f[f.length - 1];
  9136. return g.nodeType != CKEDITOR.NODE_TEXT ? {
  9137. container: d,
  9138. offset: f.length
  9139. } : {
  9140. container: g,
  9141. offset: g.nodeValue.length
  9142. }
  9143. }
  9144. for(d = f.length; h > 0 && d > 0;) {
  9145. e = f[--d];
  9146. if(e.nodeType == CKEDITOR.NODE_TEXT) {
  9147. p = e;
  9148. h = h - e.nodeValue.length
  9149. }
  9150. }
  9151. return {
  9152. container: p,
  9153. offset: -h
  9154. }
  9155. }
  9156. h.collapse(m > 0 ? true : false);
  9157. h.setEndPoint(m > 0 ? "StartToStart" : "EndToStart", b);
  9158. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  9159. if(!h) return {
  9160. container: d,
  9161. offset: a(g) + (m > 0 ? 0 : 1)
  9162. };
  9163. for(; h > 0;) try {
  9164. e =
  9165. g[m > 0 ? "previousSibling" : "nextSibling"];
  9166. if(e.nodeType == CKEDITOR.NODE_TEXT) {
  9167. h = h - e.nodeValue.length;
  9168. p = e
  9169. }
  9170. g = e
  9171. } catch(t) {
  9172. return {
  9173. container: d,
  9174. offset: a(g)
  9175. }
  9176. }
  9177. return {
  9178. container: p,
  9179. offset: m > 0 ? -h : p.nodeValue.length + h
  9180. }
  9181. };
  9182. return function() {
  9183. var a = this.getNative(),
  9184. c = a && a.createRange(),
  9185. d = this.getType();
  9186. if(!a) return [];
  9187. if(d == CKEDITOR.SELECTION_TEXT) {
  9188. a = new CKEDITOR.dom.range(this.root);
  9189. d = b(c, true);
  9190. a.setStart(new CKEDITOR.dom.node(d.container), d.offset);
  9191. d = b(c);
  9192. a.setEnd(new CKEDITOR.dom.node(d.container), d.offset);
  9193. a.endContainer.getPosition(a.startContainer) &
  9194. CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer.getIndex() && a.collapse();
  9195. return [a]
  9196. }
  9197. if(d == CKEDITOR.SELECTION_ELEMENT) {
  9198. for(var d = [], f = 0; f < c.length; f++) {
  9199. for(var g = c.item(f), e = g.parentNode, h = 0, a = new CKEDITOR.dom.range(this.root); h < e.childNodes.length && e.childNodes[h] != g; h++);
  9200. a.setStart(new CKEDITOR.dom.node(e), h);
  9201. a.setEnd(new CKEDITOR.dom.node(e), h + 1);
  9202. d.push(a)
  9203. }
  9204. return d
  9205. }
  9206. return []
  9207. }
  9208. }() : function() {
  9209. var a = [],
  9210. b, c = this.getNative();
  9211. if(!c) return a;
  9212. for(var d = 0; d < c.rangeCount; d++) {
  9213. var f = c.getRangeAt(d);
  9214. b = new CKEDITOR.dom.range(this.root);
  9215. b.setStart(new CKEDITOR.dom.node(f.startContainer), f.startOffset);
  9216. b.setEnd(new CKEDITOR.dom.node(f.endContainer), f.endOffset);
  9217. a.push(b)
  9218. }
  9219. return a
  9220. };
  9221. return function(b) {
  9222. var c = this._.cache,
  9223. d = c.ranges;
  9224. if(!d) c.ranges = d = new CKEDITOR.dom.rangeList(a.call(this));
  9225. return !b ? d : o(new CKEDITOR.dom.rangeList(d.slice()))
  9226. }
  9227. }(),
  9228. getStartElement: function() {
  9229. var a = this._.cache;
  9230. if(a.startElement !== void 0) return a.startElement;
  9231. var b;
  9232. switch(this.getType()) {
  9233. case CKEDITOR.SELECTION_ELEMENT:
  9234. return this.getSelectedElement();
  9235. case CKEDITOR.SELECTION_TEXT:
  9236. var c = this.getRanges()[0];
  9237. if(c) {
  9238. if(c.collapsed) {
  9239. b = c.startContainer;
  9240. b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent())
  9241. } else {
  9242. for(c.optimize();;) {
  9243. b = c.startContainer;
  9244. if(c.startOffset == (b.getChildCount ? b.getChildCount() : b.getLength()) && !b.isBlockBoundary()) c.setStartAfter(b);
  9245. else break
  9246. }
  9247. b = c.startContainer;
  9248. if(b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
  9249. b = b.getChild(c.startOffset);
  9250. if(!b || b.type != CKEDITOR.NODE_ELEMENT) b = c.startContainer;
  9251. else
  9252. for(c = b.getFirst(); c && c.type ==
  9253. CKEDITOR.NODE_ELEMENT;) {
  9254. b = c;
  9255. c = c.getFirst()
  9256. }
  9257. }
  9258. b = b.$
  9259. }
  9260. }
  9261. return a.startElement = b ? new CKEDITOR.dom.element(b) : null
  9262. },
  9263. getSelectedElement: function() {
  9264. var a = this._.cache;
  9265. if(a.selectedElement !== void 0) return a.selectedElement;
  9266. var b = this,
  9267. c = CKEDITOR.tools.tryThese(function() {
  9268. return b.getNative().createRange().item(0)
  9269. }, function() {
  9270. for(var a = b.getRanges()[0].clone(), c, d, f = 2; f && (!(c = a.getEnclosedNode()) || !(c.type == CKEDITOR.NODE_ELEMENT && u[c.getName()] && (d = c))); f--) a.shrink(CKEDITOR.SHRINK_ELEMENT);
  9271. return d && d.$
  9272. });
  9273. return a.selectedElement =
  9274. c ? new CKEDITOR.dom.element(c) : null
  9275. },
  9276. getSelectedText: function() {
  9277. var a = this._.cache;
  9278. if(a.selectedText !== void 0) return a.selectedText;
  9279. var b = this.getNative(),
  9280. b = t ? b.type == "Control" ? "" : b.createRange().text : b.toString();
  9281. return a.selectedText = b
  9282. },
  9283. lock: function() {
  9284. this.getRanges();
  9285. this.getStartElement();
  9286. this.getSelectedElement();
  9287. this.getSelectedText();
  9288. this._.cache.nativeSel = null;
  9289. this.isLocked = 1
  9290. },
  9291. unlock: function(a) {
  9292. if(this.isLocked) {
  9293. if(a) var b = this.getSelectedElement(),
  9294. c = !b && this.getRanges(),
  9295. d = this.isFake;
  9296. this.isLocked =
  9297. 0;
  9298. this.reset();
  9299. if(a)(a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 1) && (d ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c))
  9300. }
  9301. },
  9302. reset: function() {
  9303. this._.cache = {};
  9304. this.isFake = 0;
  9305. var a = this.root.editor;
  9306. if(a && a._.fakeSelection && this.rev == a._.fakeSelection.rev) {
  9307. delete a._.fakeSelection;
  9308. var b = a._.hiddenSelectionContainer;
  9309. if(b) {
  9310. var c = a.checkDirty();
  9311. a.fire("lockSnapshot");
  9312. b.remove();
  9313. a.fire("unlockSnapshot");
  9314. !c && a.resetDirty()
  9315. }
  9316. delete a._.hiddenSelectionContainer
  9317. }
  9318. this.rev = s++
  9319. },
  9320. selectElement: function(a) {
  9321. var b =
  9322. new CKEDITOR.dom.range(this.root);
  9323. b.setStartBefore(a);
  9324. b.setEndAfter(a);
  9325. this.selectRanges([b])
  9326. },
  9327. selectRanges: function(a) {
  9328. var b = this.root.editor,
  9329. b = b && b._.hiddenSelectionContainer;
  9330. this.reset();
  9331. if(b)
  9332. for(var b = this.root, d, f = 0; f < a.length; ++f) {
  9333. d = a[f];
  9334. if(d.endContainer.equals(b)) d.endOffset = Math.min(d.endOffset, b.getChildCount())
  9335. }
  9336. if(a.length)
  9337. if(this.isLocked) {
  9338. var g = CKEDITOR.document.getActive();
  9339. this.unlock();
  9340. this.selectRanges(a);
  9341. this.lock();
  9342. g && !g.equals(this.root) && g.focus()
  9343. } else {
  9344. var e;
  9345. a: {
  9346. var h, i;
  9347. if(a.length ==
  9348. 1 && !(i = a[0]).collapsed && (e = i.getEnclosedNode()) && e.type == CKEDITOR.NODE_ELEMENT) {
  9349. i = i.clone();
  9350. i.shrink(CKEDITOR.SHRINK_ELEMENT, true);
  9351. if((h = i.getEnclosedNode()) && h.type == CKEDITOR.NODE_ELEMENT) e = h;
  9352. if(e.getAttribute("contenteditable") == "false") break a
  9353. }
  9354. e = void 0
  9355. }
  9356. if(e) this.fake(e);
  9357. else {
  9358. if(t) {
  9359. i = CKEDITOR.dom.walker.whitespaces(true);
  9360. h = /\ufeff|\u00a0/;
  9361. b = {
  9362. table: 1,
  9363. tbody: 1,
  9364. tr: 1
  9365. };
  9366. if(a.length > 1) {
  9367. e = a[a.length - 1];
  9368. a[0].setEnd(e.endContainer, e.endOffset)
  9369. }
  9370. e = a[0];
  9371. var a = e.collapsed,
  9372. k, m, p;
  9373. if((d = e.getEnclosedNode()) && d.type ==
  9374. CKEDITOR.NODE_ELEMENT && d.getName() in u && (!d.is("a") || !d.getText())) try {
  9375. p = d.$.createControlRange();
  9376. p.addElement(d.$);
  9377. p.select();
  9378. return
  9379. } catch(C) {}
  9380. if(e.startContainer.type == CKEDITOR.NODE_ELEMENT && e.startContainer.getName() in b || e.endContainer.type == CKEDITOR.NODE_ELEMENT && e.endContainer.getName() in b) {
  9381. e.shrink(CKEDITOR.NODE_ELEMENT, true);
  9382. a = e.collapsed
  9383. }
  9384. p = e.createBookmark();
  9385. b = p.startNode;
  9386. if(!a) g = p.endNode;
  9387. p = e.document.$.body.createTextRange();
  9388. p.moveToElementText(b.$);
  9389. p.moveStart("character", 1);
  9390. if(g) {
  9391. h =
  9392. e.document.$.body.createTextRange();
  9393. h.moveToElementText(g.$);
  9394. p.setEndPoint("EndToEnd", h);
  9395. p.moveEnd("character", -1)
  9396. } else {
  9397. k = b.getNext(i);
  9398. m = b.hasAscendant("pre");
  9399. k = !(k && k.getText && k.getText().match(h)) && (m || !b.hasPrevious() || b.getPrevious().is && b.getPrevious().is("br"));
  9400. m = e.document.createElement("span");
  9401. m.setHtml("&#65279;");
  9402. m.insertBefore(b);
  9403. k && e.document.createText("").insertBefore(b)
  9404. }
  9405. e.setStartBefore(b);
  9406. b.remove();
  9407. if(a) {
  9408. if(k) {
  9409. p.moveStart("character", -1);
  9410. p.select();
  9411. e.document.$.selection.clear()
  9412. } else p.select();
  9413. e.moveToPosition(m, CKEDITOR.POSITION_BEFORE_START);
  9414. m.remove()
  9415. } else {
  9416. e.setEndBefore(g);
  9417. g.remove();
  9418. p.select()
  9419. }
  9420. } else {
  9421. g = this.getNative();
  9422. if(!g) return;
  9423. this.removeAllRanges();
  9424. for(p = 0; p < a.length; p++) {
  9425. if(p < a.length - 1) {
  9426. k = a[p];
  9427. m = a[p + 1];
  9428. h = k.clone();
  9429. h.setStart(k.endContainer, k.endOffset);
  9430. h.setEnd(m.startContainer, m.startOffset);
  9431. if(!h.collapsed) {
  9432. h.shrink(CKEDITOR.NODE_ELEMENT, true);
  9433. e = h.getCommonAncestor();
  9434. h = h.getEnclosedNode();
  9435. if(e.isReadOnly() || h && h.isReadOnly()) {
  9436. m.setStart(k.startContainer, k.startOffset);
  9437. a.splice(p--,
  9438. 1);
  9439. continue
  9440. }
  9441. }
  9442. }
  9443. e = a[p];
  9444. m = this.document.$.createRange();
  9445. if(e.collapsed && CKEDITOR.env.webkit && c(e)) {
  9446. k = this.root;
  9447. j(k, false);
  9448. h = k.getDocument().createText("​");
  9449. k.setCustomData("cke-fillingChar", h);
  9450. e.insertNode(h);
  9451. if((k = h.getNext()) && !h.getPrevious() && k.type == CKEDITOR.NODE_ELEMENT && k.getName() == "br") {
  9452. j(this.root);
  9453. e.moveToPosition(k, CKEDITOR.POSITION_BEFORE_START)
  9454. } else e.moveToPosition(h, CKEDITOR.POSITION_AFTER_END)
  9455. }
  9456. m.setStart(e.startContainer.$, e.startOffset);
  9457. try {
  9458. m.setEnd(e.endContainer.$, e.endOffset)
  9459. } catch(n) {
  9460. if(n.toString().indexOf("NS_ERROR_ILLEGAL_VALUE") >=
  9461. 0) {
  9462. e.collapse(1);
  9463. m.setEnd(e.endContainer.$, e.endOffset)
  9464. } else throw n;
  9465. }
  9466. g.addRange(m)
  9467. }
  9468. }
  9469. this.reset();
  9470. this.root.fire("selectionchange")
  9471. }
  9472. }
  9473. },
  9474. fake: function(a) {
  9475. var b = this.root.editor;
  9476. this.reset();
  9477. k(b);
  9478. var c = this._.cache,
  9479. d = new CKEDITOR.dom.range(this.root);
  9480. d.setStartBefore(a);
  9481. d.setEndAfter(a);
  9482. c.ranges = new CKEDITOR.dom.rangeList(d);
  9483. c.selectedElement = c.startElement = a;
  9484. c.type = CKEDITOR.SELECTION_ELEMENT;
  9485. c.selectedText = c.nativeSel = null;
  9486. this.isFake = 1;
  9487. this.rev = s++;
  9488. b._.fakeSelection = this;
  9489. this.root.fire("selectionchange")
  9490. },
  9491. isHidden: function() {
  9492. var a = this.getCommonAncestor();
  9493. a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
  9494. return !(!a || !a.data("cke-hidden-sel"))
  9495. },
  9496. createBookmarks: function(a) {
  9497. a = this.getRanges().createBookmarks(a);
  9498. this.isFake && (a.isFake = 1);
  9499. return a
  9500. },
  9501. createBookmarks2: function(a) {
  9502. a = this.getRanges().createBookmarks2(a);
  9503. this.isFake && (a.isFake = 1);
  9504. return a
  9505. },
  9506. selectBookmarks: function(a) {
  9507. for(var b = [], c = 0; c < a.length; c++) {
  9508. var d = new CKEDITOR.dom.range(this.root);
  9509. d.moveToBookmark(a[c]);
  9510. b.push(d)
  9511. }
  9512. a.isFake ? this.fake(b[0].getEnclosedNode()) :
  9513. this.selectRanges(b);
  9514. return this
  9515. },
  9516. getCommonAncestor: function() {
  9517. var a = this.getRanges();
  9518. return !a.length ? null : a[0].startContainer.getCommonAncestor(a[a.length - 1].endContainer)
  9519. },
  9520. scrollIntoView: function() {
  9521. this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView()
  9522. },
  9523. removeAllRanges: function() {
  9524. if(this.getType() != CKEDITOR.SELECTION_NONE) {
  9525. var a = this.getNative();
  9526. try {
  9527. a && a[t ? "empty" : "removeAllRanges"]()
  9528. } catch(b) {}
  9529. this.reset()
  9530. }
  9531. }
  9532. }
  9533. }(), "use strict", CKEDITOR.STYLE_BLOCK = 1, CKEDITOR.STYLE_INLINE = 2, CKEDITOR.STYLE_OBJECT =
  9534. 3,
  9535. function() {
  9536. function a(a, b) {
  9537. for(var c, d; a = a.getParent();) {
  9538. if(a.equals(b)) break;
  9539. if(a.getAttribute("data-nostyle")) c = a;
  9540. else if(!d) {
  9541. var f = a.getAttribute("contentEditable");
  9542. f == "false" ? c = a : f == "true" && (d = 1)
  9543. }
  9544. }
  9545. return c
  9546. }
  9547. function e(b) {
  9548. var c = b.document;
  9549. if(b.collapsed) {
  9550. c = p(this, c);
  9551. b.insertNode(c);
  9552. b.moveToPosition(c, CKEDITOR.POSITION_BEFORE_END)
  9553. } else {
  9554. var d = this.element,
  9555. f = this._.definition,
  9556. h, i = f.ignoreReadonly,
  9557. j = i || f.includeReadonly;
  9558. j == null && (j = b.root.getCustomData("cke_includeReadonly"));
  9559. var k = CKEDITOR.dtd[d];
  9560. if(!k) {
  9561. h = true;
  9562. k = CKEDITOR.dtd.span
  9563. }
  9564. b.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  9565. b.trim();
  9566. var m = b.createBookmark(),
  9567. t = m.startNode,
  9568. n = m.endNode,
  9569. s = t,
  9570. l;
  9571. if(!i) {
  9572. var o = b.getCommonAncestor(),
  9573. i = a(t, o),
  9574. o = a(n, o);
  9575. i && (s = i.getNextSourceNode(true));
  9576. o && (n = o)
  9577. }
  9578. for(s.getPosition(n) == CKEDITOR.POSITION_FOLLOWING && (s = 0); s;) {
  9579. i = false;
  9580. if(s.equals(n)) {
  9581. s = null;
  9582. i = true
  9583. } else {
  9584. var u = s.type == CKEDITOR.NODE_ELEMENT ? s.getName() : null,
  9585. o = u && s.getAttribute("contentEditable") == "false",
  9586. w = u && s.getAttribute("data-nostyle");
  9587. if(u && s.data("cke-bookmark")) {
  9588. s =
  9589. s.getNextSourceNode(true);
  9590. continue
  9591. }
  9592. if(o && j && CKEDITOR.dtd.$block[u])
  9593. for(var x = s, r = g(x), v = void 0, z = r.length, y = 0, x = z && new CKEDITOR.dom.range(x.getDocument()); y < z; ++y) {
  9594. var v = r[y],
  9595. A = CKEDITOR.filter.instances[v.data("cke-filter")];
  9596. if(A ? A.check(this) : 1) {
  9597. x.selectNodeContents(v);
  9598. e.call(this, x)
  9599. }
  9600. }
  9601. r = u ? !k[u] || w ? 0 : o && !j ? 0 : (s.getPosition(n) | G) == G && (!f.childRule || f.childRule(s)) : 1;
  9602. if(r)
  9603. if((r = s.getParent()) && ((r.getDtd() || CKEDITOR.dtd.span)[d] || h) && (!f.parentRule || f.parentRule(r))) {
  9604. if(!l && (!u || !CKEDITOR.dtd.$removeEmpty[u] ||
  9605. (s.getPosition(n) | G) == G)) {
  9606. l = b.clone();
  9607. l.setStartBefore(s)
  9608. }
  9609. u = s.type;
  9610. if(u == CKEDITOR.NODE_TEXT || o || u == CKEDITOR.NODE_ELEMENT && !s.getChildCount()) {
  9611. for(var u = s, aa;
  9612. (i = !u.getNext(B)) && (aa = u.getParent(), k[aa.getName()]) && (aa.getPosition(t) | D) == D && (!f.childRule || f.childRule(aa));) u = aa;
  9613. l.setEndAfter(u)
  9614. }
  9615. } else i = true;
  9616. else i = true;
  9617. s = s.getNextSourceNode(w || o)
  9618. }
  9619. if(i && l && !l.collapsed) {
  9620. for(var i = p(this, c), o = i.hasAttributes(), w = l.getCommonAncestor(), u = {}, r = {}, v = {}, z = {}, U, $, ca; i && w;) {
  9621. if(w.getName() == d) {
  9622. for(U in f.attributes)
  9623. if(!z[U] &&
  9624. (ca = w.getAttribute($))) i.getAttribute(U) == ca ? r[U] = 1 : z[U] = 1;
  9625. for($ in f.styles)
  9626. if(!v[$] && (ca = w.getStyle($))) i.getStyle($) == ca ? u[$] = 1 : v[$] = 1
  9627. }
  9628. w = w.getParent()
  9629. }
  9630. for(U in r) i.removeAttribute(U);
  9631. for($ in u) i.removeStyle($);
  9632. o && !i.hasAttributes() && (i = null);
  9633. if(i) {
  9634. l.extractContents().appendTo(i);
  9635. l.insertNode(i);
  9636. q.call(this, i);
  9637. i.mergeSiblings();
  9638. CKEDITOR.env.ie || i.$.normalize()
  9639. } else {
  9640. i = new CKEDITOR.dom.element("span");
  9641. l.extractContents().appendTo(i);
  9642. l.insertNode(i);
  9643. q.call(this, i);
  9644. i.remove(true)
  9645. }
  9646. l = null
  9647. }
  9648. }
  9649. b.moveToBookmark(m);
  9650. b.shrink(CKEDITOR.SHRINK_TEXT);
  9651. b.shrink(CKEDITOR.NODE_ELEMENT, true)
  9652. }
  9653. }
  9654. function b(a) {
  9655. function b() {
  9656. for(var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(j.getParent()), f = null, g = null, e = 0; e < a.elements.length; e++) {
  9657. var h = a.elements[e];
  9658. if(h == a.block || h == a.blockLimit) break;
  9659. k.checkElementRemovable(h, true) && (f = h)
  9660. }
  9661. for(e = 0; e < c.elements.length; e++) {
  9662. h = c.elements[e];
  9663. if(h == c.block || h == c.blockLimit) break;
  9664. k.checkElementRemovable(h, true) && (g = h)
  9665. }
  9666. g && j.breakParent(g);
  9667. f && d.breakParent(f)
  9668. }
  9669. a.enlarge(CKEDITOR.ENLARGE_INLINE,
  9670. 1);
  9671. var c = a.createBookmark(),
  9672. d = c.startNode;
  9673. if(a.collapsed) {
  9674. for(var f = new CKEDITOR.dom.elementPath(d.getParent(), a.root), g, e = 0, h; e < f.elements.length && (h = f.elements[e]); e++) {
  9675. if(h == f.block || h == f.blockLimit) break;
  9676. if(this.checkElementRemovable(h)) {
  9677. var i;
  9678. if(a.collapsed && (a.checkBoundaryOfElement(h, CKEDITOR.END) || (i = a.checkBoundaryOfElement(h, CKEDITOR.START)))) {
  9679. g = h;
  9680. g.match = i ? "start" : "end"
  9681. } else {
  9682. h.mergeSiblings();
  9683. h.is(this.element) ? o.call(this, h) : m(h, u(this)[h.getName()])
  9684. }
  9685. }
  9686. }
  9687. if(g) {
  9688. h = d;
  9689. for(e = 0;; e++) {
  9690. i = f.elements[e];
  9691. if(i.equals(g)) break;
  9692. else if(i.match) continue;
  9693. else i = i.clone();
  9694. i.append(h);
  9695. h = i
  9696. }
  9697. h[g.match == "start" ? "insertBefore" : "insertAfter"](g)
  9698. }
  9699. } else {
  9700. var j = c.endNode,
  9701. k = this;
  9702. b();
  9703. for(f = d; !f.equals(j);) {
  9704. g = f.getNextSourceNode();
  9705. if(f.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(f)) {
  9706. f.getName() == this.element ? o.call(this, f) : m(f, u(this)[f.getName()]);
  9707. if(g.type == CKEDITOR.NODE_ELEMENT && g.contains(d)) {
  9708. b();
  9709. g = d.getNext()
  9710. }
  9711. }
  9712. f = g
  9713. }
  9714. }
  9715. a.moveToBookmark(c);
  9716. a.shrink(CKEDITOR.NODE_ELEMENT, true)
  9717. }
  9718. function g(a) {
  9719. var b = [];
  9720. a.forEach(function(a) {
  9721. if(a.getAttribute("contenteditable") ==
  9722. "true") {
  9723. b.push(a);
  9724. return false
  9725. }
  9726. }, CKEDITOR.NODE_ELEMENT, true);
  9727. return b
  9728. }
  9729. function c(a) {
  9730. var b = a.getEnclosedNode() || a.getCommonAncestor(false, true);
  9731. (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && t(a, this)
  9732. }
  9733. function d(a) {
  9734. var b = a.getCommonAncestor(true, true);
  9735. if(a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) {
  9736. var b = this._.definition,
  9737. c = b.attributes;
  9738. if(c)
  9739. for(var d in c) a.removeAttribute(d, c[d]);
  9740. if(b.styles)
  9741. for(var f in b.styles) b.styles.hasOwnProperty(f) &&
  9742. a.removeStyle(f)
  9743. }
  9744. }
  9745. function j(a) {
  9746. var b = a.createBookmark(true),
  9747. c = a.createIterator();
  9748. c.enforceRealBlocks = true;
  9749. if(this._.enterMode) c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  9750. for(var d, f = a.document, g; d = c.getNextParagraph();)
  9751. if(!d.isReadOnly() && (c.activeFilter ? c.activeFilter.check(this) : 1)) {
  9752. g = p(this, f, d);
  9753. h(d, g)
  9754. }
  9755. a.moveToBookmark(b)
  9756. }
  9757. function f(a) {
  9758. var b = a.createBookmark(1),
  9759. c = a.createIterator();
  9760. c.enforceRealBlocks = true;
  9761. c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  9762. for(var d, f; d = c.getNextParagraph();)
  9763. if(this.checkElementRemovable(d))
  9764. if(d.is("pre")) {
  9765. (f =
  9766. this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div")) && d.copyAttributes(f);
  9767. h(d, f)
  9768. } else o.call(this, d);
  9769. a.moveToBookmark(b)
  9770. }
  9771. function h(a, b) {
  9772. var c = !b;
  9773. if(c) {
  9774. b = a.getDocument().createElement("div");
  9775. a.copyAttributes(b)
  9776. }
  9777. var d = b && b.is("pre"),
  9778. f = a.is("pre"),
  9779. g = !d && f;
  9780. if(d && !f) {
  9781. f = b;
  9782. (g = a.getBogus()) && g.remove();
  9783. g = a.getHtml();
  9784. g = k(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
  9785. g = g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
  9786. g = g.replace(/([ \t\n\r]+|&nbsp;)/g,
  9787. " ");
  9788. g = g.replace(/<br\b[^>]*>/gi, "\n");
  9789. if(CKEDITOR.env.ie) {
  9790. var e = a.getDocument().createElement("div");
  9791. e.append(f);
  9792. f.$.outerHTML = "<pre>" + g + "</pre>";
  9793. f.copyAttributes(e.getFirst());
  9794. f = e.getFirst().remove()
  9795. } else f.setHtml(g);
  9796. b = f
  9797. } else g ? b = n(c ? [a.getHtml()] : i(a), b) : a.moveChildren(b);
  9798. b.replace(a);
  9799. if(d) {
  9800. var c = b,
  9801. h;
  9802. if((h = c.getPrevious(A)) && h.type == CKEDITOR.NODE_ELEMENT && h.is("pre")) {
  9803. d = k(h.getHtml(), /\n$/, "") + "\n\n" + k(c.getHtml(), /^\n/, "");
  9804. CKEDITOR.env.ie ? c.$.outerHTML = "<pre>" + d + "</pre>" : c.setHtml(d);
  9805. h.remove()
  9806. }
  9807. } else c &&
  9808. l(b)
  9809. }
  9810. function i(a) {
  9811. var b = [];
  9812. k(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) {
  9813. return b + "</pre>" + c + "<pre>"
  9814. }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function(a, c) {
  9815. b.push(c)
  9816. });
  9817. return b
  9818. }
  9819. function k(a, b, c) {
  9820. var d = "",
  9821. f = "",
  9822. a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function(a, b, c) {
  9823. b && (d = b);
  9824. c && (f = c);
  9825. return ""
  9826. });
  9827. return d + a.replace(b, c) + f
  9828. }
  9829. function n(a, b) {
  9830. var c;
  9831. a.length > 1 && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
  9832. for(var d = 0; d < a.length; d++) {
  9833. var f = a[d],
  9834. f = f.replace(/(\r\n|\r)/g, "\n"),
  9835. f = k(f, /^[ \t]*\n/, ""),
  9836. f = k(f, /\n$/, ""),
  9837. f = k(f, /^[ \t]+|[ \t]+$/g, function(a, b) {
  9838. return a.length == 1 ? "&nbsp;" : b ? " " + CKEDITOR.tools.repeat("&nbsp;", a.length - 1) : CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " "
  9839. }),
  9840. f = f.replace(/\n/g, "<br>"),
  9841. f = f.replace(/[ \t]{2,}/g, function(a) {
  9842. return CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " "
  9843. });
  9844. if(c) {
  9845. var g = b.clone();
  9846. g.setHtml(f);
  9847. c.append(g)
  9848. } else b.setHtml(f)
  9849. }
  9850. return c || b
  9851. }
  9852. function o(a, b) {
  9853. var c = this._.definition,
  9854. d = c.attributes,
  9855. c = c.styles,
  9856. f = u(this)[a.getName()],
  9857. g = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c),
  9858. e;
  9859. for(e in d)
  9860. if(!((e == "class" || this._.definition.fullMatch) && a.getAttribute(e) != w(e, d[e])) && !(b && e.slice(0, 5) == "data-")) {
  9861. g = a.hasAttribute(e);
  9862. a.removeAttribute(e)
  9863. }
  9864. for(var h in c)
  9865. if(!(this._.definition.fullMatch && a.getStyle(h) != w(h, c[h], true))) {
  9866. g = g || !!a.getStyle(h);
  9867. a.removeStyle(h)
  9868. }
  9869. m(a, f, v[a.getName()]);
  9870. g && (this._.definition.alwaysRemoveElement ? l(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode ==
  9871. CKEDITOR.ENTER_BR && !a.hasAttributes() ? l(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div"))
  9872. }
  9873. function q(a) {
  9874. for(var b = u(this), c = a.getElementsByTag(this.element), d, f = c.count(); --f >= 0;) {
  9875. d = c.getItem(f);
  9876. d.isReadOnly() || o.call(this, d, true)
  9877. }
  9878. for(var g in b)
  9879. if(g != this.element) {
  9880. c = a.getElementsByTag(g);
  9881. for(f = c.count() - 1; f >= 0; f--) {
  9882. d = c.getItem(f);
  9883. d.isReadOnly() || m(d, b[g])
  9884. }
  9885. }
  9886. }
  9887. function m(a, b, c) {
  9888. if(b = b && b.attributes)
  9889. for(var d = 0; d < b.length; d++) {
  9890. var f = b[d][0],
  9891. g;
  9892. if(g = a.getAttribute(f)) {
  9893. var e = b[d][1];
  9894. (e === null ||
  9895. e.test && e.test(g) || typeof e == "string" && g == e) && a.removeAttribute(f)
  9896. }
  9897. }
  9898. c || l(a)
  9899. }
  9900. function l(a, b) {
  9901. if(!a.hasAttributes() || b)
  9902. if(CKEDITOR.dtd.$block[a.getName()]) {
  9903. var c = a.getPrevious(A),
  9904. d = a.getNext(A);
  9905. c && (c.type == CKEDITOR.NODE_TEXT || !c.isBlockBoundary({
  9906. br: 1
  9907. })) && a.append("br", 1);
  9908. d && (d.type == CKEDITOR.NODE_TEXT || !d.isBlockBoundary({
  9909. br: 1
  9910. })) && a.append("br");
  9911. a.remove(true)
  9912. } else {
  9913. c = a.getFirst();
  9914. d = a.getLast();
  9915. a.remove(true);
  9916. if(c) {
  9917. c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings();
  9918. d && (!c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT) &&
  9919. d.mergeSiblings()
  9920. }
  9921. }
  9922. }
  9923. function p(a, b, c) {
  9924. var d;
  9925. d = a.element;
  9926. d == "*" && (d = "span");
  9927. d = new CKEDITOR.dom.element(d, b);
  9928. c && c.copyAttributes(d);
  9929. d = t(d, a);
  9930. b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style", 1);
  9931. return d
  9932. }
  9933. function t(a, b) {
  9934. var c = b._.definition,
  9935. d = c.attributes,
  9936. c = CKEDITOR.style.getStyleText(c);
  9937. if(d)
  9938. for(var f in d) a.setAttribute(f, d[f]);
  9939. c && a.setAttribute("style", c);
  9940. return a
  9941. }
  9942. function s(a, b) {
  9943. for(var c in a) a[c] = a[c].replace(z, function(a,
  9944. c) {
  9945. return b[c]
  9946. })
  9947. }
  9948. function u(a) {
  9949. if(a._.overrides) return a._.overrides;
  9950. var b = a._.overrides = {},
  9951. c = a._.definition.overrides;
  9952. if(c) {
  9953. CKEDITOR.tools.isArray(c) || (c = [c]);
  9954. for(var d = 0; d < c.length; d++) {
  9955. var f = c[d],
  9956. g, e;
  9957. if(typeof f == "string") g = f.toLowerCase();
  9958. else {
  9959. g = f.element ? f.element.toLowerCase() : a.element;
  9960. e = f.attributes
  9961. }
  9962. f = b[g] || (b[g] = {});
  9963. if(e) {
  9964. var f = f.attributes = f.attributes || [],
  9965. h;
  9966. for(h in e) f.push([h.toLowerCase(), e[h]])
  9967. }
  9968. }
  9969. }
  9970. return b
  9971. }
  9972. function w(a, b, c) {
  9973. var d = new CKEDITOR.dom.element("span");
  9974. d[c ? "setStyle" : "setAttribute"](a,
  9975. b);
  9976. return d[c ? "getStyle" : "getAttribute"](a)
  9977. }
  9978. function x(a, b, c) {
  9979. for(var d = a.document, f = a.getRanges(), b = b ? this.removeFromRange : this.applyToRange, g, e = f.createIterator(); g = e.getNextRange();) b.call(this, g, c);
  9980. a.selectRanges(f);
  9981. d.removeCustomData("doc_processing_style")
  9982. }
  9983. var v = {
  9984. address: 1,
  9985. div: 1,
  9986. h1: 1,
  9987. h2: 1,
  9988. h3: 1,
  9989. h4: 1,
  9990. h5: 1,
  9991. h6: 1,
  9992. p: 1,
  9993. pre: 1,
  9994. section: 1,
  9995. header: 1,
  9996. footer: 1,
  9997. nav: 1,
  9998. article: 1,
  9999. aside: 1,
  10000. figure: 1,
  10001. dialog: 1,
  10002. hgroup: 1,
  10003. time: 1,
  10004. meter: 1,
  10005. menu: 1,
  10006. command: 1,
  10007. keygen: 1,
  10008. output: 1,
  10009. progress: 1,
  10010. details: 1,
  10011. datagrid: 1,
  10012. datalist: 1
  10013. },
  10014. r = {
  10015. a: 1,
  10016. blockquote: 1,
  10017. embed: 1,
  10018. hr: 1,
  10019. img: 1,
  10020. li: 1,
  10021. object: 1,
  10022. ol: 1,
  10023. table: 1,
  10024. td: 1,
  10025. tr: 1,
  10026. th: 1,
  10027. ul: 1,
  10028. dl: 1,
  10029. dt: 1,
  10030. dd: 1,
  10031. form: 1,
  10032. audio: 1,
  10033. video: 1
  10034. },
  10035. y = /\s*(?:;\s*|$)/,
  10036. z = /#\((.+?)\)/g,
  10037. B = CKEDITOR.dom.walker.bookmark(0, 1),
  10038. A = CKEDITOR.dom.walker.whitespaces(1);
  10039. CKEDITOR.style = function(a, b) {
  10040. if(typeof a.type == "string") return new CKEDITOR.style.customHandlers[a.type](a);
  10041. var c = a.attributes;
  10042. if(c && c.style) {
  10043. a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style));
  10044. delete c.style
  10045. }
  10046. if(b) {
  10047. a = CKEDITOR.tools.clone(a);
  10048. s(a.attributes,
  10049. b);
  10050. s(a.styles, b)
  10051. }
  10052. c = this.element = a.element ? typeof a.element == "string" ? a.element.toLowerCase() : a.element : "*";
  10053. this.type = a.type || (v[c] ? CKEDITOR.STYLE_BLOCK : r[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
  10054. if(typeof this.element == "object") this.type = CKEDITOR.STYLE_OBJECT;
  10055. this._ = {
  10056. definition: a
  10057. }
  10058. };
  10059. CKEDITOR.style.prototype = {
  10060. apply: function(a) {
  10061. if(a instanceof CKEDITOR.dom.document) return x.call(this, a.getSelection());
  10062. if(this.checkApplicable(a.elementPath(), a)) {
  10063. var b = this._.enterMode;
  10064. if(!b) this._.enterMode = a.activeEnterMode;
  10065. x.call(this, a.getSelection(), 0, a);
  10066. this._.enterMode = b
  10067. }
  10068. },
  10069. remove: function(a) {
  10070. if(a instanceof CKEDITOR.dom.document) return x.call(this, a.getSelection(), 1);
  10071. if(this.checkApplicable(a.elementPath(), a)) {
  10072. var b = this._.enterMode;
  10073. if(!b) this._.enterMode = a.activeEnterMode;
  10074. x.call(this, a.getSelection(), 1, a);
  10075. this._.enterMode = b
  10076. }
  10077. },
  10078. applyToRange: function(a) {
  10079. this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? e : this.type == CKEDITOR.STYLE_BLOCK ? j : this.type == CKEDITOR.STYLE_OBJECT ? c : null;
  10080. return this.applyToRange(a)
  10081. },
  10082. removeFromRange: function(a) {
  10083. this.removeFromRange =
  10084. this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? f : this.type == CKEDITOR.STYLE_OBJECT ? d : null;
  10085. return this.removeFromRange(a)
  10086. },
  10087. applyToObject: function(a) {
  10088. t(a, this)
  10089. },
  10090. checkActive: function(a, b) {
  10091. switch(this.type) {
  10092. case CKEDITOR.STYLE_BLOCK:
  10093. return this.checkElementRemovable(a.block || a.blockLimit, true, b);
  10094. case CKEDITOR.STYLE_OBJECT:
  10095. case CKEDITOR.STYLE_INLINE:
  10096. for(var c = a.elements, d = 0, f; d < c.length; d++) {
  10097. f = c[d];
  10098. if(!(this.type == CKEDITOR.STYLE_INLINE && (f == a.block || f == a.blockLimit))) {
  10099. if(this.type ==
  10100. CKEDITOR.STYLE_OBJECT) {
  10101. var g = f.getName();
  10102. if(!(typeof this.element == "string" ? g == this.element : g in this.element)) continue
  10103. }
  10104. if(this.checkElementRemovable(f, true, b)) return true
  10105. }
  10106. }
  10107. }
  10108. return false
  10109. },
  10110. checkApplicable: function(a, b, c) {
  10111. b && b instanceof CKEDITOR.filter && (c = b);
  10112. if(c && !c.check(this)) return false;
  10113. switch(this.type) {
  10114. case CKEDITOR.STYLE_OBJECT:
  10115. return !!a.contains(this.element);
  10116. case CKEDITOR.STYLE_BLOCK:
  10117. return !!a.blockLimit.getDtd()[this.element]
  10118. }
  10119. return true
  10120. },
  10121. checkElementMatch: function(a, b) {
  10122. var c = this._.definition;
  10123. if(!a || !c.ignoreReadonly && a.isReadOnly()) return false;
  10124. var d = a.getName();
  10125. if(typeof this.element == "string" ? d == this.element : d in this.element) {
  10126. if(!b && !a.hasAttributes()) return true;
  10127. if(d = c._AC) c = d;
  10128. else {
  10129. var d = {},
  10130. f = 0,
  10131. g = c.attributes;
  10132. if(g)
  10133. for(var e in g) {
  10134. f++;
  10135. d[e] = g[e]
  10136. }
  10137. if(e = CKEDITOR.style.getStyleText(c)) {
  10138. d.style || f++;
  10139. d.style = e
  10140. }
  10141. d._length = f;
  10142. c = c._AC = d
  10143. }
  10144. if(c._length) {
  10145. for(var h in c)
  10146. if(h != "_length") {
  10147. f = a.getAttribute(h) || "";
  10148. if(h == "style") a: {
  10149. d = c[h];typeof d == "string" && (d = CKEDITOR.tools.parseCssText(d));typeof f ==
  10150. "string" && (f = CKEDITOR.tools.parseCssText(f, true));e = void 0;
  10151. for(e in d)
  10152. if(!(e in f && (f[e] == d[e] || d[e] == "inherit" || f[e] == "inherit"))) {
  10153. d = false;
  10154. break a
  10155. }
  10156. d = true
  10157. }
  10158. else d = c[h] == f;
  10159. if(d) {
  10160. if(!b) return true
  10161. } else if(b) return false
  10162. }
  10163. if(b) return true
  10164. } else return true
  10165. }
  10166. return false
  10167. },
  10168. checkElementRemovable: function(a, b, c) {
  10169. if(this.checkElementMatch(a, b, c)) return true;
  10170. if(b = u(this)[a.getName()]) {
  10171. var d;
  10172. if(!(b = b.attributes)) return true;
  10173. for(c = 0; c < b.length; c++) {
  10174. d = b[c][0];
  10175. if(d = a.getAttribute(d)) {
  10176. var f = b[c][1];
  10177. if(f === null) return true;
  10178. if(typeof f == "string") {
  10179. if(d == f) return true
  10180. } else if(f.test(d)) return true
  10181. }
  10182. }
  10183. }
  10184. return false
  10185. },
  10186. buildPreview: function(a) {
  10187. var b = this._.definition,
  10188. c = [],
  10189. d = b.element;
  10190. d == "bdo" && (d = "span");
  10191. var c = ["<", d],
  10192. f = b.attributes;
  10193. if(f)
  10194. for(var g in f) c.push(" ", g, '="', f[g], '"');
  10195. (f = CKEDITOR.style.getStyleText(b)) && c.push(' style="', f, '"');
  10196. c.push(">", a || b.name, "</", d, ">");
  10197. return c.join("")
  10198. },
  10199. getDefinition: function() {
  10200. return this._.definition
  10201. }
  10202. };
  10203. CKEDITOR.style.getStyleText = function(a) {
  10204. var b = a._ST;
  10205. if(b) return b;
  10206. var b = a.styles,
  10207. c =
  10208. a.attributes && a.attributes.style || "",
  10209. d = "";
  10210. c.length && (c = c.replace(y, ";"));
  10211. for(var f in b) {
  10212. var g = b[f],
  10213. e = (f + ":" + g).replace(y, ";");
  10214. g == "inherit" ? d = d + e : c = c + e
  10215. }
  10216. c.length && (c = CKEDITOR.tools.normalizeCssText(c, true));
  10217. return a._ST = c + d
  10218. };
  10219. CKEDITOR.style.customHandlers = {};
  10220. CKEDITOR.style.addCustomHandler = function(a) {
  10221. var b = function(a) {
  10222. this._ = {
  10223. definition: a
  10224. };
  10225. this.setup && this.setup(a)
  10226. };
  10227. b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), {
  10228. assignedTo: CKEDITOR.STYLE_OBJECT
  10229. }, a, true);
  10230. return this.customHandlers[a.type] = b
  10231. };
  10232. var G = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
  10233. D = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
  10234. }(), CKEDITOR.styleCommand = function(a, e) {
  10235. this.requiredContent = this.allowedContent = this.style = a;
  10236. CKEDITOR.tools.extend(this, e, true)
  10237. }, CKEDITOR.styleCommand.prototype.exec = function(a) {
  10238. a.focus();
  10239. this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON &&
  10240. a.removeStyle(this.style)
  10241. }, CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet"), CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet), CKEDITOR.loadStylesSet = function(a, e, b) {
  10242. CKEDITOR.stylesSet.addExternal(a, e, "");
  10243. CKEDITOR.stylesSet.load(a, b)
  10244. }, CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  10245. attachStyleStateChange: function(a, e) {
  10246. var b = this._.styleStateChangeCallbacks;
  10247. if(!b) {
  10248. b = this._.styleStateChangeCallbacks = [];
  10249. this.on("selectionChange", function(a) {
  10250. for(var c =
  10251. 0; c < b.length; c++) {
  10252. var d = b[c],
  10253. e = d.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
  10254. d.fn.call(this, e)
  10255. }
  10256. })
  10257. }
  10258. b.push({
  10259. style: a,
  10260. fn: e
  10261. })
  10262. },
  10263. applyStyle: function(a) {
  10264. a.apply(this)
  10265. },
  10266. removeStyle: function(a) {
  10267. a.remove(this)
  10268. },
  10269. getStylesSet: function(a) {
  10270. if(this._.stylesDefinitions) a(this._.stylesDefinitions);
  10271. else {
  10272. var e = this,
  10273. b = e.config.stylesCombo_stylesSet || e.config.stylesSet;
  10274. if(b === false) a(null);
  10275. else if(b instanceof Array) {
  10276. e._.stylesDefinitions = b;
  10277. a(b)
  10278. } else {
  10279. b || (b = "default");
  10280. var b = b.split(":"),
  10281. g = b[0];
  10282. CKEDITOR.stylesSet.addExternal(g, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
  10283. CKEDITOR.stylesSet.load(g, function(b) {
  10284. e._.stylesDefinitions = b[g];
  10285. a(e._.stylesDefinitions)
  10286. })
  10287. }
  10288. }
  10289. }
  10290. }), CKEDITOR.dom.comment = function(a, e) {
  10291. typeof a == "string" && (a = (e ? e.$ : document).createComment(a));
  10292. CKEDITOR.dom.domObject.call(this, a)
  10293. }, CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node, CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
  10294. type: CKEDITOR.NODE_COMMENT,
  10295. getOuterHtml: function() {
  10296. return "<\!--" + this.$.nodeValue +
  10297. "--\>"
  10298. }
  10299. }), "use strict",
  10300. function() {
  10301. var a = {},
  10302. e = {},
  10303. b;
  10304. for(b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1);
  10305. for(b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (e[b] = 1);
  10306. CKEDITOR.dom.elementPath = function(b, c) {
  10307. var d = null,
  10308. j = null,
  10309. f = [],
  10310. h = b,
  10311. i, c = c || b.getDocument().getBody();
  10312. do
  10313. if(h.type == CKEDITOR.NODE_ELEMENT) {
  10314. f.push(h);
  10315. if(!this.lastElement) {
  10316. this.lastElement = h;
  10317. if(h.is(CKEDITOR.dtd.$object) || h.getAttribute("contenteditable") == "false") continue
  10318. }
  10319. if(h.equals(c)) break;
  10320. if(!j) {
  10321. i = h.getName();
  10322. h.getAttribute("contenteditable") == "true" ? j = h : !d && e[i] && (d = h);
  10323. if(a[i]) {
  10324. var k;
  10325. if(k = !d) {
  10326. if(i = i == "div") {
  10327. a: {
  10328. i = h.getChildren();k = 0;
  10329. for(var n = i.count(); k < n; k++) {
  10330. var o = i.getItem(k);
  10331. if(o.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[o.getName()]) {
  10332. i = true;
  10333. break a
  10334. }
  10335. }
  10336. i = false
  10337. }
  10338. i = !i
  10339. }
  10340. k = i
  10341. }
  10342. k ? d = h : j = h
  10343. }
  10344. }
  10345. }
  10346. while(h = h.getParent());
  10347. j || (j = c);
  10348. this.block = d;
  10349. this.blockLimit = j;
  10350. this.root = c;
  10351. this.elements = f
  10352. }
  10353. }(), CKEDITOR.dom.elementPath.prototype = {
  10354. compare: function(a) {
  10355. var e = this.elements,
  10356. a = a && a.elements;
  10357. if(!a ||
  10358. e.length != a.length) return false;
  10359. for(var b = 0; b < e.length; b++)
  10360. if(!e[b].equals(a[b])) return false;
  10361. return true
  10362. },
  10363. contains: function(a, e, b) {
  10364. var g;
  10365. typeof a == "string" && (g = function(b) {
  10366. return b.getName() == a
  10367. });
  10368. a instanceof CKEDITOR.dom.element ? g = function(b) {
  10369. return b.equals(a)
  10370. } : CKEDITOR.tools.isArray(a) ? g = function(b) {
  10371. return CKEDITOR.tools.indexOf(a, b.getName()) > -1
  10372. } : typeof a == "function" ? g = a : typeof a == "object" && (g = function(b) {
  10373. return b.getName() in a
  10374. });
  10375. var c = this.elements,
  10376. d = c.length;
  10377. e && d--;
  10378. if(b) {
  10379. c = Array.prototype.slice.call(c,
  10380. 0);
  10381. c.reverse()
  10382. }
  10383. for(e = 0; e < d; e++)
  10384. if(g(c[e])) return c[e];
  10385. return null
  10386. },
  10387. isContextFor: function(a) {
  10388. var e;
  10389. if(a in CKEDITOR.dtd.$block) {
  10390. e = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this.block) && this.block || this.blockLimit;
  10391. return !!e.getDtd()[a]
  10392. }
  10393. return true
  10394. },
  10395. direction: function() {
  10396. return(this.block || this.blockLimit || this.root).getDirection(1)
  10397. }
  10398. }, CKEDITOR.dom.text = function(a, e) {
  10399. typeof a == "string" && (a = (e ? e.$ : document).createTextNode(a));
  10400. this.$ = a
  10401. }, CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node,
  10402. CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
  10403. type: CKEDITOR.NODE_TEXT,
  10404. getLength: function() {
  10405. return this.$.nodeValue.length
  10406. },
  10407. getText: function() {
  10408. return this.$.nodeValue
  10409. },
  10410. setText: function(a) {
  10411. this.$.nodeValue = a
  10412. },
  10413. split: function(a) {
  10414. var e = this.$.parentNode,
  10415. b = e.childNodes.length,
  10416. g = this.getLength(),
  10417. c = this.getDocument(),
  10418. d = new CKEDITOR.dom.text(this.$.splitText(a), c);
  10419. if(e.childNodes.length == b)
  10420. if(a >= g) {
  10421. d = c.createText("");
  10422. d.insertAfter(this)
  10423. } else {
  10424. a = c.createText("");
  10425. a.insertAfter(d);
  10426. a.remove()
  10427. }
  10428. return d
  10429. },
  10430. substring: function(a,
  10431. e) {
  10432. return typeof e != "number" ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, e)
  10433. }
  10434. }),
  10435. function() {
  10436. function a(a, g, c) {
  10437. var d = a.serializable,
  10438. e = g[c ? "endContainer" : "startContainer"],
  10439. f = c ? "endOffset" : "startOffset",
  10440. h = d ? g.document.getById(a.startNode) : a.startNode,
  10441. a = d ? g.document.getById(a.endNode) : a.endNode;
  10442. if(e.equals(h.getPrevious())) {
  10443. g.startOffset = g.startOffset - e.getLength() - a.getPrevious().getLength();
  10444. e = a.getNext()
  10445. } else if(e.equals(a.getPrevious())) {
  10446. g.startOffset = g.startOffset - e.getLength();
  10447. e = a.getNext()
  10448. }
  10449. e.equals(h.getParent()) &&
  10450. g[f]++;
  10451. e.equals(a.getParent()) && g[f]++;
  10452. g[c ? "endContainer" : "startContainer"] = e;
  10453. return g
  10454. }
  10455. CKEDITOR.dom.rangeList = function(a) {
  10456. if(a instanceof CKEDITOR.dom.rangeList) return a;
  10457. a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = [];
  10458. return CKEDITOR.tools.extend(a, e)
  10459. };
  10460. var e = {
  10461. createIterator: function() {
  10462. var a = this,
  10463. g = CKEDITOR.dom.walker.bookmark(),
  10464. c = [],
  10465. d;
  10466. return {
  10467. getNextRange: function(e) {
  10468. d = d === void 0 ? 0 : d + 1;
  10469. var f = a[d];
  10470. if(f && a.length > 1) {
  10471. if(!d)
  10472. for(var h = a.length - 1; h >= 0; h--) c.unshift(a[h].createBookmark(true));
  10473. if(e)
  10474. for(var i =
  10475. 0; a[d + i + 1];) {
  10476. for(var k = f.document, e = 0, h = k.getById(c[i].endNode), k = k.getById(c[i + 1].startNode);;) {
  10477. h = h.getNextSourceNode(false);
  10478. if(k.equals(h)) e = 1;
  10479. else if(g(h) || h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) continue;
  10480. break
  10481. }
  10482. if(!e) break;
  10483. i++
  10484. }
  10485. for(f.moveToBookmark(c.shift()); i--;) {
  10486. h = a[++d];
  10487. h.moveToBookmark(c.shift());
  10488. f.setEnd(h.endContainer, h.endOffset)
  10489. }
  10490. }
  10491. return f
  10492. }
  10493. }
  10494. },
  10495. createBookmarks: function(b) {
  10496. for(var g = [], c, d = 0; d < this.length; d++) {
  10497. g.push(c = this[d].createBookmark(b, true));
  10498. for(var e = d + 1; e < this.length; e++) {
  10499. this[e] =
  10500. a(c, this[e]);
  10501. this[e] = a(c, this[e], true)
  10502. }
  10503. }
  10504. return g
  10505. },
  10506. createBookmarks2: function(a) {
  10507. for(var g = [], c = 0; c < this.length; c++) g.push(this[c].createBookmark2(a));
  10508. return g
  10509. },
  10510. moveToBookmarks: function(a) {
  10511. for(var g = 0; g < this.length; g++) this[g].moveToBookmark(a[g])
  10512. }
  10513. }
  10514. }(),
  10515. function() {
  10516. function a() {
  10517. return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/")
  10518. }
  10519. function e(b) {
  10520. var c = CKEDITOR.skin["ua_" + b],
  10521. d = CKEDITOR.env;
  10522. if(c)
  10523. for(var c = c.split(",").sort(function(a, b) {
  10524. return a > b ? -1 : 1
  10525. }), f =
  10526. 0, g; f < c.length; f++) {
  10527. g = c[f];
  10528. if(d.ie && (g.replace(/^ie/, "") == d.version || d.quirks && g == "iequirks")) g = "ie";
  10529. if(d[g]) {
  10530. b = b + ("_" + c[f]);
  10531. break
  10532. }
  10533. }
  10534. return CKEDITOR.getUrl(a() + b + ".css")
  10535. }
  10536. function b(a, b) {
  10537. if(!d[a]) {
  10538. CKEDITOR.document.appendStyleSheet(e(a));
  10539. d[a] = 1
  10540. }
  10541. b && b()
  10542. }
  10543. function g(a) {
  10544. var b = a.getById(j);
  10545. if(!b) {
  10546. b = a.getHead().append("style");
  10547. b.setAttribute("id", j);
  10548. b.setAttribute("type", "text/css")
  10549. }
  10550. return b
  10551. }
  10552. function c(a, b, c) {
  10553. var d, f, g;
  10554. if(CKEDITOR.env.webkit) {
  10555. b = b.split("}").slice(0, -1);
  10556. for(f = 0; f < b.length; f++) b[f] = b[f].split("{")
  10557. }
  10558. for(var e =
  10559. 0; e < a.length; e++)
  10560. if(CKEDITOR.env.webkit)
  10561. for(f = 0; f < b.length; f++) {
  10562. g = b[f][1];
  10563. for(d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  10564. a[e].$.sheet.addRule(b[f][0], g)
  10565. } else {
  10566. g = b;
  10567. for(d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  10568. CKEDITOR.env.ie && CKEDITOR.env.version < 11 ? a[e].$.styleSheet.cssText = a[e].$.styleSheet.cssText + g : a[e].$.innerHTML = a[e].$.innerHTML + g
  10569. }
  10570. }
  10571. var d = {};
  10572. CKEDITOR.skin = {
  10573. path: a,
  10574. loadPart: function(c, d) {
  10575. CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() +
  10576. "skin.js"), function() {
  10577. b(c, d)
  10578. }) : b(c, d)
  10579. },
  10580. getPath: function(a) {
  10581. return CKEDITOR.getUrl(e(a))
  10582. },
  10583. icons: {},
  10584. addIcon: function(a, b, c, d) {
  10585. a = a.toLowerCase();
  10586. this.icons[a] || (this.icons[a] = {
  10587. path: b,
  10588. offset: c || 0,
  10589. bgsize: d || "16px"
  10590. })
  10591. },
  10592. getIconStyle: function(a, b, c, d, f) {
  10593. var g;
  10594. if(a) {
  10595. a = a.toLowerCase();
  10596. b && (g = this.icons[a + "-rtl"]);
  10597. g || (g = this.icons[a])
  10598. }
  10599. a = c || g && g.path || "";
  10600. d = d || g && g.offset;
  10601. f = f || g && g.bgsize || "16px";
  10602. return a && "background-image:url(" + CKEDITOR.getUrl(a) + ");background-position:0 " + d + "px;background-size:" + f + ";"
  10603. }
  10604. };
  10605. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  10606. getUiColor: function() {
  10607. return this.uiColor
  10608. },
  10609. setUiColor: function(a) {
  10610. var b = g(CKEDITOR.document);
  10611. return(this.setUiColor = function(a) {
  10612. this.uiColor = a;
  10613. var d = CKEDITOR.skin.chameleon,
  10614. g = "",
  10615. e = "";
  10616. if(typeof d == "function") {
  10617. g = d(this, "editor");
  10618. e = d(this, "panel")
  10619. }
  10620. a = [
  10621. [h, a]
  10622. ];
  10623. c([b], g, a);
  10624. c(f, e, a)
  10625. }).call(this, a)
  10626. }
  10627. });
  10628. var j = "cke_ui_color",
  10629. f = [],
  10630. h = /\$color/g;
  10631. CKEDITOR.on("instanceLoaded", function(a) {
  10632. if(!CKEDITOR.env.ie || !CKEDITOR.env.quirks) {
  10633. var b = a.editor,
  10634. a = function(a) {
  10635. a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
  10636. if(!a.getById("cke_ui_color")) {
  10637. a = g(a);
  10638. f.push(a);
  10639. var d = b.getUiColor();
  10640. d && c([a], CKEDITOR.skin.chameleon(b, "panel"), [
  10641. [h, d]
  10642. ])
  10643. }
  10644. };
  10645. b.on("panelShow", a);
  10646. b.on("menuShow", a);
  10647. b.config.uiColor && b.setUiColor(b.config.uiColor)
  10648. }
  10649. })
  10650. }(),
  10651. function() {
  10652. if(CKEDITOR.env.webkit) CKEDITOR.env.hc = false;
  10653. else {
  10654. var a = CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>', CKEDITOR.document);
  10655. a.appendTo(CKEDITOR.document.getHead());
  10656. try {
  10657. var e = a.getComputedStyle("border-top-color"),
  10658. b = a.getComputedStyle("border-right-color");
  10659. CKEDITOR.env.hc = !!(e && e == b)
  10660. } catch(g) {
  10661. CKEDITOR.env.hc = false
  10662. }
  10663. a.remove()
  10664. }
  10665. if(CKEDITOR.env.hc) CKEDITOR.env.cssClass = CKEDITOR.env.cssClass + " cke_hc";
  10666. CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
  10667. CKEDITOR.status = "loaded";
  10668. CKEDITOR.fireOnce("loaded");
  10669. if(a = CKEDITOR._.pending) {
  10670. delete CKEDITOR._.pending;
  10671. for(e = 0; e < a.length; e++) {
  10672. CKEDITOR.editor.prototype.constructor.apply(a[e][0], a[e][1]);
  10673. CKEDITOR.add(a[e][0])
  10674. }
  10675. }
  10676. }(), CKEDITOR.skin.name = "moono", CKEDITOR.skin.ua_editor =
  10677. "ie,iequirks,ie7,ie8,gecko", CKEDITOR.skin.ua_dialog = "ie,iequirks,ie7,ie8", CKEDITOR.skin.chameleon = function() {
  10678. var a = function() {
  10679. return function(a, b) {
  10680. for(var d = a.match(/[^#]./g), e = 0; e < 3; e++) {
  10681. var f = d,
  10682. h = e,
  10683. i;
  10684. i = parseInt(d[e], 16);
  10685. i = ("0" + (b < 0 ? 0 | i * (1 + b) : 0 | i + (255 - i) * b).toString(16)).slice(-2);
  10686. f[h] = i
  10687. }
  10688. return "#" + d.join("")
  10689. }
  10690. }(),
  10691. e = function() {
  10692. var a = new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");
  10693. return function(b, d) {
  10694. return a.output({
  10695. from: b,
  10696. to: d
  10697. })
  10698. }
  10699. }(),
  10700. b = {
  10701. editor: new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
  10702. panel: new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")
  10703. };
  10704. return function(g, c) {
  10705. var d = g.uiColor,
  10706. d = {
  10707. id: "." + g.id,
  10708. defaultBorder: a(d, -0.1),
  10709. defaultGradient: e(a(d, 0.9), d),
  10710. lightGradient: e(a(d, 1), a(d, 0.7)),
  10711. mediumGradient: e(a(d, 0.8), a(d, 0.5)),
  10712. ckeButtonOn: e(a(d, 0.6), a(d, 0.7)),
  10713. ckeResizer: a(d, -0.4),
  10714. ckeToolbarSeparator: a(d, 0.5),
  10715. ckeColorauto: a(d, 0.8),
  10716. dialogBody: a(d, 0.7),
  10717. dialogTabSelected: e("#FFFFFF", "#FFFFFF"),
  10718. dialogTabSelectedBorder: "#FFF",
  10719. elementsPathColor: a(d, -0.6),
  10720. elementsPathBg: d,
  10721. menubuttonIcon: a(d, 0.5),
  10722. menubuttonIconHover: a(d, 0.3)
  10723. };
  10724. return b[c].output(d).replace(/\[/g,
  10725. "{").replace(/\]/g, "}")
  10726. }
  10727. }(), CKEDITOR.plugins.add("dialogui", {
  10728. onLoad: function() {
  10729. var a = function(a) {
  10730. this._ || (this._ = {});
  10731. this._["default"] = this._.initValue = a["default"] || "";
  10732. this._.required = a.required || false;
  10733. for(var b = [this._], c = 1; c < arguments.length; c++) b.push(arguments[c]);
  10734. b.push(true);
  10735. CKEDITOR.tools.extend.apply(CKEDITOR.tools, b);
  10736. return this._
  10737. },
  10738. e = {
  10739. build: function(a, b, c) {
  10740. return new CKEDITOR.ui.dialog.textInput(a, b, c)
  10741. }
  10742. },
  10743. b = {
  10744. build: function(a, b, c) {
  10745. return new CKEDITOR.ui.dialog[b.type](a, b, c)
  10746. }
  10747. },
  10748. g = {
  10749. isChanged: function() {
  10750. return this.getValue() !=
  10751. this.getInitValue()
  10752. },
  10753. reset: function(a) {
  10754. this.setValue(this.getInitValue(), a)
  10755. },
  10756. setInitValue: function() {
  10757. this._.initValue = this.getValue()
  10758. },
  10759. resetInitValue: function() {
  10760. this._.initValue = this._["default"]
  10761. },
  10762. getInitValue: function() {
  10763. return this._.initValue
  10764. }
  10765. },
  10766. c = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  10767. onChange: function(a, b) {
  10768. if(!this._.domOnChangeRegistered) {
  10769. a.on("load", function() {
  10770. this.getInputElement().on("change", function() {
  10771. a.parts.dialog.isVisible() && this.fire("change", {
  10772. value: this.getValue()
  10773. })
  10774. }, this)
  10775. }, this);
  10776. this._.domOnChangeRegistered = true
  10777. }
  10778. this.on("change", b)
  10779. }
  10780. }, true),
  10781. d = /^on([A-Z]\w+)/,
  10782. j = function(a) {
  10783. for(var b in a)(d.test(b) || b == "title" || b == "type") && delete a[b];
  10784. return a
  10785. };
  10786. CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
  10787. labeledElement: function(b, c, d, g) {
  10788. if(!(arguments.length < 4)) {
  10789. var e = a.call(this, c);
  10790. e.labelId = CKEDITOR.tools.getNextId() + "_label";
  10791. this._.children = [];
  10792. var j = {
  10793. role: c.role || "presentation"
  10794. };
  10795. if(c.includeLabel) j["aria-labelledby"] = e.labelId;
  10796. CKEDITOR.ui.dialog.uiElement.call(this,
  10797. b, c, d, "div", null, j,
  10798. function() {
  10799. var a = [],
  10800. d = c.required ? " cke_required" : "";
  10801. if(c.labelLayout != "horizontal") a.push('<label class="cke_dialog_ui_labeled_label' + d + '" ', ' id="' + e.labelId + '"', e.inputId ? ' for="' + e.inputId + '"' : "", (c.labelStyle ? ' style="' + c.labelStyle + '"' : "") + ">", c.label, "</label>", '<div class="cke_dialog_ui_labeled_content"', c.controlStyle ? ' style="' + c.controlStyle + '"' : "", ' role="presentation">', g.call(this, b, c), "</div>");
  10802. else {
  10803. d = {
  10804. type: "hbox",
  10805. widths: c.widths,
  10806. padding: 0,
  10807. children: [{
  10808. type: "html",
  10809. html: '<label class="cke_dialog_ui_labeled_label' +
  10810. d + '" id="' + e.labelId + '" for="' + e.inputId + '"' + (c.labelStyle ? ' style="' + c.labelStyle + '"' : "") + ">" + CKEDITOR.tools.htmlEncode(c.label) + "</span>"
  10811. }, {
  10812. type: "html",
  10813. html: '<span class="cke_dialog_ui_labeled_content"' + (c.controlStyle ? ' style="' + c.controlStyle + '"' : "") + ">" + g.call(this, b, c) + "</span>"
  10814. }]
  10815. };
  10816. CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, d, a)
  10817. }
  10818. return a.join("")
  10819. })
  10820. }
  10821. },
  10822. textInput: function(b, c, d) {
  10823. if(!(arguments.length < 3)) {
  10824. a.call(this, c);
  10825. var g = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
  10826. e = {
  10827. "class": "cke_dialog_ui_input_" +
  10828. c.type,
  10829. id: g,
  10830. type: c.type
  10831. };
  10832. if(c.validate) this.validate = c.validate;
  10833. if(c.maxLength) e.maxlength = c.maxLength;
  10834. if(c.size) e.size = c.size;
  10835. if(c.inputStyle) e.style = c.inputStyle;
  10836. var j = this,
  10837. q = false;
  10838. b.on("load", function() {
  10839. j.getInputElement().on("keydown", function(a) {
  10840. a.data.getKeystroke() == 13 && (q = true)
  10841. });
  10842. j.getInputElement().on("keyup", function(a) {
  10843. if(a.data.getKeystroke() == 13 && q) {
  10844. b.getButton("ok") && setTimeout(function() {
  10845. b.getButton("ok").click()
  10846. }, 0);
  10847. q = false
  10848. }
  10849. }, null, null, 1E3)
  10850. });
  10851. CKEDITOR.ui.dialog.labeledElement.call(this,
  10852. b, c, d,
  10853. function() {
  10854. var a = ['<div class="cke_dialog_ui_input_', c.type, '" role="presentation"'];
  10855. c.width && a.push('style="width:' + c.width + '" ');
  10856. a.push("><input ");
  10857. e["aria-labelledby"] = this._.labelId;
  10858. this._.required && (e["aria-required"] = this._.required);
  10859. for(var b in e) a.push(b + '="' + e[b] + '" ');
  10860. a.push(" /></div>");
  10861. return a.join("")
  10862. })
  10863. }
  10864. },
  10865. textarea: function(b, c, d) {
  10866. if(!(arguments.length < 3)) {
  10867. a.call(this, c);
  10868. var g = this,
  10869. e = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea",
  10870. j = {};
  10871. if(c.validate) this.validate = c.validate;
  10872. j.rows = c.rows || 5;
  10873. j.cols = c.cols || 20;
  10874. j["class"] = "cke_dialog_ui_input_textarea " + (c["class"] || "");
  10875. if(typeof c.inputStyle != "undefined") j.style = c.inputStyle;
  10876. if(c.dir) j.dir = c.dir;
  10877. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  10878. j["aria-labelledby"] = this._.labelId;
  10879. this._.required && (j["aria-required"] = this._.required);
  10880. var a = ['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="', e, '" '],
  10881. b;
  10882. for(b in j) a.push(b + '="' + CKEDITOR.tools.htmlEncode(j[b]) + '" ');
  10883. a.push(">", CKEDITOR.tools.htmlEncode(g._["default"]),
  10884. "</textarea></div>");
  10885. return a.join("")
  10886. })
  10887. }
  10888. },
  10889. checkbox: function(b, c, d) {
  10890. if(!(arguments.length < 3)) {
  10891. var g = a.call(this, c, {
  10892. "default": !!c["default"]
  10893. });
  10894. if(c.validate) this.validate = c.validate;
  10895. CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "span", null, null, function() {
  10896. var a = CKEDITOR.tools.extend({}, c, {
  10897. id: c.id ? c.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox"
  10898. }, true),
  10899. d = [],
  10900. e = CKEDITOR.tools.getNextId() + "_label",
  10901. i = {
  10902. "class": "cke_dialog_ui_checkbox_input",
  10903. type: "checkbox",
  10904. "aria-labelledby": e
  10905. };
  10906. j(a);
  10907. if(c["default"]) i.checked =
  10908. "checked";
  10909. if(typeof a.inputStyle != "undefined") a.style = a.inputStyle;
  10910. g.checkbox = new CKEDITOR.ui.dialog.uiElement(b, a, d, "input", null, i);
  10911. d.push(' <label id="', e, '" for="', i.id, '"' + (c.labelStyle ? ' style="' + c.labelStyle + '"' : "") + ">", CKEDITOR.tools.htmlEncode(c.label), "</label>");
  10912. return d.join("")
  10913. })
  10914. }
  10915. },
  10916. radio: function(b, c, d) {
  10917. if(!(arguments.length < 3)) {
  10918. a.call(this, c);
  10919. if(!this._["default"]) this._["default"] = this._.initValue = c.items[0][1];
  10920. if(c.validate) this.validate = c.valdiate;
  10921. var g = [],
  10922. e = this;
  10923. c.role = "radiogroup";
  10924. c.includeLabel = true;
  10925. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  10926. for(var a = [], d = [], i = (c.id ? c.id : CKEDITOR.tools.getNextId()) + "_radio", l = 0; l < c.items.length; l++) {
  10927. var p = c.items[l],
  10928. t = p[2] !== void 0 ? p[2] : p[0],
  10929. s = p[1] !== void 0 ? p[1] : p[0],
  10930. u = CKEDITOR.tools.getNextId() + "_radio_input",
  10931. w = u + "_label",
  10932. u = CKEDITOR.tools.extend({}, c, {
  10933. id: u,
  10934. title: null,
  10935. type: null
  10936. }, true),
  10937. t = CKEDITOR.tools.extend({}, u, {
  10938. title: t
  10939. }, true),
  10940. x = {
  10941. type: "radio",
  10942. "class": "cke_dialog_ui_radio_input",
  10943. name: i,
  10944. value: s,
  10945. "aria-labelledby": w
  10946. },
  10947. v = [];
  10948. if(e._["default"] == s) x.checked = "checked";
  10949. j(u);
  10950. j(t);
  10951. if(typeof u.inputStyle != "undefined") u.style = u.inputStyle;
  10952. u.keyboardFocusable = true;
  10953. g.push(new CKEDITOR.ui.dialog.uiElement(b, u, v, "input", null, x));
  10954. v.push(" ");
  10955. new CKEDITOR.ui.dialog.uiElement(b, t, v, "label", null, {
  10956. id: w,
  10957. "for": x.id
  10958. }, p[0]);
  10959. a.push(v.join(""))
  10960. }
  10961. new CKEDITOR.ui.dialog.hbox(b, g, a, d);
  10962. return d.join("")
  10963. });
  10964. this._.children = g
  10965. }
  10966. },
  10967. button: function(b, c, d) {
  10968. if(arguments.length) {
  10969. typeof c == "function" && (c = c(b.getParentEditor()));
  10970. a.call(this, c, {
  10971. disabled: c.disabled ||
  10972. false
  10973. });
  10974. CKEDITOR.event.implementOn(this);
  10975. var g = this;
  10976. b.on("load", function() {
  10977. var a = this.getElement();
  10978. (function() {
  10979. a.on("click", function(a) {
  10980. g.click();
  10981. a.data.preventDefault()
  10982. });
  10983. a.on("keydown", function(a) {
  10984. if(a.data.getKeystroke() in {
  10985. 32: 1
  10986. }) {
  10987. g.click();
  10988. a.data.preventDefault()
  10989. }
  10990. })
  10991. })();
  10992. a.unselectable()
  10993. }, this);
  10994. var e = CKEDITOR.tools.extend({}, c);
  10995. delete e.style;
  10996. var j = CKEDITOR.tools.getNextId() + "_label";
  10997. CKEDITOR.ui.dialog.uiElement.call(this, b, e, d, "a", null, {
  10998. style: c.style,
  10999. href: "javascript:void(0)",
  11000. title: c.label,
  11001. hidefocus: "true",
  11002. "class": c["class"],
  11003. role: "button",
  11004. "aria-labelledby": j
  11005. }, '<span id="' + j + '" class="cke_dialog_ui_button">' + CKEDITOR.tools.htmlEncode(c.label) + "</span>")
  11006. }
  11007. },
  11008. select: function(b, c, d) {
  11009. if(!(arguments.length < 3)) {
  11010. var g = a.call(this, c);
  11011. if(c.validate) this.validate = c.validate;
  11012. g.inputId = CKEDITOR.tools.getNextId() + "_select";
  11013. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  11014. var a = CKEDITOR.tools.extend({}, c, {
  11015. id: c.id ? c.id + "_select" : CKEDITOR.tools.getNextId() + "_select"
  11016. }, true),
  11017. d = [],
  11018. e = [],
  11019. i = {
  11020. id: g.inputId,
  11021. "class": "cke_dialog_ui_input_select",
  11022. "aria-labelledby": this._.labelId
  11023. };
  11024. d.push('<div class="cke_dialog_ui_input_', c.type, '" role="presentation"');
  11025. c.width && d.push('style="width:' + c.width + '" ');
  11026. d.push(">");
  11027. if(c.size !== void 0) i.size = c.size;
  11028. if(c.multiple !== void 0) i.multiple = c.multiple;
  11029. j(a);
  11030. for(var l = 0, p; l < c.items.length && (p = c.items[l]); l++) e.push('<option value="', CKEDITOR.tools.htmlEncode(p[1] !== void 0 ? p[1] : p[0]).replace(/"/g, "&quot;"), '" /> ', CKEDITOR.tools.htmlEncode(p[0]));
  11031. if(typeof a.inputStyle != "undefined") a.style = a.inputStyle;
  11032. g.select =
  11033. new CKEDITOR.ui.dialog.uiElement(b, a, d, "select", null, i, e.join(""));
  11034. d.push("</div>");
  11035. return d.join("")
  11036. })
  11037. }
  11038. },
  11039. file: function(b, c, d) {
  11040. if(!(arguments.length < 3)) {
  11041. c["default"] === void 0 && (c["default"] = "");
  11042. var g = CKEDITOR.tools.extend(a.call(this, c), {
  11043. definition: c,
  11044. buttons: []
  11045. });
  11046. if(c.validate) this.validate = c.validate;
  11047. b.on("load", function() {
  11048. CKEDITOR.document.getById(g.frameId).getParent().addClass("cke_dialog_ui_input_file")
  11049. });
  11050. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  11051. g.frameId = CKEDITOR.tools.getNextId() +
  11052. "_fileInput";
  11053. var a = ['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="', g.frameId, '" title="', c.label, '" src="javascript:void('];
  11054. a.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
  11055. a.push(')"></iframe>');
  11056. return a.join("")
  11057. })
  11058. }
  11059. },
  11060. fileButton: function(b, c, d) {
  11061. var g = this;
  11062. if(!(arguments.length < 3)) {
  11063. a.call(this, c);
  11064. if(c.validate) this.validate = c.validate;
  11065. var e = CKEDITOR.tools.extend({},
  11066. c),
  11067. j = e.onClick;
  11068. e.className = (e.className ? e.className + " " : "") + "cke_dialog_ui_button";
  11069. e.onClick = function(a) {
  11070. var d = c["for"];
  11071. if(!j || j.call(this, a) !== false) {
  11072. b.getContentElement(d[0], d[1]).submit();
  11073. this.disable()
  11074. }
  11075. };
  11076. b.on("load", function() {
  11077. b.getContentElement(c["for"][0], c["for"][1])._.buttons.push(g)
  11078. });
  11079. CKEDITOR.ui.dialog.button.call(this, b, e, d)
  11080. }
  11081. },
  11082. html: function() {
  11083. var a = /^\s*<[\w:]+\s+([^>]*)?>/,
  11084. b = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
  11085. c = /\/$/;
  11086. return function(d, g, e) {
  11087. if(!(arguments.length < 3)) {
  11088. var j = [],
  11089. m = g.html;
  11090. m.charAt(0) != "<" && (m = "<span>" + m + "</span>");
  11091. var l = g.focus;
  11092. if(l) {
  11093. var p = this.focus;
  11094. this.focus = function() {
  11095. (typeof l == "function" ? l : p).call(this);
  11096. this.fire("focus")
  11097. };
  11098. if(g.isFocusable) this.isFocusable = this.isFocusable;
  11099. this.keyboardFocusable = true
  11100. }
  11101. CKEDITOR.ui.dialog.uiElement.call(this, d, g, j, "span", null, null, "");
  11102. j = j.join("").match(a);
  11103. m = m.match(b) || ["", "", ""];
  11104. if(c.test(m[1])) {
  11105. m[1] = m[1].slice(0, -1);
  11106. m[2] = "/" + m[2]
  11107. }
  11108. e.push([m[1], " ", j[1] || "", m[2]].join(""))
  11109. }
  11110. }
  11111. }(),
  11112. fieldset: function(a, b, c, d, g) {
  11113. var e = g.label;
  11114. this._ = {
  11115. children: b
  11116. };
  11117. CKEDITOR.ui.dialog.uiElement.call(this, a, g, d, "fieldset", null, null, function() {
  11118. var a = [];
  11119. e && a.push("<legend" + (g.labelStyle ? ' style="' + g.labelStyle + '"' : "") + ">" + e + "</legend>");
  11120. for(var b = 0; b < c.length; b++) a.push(c[b]);
  11121. return a.join("")
  11122. })
  11123. }
  11124. }, true);
  11125. CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
  11126. CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  11127. setLabel: function(a) {
  11128. var b = CKEDITOR.document.getById(this._.labelId);
  11129. b.getChildCount() <
  11130. 1 ? (new CKEDITOR.dom.text(a, CKEDITOR.document)).appendTo(b) : b.getChild(0).$.nodeValue = a;
  11131. return this
  11132. },
  11133. getLabel: function() {
  11134. var a = CKEDITOR.document.getById(this._.labelId);
  11135. return !a || a.getChildCount() < 1 ? "" : a.getChild(0).getText()
  11136. },
  11137. eventProcessors: c
  11138. }, true);
  11139. CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  11140. click: function() {
  11141. return !this._.disabled ? this.fire("click", {
  11142. dialog: this._.dialog
  11143. }) : false
  11144. },
  11145. enable: function() {
  11146. this._.disabled = false;
  11147. var a = this.getElement();
  11148. a && a.removeClass("cke_disabled")
  11149. },
  11150. disable: function() {
  11151. this._.disabled = true;
  11152. this.getElement().addClass("cke_disabled")
  11153. },
  11154. isVisible: function() {
  11155. return this.getElement().getFirst().isVisible()
  11156. },
  11157. isEnabled: function() {
  11158. return !this._.disabled
  11159. },
  11160. eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  11161. onClick: function(a, b) {
  11162. this.on("click", function() {
  11163. b.apply(this, arguments)
  11164. })
  11165. }
  11166. }, true),
  11167. accessKeyUp: function() {
  11168. this.click()
  11169. },
  11170. accessKeyDown: function() {
  11171. this.focus()
  11172. },
  11173. keyboardFocusable: true
  11174. }, true);
  11175. CKEDITOR.ui.dialog.textInput.prototype =
  11176. CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  11177. getInputElement: function() {
  11178. return CKEDITOR.document.getById(this._.inputId)
  11179. },
  11180. focus: function() {
  11181. var a = this.selectParentTab();
  11182. setTimeout(function() {
  11183. var b = a.getInputElement();
  11184. b && b.$.focus()
  11185. }, 0)
  11186. },
  11187. select: function() {
  11188. var a = this.selectParentTab();
  11189. setTimeout(function() {
  11190. var b = a.getInputElement();
  11191. if(b) {
  11192. b.$.focus();
  11193. b.$.select()
  11194. }
  11195. }, 0)
  11196. },
  11197. accessKeyUp: function() {
  11198. this.select()
  11199. },
  11200. setValue: function(a) {
  11201. !a && (a = "");
  11202. return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,
  11203. arguments)
  11204. },
  11205. keyboardFocusable: true
  11206. }, g, true);
  11207. CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput;
  11208. CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  11209. getInputElement: function() {
  11210. return this._.select.getElement()
  11211. },
  11212. add: function(a, b, c) {
  11213. var d = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
  11214. g = this.getInputElement().$;
  11215. d.$.text = a;
  11216. d.$.value = b === void 0 || b === null ? a : b;
  11217. c === void 0 || c === null ? CKEDITOR.env.ie ? g.add(d.$) : g.add(d.$,
  11218. null) : g.add(d.$, c);
  11219. return this
  11220. },
  11221. remove: function(a) {
  11222. this.getInputElement().$.remove(a);
  11223. return this
  11224. },
  11225. clear: function() {
  11226. for(var a = this.getInputElement().$; a.length > 0;) a.remove(0);
  11227. return this
  11228. },
  11229. keyboardFocusable: true
  11230. }, g, true);
  11231. CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  11232. getInputElement: function() {
  11233. return this._.checkbox.getElement()
  11234. },
  11235. setValue: function(a, b) {
  11236. this.getInputElement().$.checked = a;
  11237. !b && this.fire("change", {
  11238. value: a
  11239. })
  11240. },
  11241. getValue: function() {
  11242. return this.getInputElement().$.checked
  11243. },
  11244. accessKeyUp: function() {
  11245. this.setValue(!this.getValue())
  11246. },
  11247. eventProcessors: {
  11248. onChange: function(a, b) {
  11249. if(!CKEDITOR.env.ie || CKEDITOR.env.version > 8) return c.onChange.apply(this, arguments);
  11250. a.on("load", function() {
  11251. var a = this._.checkbox.getElement();
  11252. a.on("propertychange", function(b) {
  11253. b = b.data.$;
  11254. b.propertyName == "checked" && this.fire("change", {
  11255. value: a.$.checked
  11256. })
  11257. }, this)
  11258. }, this);
  11259. this.on("change", b);
  11260. return null
  11261. }
  11262. },
  11263. keyboardFocusable: true
  11264. }, g, true);
  11265. CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  11266. setValue: function(a, b) {
  11267. for(var c = this._.children, d, g = 0; g < c.length && (d = c[g]); g++) d.getElement().$.checked = d.getValue() == a;
  11268. !b && this.fire("change", {
  11269. value: a
  11270. })
  11271. },
  11272. getValue: function() {
  11273. for(var a = this._.children, b = 0; b < a.length; b++)
  11274. if(a[b].getElement().$.checked) return a[b].getValue();
  11275. return null
  11276. },
  11277. accessKeyUp: function() {
  11278. var a = this._.children,
  11279. b;
  11280. for(b = 0; b < a.length; b++)
  11281. if(a[b].getElement().$.checked) {
  11282. a[b].getElement().focus();
  11283. return
  11284. }
  11285. a[0].getElement().focus()
  11286. },
  11287. eventProcessors: {
  11288. onChange: function(a, b) {
  11289. if(CKEDITOR.env.ie) {
  11290. a.on("load",
  11291. function() {
  11292. for(var a = this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function(a) {
  11293. a = a.data.$;
  11294. a.propertyName == "checked" && this.$.checked && b.fire("change", {
  11295. value: this.getAttribute("value")
  11296. })
  11297. })
  11298. }, this);
  11299. this.on("change", b)
  11300. } else return c.onChange.apply(this, arguments);
  11301. return null
  11302. }
  11303. }
  11304. }, g, true);
  11305. CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, g, {
  11306. getInputElement: function() {
  11307. var a = CKEDITOR.document.getById(this._.frameId).getFrameDocument();
  11308. return a.$.forms.length > 0 ? new CKEDITOR.dom.element(a.$.forms[0].elements[0]) : this.getElement()
  11309. },
  11310. submit: function() {
  11311. this.getInputElement().getParent().$.submit();
  11312. return this
  11313. },
  11314. getAction: function() {
  11315. return this.getInputElement().getParent().$.action
  11316. },
  11317. registerEvents: function(a) {
  11318. var b = /^on([A-Z]\w+)/,
  11319. c, d = function(a, b, c, d) {
  11320. a.on("formLoaded", function() {
  11321. a.getInputElement().on(c, d, a)
  11322. })
  11323. },
  11324. g;
  11325. for(g in a)
  11326. if(c = g.match(b)) this.eventProcessors[g] ? this.eventProcessors[g].call(this, this._.dialog, a[g]) : d(this, this._.dialog,
  11327. c[1].toLowerCase(), a[g]);
  11328. return this
  11329. },
  11330. reset: function() {
  11331. function a() {
  11332. c.$.open();
  11333. var f = "";
  11334. d.size && (f = d.size - (CKEDITOR.env.ie ? 7 : 0));
  11335. var t = b.frameId + "_input";
  11336. c.$.write(['<html dir="' + m + '" lang="' + l + '"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">', '<form enctype="multipart/form-data" method="POST" dir="' + m + '" lang="' + l + '" action="', CKEDITOR.tools.htmlEncode(d.action), '"><label id="', b.labelId, '" for="', t, '" style="display:none">', CKEDITOR.tools.htmlEncode(d.label),
  11337. '</label><input style="width:100%" id="', t, '" aria-labelledby="', b.labelId, '" type="file" name="', CKEDITOR.tools.htmlEncode(d.id || "cke_upload"), '" size="', CKEDITOR.tools.htmlEncode(f > 0 ? f : ""), '" /></form></body></html><script>', CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "", "window.parent.CKEDITOR.tools.callFunction(" + e + ");", "window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction(" + j + ")}", "<\/script>"
  11338. ].join(""));
  11339. c.$.close();
  11340. for(f = 0; f < g.length; f++) g[f].enable()
  11341. }
  11342. var b =
  11343. this._,
  11344. c = CKEDITOR.document.getById(b.frameId).getFrameDocument(),
  11345. d = b.definition,
  11346. g = b.buttons,
  11347. e = this.formLoadedNumber,
  11348. j = this.formUnloadNumber,
  11349. m = b.dialog._.editor.lang.dir,
  11350. l = b.dialog._.editor.langCode;
  11351. if(!e) {
  11352. e = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() {
  11353. this.fire("formLoaded")
  11354. }, this);
  11355. j = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() {
  11356. this.getInputElement().clearCustomData()
  11357. }, this);
  11358. this.getDialog()._.editor.on("destroy", function() {
  11359. CKEDITOR.tools.removeFunction(e);
  11360. CKEDITOR.tools.removeFunction(j)
  11361. })
  11362. }
  11363. CKEDITOR.env.gecko ?
  11364. setTimeout(a, 500) : a()
  11365. },
  11366. getValue: function() {
  11367. return this.getInputElement().$.value || ""
  11368. },
  11369. setInitValue: function() {
  11370. this._.initValue = ""
  11371. },
  11372. eventProcessors: {
  11373. onChange: function(a, b) {
  11374. if(!this._.domOnChangeRegistered) {
  11375. this.on("formLoaded", function() {
  11376. this.getInputElement().on("change", function() {
  11377. this.fire("change", {
  11378. value: this.getValue()
  11379. })
  11380. }, this)
  11381. }, this);
  11382. this._.domOnChangeRegistered = true
  11383. }
  11384. this.on("change", b)
  11385. }
  11386. },
  11387. keyboardFocusable: true
  11388. }, true);
  11389. CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
  11390. CKEDITOR.ui.dialog.fieldset.prototype =
  11391. CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
  11392. CKEDITOR.dialog.addUIElement("text", e);
  11393. CKEDITOR.dialog.addUIElement("password", e);
  11394. CKEDITOR.dialog.addUIElement("textarea", b);
  11395. CKEDITOR.dialog.addUIElement("checkbox", b);
  11396. CKEDITOR.dialog.addUIElement("radio", b);
  11397. CKEDITOR.dialog.addUIElement("button", b);
  11398. CKEDITOR.dialog.addUIElement("select", b);
  11399. CKEDITOR.dialog.addUIElement("file", b);
  11400. CKEDITOR.dialog.addUIElement("fileButton", b);
  11401. CKEDITOR.dialog.addUIElement("html", b);
  11402. CKEDITOR.dialog.addUIElement("fieldset", {
  11403. build: function(a, b, c) {
  11404. for(var d = b.children, g, e = [], j = [], m = 0; m < d.length && (g = d[m]); m++) {
  11405. var l = [];
  11406. e.push(l);
  11407. j.push(CKEDITOR.dialog._.uiElementBuilders[g.type].build(a, g, l))
  11408. }
  11409. return new CKEDITOR.ui.dialog[b.type](a, j, e, c, b)
  11410. }
  11411. })
  11412. }
  11413. }), CKEDITOR.DIALOG_RESIZE_NONE = 0, CKEDITOR.DIALOG_RESIZE_WIDTH = 1, CKEDITOR.DIALOG_RESIZE_HEIGHT = 2, CKEDITOR.DIALOG_RESIZE_BOTH = 3,
  11414. function() {
  11415. function a() {
  11416. for(var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--)
  11417. if(this._.tabs[this._.tabIdList[c %
  11418. a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  11419. return null
  11420. }
  11421. function e() {
  11422. for(var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++)
  11423. if(this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  11424. return null
  11425. }
  11426. function b(a, b) {
  11427. for(var c = a.$.getElementsByTagName("input"), d = 0, f = c.length; d < f; d++) {
  11428. var g = new CKEDITOR.dom.element(c[d]);
  11429. if(g.getAttribute("type").toLowerCase() == "text")
  11430. if(b) {
  11431. g.setAttribute("value", g.getCustomData("fake_value") ||
  11432. "");
  11433. g.removeCustomData("fake_value")
  11434. } else {
  11435. g.setCustomData("fake_value", g.getAttribute("value"));
  11436. g.setAttribute("value", "")
  11437. }
  11438. }
  11439. }
  11440. function g(a, b) {
  11441. var c = this.getInputElement();
  11442. c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", true));
  11443. a || (this.select ? this.select() : this.focus());
  11444. b && alert(b);
  11445. this.fire("validated", {
  11446. valid: a,
  11447. msg: b
  11448. })
  11449. }
  11450. function c() {
  11451. var a = this.getInputElement();
  11452. a && a.removeAttribute("aria-invalid")
  11453. }
  11454. function d(a) {
  11455. var a = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",
  11456. l).output({
  11457. id: CKEDITOR.tools.getNextNumber(),
  11458. editorId: a.id,
  11459. langDir: a.lang.dir,
  11460. langCode: a.langCode,
  11461. editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog",
  11462. closeTitle: a.lang.common.close,
  11463. hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : ""
  11464. })),
  11465. b = a.getChild([0, 0, 0, 0, 0]),
  11466. c = b.getChild(0),
  11467. d = b.getChild(1);
  11468. if(CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  11469. var f = "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())";
  11470. CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="' +
  11471. f + '" tabIndex="-1"></iframe>').appendTo(b.getParent())
  11472. }
  11473. c.unselectable();
  11474. d.unselectable();
  11475. return {
  11476. element: a,
  11477. parts: {
  11478. dialog: a.getChild(0),
  11479. title: c,
  11480. close: d,
  11481. tabs: b.getChild(2),
  11482. contents: b.getChild([3, 0, 0, 0]),
  11483. footer: b.getChild([3, 0, 1, 0])
  11484. }
  11485. }
  11486. }
  11487. function j(a, b, c) {
  11488. this.element = b;
  11489. this.focusIndex = c;
  11490. this.tabIndex = 0;
  11491. this.isFocusable = function() {
  11492. return !b.getAttribute("disabled") && b.isVisible()
  11493. };
  11494. this.focus = function() {
  11495. a._.currentFocusIndex = this.focusIndex;
  11496. this.element.focus()
  11497. };
  11498. b.on("keydown", function(a) {
  11499. a.data.getKeystroke() in {
  11500. 32: 1,
  11501. 13: 1
  11502. } && this.fire("click")
  11503. });
  11504. b.on("focus", function() {
  11505. this.fire("mouseover")
  11506. });
  11507. b.on("blur", function() {
  11508. this.fire("mouseout")
  11509. })
  11510. }
  11511. function f(a) {
  11512. function b() {
  11513. a.layout()
  11514. }
  11515. var c = CKEDITOR.document.getWindow();
  11516. c.on("resize", b);
  11517. a.on("hide", function() {
  11518. c.removeListener("resize", b)
  11519. })
  11520. }
  11521. function h(a, b) {
  11522. this._ = {
  11523. dialog: a
  11524. };
  11525. CKEDITOR.tools.extend(this, b)
  11526. }
  11527. function i(a) {
  11528. function b(c) {
  11529. var j = a.getSize(),
  11530. i = CKEDITOR.document.getWindow().getViewPaneSize(),
  11531. k = c.data.$.screenX,
  11532. p = c.data.$.screenY,
  11533. s = k - d.x,
  11534. t = p - d.y;
  11535. d = {
  11536. x: k,
  11537. y: p
  11538. };
  11539. f.x = f.x + s;
  11540. f.y = f.y + t;
  11541. a.move(f.x + h[3] < e ? -h[3] : f.x - h[1] > i.width - j.width - e ? i.width - j.width + (g.lang.dir == "rtl" ? 0 : h[1]) : f.x, f.y + h[0] < e ? -h[0] : f.y - h[2] > i.height - j.height - e ? i.height - j.height + h[2] : f.y, 1);
  11542. c.data.preventDefault()
  11543. }
  11544. function c() {
  11545. CKEDITOR.document.removeListener("mousemove", b);
  11546. CKEDITOR.document.removeListener("mouseup", c);
  11547. if(CKEDITOR.env.ie6Compat) {
  11548. var a = r.getChild(0).getFrameDocument();
  11549. a.removeListener("mousemove", b);
  11550. a.removeListener("mouseup", c)
  11551. }
  11552. }
  11553. var d = null,
  11554. f = null,
  11555. g = a.getParentEditor(),
  11556. e = g.config.dialog_magnetDistance,
  11557. h = CKEDITOR.skin.margins || [0, 0, 0, 0];
  11558. typeof e == "undefined" && (e = 20);
  11559. a.parts.title.on("mousedown", function(g) {
  11560. d = {
  11561. x: g.data.$.screenX,
  11562. y: g.data.$.screenY
  11563. };
  11564. CKEDITOR.document.on("mousemove", b);
  11565. CKEDITOR.document.on("mouseup", c);
  11566. f = a.getPosition();
  11567. if(CKEDITOR.env.ie6Compat) {
  11568. var e = r.getChild(0).getFrameDocument();
  11569. e.on("mousemove", b);
  11570. e.on("mouseup", c)
  11571. }
  11572. g.data.preventDefault()
  11573. }, a)
  11574. }
  11575. function k(a) {
  11576. var b, c;
  11577. function d(f) {
  11578. var s = h.lang.dir == "rtl",
  11579. t = p.width,
  11580. m = p.height,
  11581. l = t + (f.data.$.screenX - b) * (s ? -1 : 1) * (a._.moved ? 1 : 2),
  11582. n =
  11583. m + (f.data.$.screenY - c) * (a._.moved ? 1 : 2),
  11584. u = a._.element.getFirst(),
  11585. u = s && u.getComputedStyle("right"),
  11586. q = a.getPosition();
  11587. q.y + n > k.height && (n = k.height - q.y);
  11588. if((s ? u : q.x) + l > k.width) l = k.width - (s ? u : q.x);
  11589. if(e == CKEDITOR.DIALOG_RESIZE_WIDTH || e == CKEDITOR.DIALOG_RESIZE_BOTH) t = Math.max(g.minWidth || 0, l - j);
  11590. if(e == CKEDITOR.DIALOG_RESIZE_HEIGHT || e == CKEDITOR.DIALOG_RESIZE_BOTH) m = Math.max(g.minHeight || 0, n - i);
  11591. a.resize(t, m);
  11592. a._.moved || a.layout();
  11593. f.data.preventDefault()
  11594. }
  11595. function f() {
  11596. CKEDITOR.document.removeListener("mouseup",
  11597. f);
  11598. CKEDITOR.document.removeListener("mousemove", d);
  11599. if(s) {
  11600. s.remove();
  11601. s = null
  11602. }
  11603. if(CKEDITOR.env.ie6Compat) {
  11604. var a = r.getChild(0).getFrameDocument();
  11605. a.removeListener("mouseup", f);
  11606. a.removeListener("mousemove", d)
  11607. }
  11608. }
  11609. var g = a.definition,
  11610. e = g.resizable;
  11611. if(e != CKEDITOR.DIALOG_RESIZE_NONE) {
  11612. var h = a.getParentEditor(),
  11613. j, i, k, p, s, t = CKEDITOR.tools.addFunction(function(g) {
  11614. p = a.getSize();
  11615. var e = a.parts.contents;
  11616. if(e.$.getElementsByTagName("iframe").length) {
  11617. s = CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>');
  11618. e.append(s)
  11619. }
  11620. i = p.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks));
  11621. j = p.width - a.parts.contents.getSize("width", 1);
  11622. b = g.screenX;
  11623. c = g.screenY;
  11624. k = CKEDITOR.document.getWindow().getViewPaneSize();
  11625. CKEDITOR.document.on("mousemove", d);
  11626. CKEDITOR.document.on("mouseup", f);
  11627. if(CKEDITOR.env.ie6Compat) {
  11628. e = r.getChild(0).getFrameDocument();
  11629. e.on("mousemove", d);
  11630. e.on("mouseup", f)
  11631. }
  11632. g.preventDefault && g.preventDefault()
  11633. });
  11634. a.on("load", function() {
  11635. var b = "";
  11636. e == CKEDITOR.DIALOG_RESIZE_WIDTH ?
  11637. b = " cke_resizer_horizontal" : e == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical");
  11638. b = CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer' + b + " cke_resizer_" + h.lang.dir + '" title="' + CKEDITOR.tools.htmlEncode(h.lang.common.resize) + '" onmousedown="CKEDITOR.tools.callFunction(' + t + ', event )">' + (h.lang.dir == "ltr" ? "◢" : "◣") + "</div>");
  11639. a.parts.footer.append(b, 1)
  11640. });
  11641. h.on("destroy", function() {
  11642. CKEDITOR.tools.removeFunction(t)
  11643. })
  11644. }
  11645. }
  11646. function n(a) {
  11647. a.data.preventDefault(1)
  11648. }
  11649. function o(a) {
  11650. var b = CKEDITOR.document.getWindow(),
  11651. c = a.config,
  11652. d = c.dialog_backgroundCoverColor || "white",
  11653. f = c.dialog_backgroundCoverOpacity,
  11654. g = c.baseFloatZIndex,
  11655. c = CKEDITOR.tools.genKey(d, f, g),
  11656. e = v[c];
  11657. if(e) e.show();
  11658. else {
  11659. g = ['<div tabIndex="-1" style="position: ', CKEDITOR.env.ie6Compat ? "absolute" : "fixed", "; z-index: ", g, "; top: 0px; left: 0px; ", !CKEDITOR.env.ie6Compat ? "background-color: " + d : "", '" class="cke_dialog_background_cover">'];
  11660. if(CKEDITOR.env.ie6Compat) {
  11661. d = "<html><body style=\\'background-color:" + d + ";\\'></body></html>";
  11662. g.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');
  11663. g.push("void((function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.write( '" + d + "' );document.close();") + "})())");
  11664. g.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')
  11665. }
  11666. g.push("</div>");
  11667. e = CKEDITOR.dom.element.createFromHtml(g.join(""));
  11668. e.setOpacity(f !== void 0 ? f : 0.5);
  11669. e.on("keydown", n);
  11670. e.on("keypress", n);
  11671. e.on("keyup", n);
  11672. e.appendTo(CKEDITOR.document.getBody());
  11673. v[c] = e
  11674. }
  11675. a.focusManager.add(e);
  11676. r = e;
  11677. var a = function() {
  11678. var a = b.getViewPaneSize();
  11679. e.setStyles({
  11680. width: a.width + "px",
  11681. height: a.height + "px"
  11682. })
  11683. },
  11684. h = function() {
  11685. var a = b.getScrollPosition(),
  11686. c = CKEDITOR.dialog._.currentTop;
  11687. e.setStyles({
  11688. left: a.x + "px",
  11689. top: a.y + "px"
  11690. });
  11691. if(c) {
  11692. do {
  11693. a = c.getPosition();
  11694. c.move(a.x, a.y)
  11695. } while (c = c._.parentDialog)
  11696. }
  11697. };
  11698. x = a;
  11699. b.on("resize", a);
  11700. a();
  11701. (!CKEDITOR.env.mac || !CKEDITOR.env.webkit) && e.focus();
  11702. if(CKEDITOR.env.ie6Compat) {
  11703. var j = function() {
  11704. h();
  11705. arguments.callee.prevScrollHandler.apply(this, arguments)
  11706. };
  11707. b.$.setTimeout(function() {
  11708. j.prevScrollHandler =
  11709. window.onscroll || function() {};
  11710. window.onscroll = j
  11711. }, 0);
  11712. h()
  11713. }
  11714. }
  11715. function q(a) {
  11716. if(r) {
  11717. a.focusManager.remove(r);
  11718. a = CKEDITOR.document.getWindow();
  11719. r.hide();
  11720. a.removeListener("resize", x);
  11721. CKEDITOR.env.ie6Compat && a.$.setTimeout(function() {
  11722. window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null
  11723. }, 0);
  11724. x = null
  11725. }
  11726. }
  11727. var m = CKEDITOR.tools.cssLength,
  11728. l = '<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog ' +
  11729. CKEDITOR.env.cssClass + ' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';
  11730. CKEDITOR.dialog = function(b, f) {
  11731. function h() {
  11732. var a = v._.focusList;
  11733. a.sort(function(a, b) {
  11734. return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex
  11735. });
  11736. for(var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
  11737. }
  11738. function j(a) {
  11739. var b = v._.focusList,
  11740. a = a || 0;
  11741. if(!(b.length < 1)) {
  11742. var c = v._.currentFocusIndex;
  11743. try {
  11744. b[c].getInputElement().$.blur()
  11745. } catch(d) {}
  11746. for(var f = c = (c + a + b.length) % b.length; a && !b[f].isFocusable();) {
  11747. f = (f + a + b.length) % b.length;
  11748. if(f == c) break
  11749. }
  11750. b[f].focus();
  11751. b[f].type == "text" && b[f].select()
  11752. }
  11753. }
  11754. function s(c) {
  11755. if(v ==
  11756. CKEDITOR.dialog._.currentTop) {
  11757. var d = c.data.getKeystroke(),
  11758. f = b.lang.dir == "rtl";
  11759. o = x = 0;
  11760. if(d == 9 || d == CKEDITOR.SHIFT + 9) {
  11761. d = d == CKEDITOR.SHIFT + 9;
  11762. if(v._.tabBarMode) {
  11763. d = d ? a.call(v) : e.call(v);
  11764. v.selectPage(d);
  11765. v._.tabs[d][0].focus()
  11766. } else j(d ? -1 : 1);
  11767. o = 1
  11768. } else if(d == CKEDITOR.ALT + 121 && !v._.tabBarMode && v.getPageCount() > 1) {
  11769. v._.tabBarMode = true;
  11770. v._.tabs[v._.currentTabId][0].focus();
  11771. o = 1
  11772. } else if((d == 37 || d == 39) && v._.tabBarMode) {
  11773. d = d == (f ? 39 : 37) ? a.call(v) : e.call(v);
  11774. v.selectPage(d);
  11775. v._.tabs[d][0].focus();
  11776. o = 1
  11777. } else if((d == 13 || d ==
  11778. 32) && v._.tabBarMode) {
  11779. this.selectPage(this._.currentTabId);
  11780. this._.tabBarMode = false;
  11781. this._.currentFocusIndex = -1;
  11782. j(1);
  11783. o = 1
  11784. } else if(d == 13) {
  11785. d = c.data.getTarget();
  11786. if(!d.is("a", "button", "select", "textarea") && (!d.is("input") || d.$.type != "button")) {
  11787. (d = this.getButton("ok")) && CKEDITOR.tools.setTimeout(d.click, 0, d);
  11788. o = 1
  11789. }
  11790. x = 1
  11791. } else if(d == 27) {
  11792. (d = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(d.click, 0, d): this.fire("cancel", {
  11793. hide: true
  11794. }).hide !== false && this.hide();
  11795. x = 1
  11796. } else return;
  11797. t(c)
  11798. }
  11799. }
  11800. function t(a) {
  11801. o ? a.data.preventDefault(1) :
  11802. x && a.data.stopPropagation()
  11803. }
  11804. var m = CKEDITOR.dialog._.dialogDefinitions[f],
  11805. l = CKEDITOR.tools.clone(p),
  11806. n = b.config.dialog_buttonsOrder || "OS",
  11807. u = b.lang.dir,
  11808. q = {},
  11809. o, x;
  11810. (n == "OS" && CKEDITOR.env.mac || n == "rtl" && u == "ltr" || n == "ltr" && u == "rtl") && l.buttons.reverse();
  11811. m = CKEDITOR.tools.extend(m(b), l);
  11812. m = CKEDITOR.tools.clone(m);
  11813. m = new w(this, m);
  11814. l = d(b);
  11815. this._ = {
  11816. editor: b,
  11817. element: l.element,
  11818. name: f,
  11819. contentSize: {
  11820. width: 0,
  11821. height: 0
  11822. },
  11823. size: {
  11824. width: 0,
  11825. height: 0
  11826. },
  11827. contents: {},
  11828. buttons: {},
  11829. accessKeyMap: {},
  11830. tabs: {},
  11831. tabIdList: [],
  11832. currentTabId: null,
  11833. currentTabIndex: null,
  11834. pageCount: 0,
  11835. lastTab: null,
  11836. tabBarMode: false,
  11837. focusList: [],
  11838. currentFocusIndex: 0,
  11839. hasFocus: false
  11840. };
  11841. this.parts = l.parts;
  11842. CKEDITOR.tools.setTimeout(function() {
  11843. b.fire("ariaWidget", this.parts.contents)
  11844. }, 0, this);
  11845. l = {
  11846. position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed",
  11847. top: 0,
  11848. visibility: "hidden"
  11849. };
  11850. l[u == "rtl" ? "right" : "left"] = 0;
  11851. this.parts.dialog.setStyles(l);
  11852. CKEDITOR.event.call(this);
  11853. this.definition = m = CKEDITOR.fire("dialogDefinition", {
  11854. name: f,
  11855. definition: m
  11856. }, b).definition;
  11857. if(!("removeDialogTabs" in b._) &&
  11858. b.config.removeDialogTabs) {
  11859. l = b.config.removeDialogTabs.split(";");
  11860. for(u = 0; u < l.length; u++) {
  11861. n = l[u].split(":");
  11862. if(n.length == 2) {
  11863. var r = n[0];
  11864. q[r] || (q[r] = []);
  11865. q[r].push(n[1])
  11866. }
  11867. }
  11868. b._.removeDialogTabs = q
  11869. }
  11870. if(b._.removeDialogTabs && (q = b._.removeDialogTabs[f]))
  11871. for(u = 0; u < q.length; u++) m.removeContents(q[u]);
  11872. if(m.onLoad) this.on("load", m.onLoad);
  11873. if(m.onShow) this.on("show", m.onShow);
  11874. if(m.onHide) this.on("hide", m.onHide);
  11875. if(m.onOk) this.on("ok", function(a) {
  11876. b.fire("saveSnapshot");
  11877. setTimeout(function() {
  11878. b.fire("saveSnapshot")
  11879. },
  11880. 0);
  11881. if(m.onOk.call(this, a) === false) a.data.hide = false
  11882. });
  11883. if(m.onCancel) this.on("cancel", function(a) {
  11884. if(m.onCancel.call(this, a) === false) a.data.hide = false
  11885. });
  11886. var v = this,
  11887. z = function(a) {
  11888. var b = v._.contents,
  11889. c = false,
  11890. d;
  11891. for(d in b)
  11892. for(var f in b[d])
  11893. if(c = a.call(this, b[d][f])) return
  11894. };
  11895. this.on("ok", function(a) {
  11896. z(function(b) {
  11897. if(b.validate) {
  11898. var c = b.validate(this),
  11899. d = typeof c == "string" || c === false;
  11900. if(d) {
  11901. a.data.hide = false;
  11902. a.stop()
  11903. }
  11904. g.call(b, !d, typeof c == "string" ? c : void 0);
  11905. return d
  11906. }
  11907. })
  11908. }, this, null, 0);
  11909. this.on("cancel", function(a) {
  11910. z(function(c) {
  11911. if(c.isChanged()) {
  11912. if(!b.config.dialog_noConfirmCancel &&
  11913. !confirm(b.lang.common.confirmCancel)) a.data.hide = false;
  11914. return true
  11915. }
  11916. })
  11917. }, this, null, 0);
  11918. this.parts.close.on("click", function(a) {
  11919. this.fire("cancel", {
  11920. hide: true
  11921. }).hide !== false && this.hide();
  11922. a.data.preventDefault()
  11923. }, this);
  11924. this.changeFocus = j;
  11925. var y = this._.element;
  11926. b.focusManager.add(y, 1);
  11927. this.on("show", function() {
  11928. y.on("keydown", s, this);
  11929. if(CKEDITOR.env.gecko) y.on("keypress", t, this)
  11930. });
  11931. this.on("hide", function() {
  11932. y.removeListener("keydown", s);
  11933. CKEDITOR.env.gecko && y.removeListener("keypress", t);
  11934. z(function(a) {
  11935. c.apply(a)
  11936. })
  11937. });
  11938. this.on("iframeAdded", function(a) {
  11939. (new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", s, this, null, 0)
  11940. });
  11941. this.on("show", function() {
  11942. h();
  11943. if(b.config.dialog_startupFocusTab && v._.pageCount > 1) {
  11944. v._.tabBarMode = true;
  11945. v._.tabs[v._.currentTabId][0].focus()
  11946. } else if(!this._.hasFocus) {
  11947. this._.currentFocusIndex = -1;
  11948. if(m.onFocus) {
  11949. var a = m.onFocus.call(this);
  11950. a && a.focus()
  11951. } else j(1)
  11952. }
  11953. }, this, null, 4294967295);
  11954. if(CKEDITOR.env.ie6Compat) this.on("load", function() {
  11955. var a = this.getElement(),
  11956. b = a.getFirst();
  11957. b.remove();
  11958. b.appendTo(a)
  11959. }, this);
  11960. i(this);
  11961. k(this);
  11962. (new CKEDITOR.dom.text(m.title, CKEDITOR.document)).appendTo(this.parts.title);
  11963. for(u = 0; u < m.contents.length; u++)(q = m.contents[u]) && this.addPage(q);
  11964. this.parts.tabs.on("click", function(a) {
  11965. var b = a.data.getTarget();
  11966. if(b.hasClass("cke_dialog_tab")) {
  11967. b = b.$.id;
  11968. this.selectPage(b.substring(4, b.lastIndexOf("_")));
  11969. if(this._.tabBarMode) {
  11970. this._.tabBarMode = false;
  11971. this._.currentFocusIndex = -1;
  11972. j(1)
  11973. }
  11974. a.data.preventDefault()
  11975. }
  11976. }, this);
  11977. u = [];
  11978. q = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, {
  11979. type: "hbox",
  11980. className: "cke_dialog_footer_buttons",
  11981. widths: [],
  11982. children: m.buttons
  11983. }, u).getChild();
  11984. this.parts.footer.setHtml(u.join(""));
  11985. for(u = 0; u < q.length; u++) this._.buttons[q[u].id] = q[u]
  11986. };
  11987. CKEDITOR.dialog.prototype = {
  11988. destroy: function() {
  11989. this.hide();
  11990. this._.element.remove()
  11991. },
  11992. resize: function() {
  11993. return function(a, b) {
  11994. if(!this._.contentSize || !(this._.contentSize.width == a && this._.contentSize.height == b)) {
  11995. CKEDITOR.dialog.fire("resize", {
  11996. dialog: this,
  11997. width: a,
  11998. height: b
  11999. }, this._.editor);
  12000. this.fire("resize", {
  12001. width: a,
  12002. height: b
  12003. },
  12004. this._.editor);
  12005. this.parts.contents.setStyles({
  12006. width: a + "px",
  12007. height: b + "px"
  12008. });
  12009. if(this._.editor.lang.dir == "rtl" && this._.position) this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle("right"), 10);
  12010. this._.contentSize = {
  12011. width: a,
  12012. height: b
  12013. }
  12014. }
  12015. }
  12016. }(),
  12017. getSize: function() {
  12018. var a = this._.element.getFirst();
  12019. return {
  12020. width: a.$.offsetWidth || 0,
  12021. height: a.$.offsetHeight || 0
  12022. }
  12023. },
  12024. move: function(a, b, c) {
  12025. var d = this._.element.getFirst(),
  12026. f = this._.editor.lang.dir ==
  12027. "rtl",
  12028. g = d.getComputedStyle("position") == "fixed";
  12029. CKEDITOR.env.ie && d.setStyle("zoom", "100%");
  12030. if(!g || !this._.position || !(this._.position.x == a && this._.position.y == b)) {
  12031. this._.position = {
  12032. x: a,
  12033. y: b
  12034. };
  12035. if(!g) {
  12036. g = CKEDITOR.document.getWindow().getScrollPosition();
  12037. a = a + g.x;
  12038. b = b + g.y
  12039. }
  12040. if(f) {
  12041. g = this.getSize();
  12042. a = CKEDITOR.document.getWindow().getViewPaneSize().width - g.width - a
  12043. }
  12044. b = {
  12045. top: (b > 0 ? b : 0) + "px"
  12046. };
  12047. b[f ? "right" : "left"] = (a > 0 ? a : 0) + "px";
  12048. d.setStyles(b);
  12049. c && (this._.moved = 1)
  12050. }
  12051. },
  12052. getPosition: function() {
  12053. return CKEDITOR.tools.extend({},
  12054. this._.position)
  12055. },
  12056. show: function() {
  12057. var a = this._.element,
  12058. b = this.definition;
  12059. !a.getParent() || !a.getParent().equals(CKEDITOR.document.getBody()) ? a.appendTo(CKEDITOR.document.getBody()) : a.setStyle("display", "block");
  12060. this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight);
  12061. this.reset();
  12062. this.selectPage(this.definition.contents[0].id);
  12063. if(CKEDITOR.dialog._.currentZIndex === null) CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
  12064. this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex = CKEDITOR.dialog._.currentZIndex + 10);
  12065. if(CKEDITOR.dialog._.currentTop === null) {
  12066. CKEDITOR.dialog._.currentTop = this;
  12067. this._.parentDialog = null;
  12068. o(this._.editor)
  12069. } else {
  12070. this._.parentDialog = CKEDITOR.dialog._.currentTop;
  12071. this._.parentDialog.getElement().getFirst().$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex / 2);
  12072. CKEDITOR.dialog._.currentTop = this
  12073. }
  12074. a.on("keydown", z);
  12075. a.on("keyup", B);
  12076. this._.hasFocus = false;
  12077. for(var c in b.contents)
  12078. if(b.contents[c]) {
  12079. var a =
  12080. b.contents[c],
  12081. d = this._.tabs[a.id],
  12082. g = a.requiredContent,
  12083. e = 0;
  12084. if(d) {
  12085. for(var h in this._.contents[a.id]) {
  12086. var j = this._.contents[a.id][h];
  12087. if(!(j.type == "hbox" || j.type == "vbox" || !j.getInputElement()))
  12088. if(j.requiredContent && !this._.editor.activeFilter.check(j.requiredContent)) j.disable();
  12089. else {
  12090. j.enable();
  12091. e++
  12092. }
  12093. }!e || g && !this._.editor.activeFilter.check(g) ? d[0].addClass("cke_dialog_tab_disabled") : d[0].removeClass("cke_dialog_tab_disabled")
  12094. }
  12095. }
  12096. CKEDITOR.tools.setTimeout(function() {
  12097. this.layout();
  12098. f(this);
  12099. this.parts.dialog.setStyle("visibility",
  12100. "");
  12101. this.fireOnce("load", {});
  12102. CKEDITOR.ui.fire("ready", this);
  12103. this.fire("show", {});
  12104. this._.editor.fire("dialogShow", this);
  12105. this._.parentDialog || this._.editor.focusManager.lock();
  12106. this.foreach(function(a) {
  12107. a.setInitValue && a.setInitValue()
  12108. })
  12109. }, 100, this)
  12110. },
  12111. layout: function() {
  12112. var a = this.parts.dialog,
  12113. b = this.getSize(),
  12114. c = CKEDITOR.document.getWindow().getViewPaneSize(),
  12115. d = (c.width - b.width) / 2,
  12116. f = (c.height - b.height) / 2;
  12117. CKEDITOR.env.ie6Compat || (b.height + (f > 0 ? f : 0) > c.height || b.width + (d > 0 ? d : 0) > c.width ? a.setStyle("position",
  12118. "absolute") : a.setStyle("position", "fixed"));
  12119. this.move(this._.moved ? this._.position.x : d, this._.moved ? this._.position.y : f)
  12120. },
  12121. foreach: function(a) {
  12122. for(var b in this._.contents)
  12123. for(var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
  12124. return this
  12125. },
  12126. reset: function() {
  12127. var a = function(a) {
  12128. a.reset && a.reset(1)
  12129. };
  12130. return function() {
  12131. this.foreach(a);
  12132. return this
  12133. }
  12134. }(),
  12135. setupContent: function() {
  12136. var a = arguments;
  12137. this.foreach(function(b) {
  12138. b.setup && b.setup.apply(b, a)
  12139. })
  12140. },
  12141. commitContent: function() {
  12142. var a = arguments;
  12143. this.foreach(function(b) {
  12144. CKEDITOR.env.ie &&
  12145. this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
  12146. b.commit && b.commit.apply(b, a)
  12147. })
  12148. },
  12149. hide: function() {
  12150. if(this.parts.dialog.isVisible()) {
  12151. this.fire("hide", {});
  12152. this._.editor.fire("dialogHide", this);
  12153. this.selectPage(this._.tabIdList[0]);
  12154. var a = this._.element;
  12155. a.setStyle("display", "none");
  12156. this.parts.dialog.setStyle("visibility", "hidden");
  12157. for(G(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
  12158. if(this._.parentDialog) {
  12159. var b = this._.parentDialog.getElement().getFirst();
  12160. b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2))
  12161. } else q(this._.editor);
  12162. if(CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex = CKEDITOR.dialog._.currentZIndex - 10;
  12163. else {
  12164. CKEDITOR.dialog._.currentZIndex = null;
  12165. a.removeListener("keydown", z);
  12166. a.removeListener("keyup", B);
  12167. var c = this._.editor;
  12168. c.focus();
  12169. setTimeout(function() {
  12170. c.focusManager.unlock();
  12171. CKEDITOR.env.iOS && c.window.focus()
  12172. }, 0)
  12173. }
  12174. delete this._.parentDialog;
  12175. this.foreach(function(a) {
  12176. a.resetInitValue &&
  12177. a.resetInitValue()
  12178. })
  12179. }
  12180. },
  12181. addPage: function(a) {
  12182. if(!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
  12183. for(var b = [], c = a.label ? ' title="' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", d = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, {
  12184. type: "vbox",
  12185. className: "cke_dialog_page_contents",
  12186. children: a.elements,
  12187. expand: !!a.expand,
  12188. padding: a.padding,
  12189. style: a.style || "width: 100%;"
  12190. }, b), f = this._.contents[a.id] = {}, g = d.getChild(), e = 0; d = g.shift();) {
  12191. !d.notAllowed && (d.type != "hbox" && d.type != "vbox") && e++;
  12192. f[d.id] =
  12193. d;
  12194. typeof d.getChild == "function" && g.push.apply(g, d.getChild())
  12195. }
  12196. if(!e) a.hidden = true;
  12197. b = CKEDITOR.dom.element.createFromHtml(b.join(""));
  12198. b.setAttribute("role", "tabpanel");
  12199. d = CKEDITOR.env;
  12200. f = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
  12201. c = CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"', this._.pageCount > 0 ? " cke_last" : "cke_first", c, a.hidden ? ' style="display:none"' : "", ' id="', f, '"', d.gecko && !d.hc ? "" : ' href="javascript:void(0)"', ' tabIndex="-1" hidefocus="true" role="tab">', a.label, "</a>"].join(""));
  12202. b.setAttribute("aria-labelledby", f);
  12203. this._.tabs[a.id] = [c, b];
  12204. this._.tabIdList.push(a.id);
  12205. !a.hidden && this._.pageCount++;
  12206. this._.lastTab = c;
  12207. this.updateStyle();
  12208. b.setAttribute("name", a.id);
  12209. b.appendTo(this.parts.contents);
  12210. c.unselectable();
  12211. this.parts.tabs.append(c);
  12212. if(a.accessKey) {
  12213. A(this, this, "CTRL+" + a.accessKey, J, D);
  12214. this._.accessKeyMap["CTRL+" + a.accessKey] = a.id
  12215. }
  12216. }
  12217. },
  12218. selectPage: function(a) {
  12219. if(this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && this.fire("selectPage", {
  12220. page: a,
  12221. currentPage: this._.currentTabId
  12222. }) !==
  12223. false) {
  12224. for(var c in this._.tabs) {
  12225. var d = this._.tabs[c][0],
  12226. f = this._.tabs[c][1];
  12227. if(c != a) {
  12228. d.removeClass("cke_dialog_tab_selected");
  12229. f.hide()
  12230. }
  12231. f.setAttribute("aria-hidden", c != a)
  12232. }
  12233. var g = this._.tabs[a];
  12234. g[0].addClass("cke_dialog_tab_selected");
  12235. if(CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat) {
  12236. b(g[1]);
  12237. g[1].show();
  12238. setTimeout(function() {
  12239. b(g[1], 1)
  12240. }, 0)
  12241. } else g[1].show();
  12242. this._.currentTabId = a;
  12243. this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
  12244. }
  12245. },
  12246. updateStyle: function() {
  12247. this.parts.dialog[(this._.pageCount ===
  12248. 1 ? "add" : "remove") + "Class"]("cke_single_page")
  12249. },
  12250. hidePage: function(b) {
  12251. var c = this._.tabs[b] && this._.tabs[b][0];
  12252. if(c && this._.pageCount != 1 && c.isVisible()) {
  12253. b == this._.currentTabId && this.selectPage(a.call(this));
  12254. c.hide();
  12255. this._.pageCount--;
  12256. this.updateStyle()
  12257. }
  12258. },
  12259. showPage: function(a) {
  12260. if(a = this._.tabs[a] && this._.tabs[a][0]) {
  12261. a.show();
  12262. this._.pageCount++;
  12263. this.updateStyle()
  12264. }
  12265. },
  12266. getElement: function() {
  12267. return this._.element
  12268. },
  12269. getName: function() {
  12270. return this._.name
  12271. },
  12272. getContentElement: function(a, b) {
  12273. var c = this._.contents[a];
  12274. return c && c[b]
  12275. },
  12276. getValueOf: function(a, b) {
  12277. return this.getContentElement(a, b).getValue()
  12278. },
  12279. setValueOf: function(a, b, c) {
  12280. return this.getContentElement(a, b).setValue(c)
  12281. },
  12282. getButton: function(a) {
  12283. return this._.buttons[a]
  12284. },
  12285. click: function(a) {
  12286. return this._.buttons[a].click()
  12287. },
  12288. disableButton: function(a) {
  12289. return this._.buttons[a].disable()
  12290. },
  12291. enableButton: function(a) {
  12292. return this._.buttons[a].enable()
  12293. },
  12294. getPageCount: function() {
  12295. return this._.pageCount
  12296. },
  12297. getParentEditor: function() {
  12298. return this._.editor
  12299. },
  12300. getSelectedElement: function() {
  12301. return this.getParentEditor().getSelection().getSelectedElement()
  12302. },
  12303. addFocusable: function(a, b) {
  12304. if(typeof b == "undefined") {
  12305. b = this._.focusList.length;
  12306. this._.focusList.push(new j(this, a, b))
  12307. } else {
  12308. this._.focusList.splice(b, 0, new j(this, a, b));
  12309. for(var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++
  12310. }
  12311. }
  12312. };
  12313. CKEDITOR.tools.extend(CKEDITOR.dialog, {
  12314. add: function(a, b) {
  12315. if(!this._.dialogDefinitions[a] || typeof b == "function") this._.dialogDefinitions[a] = b
  12316. },
  12317. exists: function(a) {
  12318. return !!this._.dialogDefinitions[a]
  12319. },
  12320. getCurrent: function() {
  12321. return CKEDITOR.dialog._.currentTop
  12322. },
  12323. isTabEnabled: function(a, b, c) {
  12324. a = a.config.removeDialogTabs;
  12325. return !(a && a.match(RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)", "i")))
  12326. },
  12327. okButton: function() {
  12328. var a = function(a, b) {
  12329. b = b || {};
  12330. return CKEDITOR.tools.extend({
  12331. id: "ok",
  12332. type: "button",
  12333. label: a.lang.common.ok,
  12334. "class": "cke_dialog_ui_button_ok",
  12335. onClick: function(a) {
  12336. a = a.data.dialog;
  12337. a.fire("ok", {
  12338. hide: true
  12339. }).hide !== false && a.hide()
  12340. }
  12341. }, b, true)
  12342. };
  12343. a.type = "button";
  12344. a.override = function(b) {
  12345. return CKEDITOR.tools.extend(function(c) {
  12346. return a(c, b)
  12347. }, {
  12348. type: "button"
  12349. }, true)
  12350. };
  12351. return a
  12352. }(),
  12353. cancelButton: function() {
  12354. var a = function(a, b) {
  12355. b = b || {};
  12356. return CKEDITOR.tools.extend({
  12357. id: "cancel",
  12358. type: "button",
  12359. label: a.lang.common.cancel,
  12360. "class": "cke_dialog_ui_button_cancel",
  12361. onClick: function(a) {
  12362. a = a.data.dialog;
  12363. a.fire("cancel", {
  12364. hide: true
  12365. }).hide !== false && a.hide()
  12366. }
  12367. }, b, true)
  12368. };
  12369. a.type = "button";
  12370. a.override = function(b) {
  12371. return CKEDITOR.tools.extend(function(c) {
  12372. return a(c, b)
  12373. }, {
  12374. type: "button"
  12375. }, true)
  12376. };
  12377. return a
  12378. }(),
  12379. addUIElement: function(a, b) {
  12380. this._.uiElementBuilders[a] = b
  12381. }
  12382. });
  12383. CKEDITOR.dialog._ = {
  12384. uiElementBuilders: {},
  12385. dialogDefinitions: {},
  12386. currentTop: null,
  12387. currentZIndex: null
  12388. };
  12389. CKEDITOR.event.implementOn(CKEDITOR.dialog);
  12390. CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
  12391. var p = {
  12392. resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
  12393. minWidth: 600,
  12394. minHeight: 400,
  12395. buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton]
  12396. },
  12397. t = function(a, b, c) {
  12398. for(var d = 0, f; f = a[d]; d++) {
  12399. if(f.id == b) return f;
  12400. if(c && f[c])
  12401. if(f = t(f[c], b, c)) return f
  12402. }
  12403. return null
  12404. },
  12405. s = function(a, b, c, d, f) {
  12406. if(c) {
  12407. for(var g = 0, e; e = a[g]; g++) {
  12408. if(e.id == c) {
  12409. a.splice(g, 0, b);
  12410. return b
  12411. }
  12412. if(d &&
  12413. e[d])
  12414. if(e = s(e[d], b, c, d, true)) return e
  12415. }
  12416. if(f) return null
  12417. }
  12418. a.push(b);
  12419. return b
  12420. },
  12421. u = function(a, b, c) {
  12422. for(var d = 0, f; f = a[d]; d++) {
  12423. if(f.id == b) return a.splice(d, 1);
  12424. if(c && f[c])
  12425. if(f = u(f[c], b, c)) return f
  12426. }
  12427. return null
  12428. },
  12429. w = function(a, b) {
  12430. this.dialog = a;
  12431. for(var c = b.contents, d = 0, f; f = c[d]; d++) c[d] = f && new h(a, f);
  12432. CKEDITOR.tools.extend(this, b)
  12433. };
  12434. w.prototype = {
  12435. getContents: function(a) {
  12436. return t(this.contents, a)
  12437. },
  12438. getButton: function(a) {
  12439. return t(this.buttons, a)
  12440. },
  12441. addContents: function(a, b) {
  12442. return s(this.contents, a, b)
  12443. },
  12444. addButton: function(a,
  12445. b) {
  12446. return s(this.buttons, a, b)
  12447. },
  12448. removeContents: function(a) {
  12449. u(this.contents, a)
  12450. },
  12451. removeButton: function(a) {
  12452. u(this.buttons, a)
  12453. }
  12454. };
  12455. h.prototype = {
  12456. get: function(a) {
  12457. return t(this.elements, a, "children")
  12458. },
  12459. add: function(a, b) {
  12460. return s(this.elements, a, b, "children")
  12461. },
  12462. remove: function(a) {
  12463. u(this.elements, a, "children")
  12464. }
  12465. };
  12466. var x, v = {},
  12467. r, y = {},
  12468. z = function(a) {
  12469. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  12470. c = a.data.$.altKey,
  12471. d = a.data.$.shiftKey,
  12472. f = String.fromCharCode(a.data.$.keyCode);
  12473. if((b = y[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") +
  12474. f]) && b.length) {
  12475. b = b[b.length - 1];
  12476. b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key);
  12477. a.data.preventDefault()
  12478. }
  12479. },
  12480. B = function(a) {
  12481. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  12482. c = a.data.$.altKey,
  12483. d = a.data.$.shiftKey,
  12484. f = String.fromCharCode(a.data.$.keyCode);
  12485. if((b = y[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + f]) && b.length) {
  12486. b = b[b.length - 1];
  12487. if(b.keyup) {
  12488. b.keyup.call(b.uiElement, b.dialog, b.key);
  12489. a.data.preventDefault()
  12490. }
  12491. }
  12492. },
  12493. A = function(a, b, c, d, f) {
  12494. (y[c] || (y[c] = [])).push({
  12495. uiElement: a,
  12496. dialog: b,
  12497. key: c,
  12498. keyup: f || a.accessKeyUp,
  12499. keydown: d || a.accessKeyDown
  12500. })
  12501. },
  12502. G = function(a) {
  12503. for(var b in y) {
  12504. for(var c = y[b], d = c.length - 1; d >= 0; d--)(c[d].dialog == a || c[d].uiElement == a) && c.splice(d, 1);
  12505. c.length === 0 && delete y[b]
  12506. }
  12507. },
  12508. D = function(a, b) {
  12509. a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b])
  12510. },
  12511. J = function() {};
  12512. (function() {
  12513. CKEDITOR.ui.dialog = {
  12514. uiElement: function(a, b, c, d, f, g, e) {
  12515. if(!(arguments.length < 4)) {
  12516. var h = (d.call ? d(b) : d) || "div",
  12517. j = ["<", h, " "],
  12518. i = (f && f.call ? f(b) : f) || {},
  12519. k = (g && g.call ? g(b) : g) || {},
  12520. p = (e && e.call ? e.call(this, a, b) : e) || "",
  12521. s = this.domId = k.id ||
  12522. CKEDITOR.tools.getNextId() + "_uiElement";
  12523. if(b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent)) {
  12524. i.display = "none";
  12525. this.notAllowed = true
  12526. }
  12527. k.id = s;
  12528. var m = {};
  12529. b.type && (m["cke_dialog_ui_" + b.type] = 1);
  12530. b.className && (m[b.className] = 1);
  12531. if(b.disabled) m.cke_disabled = 1;
  12532. for(var t = k["class"] && k["class"].split ? k["class"].split(" ") : [], s = 0; s < t.length; s++) t[s] && (m[t[s]] = 1);
  12533. t = [];
  12534. for(s in m) t.push(s);
  12535. k["class"] = t.join(" ");
  12536. if(b.title) k.title = b.title;
  12537. m = (b.style || "").split(";");
  12538. if(b.align) {
  12539. t = b.align;
  12540. i["margin-left"] =
  12541. t == "left" ? 0 : "auto";
  12542. i["margin-right"] = t == "right" ? 0 : "auto"
  12543. }
  12544. for(s in i) m.push(s + ":" + i[s]);
  12545. b.hidden && m.push("display:none");
  12546. for(s = m.length - 1; s >= 0; s--) m[s] === "" && m.splice(s, 1);
  12547. if(m.length > 0) k.style = (k.style ? k.style + "; " : "") + m.join("; ");
  12548. for(s in k) j.push(s + '="' + CKEDITOR.tools.htmlEncode(k[s]) + '" ');
  12549. j.push(">", p, "</", h, ">");
  12550. c.push(j.join(""));
  12551. (this._ || (this._ = {})).dialog = a;
  12552. if(typeof b.isChanged == "boolean") this.isChanged = function() {
  12553. return b.isChanged
  12554. };
  12555. if(typeof b.isChanged == "function") this.isChanged = b.isChanged;
  12556. if(typeof b.setValue == "function") this.setValue = CKEDITOR.tools.override(this.setValue, function(a) {
  12557. return function(c) {
  12558. a.call(this, b.setValue.call(this, c))
  12559. }
  12560. });
  12561. if(typeof b.getValue == "function") this.getValue = CKEDITOR.tools.override(this.getValue, function(a) {
  12562. return function() {
  12563. return b.getValue.call(this, a.call(this))
  12564. }
  12565. });
  12566. CKEDITOR.event.implementOn(this);
  12567. this.registerEvents(b);
  12568. this.accessKeyUp && (this.accessKeyDown && b.accessKey) && A(this, a, "CTRL+" + b.accessKey);
  12569. var l = this;
  12570. a.on("load", function() {
  12571. var b = l.getInputElement();
  12572. if(b) {
  12573. var c = l.type in {
  12574. checkbox: 1,
  12575. ratio: 1
  12576. } && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? "cke_dialog_ui_focused" : "";
  12577. b.on("focus", function() {
  12578. a._.tabBarMode = false;
  12579. a._.hasFocus = true;
  12580. l.fire("focus");
  12581. c && this.addClass(c)
  12582. });
  12583. b.on("blur", function() {
  12584. l.fire("blur");
  12585. c && this.removeClass(c)
  12586. })
  12587. }
  12588. });
  12589. CKEDITOR.tools.extend(this, b);
  12590. if(this.keyboardFocusable) {
  12591. this.tabIndex = b.tabIndex || 0;
  12592. this.focusIndex = a._.focusList.push(this) - 1;
  12593. this.on("focus", function() {
  12594. a._.currentFocusIndex = l.focusIndex
  12595. })
  12596. }
  12597. }
  12598. },
  12599. hbox: function(a, b, c, d, f) {
  12600. if(!(arguments.length <
  12601. 4)) {
  12602. this._ || (this._ = {});
  12603. var g = this._.children = b,
  12604. e = f && f.widths || null,
  12605. h = f && f.height || null,
  12606. j, i = {
  12607. role: "presentation"
  12608. };
  12609. f && f.align && (i.align = f.align);
  12610. CKEDITOR.ui.dialog.uiElement.call(this, a, f || {
  12611. type: "hbox"
  12612. }, d, "table", {}, i, function() {
  12613. var a = ['<tbody><tr class="cke_dialog_ui_hbox">'];
  12614. for(j = 0; j < c.length; j++) {
  12615. var b = "cke_dialog_ui_hbox_child",
  12616. d = [];
  12617. j === 0 && (b = "cke_dialog_ui_hbox_first");
  12618. j == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
  12619. a.push('<td class="', b, '" role="presentation" ');
  12620. e ? e[j] && d.push("width:" + m(e[j])) :
  12621. d.push("width:" + Math.floor(100 / c.length) + "%");
  12622. h && d.push("height:" + m(h));
  12623. f && f.padding !== void 0 && d.push("padding:" + m(f.padding));
  12624. CKEDITOR.env.ie && (CKEDITOR.env.quirks && g[j].align) && d.push("text-align:" + g[j].align);
  12625. d.length > 0 && a.push('style="' + d.join("; ") + '" ');
  12626. a.push(">", c[j], "</td>")
  12627. }
  12628. a.push("</tr></tbody>");
  12629. return a.join("")
  12630. })
  12631. }
  12632. },
  12633. vbox: function(a, b, c, d, f) {
  12634. if(!(arguments.length < 3)) {
  12635. this._ || (this._ = {});
  12636. var g = this._.children = b,
  12637. e = f && f.width || null,
  12638. h = f && f.heights || null;
  12639. CKEDITOR.ui.dialog.uiElement.call(this,
  12640. a, f || {
  12641. type: "vbox"
  12642. }, d, "div", null, {
  12643. role: "presentation"
  12644. },
  12645. function() {
  12646. var b = ['<table role="presentation" cellspacing="0" border="0" '];
  12647. b.push('style="');
  12648. f && f.expand && b.push("height:100%;");
  12649. b.push("width:" + m(e || "100%"), ";");
  12650. CKEDITOR.env.webkit && b.push("float:none;");
  12651. b.push('"');
  12652. b.push('align="', CKEDITOR.tools.htmlEncode(f && f.align || (a.getParentEditor().lang.dir == "ltr" ? "left" : "right")), '" ');
  12653. b.push("><tbody>");
  12654. for(var d = 0; d < c.length; d++) {
  12655. var j = [];
  12656. b.push('<tr><td role="presentation" ');
  12657. e && j.push("width:" +
  12658. m(e || "100%"));
  12659. h ? j.push("height:" + m(h[d])) : f && f.expand && j.push("height:" + Math.floor(100 / c.length) + "%");
  12660. f && f.padding !== void 0 && j.push("padding:" + m(f.padding));
  12661. CKEDITOR.env.ie && (CKEDITOR.env.quirks && g[d].align) && j.push("text-align:" + g[d].align);
  12662. j.length > 0 && b.push('style="', j.join("; "), '" ');
  12663. b.push(' class="cke_dialog_ui_vbox_child">', c[d], "</td></tr>")
  12664. }
  12665. b.push("</tbody></table>");
  12666. return b.join("")
  12667. })
  12668. }
  12669. }
  12670. }
  12671. })();
  12672. CKEDITOR.ui.dialog.uiElement.prototype = {
  12673. getElement: function() {
  12674. return CKEDITOR.document.getById(this.domId)
  12675. },
  12676. getInputElement: function() {
  12677. return this.getElement()
  12678. },
  12679. getDialog: function() {
  12680. return this._.dialog
  12681. },
  12682. setValue: function(a, b) {
  12683. this.getInputElement().setValue(a);
  12684. !b && this.fire("change", {
  12685. value: a
  12686. });
  12687. return this
  12688. },
  12689. getValue: function() {
  12690. return this.getInputElement().getValue()
  12691. },
  12692. isChanged: function() {
  12693. return false
  12694. },
  12695. selectParentTab: function() {
  12696. for(var a = this.getInputElement();
  12697. (a = a.getParent()) && a.$.className.search("cke_dialog_page_contents") == -1;);
  12698. if(!a) return this;
  12699. a = a.getAttribute("name");
  12700. this._.dialog._.currentTabId !=
  12701. a && this._.dialog.selectPage(a);
  12702. return this
  12703. },
  12704. focus: function() {
  12705. this.selectParentTab().getInputElement().focus();
  12706. return this
  12707. },
  12708. registerEvents: function(a) {
  12709. var b = /^on([A-Z]\w+)/,
  12710. c, d = function(a, b, c, d) {
  12711. b.on("load", function() {
  12712. a.getInputElement().on(c, d, a)
  12713. })
  12714. },
  12715. f;
  12716. for(f in a)
  12717. if(c = f.match(b)) this.eventProcessors[f] ? this.eventProcessors[f].call(this, this._.dialog, a[f]) : d(this, this._.dialog, c[1].toLowerCase(), a[f]);
  12718. return this
  12719. },
  12720. eventProcessors: {
  12721. onLoad: function(a, b) {
  12722. a.on("load", b, this)
  12723. },
  12724. onShow: function(a, b) {
  12725. a.on("show",
  12726. b, this)
  12727. },
  12728. onHide: function(a, b) {
  12729. a.on("hide", b, this)
  12730. }
  12731. },
  12732. accessKeyDown: function() {
  12733. this.focus()
  12734. },
  12735. accessKeyUp: function() {},
  12736. disable: function() {
  12737. var a = this.getElement();
  12738. this.getInputElement().setAttribute("disabled", "true");
  12739. a.addClass("cke_disabled")
  12740. },
  12741. enable: function() {
  12742. var a = this.getElement();
  12743. this.getInputElement().removeAttribute("disabled");
  12744. a.removeClass("cke_disabled")
  12745. },
  12746. isEnabled: function() {
  12747. return !this.getElement().hasClass("cke_disabled")
  12748. },
  12749. isVisible: function() {
  12750. return this.getInputElement().isVisible()
  12751. },
  12752. isFocusable: function() {
  12753. return !this.isEnabled() || !this.isVisible() ? false : true
  12754. }
  12755. };
  12756. CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  12757. getChild: function(a) {
  12758. if(arguments.length < 1) return this._.children.concat();
  12759. a.splice || (a = [a]);
  12760. return a.length < 2 ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null
  12761. }
  12762. }, true);
  12763. CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
  12764. (function() {
  12765. var a = {
  12766. build: function(a, b, c) {
  12767. for(var d = b.children, f, g = [], e = [], h = 0; h < d.length && (f = d[h]); h++) {
  12768. var j = [];
  12769. g.push(j);
  12770. e.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, j))
  12771. }
  12772. return new CKEDITOR.ui.dialog[b.type](a, e, g, c, b)
  12773. }
  12774. };
  12775. CKEDITOR.dialog.addUIElement("hbox", a);
  12776. CKEDITOR.dialog.addUIElement("vbox", a)
  12777. })();
  12778. CKEDITOR.dialogCommand = function(a, b) {
  12779. this.dialogName = a;
  12780. CKEDITOR.tools.extend(this, b, true)
  12781. };
  12782. CKEDITOR.dialogCommand.prototype = {
  12783. exec: function(a) {
  12784. a.openDialog(this.dialogName)
  12785. },
  12786. canUndo: false,
  12787. editorFocus: 1
  12788. };
  12789. (function() {
  12790. var a = /^([a]|[^a])+$/,
  12791. b = /^\d*$/,
  12792. c = /^\d*(?:\.\d+)?$/,
  12793. d = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
  12794. f = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
  12795. g = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;
  12796. CKEDITOR.VALIDATE_OR = 1;
  12797. CKEDITOR.VALIDATE_AND = 2;
  12798. CKEDITOR.dialog.validate = {
  12799. functions: function() {
  12800. var a = arguments;
  12801. return function() {
  12802. var b = this && this.getValue ? this.getValue() : a[0],
  12803. c, d = CKEDITOR.VALIDATE_AND,
  12804. f = [],
  12805. g;
  12806. for(g = 0; g < a.length; g++)
  12807. if(typeof a[g] == "function") f.push(a[g]);
  12808. else break;
  12809. if(g < a.length && typeof a[g] ==
  12810. "string") {
  12811. c = a[g];
  12812. g++
  12813. }
  12814. g < a.length && typeof a[g] == "number" && (d = a[g]);
  12815. var e = d == CKEDITOR.VALIDATE_AND ? true : false;
  12816. for(g = 0; g < f.length; g++) e = d == CKEDITOR.VALIDATE_AND ? e && f[g](b) : e || f[g](b);
  12817. return !e ? c : true
  12818. }
  12819. },
  12820. regex: function(a, b) {
  12821. return function(c) {
  12822. c = this && this.getValue ? this.getValue() : c;
  12823. return !a.test(c) ? b : true
  12824. }
  12825. },
  12826. notEmpty: function(b) {
  12827. return this.regex(a, b)
  12828. },
  12829. integer: function(a) {
  12830. return this.regex(b, a)
  12831. },
  12832. number: function(a) {
  12833. return this.regex(c, a)
  12834. },
  12835. cssLength: function(a) {
  12836. return this.functions(function(a) {
  12837. return f.test(CKEDITOR.tools.trim(a))
  12838. },
  12839. a)
  12840. },
  12841. htmlLength: function(a) {
  12842. return this.functions(function(a) {
  12843. return d.test(CKEDITOR.tools.trim(a))
  12844. }, a)
  12845. },
  12846. inlineStyle: function(a) {
  12847. return this.functions(function(a) {
  12848. return g.test(CKEDITOR.tools.trim(a))
  12849. }, a)
  12850. },
  12851. equals: function(a, b) {
  12852. return this.functions(function(b) {
  12853. return b == a
  12854. }, b)
  12855. },
  12856. notEqual: function(a, b) {
  12857. return this.functions(function(b) {
  12858. return b != a
  12859. }, b)
  12860. }
  12861. };
  12862. CKEDITOR.on("instanceDestroyed", function(a) {
  12863. if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
  12864. for(var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
  12865. for(var c in v) v[c].remove();
  12866. v = {}
  12867. }
  12868. var a = a.editor._.storedDialogs,
  12869. d;
  12870. for(d in a) a[d].destroy()
  12871. })
  12872. })();
  12873. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  12874. openDialog: function(a, b) {
  12875. var c = null,
  12876. d = CKEDITOR.dialog._.dialogDefinitions[a];
  12877. CKEDITOR.dialog._.currentTop === null && o(this);
  12878. if(typeof d == "function") {
  12879. c = this._.storedDialogs || (this._.storedDialogs = {});
  12880. c = c[a] || (c[a] = new CKEDITOR.dialog(this, a));
  12881. b && b.call(c, c);
  12882. c.show()
  12883. } else {
  12884. if(d == "failed") {
  12885. q(this);
  12886. throw Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.');
  12887. }
  12888. typeof d == "string" && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d), function() {
  12889. typeof CKEDITOR.dialog._.dialogDefinitions[a] != "function" && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed");
  12890. this.openDialog(a, b)
  12891. }, this, 0, 1)
  12892. }
  12893. CKEDITOR.skin.loadPart("dialog");
  12894. return c
  12895. }
  12896. })
  12897. }(), CKEDITOR.plugins.add("dialog", {
  12898. requires: "dialogui",
  12899. init: function(a) {
  12900. a.on("doubleclick", function(e) {
  12901. e.data.dialog && a.openDialog(e.data.dialog)
  12902. }, null, null, 999)
  12903. }
  12904. }),
  12905. function() {
  12906. CKEDITOR.plugins.add("a11yhelp", {
  12907. requires: "dialog",
  12908. availableLangs: {
  12909. af: 1,
  12910. ar: 1,
  12911. bg: 1,
  12912. ca: 1,
  12913. cs: 1,
  12914. cy: 1,
  12915. da: 1,
  12916. de: 1,
  12917. el: 1,
  12918. en: 1,
  12919. "en-gb": 1,
  12920. eo: 1,
  12921. es: 1,
  12922. et: 1,
  12923. fa: 1,
  12924. fi: 1,
  12925. fr: 1,
  12926. "fr-ca": 1,
  12927. gl: 1,
  12928. gu: 1,
  12929. he: 1,
  12930. hi: 1,
  12931. hr: 1,
  12932. hu: 1,
  12933. id: 1,
  12934. it: 1,
  12935. ja: 1,
  12936. km: 1,
  12937. ko: 1,
  12938. ku: 1,
  12939. lt: 1,
  12940. lv: 1,
  12941. mk: 1,
  12942. mn: 1,
  12943. nb: 1,
  12944. nl: 1,
  12945. no: 1,
  12946. pl: 1,
  12947. pt: 1,
  12948. "pt-br": 1,
  12949. ro: 1,
  12950. ru: 1,
  12951. si: 1,
  12952. sk: 1,
  12953. sl: 1,
  12954. sq: 1,
  12955. sr: 1,
  12956. "sr-latn": 1,
  12957. sv: 1,
  12958. th: 1,
  12959. tr: 1,
  12960. tt: 1,
  12961. ug: 1,
  12962. uk: 1,
  12963. vi: 1,
  12964. zh: 1,
  12965. "zh-cn": 1
  12966. },
  12967. init: function(a) {
  12968. var e = this;
  12969. a.addCommand("a11yHelp", {
  12970. exec: function() {
  12971. var b = a.langCode,
  12972. b = e.availableLangs[b] ? b : e.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  12973. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e.path +
  12974. "dialogs/lang/" + b + ".js"), function() {
  12975. a.lang.a11yhelp = e.langEntries[b];
  12976. a.openDialog("a11yHelp")
  12977. })
  12978. },
  12979. modes: {
  12980. wysiwyg: 1,
  12981. source: 1
  12982. },
  12983. readOnly: 1,
  12984. canUndo: false
  12985. });
  12986. a.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp");
  12987. CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js");
  12988. a.on("ariaEditorHelpLabel", function(b) {
  12989. b.data.label = a.lang.common.editorHelp
  12990. })
  12991. }
  12992. })
  12993. }(), CKEDITOR.plugins.add("about", {
  12994. requires: "dialog",
  12995. init: function(a) {
  12996. var e = a.addCommand("about", new CKEDITOR.dialogCommand("about"));
  12997. e.modes = {
  12998. wysiwyg: 1,
  12999. source: 1
  13000. };
  13001. e.canUndo = false;
  13002. e.readOnly = 1;
  13003. a.ui.addButton && a.ui.addButton("About", {
  13004. label: a.lang.about.title,
  13005. command: "about",
  13006. toolbar: "about"
  13007. });
  13008. CKEDITOR.dialog.add("about", this.path + "dialogs/about.js")
  13009. }
  13010. }), CKEDITOR.plugins.add("basicstyles", {
  13011. init: function(a) {
  13012. var e = 0,
  13013. b = function(b, c, d, i) {
  13014. if(i) {
  13015. var i = new CKEDITOR.style(i),
  13016. k = g[d];
  13017. k.unshift(i);
  13018. a.attachStyleStateChange(i, function(b) {
  13019. !a.readOnly && a.getCommand(d).setState(b)
  13020. });
  13021. a.addCommand(d, new CKEDITOR.styleCommand(i, {
  13022. contentForms: k
  13023. }));
  13024. a.ui.addButton && a.ui.addButton(b, {
  13025. label: c,
  13026. command: d,
  13027. toolbar: "basicstyles," + (e = e + 10)
  13028. })
  13029. }
  13030. },
  13031. g = {
  13032. bold: ["strong", "b", ["span", function(a) {
  13033. a = a.styles["font-weight"];
  13034. return a == "bold" || +a >= 700
  13035. }]],
  13036. italic: ["em", "i", ["span", function(a) {
  13037. return a.styles["font-style"] == "italic"
  13038. }]],
  13039. underline: ["u", ["span", function(a) {
  13040. return a.styles["text-decoration"] == "underline"
  13041. }]],
  13042. strike: ["s", "strike", ["span", function(a) {
  13043. return a.styles["text-decoration"] == "line-through"
  13044. }]],
  13045. subscript: ["sub"],
  13046. superscript: ["sup"]
  13047. },
  13048. c = a.config,
  13049. d = a.lang.basicstyles;
  13050. b("Bold", d.bold, "bold",
  13051. c.coreStyles_bold);
  13052. b("Italic", d.italic, "italic", c.coreStyles_italic);
  13053. b("Underline", d.underline, "underline", c.coreStyles_underline);
  13054. b("Strike", d.strike, "strike", c.coreStyles_strike);
  13055. b("Subscript", d.subscript, "subscript", c.coreStyles_subscript);
  13056. b("Superscript", d.superscript, "superscript", c.coreStyles_superscript);
  13057. a.setKeystroke([
  13058. [CKEDITOR.CTRL + 66, "bold"],
  13059. [CKEDITOR.CTRL + 73, "italic"],
  13060. [CKEDITOR.CTRL + 85, "underline"]
  13061. ])
  13062. }
  13063. }), CKEDITOR.config.coreStyles_bold = {
  13064. element: "strong",
  13065. overrides: "b"
  13066. }, CKEDITOR.config.coreStyles_italic = {
  13067. element: "em",
  13068. overrides: "i"
  13069. }, CKEDITOR.config.coreStyles_underline = {
  13070. element: "u"
  13071. }, CKEDITOR.config.coreStyles_strike = {
  13072. element: "s",
  13073. overrides: "strike"
  13074. }, CKEDITOR.config.coreStyles_subscript = {
  13075. element: "sub"
  13076. }, CKEDITOR.config.coreStyles_superscript = {
  13077. element: "sup"
  13078. },
  13079. function() {
  13080. var a = {
  13081. exec: function(a) {
  13082. var b = a.getCommand("blockquote").state,
  13083. g = a.getSelection(),
  13084. c = g && g.getRanges()[0];
  13085. if(c) {
  13086. var d = g.createBookmarks();
  13087. if(CKEDITOR.env.ie) {
  13088. var j = d[0].startNode,
  13089. f = d[0].endNode,
  13090. h;
  13091. if(j && j.getParent().getName() == "blockquote")
  13092. for(h =
  13093. j; h = h.getNext();)
  13094. if(h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) {
  13095. j.move(h, true);
  13096. break
  13097. }
  13098. if(f && f.getParent().getName() == "blockquote")
  13099. for(h = f; h = h.getPrevious();)
  13100. if(h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) {
  13101. f.move(h);
  13102. break
  13103. }
  13104. }
  13105. var i = c.createIterator();
  13106. i.enlargeBr = a.config.enterMode != CKEDITOR.ENTER_BR;
  13107. if(b == CKEDITOR.TRISTATE_OFF) {
  13108. for(j = []; b = i.getNextParagraph();) j.push(b);
  13109. if(j.length < 1) {
  13110. b = a.document.createElement(a.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div");
  13111. f = d.shift();
  13112. c.insertNode(b);
  13113. b.append(new CKEDITOR.dom.text("", a.document));
  13114. c.moveToBookmark(f);
  13115. c.selectNodeContents(b);
  13116. c.collapse(true);
  13117. f = c.createBookmark();
  13118. j.push(b);
  13119. d.unshift(f)
  13120. }
  13121. h = j[0].getParent();
  13122. c = [];
  13123. for(f = 0; f < j.length; f++) {
  13124. b = j[f];
  13125. h = h.getCommonAncestor(b.getParent())
  13126. }
  13127. for(b = {
  13128. table: 1,
  13129. tbody: 1,
  13130. tr: 1,
  13131. ol: 1,
  13132. ul: 1
  13133. }; b[h.getName()];) h = h.getParent();
  13134. for(f = null; j.length > 0;) {
  13135. for(b = j.shift(); !b.getParent().equals(h);) b = b.getParent();
  13136. b.equals(f) || c.push(b);
  13137. f = b
  13138. }
  13139. for(; c.length > 0;) {
  13140. b = c.shift();
  13141. if(b.getName() == "blockquote") {
  13142. for(f = new CKEDITOR.dom.documentFragment(a.document); b.getFirst();) {
  13143. f.append(b.getFirst().remove());
  13144. j.push(f.getLast())
  13145. }
  13146. f.replace(b)
  13147. } else j.push(b)
  13148. }
  13149. c = a.document.createElement("blockquote");
  13150. for(c.insertBefore(j[0]); j.length > 0;) {
  13151. b = j.shift();
  13152. c.append(b)
  13153. }
  13154. } else if(b == CKEDITOR.TRISTATE_ON) {
  13155. f = [];
  13156. for(h = {}; b = i.getNextParagraph();) {
  13157. for(j = c = null; b.getParent();) {
  13158. if(b.getParent().getName() == "blockquote") {
  13159. c = b.getParent();
  13160. j = b;
  13161. break
  13162. }
  13163. b = b.getParent()
  13164. }
  13165. if(c && j && !j.getCustomData("blockquote_moveout")) {
  13166. f.push(j);
  13167. CKEDITOR.dom.element.setMarker(h, j, "blockquote_moveout", true)
  13168. }
  13169. }
  13170. CKEDITOR.dom.element.clearAllMarkers(h);
  13171. b = [];
  13172. j = [];
  13173. for(h = {}; f.length > 0;) {
  13174. i = f.shift();
  13175. c = i.getParent();
  13176. if(i.getPrevious())
  13177. if(i.getNext()) {
  13178. i.breakParent(i.getParent());
  13179. j.push(i.getNext())
  13180. } else i.remove().insertAfter(c);
  13181. else i.remove().insertBefore(c);
  13182. if(!c.getCustomData("blockquote_processed")) {
  13183. j.push(c);
  13184. CKEDITOR.dom.element.setMarker(h, c, "blockquote_processed", true)
  13185. }
  13186. b.push(i)
  13187. }
  13188. CKEDITOR.dom.element.clearAllMarkers(h);
  13189. for(f = j.length - 1; f >= 0; f--) {
  13190. c = j[f];
  13191. a: {
  13192. h = c;
  13193. for(var i = 0, k = h.getChildCount(), n = void 0; i < k && (n = h.getChild(i)); i++)
  13194. if(n.type == CKEDITOR.NODE_ELEMENT &&
  13195. n.isBlockBoundary()) {
  13196. h = false;
  13197. break a
  13198. }
  13199. h = true
  13200. }
  13201. h && c.remove()
  13202. }
  13203. if(a.config.enterMode == CKEDITOR.ENTER_BR)
  13204. for(c = true; b.length;) {
  13205. i = b.shift();
  13206. if(i.getName() == "div") {
  13207. f = new CKEDITOR.dom.documentFragment(a.document);
  13208. c && (i.getPrevious() && !(i.getPrevious().type == CKEDITOR.NODE_ELEMENT && i.getPrevious().isBlockBoundary())) && f.append(a.document.createElement("br"));
  13209. for(c = i.getNext() && !(i.getNext().type == CKEDITOR.NODE_ELEMENT && i.getNext().isBlockBoundary()); i.getFirst();) i.getFirst().remove().appendTo(f);
  13210. c && f.append(a.document.createElement("br"));
  13211. f.replace(i);
  13212. c = false
  13213. }
  13214. }
  13215. }
  13216. g.selectBookmarks(d);
  13217. a.focus()
  13218. }
  13219. },
  13220. refresh: function(a, b) {
  13221. this.setState(a.elementPath(b.block || b.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
  13222. },
  13223. context: "blockquote",
  13224. allowedContent: "blockquote",
  13225. requiredContent: "blockquote"
  13226. };
  13227. CKEDITOR.plugins.add("blockquote", {
  13228. init: function(e) {
  13229. if(!e.blockless) {
  13230. e.addCommand("blockquote", a);
  13231. e.ui.addButton && e.ui.addButton("Blockquote", {
  13232. label: e.lang.blockquote.toolbar,
  13233. command: "blockquote",
  13234. toolbar: "blocks,10"
  13235. })
  13236. }
  13237. }
  13238. })
  13239. }(),
  13240. "use strict",
  13241. function() {
  13242. function a(a) {
  13243. function b() {
  13244. var c = a.editable();
  13245. c.on(y, function(a) {
  13246. (!CKEDITOR.env.ie || !x) && s(a)
  13247. });
  13248. CKEDITOR.env.ie && c.on("paste", function(b) {
  13249. if(!v) {
  13250. g();
  13251. b.data.preventDefault();
  13252. s(b);
  13253. o("paste") || a.openDialog("paste")
  13254. }
  13255. });
  13256. if(CKEDITOR.env.ie) {
  13257. c.on("contextmenu", e, null, null, 0);
  13258. c.on("beforepaste", function(a) {
  13259. a.data && (!a.data.$.ctrlKey && !a.data.$.shiftKey) && e()
  13260. }, null, null, 0)
  13261. }
  13262. c.on("beforecut", function() {
  13263. !x && m(a)
  13264. });
  13265. var d;
  13266. c.attachListener(CKEDITOR.env.ie ? c : a.document.getDocumentElement(),
  13267. "mouseup",
  13268. function() {
  13269. d = setTimeout(function() {
  13270. u()
  13271. }, 0)
  13272. });
  13273. a.on("destroy", function() {
  13274. clearTimeout(d)
  13275. });
  13276. c.on("keyup", u)
  13277. }
  13278. function c(b) {
  13279. return {
  13280. type: b,
  13281. canUndo: b == "cut",
  13282. startDisabled: true,
  13283. exec: function() {
  13284. this.type == "cut" && m();
  13285. var b;
  13286. var c = this.type;
  13287. if(CKEDITOR.env.ie) b = o(c);
  13288. else try {
  13289. b = a.document.$.execCommand(c, false, null)
  13290. } catch(d) {
  13291. b = false
  13292. }
  13293. b || alert(a.lang.clipboard[this.type + "Error"]);
  13294. return b
  13295. }
  13296. }
  13297. }
  13298. function d() {
  13299. return {
  13300. canUndo: false,
  13301. async: true,
  13302. exec: function(a, b) {
  13303. var c = function(b, c) {
  13304. b && q(b.type, b.dataValue, !!c);
  13305. a.fire("afterCommandExec", {
  13306. name: "paste",
  13307. command: d,
  13308. returnValue: !!b
  13309. })
  13310. },
  13311. d = this;
  13312. typeof b == "string" ? c({
  13313. type: "auto",
  13314. dataValue: b
  13315. }, 1) : a.getClipboardData(c)
  13316. }
  13317. }
  13318. }
  13319. function g() {
  13320. v = 1;
  13321. setTimeout(function() {
  13322. v = 0
  13323. }, 100)
  13324. }
  13325. function e() {
  13326. x = 1;
  13327. setTimeout(function() {
  13328. x = 0
  13329. }, 10)
  13330. }
  13331. function o(b) {
  13332. var c = a.document,
  13333. d = c.getBody(),
  13334. f = false,
  13335. g = function() {
  13336. f = true
  13337. };
  13338. d.on(b, g);
  13339. (CKEDITOR.env.version > 7 ? c.$ : c.$.selection.createRange()).execCommand(b);
  13340. d.removeListener(b, g);
  13341. return f
  13342. }
  13343. function q(b, c, d) {
  13344. b = {
  13345. type: b
  13346. };
  13347. if(d && a.fire("beforePaste", b) === false ||
  13348. !c) return false;
  13349. b.dataValue = c;
  13350. return a.fire("paste", b)
  13351. }
  13352. function m() {
  13353. if(CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  13354. var b = a.getSelection(),
  13355. c, d, f;
  13356. if(b.getType() == CKEDITOR.SELECTION_ELEMENT && (c = b.getSelectedElement())) {
  13357. d = b.getRanges()[0];
  13358. f = a.document.createText("");
  13359. f.insertBefore(c);
  13360. d.setStartBefore(f);
  13361. d.setEndAfter(c);
  13362. b.selectRanges([d]);
  13363. setTimeout(function() {
  13364. if(c.getParent()) {
  13365. f.remove();
  13366. b.selectElement(c)
  13367. }
  13368. }, 0)
  13369. }
  13370. }
  13371. }
  13372. function l(b, c) {
  13373. var d = a.document,
  13374. f = a.editable(),
  13375. g = function(a) {
  13376. a.cancel()
  13377. },
  13378. e;
  13379. if(!d.getById("cke_pastebin")) {
  13380. var h =
  13381. a.getSelection(),
  13382. i = h.createBookmarks();
  13383. CKEDITOR.env.ie && h.root.fire("selectionchange");
  13384. var k = new CKEDITOR.dom.element((CKEDITOR.env.webkit || f.is("body")) && !CKEDITOR.env.ie ? "body" : "div", d);
  13385. k.setAttributes({
  13386. id: "cke_pastebin",
  13387. "data-cke-temp": "1"
  13388. });
  13389. var s = 0,
  13390. d = d.getWindow();
  13391. if(CKEDITOR.env.webkit) {
  13392. f.append(k);
  13393. k.addClass("cke_editable");
  13394. if(!f.is("body")) {
  13395. s = f.getComputedStyle("position") != "static" ? f : CKEDITOR.dom.element.get(f.$.offsetParent);
  13396. s = s.getDocumentPosition().y
  13397. }
  13398. } else f.getAscendant(CKEDITOR.env.ie ?
  13399. "body" : "html", 1).append(k);
  13400. k.setStyles({
  13401. position: "absolute",
  13402. top: d.getScrollPosition().y - s + 10 + "px",
  13403. width: "1px",
  13404. height: Math.max(1, d.getViewPaneSize().height - 20) + "px",
  13405. overflow: "hidden",
  13406. margin: 0,
  13407. padding: 0
  13408. });
  13409. CKEDITOR.env.safari && k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text"));
  13410. if(s = k.getParent().isReadOnly()) {
  13411. k.setOpacity(0);
  13412. k.setAttribute("contenteditable", true)
  13413. } else k.setStyle(a.config.contentsLangDirection == "ltr" ? "left" : "right", "-1000px");
  13414. a.on("selectionChange", g, null, null, 0);
  13415. if(CKEDITOR.env.webkit ||
  13416. CKEDITOR.env.gecko) e = f.once("blur", g, null, null, -100);
  13417. s && k.focus();
  13418. s = new CKEDITOR.dom.range(k);
  13419. s.selectNodeContents(k);
  13420. var p = s.select();
  13421. CKEDITOR.env.ie && (e = f.once("blur", function() {
  13422. a.lockSelection(p)
  13423. }));
  13424. var m = CKEDITOR.document.getWindow().getScrollPosition().y;
  13425. setTimeout(function() {
  13426. if(CKEDITOR.env.webkit) CKEDITOR.document.getBody().$.scrollTop = m;
  13427. e && e.removeListener();
  13428. CKEDITOR.env.ie && f.focus();
  13429. h.selectBookmarks(i);
  13430. k.remove();
  13431. var b;
  13432. if(CKEDITOR.env.webkit && (b = k.getFirst()) && b.is && b.hasClass("Apple-style-span")) k =
  13433. b;
  13434. a.removeListener("selectionChange", g);
  13435. c(k.getHtml())
  13436. }, 0)
  13437. }
  13438. }
  13439. function p() {
  13440. if(CKEDITOR.env.ie) {
  13441. a.focus();
  13442. g();
  13443. var b = a.focusManager;
  13444. b.lock();
  13445. if(a.editable().fire(y) && !o("paste")) {
  13446. b.unlock();
  13447. return false
  13448. }
  13449. b.unlock()
  13450. } else try {
  13451. if(a.editable().fire(y) && !a.document.$.execCommand("Paste", false, null)) throw 0;
  13452. } catch(c) {
  13453. return false
  13454. }
  13455. return true
  13456. }
  13457. function t(b) {
  13458. if(a.mode == "wysiwyg") switch(b.data.keyCode) {
  13459. case CKEDITOR.CTRL + 86:
  13460. case CKEDITOR.SHIFT + 45:
  13461. b = a.editable();
  13462. g();
  13463. !CKEDITOR.env.ie && b.fire("beforepaste");
  13464. break;
  13465. case CKEDITOR.CTRL + 88:
  13466. case CKEDITOR.SHIFT + 46:
  13467. a.fire("saveSnapshot");
  13468. setTimeout(function() {
  13469. a.fire("saveSnapshot")
  13470. }, 50)
  13471. }
  13472. }
  13473. function s(b) {
  13474. var c = {
  13475. type: "auto"
  13476. },
  13477. d = a.fire("beforePaste", c);
  13478. l(b, function(a) {
  13479. a = a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig, "");
  13480. d && q(c.type, a, 0, 1)
  13481. })
  13482. }
  13483. function u() {
  13484. if(a.mode == "wysiwyg") {
  13485. var b = w("paste");
  13486. a.getCommand("cut").setState(w("cut"));
  13487. a.getCommand("copy").setState(w("copy"));
  13488. a.getCommand("paste").setState(b);
  13489. a.fire("pasteState", b)
  13490. }
  13491. }
  13492. function w(b) {
  13493. if(r && b in {
  13494. paste: 1,
  13495. cut: 1
  13496. }) return CKEDITOR.TRISTATE_DISABLED;
  13497. if(b == "paste") return CKEDITOR.TRISTATE_OFF;
  13498. var b = a.getSelection(),
  13499. c = b.getRanges();
  13500. return b.getType() == CKEDITOR.SELECTION_NONE || c.length == 1 && c[0].collapsed ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF
  13501. }
  13502. var x = 0,
  13503. v = 0,
  13504. r = 0,
  13505. y = CKEDITOR.env.ie ? "beforepaste" : "paste";
  13506. (function() {
  13507. a.on("key", t);
  13508. a.on("contentDom", b);
  13509. a.on("selectionChange", function(a) {
  13510. r = a.data.selection.getRanges()[0].checkReadOnly();
  13511. u()
  13512. });
  13513. a.contextMenu && a.contextMenu.addListener(function(a, b) {
  13514. r = b.getRanges()[0].checkReadOnly();
  13515. return {
  13516. cut: w("cut"),
  13517. copy: w("copy"),
  13518. paste: w("paste")
  13519. }
  13520. })
  13521. })();
  13522. (function() {
  13523. function b(c, d, f, g, e) {
  13524. var h = a.lang.clipboard[d];
  13525. a.addCommand(d, f);
  13526. a.ui.addButton && a.ui.addButton(c, {
  13527. label: h,
  13528. command: d,
  13529. toolbar: "clipboard," + g
  13530. });
  13531. a.addMenuItems && a.addMenuItem(d, {
  13532. label: h,
  13533. command: d,
  13534. group: "clipboard",
  13535. order: e
  13536. })
  13537. }
  13538. b("Cut", "cut", c("cut"), 10, 1);
  13539. b("Copy", "copy", c("copy"), 20, 4);
  13540. b("Paste", "paste", d(), 30, 8)
  13541. })();
  13542. a.getClipboardData = function(b, c) {
  13543. function d(a) {
  13544. a.removeListener();
  13545. a.cancel();
  13546. c(a.data)
  13547. }
  13548. function f(a) {
  13549. a.removeListener();
  13550. a.cancel();
  13551. i = true;
  13552. c({
  13553. type: h,
  13554. dataValue: a.data
  13555. })
  13556. }
  13557. function g() {
  13558. this.customTitle = b && b.title
  13559. }
  13560. var e = false,
  13561. h = "auto",
  13562. i = false;
  13563. if(!c) {
  13564. c = b;
  13565. b = null
  13566. }
  13567. a.on("paste", d, null, null, 0);
  13568. a.on("beforePaste", function(a) {
  13569. a.removeListener();
  13570. e = true;
  13571. h = a.data.type
  13572. }, null, null, 1E3);
  13573. if(p() === false) {
  13574. a.removeListener("paste", d);
  13575. if(e && a.fire("pasteDialog", g)) {
  13576. a.on("pasteDialogCommit", f);
  13577. a.on("dialogHide", function(a) {
  13578. a.removeListener();
  13579. a.data.removeListener("pasteDialogCommit", f);
  13580. setTimeout(function() {
  13581. i || c(null)
  13582. }, 10)
  13583. })
  13584. } else c(null)
  13585. }
  13586. }
  13587. }
  13588. function e(a) {
  13589. if(CKEDITOR.env.webkit) {
  13590. if(!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html"
  13591. } else if(CKEDITOR.env.ie) {
  13592. if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi) && !a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html"
  13593. } else if(CKEDITOR.env.gecko) {
  13594. if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html"
  13595. } else return "html";
  13596. return "htmlifiedtext"
  13597. }
  13598. function b(a, b) {
  13599. function c(a) {
  13600. return CKEDITOR.tools.repeat("</p><p>", ~~(a / 2)) + (a % 2 == 1 ? "<br>" : "")
  13601. }
  13602. b = b.replace(/\s+/g,
  13603. " ").replace(/> +</g, "><").replace(/<br ?\/>/gi, "<br>");
  13604. b = b.replace(/<\/?[A-Z]+>/g, function(a) {
  13605. return a.toLowerCase()
  13606. });
  13607. if(b.match(/^[^<]$/)) return b;
  13608. if(CKEDITOR.env.webkit && b.indexOf("<div>") > -1) {
  13609. b = b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g, "<div></div>");
  13610. b.match(/<div>(<br>|)<\/div>/) && (b = "<p>" + b.replace(/(<div>(<br>|)<\/div>)+/g, function(a) {
  13611. return c(a.split("</div><div>").length + 1)
  13612. }) + "</p>");
  13613. b = b.replace(/<\/div><div>/g, "<br>");
  13614. b = b.replace(/<\/?div>/g, "")
  13615. }
  13616. if(CKEDITOR.env.gecko && a.enterMode != CKEDITOR.ENTER_BR) {
  13617. CKEDITOR.env.gecko && (b = b.replace(/^<br><br>$/, "<br>"));
  13618. b.indexOf("<br><br>") > -1 && (b = "<p>" + b.replace(/(<br>){2,}/g, function(a) {
  13619. return c(a.length / 4)
  13620. }) + "</p>")
  13621. }
  13622. return d(a, b)
  13623. }
  13624. function g() {
  13625. var a = new CKEDITOR.htmlParser.filter,
  13626. b = {
  13627. blockquote: 1,
  13628. dl: 1,
  13629. fieldset: 1,
  13630. h1: 1,
  13631. h2: 1,
  13632. h3: 1,
  13633. h4: 1,
  13634. h5: 1,
  13635. h6: 1,
  13636. ol: 1,
  13637. p: 1,
  13638. table: 1,
  13639. ul: 1
  13640. },
  13641. c = CKEDITOR.tools.extend({
  13642. br: 0
  13643. }, CKEDITOR.dtd.$inline),
  13644. d = {
  13645. p: 1,
  13646. br: 1,
  13647. "cke:br": 1
  13648. },
  13649. g = CKEDITOR.dtd,
  13650. e = CKEDITOR.tools.extend({
  13651. area: 1,
  13652. basefont: 1,
  13653. embed: 1,
  13654. iframe: 1,
  13655. map: 1,
  13656. object: 1,
  13657. param: 1
  13658. }, CKEDITOR.dtd.$nonBodyContent, CKEDITOR.dtd.$cdata),
  13659. o = function(a) {
  13660. delete a.name;
  13661. a.add(new CKEDITOR.htmlParser.text(" "))
  13662. },
  13663. q = function(a) {
  13664. for(var b = a, c;
  13665. (b = b.next) && b.name && b.name.match(/^h\d$/);) {
  13666. c = new CKEDITOR.htmlParser.element("cke:br");
  13667. c.isEmpty = true;
  13668. for(a.add(c); c = b.children.shift();) a.add(c)
  13669. }
  13670. };
  13671. a.addRules({
  13672. elements: {
  13673. h1: q,
  13674. h2: q,
  13675. h3: q,
  13676. h4: q,
  13677. h5: q,
  13678. h6: q,
  13679. img: function(a) {
  13680. var a = CKEDITOR.tools.trim(a.attributes.alt || ""),
  13681. b = " ";
  13682. a && !a.match(/(^http|\.(jpe?g|gif|png))/i) &&
  13683. (b = " [" + a + "] ");
  13684. return new CKEDITOR.htmlParser.text(b)
  13685. },
  13686. td: o,
  13687. th: o,
  13688. $: function(a) {
  13689. var j = a.name,
  13690. p;
  13691. if(e[j]) return false;
  13692. a.attributes = {};
  13693. if(j == "br") return a;
  13694. if(b[j]) a.name = "p";
  13695. else if(c[j]) delete a.name;
  13696. else if(g[j]) {
  13697. p = new CKEDITOR.htmlParser.element("cke:br");
  13698. p.isEmpty = true;
  13699. if(CKEDITOR.dtd.$empty[j]) return p;
  13700. a.add(p, 0);
  13701. p = p.clone();
  13702. p.isEmpty = true;
  13703. a.add(p);
  13704. delete a.name
  13705. }
  13706. d[a.name] || delete a.name;
  13707. return a
  13708. }
  13709. }
  13710. }, {
  13711. applyToAll: true
  13712. });
  13713. return a
  13714. }
  13715. function c(a, b, c) {
  13716. var b = new CKEDITOR.htmlParser.fragment.fromHtml(b),
  13717. g = new CKEDITOR.htmlParser.basicWriter;
  13718. b.writeHtml(g, c);
  13719. var b = g.getHtml(),
  13720. b = b.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g, "$1").replace(/(<cke:br \/>){2,}/g, "<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g, "$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g, "$1").replace(/<(cke:)?br( \/)?>/g, "<br>").replace(/<p><\/p>/g, ""),
  13721. e = 0,
  13722. b = b.replace(/<\/?p>/g, function(a) {
  13723. if(a == "<p>") {
  13724. if(++e > 1) return "</p><p>"
  13725. } else if(--e > 0) return "</p><p>";
  13726. return a
  13727. }).replace(/<p><\/p>/g, "");
  13728. return d(a, b)
  13729. }
  13730. function d(a, b) {
  13731. a.enterMode ==
  13732. CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function(a) {
  13733. return CKEDITOR.tools.repeat("<br>", a.length / 7 * 2)
  13734. }).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, "<$1div>"));
  13735. return b
  13736. }
  13737. CKEDITOR.plugins.add("clipboard", {
  13738. requires: "dialog",
  13739. init: function(d) {
  13740. var f;
  13741. a(d);
  13742. CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path + "dialogs/paste.js"));
  13743. d.on("paste", function(a) {
  13744. var b = a.data.dataValue,
  13745. c = CKEDITOR.dtd.$block;
  13746. if(b.indexOf("Apple-") > -1) {
  13747. b = b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi,
  13748. " ");
  13749. a.data.type != "html" && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) {
  13750. return b.replace(/\t/g, "&nbsp;&nbsp; &nbsp;")
  13751. }));
  13752. if(b.indexOf('<br class="Apple-interchange-newline">') > -1) {
  13753. a.data.startsWithEOL = 1;
  13754. a.data.preSniffing = "html";
  13755. b = b.replace(/<br class="Apple-interchange-newline">/, "")
  13756. }
  13757. b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi, "$1")
  13758. }
  13759. if(b.match(/^<[^<]+cke_(editable|contents)/i)) {
  13760. var d, f, g = new CKEDITOR.dom.element("div");
  13761. for(g.setHtml(b); g.getChildCount() == 1 && (d =
  13762. g.getFirst()) && d.type == CKEDITOR.NODE_ELEMENT && (d.hasClass("cke_editable") || d.hasClass("cke_contents"));) g = f = d;
  13763. f && (b = f.getHtml().replace(/<br>$/i, ""))
  13764. }
  13765. CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function(b, d) {
  13766. if(d.toLowerCase() in c) {
  13767. a.data.preSniffing = "html";
  13768. return "<" + d
  13769. }
  13770. return b
  13771. }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, d) {
  13772. if(d in c) {
  13773. a.data.endsWithEOL = 1;
  13774. return "</" + d + ">"
  13775. }
  13776. return b
  13777. }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
  13778. a.data.dataValue = b
  13779. }, null,
  13780. null, 3);
  13781. d.on("paste", function(a) {
  13782. var a = a.data,
  13783. i = a.type,
  13784. k = a.dataValue,
  13785. n, o = d.config.clipboard_defaultContentType || "html";
  13786. n = i == "html" || a.preSniffing == "html" ? "html" : e(k);
  13787. n == "htmlifiedtext" ? k = b(d.config, k) : i == "text" && n == "html" && (k = c(d.config, k, f || (f = g(d))));
  13788. a.startsWithEOL && (k = '<br data-cke-eol="1">' + k);
  13789. a.endsWithEOL && (k = k + '<br data-cke-eol="1">');
  13790. i == "auto" && (i = n == "html" || o == "html" ? "html" : "text");
  13791. a.type = i;
  13792. a.dataValue = k;
  13793. delete a.preSniffing;
  13794. delete a.startsWithEOL;
  13795. delete a.endsWithEOL
  13796. }, null, null, 6);
  13797. d.on("paste",
  13798. function(a) {
  13799. a = a.data;
  13800. d.insertHtml(a.dataValue, a.type);
  13801. setTimeout(function() {
  13802. d.fire("afterPaste")
  13803. }, 0)
  13804. }, null, null, 1E3);
  13805. d.on("pasteDialog", function(a) {
  13806. setTimeout(function() {
  13807. d.openDialog("paste", a.data)
  13808. }, 0)
  13809. })
  13810. }
  13811. })
  13812. }(),
  13813. function() {
  13814. CKEDITOR.plugins.add("panel", {
  13815. beforeInit: function(a) {
  13816. a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler)
  13817. }
  13818. });
  13819. CKEDITOR.UI_PANEL = "panel";
  13820. CKEDITOR.ui.panel = function(a, b) {
  13821. b && CKEDITOR.tools.extend(this, b);
  13822. CKEDITOR.tools.extend(this, {
  13823. className: "",
  13824. css: []
  13825. });
  13826. this.id = CKEDITOR.tools.getNextId();
  13827. this.document = a;
  13828. this.isFramed = this.forceIFrame || this.css.length;
  13829. this._ = {
  13830. blocks: {}
  13831. }
  13832. };
  13833. CKEDITOR.ui.panel.handler = {
  13834. create: function(a) {
  13835. return new CKEDITOR.ui.panel(a)
  13836. }
  13837. };
  13838. var a = CKEDITOR.addTemplate("panel", '<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),
  13839. e = CKEDITOR.addTemplate("panel-frame", '<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),
  13840. b = CKEDITOR.addTemplate("panel-frame-inner", '<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');
  13841. CKEDITOR.ui.panel.prototype = {
  13842. render: function(g, c) {
  13843. this.getHolderElement = function() {
  13844. var a = this._.holder;
  13845. if(!a) {
  13846. if(this.isFramed) {
  13847. var a = this.document.getById(this.id + "_frame"),
  13848. c = a.getParent(),
  13849. a = a.getFrameDocument();
  13850. CKEDITOR.env.iOS && c.setStyles({
  13851. overflow: "scroll",
  13852. "-webkit-overflow-scrolling": "touch"
  13853. });
  13854. c = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() {
  13855. this.isLoaded = true;
  13856. if(this.onLoad) this.onLoad()
  13857. }, this));
  13858. a.write(b.output(CKEDITOR.tools.extend({
  13859. css: CKEDITOR.tools.buildStyleHtml(this.css),
  13860. onload: "window.parent.CKEDITOR.tools.callFunction(" + c + ");"
  13861. }, d)));
  13862. a.getWindow().$.CKEDITOR = CKEDITOR;
  13863. a.on("keydown", function(a) {
  13864. var b = a.data.getKeystroke(),
  13865. c = this.document.getById(this.id).getAttribute("dir");
  13866. this._.onKeyDown && this._.onKeyDown(b) === false ? a.data.preventDefault() : (b == 27 || b == (c == "rtl" ? 39 :
  13867. 37)) && this.onEscape && this.onEscape(b) === false && a.data.preventDefault()
  13868. }, this);
  13869. a = a.getBody();
  13870. a.unselectable();
  13871. CKEDITOR.env.air && CKEDITOR.tools.callFunction(c)
  13872. } else a = this.document.getById(this.id);
  13873. this._.holder = a
  13874. }
  13875. return a
  13876. };
  13877. var d = {
  13878. editorId: g.id,
  13879. id: this.id,
  13880. langCode: g.langCode,
  13881. dir: g.lang.dir,
  13882. cls: this.className,
  13883. frame: "",
  13884. env: CKEDITOR.env.cssClass,
  13885. "z-index": g.config.baseFloatZIndex + 1
  13886. };
  13887. if(this.isFramed) {
  13888. var j = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent("document.open();(" +
  13889. CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : "";
  13890. d.frame = e.output({
  13891. id: this.id + "_frame",
  13892. src: j
  13893. })
  13894. }
  13895. j = a.output(d);
  13896. c && c.push(j);
  13897. return j
  13898. },
  13899. addBlock: function(a, b) {
  13900. b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(), b);
  13901. this._.currentBlock || this.showBlock(a);
  13902. return b
  13903. },
  13904. getBlock: function(a) {
  13905. return this._.blocks[a]
  13906. },
  13907. showBlock: function(a) {
  13908. var a = this._.blocks[a],
  13909. b = this._.currentBlock,
  13910. d = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id +
  13911. "_frame");
  13912. b && b.hide();
  13913. this._.currentBlock = a;
  13914. CKEDITOR.fire("ariaWidget", d);
  13915. a._.focusIndex = -1;
  13916. this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
  13917. a.show();
  13918. return a
  13919. },
  13920. destroy: function() {
  13921. this.element && this.element.remove()
  13922. }
  13923. };
  13924. CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass({
  13925. $: function(a, b) {
  13926. this.element = a.append(a.getDocument().createElement("div", {
  13927. attributes: {
  13928. tabindex: -1,
  13929. "class": "cke_panel_block"
  13930. },
  13931. styles: {
  13932. display: "none"
  13933. }
  13934. }));
  13935. b && CKEDITOR.tools.extend(this, b);
  13936. this.element.setAttributes({
  13937. role: this.attributes.role ||
  13938. "presentation",
  13939. "aria-label": this.attributes["aria-label"],
  13940. title: this.attributes.title || this.attributes["aria-label"]
  13941. });
  13942. this.keys = {};
  13943. this._.focusIndex = -1;
  13944. this.element.disableContextMenu()
  13945. },
  13946. _: {
  13947. markItem: function(a) {
  13948. if(a != -1) {
  13949. a = this.element.getElementsByTag("a").getItem(this._.focusIndex = a);
  13950. CKEDITOR.env.webkit && a.getDocument().getWindow().focus();
  13951. a.focus();
  13952. this.onMark && this.onMark(a)
  13953. }
  13954. }
  13955. },
  13956. proto: {
  13957. show: function() {
  13958. this.element.setStyle("display", "")
  13959. },
  13960. hide: function() {
  13961. (!this.onHide || this.onHide.call(this) !==
  13962. true) && this.element.setStyle("display", "none")
  13963. },
  13964. onKeyDown: function(a, b) {
  13965. var d = this.keys[a];
  13966. switch(d) {
  13967. case "next":
  13968. for(var e = this._.focusIndex, d = this.element.getElementsByTag("a"), f; f = d.getItem(++e);)
  13969. if(f.getAttribute("_cke_focus") && f.$.offsetWidth) {
  13970. this._.focusIndex = e;
  13971. f.focus();
  13972. break
  13973. }
  13974. if(!f && !b) {
  13975. this._.focusIndex = -1;
  13976. return this.onKeyDown(a, 1)
  13977. }
  13978. return false;
  13979. case "prev":
  13980. e = this._.focusIndex;
  13981. for(d = this.element.getElementsByTag("a"); e > 0 && (f = d.getItem(--e));) {
  13982. if(f.getAttribute("_cke_focus") && f.$.offsetWidth) {
  13983. this._.focusIndex =
  13984. e;
  13985. f.focus();
  13986. break
  13987. }
  13988. f = null
  13989. }
  13990. if(!f && !b) {
  13991. this._.focusIndex = d.count();
  13992. return this.onKeyDown(a, 1)
  13993. }
  13994. return false;
  13995. case "click":
  13996. case "mouseup":
  13997. e = this._.focusIndex;
  13998. (f = e >= 0 && this.element.getElementsByTag("a").getItem(e)) && (f.$[d] ? f.$[d]() : f.$["on" + d]());
  13999. return false
  14000. }
  14001. return true
  14002. }
  14003. }
  14004. })
  14005. }(), CKEDITOR.plugins.add("floatpanel", {
  14006. requires: "panel"
  14007. }),
  14008. function() {
  14009. function a(a, g, c, d, j) {
  14010. var j = CKEDITOR.tools.genKey(g.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || "", d.css || "", j || ""),
  14011. f = e[j];
  14012. if(!f) {
  14013. f = e[j] = new CKEDITOR.ui.panel(g,
  14014. d);
  14015. f.element = c.append(CKEDITOR.dom.element.createFromHtml(f.render(a), g));
  14016. f.element.setStyles({
  14017. display: "none",
  14018. position: "absolute"
  14019. })
  14020. }
  14021. return f
  14022. }
  14023. var e = {};
  14024. CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
  14025. $: function(b, g, c, d) {
  14026. function e() {
  14027. k.hide()
  14028. }
  14029. c.forceIFrame = 1;
  14030. c.toolbarRelated && b.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (g = CKEDITOR.document.getById("cke_" + b.name));
  14031. var f = g.getDocument(),
  14032. d = a(b, f, g, c, d || 0),
  14033. h = d.element,
  14034. i = h.getFirst(),
  14035. k = this;
  14036. h.disableContextMenu();
  14037. this.element = h;
  14038. this._ = {
  14039. editor: b,
  14040. panel: d,
  14041. parentElement: g,
  14042. definition: c,
  14043. document: f,
  14044. iframe: i,
  14045. children: [],
  14046. dir: b.lang.dir
  14047. };
  14048. b.on("mode", e);
  14049. b.on("resize", e);
  14050. if(!CKEDITOR.env.iOS) f.getWindow().on("resize", e)
  14051. },
  14052. proto: {
  14053. addBlock: function(a, g) {
  14054. return this._.panel.addBlock(a, g)
  14055. },
  14056. addListBlock: function(a, g) {
  14057. return this._.panel.addListBlock(a, g)
  14058. },
  14059. getBlock: function(a) {
  14060. return this._.panel.getBlock(a)
  14061. },
  14062. showBlock: function(a, g, c, d, e, f) {
  14063. var h = this._.panel,
  14064. i = h.showBlock(a);
  14065. this.allowBlur(false);
  14066. a = this._.editor.editable();
  14067. this._.returnFocus = a.hasFocus ? a : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
  14068. this._.hideTimeout = 0;
  14069. var k = this.element,
  14070. a = this._.iframe,
  14071. a = CKEDITOR.env.ie ? a : new CKEDITOR.dom.window(a.$.contentWindow),
  14072. n = k.getDocument(),
  14073. o = this._.parentElement.getPositionedAncestor(),
  14074. q = g.getDocumentPosition(n),
  14075. n = o ? o.getDocumentPosition(n) : {
  14076. x: 0,
  14077. y: 0
  14078. },
  14079. m = this._.dir == "rtl",
  14080. l = q.x + (d || 0) - n.x,
  14081. p = q.y + (e || 0) - n.y;
  14082. if(m && (c == 1 || c == 4)) l = l + g.$.offsetWidth;
  14083. else if(!m && (c == 2 || c == 3)) l = l + (g.$.offsetWidth - 1);
  14084. if(c == 3 || c == 4) p = p + (g.$.offsetHeight - 1);
  14085. this._.panel._.offsetParentId = g.getId();
  14086. k.setStyles({
  14087. top: p + "px",
  14088. left: 0,
  14089. display: ""
  14090. });
  14091. k.setOpacity(0);
  14092. k.getFirst().removeStyle("width");
  14093. this._.editor.focusManager.add(a);
  14094. if(!this._.blurSet) {
  14095. CKEDITOR.event.useCapture = true;
  14096. a.on("blur", function(a) {
  14097. function b() {
  14098. delete this._.returnFocus;
  14099. this.hide()
  14100. }
  14101. if(this.allowBlur() && a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !this._.activeChild)
  14102. if(CKEDITOR.env.iOS) {
  14103. if(!this._.hideTimeout) this._.hideTimeout = CKEDITOR.tools.setTimeout(b, 0, this)
  14104. } else b.call(this)
  14105. }, this);
  14106. a.on("focus", function() {
  14107. this._.focused = true;
  14108. this.hideChild();
  14109. this.allowBlur(true)
  14110. }, this);
  14111. if(CKEDITOR.env.iOS) {
  14112. a.on("touchstart", function() {
  14113. clearTimeout(this._.hideTimeout)
  14114. }, this);
  14115. a.on("touchend", function() {
  14116. this._.hideTimeout = 0;
  14117. this.focus()
  14118. }, this)
  14119. }
  14120. CKEDITOR.event.useCapture = false;
  14121. this._.blurSet = 1
  14122. }
  14123. h.onEscape = CKEDITOR.tools.bind(function(a) {
  14124. if(this.onEscape && this.onEscape(a) === false) return false
  14125. }, this);
  14126. CKEDITOR.tools.setTimeout(function() {
  14127. var a = CKEDITOR.tools.bind(function() {
  14128. k.removeStyle("width");
  14129. if(i.autoSize) {
  14130. var a = i.element.getDocument(),
  14131. a = (CKEDITOR.env.webkit ?
  14132. i.element : a.getBody()).$.scrollWidth;
  14133. CKEDITOR.env.ie && (CKEDITOR.env.quirks && a > 0) && (a = a + ((k.$.offsetWidth || 0) - (k.$.clientWidth || 0) + 3));
  14134. k.setStyle("width", a + 10 + "px");
  14135. a = i.element.$.scrollHeight;
  14136. CKEDITOR.env.ie && (CKEDITOR.env.quirks && a > 0) && (a = a + ((k.$.offsetHeight || 0) - (k.$.clientHeight || 0) + 3));
  14137. k.setStyle("height", a + "px");
  14138. h._.currentBlock.element.setStyle("display", "none").removeStyle("display")
  14139. } else k.removeStyle("height");
  14140. m && (l = l - k.$.offsetWidth);
  14141. k.setStyle("left", l + "px");
  14142. var b = h.element.getWindow(),
  14143. a = k.$.getBoundingClientRect(),
  14144. b = b.getViewPaneSize(),
  14145. c = a.width || a.right - a.left,
  14146. d = a.height || a.bottom - a.top,
  14147. g = m ? a.right : b.width - a.left,
  14148. e = m ? b.width - a.right : a.left;
  14149. m ? g < c && (l = e > c ? l + c : b.width > c ? l - a.left : l - a.right + b.width) : g < c && (l = e > c ? l - c : b.width > c ? l - a.right + b.width : l - a.left);
  14150. c = a.top;
  14151. b.height - a.top < d && (p = c > d ? p - d : b.height > d ? p - a.bottom + b.height : p - a.top);
  14152. if(CKEDITOR.env.ie) {
  14153. b = a = new CKEDITOR.dom.element(k.$.offsetParent);
  14154. b.getName() == "html" && (b = b.getDocument().getBody());
  14155. b.getComputedStyle("direction") == "rtl" &&
  14156. (l = CKEDITOR.env.ie8Compat ? l - k.getDocument().getDocumentElement().$.scrollLeft * 2 : l - (a.$.scrollWidth - a.$.clientWidth))
  14157. }
  14158. var a = k.getFirst(),
  14159. j;
  14160. (j = a.getCustomData("activePanel")) && j.onHide && j.onHide.call(this, 1);
  14161. a.setCustomData("activePanel", this);
  14162. k.setStyles({
  14163. top: p + "px",
  14164. left: l + "px"
  14165. });
  14166. k.setOpacity(1);
  14167. f && f()
  14168. }, this);
  14169. h.isLoaded ? a() : h.onLoad = a;
  14170. CKEDITOR.tools.setTimeout(function() {
  14171. var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
  14172. this.focus();
  14173. i.element.focus();
  14174. if(CKEDITOR.env.webkit) CKEDITOR.document.getBody().$.scrollTop =
  14175. a;
  14176. this.allowBlur(true);
  14177. this._.editor.fire("panelShow", this)
  14178. }, 0, this)
  14179. }, CKEDITOR.env.air ? 200 : 0, this);
  14180. this.visible = 1;
  14181. this.onShow && this.onShow.call(this)
  14182. },
  14183. focus: function() {
  14184. if(CKEDITOR.env.webkit) {
  14185. var a = CKEDITOR.document.getActive();
  14186. a && !a.equals(this._.iframe) && a.$.blur()
  14187. }(this._.lastFocused || this._.iframe.getFrameDocument().getWindow()).focus()
  14188. },
  14189. blur: function() {
  14190. var a = this._.iframe.getFrameDocument().getActive();
  14191. a && a.is("a") && (this._.lastFocused = a)
  14192. },
  14193. hide: function(a) {
  14194. if(this.visible && (!this.onHide || this.onHide.call(this) !==
  14195. true)) {
  14196. this.hideChild();
  14197. CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
  14198. this.element.setStyle("display", "none");
  14199. this.visible = 0;
  14200. this.element.getFirst().removeCustomData("activePanel");
  14201. if(a = a && this._.returnFocus) {
  14202. CKEDITOR.env.webkit && a.type && a.getWindow().$.focus();
  14203. a.focus()
  14204. }
  14205. delete this._.lastFocused;
  14206. this._.editor.fire("panelHide", this)
  14207. }
  14208. },
  14209. allowBlur: function(a) {
  14210. var g = this._.panel;
  14211. if(a !== void 0) g.allowBlur = a;
  14212. return g.allowBlur
  14213. },
  14214. showAsChild: function(a, g, c, d, e, f) {
  14215. if(!(this._.activeChild ==
  14216. a && a._.panel._.offsetParentId == c.getId())) {
  14217. this.hideChild();
  14218. a.onHide = CKEDITOR.tools.bind(function() {
  14219. CKEDITOR.tools.setTimeout(function() {
  14220. this._.focused || this.hide()
  14221. }, 0, this)
  14222. }, this);
  14223. this._.activeChild = a;
  14224. this._.focused = false;
  14225. a.showBlock(g, c, d, e, f);
  14226. this.blur();
  14227. (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() {
  14228. a.element.getChild(0).$.style.cssText += ""
  14229. }, 100)
  14230. }
  14231. },
  14232. hideChild: function(a) {
  14233. var g = this._.activeChild;
  14234. if(g) {
  14235. delete g.onHide;
  14236. delete this._.activeChild;
  14237. g.hide();
  14238. a && this.focus()
  14239. }
  14240. }
  14241. }
  14242. });
  14243. CKEDITOR.on("instanceDestroyed", function() {
  14244. var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances),
  14245. g;
  14246. for(g in e) {
  14247. var c = e[g];
  14248. a ? c.destroy() : c.element.hide()
  14249. }
  14250. a && (e = {})
  14251. })
  14252. }(), CKEDITOR.plugins.add("menu", {
  14253. requires: "floatpanel",
  14254. beforeInit: function(a) {
  14255. for(var e = a.config.menu_groups.split(","), b = a._.menuGroups = {}, g = a._.menuItems = {}, c = 0; c < e.length; c++) b[e[c]] = c + 1;
  14256. a.addMenuGroup = function(a, c) {
  14257. b[a] = c || 100
  14258. };
  14259. a.addMenuItem = function(a, c) {
  14260. b[c.group] && (g[a] = new CKEDITOR.menuItem(this, a, c))
  14261. };
  14262. a.addMenuItems = function(a) {
  14263. for(var b in a) this.addMenuItem(b,
  14264. a[b])
  14265. };
  14266. a.getMenuItem = function(a) {
  14267. return g[a]
  14268. };
  14269. a.removeMenuItem = function(a) {
  14270. delete g[a]
  14271. }
  14272. }
  14273. }),
  14274. function() {
  14275. function a(a) {
  14276. a.sort(function(a, b) {
  14277. return a.group < b.group ? -1 : a.group > b.group ? 1 : a.order < b.order ? -1 : a.order > b.order ? 1 : 0
  14278. })
  14279. }
  14280. var e = '<span class="cke_menuitem"><a id="{id}" class="cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href="{href}" title="{title}" tabindex="-1"_cke_focus=1 hidefocus="true" role="{role}" aria-haspopup="{hasPopup}" aria-disabled="{disabled}" {ariaChecked}';
  14281. CKEDITOR.env.gecko &&
  14282. CKEDITOR.env.mac && (e = e + ' onkeypress="return false;"');
  14283. CKEDITOR.env.gecko && (e = e + ' onblur="this.style.cssText = this.style.cssText;"');
  14284. var e = e + (' onmouseover="CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout="CKEDITOR.tools.callFunction({moveOutFn},{index});" ' + (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},{index}); return false;">'),
  14285. b = CKEDITOR.addTemplate("menuItem", e + '<span class="cke_menubutton_inner"><span class="cke_menubutton_icon"><span class="cke_button_icon cke_button__{iconName}_icon" style="{iconStyle}"></span></span><span class="cke_menubutton_label">{label}</span>{arrowHtml}</span></a></span>'),
  14286. g = CKEDITOR.addTemplate("menuArrow", '<span class="cke_menuarrow"><span>{label}</span></span>');
  14287. CKEDITOR.menu = CKEDITOR.tools.createClass({
  14288. $: function(a, b) {
  14289. b = this._.definition = b || {};
  14290. this.id = CKEDITOR.tools.getNextId();
  14291. this.editor = a;
  14292. this.items = [];
  14293. this._.listeners = [];
  14294. this._.level = b.level || 1;
  14295. var g = CKEDITOR.tools.extend({}, b.panel, {
  14296. css: [CKEDITOR.skin.getPath("editor")],
  14297. level: this._.level - 1,
  14298. block: {}
  14299. }),
  14300. f = g.block.attributes = g.attributes || {};
  14301. !f.role && (f.role = "menu");
  14302. this._.panelDefinition = g
  14303. },
  14304. _: {
  14305. onShow: function() {
  14306. var a =
  14307. this.editor.getSelection(),
  14308. b = a && a.getStartElement(),
  14309. g = this.editor.elementPath(),
  14310. f = this._.listeners;
  14311. this.removeAll();
  14312. for(var e = 0; e < f.length; e++) {
  14313. var i = f[e](b, a, g);
  14314. if(i)
  14315. for(var k in i) {
  14316. var n = this.editor.getMenuItem(k);
  14317. if(n && (!n.command || this.editor.getCommand(n.command).state)) {
  14318. n.state = i[k];
  14319. this.add(n)
  14320. }
  14321. }
  14322. }
  14323. },
  14324. onClick: function(a) {
  14325. this.hide();
  14326. if(a.onClick) a.onClick();
  14327. else a.command && this.editor.execCommand(a.command)
  14328. },
  14329. onEscape: function(a) {
  14330. var b = this.parent;
  14331. b ? b._.panel.hideChild(1) : a == 27 && this.hide(1);
  14332. return false
  14333. },
  14334. onHide: function() {
  14335. this.onHide && this.onHide()
  14336. },
  14337. showSubMenu: function(a) {
  14338. var b = this._.subMenu,
  14339. g = this.items[a];
  14340. if(g = g.getItems && g.getItems()) {
  14341. if(b) b.removeAll();
  14342. else {
  14343. b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, {
  14344. level: this._.level + 1
  14345. }, true));
  14346. b.parent = this;
  14347. b._.onClick = CKEDITOR.tools.bind(this._.onClick, this)
  14348. }
  14349. for(var f in g) {
  14350. var e = this.editor.getMenuItem(f);
  14351. if(e) {
  14352. e.state = g[f];
  14353. b.add(e)
  14354. }
  14355. }
  14356. var i = this._.panel.getBlock(this.id).element.getDocument().getById(this.id +
  14357. ("" + a));
  14358. setTimeout(function() {
  14359. b.show(i, 2)
  14360. }, 0)
  14361. } else this._.panel.hideChild(1)
  14362. }
  14363. },
  14364. proto: {
  14365. add: function(a) {
  14366. if(!a.order) a.order = this.items.length;
  14367. this.items.push(a)
  14368. },
  14369. removeAll: function() {
  14370. this.items = []
  14371. },
  14372. show: function(b, d, g, f) {
  14373. if(!this.parent) {
  14374. this._.onShow();
  14375. if(!this.items.length) return
  14376. }
  14377. var d = d || (this.editor.lang.dir == "rtl" ? 2 : 1),
  14378. e = this.items,
  14379. i = this.editor,
  14380. k = this._.panel,
  14381. n = this._.element;
  14382. if(!k) {
  14383. k = this._.panel = new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level);
  14384. k.onEscape = CKEDITOR.tools.bind(function(a) {
  14385. if(this._.onEscape(a) === false) return false
  14386. }, this);
  14387. k.onShow = function() {
  14388. k._.panel.getHolderElement().getParent().addClass("cke cke_reset_all")
  14389. };
  14390. k.onHide = CKEDITOR.tools.bind(function() {
  14391. this._.onHide && this._.onHide()
  14392. }, this);
  14393. n = k.addBlock(this.id, this._.panelDefinition.block);
  14394. n.autoSize = true;
  14395. var o = n.keys;
  14396. o[40] = "next";
  14397. o[9] = "next";
  14398. o[38] = "prev";
  14399. o[CKEDITOR.SHIFT + 9] = "prev";
  14400. o[i.lang.dir == "rtl" ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click";
  14401. o[32] = CKEDITOR.env.ie ? "mouseup" :
  14402. "click";
  14403. CKEDITOR.env.ie && (o[13] = "mouseup");
  14404. n = this._.element = n.element;
  14405. o = n.getDocument();
  14406. o.getBody().setStyle("overflow", "hidden");
  14407. o.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden");
  14408. this._.itemOverFn = CKEDITOR.tools.addFunction(function(a) {
  14409. clearTimeout(this._.showSubTimeout);
  14410. this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, i.config.menu_subMenuDelay || 400, this, [a])
  14411. }, this);
  14412. this._.itemOutFn = CKEDITOR.tools.addFunction(function() {
  14413. clearTimeout(this._.showSubTimeout)
  14414. }, this);
  14415. this._.itemClickFn = CKEDITOR.tools.addFunction(function(a) {
  14416. var b = this.items[a];
  14417. if(b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1);
  14418. else if(b.getItems) this._.showSubMenu(a);
  14419. else this._.onClick(b)
  14420. }, this)
  14421. }
  14422. a(e);
  14423. for(var o = i.elementPath(), o = ['<div class="cke_menu' + (o && o.direction() != i.lang.dir ? " cke_mixed_dir_content" : "") + '" role="presentation">'], q = e.length, m = q && e[0].group, l = 0; l < q; l++) {
  14424. var p = e[l];
  14425. if(m != p.group) {
  14426. o.push('<div class="cke_menuseparator" role="separator"></div>');
  14427. m = p.group
  14428. }
  14429. p.render(this, l, o)
  14430. }
  14431. o.push("</div>");
  14432. n.setHtml(o.join(""));
  14433. CKEDITOR.ui.fire("ready", this);
  14434. this.parent ? this.parent._.panel.showAsChild(k, this.id, b, d, g, f) : k.showBlock(this.id, b, d, g, f);
  14435. i.fire("menuShow", [k])
  14436. },
  14437. addListener: function(a) {
  14438. this._.listeners.push(a)
  14439. },
  14440. hide: function(a) {
  14441. this._.onHide && this._.onHide();
  14442. this._.panel && this._.panel.hide(a)
  14443. }
  14444. }
  14445. });
  14446. CKEDITOR.menuItem = CKEDITOR.tools.createClass({
  14447. $: function(a, b, g) {
  14448. CKEDITOR.tools.extend(this, g, {
  14449. order: 0,
  14450. className: "cke_menubutton__" + b
  14451. });
  14452. this.group = a._.menuGroups[this.group];
  14453. this.editor = a;
  14454. this.name =
  14455. b
  14456. },
  14457. proto: {
  14458. render: function(a, d, e) {
  14459. var f = a.id + ("" + d),
  14460. h = typeof this.state == "undefined" ? CKEDITOR.TRISTATE_OFF : this.state,
  14461. i = "",
  14462. k = h == CKEDITOR.TRISTATE_ON ? "on" : h == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off";
  14463. this.role in {
  14464. menuitemcheckbox: 1,
  14465. menuitemradio: 1
  14466. } && (i = ' aria-checked="' + (h == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"');
  14467. var n = this.getItems,
  14468. o = "&#" + (this.editor.lang.dir == "rtl" ? "9668" : "9658") + ";",
  14469. q = this.name;
  14470. if(this.icon && !/\./.test(this.icon)) q = this.icon;
  14471. a = {
  14472. id: f,
  14473. name: this.name,
  14474. iconName: q,
  14475. label: this.label,
  14476. cls: this.className || "",
  14477. state: k,
  14478. hasPopup: n ? "true" : "false",
  14479. disabled: h == CKEDITOR.TRISTATE_DISABLED,
  14480. title: this.label,
  14481. href: "javascript:void('" + (this.label || "").replace("'") + "')",
  14482. hoverFn: a._.itemOverFn,
  14483. moveOutFn: a._.itemOutFn,
  14484. clickFn: a._.itemClickFn,
  14485. index: d,
  14486. iconStyle: CKEDITOR.skin.getIconStyle(q, this.editor.lang.dir == "rtl", q == this.icon ? null : this.icon, this.iconOffset),
  14487. arrowHtml: n ? g.output({
  14488. label: o
  14489. }) : "",
  14490. role: this.role ? this.role : "menuitem",
  14491. ariaChecked: i
  14492. };
  14493. b.output(a, e)
  14494. }
  14495. }
  14496. })
  14497. }(), CKEDITOR.config.menu_groups = "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div",
  14498. CKEDITOR.plugins.add("contextmenu", {
  14499. requires: "menu",
  14500. onLoad: function() {
  14501. CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({
  14502. base: CKEDITOR.menu,
  14503. $: function(a) {
  14504. this.base.call(this, a, {
  14505. panel: {
  14506. className: "cke_menu_panel",
  14507. attributes: {
  14508. "aria-label": a.lang.contextmenu.options
  14509. }
  14510. }
  14511. })
  14512. },
  14513. proto: {
  14514. addTarget: function(a, e) {
  14515. a.on("contextmenu", function(a) {
  14516. var a = a.data,
  14517. d = CKEDITOR.env.webkit ? b : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey;
  14518. if(!e || !d) {
  14519. a.preventDefault();
  14520. if(CKEDITOR.env.mac && CKEDITOR.env.webkit) {
  14521. var d = this.editor,
  14522. g = (new CKEDITOR.dom.elementPath(a.getTarget(), d.editable())).contains(function(a) {
  14523. return a.hasAttribute("contenteditable")
  14524. }, true);
  14525. g && g.getAttribute("contenteditable") == "false" && d.getSelection().fake(g)
  14526. }
  14527. var g = a.getTarget().getDocument(),
  14528. f = a.getTarget().getDocument().getDocumentElement(),
  14529. d = !g.equals(CKEDITOR.document),
  14530. g = g.getWindow().getScrollPosition(),
  14531. h = d ? a.$.clientX : a.$.pageX || g.x + a.$.clientX,
  14532. i = d ? a.$.clientY : a.$.pageY || g.y + a.$.clientY;
  14533. CKEDITOR.tools.setTimeout(function() {
  14534. this.open(f, null, h, i)
  14535. }, CKEDITOR.env.ie ?
  14536. 200 : 0, this)
  14537. }
  14538. }, this);
  14539. if(CKEDITOR.env.webkit) {
  14540. var b, g = function() {
  14541. b = 0
  14542. };
  14543. a.on("keydown", function(a) {
  14544. b = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey
  14545. });
  14546. a.on("keyup", g);
  14547. a.on("contextmenu", g)
  14548. }
  14549. },
  14550. open: function(a, e, b, g) {
  14551. this.editor.focus();
  14552. a = a || CKEDITOR.document.getDocumentElement();
  14553. this.editor.selectionChange(1);
  14554. this.show(a, e, b, g)
  14555. }
  14556. }
  14557. })
  14558. },
  14559. beforeInit: function(a) {
  14560. var e = a.contextMenu = new CKEDITOR.plugins.contextMenu(a);
  14561. a.on("contentDom", function() {
  14562. e.addTarget(a.editable(), a.config.browserContextMenuOnCtrl !==
  14563. false)
  14564. });
  14565. a.addCommand("contextMenu", {
  14566. exec: function() {
  14567. a.contextMenu.open(a.document.getBody())
  14568. }
  14569. });
  14570. a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu");
  14571. a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu")
  14572. }
  14573. }),
  14574. function() {
  14575. var a;
  14576. function e(d, g) {
  14577. function f(a) {
  14578. a = n.list[a];
  14579. if(a.equals(d.editable()) || a.getAttribute("contenteditable") == "true") {
  14580. var b = d.createRange();
  14581. b.selectNodeContents(a);
  14582. b.select()
  14583. } else d.getSelection().selectElement(a);
  14584. d.focus()
  14585. }
  14586. function e() {
  14587. k && k.setHtml(b);
  14588. delete n.list
  14589. }
  14590. var i = d.ui.spaceId("path"),
  14591. k, n = d._.elementsPath,
  14592. o = n.idBase;
  14593. g.html = g.html + ('<span id="' + i + '_label" class="cke_voice_label">' + d.lang.elementspath.eleLabel + '</span><span id="' + i + '" class="cke_path" role="group" aria-labelledby="' + i + '_label">' + b + "</span>");
  14594. d.on("uiReady", function() {
  14595. var a = d.ui.space("path");
  14596. a && d.focusManager.add(a, 1)
  14597. });
  14598. n.onClick = f;
  14599. var q = CKEDITOR.tools.addFunction(f),
  14600. m = CKEDITOR.tools.addFunction(function(a, b) {
  14601. var c = n.idBase,
  14602. g, b = new CKEDITOR.dom.event(b);
  14603. g = d.lang.dir == "rtl";
  14604. switch(b.getKeystroke()) {
  14605. case g ? 39:
  14606. 37:
  14607. case 9:
  14608. (g =
  14609. CKEDITOR.document.getById(c + (a + 1))) || (g = CKEDITOR.document.getById(c + "0"));
  14610. g.focus();
  14611. return false;
  14612. case g ? 37:
  14613. 39:
  14614. case CKEDITOR.SHIFT + 9:
  14615. (g = CKEDITOR.document.getById(c + (a - 1))) || (g = CKEDITOR.document.getById(c + (n.list.length - 1)));
  14616. g.focus();
  14617. return false;
  14618. case 27:
  14619. d.focus();
  14620. return false;
  14621. case 13:
  14622. case 32:
  14623. f(a);
  14624. return false
  14625. }
  14626. return true
  14627. });
  14628. d.on("selectionChange", function() {
  14629. for(var a = [], f = n.list = [], g = [], e = n.filters, h = true, j = d.elementPath().elements, x, v = j.length; v--;) {
  14630. var r = j[v],
  14631. y = 0;
  14632. x = r.data("cke-display-name") ? r.data("cke-display-name") :
  14633. r.data("cke-real-element-type") ? r.data("cke-real-element-type") : r.getName();
  14634. h = r.hasAttribute("contenteditable") ? r.getAttribute("contenteditable") == "true" : h;
  14635. !h && !r.hasAttribute("contenteditable") && (y = 1);
  14636. for(var z = 0; z < e.length; z++) {
  14637. var B = e[z](r, x);
  14638. if(B === false) {
  14639. y = 1;
  14640. break
  14641. }
  14642. x = B || x
  14643. }
  14644. if(!y) {
  14645. f.unshift(r);
  14646. g.unshift(x)
  14647. }
  14648. }
  14649. f = f.length;
  14650. for(e = 0; e < f; e++) {
  14651. x = g[e];
  14652. h = d.lang.elementspath.eleTitle.replace(/%1/, x);
  14653. x = c.output({
  14654. id: o + e,
  14655. label: h,
  14656. text: x,
  14657. jsTitle: "javascript:void('" + x + "')",
  14658. index: e,
  14659. keyDownFn: m,
  14660. clickFn: q
  14661. });
  14662. a.unshift(x)
  14663. }
  14664. k ||
  14665. (k = CKEDITOR.document.getById(i));
  14666. g = k;
  14667. g.setHtml(a.join("") + b);
  14668. d.fire("elementsPathUpdate", {
  14669. space: g
  14670. })
  14671. });
  14672. d.on("readOnly", e);
  14673. d.on("contentDomUnload", e);
  14674. d.addCommand("elementsPathFocus", a);
  14675. d.setKeystroke(CKEDITOR.ALT + 122, "elementsPathFocus")
  14676. }
  14677. a = {
  14678. editorFocus: false,
  14679. readOnly: 1,
  14680. exec: function(a) {
  14681. (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air)
  14682. }
  14683. };
  14684. var b = '<span class="cke_path_empty">&nbsp;</span>',
  14685. g = "";
  14686. CKEDITOR.env.gecko && CKEDITOR.env.mac && (g = g + ' onkeypress="return false;"');
  14687. CKEDITOR.env.gecko && (g = g + ' onblur="this.style.cssText = this.style.cssText;"');
  14688. var c = CKEDITOR.addTemplate("pathItem", '<a id="{id}" href="{jsTitle}" tabindex="-1" class="cke_path_item" title="{label}"' + g + ' hidefocus="true" onkeydown="return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick="CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role="button" aria-label="{label}">{text}</a>');
  14689. CKEDITOR.plugins.add("elementspath", {
  14690. init: function(a) {
  14691. a._.elementsPath = {
  14692. idBase: "cke_elementspath_" +
  14693. CKEDITOR.tools.getNextNumber() + "_",
  14694. filters: []
  14695. };
  14696. a.on("uiSpace", function(b) {
  14697. b.data.space == "bottom" && e(a, b.data)
  14698. })
  14699. }
  14700. })
  14701. }(),
  14702. function() {
  14703. function a(a, c) {
  14704. var d, j;
  14705. c.on("refresh", function(a) {
  14706. var c = [e],
  14707. d;
  14708. for(d in a.data.states) c.push(a.data.states[d]);
  14709. this.setState(CKEDITOR.tools.search(c, b) ? b : e)
  14710. }, c, null, 100);
  14711. c.on("exec", function(b) {
  14712. d = a.getSelection();
  14713. j = d.createBookmarks(1);
  14714. if(!b.data) b.data = {};
  14715. b.data.done = false
  14716. }, c, null, 0);
  14717. c.on("exec", function() {
  14718. a.forceNextSelectionCheck();
  14719. d.selectBookmarks(j)
  14720. }, c, null, 100)
  14721. }
  14722. var e =
  14723. CKEDITOR.TRISTATE_DISABLED,
  14724. b = CKEDITOR.TRISTATE_OFF;
  14725. CKEDITOR.plugins.add("indent", {
  14726. init: function(b) {
  14727. var c = CKEDITOR.plugins.indent.genericDefinition;
  14728. a(b, b.addCommand("indent", new c(true)));
  14729. a(b, b.addCommand("outdent", new c));
  14730. if(b.ui.addButton) {
  14731. b.ui.addButton("Indent", {
  14732. label: b.lang.indent.indent,
  14733. command: "indent",
  14734. directional: true,
  14735. toolbar: "indent,20"
  14736. });
  14737. b.ui.addButton("Outdent", {
  14738. label: b.lang.indent.outdent,
  14739. command: "outdent",
  14740. directional: true,
  14741. toolbar: "indent,10"
  14742. })
  14743. }
  14744. b.on("dirChanged", function(a) {
  14745. var c = b.createRange(),
  14746. f = a.data.node;
  14747. c.setStartBefore(f);
  14748. c.setEndAfter(f);
  14749. for(var e = new CKEDITOR.dom.walker(c), i; i = e.next();)
  14750. if(i.type == CKEDITOR.NODE_ELEMENT)
  14751. if(!i.equals(f) && i.getDirection()) {
  14752. c.setStartAfter(i);
  14753. e = new CKEDITOR.dom.walker(c)
  14754. } else {
  14755. var k = b.config.indentClasses;
  14756. if(k)
  14757. for(var n = a.data.dir == "ltr" ? ["_rtl", ""] : ["", "_rtl"], o = 0; o < k.length; o++)
  14758. if(i.hasClass(k[o] + n[0])) {
  14759. i.removeClass(k[o] + n[0]);
  14760. i.addClass(k[o] + n[1])
  14761. }
  14762. k = i.getStyle("margin-right");
  14763. n = i.getStyle("margin-left");
  14764. k ? i.setStyle("margin-left", k) : i.removeStyle("margin-left");
  14765. n ? i.setStyle("margin-right", n) : i.removeStyle("margin-right")
  14766. }
  14767. })
  14768. }
  14769. });
  14770. CKEDITOR.plugins.indent = {
  14771. genericDefinition: function(a) {
  14772. this.isIndent = !!a;
  14773. this.startDisabled = !this.isIndent
  14774. },
  14775. specificDefinition: function(a, b, d) {
  14776. this.name = b;
  14777. this.editor = a;
  14778. this.jobs = {};
  14779. this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
  14780. this.isIndent = !!d;
  14781. this.relatedGlobal = d ? "indent" : "outdent";
  14782. this.indentKey = d ? 9 : CKEDITOR.SHIFT + 9;
  14783. this.database = {}
  14784. },
  14785. registerCommands: function(a, b) {
  14786. a.on("pluginsLoaded", function() {
  14787. for(var a in b)(function(a,
  14788. b) {
  14789. var c = a.getCommand(b.relatedGlobal),
  14790. d;
  14791. for(d in b.jobs) {
  14792. c.on("exec", function(c) {
  14793. if(!c.data.done) {
  14794. a.fire("lockSnapshot");
  14795. if(b.execJob(a, d)) c.data.done = true;
  14796. a.fire("unlockSnapshot");
  14797. CKEDITOR.dom.element.clearAllMarkers(b.database)
  14798. }
  14799. }, this, null, d);
  14800. c.on("refresh", function(c) {
  14801. if(!c.data.states) c.data.states = {};
  14802. c.data.states[b.name + "@" + d] = b.refreshJob(a, d, c.data.path)
  14803. }, this, null, d)
  14804. }
  14805. a.addFeature(b)
  14806. })(this, b[a])
  14807. })
  14808. }
  14809. };
  14810. CKEDITOR.plugins.indent.genericDefinition.prototype = {
  14811. context: "p",
  14812. exec: function() {}
  14813. };
  14814. CKEDITOR.plugins.indent.specificDefinition.prototype = {
  14815. execJob: function(a, b) {
  14816. var d = this.jobs[b];
  14817. if(d.state != e) return d.exec.call(this, a)
  14818. },
  14819. refreshJob: function(a, b, d) {
  14820. b = this.jobs[b];
  14821. b.state = a.activeFilter.checkFeature(this) ? b.refresh.call(this, a, d) : e;
  14822. return b.state
  14823. },
  14824. getContext: function(a) {
  14825. return a.contains(this.context)
  14826. }
  14827. }
  14828. }(),
  14829. function() {
  14830. function a(a) {
  14831. function c(e) {
  14832. for(var h = q.startContainer, m = q.endContainer; h && !h.getParent().equals(e);) h = h.getParent();
  14833. for(; m && !m.getParent().equals(e);) m = m.getParent();
  14834. if(!h || !m) return false;
  14835. for(var l = h, h = [], o = false; !o;) {
  14836. l.equals(m) &&
  14837. (o = true);
  14838. h.push(l);
  14839. l = l.getNext()
  14840. }
  14841. if(h.length < 1) return false;
  14842. l = e.getParents(true);
  14843. for(m = 0; m < l.length; m++)
  14844. if(l[m].getName && j[l[m].getName()]) {
  14845. e = l[m];
  14846. break
  14847. }
  14848. for(var l = d.isIndent ? 1 : -1, m = h[0], h = h[h.length - 1], o = CKEDITOR.plugins.list.listToArray(e, g), x = o[h.getCustomData("listarray_index")].indent, m = m.getCustomData("listarray_index"); m <= h.getCustomData("listarray_index"); m++) {
  14849. o[m].indent = o[m].indent + l;
  14850. if(l > 0) {
  14851. var v = o[m].parent;
  14852. o[m].parent = new CKEDITOR.dom.element(v.getName(), v.getDocument())
  14853. }
  14854. }
  14855. for(m = h.getCustomData("listarray_index") +
  14856. 1; m < o.length && o[m].indent > x; m++) o[m].indent = o[m].indent + l;
  14857. h = CKEDITOR.plugins.list.arrayToList(o, g, null, a.config.enterMode, e.getDirection());
  14858. if(!d.isIndent) {
  14859. var r;
  14860. if((r = e.getParent()) && r.is("li"))
  14861. for(var l = h.listNode.getChildren(), y = [], z, m = l.count() - 1; m >= 0; m--)(z = l.getItem(m)) && (z.is && z.is("li")) && y.push(z)
  14862. }
  14863. h && h.listNode.replace(e);
  14864. if(y && y.length)
  14865. for(m = 0; m < y.length; m++) {
  14866. for(z = e = y[m];
  14867. (z = z.getNext()) && z.is && z.getName() in j;) {
  14868. CKEDITOR.env.needsNbspFiller && !e.getFirst(b) && e.append(q.document.createText(" "));
  14869. e.append(z)
  14870. }
  14871. e.insertAfter(r)
  14872. }
  14873. h && a.fire("contentDomInvalidated");
  14874. return true
  14875. }
  14876. for(var d = this, g = this.database, j = this.context, o = a.getSelection(), o = (o && o.getRanges()).createIterator(), q; q = o.getNextRange();) {
  14877. for(var m = q.getCommonAncestor(); m && !(m.type == CKEDITOR.NODE_ELEMENT && j[m.getName()]);) m = m.getParent();
  14878. m || (m = q.startPath().contains(j)) && q.setEndAt(m, CKEDITOR.POSITION_BEFORE_END);
  14879. if(!m) {
  14880. var l = q.getEnclosedNode();
  14881. if(l && l.type == CKEDITOR.NODE_ELEMENT && l.getName() in j) {
  14882. q.setStartAt(l, CKEDITOR.POSITION_AFTER_START);
  14883. q.setEndAt(l, CKEDITOR.POSITION_BEFORE_END);
  14884. m = l
  14885. }
  14886. }
  14887. if(m && q.startContainer.type == CKEDITOR.NODE_ELEMENT && q.startContainer.getName() in j) {
  14888. l = new CKEDITOR.dom.walker(q);
  14889. l.evaluator = e;
  14890. q.startContainer = l.next()
  14891. }
  14892. if(m && q.endContainer.type == CKEDITOR.NODE_ELEMENT && q.endContainer.getName() in j) {
  14893. l = new CKEDITOR.dom.walker(q);
  14894. l.evaluator = e;
  14895. q.endContainer = l.previous()
  14896. }
  14897. if(m) return c(m)
  14898. }
  14899. return 0
  14900. }
  14901. function e(a) {
  14902. return a.type == CKEDITOR.NODE_ELEMENT && a.is("li")
  14903. }
  14904. function b(a) {
  14905. return g(a) && c(a)
  14906. }
  14907. var g = CKEDITOR.dom.walker.whitespaces(true),
  14908. c = CKEDITOR.dom.walker.bookmark(false, true),
  14909. d = CKEDITOR.TRISTATE_DISABLED,
  14910. j = CKEDITOR.TRISTATE_OFF;
  14911. CKEDITOR.plugins.add("indentlist", {
  14912. requires: "indent",
  14913. init: function(b) {
  14914. function c(b) {
  14915. e.specificDefinition.apply(this, arguments);
  14916. this.requiredContent = ["ul", "ol"];
  14917. b.on("key", function(a) {
  14918. if(b.mode == "wysiwyg" && a.data.keyCode == this.indentKey) {
  14919. var c = this.getContext(b.elementPath());
  14920. if(c && (!this.isIndent || !CKEDITOR.plugins.indentList.firstItemInPath(this.context, b.elementPath(), c))) {
  14921. b.execCommand(this.relatedGlobal);
  14922. a.cancel()
  14923. }
  14924. }
  14925. }, this);
  14926. this.jobs[this.isIndent ? 10 : 30] = {
  14927. refresh: this.isIndent ? function(a, b) {
  14928. var c = this.getContext(b),
  14929. f = CKEDITOR.plugins.indentList.firstItemInPath(this.context, b, c);
  14930. return !c || !this.isIndent || f ? d : j
  14931. } : function(a, b) {
  14932. return !this.getContext(b) || this.isIndent ? d : j
  14933. },
  14934. exec: CKEDITOR.tools.bind(a, this)
  14935. }
  14936. }
  14937. var e = CKEDITOR.plugins.indent;
  14938. e.registerCommands(b, {
  14939. indentlist: new c(b, "indentlist", true),
  14940. outdentlist: new c(b, "outdentlist")
  14941. });
  14942. CKEDITOR.tools.extend(c.prototype, e.specificDefinition.prototype, {
  14943. context: {
  14944. ol: 1,
  14945. ul: 1
  14946. }
  14947. })
  14948. }
  14949. });
  14950. CKEDITOR.plugins.indentList = {};
  14951. CKEDITOR.plugins.indentList.firstItemInPath = function(a, b, c) {
  14952. var d = b.contains(e);
  14953. c || (c = b.contains(a));
  14954. return c && d && d.equals(c.getFirst(e))
  14955. }
  14956. }(),
  14957. function() {
  14958. function a(a, b, c) {
  14959. function d(c) {
  14960. if((j = i[c ? "getFirst" : "getLast"]()) && (!j.is || !j.isBlockBoundary()) && (k = b.root[c ? "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(true))) && (!k.is || !k.isBlockBoundary({
  14961. br: 1
  14962. }))) a.document.createElement("br")[c ? "insertBefore" : "insertAfter"](j)
  14963. }
  14964. for(var f = CKEDITOR.plugins.list.listToArray(b.root,
  14965. c), e = [], g = 0; g < b.contents.length; g++) {
  14966. var h = b.contents[g];
  14967. if((h = h.getAscendant("li", true)) && !h.getCustomData("list_item_processed")) {
  14968. e.push(h);
  14969. CKEDITOR.dom.element.setMarker(c, h, "list_item_processed", true)
  14970. }
  14971. }
  14972. h = null;
  14973. for(g = 0; g < e.length; g++) {
  14974. h = e[g].getCustomData("listarray_index");
  14975. f[h].indent = -1
  14976. }
  14977. for(g = h + 1; g < f.length; g++)
  14978. if(f[g].indent > f[g - 1].indent + 1) {
  14979. e = f[g - 1].indent + 1 - f[g].indent;
  14980. for(h = f[g].indent; f[g] && f[g].indent >= h;) {
  14981. f[g].indent = f[g].indent + e;
  14982. g++
  14983. }
  14984. g--
  14985. }
  14986. var i = CKEDITOR.plugins.list.arrayToList(f, c, null,
  14987. a.config.enterMode, b.root.getAttribute("dir")).listNode,
  14988. j, k;
  14989. d(true);
  14990. d();
  14991. i.replace(b.root);
  14992. a.fire("contentDomInvalidated")
  14993. }
  14994. function e(a, b) {
  14995. this.name = a;
  14996. this.context = this.type = b;
  14997. this.allowedContent = b + " li";
  14998. this.requiredContent = b
  14999. }
  15000. function b(a, b, c, d) {
  15001. for(var f, g; f = a[d ? "getLast" : "getFirst"](q);) {
  15002. (g = f.getDirection(1)) !== b.getDirection(1) && f.setAttribute("dir", g);
  15003. f.remove();
  15004. c ? f[d ? "insertBefore" : "insertAfter"](c) : b.append(f, d)
  15005. }
  15006. }
  15007. function g(a) {
  15008. function c(d) {
  15009. var f = a[d ? "getPrevious" : "getNext"](k);
  15010. if(f && f.type ==
  15011. CKEDITOR.NODE_ELEMENT && f.is(a.getName())) {
  15012. b(a, f, null, !d);
  15013. a.remove();
  15014. a = f
  15015. }
  15016. }
  15017. c();
  15018. c(1)
  15019. }
  15020. function c(a) {
  15021. return a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in CKEDITOR.dtd.$block || a.getName() in CKEDITOR.dtd.$listItem) && CKEDITOR.dtd[a.getName()]["#"]
  15022. }
  15023. function d(a, c, d) {
  15024. a.fire("saveSnapshot");
  15025. d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
  15026. var f = d.extractContents();
  15027. c.trim(false, true);
  15028. var e = c.createBookmark(),
  15029. h = new CKEDITOR.dom.elementPath(c.startContainer),
  15030. i = h.block,
  15031. h = h.lastElement.getAscendant("li", 1) || i,
  15032. q = new CKEDITOR.dom.elementPath(d.startContainer),
  15033. o = q.contains(CKEDITOR.dtd.$listItem),
  15034. q = q.contains(CKEDITOR.dtd.$list);
  15035. if(i)(i = i.getBogus()) && i.remove();
  15036. else if(q)(i = q.getPrevious(k)) && n(i) && i.remove();
  15037. (i = f.getLast()) && (i.type == CKEDITOR.NODE_ELEMENT && i.is("br")) && i.remove();
  15038. (i = c.startContainer.getChild(c.startOffset)) ? f.insertBefore(i): c.startContainer.append(f);
  15039. if(o)
  15040. if(f = j(o))
  15041. if(h.contains(o)) {
  15042. b(f, o.getParent(), o);
  15043. f.remove()
  15044. } else h.append(f);
  15045. for(; d.checkStartOfBlock() && d.checkEndOfBlock();) {
  15046. q = d.startPath();
  15047. f = q.block;
  15048. if(!f) break;
  15049. if(f.is("li")) {
  15050. h =
  15051. f.getParent();
  15052. f.equals(h.getLast(k)) && f.equals(h.getFirst(k)) && (f = h)
  15053. }
  15054. d.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START);
  15055. f.remove()
  15056. }
  15057. d = d.clone();
  15058. f = a.editable();
  15059. d.setEndAt(f, CKEDITOR.POSITION_BEFORE_END);
  15060. d = new CKEDITOR.dom.walker(d);
  15061. d.evaluator = function(a) {
  15062. return k(a) && !n(a)
  15063. };
  15064. (d = d.next()) && (d.type == CKEDITOR.NODE_ELEMENT && d.getName() in CKEDITOR.dtd.$list) && g(d);
  15065. c.moveToBookmark(e);
  15066. c.select();
  15067. a.fire("saveSnapshot")
  15068. }
  15069. function j(a) {
  15070. return(a = a.getLast(k)) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in f ? a :
  15071. null
  15072. }
  15073. var f = {
  15074. ol: 1,
  15075. ul: 1
  15076. },
  15077. h = CKEDITOR.dom.walker.whitespaces(),
  15078. i = CKEDITOR.dom.walker.bookmark(),
  15079. k = function(a) {
  15080. return !(h(a) || i(a))
  15081. },
  15082. n = CKEDITOR.dom.walker.bogus();
  15083. CKEDITOR.plugins.list = {
  15084. listToArray: function(a, b, c, d, g) {
  15085. if(!f[a.getName()]) return [];
  15086. d || (d = 0);
  15087. c || (c = []);
  15088. for(var e = 0, h = a.getChildCount(); e < h; e++) {
  15089. var i = a.getChild(e);
  15090. i.type == CKEDITOR.NODE_ELEMENT && i.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(i, b, c, d + 1);
  15091. if(i.$.nodeName.toLowerCase() == "li") {
  15092. var j = {
  15093. parent: a,
  15094. indent: d,
  15095. element: i,
  15096. contents: []
  15097. };
  15098. if(g) j.grandparent = g;
  15099. else {
  15100. j.grandparent = a.getParent();
  15101. if(j.grandparent && j.grandparent.$.nodeName.toLowerCase() == "li") j.grandparent = j.grandparent.getParent()
  15102. }
  15103. b && CKEDITOR.dom.element.setMarker(b, i, "listarray_index", c.length);
  15104. c.push(j);
  15105. for(var k = 0, n = i.getChildCount(), q; k < n; k++) {
  15106. q = i.getChild(k);
  15107. q.type == CKEDITOR.NODE_ELEMENT && f[q.getName()] ? CKEDITOR.plugins.list.listToArray(q, b, c, d + 1, j.grandparent) : j.contents.push(q)
  15108. }
  15109. }
  15110. }
  15111. return c
  15112. },
  15113. arrayToList: function(a, b, c, d, g) {
  15114. c || (c = 0);
  15115. if(!a || a.length < c + 1) return null;
  15116. for(var e, h = a[c].parent.getDocument(), j = new CKEDITOR.dom.documentFragment(h), n = null, q = c, o = Math.max(a[c].indent, 0), z = null, B, A, G = d == CKEDITOR.ENTER_P ? "p" : "div";;) {
  15117. var D = a[q];
  15118. e = D.grandparent;
  15119. B = D.element.getDirection(1);
  15120. if(D.indent == o) {
  15121. if(!n || a[q].parent.getName() != n.getName()) {
  15122. n = a[q].parent.clone(false, 1);
  15123. g && n.setAttribute("dir", g);
  15124. j.append(n)
  15125. }
  15126. z = n.append(D.element.clone(0, 1));
  15127. B != n.getDirection(1) && z.setAttribute("dir", B);
  15128. for(e = 0; e < D.contents.length; e++) z.append(D.contents[e].clone(1, 1));
  15129. q++
  15130. } else if(D.indent ==
  15131. Math.max(o, 0) + 1) {
  15132. D = a[q - 1].element.getDirection(1);
  15133. q = CKEDITOR.plugins.list.arrayToList(a, null, q, d, D != B ? B : null);
  15134. !z.getChildCount() && (CKEDITOR.env.needsNbspFiller && h.$.documentMode <= 7) && z.append(h.createText(" "));
  15135. z.append(q.listNode);
  15136. q = q.nextIndex
  15137. } else if(D.indent == -1 && !c && e) {
  15138. if(f[e.getName()]) {
  15139. z = D.element.clone(false, true);
  15140. B != e.getDirection(1) && z.setAttribute("dir", B)
  15141. } else z = new CKEDITOR.dom.documentFragment(h);
  15142. var n = e.getDirection(1) != B,
  15143. J = D.element,
  15144. C = J.getAttribute("class"),
  15145. F = J.getAttribute("style"),
  15146. E = z.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (d != CKEDITOR.ENTER_BR || n || F || C),
  15147. I, L = D.contents.length,
  15148. H;
  15149. for(e = 0; e < L; e++) {
  15150. I = D.contents[e];
  15151. if(i(I) && L > 1) E ? H = I.clone(1, 1) : z.append(I.clone(1, 1));
  15152. else if(I.type == CKEDITOR.NODE_ELEMENT && I.isBlockBoundary()) {
  15153. n && !I.getDirection() && I.setAttribute("dir", B);
  15154. A = I;
  15155. var Q = J.getAttribute("style");
  15156. Q && A.setAttribute("style", Q.replace(/([^;])$/, "$1;") + (A.getAttribute("style") || ""));
  15157. C && I.addClass(C);
  15158. A = null;
  15159. if(H) {
  15160. z.append(H);
  15161. H = null
  15162. }
  15163. z.append(I.clone(1, 1))
  15164. } else if(E) {
  15165. if(!A) {
  15166. A =
  15167. h.createElement(G);
  15168. z.append(A);
  15169. n && A.setAttribute("dir", B)
  15170. }
  15171. F && A.setAttribute("style", F);
  15172. C && A.setAttribute("class", C);
  15173. if(H) {
  15174. A.append(H);
  15175. H = null
  15176. }
  15177. A.append(I.clone(1, 1))
  15178. } else z.append(I.clone(1, 1))
  15179. }
  15180. if(H) {
  15181. (A || z).append(H);
  15182. H = null
  15183. }
  15184. if(z.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && q != a.length - 1) {
  15185. if(CKEDITOR.env.needsBrFiller)(B = z.getLast()) && (B.type == CKEDITOR.NODE_ELEMENT && B.is("br")) && B.remove();
  15186. B = z.getLast(k);
  15187. (!B || !(B.type == CKEDITOR.NODE_ELEMENT && B.is(CKEDITOR.dtd.$block))) && z.append(h.createElement("br"))
  15188. }
  15189. B = z.$.nodeName.toLowerCase();
  15190. (B == "div" || B == "p") && z.appendBogus();
  15191. j.append(z);
  15192. n = null;
  15193. q++
  15194. } else return null;
  15195. A = null;
  15196. if(a.length <= q || Math.max(a[q].indent, 0) < o) break
  15197. }
  15198. if(b)
  15199. for(a = j.getFirst(); a;) {
  15200. if(a.type == CKEDITOR.NODE_ELEMENT) {
  15201. CKEDITOR.dom.element.clearMarkers(b, a);
  15202. if(a.getName() in CKEDITOR.dtd.$listItem) {
  15203. c = a;
  15204. h = g = d = void 0;
  15205. if(d = c.getDirection()) {
  15206. for(g = c.getParent(); g && !(h = g.getDirection());) g = g.getParent();
  15207. d == h && c.removeAttribute("dir")
  15208. }
  15209. }
  15210. }
  15211. a = a.getNextSourceNode()
  15212. }
  15213. return {
  15214. listNode: j,
  15215. nextIndex: q
  15216. }
  15217. }
  15218. };
  15219. var o = /^h[1-6]$/,
  15220. q = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
  15221. e.prototype = {
  15222. exec: function(b) {
  15223. this.refresh(b, b.elementPath());
  15224. var c = b.config,
  15225. d = b.getSelection(),
  15226. e = d && d.getRanges();
  15227. if(this.state == CKEDITOR.TRISTATE_OFF) {
  15228. var h = b.editable();
  15229. if(h.getFirst(k)) {
  15230. var i = e.length == 1 && e[0];
  15231. (c = i && i.getEnclosedNode()) && (c.is && this.type == c.getName()) && this.setState(CKEDITOR.TRISTATE_ON)
  15232. } else {
  15233. c.enterMode == CKEDITOR.ENTER_BR ? h.appendBogus() : e[0].fixBlock(1, c.enterMode == CKEDITOR.ENTER_P ? "p" : "div");
  15234. d.selectRanges(e)
  15235. }
  15236. }
  15237. for(var c = d.createBookmarks(true), h = [], j = {}, e = e.createIterator(),
  15238. n = 0;
  15239. (i = e.getNextRange()) && ++n;) {
  15240. var q = i.getBoundaryNodes(),
  15241. r = q.startNode,
  15242. y = q.endNode;
  15243. r.type == CKEDITOR.NODE_ELEMENT && r.getName() == "td" && i.setStartAt(q.startNode, CKEDITOR.POSITION_AFTER_START);
  15244. y.type == CKEDITOR.NODE_ELEMENT && y.getName() == "td" && i.setEndAt(q.endNode, CKEDITOR.POSITION_BEFORE_END);
  15245. i = i.createIterator();
  15246. for(i.forceBrBreak = this.state == CKEDITOR.TRISTATE_OFF; q = i.getNextParagraph();)
  15247. if(!q.getCustomData("list_block")) {
  15248. CKEDITOR.dom.element.setMarker(j, q, "list_block", 1);
  15249. for(var z = b.elementPath(q),
  15250. r = z.elements, y = 0, z = z.blockLimit, B, A = r.length - 1; A >= 0 && (B = r[A]); A--)
  15251. if(f[B.getName()] && z.contains(B)) {
  15252. z.removeCustomData("list_group_object_" + n);
  15253. if(r = B.getCustomData("list_group_object")) r.contents.push(q);
  15254. else {
  15255. r = {
  15256. root: B,
  15257. contents: [q]
  15258. };
  15259. h.push(r);
  15260. CKEDITOR.dom.element.setMarker(j, B, "list_group_object", r)
  15261. }
  15262. y = 1;
  15263. break
  15264. }
  15265. if(!y) {
  15266. y = z;
  15267. if(y.getCustomData("list_group_object_" + n)) y.getCustomData("list_group_object_" + n).contents.push(q);
  15268. else {
  15269. r = {
  15270. root: y,
  15271. contents: [q]
  15272. };
  15273. CKEDITOR.dom.element.setMarker(j, y, "list_group_object_" +
  15274. n, r);
  15275. h.push(r)
  15276. }
  15277. }
  15278. }
  15279. }
  15280. for(B = []; h.length > 0;) {
  15281. r = h.shift();
  15282. if(this.state == CKEDITOR.TRISTATE_OFF)
  15283. if(f[r.root.getName()]) {
  15284. e = b;
  15285. n = r;
  15286. r = j;
  15287. i = B;
  15288. y = CKEDITOR.plugins.list.listToArray(n.root, r);
  15289. z = [];
  15290. for(q = 0; q < n.contents.length; q++) {
  15291. A = n.contents[q];
  15292. if((A = A.getAscendant("li", true)) && !A.getCustomData("list_item_processed")) {
  15293. z.push(A);
  15294. CKEDITOR.dom.element.setMarker(r, A, "list_item_processed", true)
  15295. }
  15296. }
  15297. for(var A = n.root.getDocument(), G = void 0, D = void 0, q = 0; q < z.length; q++) {
  15298. var J = z[q].getCustomData("listarray_index"),
  15299. G = y[J].parent;
  15300. if(!G.is(this.type)) {
  15301. D = A.createElement(this.type);
  15302. G.copyAttributes(D, {
  15303. start: 1,
  15304. type: 1
  15305. });
  15306. D.removeStyle("list-style-type");
  15307. y[J].parent = D
  15308. }
  15309. }
  15310. r = CKEDITOR.plugins.list.arrayToList(y, r, null, e.config.enterMode);
  15311. y = void 0;
  15312. z = r.listNode.getChildCount();
  15313. for(q = 0; q < z && (y = r.listNode.getChild(q)); q++) y.getName() == this.type && i.push(y);
  15314. r.listNode.replace(n.root);
  15315. e.fire("contentDomInvalidated")
  15316. } else {
  15317. y = b;
  15318. q = r;
  15319. i = B;
  15320. z = q.contents;
  15321. e = q.root.getDocument();
  15322. n = [];
  15323. if(z.length == 1 && z[0].equals(q.root)) {
  15324. r = e.createElement("div");
  15325. z[0].moveChildren &&
  15326. z[0].moveChildren(r);
  15327. z[0].append(r);
  15328. z[0] = r
  15329. }
  15330. q = q.contents[0].getParent();
  15331. for(A = 0; A < z.length; A++) q = q.getCommonAncestor(z[A].getParent());
  15332. G = y.config.useComputedState;
  15333. y = r = void 0;
  15334. G = G === void 0 || G;
  15335. for(A = 0; A < z.length; A++)
  15336. for(D = z[A]; J = D.getParent();) {
  15337. if(J.equals(q)) {
  15338. n.push(D);
  15339. !y && D.getDirection() && (y = 1);
  15340. D = D.getDirection(G);
  15341. r !== null && (r = r && r != D ? null : D);
  15342. break
  15343. }
  15344. D = J
  15345. }
  15346. if(!(n.length < 1)) {
  15347. z = n[n.length - 1].getNext();
  15348. A = e.createElement(this.type);
  15349. i.push(A);
  15350. for(G = i = void 0; n.length;) {
  15351. i = n.shift();
  15352. G = e.createElement("li");
  15353. if(i.is("pre") ||
  15354. o.test(i.getName()) || i.getAttribute("contenteditable") == "false") i.appendTo(G);
  15355. else {
  15356. i.copyAttributes(G);
  15357. if(r && i.getDirection()) {
  15358. G.removeStyle("direction");
  15359. G.removeAttribute("dir")
  15360. }
  15361. i.moveChildren(G);
  15362. i.remove()
  15363. }
  15364. G.appendTo(A)
  15365. }
  15366. r && y && A.setAttribute("dir", r);
  15367. z ? A.insertBefore(z) : A.appendTo(q)
  15368. }
  15369. }
  15370. else this.state == CKEDITOR.TRISTATE_ON && f[r.root.getName()] && a.call(this, b, r, j)
  15371. }
  15372. for(A = 0; A < B.length; A++) g(B[A]);
  15373. CKEDITOR.dom.element.clearAllMarkers(j);
  15374. d.selectBookmarks(c);
  15375. b.focus()
  15376. },
  15377. refresh: function(a, b) {
  15378. var c = b.contains(f,
  15379. 1),
  15380. d = b.blockLimit || b.root;
  15381. c && d.contains(c) ? this.setState(c.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF)
  15382. }
  15383. };
  15384. CKEDITOR.plugins.add("list", {
  15385. requires: "indentlist",
  15386. init: function(a) {
  15387. if(!a.blockless) {
  15388. a.addCommand("numberedlist", new e("numberedlist", "ol"));
  15389. a.addCommand("bulletedlist", new e("bulletedlist", "ul"));
  15390. if(a.ui.addButton) {
  15391. a.ui.addButton("NumberedList", {
  15392. label: a.lang.list.numberedlist,
  15393. command: "numberedlist",
  15394. directional: true,
  15395. toolbar: "list,10"
  15396. });
  15397. a.ui.addButton("BulletedList", {
  15398. label: a.lang.list.bulletedlist,
  15399. command: "bulletedlist",
  15400. directional: true,
  15401. toolbar: "list,20"
  15402. })
  15403. }
  15404. a.on("key", function(b) {
  15405. var e = b.data.domEvent.getKey(),
  15406. g;
  15407. if(a.mode == "wysiwyg" && e in {
  15408. 8: 1,
  15409. 46: 1
  15410. }) {
  15411. var h = a.getSelection().getRanges()[0],
  15412. i = h && h.startPath();
  15413. if(h && h.collapsed) {
  15414. var q = e == 8,
  15415. o = a.editable(),
  15416. v = new CKEDITOR.dom.walker(h.clone());
  15417. v.evaluator = function(a) {
  15418. return k(a) && !n(a)
  15419. };
  15420. v.guard = function(a, b) {
  15421. return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table"))
  15422. };
  15423. e = h.clone();
  15424. if(q) {
  15425. var r;
  15426. if((r = i.contains(f)) && h.checkBoundaryOfElement(r,
  15427. CKEDITOR.START) && (r = r.getParent()) && r.is("li") && (r = j(r))) {
  15428. g = r;
  15429. r = r.getPrevious(k);
  15430. e.moveToPosition(r && n(r) ? r : g, CKEDITOR.POSITION_BEFORE_START)
  15431. } else {
  15432. v.range.setStartAt(o, CKEDITOR.POSITION_AFTER_START);
  15433. v.range.setEnd(h.startContainer, h.startOffset);
  15434. if((r = v.previous()) && r.type == CKEDITOR.NODE_ELEMENT && (r.getName() in f || r.is("li"))) {
  15435. if(!r.is("li")) {
  15436. v.range.selectNodeContents(r);
  15437. v.reset();
  15438. v.evaluator = c;
  15439. r = v.previous()
  15440. }
  15441. g = r;
  15442. e.moveToElementEditEnd(g)
  15443. }
  15444. }
  15445. if(g) {
  15446. d(a, e, h);
  15447. b.cancel()
  15448. } else if((e = i.contains(f)) && h.checkBoundaryOfElement(e,
  15449. CKEDITOR.START)) {
  15450. g = e.getFirst(k);
  15451. if(h.checkBoundaryOfElement(g, CKEDITOR.START)) {
  15452. r = e.getPrevious(k);
  15453. if(j(g)) {
  15454. if(r) {
  15455. h.moveToElementEditEnd(r);
  15456. h.select()
  15457. }
  15458. } else a.execCommand("outdent");
  15459. b.cancel()
  15460. }
  15461. }
  15462. } else if(g = i.contains("li")) {
  15463. v.range.setEndAt(o, CKEDITOR.POSITION_BEFORE_END);
  15464. g = (i = g.getLast(k)) && c(i) ? i : g;
  15465. o = 0;
  15466. if((r = v.next()) && r.type == CKEDITOR.NODE_ELEMENT && r.getName() in f && r.equals(i)) {
  15467. o = 1;
  15468. r = v.next()
  15469. } else h.checkBoundaryOfElement(g, CKEDITOR.END) && (o = 1);
  15470. if(o && r) {
  15471. h = h.clone();
  15472. h.moveToElementEditStart(r);
  15473. d(a,
  15474. e, h);
  15475. b.cancel()
  15476. }
  15477. } else {
  15478. v.range.setEndAt(o, CKEDITOR.POSITION_BEFORE_END);
  15479. if((r = v.next()) && r.type == CKEDITOR.NODE_ELEMENT && r.is(f)) {
  15480. r = r.getFirst(k);
  15481. if(i.block && h.checkStartOfBlock() && h.checkEndOfBlock()) {
  15482. i.block.remove();
  15483. h.moveToElementEditStart(r);
  15484. h.select()
  15485. } else if(j(r)) {
  15486. h.moveToElementEditStart(r);
  15487. h.select()
  15488. } else {
  15489. h = h.clone();
  15490. h.moveToElementEditStart(r);
  15491. d(a, e, h)
  15492. }
  15493. b.cancel()
  15494. }
  15495. }
  15496. setTimeout(function() {
  15497. a.selectionChange(1)
  15498. })
  15499. }
  15500. }
  15501. })
  15502. }
  15503. }
  15504. })
  15505. }(),
  15506. function() {
  15507. function a(a, b, c) {
  15508. c = a.config.forceEnterMode || c;
  15509. if(a.mode == "wysiwyg") {
  15510. if(!b) b =
  15511. a.activeEnterMode;
  15512. if(!a.elementPath().isContextFor("p")) {
  15513. b = CKEDITOR.ENTER_BR;
  15514. c = 1
  15515. }
  15516. a.fire("saveSnapshot");
  15517. b == CKEDITOR.ENTER_BR ? j(a, b, null, c) : f(a, b, null, c);
  15518. a.fire("saveSnapshot")
  15519. }
  15520. }
  15521. function e(a) {
  15522. for(var a = a.getSelection().getRanges(true), b = a.length - 1; b > 0; b--) a[b].deleteContents();
  15523. return a[0]
  15524. }
  15525. function b(a) {
  15526. var b = a.startContainer.getAscendant(function(a) {
  15527. return a.type == CKEDITOR.NODE_ELEMENT && a.getAttribute("contenteditable") == "true"
  15528. }, true);
  15529. if(a.root.equals(b)) return a;
  15530. b = new CKEDITOR.dom.range(b);
  15531. b.moveToRange(a);
  15532. return b
  15533. }
  15534. CKEDITOR.plugins.add("enterkey", {
  15535. init: function(b) {
  15536. b.addCommand("enter", {
  15537. modes: {
  15538. wysiwyg: 1
  15539. },
  15540. editorFocus: false,
  15541. exec: function(b) {
  15542. a(b)
  15543. }
  15544. });
  15545. b.addCommand("shiftEnter", {
  15546. modes: {
  15547. wysiwyg: 1
  15548. },
  15549. editorFocus: false,
  15550. exec: function(b) {
  15551. a(b, b.activeShiftEnterMode, 1)
  15552. }
  15553. });
  15554. b.setKeystroke([
  15555. [13, "enter"],
  15556. [CKEDITOR.SHIFT + 13, "shiftEnter"]
  15557. ])
  15558. }
  15559. });
  15560. var g = CKEDITOR.dom.walker.whitespaces(),
  15561. c = CKEDITOR.dom.walker.bookmark();
  15562. CKEDITOR.plugins.enterkey = {
  15563. enterBlock: function(a, d, f, o) {
  15564. if(f = f || e(a)) {
  15565. var f = b(f),
  15566. q = f.document,
  15567. m = f.checkStartOfBlock(),
  15568. l = f.checkEndOfBlock(),
  15569. p = a.elementPath(f.startContainer),
  15570. t = p.block,
  15571. s = d == CKEDITOR.ENTER_DIV ? "div" : "p",
  15572. u;
  15573. if(m && l) {
  15574. if(t && (t.is("li") || t.getParent().is("li"))) {
  15575. t.is("li") || (t = t.getParent());
  15576. f = t.getParent();
  15577. u = f.getParent();
  15578. var o = !t.hasPrevious(),
  15579. w = !t.hasNext(),
  15580. s = a.getSelection(),
  15581. x = s.createBookmarks(),
  15582. m = t.getDirection(1),
  15583. l = t.getAttribute("class"),
  15584. v = t.getAttribute("style"),
  15585. r = u.getDirection(1) != m,
  15586. a = a.enterMode != CKEDITOR.ENTER_BR || r || v || l;
  15587. if(u.is("li"))
  15588. if(o || w) t[o ? "insertBefore" : "insertAfter"](u);
  15589. else t.breakParent(u);
  15590. else {
  15591. if(a) {
  15592. if(p.block.is("li")) {
  15593. u = q.createElement(d == CKEDITOR.ENTER_P ? "p" : "div");
  15594. r && u.setAttribute("dir", m);
  15595. v && u.setAttribute("style", v);
  15596. l && u.setAttribute("class", l);
  15597. t.moveChildren(u)
  15598. } else u = p.block;
  15599. if(o || w) u[o ? "insertBefore" : "insertAfter"](f);
  15600. else {
  15601. t.breakParent(f);
  15602. u.insertAfter(f)
  15603. }
  15604. } else {
  15605. t.appendBogus(true);
  15606. if(o || w)
  15607. for(; q = t[o ? "getFirst" : "getLast"]();) q[o ? "insertBefore" : "insertAfter"](f);
  15608. else
  15609. for(t.breakParent(f); q = t.getLast();) q.insertAfter(f)
  15610. }
  15611. t.remove()
  15612. }
  15613. s.selectBookmarks(x);
  15614. return
  15615. }
  15616. if(t && t.getParent().is("blockquote")) {
  15617. t.breakParent(t.getParent());
  15618. t.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || t.getPrevious().remove();
  15619. t.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || t.getNext().remove();
  15620. f.moveToElementEditStart(t);
  15621. f.select();
  15622. return
  15623. }
  15624. } else if(t && t.is("pre") && !l) {
  15625. j(a, d, f, o);
  15626. return
  15627. }
  15628. if(m = f.splitBlock(s)) {
  15629. d = m.previousBlock;
  15630. t = m.nextBlock;
  15631. p = m.wasStartOfBlock;
  15632. a = m.wasEndOfBlock;
  15633. if(t) {
  15634. x = t.getParent();
  15635. if(x.is("li")) {
  15636. t.breakParent(x);
  15637. t.move(t.getNext(), 1)
  15638. }
  15639. } else if(d && (x = d.getParent()) && x.is("li")) {
  15640. d.breakParent(x);
  15641. x = d.getNext();
  15642. f.moveToElementEditStart(x);
  15643. d.move(d.getPrevious())
  15644. }
  15645. if(!p && !a) {
  15646. if(t.is("li")) {
  15647. u = f.clone();
  15648. u.selectNodeContents(t);
  15649. u = new CKEDITOR.dom.walker(u);
  15650. u.evaluator = function(a) {
  15651. return !(c(a) || g(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in CKEDITOR.dtd.$empty))
  15652. };
  15653. (x = u.next()) && (x.type == CKEDITOR.NODE_ELEMENT && x.is("ul", "ol")) && (CKEDITOR.env.needsBrFiller ? q.createElement("br") : q.createText(" ")).insertBefore(x)
  15654. }
  15655. t && f.moveToElementEditStart(t)
  15656. } else {
  15657. if(d) {
  15658. if(d.is("li") || !h.test(d.getName()) && !d.is("pre")) u =
  15659. d.clone()
  15660. } else t && (u = t.clone());
  15661. if(u) o && !u.is("li") && u.renameNode(s);
  15662. else if(x && x.is("li")) u = x;
  15663. else {
  15664. u = q.createElement(s);
  15665. d && (w = d.getDirection()) && u.setAttribute("dir", w)
  15666. }
  15667. if(q = m.elementPath) {
  15668. o = 0;
  15669. for(s = q.elements.length; o < s; o++) {
  15670. x = q.elements[o];
  15671. if(x.equals(q.block) || x.equals(q.blockLimit)) break;
  15672. if(CKEDITOR.dtd.$removeEmpty[x.getName()]) {
  15673. x = x.clone();
  15674. u.moveChildren(x);
  15675. u.append(x)
  15676. }
  15677. }
  15678. }
  15679. u.appendBogus();
  15680. u.getParent() || f.insertNode(u);
  15681. u.is("li") && u.removeAttribute("value");
  15682. if(CKEDITOR.env.ie && p && (!a || !d.getChildCount())) {
  15683. f.moveToElementEditStart(a ?
  15684. d : u);
  15685. f.select()
  15686. }
  15687. f.moveToElementEditStart(p && !a ? t : u)
  15688. }
  15689. f.select();
  15690. f.scrollIntoView()
  15691. }
  15692. }
  15693. },
  15694. enterBr: function(a, b, c, d) {
  15695. if(c = c || e(a)) {
  15696. var g = c.document,
  15697. j = c.checkEndOfBlock(),
  15698. l = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),
  15699. p = l.block,
  15700. t = p && l.block.getName();
  15701. if(!d && t == "li") f(a, b, c, d);
  15702. else {
  15703. if(!d && j && h.test(t))
  15704. if(j = p.getDirection()) {
  15705. g = g.createElement("div");
  15706. g.setAttribute("dir", j);
  15707. g.insertAfter(p);
  15708. c.setStart(g, 0)
  15709. } else {
  15710. g.createElement("br").insertAfter(p);
  15711. CKEDITOR.env.gecko && g.createText("").insertAfter(p);
  15712. c.setStartAt(p.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)
  15713. }
  15714. else {
  15715. a = t == "pre" && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? g.createText("\r") : g.createElement("br");
  15716. c.deleteContents();
  15717. c.insertNode(a);
  15718. if(CKEDITOR.env.needsBrFiller) {
  15719. g.createText("").insertAfter(a);
  15720. j && (p || l.blockLimit).appendBogus();
  15721. a.getNext().$.nodeValue = "";
  15722. c.setStartAt(a.getNext(), CKEDITOR.POSITION_AFTER_START)
  15723. } else c.setStartAt(a, CKEDITOR.POSITION_AFTER_END)
  15724. }
  15725. c.collapse(true);
  15726. c.select();
  15727. c.scrollIntoView()
  15728. }
  15729. }
  15730. }
  15731. };
  15732. var d = CKEDITOR.plugins.enterkey,
  15733. j = d.enterBr,
  15734. f = d.enterBlock,
  15735. h = /^h[1-6]$/
  15736. }(),
  15737. function() {
  15738. function a(a, b) {
  15739. var g = {},
  15740. c = [],
  15741. d = {
  15742. nbsp: " ",
  15743. shy: "­",
  15744. gt: ">",
  15745. lt: "<",
  15746. amp: "&",
  15747. apos: "'",
  15748. quot: '"'
  15749. },
  15750. a = a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function(a, f) {
  15751. var e = b ? "&" + f + ";" : d[f];
  15752. g[e] = b ? d[f] : "&" + f + ";";
  15753. c.push(e);
  15754. return ""
  15755. });
  15756. if(!b && a) {
  15757. var a = a.split(","),
  15758. j = document.createElement("div"),
  15759. f;
  15760. j.innerHTML = "&" + a.join(";&") + ";";
  15761. f = j.innerHTML;
  15762. j = null;
  15763. for(j = 0; j < f.length; j++) {
  15764. var h = f.charAt(j);
  15765. g[h] = "&" + a[j] + ";";
  15766. c.push(h)
  15767. }
  15768. }
  15769. g.regex =
  15770. c.join(b ? "|" : "");
  15771. return g
  15772. }
  15773. CKEDITOR.plugins.add("entities", {
  15774. afterInit: function(e) {
  15775. function b(a) {
  15776. return h[a]
  15777. }
  15778. function g(a) {
  15779. return c.entities_processNumerical == "force" || !j[a] ? "&#" + a.charCodeAt(0) + ";" : j[a]
  15780. }
  15781. var c = e.config;
  15782. if(e = (e = e.dataProcessor) && e.htmlFilter) {
  15783. var d = [];
  15784. c.basicEntities !== false && d.push("nbsp,gt,lt,amp");
  15785. if(c.entities) {
  15786. d.length && d.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro");
  15787. c.entities_latin && d.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml");
  15788. c.entities_greek && d.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv");
  15789. c.entities_additional && d.push(c.entities_additional)
  15790. }
  15791. var j = a(d.join(",")),
  15792. f = j.regex ? "[" + j.regex + "]" : "a^";
  15793. delete j.regex;
  15794. c.entities && c.entities_processNumerical && (f = "[^ -~]|" + f);
  15795. var f = RegExp(f, "g"),
  15796. h = a("nbsp,gt,lt,amp,shy", true),
  15797. i = RegExp(h.regex, "g");
  15798. e.addRules({
  15799. text: function(a) {
  15800. return a.replace(i, b).replace(f, g)
  15801. }
  15802. }, {
  15803. applyToAll: true,
  15804. excludeNestedEditable: true
  15805. })
  15806. }
  15807. }
  15808. })
  15809. }(), CKEDITOR.config.basicEntities = !0, CKEDITOR.config.entities = !0, CKEDITOR.config.entities_latin = !0, CKEDITOR.config.entities_greek = !0, CKEDITOR.config.entities_additional =
  15810. "#39", CKEDITOR.plugins.add("popup"), CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  15811. popup: function(a, e, b, g) {
  15812. e = e || "80%";
  15813. b = b || "70%";
  15814. typeof e == "string" && (e.length > 1 && e.substr(e.length - 1, 1) == "%") && (e = parseInt(window.screen.width * parseInt(e, 10) / 100, 10));
  15815. typeof b == "string" && (b.length > 1 && b.substr(b.length - 1, 1) == "%") && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10));
  15816. e < 640 && (e = 640);
  15817. b < 420 && (b = 420);
  15818. var c = parseInt((window.screen.height - b) / 2, 10),
  15819. d = parseInt((window.screen.width - e) / 2, 10),
  15820. g = (g || "location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes") +
  15821. ",width=" + e + ",height=" + b + ",top=" + c + ",left=" + d,
  15822. j = window.open("", null, g, true);
  15823. if(!j) return false;
  15824. try {
  15825. if(navigator.userAgent.toLowerCase().indexOf(" chrome/") == -1) {
  15826. j.moveTo(d, c);
  15827. j.resizeTo(e, b)
  15828. }
  15829. j.focus();
  15830. j.location.href = a
  15831. } catch(f) {
  15832. window.open(a, null, g, true)
  15833. }
  15834. return true
  15835. }
  15836. }),
  15837. function() {
  15838. function a(a, b) {
  15839. var c = [];
  15840. if(b)
  15841. for(var d in b) c.push(d + "=" + encodeURIComponent(b[d]));
  15842. else return a;
  15843. return a + (a.indexOf("?") != -1 ? "&" : "?") + c.join("&")
  15844. }
  15845. function e(a) {
  15846. a = a + "";
  15847. return a.charAt(0).toUpperCase() + a.substr(1)
  15848. }
  15849. function b() {
  15850. var b =
  15851. this.getDialog(),
  15852. c = b.getParentEditor();
  15853. c._.filebrowserSe = this;
  15854. var d = c.config["filebrowser" + e(b.getName()) + "WindowWidth"] || c.config.filebrowserWindowWidth || "80%",
  15855. b = c.config["filebrowser" + e(b.getName()) + "WindowHeight"] || c.config.filebrowserWindowHeight || "70%",
  15856. f = this.filebrowser.params || {};
  15857. f.CKEditor = c.name;
  15858. f.CKEditorFuncNum = c._.filebrowserFn;
  15859. if(!f.langCode) f.langCode = c.langCode;
  15860. f = a(this.filebrowser.url, f);
  15861. c.popup(f, d, b, c.config.filebrowserWindowFeatures || c.config.fileBrowserWindowFeatures)
  15862. }
  15863. function g() {
  15864. var a =
  15865. this.getDialog();
  15866. a.getParentEditor()._.filebrowserSe = this;
  15867. return !a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value || !a.getContentElement(this["for"][0], this["for"][1]).getAction() ? false : true
  15868. }
  15869. function c(b, c, d) {
  15870. var f = d.params || {};
  15871. f.CKEditor = b.name;
  15872. f.CKEditorFuncNum = b._.filebrowserFn;
  15873. if(!f.langCode) f.langCode = b.langCode;
  15874. c.action = a(d.url, f);
  15875. c.filebrowser = d
  15876. }
  15877. function d(a, f, j, n) {
  15878. if(n && n.length)
  15879. for(var o, q = n.length; q--;) {
  15880. o = n[q];
  15881. (o.type == "hbox" || o.type == "vbox" || o.type == "fieldset") &&
  15882. d(a, f, j, o.children);
  15883. if(o.filebrowser) {
  15884. if(typeof o.filebrowser == "string") o.filebrowser = {
  15885. action: o.type == "fileButton" ? "QuickUpload" : "Browse",
  15886. target: o.filebrowser
  15887. };
  15888. if(o.filebrowser.action == "Browse") {
  15889. var m = o.filebrowser.url;
  15890. if(m === void 0) {
  15891. m = a.config["filebrowser" + e(f) + "BrowseUrl"];
  15892. if(m === void 0) m = a.config.filebrowserBrowseUrl
  15893. }
  15894. if(m) {
  15895. o.onClick = b;
  15896. o.filebrowser.url = m;
  15897. o.hidden = false
  15898. }
  15899. } else if(o.filebrowser.action == "QuickUpload" && o["for"]) {
  15900. m = o.filebrowser.url;
  15901. if(m === void 0) {
  15902. m = a.config["filebrowser" + e(f) + "UploadUrl"];
  15903. if(m === void 0) m = a.config.filebrowserUploadUrl
  15904. }
  15905. if(m) {
  15906. var l = o.onClick;
  15907. o.onClick = function(a) {
  15908. var b = a.sender;
  15909. return l && l.call(b, a) === false ? false : g.call(b, a)
  15910. };
  15911. o.filebrowser.url = m;
  15912. o.hidden = false;
  15913. c(a, j.getContents(o["for"][0]).get(o["for"][1]), o.filebrowser)
  15914. }
  15915. }
  15916. }
  15917. }
  15918. }
  15919. function j(a, b, c) {
  15920. if(c.indexOf(";") !== -1) {
  15921. for(var c = c.split(";"), d = 0; d < c.length; d++)
  15922. if(j(a, b, c[d])) return true;
  15923. return false
  15924. }
  15925. return(a = a.getContents(b).get(c).filebrowser) && a.url
  15926. }
  15927. function f(a, b) {
  15928. var c = this._.filebrowserSe.getDialog(),
  15929. d = this._.filebrowserSe["for"],
  15930. f = this._.filebrowserSe.filebrowser.onSelect;
  15931. d && c.getContentElement(d[0], d[1]).reset();
  15932. if(!(typeof b == "function" && b.call(this._.filebrowserSe) === false) && !(f && f.call(this._.filebrowserSe, a, b) === false)) {
  15933. typeof b == "string" && b && alert(b);
  15934. if(a) {
  15935. d = this._.filebrowserSe;
  15936. c = d.getDialog();
  15937. if(d = d.filebrowser.target || null) {
  15938. d = d.split(":");
  15939. if(f = c.getContentElement(d[0], d[1])) {
  15940. f.setValue(a);
  15941. c.selectPage(d[0])
  15942. }
  15943. }
  15944. }
  15945. }
  15946. }
  15947. CKEDITOR.plugins.add("filebrowser", {
  15948. requires: "popup",
  15949. init: function(a) {
  15950. a._.filebrowserFn = CKEDITOR.tools.addFunction(f,
  15951. a);
  15952. a.on("destroy", function() {
  15953. CKEDITOR.tools.removeFunction(this._.filebrowserFn)
  15954. })
  15955. }
  15956. });
  15957. CKEDITOR.on("dialogDefinition", function(a) {
  15958. if(a.editor.plugins.filebrowser)
  15959. for(var b = a.data.definition, c, f = 0; f < b.contents.length; ++f)
  15960. if(c = b.contents[f]) {
  15961. d(a.editor, a.data.name, b, c.elements);
  15962. if(c.hidden && c.filebrowser) c.hidden = !j(b, c.id, c.filebrowser)
  15963. }
  15964. })
  15965. }(),
  15966. function() {
  15967. function a(a) {
  15968. var c = a.config,
  15969. d = a.fire("uiSpace", {
  15970. space: "top",
  15971. html: ""
  15972. }).html,
  15973. j = function() {
  15974. function d(a, c, f) {
  15975. h.setStyle(c, b(f));
  15976. h.setStyle("position",
  15977. a)
  15978. }
  15979. function f(a) {
  15980. var b = k.getDocumentPosition();
  15981. switch(a) {
  15982. case "top":
  15983. d("absolute", "top", b.y - s - x);
  15984. break;
  15985. case "pin":
  15986. d("fixed", "top", r);
  15987. break;
  15988. case "bottom":
  15989. d("absolute", "top", b.y + (p.height || p.bottom - p.top) + x)
  15990. }
  15991. i = a
  15992. }
  15993. var i, k, l, p, t, s, u, w = c.floatSpaceDockedOffsetX || 0,
  15994. x = c.floatSpaceDockedOffsetY || 0,
  15995. v = c.floatSpacePinnedOffsetX || 0,
  15996. r = c.floatSpacePinnedOffsetY || 0;
  15997. return function(c) {
  15998. if(k = a.editable()) {
  15999. c && c.name == "focus" && h.show();
  16000. h.removeStyle("left");
  16001. h.removeStyle("right");
  16002. l = h.getClientRect();
  16003. p = k.getClientRect();
  16004. t = e.getViewPaneSize();
  16005. s = l.height;
  16006. u = "pageXOffset" in e.$ ? e.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft;
  16007. if(i) {
  16008. s + x <= p.top ? f("top") : s + x > t.height - p.bottom ? f("pin") : f("bottom");
  16009. var c = t.width / 2,
  16010. c = p.left > 0 && p.right < t.width && p.width > l.width ? a.config.contentsLangDirection == "rtl" ? "right" : "left" : c - p.left > p.right - c ? "left" : "right",
  16011. d;
  16012. if(l.width > t.width) {
  16013. c = "left";
  16014. d = 0
  16015. } else {
  16016. d = c == "left" ? p.left > 0 ? p.left : 0 : p.right < t.width ? t.width - p.right : 0;
  16017. if(d + l.width > t.width) {
  16018. c = c == "left" ? "right" : "left";
  16019. d = 0
  16020. }
  16021. }
  16022. h.setStyle(c,
  16023. b((i == "pin" ? v : w) + d + (i == "pin" ? 0 : c == "left" ? u : -u)))
  16024. } else {
  16025. i = "pin";
  16026. f("pin");
  16027. j(c)
  16028. }
  16029. }
  16030. }
  16031. }();
  16032. if(d) {
  16033. var f = new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir="{langDir}" title="' + (CKEDITOR.env.gecko ? " " : "") + '" lang="{langCode}" role="application" style="{style}"' + (a.title ? ' aria-labelledby="cke_{name}_arialbl"' : " ") + ">" + (a.title ? '<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>' :
  16034. " ") + '<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),
  16035. h = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(f.output({
  16036. content: d,
  16037. id: a.id,
  16038. langDir: a.lang.dir,
  16039. langCode: a.langCode,
  16040. name: a.name,
  16041. style: "display:none;z-index:" + (c.baseFloatZIndex - 1),
  16042. topId: a.ui.spaceId("top"),
  16043. voiceLabel: a.title
  16044. }))),
  16045. i = CKEDITOR.tools.eventsBuffer(500, j),
  16046. k = CKEDITOR.tools.eventsBuffer(100, j);
  16047. h.unselectable();
  16048. h.on("mousedown", function(a) {
  16049. a = a.data;
  16050. a.getTarget().hasAscendant("a",
  16051. 1) || a.preventDefault()
  16052. });
  16053. a.on("focus", function(b) {
  16054. j(b);
  16055. a.on("change", i.input);
  16056. e.on("scroll", k.input);
  16057. e.on("resize", k.input)
  16058. });
  16059. a.on("blur", function() {
  16060. h.hide();
  16061. a.removeListener("change", i.input);
  16062. e.removeListener("scroll", k.input);
  16063. e.removeListener("resize", k.input)
  16064. });
  16065. a.on("destroy", function() {
  16066. e.removeListener("scroll", k.input);
  16067. e.removeListener("resize", k.input);
  16068. h.clearCustomData();
  16069. h.remove()
  16070. });
  16071. a.focusManager.hasFocus && h.show();
  16072. a.focusManager.add(h, 1)
  16073. }
  16074. }
  16075. var e = CKEDITOR.document.getWindow(),
  16076. b = CKEDITOR.tools.cssLength;
  16077. CKEDITOR.plugins.add("floatingspace", {
  16078. init: function(b) {
  16079. b.on("loaded", function() {
  16080. a(this)
  16081. }, null, null, 20)
  16082. }
  16083. })
  16084. }(), CKEDITOR.plugins.add("listblock", {
  16085. requires: "panel",
  16086. onLoad: function() {
  16087. var a = CKEDITOR.addTemplate("panel-list", '<ul role="presentation" class="cke_panel_list">{items}</ul>'),
  16088. e = CKEDITOR.addTemplate("panel-list-item", '<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')" {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),
  16089. b = CKEDITOR.addTemplate("panel-list-group", '<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),
  16090. g = /\'/g;
  16091. CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) {
  16092. return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b))
  16093. };
  16094. CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
  16095. base: CKEDITOR.ui.panel.block,
  16096. $: function(a, b) {
  16097. var b = b || {},
  16098. e = b.attributes || (b.attributes = {});
  16099. (this.multiSelect = !!b.multiSelect) && (e["aria-multiselectable"] = true);
  16100. !e.role && (e.role = "listbox");
  16101. this.base.apply(this, arguments);
  16102. this.element.setAttribute("role", e.role);
  16103. e = this.keys;
  16104. e[40] = "next";
  16105. e[9] = "next";
  16106. e[38] = "prev";
  16107. e[CKEDITOR.SHIFT + 9] = "prev";
  16108. e[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  16109. CKEDITOR.env.ie && (e[13] = "mouseup");
  16110. this._.pendingHtml = [];
  16111. this._.pendingList = [];
  16112. this._.items = {};
  16113. this._.groups = {}
  16114. },
  16115. _: {
  16116. close: function() {
  16117. if(this._.started) {
  16118. var b = a.output({
  16119. items: this._.pendingList.join("")
  16120. });
  16121. this._.pendingList = [];
  16122. this._.pendingHtml.push(b);
  16123. delete this._.started
  16124. }
  16125. },
  16126. getClick: function() {
  16127. if(!this._.click) this._.click =
  16128. CKEDITOR.tools.addFunction(function(a) {
  16129. var b = this.toggle(a);
  16130. if(this.onClick) this.onClick(a, b)
  16131. }, this);
  16132. return this._.click
  16133. }
  16134. },
  16135. proto: {
  16136. add: function(a, b, j) {
  16137. var f = CKEDITOR.tools.getNextId();
  16138. if(!this._.started) {
  16139. this._.started = 1;
  16140. this._.size = this._.size || 0
  16141. }
  16142. this._.items[a] = f;
  16143. var h;
  16144. h = CKEDITOR.tools.htmlEncodeAttr(a).replace(g, "\\'");
  16145. a = {
  16146. id: f,
  16147. val: h,
  16148. onclick: CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick",
  16149. clickFn: this._.getClick(),
  16150. title: CKEDITOR.tools.htmlEncodeAttr(j || a),
  16151. text: b || a
  16152. };
  16153. this._.pendingList.push(e.output(a))
  16154. },
  16155. startGroup: function(a) {
  16156. this._.close();
  16157. var d = CKEDITOR.tools.getNextId();
  16158. this._.groups[a] = d;
  16159. this._.pendingHtml.push(b.output({
  16160. id: d,
  16161. label: a
  16162. }))
  16163. },
  16164. commit: function() {
  16165. this._.close();
  16166. this.element.appendHtml(this._.pendingHtml.join(""));
  16167. delete this._.size;
  16168. this._.pendingHtml = []
  16169. },
  16170. toggle: function(a) {
  16171. var b = this.isMarked(a);
  16172. b ? this.unmark(a) : this.mark(a);
  16173. return !b
  16174. },
  16175. hideGroup: function(a) {
  16176. var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext();
  16177. if(a) {
  16178. a.setStyle("display", "none");
  16179. b && b.getName() == "ul" &&
  16180. b.setStyle("display", "none")
  16181. }
  16182. },
  16183. hideItem: function(a) {
  16184. this.element.getDocument().getById(this._.items[a]).setStyle("display", "none")
  16185. },
  16186. showAll: function() {
  16187. var a = this._.items,
  16188. b = this._.groups,
  16189. e = this.element.getDocument(),
  16190. f;
  16191. for(f in a) e.getById(a[f]).setStyle("display", "");
  16192. for(var g in b) {
  16193. a = e.getById(b[g]);
  16194. f = a.getNext();
  16195. a.setStyle("display", "");
  16196. f && f.getName() == "ul" && f.setStyle("display", "")
  16197. }
  16198. },
  16199. mark: function(a) {
  16200. this.multiSelect || this.unmarkAll();
  16201. var a = this._.items[a],
  16202. b = this.element.getDocument().getById(a);
  16203. b.addClass("cke_selected");
  16204. this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", true);
  16205. this.onMark && this.onMark(b)
  16206. },
  16207. unmark: function(a) {
  16208. var b = this.element.getDocument(),
  16209. a = this._.items[a],
  16210. e = b.getById(a);
  16211. e.removeClass("cke_selected");
  16212. b.getById(a + "_option").removeAttribute("aria-selected");
  16213. this.onUnmark && this.onUnmark(e)
  16214. },
  16215. unmarkAll: function() {
  16216. var a = this._.items,
  16217. b = this.element.getDocument(),
  16218. e;
  16219. for(e in a) {
  16220. var f = a[e];
  16221. b.getById(f).removeClass("cke_selected");
  16222. b.getById(f + "_option").removeAttribute("aria-selected")
  16223. }
  16224. this.onUnmark &&
  16225. this.onUnmark()
  16226. },
  16227. isMarked: function(a) {
  16228. return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")
  16229. },
  16230. focus: function(a) {
  16231. this._.focusIndex = -1;
  16232. var b = this.element.getElementsByTag("a"),
  16233. e, f = -1;
  16234. if(a)
  16235. for(e = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++f);) {
  16236. if(a.equals(e)) {
  16237. this._.focusIndex = f;
  16238. break
  16239. }
  16240. } else this.element.focus();
  16241. e && setTimeout(function() {
  16242. e.focus()
  16243. }, 0)
  16244. }
  16245. }
  16246. })
  16247. }
  16248. }),
  16249. function() {
  16250. var a = '<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"' +
  16251. (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href=\"javascript:void('{titleJs}')\"") + ' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';
  16252. CKEDITOR.env.gecko && CKEDITOR.env.mac && (a = a + ' onkeypress="return false;"');
  16253. CKEDITOR.env.gecko && (a = a + ' onblur="this.style.cssText = this.style.cssText;"');
  16254. var a = a + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' +
  16255. (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),
  16256. a = a + '>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',
  16257. e = CKEDITOR.addTemplate("buttonArrow", '<span class="cke_button_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : "") + "</span>"),
  16258. b = CKEDITOR.addTemplate("button", a);
  16259. CKEDITOR.plugins.add("button", {
  16260. beforeInit: function(a) {
  16261. a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler)
  16262. }
  16263. });
  16264. CKEDITOR.UI_BUTTON = "button";
  16265. CKEDITOR.ui.button = function(a) {
  16266. CKEDITOR.tools.extend(this, a, {
  16267. title: a.label,
  16268. click: a.click || function(b) {
  16269. b.execCommand(a.command)
  16270. }
  16271. });
  16272. this._ = {}
  16273. };
  16274. CKEDITOR.ui.button.handler = {
  16275. create: function(a) {
  16276. return new CKEDITOR.ui.button(a)
  16277. }
  16278. };
  16279. CKEDITOR.ui.button.prototype = {
  16280. render: function(a, c) {
  16281. function d() {
  16282. var b = a.mode;
  16283. if(b) {
  16284. b = this.modes[b] ? l[b] !== void 0 ? l[b] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  16285. b = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : b;
  16286. this.setState(b);
  16287. this.refresh && this.refresh()
  16288. }
  16289. }
  16290. var j = CKEDITOR.env,
  16291. f = this._.id = CKEDITOR.tools.getNextId(),
  16292. h = "",
  16293. i = this.command,
  16294. k;
  16295. this._.editor = a;
  16296. var n = {
  16297. id: f,
  16298. button: this,
  16299. editor: a,
  16300. focus: function() {
  16301. CKEDITOR.document.getById(f).focus()
  16302. },
  16303. execute: function() {
  16304. this.button.click(a)
  16305. },
  16306. attach: function(a) {
  16307. this.button.attach(a)
  16308. }
  16309. },
  16310. o = CKEDITOR.tools.addFunction(function(a) {
  16311. if(n.onkey) {
  16312. a = new CKEDITOR.dom.event(a);
  16313. return n.onkey(n, a.getKeystroke()) !== false
  16314. }
  16315. }),
  16316. q =
  16317. CKEDITOR.tools.addFunction(function(a) {
  16318. var b;
  16319. n.onfocus && (b = n.onfocus(n, new CKEDITOR.dom.event(a)) !== false);
  16320. return b
  16321. }),
  16322. m = 0;
  16323. n.clickFn = k = CKEDITOR.tools.addFunction(function() {
  16324. if(m) {
  16325. a.unlockSelection(1);
  16326. m = 0
  16327. }
  16328. n.execute();
  16329. j.iOS && a.focus()
  16330. });
  16331. if(this.modes) {
  16332. var l = {};
  16333. a.on("beforeModeUnload", function() {
  16334. if(a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED) l[a.mode] = this._.state
  16335. }, this);
  16336. a.on("activeFilterChange", d, this);
  16337. a.on("mode", d, this);
  16338. !this.readOnly && a.on("readOnly", d, this)
  16339. } else if(i)
  16340. if(i = a.getCommand(i)) {
  16341. i.on("state",
  16342. function() {
  16343. this.setState(i.state)
  16344. }, this);
  16345. h = h + (i.state == CKEDITOR.TRISTATE_ON ? "on" : i.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off")
  16346. }
  16347. if(this.directional) a.on("contentDirChanged", function(b) {
  16348. var c = CKEDITOR.document.getById(this._.id),
  16349. d = c.getFirst(),
  16350. b = b.data;
  16351. b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl");
  16352. d.setAttribute("style", CKEDITOR.skin.getIconStyle(t, b == "rtl", this.icon, this.iconOffset))
  16353. }, this);
  16354. i || (h = h + "off");
  16355. var p = this.name || this.command,
  16356. t = p;
  16357. if(this.icon &&
  16358. !/\./.test(this.icon)) {
  16359. t = this.icon;
  16360. this.icon = null
  16361. }
  16362. h = {
  16363. id: f,
  16364. name: p,
  16365. iconName: t,
  16366. label: this.label,
  16367. cls: this.className || "",
  16368. state: h,
  16369. ariaDisabled: h == "disabled" ? "true" : "false",
  16370. title: this.title,
  16371. titleJs: j.gecko && !j.hc ? "" : (this.title || "").replace("'", ""),
  16372. hasArrow: this.hasArrow ? "true" : "false",
  16373. keydownFn: o,
  16374. focusFn: q,
  16375. clickFn: k,
  16376. style: CKEDITOR.skin.getIconStyle(t, a.lang.dir == "rtl", this.icon, this.iconOffset),
  16377. arrowHtml: this.hasArrow ? e.output() : ""
  16378. };
  16379. b.output(h, c);
  16380. if(this.onRender) this.onRender();
  16381. return n
  16382. },
  16383. setState: function(a) {
  16384. if(this._.state ==
  16385. a) return false;
  16386. this._.state = a;
  16387. var b = CKEDITOR.document.getById(this._.id);
  16388. if(b) {
  16389. b.setState(a, "cke_button");
  16390. a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", true) : b.removeAttribute("aria-disabled");
  16391. if(this.hasArrow) {
  16392. a = a == CKEDITOR.TRISTATE_ON ? this._.editor.lang.button.selectedLabel.replace(/%1/g, this.label) : this.label;
  16393. CKEDITOR.document.getById(this._.id + "_label").setText(a)
  16394. } else a == CKEDITOR.TRISTATE_ON ? b.setAttribute("aria-pressed", true) : b.removeAttribute("aria-pressed");
  16395. return true
  16396. }
  16397. return false
  16398. },
  16399. getState: function() {
  16400. return this._.state
  16401. },
  16402. toFeature: function(a) {
  16403. if(this._.feature) return this._.feature;
  16404. var b = this;
  16405. !this.allowedContent && (!this.requiredContent && this.command) && (b = a.getCommand(this.command) || b);
  16406. return this._.feature = b
  16407. }
  16408. };
  16409. CKEDITOR.ui.prototype.addButton = function(a, b) {
  16410. this.add(a, CKEDITOR.UI_BUTTON, b)
  16411. }
  16412. }(), CKEDITOR.plugins.add("richcombo", {
  16413. requires: "floatpanel,listblock,button",
  16414. beforeInit: function(a) {
  16415. a.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler)
  16416. }
  16417. }),
  16418. function() {
  16419. var a =
  16420. '<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" title="{title}" tabindex="-1"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href=\"javascript:void('{titleJs}')\"") + ' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';
  16421. CKEDITOR.env.gecko && CKEDITOR.env.mac && (a = a + ' onkeypress="return false;"');
  16422. CKEDITOR.env.gecko && (a = a + ' onblur="this.style.cssText = this.style.cssText;"');
  16423. var a = a + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : CKEDITOR.env.air ? "&nbsp;" : "") + "</span></span></a></span>"),
  16424. e = CKEDITOR.addTemplate("combo", a);
  16425. CKEDITOR.UI_RICHCOMBO = "richcombo";
  16426. CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({
  16427. $: function(a) {
  16428. CKEDITOR.tools.extend(this, a, {
  16429. canGroup: false,
  16430. title: a.label,
  16431. modes: {
  16432. wysiwyg: 1
  16433. },
  16434. editorFocus: 1
  16435. });
  16436. a = this.panel || {};
  16437. delete this.panel;
  16438. this.id = CKEDITOR.tools.getNextNumber();
  16439. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  16440. a.className = "cke_combopanel";
  16441. a.block = {
  16442. multiSelect: a.multiSelect,
  16443. attributes: a.attributes
  16444. };
  16445. a.toolbarRelated = true;
  16446. this._ = {
  16447. panelDefinition: a,
  16448. items: {}
  16449. }
  16450. },
  16451. proto: {
  16452. renderHtml: function(a) {
  16453. var e = [];
  16454. this.render(a, e);
  16455. return e.join("")
  16456. },
  16457. render: function(a, g) {
  16458. function c() {
  16459. if(this.getState() != CKEDITOR.TRISTATE_ON) {
  16460. var c = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  16461. if(a.readOnly && !this.readOnly) c = CKEDITOR.TRISTATE_DISABLED;
  16462. this.setState(c);
  16463. this.setValue("");
  16464. c != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
  16465. }
  16466. }
  16467. var d = CKEDITOR.env,
  16468. j = "cke_" + this.id,
  16469. f = CKEDITOR.tools.addFunction(function(c) {
  16470. if(o) {
  16471. a.unlockSelection(1);
  16472. o = 0
  16473. }
  16474. i.execute(c)
  16475. },
  16476. this),
  16477. h = this,
  16478. i = {
  16479. id: j,
  16480. combo: this,
  16481. focus: function() {
  16482. CKEDITOR.document.getById(j).getChild(1).focus()
  16483. },
  16484. execute: function(c) {
  16485. var d = h._;
  16486. if(d.state != CKEDITOR.TRISTATE_DISABLED) {
  16487. h.createPanel(a);
  16488. if(d.on) d.panel.hide();
  16489. else {
  16490. h.commit();
  16491. var f = h.getValue();
  16492. f ? d.list.mark(f) : d.list.unmarkAll();
  16493. d.panel.showBlock(h.id, new CKEDITOR.dom.element(c), 4)
  16494. }
  16495. }
  16496. },
  16497. clickFn: f
  16498. };
  16499. a.on("activeFilterChange", c, this);
  16500. a.on("mode", c, this);
  16501. a.on("selectionChange", c, this);
  16502. !this.readOnly && a.on("readOnly", c, this);
  16503. var k = CKEDITOR.tools.addFunction(function(c,
  16504. d) {
  16505. var c = new CKEDITOR.dom.event(c),
  16506. e = c.getKeystroke();
  16507. if(e == 40) a.once("panelShow", function(a) {
  16508. a.data._.panel._.currentBlock.onKeyDown(40)
  16509. });
  16510. switch(e) {
  16511. case 13:
  16512. case 32:
  16513. case 40:
  16514. CKEDITOR.tools.callFunction(f, d);
  16515. break;
  16516. default:
  16517. i.onkey(i, e)
  16518. }
  16519. c.preventDefault()
  16520. }),
  16521. n = CKEDITOR.tools.addFunction(function() {
  16522. i.onfocus && i.onfocus()
  16523. }),
  16524. o = 0;
  16525. i.keyDownFn = k;
  16526. d = {
  16527. id: j,
  16528. name: this.name || this.command,
  16529. label: this.label,
  16530. title: this.title,
  16531. cls: this.className || "",
  16532. titleJs: d.gecko && !d.hc ? "" : (this.title || "").replace("'", ""),
  16533. keydownFn: k,
  16534. focusFn: n,
  16535. clickFn: f
  16536. };
  16537. e.output(d, g);
  16538. if(this.onRender) this.onRender();
  16539. return i
  16540. },
  16541. createPanel: function(a) {
  16542. if(!this._.panel) {
  16543. var e = this._.panelDefinition,
  16544. c = this._.panelDefinition.block,
  16545. d = e.parent || CKEDITOR.document.getBody(),
  16546. j = "cke_combopanel__" + this.name,
  16547. f = new CKEDITOR.ui.floatPanel(a, d, e),
  16548. h = f.addListBlock(this.id, c),
  16549. i = this;
  16550. f.onShow = function() {
  16551. this.element.addClass(j);
  16552. i.setState(CKEDITOR.TRISTATE_ON);
  16553. i._.on = 1;
  16554. i.editorFocus && !a.focusManager.hasFocus && a.focus();
  16555. if(i.onOpen) i.onOpen();
  16556. a.once("panelShow",
  16557. function() {
  16558. h.focus(!h.multiSelect && i.getValue())
  16559. })
  16560. };
  16561. f.onHide = function(c) {
  16562. this.element.removeClass(j);
  16563. i.setState(i.modes && i.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  16564. i._.on = 0;
  16565. if(!c && i.onClose) i.onClose()
  16566. };
  16567. f.onEscape = function() {
  16568. f.hide(1)
  16569. };
  16570. h.onClick = function(a, b) {
  16571. i.onClick && i.onClick.call(i, a, b);
  16572. f.hide()
  16573. };
  16574. this._.panel = f;
  16575. this._.list = h;
  16576. f.getBlock(this.id).onHide = function() {
  16577. i._.on = 0;
  16578. i.setState(CKEDITOR.TRISTATE_OFF)
  16579. };
  16580. this.init && this.init()
  16581. }
  16582. },
  16583. setValue: function(a, e) {
  16584. this._.value = a;
  16585. var c =
  16586. this.document.getById("cke_" + this.id + "_text");
  16587. if(c) {
  16588. if(!a && !e) {
  16589. e = this.label;
  16590. c.addClass("cke_combo_inlinelabel")
  16591. } else c.removeClass("cke_combo_inlinelabel");
  16592. c.setText(typeof e != "undefined" ? e : a)
  16593. }
  16594. },
  16595. getValue: function() {
  16596. return this._.value || ""
  16597. },
  16598. unmarkAll: function() {
  16599. this._.list.unmarkAll()
  16600. },
  16601. mark: function(a) {
  16602. this._.list.mark(a)
  16603. },
  16604. hideItem: function(a) {
  16605. this._.list.hideItem(a)
  16606. },
  16607. hideGroup: function(a) {
  16608. this._.list.hideGroup(a)
  16609. },
  16610. showAll: function() {
  16611. this._.list.showAll()
  16612. },
  16613. add: function(a, e, c) {
  16614. this._.items[a] = c || a;
  16615. this._.list.add(a, e, c)
  16616. },
  16617. startGroup: function(a) {
  16618. this._.list.startGroup(a)
  16619. },
  16620. commit: function() {
  16621. if(!this._.committed) {
  16622. this._.list.commit();
  16623. this._.committed = 1;
  16624. CKEDITOR.ui.fire("ready", this)
  16625. }
  16626. this._.committed = 1
  16627. },
  16628. setState: function(a) {
  16629. if(this._.state != a) {
  16630. var e = this.document.getById("cke_" + this.id);
  16631. e.setState(a, "cke_combo");
  16632. a == CKEDITOR.TRISTATE_DISABLED ? e.setAttribute("aria-disabled", true) : e.removeAttribute("aria-disabled");
  16633. this._.state = a
  16634. }
  16635. },
  16636. getState: function() {
  16637. return this._.state
  16638. },
  16639. enable: function() {
  16640. this._.state ==
  16641. CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
  16642. },
  16643. disable: function() {
  16644. if(this._.state != CKEDITOR.TRISTATE_DISABLED) {
  16645. this._.lastState = this._.state;
  16646. this.setState(CKEDITOR.TRISTATE_DISABLED)
  16647. }
  16648. }
  16649. },
  16650. statics: {
  16651. handler: {
  16652. create: function(a) {
  16653. return new CKEDITOR.ui.richCombo(a)
  16654. }
  16655. }
  16656. }
  16657. });
  16658. CKEDITOR.ui.prototype.addRichCombo = function(a, e) {
  16659. this.add(a, CKEDITOR.UI_RICHCOMBO, e)
  16660. }
  16661. }(), CKEDITOR.plugins.add("format", {
  16662. requires: "richcombo",
  16663. init: function(a) {
  16664. if(!a.blockless) {
  16665. for(var e = a.config, b = a.lang.format, g = e.format_tags.split(";"),
  16666. c = {}, d = 0, j = [], f = 0; f < g.length; f++) {
  16667. var h = g[f],
  16668. i = new CKEDITOR.style(e["format_" + h]);
  16669. if(!a.filter.customConfig || a.filter.check(i)) {
  16670. d++;
  16671. c[h] = i;
  16672. c[h]._.enterMode = a.config.enterMode;
  16673. j.push(i)
  16674. }
  16675. }
  16676. d !== 0 && a.ui.addRichCombo("Format", {
  16677. label: b.label,
  16678. title: b.panelTitle,
  16679. toolbar: "styles,20",
  16680. allowedContent: j,
  16681. panel: {
  16682. css: [CKEDITOR.skin.getPath("editor")].concat(e.contentsCss),
  16683. multiSelect: false,
  16684. attributes: {
  16685. "aria-label": b.panelTitle
  16686. }
  16687. },
  16688. init: function() {
  16689. this.startGroup(b.panelTitle);
  16690. for(var a in c) {
  16691. var d = b["tag_" + a];
  16692. this.add(a,
  16693. c[a].buildPreview(d), d)
  16694. }
  16695. },
  16696. onClick: function(b) {
  16697. a.focus();
  16698. a.fire("saveSnapshot");
  16699. var b = c[b],
  16700. d = a.elementPath();
  16701. a[b.checkActive(d, a) ? "removeStyle" : "applyStyle"](b);
  16702. setTimeout(function() {
  16703. a.fire("saveSnapshot")
  16704. }, 0)
  16705. },
  16706. onRender: function() {
  16707. a.on("selectionChange", function(b) {
  16708. var d = this.getValue(),
  16709. b = b.data.path;
  16710. this.refresh();
  16711. for(var f in c)
  16712. if(c[f].checkActive(b, a)) {
  16713. f != d && this.setValue(f, a.lang.format["tag_" + f]);
  16714. return
  16715. }
  16716. this.setValue("")
  16717. }, this)
  16718. },
  16719. onOpen: function() {
  16720. this.showAll();
  16721. for(var b in c) a.activeFilter.check(c[b]) ||
  16722. this.hideItem(b)
  16723. },
  16724. refresh: function() {
  16725. var b = a.elementPath();
  16726. if(b) {
  16727. if(b.isContextFor("p"))
  16728. for(var d in c)
  16729. if(a.activeFilter.check(c[d])) return;
  16730. this.setState(CKEDITOR.TRISTATE_DISABLED)
  16731. }
  16732. }
  16733. })
  16734. }
  16735. }
  16736. }), CKEDITOR.config.format_tags = "p;h1;h2;h3;h4;h5;h6;pre;address;div", CKEDITOR.config.format_p = {
  16737. element: "p"
  16738. }, CKEDITOR.config.format_div = {
  16739. element: "div"
  16740. }, CKEDITOR.config.format_pre = {
  16741. element: "pre"
  16742. }, CKEDITOR.config.format_address = {
  16743. element: "address"
  16744. }, CKEDITOR.config.format_h1 = {
  16745. element: "h1"
  16746. }, CKEDITOR.config.format_h2 = {
  16747. element: "h2"
  16748. },
  16749. CKEDITOR.config.format_h3 = {
  16750. element: "h3"
  16751. }, CKEDITOR.config.format_h4 = {
  16752. element: "h4"
  16753. }, CKEDITOR.config.format_h5 = {
  16754. element: "h5"
  16755. }, CKEDITOR.config.format_h6 = {
  16756. element: "h6"
  16757. },
  16758. function() {
  16759. var a = {
  16760. canUndo: false,
  16761. exec: function(a) {
  16762. var b = a.document.createElement("hr");
  16763. a.insertElement(b)
  16764. },
  16765. allowedContent: "hr",
  16766. requiredContent: "hr"
  16767. };
  16768. CKEDITOR.plugins.add("horizontalrule", {
  16769. init: function(e) {
  16770. if(!e.blockless) {
  16771. e.addCommand("horizontalrule", a);
  16772. e.ui.addButton && e.ui.addButton("HorizontalRule", {
  16773. label: e.lang.horizontalrule.toolbar,
  16774. command: "horizontalrule",
  16775. toolbar: "insert,40"
  16776. })
  16777. }
  16778. }
  16779. })
  16780. }(), CKEDITOR.plugins.add("htmlwriter", {
  16781. init: function(a) {
  16782. var e = new CKEDITOR.htmlWriter;
  16783. e.forceSimpleAmpersand = a.config.forceSimpleAmpersand;
  16784. e.indentationChars = a.config.dataIndentationChars || "\t";
  16785. a.dataProcessor.writer = e
  16786. }
  16787. }), CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({
  16788. base: CKEDITOR.htmlParser.basicWriter,
  16789. $: function() {
  16790. this.base();
  16791. this.indentationChars = "\t";
  16792. this.selfClosingEnd = " />";
  16793. this.lineBreakChars = "\n";
  16794. this.sortAttributes = 1;
  16795. this._.indent = 0;
  16796. this._.indentation =
  16797. "";
  16798. this._.inPre = 0;
  16799. this._.rules = {};
  16800. var a = CKEDITOR.dtd,
  16801. e;
  16802. for(e in CKEDITOR.tools.extend({}, a.$nonBodyContent, a.$block, a.$listItem, a.$tableContent)) this.setRules(e, {
  16803. indent: !a[e]["#"],
  16804. breakBeforeOpen: 1,
  16805. breakBeforeClose: !a[e]["#"],
  16806. breakAfterClose: 1,
  16807. needsSpace: e in a.$block && !(e in {
  16808. li: 1,
  16809. dt: 1,
  16810. dd: 1
  16811. })
  16812. });
  16813. this.setRules("br", {
  16814. breakAfterOpen: 1
  16815. });
  16816. this.setRules("title", {
  16817. indent: 0,
  16818. breakAfterOpen: 0
  16819. });
  16820. this.setRules("style", {
  16821. indent: 0,
  16822. breakBeforeClose: 1
  16823. });
  16824. this.setRules("pre", {
  16825. breakAfterOpen: 1,
  16826. indent: 0
  16827. })
  16828. },
  16829. proto: {
  16830. openTag: function(a) {
  16831. var e =
  16832. this._.rules[a];
  16833. this._.afterCloser && (e && e.needsSpace && this._.needsSpace) && this._.output.push("\n");
  16834. if(this._.indent) this.indentation();
  16835. else if(e && e.breakBeforeOpen) {
  16836. this.lineBreak();
  16837. this.indentation()
  16838. }
  16839. this._.output.push("<", a);
  16840. this._.afterCloser = 0
  16841. },
  16842. openTagClose: function(a, e) {
  16843. var b = this._.rules[a];
  16844. if(e) {
  16845. this._.output.push(this.selfClosingEnd);
  16846. if(b && b.breakAfterClose) this._.needsSpace = b.needsSpace
  16847. } else {
  16848. this._.output.push(">");
  16849. if(b && b.indent) this._.indentation = this._.indentation + this.indentationChars
  16850. }
  16851. b &&
  16852. b.breakAfterOpen && this.lineBreak();
  16853. a == "pre" && (this._.inPre = 1)
  16854. },
  16855. attribute: function(a, e) {
  16856. if(typeof e == "string") {
  16857. this.forceSimpleAmpersand && (e = e.replace(/&amp;/g, "&"));
  16858. e = CKEDITOR.tools.htmlEncodeAttr(e)
  16859. }
  16860. this._.output.push(" ", a, '="', e, '"')
  16861. },
  16862. closeTag: function(a) {
  16863. var e = this._.rules[a];
  16864. if(e && e.indent) this._.indentation = this._.indentation.substr(this.indentationChars.length);
  16865. if(this._.indent) this.indentation();
  16866. else if(e && e.breakBeforeClose) {
  16867. this.lineBreak();
  16868. this.indentation()
  16869. }
  16870. this._.output.push("</", a, ">");
  16871. a == "pre" && (this._.inPre = 0);
  16872. if(e && e.breakAfterClose) {
  16873. this.lineBreak();
  16874. this._.needsSpace = e.needsSpace
  16875. }
  16876. this._.afterCloser = 1
  16877. },
  16878. text: function(a) {
  16879. if(this._.indent) {
  16880. this.indentation();
  16881. !this._.inPre && (a = CKEDITOR.tools.ltrim(a))
  16882. }
  16883. this._.output.push(a)
  16884. },
  16885. comment: function(a) {
  16886. this._.indent && this.indentation();
  16887. this._.output.push("<\!--", a, "--\>")
  16888. },
  16889. lineBreak: function() {
  16890. !this._.inPre && this._.output.length > 0 && this._.output.push(this.lineBreakChars);
  16891. this._.indent = 1
  16892. },
  16893. indentation: function() {
  16894. !this._.inPre && this._.indentation &&
  16895. this._.output.push(this._.indentation);
  16896. this._.indent = 0
  16897. },
  16898. reset: function() {
  16899. this._.output = [];
  16900. this._.indent = 0;
  16901. this._.indentation = "";
  16902. this._.afterCloser = 0;
  16903. this._.inPre = 0
  16904. },
  16905. setRules: function(a, e) {
  16906. var b = this._.rules[a];
  16907. b ? CKEDITOR.tools.extend(b, e, true) : this._.rules[a] = e
  16908. }
  16909. }
  16910. }),
  16911. function() {
  16912. function a(a, e) {
  16913. e || (e = a.getSelection().getSelectedElement());
  16914. if(e && e.is("img") && !e.data("cke-realelement") && !e.isReadOnly()) return e
  16915. }
  16916. function e(a) {
  16917. var e = a.getStyle("float");
  16918. if(e == "inherit" || e == "none") e = 0;
  16919. e || (e = a.getAttribute("align"));
  16920. return e
  16921. }
  16922. CKEDITOR.plugins.add("image", {
  16923. requires: "dialog",
  16924. init: function(b) {
  16925. if(!b.plugins.image2) {
  16926. CKEDITOR.dialog.add("image", this.path + "dialogs/image.js");
  16927. var e = "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
  16928. CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (e = "img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");
  16929. b.addCommand("image", new CKEDITOR.dialogCommand("image", {
  16930. allowedContent: e,
  16931. requiredContent: "img[alt,src]",
  16932. contentTransformations: [
  16933. ["img{width}: sizeToStyle",
  16934. "img[width]: sizeToAttribute"
  16935. ],
  16936. ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"]
  16937. ]
  16938. }));
  16939. b.ui.addButton && b.ui.addButton("Image", {
  16940. label: b.lang.common.image,
  16941. command: "image",
  16942. toolbar: "insert,10"
  16943. });
  16944. b.on("doubleclick", function(a) {
  16945. var b = a.data.element;
  16946. if(b.is("img") && !b.data("cke-realelement") && !b.isReadOnly()) a.data.dialog = "image"
  16947. });
  16948. b.addMenuItems && b.addMenuItems({
  16949. image: {
  16950. label: b.lang.image.menu,
  16951. command: "image",
  16952. group: "image"
  16953. }
  16954. });
  16955. b.contextMenu && b.contextMenu.addListener(function(c) {
  16956. if(a(b, c)) return {
  16957. image: CKEDITOR.TRISTATE_OFF
  16958. }
  16959. })
  16960. }
  16961. },
  16962. afterInit: function(b) {
  16963. function g(c) {
  16964. var d = b.getCommand("justify" + c);
  16965. if(d) {
  16966. if(c == "left" || c == "right") d.on("exec", function(d) {
  16967. var f = a(b),
  16968. g;
  16969. if(f) {
  16970. g = e(f);
  16971. if(g == c) {
  16972. f.removeStyle("float");
  16973. c == e(f) && f.removeAttribute("align")
  16974. } else f.setStyle("float", c);
  16975. d.cancel()
  16976. }
  16977. });
  16978. d.on("refresh", function(d) {
  16979. var f = a(b);
  16980. if(f) {
  16981. f = e(f);
  16982. this.setState(f == c ? CKEDITOR.TRISTATE_ON : c == "right" || c == "left" ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  16983. d.cancel()
  16984. }
  16985. })
  16986. }
  16987. }
  16988. if(!b.plugins.image2) {
  16989. g("left");
  16990. g("right");
  16991. g("center");
  16992. g("block")
  16993. }
  16994. }
  16995. })
  16996. }(),
  16997. CKEDITOR.config.image_removeLinkByEmptyURL = !0,
  16998. function() {
  16999. function a(a, b) {
  17000. var c = g.exec(a),
  17001. e = g.exec(b);
  17002. if(c) {
  17003. if(!c[2] && e[2] == "px") return e[1];
  17004. if(c[2] == "px" && !e[2]) return e[1] + "px"
  17005. }
  17006. return b
  17007. }
  17008. var e = CKEDITOR.htmlParser.cssStyle,
  17009. b = CKEDITOR.tools.cssLength,
  17010. g = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,
  17011. c = {
  17012. elements: {
  17013. $: function(b) {
  17014. var c = b.attributes;
  17015. if((c = (c = (c = c && c["data-cke-realelement"]) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(c))) && c.children[0]) && b.attributes["data-cke-resizable"]) {
  17016. var f =
  17017. (new e(b)).rules,
  17018. b = c.attributes,
  17019. g = f.width,
  17020. f = f.height;
  17021. g && (b.width = a(b.width, g));
  17022. f && (b.height = a(b.height, f))
  17023. }
  17024. return c
  17025. }
  17026. }
  17027. };
  17028. CKEDITOR.plugins.add("fakeobjects", {
  17029. init: function(a) {
  17030. a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}", "fakeobjects")
  17031. },
  17032. afterInit: function(a) {
  17033. (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(c, {
  17034. applyToAll: true
  17035. })
  17036. }
  17037. });
  17038. CKEDITOR.editor.prototype.createFakeElement = function(a, c, f, g) {
  17039. var i = this.lang.fakeobjects,
  17040. i = i[f] || i.unknown,
  17041. c = {
  17042. "class": c,
  17043. "data-cke-realelement": encodeURIComponent(a.getOuterHtml()),
  17044. "data-cke-real-node-type": a.type,
  17045. alt: i,
  17046. title: i,
  17047. align: a.getAttribute("align") || ""
  17048. };
  17049. if(!CKEDITOR.env.hc) c.src = CKEDITOR.tools.transparentImageData;
  17050. f && (c["data-cke-real-element-type"] = f);
  17051. if(g) {
  17052. c["data-cke-resizable"] = g;
  17053. f = new e;
  17054. g = a.getAttribute("width");
  17055. a = a.getAttribute("height");
  17056. g && (f.rules.width = b(g));
  17057. a && (f.rules.height = b(a));
  17058. f.populate(c)
  17059. }
  17060. return this.document.createElement("img", {
  17061. attributes: c
  17062. })
  17063. };
  17064. CKEDITOR.editor.prototype.createFakeParserElement = function(a, c, f, g) {
  17065. var i = this.lang.fakeobjects,
  17066. i = i[f] ||
  17067. i.unknown,
  17068. k;
  17069. k = new CKEDITOR.htmlParser.basicWriter;
  17070. a.writeHtml(k);
  17071. k = k.getHtml();
  17072. c = {
  17073. "class": c,
  17074. "data-cke-realelement": encodeURIComponent(k),
  17075. "data-cke-real-node-type": a.type,
  17076. alt: i,
  17077. title: i,
  17078. align: a.attributes.align || ""
  17079. };
  17080. if(!CKEDITOR.env.hc) c.src = CKEDITOR.tools.transparentImageData;
  17081. f && (c["data-cke-real-element-type"] = f);
  17082. if(g) {
  17083. c["data-cke-resizable"] = g;
  17084. g = a.attributes;
  17085. a = new e;
  17086. f = g.width;
  17087. g = g.height;
  17088. f !== void 0 && (a.rules.width = b(f));
  17089. g !== void 0 && (a.rules.height = b(g));
  17090. a.populate(c)
  17091. }
  17092. return new CKEDITOR.htmlParser.element("img",
  17093. c)
  17094. };
  17095. CKEDITOR.editor.prototype.restoreRealElement = function(b) {
  17096. if(b.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null;
  17097. var c = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(b.data("cke-realelement")), this.document);
  17098. if(b.data("cke-resizable")) {
  17099. var f = b.getStyle("width"),
  17100. b = b.getStyle("height");
  17101. f && c.setAttribute("width", a(c.getAttribute("width"), f));
  17102. b && c.setAttribute("height", a(c.getAttribute("height"), b))
  17103. }
  17104. return c
  17105. }
  17106. }(), "use strict",
  17107. function() {
  17108. function a(a) {
  17109. return a.replace(/'/g, "\\$&")
  17110. }
  17111. function e(a) {
  17112. for(var b, c = a.length, d = [], f = 0; f < c; f++) {
  17113. b = a.charCodeAt(f);
  17114. d.push(b)
  17115. }
  17116. return "String.fromCharCode(" + d.join(",") + ")"
  17117. }
  17118. function b(b, c) {
  17119. var d = b.plugins.link,
  17120. f = d.compiledProtectionFunction.params,
  17121. e, g;
  17122. g = [d.compiledProtectionFunction.name, "("];
  17123. for(var h = 0; h < f.length; h++) {
  17124. d = f[h].toLowerCase();
  17125. e = c[d];
  17126. h > 0 && g.push(",");
  17127. g.push("'", e ? a(encodeURIComponent(c[d])) : "", "'")
  17128. }
  17129. g.push(")");
  17130. return g.join("")
  17131. }
  17132. function g(a) {
  17133. var a = a.config.emailProtection || "",
  17134. b;
  17135. if(a && a != "encode") {
  17136. b = {};
  17137. a.replace(/^([^(]+)\(([^)]+)\)$/,
  17138. function(a, c, d) {
  17139. b.name = c;
  17140. b.params = [];
  17141. d.replace(/[^,\s]+/g, function(a) {
  17142. b.params.push(a)
  17143. })
  17144. })
  17145. }
  17146. return b
  17147. }
  17148. CKEDITOR.plugins.add("link", {
  17149. requires: "dialog,fakeobjects",
  17150. onLoad: function() {
  17151. function a(b) {
  17152. return c.replace(/%1/g, b == "rtl" ? "right" : "left").replace(/%2/g, "cke_contents_" + b)
  17153. }
  17154. 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;",
  17155. c = ".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{" +
  17156. b + "padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{" + b + "width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
  17157. CKEDITOR.addCss(a("ltr") + a("rtl"))
  17158. },
  17159. init: function(a) {
  17160. var b = "a[!href]";
  17161. CKEDITOR.dialog.isTabEnabled(a, "link", "advanced") && (b = b.replace("]", ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));
  17162. CKEDITOR.dialog.isTabEnabled(a, "link", "target") && (b = b.replace("]", ",target,onclick]"));
  17163. a.addCommand("link", new CKEDITOR.dialogCommand("link", {
  17164. allowedContent: b,
  17165. requiredContent: "a[href]"
  17166. }));
  17167. a.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", {
  17168. allowedContent: "a[!name,id]",
  17169. requiredContent: "a[name]"
  17170. }));
  17171. a.addCommand("unlink", new CKEDITOR.unlinkCommand);
  17172. a.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand);
  17173. a.setKeystroke(CKEDITOR.CTRL + 76, "link");
  17174. if(a.ui.addButton) {
  17175. a.ui.addButton("Link", {
  17176. label: a.lang.link.toolbar,
  17177. command: "link",
  17178. toolbar: "links,10"
  17179. });
  17180. a.ui.addButton("Unlink", {
  17181. label: a.lang.link.unlink,
  17182. command: "unlink",
  17183. toolbar: "links,20"
  17184. });
  17185. a.ui.addButton("Anchor", {
  17186. label: a.lang.link.anchor.toolbar,
  17187. command: "anchor",
  17188. toolbar: "links,30"
  17189. })
  17190. }
  17191. CKEDITOR.dialog.add("link", this.path + "dialogs/link.js");
  17192. CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js");
  17193. a.on("doubleclick", function(b) {
  17194. var c = CKEDITOR.plugins.link.getSelectedLink(a) || b.data.element;
  17195. if(!c.isReadOnly())
  17196. if(c.is("a")) {
  17197. b.data.dialog = c.getAttribute("name") && (!c.getAttribute("href") || !c.getChildCount()) ? "anchor" : "link";
  17198. b.data.link = c
  17199. } else if(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, c)) b.data.dialog = "anchor"
  17200. }, null, null, 0);
  17201. a.on("doubleclick",
  17202. function(b) {
  17203. b.data.dialog in {
  17204. link: 1,
  17205. anchor: 1
  17206. } && b.data.link && a.getSelection().selectElement(b.data.link)
  17207. }, null, null, 20);
  17208. a.addMenuItems && a.addMenuItems({
  17209. anchor: {
  17210. label: a.lang.link.anchor.menu,
  17211. command: "anchor",
  17212. group: "anchor",
  17213. order: 1
  17214. },
  17215. removeAnchor: {
  17216. label: a.lang.link.anchor.remove,
  17217. command: "removeAnchor",
  17218. group: "anchor",
  17219. order: 5
  17220. },
  17221. link: {
  17222. label: a.lang.link.menu,
  17223. command: "link",
  17224. group: "link",
  17225. order: 1
  17226. },
  17227. unlink: {
  17228. label: a.lang.link.unlink,
  17229. command: "unlink",
  17230. group: "link",
  17231. order: 5
  17232. }
  17233. });
  17234. a.contextMenu && a.contextMenu.addListener(function(b) {
  17235. if(!b ||
  17236. b.isReadOnly()) return null;
  17237. b = CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, b);
  17238. if(!b && !(b = CKEDITOR.plugins.link.getSelectedLink(a))) return null;
  17239. var c = {};
  17240. b.getAttribute("href") && b.getChildCount() && (c = {
  17241. link: CKEDITOR.TRISTATE_OFF,
  17242. unlink: CKEDITOR.TRISTATE_OFF
  17243. });
  17244. if(b && b.hasAttribute("name")) c.anchor = c.removeAnchor = CKEDITOR.TRISTATE_OFF;
  17245. return c
  17246. });
  17247. this.compiledProtectionFunction = g(a)
  17248. },
  17249. afterInit: function(a) {
  17250. a.dataProcessor.dataFilter.addRules({
  17251. elements: {
  17252. a: function(b) {
  17253. return !b.attributes.name ? null : !b.children.length ?
  17254. a.createFakeParserElement(b, "cke_anchor", "anchor") : null
  17255. }
  17256. }
  17257. });
  17258. var b = a._.elementsPath && a._.elementsPath.filters;
  17259. b && b.push(function(b, c) {
  17260. if(c == "a" && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, b) || b.getAttribute("name") && (!b.getAttribute("href") || !b.getChildCount()))) return "anchor"
  17261. })
  17262. }
  17263. });
  17264. var c = /^javascript:/,
  17265. d = /^mailto:([^?]+)(?:\?(.+))?$/,
  17266. j = /subject=([^;?:@&=$,\/]*)/,
  17267. f = /body=([^;?:@&=$,\/]*)/,
  17268. h = /^#(.*)$/,
  17269. i = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
  17270. k = /^(_(?:self|top|parent|blank))$/,
  17271. n = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
  17272. o = /^javascript:([^(]+)\(([^)]+)\)$/,
  17273. q = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
  17274. m = /(?:^|,)([^=]+)=(\d+|yes|no)/gi,
  17275. l = {
  17276. id: "advId",
  17277. dir: "advLangDir",
  17278. accessKey: "advAccessKey",
  17279. name: "advName",
  17280. lang: "advLangCode",
  17281. tabindex: "advTabIndex",
  17282. title: "advTitle",
  17283. type: "advContentType",
  17284. "class": "advCSSClasses",
  17285. charset: "advCharset",
  17286. style: "advStyles",
  17287. rel: "advRel"
  17288. };
  17289. CKEDITOR.plugins.link = {
  17290. getSelectedLink: function(a) {
  17291. var b = a.getSelection(),
  17292. c = b.getSelectedElement();
  17293. if(c && c.is("a")) return c;
  17294. if(b = b.getRanges()[0]) {
  17295. b.shrink(CKEDITOR.SHRINK_TEXT);
  17296. return a.elementPath(b.getCommonAncestor()).contains("a", 1)
  17297. }
  17298. return null
  17299. },
  17300. getEditorAnchors: function(a) {
  17301. for(var b = a.editable(), c = b.isInline() && !a.plugins.divarea ? a.document : b, b = c.getElementsByTag("a"), c = c.getElementsByTag("img"), d = [], f = 0, e; e = b.getItem(f++);)
  17302. if(e.data("cke-saved-name") || e.hasAttribute("name")) d.push({
  17303. name: e.data("cke-saved-name") || e.getAttribute("name"),
  17304. id: e.getAttribute("id")
  17305. });
  17306. for(f = 0; e = c.getItem(f++);)(e =
  17307. this.tryRestoreFakeAnchor(a, e)) && d.push({
  17308. name: e.getAttribute("name"),
  17309. id: e.getAttribute("id")
  17310. });
  17311. return d
  17312. },
  17313. fakeAnchor: true,
  17314. tryRestoreFakeAnchor: function(a, b) {
  17315. if(b && b.data("cke-real-element-type") && b.data("cke-real-element-type") == "anchor") {
  17316. var c = a.restoreRealElement(b);
  17317. if(c.data("cke-saved-name")) return c
  17318. }
  17319. },
  17320. parseLinkAttributes: function(a, b) {
  17321. var e = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "",
  17322. g = a.plugins.link.compiledProtectionFunction,
  17323. w = a.config.emailProtection,
  17324. x, v = {};
  17325. e.match(c) && (w == "encode" ?
  17326. e = e.replace(n, function(a, b, c) {
  17327. return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + (c && c.replace(/\\'/g, "'"))
  17328. }) : w && e.replace(o, function(a, b, c) {
  17329. if(b == g.name) {
  17330. v.type = "email";
  17331. for(var a = v.email = {}, b = /(^')|('$)/g, c = c.match(/[^,\s]+/g), d = c.length, f, e, h = 0; h < d; h++) {
  17332. f = decodeURIComponent;
  17333. e = c[h].replace(b, "").replace(/\\'/g, "'");
  17334. e = f(e);
  17335. f = g.params[h].toLowerCase();
  17336. a[f] = e
  17337. }
  17338. a.address = [a.name, a.domain].join("@")
  17339. }
  17340. }));
  17341. if(!v.type)
  17342. if(w = e.match(h)) {
  17343. v.type = "anchor";
  17344. v.anchor = {};
  17345. v.anchor.name = v.anchor.id = w[1]
  17346. } else if(w =
  17347. e.match(d)) {
  17348. x = e.match(j);
  17349. e = e.match(f);
  17350. v.type = "email";
  17351. var r = v.email = {};
  17352. r.address = w[1];
  17353. x && (r.subject = decodeURIComponent(x[1]));
  17354. e && (r.body = decodeURIComponent(e[1]))
  17355. } else if(e && (x = e.match(i))) {
  17356. v.type = "url";
  17357. v.url = {};
  17358. v.url.protocol = x[1];
  17359. v.url.url = x[2]
  17360. }
  17361. if(b) {
  17362. if(e = b.getAttribute("target")) v.target = {
  17363. type: e.match(k) ? e : "frame",
  17364. name: e
  17365. };
  17366. else if(e = (e = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && e.match(q))
  17367. for(v.target = {
  17368. type: "popup",
  17369. name: e[1]
  17370. }; w = m.exec(e[2]);)(w[2] == "yes" || w[2] == "1") && !(w[1] in {
  17371. height: 1,
  17372. width: 1,
  17373. top: 1,
  17374. left: 1
  17375. }) ? v.target[w[1]] = true : isFinite(w[2]) && (v.target[w[1]] = w[2]);
  17376. var e = {},
  17377. y;
  17378. for(y in l)(w = b.getAttribute(y)) && (e[l[y]] = w);
  17379. if(y = b.data("cke-saved-name") || e.advName) e.advName = y;
  17380. if(!CKEDITOR.tools.isEmpty(e)) v.advanced = e
  17381. }
  17382. return v
  17383. },
  17384. getLinkAttributes: function(c, d) {
  17385. var f = c.config.emailProtection || "",
  17386. g = {};
  17387. switch(d.type) {
  17388. case "url":
  17389. var f = d.url && d.url.protocol !== void 0 ? d.url.protocol : "http://",
  17390. h = d.url && CKEDITOR.tools.trim(d.url.url) || "";
  17391. g["data-cke-saved-href"] = h.indexOf("/") === 0 ? h : f + h;
  17392. break;
  17393. case "anchor":
  17394. f = d.anchor && d.anchor.id;
  17395. g["data-cke-saved-href"] = "#" + (d.anchor && d.anchor.name || f || "");
  17396. break;
  17397. case "email":
  17398. var i = d.email,
  17399. h = i.address;
  17400. switch(f) {
  17401. case "":
  17402. case "encode":
  17403. var j = encodeURIComponent(i.subject || ""),
  17404. k = encodeURIComponent(i.body || ""),
  17405. i = [];
  17406. j && i.push("subject=" + j);
  17407. k && i.push("body=" + k);
  17408. i = i.length ? "?" + i.join("&") : "";
  17409. if(f == "encode") {
  17410. f = ["javascript:void(location.href='mailto:'+", e(h)];
  17411. i && f.push("+'", a(i), "'");
  17412. f.push(")")
  17413. } else f = ["mailto:", h, i];
  17414. break;
  17415. default:
  17416. f = h.split("@", 2);
  17417. i.name = f[0];
  17418. i.domain = f[1];
  17419. f = ["javascript:", b(c, i)]
  17420. }
  17421. g["data-cke-saved-href"] = f.join("")
  17422. }
  17423. if(d.target)
  17424. if(d.target.type == "popup") {
  17425. for(var f = ["window.open(this.href, '", d.target.name || "", "', '"], m = ["resizable", "status", "location", "toolbar", "menubar", "fullscreen", "scrollbars", "dependent"], h = m.length, j = function(a) {
  17426. d.target[a] && m.push(a + "=" + d.target[a])
  17427. }, i = 0; i < h; i++) m[i] = m[i] + (d.target[m[i]] ? "=yes" : "=no");
  17428. j("width");
  17429. j("left");
  17430. j("height");
  17431. j("top");
  17432. f.push(m.join(","), "'); return false;");
  17433. g["data-cke-pa-onclick"] = f.join("")
  17434. } else if(d.target.type !=
  17435. "notSet" && d.target.name) g.target = d.target.name;
  17436. if(d.advanced) {
  17437. for(var q in l)(f = d.advanced[l[q]]) && (g[q] = f);
  17438. if(g.name) g["data-cke-saved-name"] = g.name
  17439. }
  17440. if(g["data-cke-saved-href"]) g.href = g["data-cke-saved-href"];
  17441. q = CKEDITOR.tools.extend({
  17442. target: 1,
  17443. onclick: 1,
  17444. "data-cke-pa-onclick": 1,
  17445. "data-cke-saved-name": 1
  17446. }, l);
  17447. for(var n in g) delete q[n];
  17448. return {
  17449. set: g,
  17450. removed: CKEDITOR.tools.objectKeys(q)
  17451. }
  17452. }
  17453. };
  17454. CKEDITOR.unlinkCommand = function() {};
  17455. CKEDITOR.unlinkCommand.prototype = {
  17456. exec: function(a) {
  17457. var b = new CKEDITOR.style({
  17458. element: "a",
  17459. type: CKEDITOR.STYLE_INLINE,
  17460. alwaysRemoveElement: 1
  17461. });
  17462. a.removeStyle(b)
  17463. },
  17464. refresh: function(a, b) {
  17465. var c = b.lastElement && b.lastElement.getAscendant("a", true);
  17466. c && c.getName() == "a" && c.getAttribute("href") && c.getChildCount() ? this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  17467. },
  17468. contextSensitive: 1,
  17469. startDisabled: 1,
  17470. requiredContent: "a[href]"
  17471. };
  17472. CKEDITOR.removeAnchorCommand = function() {};
  17473. CKEDITOR.removeAnchorCommand.prototype = {
  17474. exec: function(a) {
  17475. var b = a.getSelection(),
  17476. c = b.createBookmarks(),
  17477. d;
  17478. if(b &&
  17479. (d = b.getSelectedElement()) && (!d.getChildCount() ? CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, d) : d.is("a"))) d.remove(1);
  17480. else if(d = CKEDITOR.plugins.link.getSelectedLink(a))
  17481. if(d.hasAttribute("href")) {
  17482. d.removeAttributes({
  17483. name: 1,
  17484. "data-cke-saved-name": 1
  17485. });
  17486. d.removeClass("cke_anchor")
  17487. } else d.remove(1);
  17488. b.selectBookmarks(c)
  17489. },
  17490. requiredContent: "a[name]"
  17491. };
  17492. CKEDITOR.tools.extend(CKEDITOR.config, {
  17493. linkShowAdvancedTab: true,
  17494. linkShowTargetTab: true
  17495. })
  17496. }(), "use strict",
  17497. function() {
  17498. function a(a, b, c) {
  17499. return k(b) && k(c) && c.equals(b.getNext(function(a) {
  17500. return !(Y(a) ||
  17501. Z(a) || n(a))
  17502. }))
  17503. }
  17504. function e(a) {
  17505. this.upper = a[0];
  17506. this.lower = a[1];
  17507. this.set.apply(this, a.slice(2))
  17508. }
  17509. function b(a) {
  17510. var b = a.element;
  17511. if(b && k(b))
  17512. if((b = b.getAscendant(a.triggers, true)) && a.editable.contains(b)) {
  17513. var c = d(b);
  17514. if(c.getAttribute("contenteditable") == "true") return b;
  17515. if(c.is(a.triggers)) return c
  17516. }
  17517. return null
  17518. }
  17519. function g(a, b, c) {
  17520. u(a, b);
  17521. u(a, c);
  17522. a = b.size.bottom;
  17523. c = c.size.top;
  17524. return a && c ? 0 | (a + c) / 2 : a || c
  17525. }
  17526. function c(a, b, c) {
  17527. return b = b[c ? "getPrevious" : "getNext"](function(b) {
  17528. return b && b.type == CKEDITOR.NODE_TEXT && !Y(b) ||
  17529. k(b) && !n(b) && !i(a, b)
  17530. })
  17531. }
  17532. function d(a, b) {
  17533. if(a.data("cke-editable")) return null;
  17534. for(b || (a = a.getParent()); a;) {
  17535. if(a.data("cke-editable")) break;
  17536. if(a.hasAttribute("contenteditable")) return a;
  17537. a = a.getParent()
  17538. }
  17539. return null
  17540. }
  17541. function j(a) {
  17542. var b = a.doc,
  17543. c = z('<span contenteditable="false" style="' + P + "position:absolute;border-top:1px dashed " + a.boxColor + '"></span>', b),
  17544. d = CKEDITOR.getUrl(this.path + "images/" + (B.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") + ".png");
  17545. r(c, {
  17546. attach: function() {
  17547. this.wrap.getParent() || this.wrap.appendTo(a.editable,
  17548. true);
  17549. return this
  17550. },
  17551. lineChildren: [r(z('<span title="' + a.editor.lang.magicline.title + '" contenteditable="false">&#8629;</span>', b), {
  17552. base: P + "height:17px;width:17px;" + (a.rtl ? "left" : "right") + ":17px;background:url(" + d + ") center no-repeat " + a.boxColor + ";cursor:pointer;" + (B.hc ? "font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;" : "") + (B.hidpi ? "background-size: 9px 10px;" : ""),
  17553. looks: ["top:-8px;" + CKEDITOR.tools.cssVendorPrefix("border-radius", "2px", 1), "top:-17px;" + CKEDITOR.tools.cssVendorPrefix("border-radius",
  17554. "2px 2px 0px 0px", 1), "top:-1px;" + CKEDITOR.tools.cssVendorPrefix("border-radius", "0px 0px 2px 2px", 1)]
  17555. }), r(z(W, b), {
  17556. base: V + "left:0px;border-left-color:" + a.boxColor + ";",
  17557. 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"]
  17558. }), r(z(W, b), {
  17559. base: V + "right:0px;border-right-color:" + a.boxColor + ";",
  17560. looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px", "border-width:0 8px 8px 0;top:0px"]
  17561. })],
  17562. detach: function() {
  17563. this.wrap.getParent() &&
  17564. this.wrap.remove();
  17565. return this
  17566. },
  17567. mouseNear: function() {
  17568. u(a, this);
  17569. var b = a.holdDistance,
  17570. c = this.size;
  17571. return c && a.mouse.y > c.top - b && a.mouse.y < c.bottom + b && a.mouse.x > c.left - b && a.mouse.x < c.right + b ? true : false
  17572. },
  17573. place: function() {
  17574. var b = a.view,
  17575. c = a.editable,
  17576. d = a.trigger,
  17577. f = d.upper,
  17578. e = d.lower,
  17579. g = f || e,
  17580. h = g.getParent(),
  17581. i = {};
  17582. this.trigger = d;
  17583. f && u(a, f, true);
  17584. e && u(a, e, true);
  17585. u(a, h, true);
  17586. a.inInlineMode && w(a, true);
  17587. if(h.equals(c)) {
  17588. i.left = b.scroll.x;
  17589. i.right = -b.scroll.x;
  17590. i.width = ""
  17591. } else {
  17592. i.left = g.size.left - g.size.margin.left + b.scroll.x -
  17593. (a.inInlineMode ? b.editable.left + b.editable.border.left : 0);
  17594. i.width = g.size.outerWidth + g.size.margin.left + g.size.margin.right + b.scroll.x;
  17595. i.right = ""
  17596. }
  17597. if(f && e) i.top = f.size.margin.bottom === e.size.margin.top ? 0 | f.size.bottom + f.size.margin.bottom / 2 : f.size.margin.bottom < e.size.margin.top ? f.size.bottom + f.size.margin.bottom : f.size.bottom + f.size.margin.bottom - e.size.margin.top;
  17598. else if(f) {
  17599. if(!e) i.top = f.size.bottom + f.size.margin.bottom
  17600. } else i.top = e.size.top - e.size.margin.top;
  17601. if(d.is(L) || i.top > b.scroll.y - 15 && i.top <
  17602. b.scroll.y + 5) {
  17603. i.top = a.inInlineMode ? 0 : b.scroll.y;
  17604. this.look(L)
  17605. } else if(d.is(H) || i.top > b.pane.bottom - 5 && i.top < b.pane.bottom + 15) {
  17606. i.top = a.inInlineMode ? b.editable.height + b.editable.padding.top + b.editable.padding.bottom : b.pane.bottom - 1;
  17607. this.look(H)
  17608. } else {
  17609. if(a.inInlineMode) i.top = i.top - (b.editable.top + b.editable.border.top);
  17610. this.look(Q)
  17611. }
  17612. if(a.inInlineMode) {
  17613. i.top--;
  17614. i.top = i.top + b.editable.scroll.top;
  17615. i.left = i.left + b.editable.scroll.left
  17616. }
  17617. for(var j in i) i[j] = CKEDITOR.tools.cssLength(i[j]);
  17618. this.setStyles(i)
  17619. },
  17620. look: function(a) {
  17621. if(this.oldLook !=
  17622. a) {
  17623. for(var b = this.lineChildren.length, c; b--;)(c = this.lineChildren[b]).setAttribute("style", c.base + c.looks[0 | a / 2]);
  17624. this.oldLook = a
  17625. }
  17626. },
  17627. wrap: new y("span", a.doc)
  17628. });
  17629. for(b = c.lineChildren.length; b--;) c.lineChildren[b].appendTo(c);
  17630. c.look(Q);
  17631. c.appendTo(c.wrap);
  17632. c.unselectable();
  17633. c.lineChildren[0].on("mouseup", function(b) {
  17634. c.detach();
  17635. f(a, function(b) {
  17636. var c = a.line.trigger;
  17637. b[c.is(J) ? "insertBefore" : "insertAfter"](c.is(J) ? c.lower : c.upper)
  17638. }, true);
  17639. a.editor.focus();
  17640. !B.ie && a.enterMode != CKEDITOR.ENTER_BR && a.hotNode.scrollIntoView();
  17641. b.data.preventDefault(true)
  17642. });
  17643. c.on("mousedown", function(a) {
  17644. a.data.preventDefault(true)
  17645. });
  17646. a.line = c
  17647. }
  17648. function f(a, b, c) {
  17649. var f = new CKEDITOR.dom.range(a.doc),
  17650. e = a.editor,
  17651. g;
  17652. if(B.ie && a.enterMode == CKEDITOR.ENTER_BR) g = a.doc.createText(O);
  17653. else {
  17654. g = (g = d(a.element, true)) && g.data("cke-enter-mode") || a.enterMode;
  17655. g = new y(D[g], a.doc);
  17656. g.is("br") || a.doc.createText(O).appendTo(g)
  17657. }
  17658. c && e.fire("saveSnapshot");
  17659. b(g);
  17660. f.moveToPosition(g, CKEDITOR.POSITION_AFTER_START);
  17661. e.getSelection().selectRanges([f]);
  17662. a.hotNode = g;
  17663. c && e.fire("saveSnapshot")
  17664. }
  17665. function h(a, e) {
  17666. return {
  17667. canUndo: true,
  17668. modes: {
  17669. wysiwyg: 1
  17670. },
  17671. exec: function() {
  17672. function g(b) {
  17673. var c = B.ie && B.version < 9 ? " " : O,
  17674. d = a.hotNode && a.hotNode.getText() == c && a.element.equals(a.hotNode) && a.lastCmdDirection === !!e;
  17675. f(a, function(c) {
  17676. d && a.hotNode && a.hotNode.remove();
  17677. c[e ? "insertAfter" : "insertBefore"](b);
  17678. c.setAttributes({
  17679. "data-cke-magicline-hot": 1,
  17680. "data-cke-magicline-dir": !!e
  17681. });
  17682. a.lastCmdDirection = !!e
  17683. });
  17684. !B.ie && a.enterMode != CKEDITOR.ENTER_BR && a.hotNode.scrollIntoView();
  17685. a.line.detach()
  17686. }
  17687. return function(f) {
  17688. var f = f.getSelection().getStartElement(),
  17689. h, f = f.getAscendant(N, 1);
  17690. if(!m(a, f) && f && !f.equals(a.editable) && !f.contains(a.editable)) {
  17691. if((h = d(f)) && h.getAttribute("contenteditable") == "false") f = h;
  17692. a.element = f;
  17693. h = c(a, f, !e);
  17694. var i;
  17695. if(k(h) && h.is(a.triggers) && h.is(R) && (!c(a, h, !e) || (i = c(a, h, !e)) && k(i) && i.is(a.triggers))) g(h);
  17696. else {
  17697. i = b(a, f);
  17698. if(k(i))
  17699. if(c(a, i, !e))(f = c(a, i, !e)) && (k(f) && f.is(a.triggers)) && g(i);
  17700. else g(i)
  17701. }
  17702. }
  17703. }
  17704. }()
  17705. }
  17706. }
  17707. function i(a, b) {
  17708. if(!b || !(b.type == CKEDITOR.NODE_ELEMENT && b.$)) return false;
  17709. var c = a.line;
  17710. return c.wrap.equals(b) || c.wrap.contains(b)
  17711. }
  17712. function k(a) {
  17713. return a &&
  17714. a.type == CKEDITOR.NODE_ELEMENT && a.$
  17715. }
  17716. function n(a) {
  17717. if(!k(a)) return false;
  17718. var b;
  17719. if(!(b = o(a)))
  17720. if(k(a)) {
  17721. b = {
  17722. left: 1,
  17723. right: 1,
  17724. center: 1
  17725. };
  17726. b = !(!b[a.getComputedStyle("float")] && !b[a.getAttribute("align")])
  17727. } else b = false;
  17728. return b
  17729. }
  17730. function o(a) {
  17731. return !!{
  17732. absolute: 1,
  17733. fixed: 1
  17734. }[a.getComputedStyle("position")]
  17735. }
  17736. function q(a, b) {
  17737. return k(b) ? b.is(a.triggers) : null
  17738. }
  17739. function m(a, b) {
  17740. if(!b) return false;
  17741. for(var c = b.getParents(1), d = c.length; d--;)
  17742. for(var f = a.tabuList.length; f--;)
  17743. if(c[d].hasAttribute(a.tabuList[f])) return true;
  17744. return false
  17745. }
  17746. function l(a, b, c) {
  17747. b = b[c ? "getLast" : "getFirst"](function(b) {
  17748. return a.isRelevant(b) && !b.is(K)
  17749. });
  17750. if(!b) return false;
  17751. u(a, b);
  17752. return c ? b.size.top > a.mouse.y : b.size.bottom < a.mouse.y
  17753. }
  17754. function p(a) {
  17755. var b = a.editable,
  17756. c = a.mouse,
  17757. d = a.view,
  17758. f = a.triggerOffset;
  17759. w(a);
  17760. var g = c.y > (a.inInlineMode ? d.editable.top + d.editable.height / 2 : Math.min(d.editable.height, d.pane.height) / 2),
  17761. b = b[g ? "getLast" : "getFirst"](function(a) {
  17762. return !(Y(a) || Z(a))
  17763. });
  17764. if(!b) return null;
  17765. i(a, b) && (b = a.line.wrap[g ? "getPrevious" : "getNext"](function(a) {
  17766. return !(Y(a) ||
  17767. Z(a))
  17768. }));
  17769. if(!k(b) || n(b) || !q(a, b)) return null;
  17770. u(a, b);
  17771. if(!g && b.size.top >= 0 && c.y > 0 && c.y < b.size.top + f) {
  17772. a = a.inInlineMode || d.scroll.y === 0 ? L : Q;
  17773. return new e([null, b, J, E, a])
  17774. }
  17775. if(g && b.size.bottom <= d.pane.height && c.y > b.size.bottom - f && c.y < d.pane.height) {
  17776. a = a.inInlineMode || b.size.bottom > d.pane.height - f && b.size.bottom < d.pane.height ? H : Q;
  17777. return new e([b, null, C, E, a])
  17778. }
  17779. return null
  17780. }
  17781. function t(a) {
  17782. var d = a.mouse,
  17783. f = a.view,
  17784. g = a.triggerOffset,
  17785. h = b(a);
  17786. if(!h) return null;
  17787. u(a, h);
  17788. var g = Math.min(g, 0 | h.size.outerHeight / 2),
  17789. i = [],
  17790. j, m;
  17791. if(d.y >
  17792. h.size.top - 1 && d.y < h.size.top + g) m = false;
  17793. else if(d.y > h.size.bottom - g && d.y < h.size.bottom + 1) m = true;
  17794. else return null;
  17795. if(n(h) || l(a, h, m) || h.getParent().is(M)) return null;
  17796. var p = c(a, h, !m);
  17797. if(p) {
  17798. if(p && p.type == CKEDITOR.NODE_TEXT) return null;
  17799. if(k(p)) {
  17800. if(n(p) || !q(a, p) || p.getParent().is(M)) return null;
  17801. i = [p, h][m ? "reverse" : "concat"]().concat([F, E])
  17802. }
  17803. } else {
  17804. if(h.equals(a.editable[m ? "getLast" : "getFirst"](a.isRelevant))) {
  17805. w(a);
  17806. m && d.y > h.size.bottom - g && d.y < f.pane.height && h.size.bottom > f.pane.height - g && h.size.bottom < f.pane.height ?
  17807. j = H : d.y > 0 && d.y < h.size.top + g && (j = L)
  17808. } else j = Q;
  17809. i = [null, h][m ? "reverse" : "concat"]().concat([m ? C : J, E, j, h.equals(a.editable[m ? "getLast" : "getFirst"](a.isRelevant)) ? m ? H : L : Q])
  17810. }
  17811. return 0 in i ? new e(i) : null
  17812. }
  17813. function s(a, b, c, d) {
  17814. for(var f = function() {
  17815. var c = B.ie ? b.$.currentStyle : a.win.$.getComputedStyle(b.$, "");
  17816. return B.ie ? function(a) {
  17817. return c[CKEDITOR.tools.cssStyleToDomStyle(a)]
  17818. } : function(a) {
  17819. return c.getPropertyValue(a)
  17820. }
  17821. }(), e = b.getDocumentPosition(), g = {}, h = {}, i = {}, j = {}, k = X.length; k--;) {
  17822. g[X[k]] = parseInt(f("border-" +
  17823. X[k] + "-width"), 10) || 0;
  17824. i[X[k]] = parseInt(f("padding-" + X[k]), 10) || 0;
  17825. h[X[k]] = parseInt(f("margin-" + X[k]), 10) || 0
  17826. }(!c || d) && x(a, d);
  17827. j.top = e.y - (c ? 0 : a.view.scroll.y);
  17828. j.left = e.x - (c ? 0 : a.view.scroll.x);
  17829. j.outerWidth = b.$.offsetWidth;
  17830. j.outerHeight = b.$.offsetHeight;
  17831. j.height = j.outerHeight - (i.top + i.bottom + g.top + g.bottom);
  17832. j.width = j.outerWidth - (i.left + i.right + g.left + g.right);
  17833. j.bottom = j.top + j.outerHeight;
  17834. j.right = j.left + j.outerWidth;
  17835. if(a.inInlineMode) j.scroll = {
  17836. top: b.$.scrollTop,
  17837. left: b.$.scrollLeft
  17838. };
  17839. return r({
  17840. border: g,
  17841. padding: i,
  17842. margin: h,
  17843. ignoreScroll: c
  17844. }, j, true)
  17845. }
  17846. function u(a, b, c) {
  17847. if(!k(b)) return b.size = null;
  17848. if(b.size) {
  17849. if(b.size.ignoreScroll == c && b.size.date > new Date - T) return null
  17850. } else b.size = {};
  17851. return r(b.size, s(a, b, c), {
  17852. date: +new Date
  17853. }, true)
  17854. }
  17855. function w(a, b) {
  17856. a.view.editable = s(a, a.editable, b, true)
  17857. }
  17858. function x(a, b) {
  17859. if(!a.view) a.view = {};
  17860. var c = a.view;
  17861. if(b || !(c && c.date > new Date - T)) {
  17862. var d = a.win,
  17863. c = d.getScrollPosition(),
  17864. d = d.getViewPaneSize();
  17865. r(a.view, {
  17866. scroll: {
  17867. x: c.x,
  17868. y: c.y,
  17869. width: a.doc.$.documentElement.scrollWidth - d.width,
  17870. height: a.doc.$.documentElement.scrollHeight -
  17871. d.height
  17872. },
  17873. pane: {
  17874. width: d.width,
  17875. height: d.height,
  17876. bottom: d.height + c.y
  17877. },
  17878. date: +new Date
  17879. }, true)
  17880. }
  17881. }
  17882. function v(a, b, c, d) {
  17883. for(var f = d, g = d, h = 0, i = false, j = false, k = a.view.pane.height, m = a.mouse; m.y + h < k && m.y - h > 0;) {
  17884. i || (i = b(f, d));
  17885. j || (j = b(g, d));
  17886. !i && m.y - h > 0 && (f = c(a, {
  17887. x: m.x,
  17888. y: m.y - h
  17889. }));
  17890. !j && m.y + h < k && (g = c(a, {
  17891. x: m.x,
  17892. y: m.y + h
  17893. }));
  17894. if(i && j) break;
  17895. h = h + 2
  17896. }
  17897. return new e([f, g, null, null])
  17898. }
  17899. CKEDITOR.plugins.add("magicline", {
  17900. init: function(a) {
  17901. var d = a.config,
  17902. g = d.magicline_triggerOffset || 30,
  17903. l = {
  17904. editor: a,
  17905. enterMode: d.enterMode,
  17906. triggerOffset: g,
  17907. holdDistance: 0 |
  17908. g * (d.magicline_holdDistance || 0.5),
  17909. boxColor: d.magicline_color || "#ff0000",
  17910. rtl: d.contentsLangDirection == "rtl",
  17911. tabuList: ["data-cke-hidden-sel"].concat(d.magicline_tabuList || []),
  17912. triggers: d.magicline_everywhere ? N : {
  17913. table: 1,
  17914. hr: 1,
  17915. div: 1,
  17916. ul: 1,
  17917. ol: 1,
  17918. dl: 1,
  17919. form: 1,
  17920. blockquote: 1
  17921. }
  17922. },
  17923. q, u, v;
  17924. l.isRelevant = function(a) {
  17925. return k(a) && !i(l, a) && !n(a)
  17926. };
  17927. a.on("contentDom", function() {
  17928. var g = a.editable(),
  17929. k = a.document,
  17930. n = a.window;
  17931. r(l, {
  17932. editable: g,
  17933. inInlineMode: g.isInline(),
  17934. doc: k,
  17935. win: n,
  17936. hotNode: null
  17937. }, true);
  17938. l.boundary = l.inInlineMode ? l.editable :
  17939. l.doc.getDocumentElement();
  17940. if(!g.is(G.$inline)) {
  17941. l.inInlineMode && !o(g) && g.setStyles({
  17942. position: "relative",
  17943. top: null,
  17944. left: null
  17945. });
  17946. j.call(this, l);
  17947. x(l);
  17948. g.attachListener(a, "beforeUndoImage", function() {
  17949. l.line.detach()
  17950. });
  17951. g.attachListener(a, "beforeGetData", function() {
  17952. if(l.line.wrap.getParent()) {
  17953. l.line.detach();
  17954. a.once("getData", function() {
  17955. l.line.attach()
  17956. }, null, null, 1E3)
  17957. }
  17958. }, null, null, 0);
  17959. g.attachListener(l.inInlineMode ? k : k.getWindow().getFrame(), "mouseout", function(b) {
  17960. if(a.mode == "wysiwyg")
  17961. if(l.inInlineMode) {
  17962. var c =
  17963. b.data.$.clientX,
  17964. b = b.data.$.clientY;
  17965. x(l);
  17966. w(l, true);
  17967. var d = l.view.editable,
  17968. f = l.view.scroll;
  17969. if(!(c > d.left - f.x && c < d.right - f.x) || !(b > d.top - f.y && b < d.bottom - f.y)) {
  17970. clearTimeout(v);
  17971. v = null;
  17972. l.line.detach()
  17973. }
  17974. } else {
  17975. clearTimeout(v);
  17976. v = null;
  17977. l.line.detach()
  17978. }
  17979. });
  17980. g.attachListener(g, "keyup", function() {
  17981. l.hiddenMode = 0
  17982. });
  17983. g.attachListener(g, "keydown", function(b) {
  17984. if(a.mode == "wysiwyg") switch(b.data.getKeystroke()) {
  17985. case 2228240:
  17986. case 16:
  17987. l.hiddenMode = 1;
  17988. l.line.detach()
  17989. }
  17990. });
  17991. g.attachListener(l.inInlineMode ? g : k, "mousemove", function(b) {
  17992. u =
  17993. true;
  17994. if(!(a.mode != "wysiwyg" || a.readOnly || v)) {
  17995. var c = {
  17996. x: b.data.$.clientX,
  17997. y: b.data.$.clientY
  17998. };
  17999. v = setTimeout(function() {
  18000. l.mouse = c;
  18001. v = l.trigger = null;
  18002. x(l);
  18003. if(u && !l.hiddenMode && a.focusManager.hasFocus && !l.line.mouseNear() && (l.element = S(l, true))) {
  18004. if((l.trigger = p(l) || t(l) || ba(l)) && !m(l, l.trigger.upper || l.trigger.lower)) l.line.attach().place();
  18005. else {
  18006. l.trigger = null;
  18007. l.line.detach()
  18008. }
  18009. u = false
  18010. }
  18011. }, 30)
  18012. }
  18013. });
  18014. g.attachListener(n, "scroll", function() {
  18015. if(a.mode == "wysiwyg") {
  18016. l.line.detach();
  18017. if(B.webkit) {
  18018. l.hiddenMode = 1;
  18019. clearTimeout(q);
  18020. q = setTimeout(function() {
  18021. if(!l.mouseDown) l.hiddenMode = 0
  18022. }, 50)
  18023. }
  18024. }
  18025. });
  18026. g.attachListener(A ? k : n, "mousedown", function() {
  18027. if(a.mode == "wysiwyg") {
  18028. l.line.detach();
  18029. l.hiddenMode = 1;
  18030. l.mouseDown = 1
  18031. }
  18032. });
  18033. g.attachListener(A ? k : n, "mouseup", function() {
  18034. l.hiddenMode = 0;
  18035. l.mouseDown = 0
  18036. });
  18037. a.addCommand("accessPreviousSpace", h(l));
  18038. a.addCommand("accessNextSpace", h(l, true));
  18039. a.setKeystroke([
  18040. [d.magicline_keystrokePrevious, "accessPreviousSpace"],
  18041. [d.magicline_keystrokeNext, "accessNextSpace"]
  18042. ]);
  18043. a.on("loadSnapshot", function() {
  18044. var b, c, d, f;
  18045. for(f in {
  18046. p: 1,
  18047. br: 1,
  18048. div: 1
  18049. }) {
  18050. b = a.document.getElementsByTag(f);
  18051. for(d = b.count(); d--;)
  18052. if((c = b.getItem(d)).data("cke-magicline-hot")) {
  18053. l.hotNode = c;
  18054. l.lastCmdDirection = c.data("cke-magicline-dir") === "true" ? true : false;
  18055. return
  18056. }
  18057. }
  18058. });
  18059. this.backdoor = {
  18060. accessFocusSpace: f,
  18061. boxTrigger: e,
  18062. isLine: i,
  18063. getAscendantTrigger: b,
  18064. getNonEmptyNeighbour: c,
  18065. getSize: s,
  18066. that: l,
  18067. triggerEdge: t,
  18068. triggerEditable: p,
  18069. triggerExpand: ba
  18070. }
  18071. }
  18072. }, this)
  18073. }
  18074. });
  18075. var r = CKEDITOR.tools.extend,
  18076. y = CKEDITOR.dom.element,
  18077. z = y.createFromHtml,
  18078. B = CKEDITOR.env,
  18079. A = CKEDITOR.env.ie && CKEDITOR.env.version <
  18080. 9,
  18081. G = CKEDITOR.dtd,
  18082. D = {},
  18083. J = 128,
  18084. C = 64,
  18085. F = 32,
  18086. E = 16,
  18087. I = 8,
  18088. L = 4,
  18089. H = 2,
  18090. Q = 1,
  18091. O = " ",
  18092. M = G.$listItem,
  18093. K = G.$tableContent,
  18094. R = r({}, G.$nonEditable, G.$empty),
  18095. N = G.$block,
  18096. T = 100,
  18097. P = "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
  18098. V = P + "border-color:transparent;display:block;border-style:solid;",
  18099. W = "<span>" + O + "</span>";
  18100. D[CKEDITOR.ENTER_BR] = "br";
  18101. D[CKEDITOR.ENTER_P] = "p";
  18102. D[CKEDITOR.ENTER_DIV] = "div";
  18103. e.prototype = {
  18104. set: function(a, b, c) {
  18105. this.properties = a + b +
  18106. (c || Q);
  18107. return this
  18108. },
  18109. is: function(a) {
  18110. return(this.properties & a) == a
  18111. }
  18112. };
  18113. var S = function() {
  18114. function a(b, c) {
  18115. var d = b.$.elementFromPoint(c.x, c.y);
  18116. return d && d.nodeType ? new CKEDITOR.dom.element(d) : null
  18117. }
  18118. return function(b, c, d) {
  18119. if(!b.mouse) return null;
  18120. var f = b.doc,
  18121. e = b.line.wrap,
  18122. d = d || b.mouse,
  18123. g = a(f, d);
  18124. if(c && i(b, g)) {
  18125. e.hide();
  18126. g = a(f, d);
  18127. e.show()
  18128. }
  18129. return !g || !(g.type == CKEDITOR.NODE_ELEMENT && g.$) || B.ie && B.version < 9 && !b.boundary.equals(g) && !b.boundary.contains(g) ? null : g
  18130. }
  18131. }(),
  18132. Y = CKEDITOR.dom.walker.whitespaces(),
  18133. Z = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),
  18134. ba = function() {
  18135. function b(d) {
  18136. var f = d.element,
  18137. e, h, i;
  18138. if(!k(f) || f.contains(d.editable) || f.isReadOnly()) return null;
  18139. i = v(d, function(a, b) {
  18140. return !b.equals(a)
  18141. }, function(a, b) {
  18142. return S(a, true, b)
  18143. }, f);
  18144. e = i.upper;
  18145. h = i.lower;
  18146. if(a(d, e, h)) return i.set(F, I);
  18147. if(e && f.contains(e))
  18148. for(; !e.getParent().equals(f);) e = e.getParent();
  18149. else e = f.getFirst(function(a) {
  18150. return c(d, a)
  18151. });
  18152. if(h && f.contains(h))
  18153. for(; !h.getParent().equals(f);) h = h.getParent();
  18154. else h = f.getLast(function(a) {
  18155. return c(d, a)
  18156. });
  18157. if(!e || !h) return null;
  18158. u(d, e);
  18159. u(d, h);
  18160. if(!(d.mouse.y >
  18161. e.size.top && d.mouse.y < h.size.bottom)) return null;
  18162. for(var f = Number.MAX_VALUE, j, m, l, q; h && !h.equals(e);) {
  18163. if(!(m = e.getNext(d.isRelevant))) break;
  18164. j = Math.abs(g(d, e, m) - d.mouse.y);
  18165. if(j < f) {
  18166. f = j;
  18167. l = e;
  18168. q = m
  18169. }
  18170. e = m;
  18171. u(d, e)
  18172. }
  18173. if(!l || !q || !(d.mouse.y > l.size.top && d.mouse.y < q.size.bottom)) return null;
  18174. i.upper = l;
  18175. i.lower = q;
  18176. return i.set(F, I)
  18177. }
  18178. function c(a, b) {
  18179. return !(b && b.type == CKEDITOR.NODE_TEXT || Z(b) || n(b) || i(a, b) || b.type == CKEDITOR.NODE_ELEMENT && b.$ && b.is("br"))
  18180. }
  18181. return function(c) {
  18182. var d = b(c),
  18183. f;
  18184. if(f = d) {
  18185. f = d.upper;
  18186. var e = d.lower;
  18187. f = !f || !e || n(e) || n(f) || e.equals(f) || f.equals(e) || e.contains(f) || f.contains(e) ? false : q(c, f) && q(c, e) && a(c, f, e) ? true : false
  18188. }
  18189. return f ? d : null
  18190. }
  18191. }(),
  18192. X = ["top", "left", "right", "bottom"]
  18193. }(), CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51, CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52,
  18194. function() {
  18195. function a(a) {
  18196. if(!a || a.type != CKEDITOR.NODE_ELEMENT || a.getName() != "form") return [];
  18197. for(var b = [], c = ["style", "className"], e = 0; e < c.length; e++) {
  18198. var g = a.$.elements.namedItem(c[e]);
  18199. if(g) {
  18200. g = new CKEDITOR.dom.element(g);
  18201. b.push([g, g.nextSibling]);
  18202. g.remove()
  18203. }
  18204. }
  18205. return b
  18206. }
  18207. function e(a, b) {
  18208. if(a && !(a.type != CKEDITOR.NODE_ELEMENT || a.getName() != "form") && b.length > 0)
  18209. for(var c = b.length - 1; c >= 0; c--) {
  18210. var e = b[c][0],
  18211. g = b[c][1];
  18212. g ? e.insertBefore(g) : e.appendTo(a)
  18213. }
  18214. }
  18215. function b(b, c) {
  18216. var f = a(b),
  18217. g = {},
  18218. i = b.$;
  18219. if(!c) {
  18220. g["class"] = i.className || "";
  18221. i.className = ""
  18222. }
  18223. g.inline = i.style.cssText || "";
  18224. if(!c) i.style.cssText = "position: static; overflow: visible";
  18225. e(f);
  18226. return g
  18227. }
  18228. function g(b, c) {
  18229. var f = a(b),
  18230. g = b.$;
  18231. if("class" in c) g.className =
  18232. c["class"];
  18233. if("inline" in c) g.style.cssText = c.inline;
  18234. e(f)
  18235. }
  18236. function c(a) {
  18237. if(!a.editable().isInline()) {
  18238. var b = CKEDITOR.instances,
  18239. c;
  18240. for(c in b) {
  18241. var e = b[c];
  18242. if(e.mode == "wysiwyg" && !e.readOnly) {
  18243. e = e.document.getBody();
  18244. e.setAttribute("contentEditable", false);
  18245. e.setAttribute("contentEditable", true)
  18246. }
  18247. }
  18248. if(a.editable().hasFocus) {
  18249. a.toolbox.focus();
  18250. a.focus()
  18251. }
  18252. }
  18253. }
  18254. CKEDITOR.plugins.add("maximize", {
  18255. init: function(a) {
  18256. function e() {
  18257. var b = i.getViewPaneSize();
  18258. a.resize(b.width, b.height, null, true)
  18259. }
  18260. if(a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  18261. var f =
  18262. a.lang,
  18263. h = CKEDITOR.document,
  18264. i = h.getWindow(),
  18265. k, n, o, q = CKEDITOR.TRISTATE_OFF;
  18266. a.addCommand("maximize", {
  18267. modes: {
  18268. wysiwyg: !CKEDITOR.env.iOS,
  18269. source: !CKEDITOR.env.iOS
  18270. },
  18271. readOnly: 1,
  18272. editorFocus: false,
  18273. exec: function() {
  18274. var m = a.container.getFirst(function(a) {
  18275. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  18276. }),
  18277. l = a.ui.space("contents");
  18278. if(a.mode == "wysiwyg") {
  18279. var p = a.getSelection();
  18280. k = p && p.getRanges();
  18281. n = i.getScrollPosition()
  18282. } else {
  18283. var t = a.editable().$;
  18284. k = !CKEDITOR.env.ie && [t.selectionStart, t.selectionEnd];
  18285. n = [t.scrollLeft,
  18286. t.scrollTop
  18287. ]
  18288. }
  18289. if(this.state == CKEDITOR.TRISTATE_OFF) {
  18290. i.on("resize", e);
  18291. o = i.getScrollPosition();
  18292. for(p = a.container; p = p.getParent();) {
  18293. p.setCustomData("maximize_saved_styles", b(p));
  18294. p.setStyle("z-index", a.config.baseFloatZIndex - 5)
  18295. }
  18296. l.setCustomData("maximize_saved_styles", b(l, true));
  18297. m.setCustomData("maximize_saved_styles", b(m, true));
  18298. l = {
  18299. overflow: CKEDITOR.env.webkit ? "" : "hidden",
  18300. width: 0,
  18301. height: 0
  18302. };
  18303. h.getDocumentElement().setStyles(l);
  18304. !CKEDITOR.env.gecko && h.getDocumentElement().setStyle("position", "fixed");
  18305. (!CKEDITOR.env.gecko ||
  18306. !CKEDITOR.env.quirks) && h.getBody().setStyles(l);
  18307. CKEDITOR.env.ie ? setTimeout(function() {
  18308. i.$.scrollTo(0, 0)
  18309. }, 0) : i.$.scrollTo(0, 0);
  18310. m.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute");
  18311. m.$.offsetLeft;
  18312. m.setStyles({
  18313. "z-index": a.config.baseFloatZIndex - 5,
  18314. left: "0px",
  18315. top: "0px"
  18316. });
  18317. m.addClass("cke_maximized");
  18318. e();
  18319. l = m.getDocumentPosition();
  18320. m.setStyles({
  18321. left: -1 * l.x + "px",
  18322. top: -1 * l.y + "px"
  18323. });
  18324. CKEDITOR.env.gecko && c(a)
  18325. } else if(this.state == CKEDITOR.TRISTATE_ON) {
  18326. i.removeListener("resize", e);
  18327. l = [l,
  18328. m
  18329. ];
  18330. for(p = 0; p < l.length; p++) {
  18331. g(l[p], l[p].getCustomData("maximize_saved_styles"));
  18332. l[p].removeCustomData("maximize_saved_styles")
  18333. }
  18334. for(p = a.container; p = p.getParent();) {
  18335. g(p, p.getCustomData("maximize_saved_styles"));
  18336. p.removeCustomData("maximize_saved_styles")
  18337. }
  18338. CKEDITOR.env.ie ? setTimeout(function() {
  18339. i.$.scrollTo(o.x, o.y)
  18340. }, 0) : i.$.scrollTo(o.x, o.y);
  18341. m.removeClass("cke_maximized");
  18342. if(CKEDITOR.env.webkit) {
  18343. m.setStyle("display", "inline");
  18344. setTimeout(function() {
  18345. m.setStyle("display", "block")
  18346. }, 0)
  18347. }
  18348. a.fire("resize")
  18349. }
  18350. this.toggleState();
  18351. if(p = this.uiItems[0]) {
  18352. l = this.state == CKEDITOR.TRISTATE_OFF ? f.maximize.maximize : f.maximize.minimize;
  18353. p = CKEDITOR.document.getById(p._.id);
  18354. p.getChild(1).setHtml(l);
  18355. p.setAttribute("title", l);
  18356. p.setAttribute("href", 'javascript:void("' + l + '");')
  18357. }
  18358. if(a.mode == "wysiwyg")
  18359. if(k) {
  18360. CKEDITOR.env.gecko && c(a);
  18361. a.getSelection().selectRanges(k);
  18362. (t = a.getSelection().getStartElement()) && t.scrollIntoView(true)
  18363. } else i.$.scrollTo(n.x, n.y);
  18364. else {
  18365. if(k) {
  18366. t.selectionStart = k[0];
  18367. t.selectionEnd = k[1]
  18368. }
  18369. t.scrollLeft = n[0];
  18370. t.scrollTop = n[1]
  18371. }
  18372. k =
  18373. n = null;
  18374. q = this.state;
  18375. a.fire("maximize", this.state)
  18376. },
  18377. canUndo: false
  18378. });
  18379. a.ui.addButton && a.ui.addButton("Maximize", {
  18380. label: f.maximize.maximize,
  18381. command: "maximize",
  18382. toolbar: "tools,10"
  18383. });
  18384. a.on("mode", function() {
  18385. var b = a.getCommand("maximize");
  18386. b.setState(b.state == CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : q)
  18387. }, null, null, 100)
  18388. }
  18389. }
  18390. })
  18391. }(),
  18392. function() {
  18393. function a(a, e, c) {
  18394. var d = CKEDITOR.cleanWord;
  18395. if(d) c();
  18396. else {
  18397. a = CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile || e + "filter/default.js");
  18398. CKEDITOR.scriptLoader.load(a,
  18399. c, null, true)
  18400. }
  18401. return !d
  18402. }
  18403. function e(a) {
  18404. a.data.type = "html"
  18405. }
  18406. CKEDITOR.plugins.add("pastefromword", {
  18407. requires: "clipboard",
  18408. init: function(b) {
  18409. var g = 0,
  18410. c = this.path;
  18411. b.addCommand("pastefromword", {
  18412. canUndo: false,
  18413. async: true,
  18414. exec: function(a) {
  18415. var b = this;
  18416. g = 1;
  18417. a.once("beforePaste", e);
  18418. a.getClipboardData({
  18419. title: a.lang.pastefromword.title
  18420. }, function(c) {
  18421. c && a.fire("paste", {
  18422. type: "html",
  18423. dataValue: c.dataValue
  18424. });
  18425. a.fire("afterCommandExec", {
  18426. name: "pastefromword",
  18427. command: b,
  18428. returnValue: !!c
  18429. })
  18430. })
  18431. }
  18432. });
  18433. b.ui.addButton && b.ui.addButton("PasteFromWord", {
  18434. label: b.lang.pastefromword.toolbar,
  18435. command: "pastefromword",
  18436. toolbar: "clipboard,50"
  18437. });
  18438. b.on("pasteState", function(a) {
  18439. b.getCommand("pastefromword").setState(a.data)
  18440. });
  18441. b.on("paste", function(d) {
  18442. var e = d.data,
  18443. f = e.dataValue;
  18444. if(f && (g || /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(f))) {
  18445. var h = a(b, c, function() {
  18446. if(h) b.fire("paste", e);
  18447. else if(!b.config.pasteFromWordPromptCleanup || g || confirm(b.lang.pastefromword.confirmCleanup)) e.dataValue = CKEDITOR.cleanWord(f, b);
  18448. g = 0
  18449. });
  18450. h && d.cancel()
  18451. }
  18452. }, null, null, 3)
  18453. }
  18454. })
  18455. }(),
  18456. function() {
  18457. var a = {
  18458. canUndo: false,
  18459. async: true,
  18460. exec: function(e) {
  18461. e.getClipboardData({
  18462. title: e.lang.pastetext.title
  18463. }, function(b) {
  18464. b && e.fire("paste", {
  18465. type: "text",
  18466. dataValue: b.dataValue
  18467. });
  18468. e.fire("afterCommandExec", {
  18469. name: "pastetext",
  18470. command: a,
  18471. returnValue: !!b
  18472. })
  18473. })
  18474. }
  18475. };
  18476. CKEDITOR.plugins.add("pastetext", {
  18477. requires: "clipboard",
  18478. init: function(e) {
  18479. e.addCommand("pastetext", a);
  18480. e.ui.addButton && e.ui.addButton("PasteText", {
  18481. label: e.lang.pastetext.button,
  18482. command: "pastetext",
  18483. toolbar: "clipboard,40"
  18484. });
  18485. if(e.config.forcePasteAsPlainText) e.on("beforePaste",
  18486. function(a) {
  18487. if(a.data.type != "html") a.data.type = "text"
  18488. });
  18489. e.on("pasteState", function(a) {
  18490. e.getCommand("pastetext").setState(a.data)
  18491. })
  18492. }
  18493. })
  18494. }(), CKEDITOR.plugins.add("removeformat", {
  18495. init: function(a) {
  18496. a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
  18497. a.ui.addButton && a.ui.addButton("RemoveFormat", {
  18498. label: a.lang.removeformat.toolbar,
  18499. command: "removeFormat",
  18500. toolbar: "cleanup,10"
  18501. })
  18502. }
  18503. }), CKEDITOR.plugins.removeformat = {
  18504. commands: {
  18505. removeformat: {
  18506. exec: function(a) {
  18507. for(var e = a._.removeFormatRegex ||
  18508. (a._.removeFormatRegex = RegExp("^(?:" + a.config.removeFormatTags.replace(/,/g, "|") + ")$", "i")), b = a._.removeAttributes || (a._.removeAttributes = a.config.removeFormatAttributes.split(",")), g = CKEDITOR.plugins.removeformat.filter, c = a.getSelection().getRanges(), d = c.createIterator(), j = function(a) {
  18509. return a.type == CKEDITOR.NODE_ELEMENT
  18510. }, f; f = d.getNextRange();) {
  18511. f.collapsed || f.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  18512. var h = f.createBookmark(),
  18513. i = h.startNode,
  18514. k = h.endNode,
  18515. n = function(b) {
  18516. for(var c = a.elementPath(b), d = c.elements,
  18517. f = 1, h; h = d[f]; f++) {
  18518. if(h.equals(c.block) || h.equals(c.blockLimit)) break;
  18519. e.test(h.getName()) && g(a, h) && b.breakParent(h)
  18520. }
  18521. };
  18522. n(i);
  18523. if(k) {
  18524. n(k);
  18525. for(i = i.getNextSourceNode(true, CKEDITOR.NODE_ELEMENT); i;) {
  18526. if(i.equals(k)) break;
  18527. if(i.isReadOnly()) {
  18528. if(i.getPosition(k) & CKEDITOR.POSITION_CONTAINS) break;
  18529. i = i.getNext(j)
  18530. } else {
  18531. n = i.getNextSourceNode(false, CKEDITOR.NODE_ELEMENT);
  18532. if(!(i.getName() == "img" && i.data("cke-realelement")) && g(a, i))
  18533. if(e.test(i.getName())) i.remove(1);
  18534. else {
  18535. i.removeAttributes(b);
  18536. a.fire("removeFormatCleanup",
  18537. i)
  18538. }
  18539. i = n
  18540. }
  18541. }
  18542. }
  18543. f.moveToBookmark(h)
  18544. }
  18545. a.forceNextSelectionCheck();
  18546. a.getSelection().selectRanges(c)
  18547. }
  18548. }
  18549. },
  18550. filter: function(a, e) {
  18551. for(var b = a._.removeFormatFilters || [], g = 0; g < b.length; g++)
  18552. if(b[g](e) === false) return false;
  18553. return true
  18554. }
  18555. }, CKEDITOR.editor.prototype.addRemoveFormatFilter = function(a) {
  18556. if(!this._.removeFormatFilters) this._.removeFormatFilters = [];
  18557. this._.removeFormatFilters.push(a)
  18558. }, 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",
  18559. CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign", CKEDITOR.plugins.add("resize", {
  18560. init: function(a) {
  18561. var e, b, g, c;
  18562. function d(d) {
  18563. var h = e,
  18564. j = b,
  18565. k = h + (d.data.$.screenX - g) * (i == "rtl" ? -1 : 1),
  18566. d = j + (d.data.$.screenY - c);
  18567. n && (h = Math.max(f.resize_minWidth, Math.min(k, f.resize_maxWidth)));
  18568. o && (j = Math.max(f.resize_minHeight, Math.min(d, f.resize_maxHeight)));
  18569. a.resize(n ? h : null, j)
  18570. }
  18571. function j() {
  18572. CKEDITOR.document.removeListener("mousemove", d);
  18573. CKEDITOR.document.removeListener("mouseup", j);
  18574. if(a.document) {
  18575. a.document.removeListener("mousemove", d);
  18576. a.document.removeListener("mouseup", j)
  18577. }
  18578. }
  18579. var f = a.config,
  18580. h = a.ui.spaceId("resizer"),
  18581. i = a.element ? a.element.getDirection(1) : "ltr";
  18582. !f.resize_dir && (f.resize_dir = "vertical");
  18583. f.resize_maxWidth === void 0 && (f.resize_maxWidth = 3E3);
  18584. f.resize_maxHeight === void 0 && (f.resize_maxHeight = 3E3);
  18585. f.resize_minWidth === void 0 && (f.resize_minWidth = 750);
  18586. f.resize_minHeight === void 0 && (f.resize_minHeight = 250);
  18587. if(f.resize_enabled !== false) {
  18588. var k = null,
  18589. n = (f.resize_dir == "both" || f.resize_dir ==
  18590. "horizontal") && f.resize_minWidth != f.resize_maxWidth,
  18591. o = (f.resize_dir == "both" || f.resize_dir == "vertical") && f.resize_minHeight != f.resize_maxHeight,
  18592. q = CKEDITOR.tools.addFunction(function(h) {
  18593. k || (k = a.getResizable());
  18594. e = k.$.offsetWidth || 0;
  18595. b = k.$.offsetHeight || 0;
  18596. g = h.screenX;
  18597. c = h.screenY;
  18598. f.resize_minWidth > e && (f.resize_minWidth = e);
  18599. f.resize_minHeight > b && (f.resize_minHeight = b);
  18600. CKEDITOR.document.on("mousemove", d);
  18601. CKEDITOR.document.on("mouseup", j);
  18602. if(a.document) {
  18603. a.document.on("mousemove", d);
  18604. a.document.on("mouseup",
  18605. j)
  18606. }
  18607. h.preventDefault && h.preventDefault()
  18608. });
  18609. a.on("destroy", function() {
  18610. CKEDITOR.tools.removeFunction(q)
  18611. });
  18612. a.on("uiSpace", function(b) {
  18613. if(b.data.space == "bottom") {
  18614. var c = "";
  18615. n && !o && (c = " cke_resizer_horizontal");
  18616. !n && o && (c = " cke_resizer_vertical");
  18617. var d = '<span id="' + h + '" class="cke_resizer' + c + " cke_resizer_" + i + '" title="' + CKEDITOR.tools.htmlEncode(a.lang.common.resize) + '" onmousedown="CKEDITOR.tools.callFunction(' + q + ', event)">' + (i == "ltr" ? "◢" : "◣") + "</span>";
  18618. i == "ltr" && c == "ltr" ? b.data.html = b.data.html + d : b.data.html =
  18619. d + b.data.html
  18620. }
  18621. }, a, null, 100);
  18622. a.on("maximize", function(b) {
  18623. a.ui.space("resizer")[b.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]()
  18624. })
  18625. }
  18626. }
  18627. }), CKEDITOR.plugins.add("menubutton", {
  18628. requires: "button,menu",
  18629. onLoad: function() {
  18630. var a = function(a) {
  18631. var b = this._,
  18632. g = b.menu;
  18633. if(b.state !== CKEDITOR.TRISTATE_DISABLED)
  18634. if(b.on && g) g.hide();
  18635. else {
  18636. b.previousState = b.state;
  18637. if(!g) {
  18638. g = b.menu = new CKEDITOR.menu(a, {
  18639. panel: {
  18640. className: "cke_menu_panel",
  18641. attributes: {
  18642. "aria-label": a.lang.common.options
  18643. }
  18644. }
  18645. });
  18646. g.onHide = CKEDITOR.tools.bind(function() {
  18647. var c =
  18648. this.command ? a.getCommand(this.command).modes : this.modes;
  18649. this.setState(!c || c[a.mode] ? b.previousState : CKEDITOR.TRISTATE_DISABLED);
  18650. b.on = 0
  18651. }, this);
  18652. this.onMenu && g.addListener(this.onMenu)
  18653. }
  18654. this.setState(CKEDITOR.TRISTATE_ON);
  18655. b.on = 1;
  18656. setTimeout(function() {
  18657. g.show(CKEDITOR.document.getById(b.id), 4)
  18658. }, 0)
  18659. }
  18660. };
  18661. CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({
  18662. base: CKEDITOR.ui.button,
  18663. $: function(e) {
  18664. delete e.panel;
  18665. this.base(e);
  18666. this.hasArrow = true;
  18667. this.click = a
  18668. },
  18669. statics: {
  18670. handler: {
  18671. create: function(a) {
  18672. return new CKEDITOR.ui.menuButton(a)
  18673. }
  18674. }
  18675. }
  18676. })
  18677. },
  18678. beforeInit: function(a) {
  18679. a.ui.addHandler(CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler)
  18680. }
  18681. }), CKEDITOR.UI_MENUBUTTON = "menubutton", "use strict", CKEDITOR.plugins.add("scayt", {
  18682. requires: "menubutton,dialog",
  18683. tabToOpen: null,
  18684. dialogName: "scaytDialog",
  18685. init: function(a) {
  18686. var e = this,
  18687. b = CKEDITOR.plugins.scayt;
  18688. this.bindEvents(a);
  18689. this.parseConfig(a);
  18690. this.addRule(a);
  18691. CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + "dialogs/options.js"));
  18692. this.addMenuItems(a);
  18693. var g = a.lang.scayt,
  18694. c = CKEDITOR.env;
  18695. a.ui.add("Scayt",
  18696. CKEDITOR.UI_MENUBUTTON, {
  18697. label: g.text_title,
  18698. title: a.plugins.wsc ? a.lang.wsc.title : g.text_title,
  18699. modes: {
  18700. wysiwyg: !(c.ie && (c.version < 8 || c.quirks))
  18701. },
  18702. toolbar: "spellchecker,20",
  18703. refresh: function() {
  18704. var c = a.ui.instances.Scayt.getState();
  18705. a.scayt && (c = b.state[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
  18706. a.fire("scaytButtonState", c)
  18707. },
  18708. onRender: function() {
  18709. var b = this;
  18710. a.on("scaytButtonState", function(a) {
  18711. typeof a.data !== void 0 && b.setState(a.data)
  18712. })
  18713. },
  18714. onMenu: function() {
  18715. var c = a.scayt;
  18716. a.getMenuItem("scaytToggle").label =
  18717. a.lang.scayt[c && b.state[a.name] ? "btn_disable" : "btn_enable"];
  18718. c = {
  18719. scaytToggle: CKEDITOR.TRISTATE_OFF,
  18720. scaytOptions: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18721. scaytLangs: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18722. scaytDict: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18723. scaytAbout: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18724. WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  18725. };
  18726. a.config.scayt_uiTabs[0] || delete c.scaytOptions;
  18727. a.config.scayt_uiTabs[1] || delete c.scaytLangs;
  18728. a.config.scayt_uiTabs[2] || delete c.scaytDict;
  18729. return c
  18730. }
  18731. });
  18732. if(a.contextMenu && a.addMenuItems) {
  18733. a.contextMenu.addListener(function() {
  18734. var b = a.scayt,
  18735. c;
  18736. if(b) {
  18737. var f = b.getSelectionNode();
  18738. if(f = f ? f.getAttribute(b.getNodeAttribute()) : f) {
  18739. c = e.menuGenerator(a, f, e);
  18740. b.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" ."))
  18741. }
  18742. }
  18743. return c
  18744. });
  18745. a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function(b) {
  18746. return function() {
  18747. var c = a.scayt;
  18748. c && c.hideBanner();
  18749. return b.apply(this)
  18750. }
  18751. })
  18752. }
  18753. },
  18754. addMenuItems: function(a) {
  18755. var e = this,
  18756. b = CKEDITOR.plugins.scayt;
  18757. a.addMenuGroup("scaytButton");
  18758. var g = a.config.scayt_contextMenuItemsOrder.split("|");
  18759. if(g && g.length)
  18760. for(var c = 0; c < g.length; c++) a.addMenuGroup("scayt_" + g[c], c - 10);
  18761. g = {
  18762. scaytToggle: {
  18763. label: a.lang.scayt.btn_enable,
  18764. group: "scaytButton",
  18765. onClick: function() {
  18766. var c = a.scayt;
  18767. b.state[a.name] = !b.state[a.name];
  18768. b.state[a.name] === true ? c || b.createScayt(a) : c && b.destroy(a)
  18769. }
  18770. },
  18771. scaytAbout: {
  18772. label: a.lang.scayt.btn_about,
  18773. group: "scaytButton",
  18774. onClick: function() {
  18775. a.scayt.tabToOpen =
  18776. "about";
  18777. a.lockSelection();
  18778. a.openDialog(e.dialogName)
  18779. }
  18780. },
  18781. scaytOptions: {
  18782. label: a.lang.scayt.btn_options,
  18783. group: "scaytButton",
  18784. onClick: function() {
  18785. a.scayt.tabToOpen = "options";
  18786. a.lockSelection();
  18787. a.openDialog(e.dialogName)
  18788. }
  18789. },
  18790. scaytLangs: {
  18791. label: a.lang.scayt.btn_langs,
  18792. group: "scaytButton",
  18793. onClick: function() {
  18794. a.scayt.tabToOpen = "langs";
  18795. a.lockSelection();
  18796. a.openDialog(e.dialogName)
  18797. }
  18798. },
  18799. scaytDict: {
  18800. label: a.lang.scayt.btn_dictionaries,
  18801. group: "scaytButton",
  18802. onClick: function() {
  18803. a.scayt.tabToOpen = "dictionaries";
  18804. a.lockSelection();
  18805. a.openDialog(e.dialogName)
  18806. }
  18807. }
  18808. };
  18809. if(a.plugins.wsc) g.WSC = {
  18810. label: a.lang.wsc.toolbar,
  18811. group: "scaytButton",
  18812. onClick: function() {
  18813. var b = CKEDITOR.plugins.scayt,
  18814. c = a.scayt,
  18815. f = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  18816. if(f = f.replace(/\s/g, "")) {
  18817. c && (b.state[a.name] && c.setMarkupPaused) && c.setMarkupPaused(true);
  18818. a.lockSelection();
  18819. a.execCommand("checkspell")
  18820. } else alert("Nothing to check!")
  18821. }
  18822. };
  18823. a.addMenuItems(g)
  18824. },
  18825. bindEvents: function(a) {
  18826. function e() {
  18827. var b = a.scayt;
  18828. if(b) {
  18829. b.removeMarkupInSelectionNode();
  18830. b.fire("startSpellCheck")
  18831. }
  18832. }
  18833. var b = CKEDITOR.plugins.scayt,
  18834. g = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE;
  18835. CKEDITOR.on("dialogDefinition", function(a) {
  18836. if(a.data.name === "scaytDialog") a.data.definition.dialog.on("cancel", function() {
  18837. return false
  18838. }, this, null, -1)
  18839. });
  18840. var c = function() {
  18841. a.scayt && b.destroy(a)
  18842. },
  18843. d = function() {
  18844. b.state[a.name] && !a.readOnly && b.createScayt(a)
  18845. },
  18846. j = function() {
  18847. var b = a.editable();
  18848. b.attachListener(b, "focus", function() {
  18849. var b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[a.name] && a.scayt,
  18850. c, d;
  18851. if((g || b) && a._.savedSelection)
  18852. for(var b = a._.savedSelection.getSelectedElement(), b = !b && a._.savedSelection.getRanges(), f = 0; f < b.length; f++) {
  18853. d = b[f];
  18854. c = d.startContainer.getText().length;
  18855. (c < d.startOffset || c < d.endOffset) && a.unlockSelection(false)
  18856. }
  18857. }, this, null, -10)
  18858. },
  18859. f = function() {
  18860. if(g) {
  18861. a.on("blur", c);
  18862. a.on("focus", d);
  18863. a.focusManager.hasFocus && d()
  18864. } else d();
  18865. j()
  18866. };
  18867. a.on("contentDom", f);
  18868. a.on("beforeCommandExec", function(c) {
  18869. var d;
  18870. if(c.data.name in b.options.disablingCommandExec && a.mode == "wysiwyg") {
  18871. if(d = a.scayt) {
  18872. b.destroy(a);
  18873. a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)
  18874. }
  18875. } else if(c.data.name === "bold" || c.data.name === "italic" || c.data.name === "underline" || c.data.name === "strike" || c.data.name === "subscript" || c.data.name === "superscript")
  18876. if(d = a.scayt) {
  18877. d.removeMarkupInSelectionNode();
  18878. setTimeout(function() {
  18879. d.fire("startSpellCheck")
  18880. }, 0)
  18881. }
  18882. });
  18883. a.on("beforeSetMode", function(c) {
  18884. if(c.data == "source") {
  18885. if(c = a.scayt) {
  18886. b.destroy(a);
  18887. a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)
  18888. }
  18889. if(a.document) {
  18890. a.document.getBody().removeAttribute("_jquid");
  18891. a.document.getBody().removeAttribute("dir")
  18892. }
  18893. }
  18894. });
  18895. a.on("afterCommandExec", function(b) {
  18896. var c;
  18897. if(a.mode == "wysiwyg" && (b.data.name == "undo" || b.data.name == "redo"))(c = a.scayt) && setTimeout(function() {
  18898. c.fire("startSpellCheck")
  18899. }, 250)
  18900. });
  18901. a.on("readOnly", function(c) {
  18902. var d;
  18903. if(c) {
  18904. d = a.scayt;
  18905. if(c.editor.readOnly === true) d && d.fire("removeMarkupInDocument", {});
  18906. else if(d) d.fire("startSpellCheck");
  18907. else if(c.editor.mode == "wysiwyg" && b.state[c.editor.name] === true) {
  18908. b.createScayt(a);
  18909. c.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)
  18910. }
  18911. }
  18912. });
  18913. a.on("beforeDestroy", c);
  18914. a.on("setData", function() {
  18915. c();
  18916. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && f()
  18917. }, this, null, 50);
  18918. a.on("insertElement", function() {
  18919. CKEDITOR.env.ie ? setTimeout(function() {
  18920. e()
  18921. }, 50) : e()
  18922. }, this, null, 50);
  18923. a.on("insertHtml", function() {
  18924. e()
  18925. }, this, null, 50);
  18926. a.on("insertText", function() {
  18927. e()
  18928. }, this, null, 50);
  18929. a.on("scaytDialogShown", function(b) {
  18930. b.data.selectPage(a.scayt.tabToOpen)
  18931. })
  18932. },
  18933. parseConfig: function(a) {
  18934. var e = CKEDITOR.plugins.scayt;
  18935. e.replaceOldOptionsNames(a.config);
  18936. if(typeof a.config.scayt_autoStartup !==
  18937. "boolean") a.config.scayt_autoStartup = false;
  18938. e.state[a.name] = a.config.scayt_autoStartup;
  18939. if(!a.config.scayt_contextCommands) a.config.scayt_contextCommands = "ignore|ignoreall|add";
  18940. if(!a.config.scayt_contextMenuItemsOrder) a.config.scayt_contextMenuItemsOrder = "suggest|moresuggest|control";
  18941. if(!a.config.scayt_sLang) a.config.scayt_sLang = "en_US";
  18942. if(a.config.scayt_maxSuggestions === void 0 || typeof a.config.scayt_maxSuggestions != "number" || a.config.scayt_maxSuggestions < 0) a.config.scayt_maxSuggestions = 5;
  18943. if(a.config.scayt_customDictionaryIds ===
  18944. void 0 || typeof a.config.scayt_customDictionaryIds !== "string") a.config.scayt_customDictionaryIds = "";
  18945. if(a.config.scayt_userDictionaryName === void 0 || typeof a.config.scayt_userDictionaryName !== "string") a.config.scayt_userDictionaryName = null;
  18946. if(typeof a.config.scayt_uiTabs === "string" && a.config.scayt_uiTabs.split(",").length === 3) {
  18947. var b = [],
  18948. g = [];
  18949. a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");
  18950. CKEDITOR.tools.search(a.config.scayt_uiTabs, function(a) {
  18951. if(Number(a) === 1 || Number(a) === 0) {
  18952. g.push(true);
  18953. b.push(Number(a))
  18954. } else g.push(false)
  18955. });
  18956. a.config.scayt_uiTabs = CKEDITOR.tools.search(g, false) === null ? b : [1, 1, 1]
  18957. } else a.config.scayt_uiTabs = [1, 1, 1];
  18958. if(typeof a.config.scayt_serviceProtocol != "string") a.config.scayt_serviceProtocol = null;
  18959. if(typeof a.config.scayt_serviceHost != "string") a.config.scayt_serviceHost = null;
  18960. if(typeof a.config.scayt_servicePort != "string") a.config.scayt_servicePort = null;
  18961. if(typeof a.config.scayt_servicePath != "string") a.config.scayt_servicePath = null;
  18962. if(!a.config.scayt_moreSuggestions) a.config.scayt_moreSuggestions = "on";
  18963. if(typeof a.config.scayt_customerId !==
  18964. "string") a.config.scayt_customerId = "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2";
  18965. if(typeof a.config.scayt_srcUrl !== "string") {
  18966. e = document.location.protocol;
  18967. e = e.search(/https?:/) != -1 ? e : "http:";
  18968. a.config.scayt_srcUrl = e + "//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js"
  18969. }
  18970. if(typeof CKEDITOR.config.scayt_handleCheckDirty !== "boolean") CKEDITOR.config.scayt_handleCheckDirty = true;
  18971. if(typeof CKEDITOR.config.scayt_handleUndoRedo !== "boolean") CKEDITOR.config.scayt_handleUndoRedo =
  18972. true;
  18973. if(a.config.scayt_disableOptionsStorage) {
  18974. var e = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ? a.config.scayt_disableOptionsStorage : typeof a.config.scayt_disableOptionsStorage === "string" ? [a.config.scayt_disableOptionsStorage] : void 0,
  18975. c = ["all", "options", "lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
  18976. d = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
  18977. j = CKEDITOR.tools.search,
  18978. f = CKEDITOR.tools.indexOf;
  18979. a.config.scayt_disableOptionsStorage = function(a) {
  18980. for(var b = [], e = 0; e < a.length; e++) {
  18981. var g = a[e],
  18982. o = !!j(a, "options");
  18983. if(!j(c, g) || o && j(d, function(a) {
  18984. if(a === "lang") return false
  18985. })) return;
  18986. j(d, g) && d.splice(f(d, g), 1);
  18987. if(g === "all" || o && j(a, "lang")) return [];
  18988. g === "options" && (d = ["lang"])
  18989. }
  18990. return b = b.concat(d)
  18991. }(e)
  18992. }
  18993. },
  18994. addRule: function(a) {
  18995. var e = a.dataProcessor,
  18996. b = e && e.htmlFilter,
  18997. g = a._.elementsPath && a._.elementsPath.filters,
  18998. e = e && e.dataFilter,
  18999. c = a.addRemoveFormatFilter,
  19000. d = function(b) {
  19001. var c =
  19002. CKEDITOR.plugins.scayt;
  19003. if(a.scayt && b.hasAttribute(c.options.data_attribute_name)) return false
  19004. },
  19005. j = function(b) {
  19006. var c = CKEDITOR.plugins.scayt,
  19007. d = true;
  19008. a.scayt && b.hasAttribute(c.options.data_attribute_name) && (d = false);
  19009. return d
  19010. };
  19011. g && g.push(d);
  19012. e && e.addRules({
  19013. elements: {
  19014. span: function(b) {
  19015. var c = CKEDITOR.plugins.scayt;
  19016. if(c && c.state[a.name] && b.classes && CKEDITOR.tools.search(b.classes, c.options.misspelled_word_class))
  19017. if(b.classes && b.parent.type === CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  19018. delete b.attributes.style;
  19019. delete b.name
  19020. } else delete b.classes[CKEDITOR.tools.indexOf(b.classes,
  19021. c.options.misspelled_word_class)];
  19022. return b
  19023. }
  19024. }
  19025. });
  19026. b && b.addRules({
  19027. elements: {
  19028. span: function(b) {
  19029. var c = CKEDITOR.plugins.scayt;
  19030. if(c && c.state[a.name] && b.hasClass(c.options.misspelled_word_class) && b.attributes[c.options.data_attribute_name]) {
  19031. b.removeClass(c.options.misspelled_word_class);
  19032. delete b.attributes[c.options.data_attribute_name];
  19033. delete b.name
  19034. }
  19035. return b
  19036. }
  19037. }
  19038. });
  19039. c && c.call(a, j)
  19040. },
  19041. scaytMenuDefinition: function(a) {
  19042. var e = this,
  19043. a = a.scayt;
  19044. return {
  19045. scayt_ignore: {
  19046. label: a.getLocal("btn_ignore"),
  19047. group: "scayt_control",
  19048. order: 1,
  19049. exec: function(a) {
  19050. a.scayt.ignoreWord()
  19051. }
  19052. },
  19053. scayt_ignoreall: {
  19054. label: a.getLocal("btn_ignoreAll"),
  19055. group: "scayt_control",
  19056. order: 2,
  19057. exec: function(a) {
  19058. a.scayt.ignoreAllWords()
  19059. }
  19060. },
  19061. scayt_add: {
  19062. label: a.getLocal("btn_addWord"),
  19063. group: "scayt_control",
  19064. order: 3,
  19065. exec: function(a) {
  19066. var e = a.scayt;
  19067. setTimeout(function() {
  19068. e.addWordToUserDictionary()
  19069. }, 10)
  19070. }
  19071. },
  19072. option: {
  19073. label: a.getLocal("btn_options"),
  19074. group: "scayt_control",
  19075. order: 4,
  19076. exec: function(a) {
  19077. a.scayt.tabToOpen = "options";
  19078. a.lockSelection();
  19079. a.openDialog(e.dialogName)
  19080. },
  19081. verification: function(a) {
  19082. return a.config.scayt_uiTabs[0] ==
  19083. 1 ? true : false
  19084. }
  19085. },
  19086. language: {
  19087. label: a.getLocal("btn_langs"),
  19088. group: "scayt_control",
  19089. order: 5,
  19090. exec: function(a) {
  19091. a.scayt.tabToOpen = "langs";
  19092. a.lockSelection();
  19093. a.openDialog(e.dialogName)
  19094. },
  19095. verification: function(a) {
  19096. return a.config.scayt_uiTabs[1] == 1 ? true : false
  19097. }
  19098. },
  19099. dictionary: {
  19100. label: a.getLocal("btn_dictionaries"),
  19101. group: "scayt_control",
  19102. order: 6,
  19103. exec: function(a) {
  19104. a.scayt.tabToOpen = "dictionaries";
  19105. a.lockSelection();
  19106. a.openDialog(e.dialogName)
  19107. },
  19108. verification: function(a) {
  19109. return a.config.scayt_uiTabs[2] == 1 ? true : false
  19110. }
  19111. },
  19112. about: {
  19113. label: a.getLocal("btn_about"),
  19114. group: "scayt_control",
  19115. order: 7,
  19116. exec: function(a) {
  19117. a.scayt.tabToOpen = "about";
  19118. a.lockSelection();
  19119. a.openDialog(e.dialogName)
  19120. }
  19121. }
  19122. }
  19123. },
  19124. buildSuggestionMenuItems: function(a, e) {
  19125. var b = {},
  19126. g = {},
  19127. c = a.scayt;
  19128. if(e.length > 0 && e[0] !== "no_any_suggestions")
  19129. for(var d = 0; d < e.length; d++) {
  19130. var j = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_");
  19131. a.addCommand(j, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d]));
  19132. if(d < a.config.scayt_maxSuggestions) {
  19133. a.addMenuItem(j, {
  19134. label: e[d],
  19135. command: j,
  19136. group: "scayt_suggest",
  19137. order: d + 1
  19138. });
  19139. b[j] = CKEDITOR.TRISTATE_OFF
  19140. } else {
  19141. a.addMenuItem(j, {
  19142. label: e[d],
  19143. command: j,
  19144. group: "scayt_moresuggest",
  19145. order: d + 1
  19146. });
  19147. g[j] = CKEDITOR.TRISTATE_OFF;
  19148. if(a.config.scayt_moreSuggestions === "on") {
  19149. a.addMenuItem("scayt_moresuggest", {
  19150. label: c.getLocal("btn_moreSuggestions"),
  19151. group: "scayt_moresuggest",
  19152. order: 10,
  19153. getItems: function() {
  19154. return g
  19155. }
  19156. });
  19157. b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF
  19158. }
  19159. }
  19160. } else {
  19161. b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED;
  19162. a.addCommand("no_scayt_suggest", {
  19163. exec: function() {}
  19164. });
  19165. a.addMenuItem("no_scayt_suggest", {
  19166. label: c.getLocal("btn_noSuggestions") || "no_scayt_suggest",
  19167. command: "no_scayt_suggest",
  19168. group: "scayt_suggest",
  19169. order: 0
  19170. })
  19171. }
  19172. return b
  19173. },
  19174. menuGenerator: function(a, e) {
  19175. var b = a.scayt,
  19176. g = this.scaytMenuDefinition(a),
  19177. c = {},
  19178. d = a.config.scayt_contextCommands.split("|");
  19179. b.fire("getSuggestionsList", {
  19180. lang: b.getLang(),
  19181. word: e
  19182. });
  19183. c = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions);
  19184. if(a.config.scayt_contextCommands == "off") return c;
  19185. for(var j in g)
  19186. if(!(CKEDITOR.tools.indexOf(d, j.replace("scayt_", "")) == -1 && a.config.scayt_contextCommands !=
  19187. "all")) {
  19188. c[j] = CKEDITOR.TRISTATE_OFF;
  19189. typeof g[j].verification === "function" && !g[j].verification(a) && delete c[j];
  19190. a.addCommand(j, {
  19191. exec: g[j].exec
  19192. });
  19193. a.addMenuItem(j, {
  19194. label: a.lang.scayt[g[j].label] || g[j].label,
  19195. command: j,
  19196. group: g[j].group,
  19197. order: g[j].order
  19198. })
  19199. }
  19200. return c
  19201. },
  19202. createCommand: function(a) {
  19203. return {
  19204. exec: function(e) {
  19205. e.scayt.replaceSelectionNode({
  19206. word: a
  19207. })
  19208. }
  19209. }
  19210. }
  19211. }), CKEDITOR.plugins.scayt = {
  19212. state: {},
  19213. suggestions: [],
  19214. loadingHelper: {
  19215. loadOrder: []
  19216. },
  19217. isLoading: !1,
  19218. options: {
  19219. disablingCommandExec: {
  19220. source: !0,
  19221. newpage: !0,
  19222. templates: !0
  19223. },
  19224. data_attribute_name: "data-scayt-word",
  19225. misspelled_word_class: "scayt-misspell-word"
  19226. },
  19227. backCompatibilityMap: {
  19228. scayt_service_protocol: "scayt_serviceProtocol",
  19229. scayt_service_host: "scayt_serviceHost",
  19230. scayt_service_port: "scayt_servicePort",
  19231. scayt_service_path: "scayt_servicePath",
  19232. scayt_customerid: "scayt_customerId"
  19233. },
  19234. replaceOldOptionsNames: function(a) {
  19235. for(var e in a)
  19236. if(e in this.backCompatibilityMap) {
  19237. a[this.backCompatibilityMap[e]] = a[e];
  19238. delete a[e]
  19239. }
  19240. },
  19241. createScayt: function(a) {
  19242. var e = this;
  19243. this.loadScaytLibrary(a,
  19244. function(a) {
  19245. var g = {
  19246. lang: a.config.scayt_sLang,
  19247. container: a.editable().$.nodeName == "BODY" ? a.document.getWindow().$.frameElement : a.editable().$,
  19248. customDictionary: a.config.scayt_customDictionaryIds,
  19249. userDictionaryName: a.config.scayt_userDictionaryName,
  19250. localization: a.langCode,
  19251. customer_id: a.config.scayt_customerId,
  19252. debug: a.config.scayt_debug,
  19253. data_attribute_name: e.options.data_attribute_name,
  19254. misspelled_word_class: e.options.misspelled_word_class,
  19255. "options-to-restore": a.config.scayt_disableOptionsStorage,
  19256. focused: a.editable().hasFocus,
  19257. ignoreElementsRegex: a.config.scayt_elementsToIgnore
  19258. };
  19259. if(a.config.scayt_serviceProtocol) g.service_protocol = a.config.scayt_serviceProtocol;
  19260. if(a.config.scayt_serviceHost) g.service_host = a.config.scayt_serviceHost;
  19261. if(a.config.scayt_servicePort) g.service_port = a.config.scayt_servicePort;
  19262. if(a.config.scayt_servicePath) g.service_path = a.config.scayt_servicePath;
  19263. g = new SCAYT.CKSCAYT(g, function() {}, function() {});
  19264. g.subscribe("suggestionListSend", function(a) {
  19265. for(var b = {}, e = [], f = 0; f < a.suggestionList.length; f++)
  19266. if(!b["word_" +
  19267. a.suggestionList[f]]) {
  19268. b["word_" + a.suggestionList[f]] = a.suggestionList[f];
  19269. e.push(a.suggestionList[f])
  19270. }
  19271. CKEDITOR.plugins.scayt.suggestions = e
  19272. });
  19273. a.scayt = g;
  19274. a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON)
  19275. })
  19276. },
  19277. destroy: function(a) {
  19278. a.scayt && a.scayt.destroy();
  19279. delete a.scayt;
  19280. a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF)
  19281. },
  19282. loadScaytLibrary: function(a, e) {
  19283. var b = this;
  19284. if(typeof window.SCAYT === "undefined" || typeof window.SCAYT.CKSCAYT !== "function") {
  19285. this.loadingHelper[a.name] = e;
  19286. this.loadingHelper.loadOrder.push(a.name);
  19287. CKEDITOR.scriptLoader.load(a.config.scayt_srcUrl, function() {
  19288. var a;
  19289. CKEDITOR.fireOnce("scaytReady");
  19290. for(var c = 0; c < b.loadingHelper.loadOrder.length; c++) {
  19291. a = b.loadingHelper.loadOrder[c];
  19292. if(typeof b.loadingHelper[a] === "function") b.loadingHelper[a](CKEDITOR.instances[a]);
  19293. delete b.loadingHelper[a]
  19294. }
  19295. b.loadingHelper.loadOrder = []
  19296. })
  19297. } else if(window.SCAYT && typeof window.SCAYT.CKSCAYT === "function") {
  19298. CKEDITOR.fireOnce("scaytReady");
  19299. a.scayt || typeof e === "function" && e(a)
  19300. }
  19301. }
  19302. }, CKEDITOR.on("scaytReady",
  19303. function() {
  19304. if(CKEDITOR.config.scayt_handleCheckDirty === true) {
  19305. var a = CKEDITOR.editor.prototype;
  19306. a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function(a) {
  19307. return function() {
  19308. var e = null,
  19309. c = this.scayt;
  19310. if(!CKEDITOR.plugins.scayt || !CKEDITOR.plugins.scayt.state[this.name] || !this.scayt) e = a.call(this);
  19311. else if(e = this.status == "ready") var d = c.removeMarkupFromString(this.getSnapshot()),
  19312. c = c.removeMarkupFromString(this._.previousValue),
  19313. e = e && c !== d;
  19314. return e
  19315. }
  19316. });
  19317. a.resetDirty = CKEDITOR.tools.override(a.resetDirty, function(a) {
  19318. return function() {
  19319. var e =
  19320. this.scayt;
  19321. !CKEDITOR.plugins.scayt || !CKEDITOR.plugins.scayt.state[this.name] || !this.scayt ? a.call(this) : this._.previousValue = e.removeMarkupFromString(this.getSnapshot())
  19322. }
  19323. })
  19324. }
  19325. if(CKEDITOR.config.scayt_handleUndoRedo === true) {
  19326. var a = CKEDITOR.plugins.undo.Image.prototype,
  19327. e = typeof a.equalsContent == "function" ? "equalsContent" : "equals";
  19328. a[e] = CKEDITOR.tools.override(a[e], function(a) {
  19329. return function(e) {
  19330. var c = e.editor.scayt,
  19331. d = this.contents,
  19332. j = e.contents,
  19333. f = null;
  19334. if(CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[e.editor.name] &&
  19335. e.editor.scayt) {
  19336. this.contents = c.removeMarkupFromString(d) || "";
  19337. e.contents = c.removeMarkupFromString(j) || ""
  19338. }
  19339. f = a.apply(this, arguments);
  19340. this.contents = d;
  19341. e.contents = j;
  19342. return f
  19343. }
  19344. })
  19345. }
  19346. }),
  19347. function() {
  19348. var a = {
  19349. preserveState: true,
  19350. editorFocus: false,
  19351. readOnly: 1,
  19352. exec: function(a) {
  19353. this.toggleState();
  19354. this.refresh(a)
  19355. },
  19356. refresh: function(a) {
  19357. if(a.document) {
  19358. var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass";
  19359. a.editable()[b]("cke_show_borders")
  19360. }
  19361. }
  19362. };
  19363. CKEDITOR.plugins.add("showborders", {
  19364. modes: {
  19365. wysiwyg: 1
  19366. },
  19367. onLoad: function() {
  19368. var a;
  19369. a = (CKEDITOR.env.ie6Compat ? [".%1 table.%2,", ".%1 table.%2 td, .%1 table.%2 th", "{", "border : #d3d3d3 1px dotted", "}"] : [".%1 table.%2,", ".%1 table.%2 > tr > td, .%1 table.%2 > tr > th,", ".%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,", ".%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,", ".%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th", "{", "border : #d3d3d3 1px dotted", "}"]).join("").replace(/%2/g, "cke_show_border").replace(/%1/g, "cke_show_borders ");
  19370. CKEDITOR.addCss(a)
  19371. },
  19372. init: function(e) {
  19373. var b = e.addCommand("showborders", a);
  19374. b.canUndo = false;
  19375. e.config.startupShowBorders !== false && b.setState(CKEDITOR.TRISTATE_ON);
  19376. e.on("mode", function() {
  19377. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(e)
  19378. }, null, null, 100);
  19379. e.on("contentDom", function() {
  19380. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(e)
  19381. });
  19382. e.on("removeFormatCleanup", function(a) {
  19383. a = a.data;
  19384. e.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && (a.is("table") && (!a.hasAttribute("border") || parseInt(a.getAttribute("border"), 10) <= 0)) &&
  19385. a.addClass("cke_show_border")
  19386. })
  19387. },
  19388. afterInit: function(a) {
  19389. var b = a.dataProcessor,
  19390. a = b && b.dataFilter,
  19391. b = b && b.htmlFilter;
  19392. a && a.addRules({
  19393. elements: {
  19394. table: function(a) {
  19395. var a = a.attributes,
  19396. b = a["class"],
  19397. d = parseInt(a.border, 10);
  19398. if((!d || d <= 0) && (!b || b.indexOf("cke_show_border") == -1)) a["class"] = (b || "") + " cke_show_border"
  19399. }
  19400. }
  19401. });
  19402. b && b.addRules({
  19403. elements: {
  19404. table: function(a) {
  19405. var a = a.attributes,
  19406. b = a["class"];
  19407. b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(/^\s+|\s+$/, ""))
  19408. }
  19409. }
  19410. })
  19411. }
  19412. });
  19413. CKEDITOR.on("dialogDefinition",
  19414. function(a) {
  19415. var b = a.data.name;
  19416. if(b == "table" || b == "tableProperties") {
  19417. a = a.data.definition;
  19418. b = a.getContents("info").get("txtBorder");
  19419. b.commit = CKEDITOR.tools.override(b.commit, function(a) {
  19420. return function(b, d) {
  19421. a.apply(this, arguments);
  19422. var e = parseInt(this.getValue(), 10);
  19423. d[!e || e <= 0 ? "addClass" : "removeClass"]("cke_show_border")
  19424. }
  19425. });
  19426. if(a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) {
  19427. a.setup = CKEDITOR.tools.override(a.setup, function(a) {
  19428. return function() {
  19429. a.apply(this, arguments);
  19430. this.setValue(this.getValue().replace(/cke_show_border/,
  19431. ""))
  19432. }
  19433. });
  19434. a.commit = CKEDITOR.tools.override(a.commit, function(a) {
  19435. return function(b, d) {
  19436. a.apply(this, arguments);
  19437. parseInt(d.getAttribute("border"), 10) || d.addClass("cke_show_border")
  19438. }
  19439. })
  19440. }
  19441. }
  19442. })
  19443. }(),
  19444. function() {
  19445. CKEDITOR.plugins.add("sourcearea", {
  19446. init: function(e) {
  19447. function b() {
  19448. var a = c && this.equals(CKEDITOR.document.getActive());
  19449. this.hide();
  19450. this.setStyle("height", this.getParent().$.clientHeight + "px");
  19451. this.setStyle("width", this.getParent().$.clientWidth + "px");
  19452. this.show();
  19453. a && this.focus()
  19454. }
  19455. if(e.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  19456. var g =
  19457. CKEDITOR.plugins.sourcearea;
  19458. e.addMode("source", function(c) {
  19459. var g = e.ui.space("contents").getDocument().createElement("textarea");
  19460. g.setStyles(CKEDITOR.tools.extend({
  19461. width: CKEDITOR.env.ie7Compat ? "99%" : "100%",
  19462. height: "100%",
  19463. resize: "none",
  19464. outline: "none",
  19465. "text-align": "left"
  19466. }, CKEDITOR.tools.cssVendorPrefix("tab-size", e.config.sourceAreaTabSize || 4)));
  19467. g.setAttribute("dir", "ltr");
  19468. g.addClass("cke_source cke_reset cke_enable_context_menu");
  19469. e.ui.space("contents").append(g);
  19470. g = e.editable(new a(e, g));
  19471. g.setData(e.getData(1));
  19472. if(CKEDITOR.env.ie) {
  19473. g.attachListener(e, "resize", b, g);
  19474. g.attachListener(CKEDITOR.document.getWindow(), "resize", b, g);
  19475. CKEDITOR.tools.setTimeout(b, 0, g)
  19476. }
  19477. e.fire("ariaWidget", this);
  19478. c()
  19479. });
  19480. e.addCommand("source", g.commands.source);
  19481. e.ui.addButton && e.ui.addButton("Source", {
  19482. label: e.lang.sourcearea.toolbar,
  19483. command: "source",
  19484. toolbar: "mode,10"
  19485. });
  19486. e.on("mode", function() {
  19487. e.getCommand("source").setState(e.mode == "source" ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
  19488. });
  19489. var c = CKEDITOR.env.ie && CKEDITOR.env.version == 9
  19490. }
  19491. }
  19492. });
  19493. var a =
  19494. CKEDITOR.tools.createClass({
  19495. base: CKEDITOR.editable,
  19496. proto: {
  19497. setData: function(a) {
  19498. this.setValue(a);
  19499. this.status = "ready";
  19500. this.editor.fire("dataReady")
  19501. },
  19502. getData: function() {
  19503. return this.getValue()
  19504. },
  19505. insertHtml: function() {},
  19506. insertElement: function() {},
  19507. insertText: function() {},
  19508. setReadOnly: function(a) {
  19509. this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly")
  19510. },
  19511. detach: function() {
  19512. a.baseProto.detach.call(this);
  19513. this.clearCustomData();
  19514. this.remove()
  19515. }
  19516. }
  19517. })
  19518. }(), CKEDITOR.plugins.sourcearea = {
  19519. commands: {
  19520. source: {
  19521. modes: {
  19522. wysiwyg: 1,
  19523. source: 1
  19524. },
  19525. editorFocus: !1,
  19526. readOnly: 1,
  19527. exec: function(a) {
  19528. a.mode == "wysiwyg" && a.fire("saveSnapshot");
  19529. a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
  19530. a.setMode(a.mode == "source" ? "wysiwyg" : "source")
  19531. },
  19532. canUndo: !1
  19533. }
  19534. }
  19535. }, CKEDITOR.plugins.add("specialchar", {
  19536. availableLangs: {
  19537. af: 1,
  19538. ar: 1,
  19539. bg: 1,
  19540. ca: 1,
  19541. cs: 1,
  19542. cy: 1,
  19543. da: 1,
  19544. de: 1,
  19545. el: 1,
  19546. en: 1,
  19547. "en-gb": 1,
  19548. eo: 1,
  19549. es: 1,
  19550. et: 1,
  19551. fa: 1,
  19552. fi: 1,
  19553. fr: 1,
  19554. "fr-ca": 1,
  19555. gl: 1,
  19556. he: 1,
  19557. hr: 1,
  19558. hu: 1,
  19559. id: 1,
  19560. it: 1,
  19561. ja: 1,
  19562. km: 1,
  19563. ku: 1,
  19564. lt: 1,
  19565. lv: 1,
  19566. nb: 1,
  19567. nl: 1,
  19568. no: 1,
  19569. pl: 1,
  19570. pt: 1,
  19571. "pt-br": 1,
  19572. ru: 1,
  19573. si: 1,
  19574. sk: 1,
  19575. sl: 1,
  19576. sq: 1,
  19577. sv: 1,
  19578. th: 1,
  19579. tr: 1,
  19580. tt: 1,
  19581. ug: 1,
  19582. uk: 1,
  19583. vi: 1,
  19584. zh: 1,
  19585. "zh-cn": 1
  19586. },
  19587. requires: "dialog",
  19588. init: function(a) {
  19589. var e = this;
  19590. CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js");
  19591. a.addCommand("specialchar", {
  19592. exec: function() {
  19593. var b = a.langCode,
  19594. b = e.availableLangs[b] ? b : e.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  19595. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e.path + "dialogs/lang/" + b + ".js"), function() {
  19596. CKEDITOR.tools.extend(a.lang.specialchar, e.langEntries[b]);
  19597. a.openDialog("specialchar")
  19598. })
  19599. },
  19600. modes: {
  19601. wysiwyg: 1
  19602. },
  19603. canUndo: false
  19604. });
  19605. a.ui.addButton && a.ui.addButton("SpecialChar", {
  19606. label: a.lang.specialchar.toolbar,
  19607. command: "specialchar",
  19608. toolbar: "insert,50"
  19609. })
  19610. }
  19611. }), CKEDITOR.config.specialChars = "! &quot; # $ % &amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ &euro; &lsquo; &rsquo; &ldquo; &rdquo; &ndash; &mdash; &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml; &copy; &ordf; &laquo; &not; &reg; &macr; &deg; &sup2; &sup3; &acute; &micro; &para; &middot; &cedil; &sup1; &ordm; &raquo; &frac14; &frac12; &frac34; &iquest; &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &times; &Oslash; &Ugrave; &Uacute; &Ucirc; &Uuml; &Yacute; &THORN; &szlig; &agrave; &aacute; &acirc; &atilde; &auml; &aring; &aelig; &ccedil; &egrave; &eacute; &ecirc; &euml; &igrave; &iacute; &icirc; &iuml; &eth; &ntilde; &ograve; &oacute; &ocirc; &otilde; &ouml; &divide; &oslash; &ugrave; &uacute; &ucirc; &uuml; &yacute; &thorn; &yuml; &OElig; &oelig; &#372; &#374 &#373 &#375; &sbquo; &#8219; &bdquo; &hellip; &trade; &#9658; &bull; &rarr; &rArr; &hArr; &diams; &asymp;".split(" "),
  19612. function() {
  19613. CKEDITOR.plugins.add("stylescombo", {
  19614. requires: "richcombo",
  19615. init: function(a) {
  19616. var e = a.config,
  19617. b = a.lang.stylescombo,
  19618. g = {},
  19619. c = [],
  19620. d = [];
  19621. a.on("stylesSet", function(b) {
  19622. if(b = b.data.styles) {
  19623. for(var f, h, i, k = 0, n = b.length; k < n; k++) {
  19624. f = b[k];
  19625. if(!(a.blockless && f.element in CKEDITOR.dtd.$block)) {
  19626. h = f.name;
  19627. f = new CKEDITOR.style(f);
  19628. if(!a.filter.customConfig || a.filter.check(f)) {
  19629. f._name = h;
  19630. f._.enterMode = e.enterMode;
  19631. f._.type = i = f.assignedTo || f.type;
  19632. f._.weight = k + (i == CKEDITOR.STYLE_OBJECT ? 1 : i == CKEDITOR.STYLE_BLOCK ? 2 : 3) * 1E3;
  19633. g[h] = f;
  19634. c.push(f);
  19635. d.push(f)
  19636. }
  19637. }
  19638. }
  19639. c.sort(function(a, b) {
  19640. return a._.weight - b._.weight
  19641. })
  19642. }
  19643. });
  19644. a.ui.addRichCombo("Styles", {
  19645. label: b.label,
  19646. title: b.panelTitle,
  19647. toolbar: "styles,10",
  19648. allowedContent: d,
  19649. panel: {
  19650. css: [CKEDITOR.skin.getPath("editor")].concat(e.contentsCss),
  19651. multiSelect: true,
  19652. attributes: {
  19653. "aria-label": b.panelTitle
  19654. }
  19655. },
  19656. init: function() {
  19657. var a, d, e, g, k, n;
  19658. k = 0;
  19659. for(n = c.length; k < n; k++) {
  19660. a = c[k];
  19661. d = a._name;
  19662. g = a._.type;
  19663. if(g != e) {
  19664. this.startGroup(b["panelTitle" + g]);
  19665. e = g
  19666. }
  19667. this.add(d, a.type == CKEDITOR.STYLE_OBJECT ? d : a.buildPreview(),
  19668. d)
  19669. }
  19670. this.commit()
  19671. },
  19672. onClick: function(b) {
  19673. a.focus();
  19674. a.fire("saveSnapshot");
  19675. var b = g[b],
  19676. c = a.elementPath();
  19677. a[b.checkActive(c, a) ? "removeStyle" : "applyStyle"](b);
  19678. a.fire("saveSnapshot")
  19679. },
  19680. onRender: function() {
  19681. a.on("selectionChange", function(b) {
  19682. for(var c = this.getValue(), b = b.data.path.elements, d = 0, e = b.length, k; d < e; d++) {
  19683. k = b[d];
  19684. for(var n in g)
  19685. if(g[n].checkElementRemovable(k, true, a)) {
  19686. n != c && this.setValue(n);
  19687. return
  19688. }
  19689. }
  19690. this.setValue("")
  19691. }, this)
  19692. },
  19693. onOpen: function() {
  19694. var c = a.getSelection().getSelectedElement(),
  19695. c = a.elementPath(c),
  19696. d = [0, 0, 0, 0];
  19697. this.showAll();
  19698. this.unmarkAll();
  19699. for(var e in g) {
  19700. var i = g[e],
  19701. k = i._.type;
  19702. i.checkApplicable(c, a, a.activeFilter) ? d[k]++ : this.hideItem(e);
  19703. i.checkActive(c, a) && this.mark(e)
  19704. }
  19705. d[CKEDITOR.STYLE_BLOCK] || this.hideGroup(b["panelTitle" + CKEDITOR.STYLE_BLOCK]);
  19706. d[CKEDITOR.STYLE_INLINE] || this.hideGroup(b["panelTitle" + CKEDITOR.STYLE_INLINE]);
  19707. d[CKEDITOR.STYLE_OBJECT] || this.hideGroup(b["panelTitle" + CKEDITOR.STYLE_OBJECT])
  19708. },
  19709. refresh: function() {
  19710. var b = a.elementPath();
  19711. if(b) {
  19712. for(var c in g)
  19713. if(g[c].checkApplicable(b,
  19714. a, a.activeFilter)) return;
  19715. this.setState(CKEDITOR.TRISTATE_DISABLED)
  19716. }
  19717. },
  19718. reset: function() {
  19719. g = {};
  19720. c = []
  19721. }
  19722. })
  19723. }
  19724. })
  19725. }(),
  19726. function() {
  19727. function a(a) {
  19728. return {
  19729. editorFocus: false,
  19730. canUndo: false,
  19731. modes: {
  19732. wysiwyg: 1
  19733. },
  19734. exec: function(b) {
  19735. if(b.editable().hasFocus) {
  19736. var e = b.getSelection(),
  19737. f;
  19738. if(f = (new CKEDITOR.dom.elementPath(e.getCommonAncestor(), e.root)).contains({
  19739. td: 1,
  19740. th: 1
  19741. }, 1)) {
  19742. var e = b.createRange(),
  19743. g = CKEDITOR.tools.tryThese(function() {
  19744. var b = f.getParent().$.cells[f.$.cellIndex + (a ? -1 : 1)];
  19745. b.parentNode.parentNode;
  19746. return b
  19747. }, function() {
  19748. var b =
  19749. f.getParent(),
  19750. b = b.getAscendant("table").$.rows[b.$.rowIndex + (a ? -1 : 1)];
  19751. return b.cells[a ? b.cells.length - 1 : 0]
  19752. });
  19753. if(!g && !a) {
  19754. for(var i = f.getAscendant("table").$, g = f.getParent().$.cells, i = new CKEDITOR.dom.element(i.insertRow(-1), b.document), k = 0, n = g.length; k < n; k++) i.append((new CKEDITOR.dom.element(g[k], b.document)).clone(false, false)).appendBogus();
  19755. e.moveToElementEditStart(i)
  19756. } else if(g) {
  19757. g = new CKEDITOR.dom.element(g);
  19758. e.moveToElementEditStart(g);
  19759. (!e.checkStartOfBlock() || !e.checkEndOfBlock()) && e.selectNodeContents(g)
  19760. } else return true;
  19761. e.select(true);
  19762. return true
  19763. }
  19764. }
  19765. return false
  19766. }
  19767. }
  19768. }
  19769. var e = {
  19770. editorFocus: false,
  19771. modes: {
  19772. wysiwyg: 1,
  19773. source: 1
  19774. }
  19775. },
  19776. b = {
  19777. exec: function(a) {
  19778. a.container.focusNext(true, a.tabIndex)
  19779. }
  19780. },
  19781. g = {
  19782. exec: function(a) {
  19783. a.container.focusPrevious(true, a.tabIndex)
  19784. }
  19785. };
  19786. CKEDITOR.plugins.add("tab", {
  19787. init: function(c) {
  19788. for(var d = c.config.enableTabKeyTools !== false, j = c.config.tabSpaces || 0, f = ""; j--;) f = f + " ";
  19789. if(f) c.on("key", function(a) {
  19790. if(a.data.keyCode == 9) {
  19791. c.insertText(f);
  19792. a.cancel()
  19793. }
  19794. });
  19795. if(d) c.on("key", function(a) {
  19796. (a.data.keyCode == 9 && c.execCommand("selectNextCell") ||
  19797. a.data.keyCode == CKEDITOR.SHIFT + 9 && c.execCommand("selectPreviousCell")) && a.cancel()
  19798. });
  19799. c.addCommand("blur", CKEDITOR.tools.extend(b, e));
  19800. c.addCommand("blurBack", CKEDITOR.tools.extend(g, e));
  19801. c.addCommand("selectNextCell", a());
  19802. c.addCommand("selectPreviousCell", a(true))
  19803. }
  19804. })
  19805. }(), CKEDITOR.dom.element.prototype.focusNext = function(a, e) {
  19806. var b = e === void 0 ? this.getTabIndex() : e,
  19807. g, c, d, j, f, h;
  19808. if(b <= 0)
  19809. for(f = this.getNextSourceNode(a, CKEDITOR.NODE_ELEMENT); f;) {
  19810. if(f.isVisible() && f.getTabIndex() === 0) {
  19811. d = f;
  19812. break
  19813. }
  19814. f = f.getNextSourceNode(false,
  19815. CKEDITOR.NODE_ELEMENT)
  19816. } else
  19817. for(f = this.getDocument().getBody().getFirst(); f = f.getNextSourceNode(false, CKEDITOR.NODE_ELEMENT);) {
  19818. if(!g)
  19819. if(!c && f.equals(this)) {
  19820. c = true;
  19821. if(a) {
  19822. if(!(f = f.getNextSourceNode(true, CKEDITOR.NODE_ELEMENT))) break;
  19823. g = 1
  19824. }
  19825. } else c && !this.contains(f) && (g = 1);
  19826. if(f.isVisible() && !((h = f.getTabIndex()) < 0)) {
  19827. if(g && h == b) {
  19828. d = f;
  19829. break
  19830. }
  19831. if(h > b && (!d || !j || h < j)) {
  19832. d = f;
  19833. j = h
  19834. } else if(!d && h === 0) {
  19835. d = f;
  19836. j = h
  19837. }
  19838. }
  19839. }
  19840. d && d.focus()
  19841. }, CKEDITOR.dom.element.prototype.focusPrevious = function(a, e) {
  19842. for(var b = e === void 0 ? this.getTabIndex() :
  19843. e, g, c, d, j = 0, f, h = this.getDocument().getBody().getLast(); h = h.getPreviousSourceNode(false, CKEDITOR.NODE_ELEMENT);) {
  19844. if(!g)
  19845. if(!c && h.equals(this)) {
  19846. c = true;
  19847. if(a) {
  19848. if(!(h = h.getPreviousSourceNode(true, CKEDITOR.NODE_ELEMENT))) break;
  19849. g = 1
  19850. }
  19851. } else c && !this.contains(h) && (g = 1);
  19852. if(h.isVisible() && !((f = h.getTabIndex()) < 0))
  19853. if(b <= 0) {
  19854. if(g && f === 0) {
  19855. d = h;
  19856. break
  19857. }
  19858. if(f > j) {
  19859. d = h;
  19860. j = f
  19861. }
  19862. } else {
  19863. if(g && f == b) {
  19864. d = h;
  19865. break
  19866. }
  19867. if(f < b && (!d || f > j)) {
  19868. d = h;
  19869. j = f
  19870. }
  19871. }
  19872. }
  19873. d && d.focus()
  19874. }, CKEDITOR.plugins.add("table", {
  19875. requires: "dialog",
  19876. init: function(a) {
  19877. function e(a) {
  19878. return CKEDITOR.tools.extend(a || {}, {
  19879. contextSensitive: 1,
  19880. refresh: function(a, b) {
  19881. this.setState(b.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  19882. }
  19883. })
  19884. }
  19885. if(!a.blockless) {
  19886. var b = a.lang.table;
  19887. a.addCommand("table", new CKEDITOR.dialogCommand("table", {
  19888. context: "table",
  19889. allowedContent: "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];" + (a.plugins.dialogadvtab ? "table" + a.plugins.dialogadvtab.allowedContent() : ""),
  19890. requiredContent: "table",
  19891. contentTransformations: [
  19892. ["table{width}: sizeToStyle",
  19893. "table[width]: sizeToAttribute"
  19894. ]
  19895. ]
  19896. }));
  19897. a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", e()));
  19898. a.addCommand("tableDelete", e({
  19899. exec: function(a) {
  19900. var b = a.elementPath().contains("table", 1);
  19901. if(b) {
  19902. var d = b.getParent(),
  19903. e = a.editable();
  19904. d.getChildCount() == 1 && (!d.is("td", "th") && !d.equals(e)) && (b = d);
  19905. a = a.createRange();
  19906. a.moveToPosition(b, CKEDITOR.POSITION_BEFORE_START);
  19907. b.remove();
  19908. a.select()
  19909. }
  19910. }
  19911. }));
  19912. a.ui.addButton && a.ui.addButton("Table", {
  19913. label: b.toolbar,
  19914. command: "table",
  19915. toolbar: "insert,30"
  19916. });
  19917. CKEDITOR.dialog.add("table", this.path + "dialogs/table.js");
  19918. CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js");
  19919. a.addMenuItems && a.addMenuItems({
  19920. table: {
  19921. label: b.menu,
  19922. command: "tableProperties",
  19923. group: "table",
  19924. order: 5
  19925. },
  19926. tabledelete: {
  19927. label: b.deleteTable,
  19928. command: "tableDelete",
  19929. group: "table",
  19930. order: 1
  19931. }
  19932. });
  19933. a.on("doubleclick", function(a) {
  19934. if(a.data.element.is("table")) a.data.dialog = "tableProperties"
  19935. });
  19936. a.contextMenu && a.contextMenu.addListener(function() {
  19937. return {
  19938. tabledelete: CKEDITOR.TRISTATE_OFF,
  19939. table: CKEDITOR.TRISTATE_OFF
  19940. }
  19941. })
  19942. }
  19943. }
  19944. }),
  19945. function() {
  19946. function a(a) {
  19947. function b(a) {
  19948. if(!(c.length > 0) && a.type == CKEDITOR.NODE_ELEMENT && o.test(a.getName()) && !a.getCustomData("selected_cell")) {
  19949. CKEDITOR.dom.element.setMarker(d, a, "selected_cell", true);
  19950. c.push(a)
  19951. }
  19952. }
  19953. for(var a = a.getRanges(), c = [], d = {}, f = 0; f < a.length; f++) {
  19954. var e = a[f];
  19955. if(e.collapsed) {
  19956. e = e.getCommonAncestor();
  19957. (e = e.getAscendant("td", true) || e.getAscendant("th", true)) && c.push(e)
  19958. } else {
  19959. var e = new CKEDITOR.dom.walker(e),
  19960. g;
  19961. for(e.guard = b; g = e.next();)
  19962. if(g.type != CKEDITOR.NODE_ELEMENT || !g.is(CKEDITOR.dtd.table))
  19963. if((g =
  19964. g.getAscendant("td", true) || g.getAscendant("th", true)) && !g.getCustomData("selected_cell")) {
  19965. CKEDITOR.dom.element.setMarker(d, g, "selected_cell", true);
  19966. c.push(g)
  19967. }
  19968. }
  19969. }
  19970. CKEDITOR.dom.element.clearAllMarkers(d);
  19971. return c
  19972. }
  19973. function e(b, c) {
  19974. for(var d = a(b), f = d[0], e = f.getAscendant("table"), f = f.getDocument(), g = d[0].getParent(), h = g.$.rowIndex, d = d[d.length - 1], i = d.getParent().$.rowIndex + d.$.rowSpan - 1, d = new CKEDITOR.dom.element(e.$.rows[i]), h = c ? h : i, g = c ? g : d, d = CKEDITOR.tools.buildTableMap(e), e = d[h], h = c ? d[h - 1] : d[h + 1], d = d[0].length,
  19975. f = f.createElement("tr"), i = 0; e[i] && i < d; i++) {
  19976. var j;
  19977. if(e[i].rowSpan > 1 && h && e[i] == h[i]) {
  19978. j = e[i];
  19979. j.rowSpan = j.rowSpan + 1
  19980. } else {
  19981. j = (new CKEDITOR.dom.element(e[i])).clone();
  19982. j.removeAttribute("rowSpan");
  19983. j.appendBogus();
  19984. f.append(j);
  19985. j = j.$
  19986. }
  19987. i = i + (j.colSpan - 1)
  19988. }
  19989. c ? f.insertBefore(g) : f.insertAfter(g)
  19990. }
  19991. function b(c) {
  19992. if(c instanceof CKEDITOR.dom.selection) {
  19993. for(var d = a(c), f = d[0].getAscendant("table"), e = CKEDITOR.tools.buildTableMap(f), c = d[0].getParent().$.rowIndex, d = d[d.length - 1], g = d.getParent().$.rowIndex + d.$.rowSpan - 1, d = [],
  19994. h = c; h <= g; h++) {
  19995. for(var i = e[h], j = new CKEDITOR.dom.element(f.$.rows[h]), k = 0; k < i.length; k++) {
  19996. var n = new CKEDITOR.dom.element(i[k]),
  19997. o = n.getParent().$.rowIndex;
  19998. if(n.$.rowSpan == 1) n.remove();
  19999. else {
  20000. n.$.rowSpan = n.$.rowSpan - 1;
  20001. if(o == h) {
  20002. o = e[h + 1];
  20003. o[k - 1] ? n.insertAfter(new CKEDITOR.dom.element(o[k - 1])) : (new CKEDITOR.dom.element(f.$.rows[h + 1])).append(n, 1)
  20004. }
  20005. }
  20006. k = k + (n.$.colSpan - 1)
  20007. }
  20008. d.push(j)
  20009. }
  20010. e = f.$.rows;
  20011. f = new CKEDITOR.dom.element(e[g + 1] || (c > 0 ? e[c - 1] : null) || f.$.parentNode);
  20012. for(h = d.length; h >= 0; h--) b(d[h]);
  20013. return f
  20014. }
  20015. if(c instanceof CKEDITOR.dom.element) {
  20016. f = c.getAscendant("table");
  20017. f.$.rows.length == 1 ? f.remove() : c.remove()
  20018. }
  20019. return null
  20020. }
  20021. function g(a, b) {
  20022. for(var c = b ? Infinity : 0, d = 0; d < a.length; d++) {
  20023. var f;
  20024. f = a[d];
  20025. for(var e = b, g = f.getParent().$.cells, h = 0, i = 0; i < g.length; i++) {
  20026. var j = g[i],
  20027. h = h + (e ? 1 : j.colSpan);
  20028. if(j == f.$) break
  20029. }
  20030. f = h - 1;
  20031. if(b ? f < c : f > c) c = f
  20032. }
  20033. return c
  20034. }
  20035. function c(b, c) {
  20036. for(var d = a(b), f = d[0].getAscendant("table"), e = g(d, 1), d = g(d), e = c ? e : d, h = CKEDITOR.tools.buildTableMap(f), f = [], d = [], i = h.length, j = 0; j < i; j++) {
  20037. f.push(h[j][e]);
  20038. d.push(c ? h[j][e - 1] : h[j][e +
  20039. 1
  20040. ])
  20041. }
  20042. for(j = 0; j < i; j++)
  20043. if(f[j]) {
  20044. if(f[j].colSpan > 1 && d[j] == f[j]) {
  20045. e = f[j];
  20046. e.colSpan = e.colSpan + 1
  20047. } else {
  20048. e = (new CKEDITOR.dom.element(f[j])).clone();
  20049. e.removeAttribute("colSpan");
  20050. e.appendBogus();
  20051. e[c ? "insertBefore" : "insertAfter"].call(e, new CKEDITOR.dom.element(f[j]));
  20052. e = e.$
  20053. }
  20054. j = j + (e.rowSpan - 1)
  20055. }
  20056. }
  20057. function d(a, b) {
  20058. var c = a.getStartElement();
  20059. if(c = c.getAscendant("td", 1) || c.getAscendant("th", 1)) {
  20060. var d = c.clone();
  20061. d.appendBogus();
  20062. b ? d.insertBefore(c) : d.insertAfter(c)
  20063. }
  20064. }
  20065. function j(b) {
  20066. if(b instanceof CKEDITOR.dom.selection) {
  20067. var b =
  20068. a(b),
  20069. c = b[0] && b[0].getAscendant("table"),
  20070. d;
  20071. a: {
  20072. var e = 0;d = b.length - 1;
  20073. for(var g = {}, h, i; h = b[e++];) CKEDITOR.dom.element.setMarker(g, h, "delete_cell", true);
  20074. for(e = 0; h = b[e++];)
  20075. if((i = h.getPrevious()) && !i.getCustomData("delete_cell") || (i = h.getNext()) && !i.getCustomData("delete_cell")) {
  20076. CKEDITOR.dom.element.clearAllMarkers(g);
  20077. d = i;
  20078. break a
  20079. }
  20080. CKEDITOR.dom.element.clearAllMarkers(g);i = b[0].getParent();
  20081. if(i = i.getPrevious()) d = i.getLast();
  20082. else {
  20083. i = b[d].getParent();
  20084. d = (i = i.getNext()) ? i.getChild(0) : null
  20085. }
  20086. }
  20087. for(i = b.length - 1; i >=
  20088. 0; i--) j(b[i]);
  20089. d ? f(d, true) : c && c.remove()
  20090. } else if(b instanceof CKEDITOR.dom.element) {
  20091. c = b.getParent();
  20092. c.getChildCount() == 1 ? c.remove() : b.remove()
  20093. }
  20094. }
  20095. function f(a, b) {
  20096. var c = a.getDocument(),
  20097. d = CKEDITOR.document;
  20098. if(CKEDITOR.env.ie && CKEDITOR.env.version == 10) {
  20099. d.focus();
  20100. c.focus()
  20101. }
  20102. c = new CKEDITOR.dom.range(c);
  20103. if(!c["moveToElementEdit" + (b ? "End" : "Start")](a)) {
  20104. c.selectNodeContents(a);
  20105. c.collapse(b ? false : true)
  20106. }
  20107. c.select(true)
  20108. }
  20109. function h(a, b, c) {
  20110. a = a[b];
  20111. if(typeof c == "undefined") return a;
  20112. for(b = 0; a && b < a.length; b++) {
  20113. if(c.is &&
  20114. a[b] == c.$) return b;
  20115. if(b == c) return new CKEDITOR.dom.element(a[b])
  20116. }
  20117. return c.is ? -1 : null
  20118. }
  20119. function i(b, c, d) {
  20120. var f = a(b),
  20121. e;
  20122. if((c ? f.length != 1 : f.length < 2) || (e = b.getCommonAncestor()) && e.type == CKEDITOR.NODE_ELEMENT && e.is("table")) return false;
  20123. var g, b = f[0];
  20124. e = b.getAscendant("table");
  20125. var i = CKEDITOR.tools.buildTableMap(e),
  20126. j = i.length,
  20127. k = i[0].length,
  20128. n = b.getParent().$.rowIndex,
  20129. o = h(i, n, b);
  20130. if(c) {
  20131. var y;
  20132. try {
  20133. var z = parseInt(b.getAttribute("rowspan"), 10) || 1;
  20134. g = parseInt(b.getAttribute("colspan"), 10) || 1;
  20135. y = i[c == "up" ? n - z : c == "down" ?
  20136. n + z : n][c == "left" ? o - g : c == "right" ? o + g : o]
  20137. } catch(B) {
  20138. return false
  20139. }
  20140. if(!y || b.$ == y) return false;
  20141. f[c == "up" || c == "left" ? "unshift" : "push"](new CKEDITOR.dom.element(y))
  20142. }
  20143. for(var c = b.getDocument(), A = n, z = y = 0, G = !d && new CKEDITOR.dom.documentFragment(c), D = 0, c = 0; c < f.length; c++) {
  20144. g = f[c];
  20145. var J = g.getParent(),
  20146. C = g.getFirst(),
  20147. F = g.$.colSpan,
  20148. E = g.$.rowSpan,
  20149. J = J.$.rowIndex,
  20150. I = h(i, J, g),
  20151. D = D + F * E,
  20152. z = Math.max(z, I - o + F);
  20153. y = Math.max(y, J - n + E);
  20154. if(!d) {
  20155. F = g;
  20156. (E = F.getBogus()) && E.remove();
  20157. F.trim();
  20158. if(g.getChildren().count()) {
  20159. if(J != A && C && (!C.isBlockBoundary ||
  20160. !C.isBlockBoundary({
  20161. br: 1
  20162. })))(A = G.getLast(CKEDITOR.dom.walker.whitespaces(true))) && (!A.is || !A.is("br")) && G.append("br");
  20163. g.moveChildren(G)
  20164. }
  20165. c ? g.remove() : g.setHtml("")
  20166. }
  20167. A = J
  20168. }
  20169. if(d) return y * z == D;
  20170. G.moveChildren(b);
  20171. b.appendBogus();
  20172. z >= k ? b.removeAttribute("rowSpan") : b.$.rowSpan = y;
  20173. y >= j ? b.removeAttribute("colSpan") : b.$.colSpan = z;
  20174. d = new CKEDITOR.dom.nodeList(e.$.rows);
  20175. f = d.count();
  20176. for(c = f - 1; c >= 0; c--) {
  20177. e = d.getItem(c);
  20178. if(!e.$.cells.length) {
  20179. e.remove();
  20180. f++
  20181. }
  20182. }
  20183. return b
  20184. }
  20185. function k(b, c) {
  20186. var d = a(b);
  20187. if(d.length > 1) return false;
  20188. if(c) return true;
  20189. var d = d[0],
  20190. f = d.getParent(),
  20191. e = f.getAscendant("table"),
  20192. g = CKEDITOR.tools.buildTableMap(e),
  20193. i = f.$.rowIndex,
  20194. j = h(g, i, d),
  20195. k = d.$.rowSpan,
  20196. n;
  20197. if(k > 1) {
  20198. n = Math.ceil(k / 2);
  20199. for(var k = Math.floor(k / 2), f = i + n, e = new CKEDITOR.dom.element(e.$.rows[f]), g = h(g, f), o, f = d.clone(), i = 0; i < g.length; i++) {
  20200. o = g[i];
  20201. if(o.parentNode == e.$ && i > j) {
  20202. f.insertBefore(new CKEDITOR.dom.element(o));
  20203. break
  20204. } else o = null
  20205. }
  20206. o || e.append(f)
  20207. } else {
  20208. k = n = 1;
  20209. e = f.clone();
  20210. e.insertAfter(f);
  20211. e.append(f = d.clone());
  20212. o = h(g, i);
  20213. for(j = 0; j < o.length; j++) o[j].rowSpan++
  20214. }
  20215. f.appendBogus();
  20216. d.$.rowSpan = n;
  20217. f.$.rowSpan = k;
  20218. n == 1 && d.removeAttribute("rowSpan");
  20219. k == 1 && f.removeAttribute("rowSpan");
  20220. return f
  20221. }
  20222. function n(b, c) {
  20223. var d = a(b);
  20224. if(d.length > 1) return false;
  20225. if(c) return true;
  20226. var d = d[0],
  20227. f = d.getParent(),
  20228. e = f.getAscendant("table"),
  20229. e = CKEDITOR.tools.buildTableMap(e),
  20230. g = h(e, f.$.rowIndex, d),
  20231. i = d.$.colSpan;
  20232. if(i > 1) {
  20233. f = Math.ceil(i / 2);
  20234. i = Math.floor(i / 2)
  20235. } else {
  20236. for(var i = f = 1, j = [], k = 0; k < e.length; k++) {
  20237. var n = e[k];
  20238. j.push(n[g]);
  20239. n[g].rowSpan > 1 && (k = k + (n[g].rowSpan - 1))
  20240. }
  20241. for(e = 0; e < j.length; e++) j[e].colSpan++
  20242. }
  20243. e = d.clone();
  20244. e.insertAfter(d);
  20245. e.appendBogus();
  20246. d.$.colSpan = f;
  20247. e.$.colSpan = i;
  20248. f == 1 && d.removeAttribute("colSpan");
  20249. i == 1 && e.removeAttribute("colSpan");
  20250. return e
  20251. }
  20252. var o = /^(?:td|th)$/;
  20253. CKEDITOR.plugins.tabletools = {
  20254. requires: "table,dialog,contextmenu",
  20255. init: function(g) {
  20256. function h(a) {
  20257. return CKEDITOR.tools.extend(a || {}, {
  20258. contextSensitive: 1,
  20259. refresh: function(a, b) {
  20260. this.setState(b.contains({
  20261. td: 1,
  20262. th: 1
  20263. }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  20264. }
  20265. })
  20266. }
  20267. function l(a, b) {
  20268. var c = g.addCommand(a, b);
  20269. g.addFeature(c)
  20270. }
  20271. var o = g.lang.table;
  20272. l("cellProperties", new CKEDITOR.dialogCommand("cellProperties", h({
  20273. allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",
  20274. requiredContent: "table"
  20275. })));
  20276. CKEDITOR.dialog.add("cellProperties", this.path + "dialogs/tableCell.js");
  20277. l("rowDelete", h({
  20278. requiredContent: "table",
  20279. exec: function(a) {
  20280. a = a.getSelection();
  20281. f(b(a))
  20282. }
  20283. }));
  20284. l("rowInsertBefore", h({
  20285. requiredContent: "table",
  20286. exec: function(a) {
  20287. a = a.getSelection();
  20288. e(a, true)
  20289. }
  20290. }));
  20291. l("rowInsertAfter", h({
  20292. requiredContent: "table",
  20293. exec: function(a) {
  20294. a = a.getSelection();
  20295. e(a)
  20296. }
  20297. }));
  20298. l("columnDelete", h({
  20299. requiredContent: "table",
  20300. exec: function(b) {
  20301. for(var b = b.getSelection(), b = a(b), c = b[0], d = b[b.length - 1], b = c.getAscendant("table"), e = CKEDITOR.tools.buildTableMap(b), g, h, i = [], j = 0, k = e.length; j < k; j++)
  20302. for(var m = 0, l = e[j].length; m < l; m++) {
  20303. e[j][m] == c.$ && (g = m);
  20304. e[j][m] == d.$ && (h = m)
  20305. }
  20306. for(j = g; j <= h; j++)
  20307. for(m = 0; m < e.length; m++) {
  20308. d = e[m];
  20309. c = new CKEDITOR.dom.element(b.$.rows[m]);
  20310. d = new CKEDITOR.dom.element(d[j]);
  20311. if(d.$) {
  20312. d.$.colSpan == 1 ? d.remove() : d.$.colSpan = d.$.colSpan -
  20313. 1;
  20314. m = m + (d.$.rowSpan - 1);
  20315. c.$.cells.length || i.push(c)
  20316. }
  20317. }
  20318. h = b.$.rows[0] && b.$.rows[0].cells;
  20319. g = new CKEDITOR.dom.element(h[g] || (g ? h[g - 1] : b.$.parentNode));
  20320. i.length == k && b.remove();
  20321. g && f(g, true)
  20322. }
  20323. }));
  20324. l("columnInsertBefore", h({
  20325. requiredContent: "table",
  20326. exec: function(a) {
  20327. a = a.getSelection();
  20328. c(a, true)
  20329. }
  20330. }));
  20331. l("columnInsertAfter", h({
  20332. requiredContent: "table",
  20333. exec: function(a) {
  20334. a = a.getSelection();
  20335. c(a)
  20336. }
  20337. }));
  20338. l("cellDelete", h({
  20339. requiredContent: "table",
  20340. exec: function(a) {
  20341. a = a.getSelection();
  20342. j(a)
  20343. }
  20344. }));
  20345. l("cellMerge", h({
  20346. allowedContent: "td[colspan,rowspan]",
  20347. requiredContent: "td[colspan,rowspan]",
  20348. exec: function(a) {
  20349. f(i(a.getSelection()), true)
  20350. }
  20351. }));
  20352. l("cellMergeRight", h({
  20353. allowedContent: "td[colspan]",
  20354. requiredContent: "td[colspan]",
  20355. exec: function(a) {
  20356. f(i(a.getSelection(), "right"), true)
  20357. }
  20358. }));
  20359. l("cellMergeDown", h({
  20360. allowedContent: "td[rowspan]",
  20361. requiredContent: "td[rowspan]",
  20362. exec: function(a) {
  20363. f(i(a.getSelection(), "down"), true)
  20364. }
  20365. }));
  20366. l("cellVerticalSplit", h({
  20367. allowedContent: "td[rowspan]",
  20368. requiredContent: "td[rowspan]",
  20369. exec: function(a) {
  20370. f(k(a.getSelection()))
  20371. }
  20372. }));
  20373. l("cellHorizontalSplit",
  20374. h({
  20375. allowedContent: "td[colspan]",
  20376. requiredContent: "td[colspan]",
  20377. exec: function(a) {
  20378. f(n(a.getSelection()))
  20379. }
  20380. }));
  20381. l("cellInsertBefore", h({
  20382. requiredContent: "table",
  20383. exec: function(a) {
  20384. a = a.getSelection();
  20385. d(a, true)
  20386. }
  20387. }));
  20388. l("cellInsertAfter", h({
  20389. requiredContent: "table",
  20390. exec: function(a) {
  20391. a = a.getSelection();
  20392. d(a)
  20393. }
  20394. }));
  20395. g.addMenuItems && g.addMenuItems({
  20396. tablecell: {
  20397. label: o.cell.menu,
  20398. group: "tablecell",
  20399. order: 1,
  20400. getItems: function() {
  20401. var b = g.getSelection(),
  20402. c = a(b);
  20403. return {
  20404. tablecell_insertBefore: CKEDITOR.TRISTATE_OFF,
  20405. tablecell_insertAfter: CKEDITOR.TRISTATE_OFF,
  20406. tablecell_delete: CKEDITOR.TRISTATE_OFF,
  20407. tablecell_merge: i(b, null, true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  20408. tablecell_merge_right: i(b, "right", true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  20409. tablecell_merge_down: i(b, "down", true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  20410. tablecell_split_vertical: k(b, true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  20411. tablecell_split_horizontal: n(b, true) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  20412. tablecell_properties: c.length > 0 ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  20413. }
  20414. }
  20415. },
  20416. tablecell_insertBefore: {
  20417. label: o.cell.insertBefore,
  20418. group: "tablecell",
  20419. command: "cellInsertBefore",
  20420. order: 5
  20421. },
  20422. tablecell_insertAfter: {
  20423. label: o.cell.insertAfter,
  20424. group: "tablecell",
  20425. command: "cellInsertAfter",
  20426. order: 10
  20427. },
  20428. tablecell_delete: {
  20429. label: o.cell.deleteCell,
  20430. group: "tablecell",
  20431. command: "cellDelete",
  20432. order: 15
  20433. },
  20434. tablecell_merge: {
  20435. label: o.cell.merge,
  20436. group: "tablecell",
  20437. command: "cellMerge",
  20438. order: 16
  20439. },
  20440. tablecell_merge_right: {
  20441. label: o.cell.mergeRight,
  20442. group: "tablecell",
  20443. command: "cellMergeRight",
  20444. order: 17
  20445. },
  20446. tablecell_merge_down: {
  20447. label: o.cell.mergeDown,
  20448. group: "tablecell",
  20449. command: "cellMergeDown",
  20450. order: 18
  20451. },
  20452. tablecell_split_horizontal: {
  20453. label: o.cell.splitHorizontal,
  20454. group: "tablecell",
  20455. command: "cellHorizontalSplit",
  20456. order: 19
  20457. },
  20458. tablecell_split_vertical: {
  20459. label: o.cell.splitVertical,
  20460. group: "tablecell",
  20461. command: "cellVerticalSplit",
  20462. order: 20
  20463. },
  20464. tablecell_properties: {
  20465. label: o.cell.title,
  20466. group: "tablecellproperties",
  20467. command: "cellProperties",
  20468. order: 21
  20469. },
  20470. tablerow: {
  20471. label: o.row.menu,
  20472. group: "tablerow",
  20473. order: 1,
  20474. getItems: function() {
  20475. return {
  20476. tablerow_insertBefore: CKEDITOR.TRISTATE_OFF,
  20477. tablerow_insertAfter: CKEDITOR.TRISTATE_OFF,
  20478. tablerow_delete: CKEDITOR.TRISTATE_OFF
  20479. }
  20480. }
  20481. },
  20482. tablerow_insertBefore: {
  20483. label: o.row.insertBefore,
  20484. group: "tablerow",
  20485. command: "rowInsertBefore",
  20486. order: 5
  20487. },
  20488. tablerow_insertAfter: {
  20489. label: o.row.insertAfter,
  20490. group: "tablerow",
  20491. command: "rowInsertAfter",
  20492. order: 10
  20493. },
  20494. tablerow_delete: {
  20495. label: o.row.deleteRow,
  20496. group: "tablerow",
  20497. command: "rowDelete",
  20498. order: 15
  20499. },
  20500. tablecolumn: {
  20501. label: o.column.menu,
  20502. group: "tablecolumn",
  20503. order: 1,
  20504. getItems: function() {
  20505. return {
  20506. tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF,
  20507. tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF,
  20508. tablecolumn_delete: CKEDITOR.TRISTATE_OFF
  20509. }
  20510. }
  20511. },
  20512. tablecolumn_insertBefore: {
  20513. label: o.column.insertBefore,
  20514. group: "tablecolumn",
  20515. command: "columnInsertBefore",
  20516. order: 5
  20517. },
  20518. tablecolumn_insertAfter: {
  20519. label: o.column.insertAfter,
  20520. group: "tablecolumn",
  20521. command: "columnInsertAfter",
  20522. order: 10
  20523. },
  20524. tablecolumn_delete: {
  20525. label: o.column.deleteColumn,
  20526. group: "tablecolumn",
  20527. command: "columnDelete",
  20528. order: 15
  20529. }
  20530. });
  20531. g.contextMenu && g.contextMenu.addListener(function(a, b, c) {
  20532. return(a = c.contains({
  20533. td: 1,
  20534. th: 1
  20535. },
  20536. 1)) && !a.isReadOnly() ? {
  20537. tablecell: CKEDITOR.TRISTATE_OFF,
  20538. tablerow: CKEDITOR.TRISTATE_OFF,
  20539. tablecolumn: CKEDITOR.TRISTATE_OFF
  20540. } : null
  20541. })
  20542. },
  20543. getSelectedCells: a
  20544. };
  20545. CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools)
  20546. }(), CKEDITOR.tools.buildTableMap = function(a) {
  20547. for(var a = a.$.rows, e = -1, b = [], g = 0; g < a.length; g++) {
  20548. e++;
  20549. !b[e] && (b[e] = []);
  20550. for(var c = -1, d = 0; d < a[g].cells.length; d++) {
  20551. var j = a[g].cells[d];
  20552. for(c++; b[e][c];) c++;
  20553. for(var f = isNaN(j.colSpan) ? 1 : j.colSpan, j = isNaN(j.rowSpan) ? 1 : j.rowSpan, h = 0; h < j; h++) {
  20554. b[e + h] || (b[e +
  20555. h] = []);
  20556. for(var i = 0; i < f; i++) b[e + h][c + i] = a[g].cells[d]
  20557. }
  20558. c = c + (f - 1)
  20559. }
  20560. }
  20561. return b
  20562. },
  20563. function() {
  20564. function a(a) {
  20565. function b() {
  20566. for(var d = g(), h = CKEDITOR.tools.clone(a.config.toolbarGroups) || e(a), i = 0; i < h.length; i++) {
  20567. var k = h[i];
  20568. if(k != "/") {
  20569. typeof k == "string" && (k = h[i] = {
  20570. name: k
  20571. });
  20572. var l, p = k.groups;
  20573. if(p)
  20574. for(var t = 0; t < p.length; t++) {
  20575. l = p[t];
  20576. (l = d[l]) && f(k, l)
  20577. }(l = d[k.name]) && f(k, l)
  20578. }
  20579. }
  20580. return h
  20581. }
  20582. function g() {
  20583. var b = {},
  20584. d, f, e;
  20585. for(d in a.ui.items) {
  20586. f = a.ui.items[d];
  20587. e = f.toolbar || "others";
  20588. e = e.split(",");
  20589. f = e[0];
  20590. e = parseInt(e[1] || -1, 10);
  20591. b[f] ||
  20592. (b[f] = []);
  20593. b[f].push({
  20594. name: d,
  20595. order: e
  20596. })
  20597. }
  20598. for(f in b) b[f] = b[f].sort(function(a, b) {
  20599. return a.order == b.order ? 0 : b.order < 0 ? -1 : a.order < 0 ? 1 : a.order < b.order ? -1 : 1
  20600. });
  20601. return b
  20602. }
  20603. function f(b, d) {
  20604. if(d.length) {
  20605. b.items ? b.items.push(a.ui.create("-")) : b.items = [];
  20606. for(var f; f = d.shift();) {
  20607. f = typeof f == "string" ? f : f.name;
  20608. if(!i || CKEDITOR.tools.indexOf(i, f) == -1)(f = a.ui.create(f)) && a.addFeature(f) && b.items.push(f)
  20609. }
  20610. }
  20611. }
  20612. function h(a) {
  20613. var b = [],
  20614. c, d, e;
  20615. for(c = 0; c < a.length; ++c) {
  20616. d = a[c];
  20617. e = {};
  20618. if(d == "/") b.push(d);
  20619. else if(CKEDITOR.tools.isArray(d)) {
  20620. f(e,
  20621. CKEDITOR.tools.clone(d));
  20622. b.push(e)
  20623. } else if(d.items) {
  20624. f(e, CKEDITOR.tools.clone(d.items));
  20625. e.name = d.name;
  20626. b.push(e)
  20627. }
  20628. }
  20629. return b
  20630. }
  20631. var i = a.config.removeButtons,
  20632. i = i && i.split(","),
  20633. k = a.config.toolbar;
  20634. typeof k == "string" && (k = a.config["toolbar_" + k]);
  20635. return a.toolbar = k ? h(k) : b()
  20636. }
  20637. function e(a) {
  20638. return a._.toolbarGroups || (a._.toolbarGroups = [{
  20639. name: "document",
  20640. groups: ["mode", "document", "doctools"]
  20641. }, {
  20642. name: "clipboard",
  20643. groups: ["clipboard", "undo"]
  20644. }, {
  20645. name: "editing",
  20646. groups: ["find", "selection", "spellchecker"]
  20647. }, {
  20648. name: "forms"
  20649. }, "/", {
  20650. name: "basicstyles",
  20651. groups: ["basicstyles", "cleanup"]
  20652. }, {
  20653. name: "paragraph",
  20654. groups: ["list", "indent", "blocks", "align", "bidi"]
  20655. }, {
  20656. name: "links"
  20657. }, {
  20658. name: "insert"
  20659. }, "/", {
  20660. name: "styles"
  20661. }, {
  20662. name: "colors"
  20663. }, {
  20664. name: "tools"
  20665. }, {
  20666. name: "others"
  20667. }, {
  20668. name: "about"
  20669. }])
  20670. }
  20671. var b = function() {
  20672. this.toolbars = [];
  20673. this.focusCommandExecuted = false
  20674. };
  20675. b.prototype.focus = function() {
  20676. for(var a = 0, b; b = this.toolbars[a++];)
  20677. for(var e = 0, f; f = b.items[e++];)
  20678. if(f.focus) {
  20679. f.focus();
  20680. return
  20681. }
  20682. };
  20683. var g = {
  20684. modes: {
  20685. wysiwyg: 1,
  20686. source: 1
  20687. },
  20688. readOnly: 1,
  20689. exec: function(a) {
  20690. if(a.toolbox) {
  20691. a.toolbox.focusCommandExecuted =
  20692. true;
  20693. CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() {
  20694. a.toolbox.focus()
  20695. }, 100) : a.toolbox.focus()
  20696. }
  20697. }
  20698. };
  20699. CKEDITOR.plugins.add("toolbar", {
  20700. requires: "button",
  20701. init: function(c) {
  20702. var d, e = function(a, b) {
  20703. var g, k = c.lang.dir == "rtl",
  20704. n = c.config.toolbarGroupCycling,
  20705. o = k ? 37 : 39,
  20706. k = k ? 39 : 37,
  20707. n = n === void 0 || n;
  20708. switch(b) {
  20709. case 9:
  20710. case CKEDITOR.SHIFT + 9:
  20711. for(; !g || !g.items.length;) {
  20712. g = b == 9 ? (g ? g.next : a.toolbar.next) || c.toolbox.toolbars[0] : (g ? g.previous : a.toolbar.previous) || c.toolbox.toolbars[c.toolbox.toolbars.length - 1];
  20713. if(g.items.length)
  20714. for(a =
  20715. g.items[d ? g.items.length - 1 : 0]; a && !a.focus;)(a = d ? a.previous : a.next) || (g = 0)
  20716. }
  20717. a && a.focus();
  20718. return false;
  20719. case o:
  20720. g = a;
  20721. do {
  20722. g = g.next;
  20723. !g && n && (g = a.toolbar.items[0])
  20724. } while (g && !g.focus);
  20725. g ? g.focus() : e(a, 9);
  20726. return false;
  20727. case 40:
  20728. if(a.button && a.button.hasArrow) {
  20729. c.once("panelShow", function(a) {
  20730. a.data._.panel._.currentBlock.onKeyDown(40)
  20731. });
  20732. a.execute()
  20733. } else e(a, b == 40 ? o : k);
  20734. return false;
  20735. case k:
  20736. case 38:
  20737. g = a;
  20738. do {
  20739. g = g.previous;
  20740. !g && n && (g = a.toolbar.items[a.toolbar.items.length - 1])
  20741. } while (g && !g.focus);
  20742. if(g) g.focus();
  20743. else {
  20744. d = 1;
  20745. e(a,
  20746. CKEDITOR.SHIFT + 9);
  20747. d = 0
  20748. }
  20749. return false;
  20750. case 27:
  20751. c.focus();
  20752. return false;
  20753. case 13:
  20754. case 32:
  20755. a.execute();
  20756. return false
  20757. }
  20758. return true
  20759. };
  20760. c.on("uiSpace", function(d) {
  20761. if(d.data.space == c.config.toolbarLocation) {
  20762. d.removeListener();
  20763. c.toolbox = new b;
  20764. var g = CKEDITOR.tools.getNextId(),
  20765. i = ['<span id="', g, '" class="cke_voice_label">', c.lang.toolbar.toolbars, "</span>", '<span id="' + c.ui.spaceId("toolbox") + '" class="cke_toolbox" role="group" aria-labelledby="', g, '" onmousedown="return false;">'],
  20766. g = c.config.toolbarStartupExpanded !==
  20767. false,
  20768. k, n;
  20769. c.config.toolbarCanCollapse && c.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && i.push('<span class="cke_toolbox_main"' + (g ? ">" : ' style="display:none">'));
  20770. for(var o = c.toolbox.toolbars, q = a(c), m = 0; m < q.length; m++) {
  20771. var l, p = 0,
  20772. t, s = q[m],
  20773. u;
  20774. if(s) {
  20775. if(k) {
  20776. i.push("</span>");
  20777. n = k = 0
  20778. }
  20779. if(s === "/") i.push('<span class="cke_toolbar_break"></span>');
  20780. else {
  20781. u = s.items || s;
  20782. for(var w = 0; w < u.length; w++) {
  20783. var x = u[w],
  20784. v;
  20785. if(x)
  20786. if(x.type == CKEDITOR.UI_SEPARATOR) n = k && x;
  20787. else {
  20788. v = x.canGroup !== false;
  20789. if(!p) {
  20790. l = CKEDITOR.tools.getNextId();
  20791. p = {
  20792. id: l,
  20793. items: []
  20794. };
  20795. t = s.name && (c.lang.toolbar.toolbarGroups[s.name] || s.name);
  20796. i.push('<span id="', l, '" class="cke_toolbar"', t ? ' aria-labelledby="' + l + '_label"' : "", ' role="toolbar">');
  20797. t && i.push('<span id="', l, '_label" class="cke_voice_label">', t, "</span>");
  20798. i.push('<span class="cke_toolbar_start"></span>');
  20799. var r = o.push(p) - 1;
  20800. if(r > 0) {
  20801. p.previous = o[r - 1];
  20802. p.previous.next = p
  20803. }
  20804. }
  20805. if(v) {
  20806. if(!k) {
  20807. i.push('<span class="cke_toolgroup" role="presentation">');
  20808. k = 1
  20809. }
  20810. } else if(k) {
  20811. i.push("</span>");
  20812. k = 0
  20813. }
  20814. l = function(a) {
  20815. a = a.render(c, i);
  20816. r = p.items.push(a) -
  20817. 1;
  20818. if(r > 0) {
  20819. a.previous = p.items[r - 1];
  20820. a.previous.next = a
  20821. }
  20822. a.toolbar = p;
  20823. a.onkey = e;
  20824. a.onfocus = function() {
  20825. c.toolbox.focusCommandExecuted || c.focus()
  20826. }
  20827. };
  20828. if(n) {
  20829. l(n);
  20830. n = 0
  20831. }
  20832. l(x)
  20833. }
  20834. }
  20835. if(k) {
  20836. i.push("</span>");
  20837. n = k = 0
  20838. }
  20839. p && i.push('<span class="cke_toolbar_end"></span></span>')
  20840. }
  20841. }
  20842. }
  20843. c.config.toolbarCanCollapse && i.push("</span>");
  20844. if(c.config.toolbarCanCollapse && c.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  20845. var y = CKEDITOR.tools.addFunction(function() {
  20846. c.execCommand("toolbarCollapse")
  20847. });
  20848. c.on("destroy", function() {
  20849. CKEDITOR.tools.removeFunction(y)
  20850. });
  20851. c.addCommand("toolbarCollapse", {
  20852. readOnly: 1,
  20853. exec: function(a) {
  20854. var b = a.ui.space("toolbar_collapser"),
  20855. c = b.getPrevious(),
  20856. d = a.ui.space("contents"),
  20857. f = c.getParent(),
  20858. e = parseInt(d.$.style.height, 10),
  20859. g = f.$.offsetHeight,
  20860. h = b.hasClass("cke_toolbox_collapser_min");
  20861. if(h) {
  20862. c.show();
  20863. b.removeClass("cke_toolbox_collapser_min");
  20864. b.setAttribute("title", a.lang.toolbar.toolbarCollapse)
  20865. } else {
  20866. c.hide();
  20867. b.addClass("cke_toolbox_collapser_min");
  20868. b.setAttribute("title", a.lang.toolbar.toolbarExpand)
  20869. }
  20870. b.getFirst().setText(h ? "▲" : "◀");
  20871. d.setStyle("height", e - (f.$.offsetHeight - g) + "px");
  20872. a.fire("resize")
  20873. },
  20874. modes: {
  20875. wysiwyg: 1,
  20876. source: 1
  20877. }
  20878. });
  20879. c.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse");
  20880. i.push('<a title="' + (g ? c.lang.toolbar.toolbarCollapse : c.lang.toolbar.toolbarExpand) + '" id="' + c.ui.spaceId("toolbar_collapser") + '" tabIndex="-1" class="cke_toolbox_collapser');
  20881. g || i.push(" cke_toolbox_collapser_min");
  20882. i.push('" onclick="CKEDITOR.tools.callFunction(' + y + ')">', '<span class="cke_arrow">&#9650;</span>',
  20883. "</a>")
  20884. }
  20885. i.push("</span>");
  20886. d.data.html = d.data.html + i.join("")
  20887. }
  20888. });
  20889. c.on("destroy", function() {
  20890. if(this.toolbox) {
  20891. var a, b = 0,
  20892. c, d, e;
  20893. for(a = this.toolbox.toolbars; b < a.length; b++) {
  20894. d = a[b].items;
  20895. for(c = 0; c < d.length; c++) {
  20896. e = d[c];
  20897. e.clickFn && CKEDITOR.tools.removeFunction(e.clickFn);
  20898. e.keyDownFn && CKEDITOR.tools.removeFunction(e.keyDownFn)
  20899. }
  20900. }
  20901. }
  20902. });
  20903. c.on("uiReady", function() {
  20904. var a = c.ui.space("toolbox");
  20905. a && c.focusManager.add(a, 1)
  20906. });
  20907. c.addCommand("toolbarFocus", g);
  20908. c.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
  20909. c.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
  20910. c.ui.addHandler(CKEDITOR.UI_SEPARATOR, {
  20911. create: function() {
  20912. return {
  20913. render: function(a, b) {
  20914. b.push('<span class="cke_toolbar_separator" role="separator"></span>');
  20915. return {}
  20916. }
  20917. }
  20918. }
  20919. })
  20920. }
  20921. });
  20922. CKEDITOR.ui.prototype.addToolbarGroup = function(a, b, g) {
  20923. var f = e(this.editor),
  20924. h = b === 0,
  20925. i = {
  20926. name: a
  20927. };
  20928. if(g) {
  20929. if(g = CKEDITOR.tools.search(f, function(a) {
  20930. return a.name == g
  20931. })) {
  20932. !g.groups && (g.groups = []);
  20933. if(b) {
  20934. b = CKEDITOR.tools.indexOf(g.groups, b);
  20935. if(b >= 0) {
  20936. g.groups.splice(b + 1, 0, a);
  20937. return
  20938. }
  20939. }
  20940. h ? g.groups.splice(0, 0, a) : g.groups.push(a);
  20941. return
  20942. }
  20943. b = null
  20944. }
  20945. b &&
  20946. (b = CKEDITOR.tools.indexOf(f, function(a) {
  20947. return a.name == b
  20948. }));
  20949. h ? f.splice(0, 0, a) : typeof b == "number" ? f.splice(b + 1, 0, i) : f.push(a)
  20950. }
  20951. }(), CKEDITOR.UI_SEPARATOR = "separator", CKEDITOR.config.toolbarLocation = "top", "use strict",
  20952. function() {
  20953. var a = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90],
  20954. e = {
  20955. 8: 1,
  20956. 46: 1
  20957. };
  20958. CKEDITOR.plugins.add("undo", {
  20959. init: function(c) {
  20960. function e(a) {
  20961. j.enabled && a.data.command.canUndo !== false && j.save()
  20962. }
  20963. function g() {
  20964. j.enabled = c.readOnly ? false : c.mode == "wysiwyg";
  20965. j.onChange()
  20966. }
  20967. var j =
  20968. c.undoManager = new b(c),
  20969. n = j.editingHandler = new d(j),
  20970. o = c.addCommand("undo", {
  20971. exec: function() {
  20972. if(j.undo()) {
  20973. c.selectionChange();
  20974. this.fire("afterUndo")
  20975. }
  20976. },
  20977. startDisabled: true,
  20978. canUndo: false
  20979. }),
  20980. q = c.addCommand("redo", {
  20981. exec: function() {
  20982. if(j.redo()) {
  20983. c.selectionChange();
  20984. this.fire("afterRedo")
  20985. }
  20986. },
  20987. startDisabled: true,
  20988. canUndo: false
  20989. });
  20990. c.setKeystroke([
  20991. [a[0], "undo"],
  20992. [a[1], "redo"],
  20993. [a[2], "redo"]
  20994. ]);
  20995. j.onChange = function() {
  20996. o.setState(j.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  20997. q.setState(j.redoable() ? CKEDITOR.TRISTATE_OFF :
  20998. CKEDITOR.TRISTATE_DISABLED)
  20999. };
  21000. c.on("beforeCommandExec", e);
  21001. c.on("afterCommandExec", e);
  21002. c.on("saveSnapshot", function(a) {
  21003. j.save(a.data && a.data.contentOnly)
  21004. });
  21005. c.on("contentDom", n.attachListeners, n);
  21006. c.on("instanceReady", function() {
  21007. c.fire("saveSnapshot")
  21008. });
  21009. c.on("beforeModeUnload", function() {
  21010. c.mode == "wysiwyg" && j.save(true)
  21011. });
  21012. c.on("mode", g);
  21013. c.on("readOnly", g);
  21014. if(c.ui.addButton) {
  21015. c.ui.addButton("Undo", {
  21016. label: c.lang.undo.undo,
  21017. command: "undo",
  21018. toolbar: "undo,10"
  21019. });
  21020. c.ui.addButton("Redo", {
  21021. label: c.lang.undo.redo,
  21022. command: "redo",
  21023. toolbar: "undo,20"
  21024. })
  21025. }
  21026. c.resetUndo = function() {
  21027. j.reset();
  21028. c.fire("saveSnapshot")
  21029. };
  21030. c.on("updateSnapshot", function() {
  21031. j.currentImage && j.update()
  21032. });
  21033. c.on("lockSnapshot", function(a) {
  21034. a = a.data;
  21035. j.lock(a && a.dontUpdate, a && a.forceUpdate)
  21036. });
  21037. c.on("unlockSnapshot", j.unlock, j)
  21038. }
  21039. });
  21040. CKEDITOR.plugins.undo = {};
  21041. var b = CKEDITOR.plugins.undo.UndoManager = function(a) {
  21042. this.strokesRecorded = [0, 0];
  21043. this.locked = null;
  21044. this.previousKeyGroup = -1;
  21045. this.limit = a.config.undoStackSize || 20;
  21046. this.strokesLimit = 25;
  21047. this.editor = a;
  21048. this.reset()
  21049. };
  21050. b.prototype = {
  21051. type: function(a, c) {
  21052. var d = b.getKeyGroup(a),
  21053. e = this.strokesRecorded[d] + 1,
  21054. c = c || e >= this.strokesLimit;
  21055. if(!this.typing) {
  21056. this.hasUndo = this.typing = true;
  21057. this.hasRedo = false;
  21058. this.onChange()
  21059. }
  21060. if(c) {
  21061. e = 0;
  21062. this.editor.fire("saveSnapshot")
  21063. } else this.editor.fire("change");
  21064. this.strokesRecorded[d] = e;
  21065. this.previousKeyGroup = d
  21066. },
  21067. keyGroupChanged: function(a) {
  21068. return b.getKeyGroup(a) != this.previousKeyGroup
  21069. },
  21070. reset: function() {
  21071. this.snapshots = [];
  21072. this.index = -1;
  21073. this.currentImage = null;
  21074. this.hasRedo = this.hasUndo = false;
  21075. this.locked = null;
  21076. this.resetType()
  21077. },
  21078. resetType: function() {
  21079. this.strokesRecorded = [0, 0];
  21080. this.typing = false;
  21081. this.previousKeyGroup = -1
  21082. },
  21083. refreshState: function() {
  21084. this.hasUndo = !!this.getNextImage(true);
  21085. this.hasRedo = !!this.getNextImage(false);
  21086. this.resetType();
  21087. this.onChange()
  21088. },
  21089. save: function(a, b, c) {
  21090. var d = this.editor;
  21091. if(this.locked || d.status != "ready" || d.mode != "wysiwyg") return false;
  21092. var e = d.editable();
  21093. if(!e || e.status != "ready") return false;
  21094. e = this.snapshots;
  21095. b || (b = new g(d));
  21096. if(b.contents === false) return false;
  21097. if(this.currentImage)
  21098. if(b.equalsContent(this.currentImage)) {
  21099. if(a ||
  21100. b.equalsSelection(this.currentImage)) return false
  21101. } else c !== false && d.fire("change");
  21102. e.splice(this.index + 1, e.length - this.index - 1);
  21103. e.length == this.limit && e.shift();
  21104. this.index = e.push(b) - 1;
  21105. this.currentImage = b;
  21106. c !== false && this.refreshState();
  21107. return true
  21108. },
  21109. restoreImage: function(a) {
  21110. var b = this.editor,
  21111. c;
  21112. if(a.bookmarks) {
  21113. b.focus();
  21114. c = b.getSelection()
  21115. }
  21116. this.locked = {
  21117. level: 999
  21118. };
  21119. this.editor.loadSnapshot(a.contents);
  21120. if(a.bookmarks) c.selectBookmarks(a.bookmarks);
  21121. else if(CKEDITOR.env.ie) {
  21122. c = this.editor.document.getBody().$.createTextRange();
  21123. c.collapse(true);
  21124. c.select()
  21125. }
  21126. this.locked = null;
  21127. this.index = a.index;
  21128. this.currentImage = this.snapshots[this.index];
  21129. this.update();
  21130. this.refreshState();
  21131. b.fire("change")
  21132. },
  21133. getNextImage: function(a) {
  21134. var b = this.snapshots,
  21135. c = this.currentImage,
  21136. d;
  21137. if(c)
  21138. if(a)
  21139. for(d = this.index - 1; d >= 0; d--) {
  21140. a = b[d];
  21141. if(!c.equalsContent(a)) {
  21142. a.index = d;
  21143. return a
  21144. }
  21145. } else
  21146. for(d = this.index + 1; d < b.length; d++) {
  21147. a = b[d];
  21148. if(!c.equalsContent(a)) {
  21149. a.index = d;
  21150. return a
  21151. }
  21152. }
  21153. return null
  21154. },
  21155. redoable: function() {
  21156. return this.enabled && this.hasRedo
  21157. },
  21158. undoable: function() {
  21159. return this.enabled &&
  21160. this.hasUndo
  21161. },
  21162. undo: function() {
  21163. if(this.undoable()) {
  21164. this.save(true);
  21165. var a = this.getNextImage(true);
  21166. if(a) return this.restoreImage(a), true
  21167. }
  21168. return false
  21169. },
  21170. redo: function() {
  21171. if(this.redoable()) {
  21172. this.save(true);
  21173. if(this.redoable()) {
  21174. var a = this.getNextImage(false);
  21175. if(a) return this.restoreImage(a), true
  21176. }
  21177. }
  21178. return false
  21179. },
  21180. update: function(a) {
  21181. if(!this.locked) {
  21182. a || (a = new g(this.editor));
  21183. for(var b = this.index, c = this.snapshots; b > 0 && this.currentImage.equalsContent(c[b - 1]);) b = b - 1;
  21184. c.splice(b, this.index - b + 1, a);
  21185. this.index = b;
  21186. this.currentImage =
  21187. a
  21188. }
  21189. },
  21190. updateSelection: function(a) {
  21191. if(!this.snapshots.length) return false;
  21192. var b = this.snapshots,
  21193. c = b[b.length - 1];
  21194. if(c.equalsContent(a) && !c.equalsSelection(a)) {
  21195. this.currentImage = b[b.length - 1] = a;
  21196. return true
  21197. }
  21198. return false
  21199. },
  21200. lock: function(a, b) {
  21201. if(this.locked) this.locked.level++;
  21202. else if(a) this.locked = {
  21203. level: 1
  21204. };
  21205. else {
  21206. var c = null;
  21207. if(b) c = true;
  21208. else {
  21209. var d = new g(this.editor, true);
  21210. this.currentImage && this.currentImage.equalsContent(d) && (c = d)
  21211. }
  21212. this.locked = {
  21213. update: c,
  21214. level: 1
  21215. }
  21216. }
  21217. },
  21218. unlock: function() {
  21219. if(this.locked && !--this.locked.level) {
  21220. var a =
  21221. this.locked.update;
  21222. this.locked = null;
  21223. if(a === true) this.update();
  21224. else if(a) {
  21225. var b = new g(this.editor, true);
  21226. a.equalsContent(b) || this.update()
  21227. }
  21228. }
  21229. }
  21230. };
  21231. b.navigationKeyCodes = {
  21232. 37: 1,
  21233. 38: 1,
  21234. 39: 1,
  21235. 40: 1,
  21236. 36: 1,
  21237. 35: 1,
  21238. 33: 1,
  21239. 34: 1
  21240. };
  21241. b.keyGroups = {
  21242. PRINTABLE: 0,
  21243. FUNCTIONAL: 1
  21244. };
  21245. b.isNavigationKey = function(a) {
  21246. return !!b.navigationKeyCodes[a]
  21247. };
  21248. b.getKeyGroup = function(a) {
  21249. var c = b.keyGroups;
  21250. return e[a] ? c.FUNCTIONAL : c.PRINTABLE
  21251. };
  21252. b.getOppositeKeyGroup = function(a) {
  21253. var c = b.keyGroups;
  21254. return a == c.FUNCTIONAL ? c.PRINTABLE : c.FUNCTIONAL
  21255. };
  21256. b.ieFunctionalKeysBug =
  21257. function(a) {
  21258. return CKEDITOR.env.ie && b.getKeyGroup(a) == b.keyGroups.FUNCTIONAL
  21259. };
  21260. var g = CKEDITOR.plugins.undo.Image = function(a, b) {
  21261. this.editor = a;
  21262. a.fire("beforeUndoImage");
  21263. var c = a.getSnapshot();
  21264. CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, ""));
  21265. this.contents = c;
  21266. if(!b) this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(true);
  21267. a.fire("afterUndoImage")
  21268. },
  21269. c = /\b(?:href|src|name)="[^"]*?"/gi;
  21270. g.prototype = {
  21271. equalsContent: function(a) {
  21272. var b = this.contents,
  21273. a = a.contents;
  21274. if(CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat ||
  21275. CKEDITOR.env.quirks)) {
  21276. b = b.replace(c, "");
  21277. a = a.replace(c, "")
  21278. }
  21279. return b != a ? false : true
  21280. },
  21281. equalsSelection: function(a) {
  21282. var b = this.bookmarks,
  21283. a = a.bookmarks;
  21284. if(b || a) {
  21285. if(!b || !a || b.length != a.length) return false;
  21286. for(var c = 0; c < b.length; c++) {
  21287. var d = b[c],
  21288. e = a[c];
  21289. if(d.startOffset != e.startOffset || d.endOffset != e.endOffset || !CKEDITOR.tools.arrayCompare(d.start, e.start) || !CKEDITOR.tools.arrayCompare(d.end, e.end)) return false
  21290. }
  21291. }
  21292. return true
  21293. }
  21294. };
  21295. var d = CKEDITOR.plugins.undo.NativeEditingHandler = function(a) {
  21296. this.undoManager = a;
  21297. this.ignoreInputEvent =
  21298. false;
  21299. this.keyEventsStack = new j;
  21300. this.lastKeydownImage = null
  21301. };
  21302. d.prototype = {
  21303. onKeydown: function(c) {
  21304. var d = c.data.getKey();
  21305. if(d !== 229)
  21306. if(CKEDITOR.tools.indexOf(a, c.data.getKeystroke()) > -1) c.data.preventDefault();
  21307. else {
  21308. this.keyEventsStack.cleanUp(c);
  21309. c = this.undoManager;
  21310. this.keyEventsStack.getLast(d) || this.keyEventsStack.push(d);
  21311. this.lastKeydownImage = new g(c.editor);
  21312. if(b.isNavigationKey(d) || this.undoManager.keyGroupChanged(d))
  21313. if(c.strokesRecorded[0] || c.strokesRecorded[1]) {
  21314. c.save(false, this.lastKeydownImage,
  21315. false);
  21316. c.resetType()
  21317. }
  21318. }
  21319. },
  21320. onInput: function() {
  21321. if(this.ignoreInputEvent) this.ignoreInputEvent = false;
  21322. else {
  21323. var a = this.keyEventsStack.getLast();
  21324. a || (a = this.keyEventsStack.push(0));
  21325. this.keyEventsStack.increment(a.keyCode);
  21326. if(this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit) {
  21327. this.undoManager.type(a.keyCode, true);
  21328. this.keyEventsStack.resetInputs()
  21329. }
  21330. }
  21331. },
  21332. onKeyup: function(a) {
  21333. var c = this.undoManager,
  21334. a = a.data.getKey(),
  21335. d = this.keyEventsStack.getTotalInputs();
  21336. this.keyEventsStack.remove(a);
  21337. if(!b.ieFunctionalKeysBug(a) ||
  21338. !this.lastKeydownImage || !this.lastKeydownImage.equalsContent(new g(c.editor, true)))
  21339. if(d > 0) c.type(a);
  21340. else if(b.isNavigationKey(a)) this.onNavigationKey(true)
  21341. },
  21342. onNavigationKey: function(a) {
  21343. var b = this.undoManager;
  21344. (a || !b.save(true, null, false)) && b.updateSelection(new g(b.editor));
  21345. b.resetType()
  21346. },
  21347. ignoreInputEventListener: function() {
  21348. this.ignoreInputEvent = true
  21349. },
  21350. attachListeners: function() {
  21351. var a = this.undoManager.editor,
  21352. c = a.editable(),
  21353. d = this;
  21354. c.attachListener(c, "keydown", function(a) {
  21355. d.onKeydown(a);
  21356. if(b.ieFunctionalKeysBug(a.data.getKey())) d.onInput()
  21357. },
  21358. null, null, 999);
  21359. c.attachListener(c, CKEDITOR.env.ie ? "keypress" : "input", d.onInput, d, null, 999);
  21360. c.attachListener(c, "keyup", d.onKeyup, d, null, 999);
  21361. c.attachListener(c, "paste", d.ignoreInputEventListener, d, null, 999);
  21362. c.attachListener(c, "drop", d.ignoreInputEventListener, d, null, 999);
  21363. c.attachListener(c.isInline() ? c : a.document.getDocumentElement(), "click", function() {
  21364. d.onNavigationKey()
  21365. }, null, null, 999);
  21366. c.attachListener(this.undoManager.editor, "blur", function() {
  21367. d.keyEventsStack.remove(9)
  21368. }, null, null, 999)
  21369. }
  21370. };
  21371. var j = CKEDITOR.plugins.undo.KeyEventsStack =
  21372. function() {
  21373. this.stack = []
  21374. };
  21375. j.prototype = {
  21376. push: function(a) {
  21377. return this.stack[this.stack.push({
  21378. keyCode: a,
  21379. inputs: 0
  21380. }) - 1]
  21381. },
  21382. getLastIndex: function(a) {
  21383. if(typeof a != "number") return this.stack.length - 1;
  21384. for(var b = this.stack.length; b--;)
  21385. if(this.stack[b].keyCode == a) return b;
  21386. return -1
  21387. },
  21388. getLast: function(a) {
  21389. a = this.getLastIndex(a);
  21390. return a != -1 ? this.stack[a] : null
  21391. },
  21392. increment: function(a) {
  21393. this.getLast(a).inputs++
  21394. },
  21395. remove: function(a) {
  21396. a = this.getLastIndex(a);
  21397. a != -1 && this.stack.splice(a, 1)
  21398. },
  21399. resetInputs: function(a) {
  21400. if(typeof a ==
  21401. "number") this.getLast(a).inputs = 0;
  21402. else
  21403. for(a = this.stack.length; a--;) this.stack[a].inputs = 0
  21404. },
  21405. getTotalInputs: function() {
  21406. for(var a = this.stack.length, b = 0; a--;) b = b + this.stack[a].inputs;
  21407. return b
  21408. },
  21409. cleanUp: function(a) {
  21410. a = a.data.$;
  21411. !a.ctrlKey && !a.metaKey && this.remove(17);
  21412. a.shiftKey || this.remove(16);
  21413. a.altKey || this.remove(18)
  21414. }
  21415. }
  21416. }(), CKEDITOR.plugins.add("wsc", {
  21417. requires: "dialog",
  21418. parseApi: function(a) {
  21419. a.config.wsc_onFinish = typeof a.config.wsc_onFinish === "function" ? a.config.wsc_onFinish : function() {};
  21420. a.config.wsc_onClose =
  21421. typeof a.config.wsc_onClose === "function" ? a.config.wsc_onClose : function() {}
  21422. },
  21423. parseConfig: function(a) {
  21424. a.config.wsc_customerId = a.config.wsc_customerId || CKEDITOR.config.wsc_customerId || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";
  21425. a.config.wsc_customDictionaryIds = a.config.wsc_customDictionaryIds || CKEDITOR.config.wsc_customDictionaryIds || "";
  21426. a.config.wsc_userDictionaryName = a.config.wsc_userDictionaryName || CKEDITOR.config.wsc_userDictionaryName || "";
  21427. a.config.wsc_customLoaderScript =
  21428. a.config.wsc_customLoaderScript || CKEDITOR.config.wsc_customLoaderScript;
  21429. CKEDITOR.config.wsc_cmd = a.config.wsc_cmd || CKEDITOR.config.wsc_cmd || "spell";
  21430. CKEDITOR.config.wsc_version = "v4.3.0-26-g5bcf855";
  21431. CKEDITOR.config.wsc_removeGlobalVariable = true
  21432. },
  21433. init: function(a) {
  21434. var e = CKEDITOR.env;
  21435. this.parseConfig(a);
  21436. this.parseApi(a);
  21437. a.addCommand("checkspell", new CKEDITOR.dialogCommand("checkspell")).modes = {
  21438. wysiwyg: !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname && !(e.ie && (e.version <
  21439. 8 || e.quirks))
  21440. };
  21441. typeof a.plugins.scayt == "undefined" && a.ui.addButton && a.ui.addButton("SpellChecker", {
  21442. label: a.lang.wsc.toolbar,
  21443. click: function(a) {
  21444. var e = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  21445. (e = e.replace(/\s/g, "")) ? a.execCommand("checkspell"): alert("Nothing to check!")
  21446. },
  21447. toolbar: "spellchecker,10"
  21448. });
  21449. CKEDITOR.dialog.add("checkspell", this.path + (CKEDITOR.env.ie && CKEDITOR.env.version <= 7 ? "dialogs/wsc_ie.js" : window.postMessage ? "dialogs/wsc.js" : "dialogs/wsc_ie.js"))
  21450. }
  21451. }),
  21452. function() {
  21453. function a(a) {
  21454. var b = this.editor,
  21455. g = a.document,
  21456. f = g.body,
  21457. h = g.getElementById("cke_actscrpt");
  21458. h && h.parentNode.removeChild(h);
  21459. (h = g.getElementById("cke_shimscrpt")) && h.parentNode.removeChild(h);
  21460. (h = g.getElementById("cke_basetagscrpt")) && h.parentNode.removeChild(h);
  21461. f.contentEditable = true;
  21462. if(CKEDITOR.env.ie) {
  21463. f.hideFocus = true;
  21464. f.disabled = true;
  21465. f.removeAttribute("disabled")
  21466. }
  21467. delete this._.isLoadingData;
  21468. this.$ = f;
  21469. g = new CKEDITOR.dom.document(g);
  21470. this.setup();
  21471. this.fixInitialSelection();
  21472. if(CKEDITOR.env.ie) {
  21473. g.getDocumentElement().addClass(g.$.compatMode);
  21474. b.config.enterMode != CKEDITOR.ENTER_P && this.attachListener(g, "selectionchange", function() {
  21475. var a = g.getBody(),
  21476. c = b.getSelection(),
  21477. e = c && c.getRanges()[0];
  21478. e && (a.getHtml().match(/^<p>(?:&nbsp;|<br>)<\/p>$/i) && e.startContainer.equals(a)) && setTimeout(function() {
  21479. e = b.getSelection().getRanges()[0];
  21480. if(!e.startContainer.equals("body")) {
  21481. a.getFirst().remove(1);
  21482. e.moveToElementEditEnd(a);
  21483. e.select()
  21484. }
  21485. }, 0)
  21486. })
  21487. }
  21488. if(CKEDITOR.env.webkit || CKEDITOR.env.ie && CKEDITOR.env.version > 10) g.getDocumentElement().on("mousedown", function(a) {
  21489. a.data.getTarget().is("html") &&
  21490. setTimeout(function() {
  21491. b.editable().focus()
  21492. })
  21493. });
  21494. e(b);
  21495. try {
  21496. b.document.$.execCommand("2D-position", false, true)
  21497. } catch(i) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && b.document.$.compatMode == "CSS1Compat") && this.attachListener(this, "keydown", function(a) {
  21498. var c = a.data.getKeystroke();
  21499. if(c == 33 || c == 34)
  21500. if(CKEDITOR.env.ie) setTimeout(function() {
  21501. b.getSelection().scrollIntoView()
  21502. }, 0);
  21503. else if(b.window.$.innerHeight > this.$.offsetHeight) {
  21504. var e = b.createRange();
  21505. e[c == 33 ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
  21506. e.select();
  21507. a.data.preventDefault()
  21508. }
  21509. });
  21510. CKEDITOR.env.ie && this.attachListener(g, "blur", function() {
  21511. try {
  21512. g.$.selection.empty()
  21513. } catch(a) {}
  21514. });
  21515. CKEDITOR.env.iOS && this.attachListener(g, "touchend", function() {
  21516. a.focus()
  21517. });
  21518. f = b.document.getElementsByTag("title").getItem(0);
  21519. f.data("cke-title", f.getText());
  21520. if(CKEDITOR.env.ie) b.document.$.title = this._.docTitle;
  21521. CKEDITOR.tools.setTimeout(function() {
  21522. if(this.status == "unloaded") this.status = "ready";
  21523. b.fire("contentDom");
  21524. if(this._.isPendingFocus) {
  21525. b.focus();
  21526. this._.isPendingFocus =
  21527. false
  21528. }
  21529. setTimeout(function() {
  21530. b.fire("dataReady")
  21531. }, 0);
  21532. CKEDITOR.env.ie && setTimeout(function() {
  21533. if(b.document) {
  21534. var a = b.document.$.body;
  21535. a.runtimeStyle.marginBottom = "0px";
  21536. a.runtimeStyle.marginBottom = ""
  21537. }
  21538. }, 1E3)
  21539. }, 0, this)
  21540. }
  21541. function e(a) {
  21542. function b() {
  21543. var d;
  21544. a.editable().attachListener(a, "selectionChange", function() {
  21545. var b = a.getSelection().getSelectedElement();
  21546. if(b) {
  21547. if(d) {
  21548. d.detachEvent("onresizestart", e);
  21549. d = null
  21550. }
  21551. b.$.attachEvent("onresizestart", e);
  21552. d = b.$
  21553. }
  21554. })
  21555. }
  21556. function e(a) {
  21557. a.returnValue = false
  21558. }
  21559. if(CKEDITOR.env.gecko) try {
  21560. var f =
  21561. a.document.$;
  21562. f.execCommand("enableObjectResizing", false, !a.config.disableObjectResizing);
  21563. f.execCommand("enableInlineTableEditing", false, !a.config.disableNativeTableHandles)
  21564. } catch(g) {} else CKEDITOR.env.ie && (CKEDITOR.env.version < 11 && a.config.disableObjectResizing) && b(a)
  21565. }
  21566. function b() {
  21567. var a = [];
  21568. if(CKEDITOR.document.$.documentMode >= 8) {
  21569. a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");
  21570. var b = [],
  21571. e;
  21572. for(e in CKEDITOR.dtd.$removeEmpty) b.push("html.CSS1Compat " + e + "[contenteditable=false]");
  21573. a.push(b.join(",") + "{display:inline-block}")
  21574. } else if(CKEDITOR.env.gecko) {
  21575. a.push("html{height:100% !important}");
  21576. a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")
  21577. }
  21578. a.push("html{cursor:text;*cursor:auto}");
  21579. a.push("img,input,textarea{cursor:default}");
  21580. return a.join("\n")
  21581. }
  21582. CKEDITOR.plugins.add("wysiwygarea", {
  21583. init: function(a) {
  21584. a.config.fullPage && a.addFeature({
  21585. allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]",
  21586. requiredContent: "body"
  21587. });
  21588. a.addMode("wysiwyg",
  21589. function(b) {
  21590. function e(f) {
  21591. f && f.removeListener();
  21592. a.editable(new g(a, h.$.contentWindow.document.body));
  21593. a.setData(a.getData(1), b)
  21594. }
  21595. var f = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();",
  21596. f = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent(f) + "}())" : "",
  21597. h = CKEDITOR.dom.element.createFromHtml('<iframe src="' + f + '" frameBorder="0"></iframe>');
  21598. h.setStyles({
  21599. width: "100%",
  21600. height: "100%"
  21601. });
  21602. h.addClass("cke_wysiwyg_frame cke_reset");
  21603. var i = a.ui.space("contents");
  21604. i.append(h);
  21605. if(f = CKEDITOR.env.ie || CKEDITOR.env.gecko) h.on("load", e);
  21606. var k = a.title,
  21607. n = a.fire("ariaEditorHelpLabel", {}).label;
  21608. if(k) {
  21609. CKEDITOR.env.ie && n && (k = k + (", " + n));
  21610. h.setAttribute("title", k)
  21611. }
  21612. if(n) {
  21613. var k = CKEDITOR.tools.getNextId(),
  21614. o = CKEDITOR.dom.element.createFromHtml('<span id="' + k + '" class="cke_voice_label">' + n + "</span>");
  21615. i.append(o, 1);
  21616. h.setAttribute("aria-describedby", k)
  21617. }
  21618. a.on("beforeModeUnload", function(a) {
  21619. a.removeListener();
  21620. o && o.remove()
  21621. });
  21622. h.setAttributes({
  21623. tabIndex: a.tabIndex,
  21624. allowTransparency: "true"
  21625. });
  21626. !f && e();
  21627. if(CKEDITOR.env.webkit) {
  21628. f = function() {
  21629. i.setStyle("width", "100%");
  21630. h.hide();
  21631. h.setSize("width", i.getSize("width"));
  21632. i.removeStyle("width");
  21633. h.show()
  21634. };
  21635. h.setCustomData("onResize", f);
  21636. CKEDITOR.document.getWindow().on("resize", f)
  21637. }
  21638. a.fire("ariaWidget", h)
  21639. })
  21640. }
  21641. });
  21642. CKEDITOR.editor.prototype.addContentsCss = function(a) {
  21643. var b = this.config,
  21644. e = b.contentsCss;
  21645. if(!CKEDITOR.tools.isArray(e)) b.contentsCss = e ? [e] : [];
  21646. b.contentsCss.push(a)
  21647. };
  21648. var g = CKEDITOR.tools.createClass({
  21649. $: function() {
  21650. this.base.apply(this,
  21651. arguments);
  21652. this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(b) {
  21653. CKEDITOR.tools.setTimeout(a, 0, this, b)
  21654. }, this);
  21655. this._.docTitle = this.getWindow().getFrame().getAttribute("title")
  21656. },
  21657. base: CKEDITOR.editable,
  21658. proto: {
  21659. setData: function(a, d) {
  21660. var e = this.editor;
  21661. if(d) {
  21662. this.setHtml(a);
  21663. this.fixInitialSelection();
  21664. e.fire("dataReady")
  21665. } else {
  21666. this._.isLoadingData = true;
  21667. e._.dataStore = {
  21668. id: 1
  21669. };
  21670. var f = e.config,
  21671. g = f.fullPage,
  21672. i = f.docType,
  21673. k = CKEDITOR.tools.buildStyleHtml(b()).replace(/<style>/, '<style data-cke-temp="1">');
  21674. g || (k = k + CKEDITOR.tools.buildStyleHtml(e.config.contentsCss));
  21675. var n = f.baseHref ? '<base href="' + f.baseHref + '" data-cke-temp="1" />' : "";
  21676. g && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) {
  21677. e.docType = i = a;
  21678. return ""
  21679. }).replace(/<\?xml\s[^\?]*\?>/i, function(a) {
  21680. e.xmlDeclaration = a;
  21681. return ""
  21682. }));
  21683. a = e.dataProcessor.toHtml(a);
  21684. if(g) {
  21685. /<body[\s|>]/.test(a) || (a = "<body>" + a);
  21686. /<html[\s|>]/.test(a) || (a = "<html>" + a + "</html>");
  21687. /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (a = a.replace(/<head[^>]*>/, "$&<title></title>")) : a = a.replace(/<html[^>]*>/,
  21688. "$&<head><title></title></head>");
  21689. n && (a = a.replace(/<head[^>]*?>/, "$&" + n));
  21690. a = a.replace(/<\/head\s*>/, k + "$&");
  21691. a = i + a
  21692. } else a = f.docType + '<html dir="' + f.contentsLangDirection + '" lang="' + (f.contentsLanguage || e.langCode) + '"><head><title>' + this._.docTitle + "</title>" + n + k + "</head><body" + (f.bodyId ? ' id="' + f.bodyId + '"' : "") + (f.bodyClass ? ' class="' + f.bodyClass + '"' : "") + ">" + a + "</body></html>";
  21693. if(CKEDITOR.env.gecko) {
  21694. a = a.replace(/<body/, '<body contenteditable="true" ');
  21695. CKEDITOR.env.version < 2E4 && (a = a.replace(/<body[^>]*>/,
  21696. "$&<\!-- cke-content-start --\>"))
  21697. }
  21698. f = '<script id="cke_actscrpt" type="text/javascript"' + (CKEDITOR.env.ie ? ' defer="defer" ' : "") + ">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction(" + this._.frameLoadedHandler + ",window);wasLoaded=1;}" + (CKEDITOR.env.ie ? "onload();" : 'document.addEventListener("DOMContentLoaded", onload, false );') + "<\/script>";
  21699. CKEDITOR.env.ie && CKEDITOR.env.version < 9 && (f = f + '<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)<\/script>');
  21700. n && (CKEDITOR.env.ie && CKEDITOR.env.version < 10) && (f = f + '<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;<\/script>');
  21701. a = a.replace(/(?=\s*<\/(:?head)>)/, f);
  21702. this.clearCustomData();
  21703. this.clearListeners();
  21704. e.fire("contentDomUnload");
  21705. var o = this.getDocument();
  21706. try {
  21707. o.write(a)
  21708. } catch(q) {
  21709. setTimeout(function() {
  21710. o.write(a)
  21711. }, 0)
  21712. }
  21713. }
  21714. },
  21715. getData: function(a) {
  21716. if(a) return this.getHtml();
  21717. var a = this.editor,
  21718. b = a.config,
  21719. e = b.fullPage,
  21720. f = e && a.docType,
  21721. g = e && a.xmlDeclaration,
  21722. i = this.getDocument(),
  21723. e = e ? i.getDocumentElement().getOuterHtml() : i.getBody().getHtml();
  21724. CKEDITOR.env.gecko && b.enterMode != CKEDITOR.ENTER_BR && (e = e.replace(/<br>(?=\s*(:?$|<\/body>))/, ""));
  21725. e = a.dataProcessor.toDataFormat(e);
  21726. g && (e = g + "\n" + e);
  21727. f && (e = f + "\n" + e);
  21728. return e
  21729. },
  21730. focus: function() {
  21731. this._.isLoadingData ? this._.isPendingFocus = true : g.baseProto.focus.call(this)
  21732. },
  21733. detach: function() {
  21734. var a = this.editor,
  21735. b = a.document,
  21736. a = a.window.getFrame();
  21737. g.baseProto.detach.call(this);
  21738. this.clearCustomData();
  21739. b.getDocumentElement().clearCustomData();
  21740. a.clearCustomData();
  21741. CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
  21742. (b = a.removeCustomData("onResize")) && b.removeListener();
  21743. a.remove()
  21744. }
  21745. }
  21746. })
  21747. }(), CKEDITOR.config.disableObjectResizing = !1, CKEDITOR.config.disableNativeTableHandles = !0, CKEDITOR.config.disableNativeSpellChecker = !0, CKEDITOR.config.contentsCss = CKEDITOR.getUrl("contents.css"), CKEDITOR.config.plugins = "dialogui,dialog,a11yhelp,about,basicstyles,blockquote,clipboard,panel,floatpanel,menu,contextmenu,elementspath,indent,indentlist,list,enterkey,entities,popup,filebrowser,floatingspace,listblock,button,richcombo,format,horizontalrule,htmlwriter,image,fakeobjects,link,magicline,maximize,pastefromword,pastetext,removeformat,resize,menubutton,scayt,showborders,sourcearea,specialchar,stylescombo,tab,table,tabletools,toolbar,undo,wsc,wysiwygarea",
  21748. CKEDITOR.config.skin = "moono",
  21749. function() {
  21750. var a = function(a, b) {
  21751. for(var g = CKEDITOR.getUrl("plugins/" + b), a = a.split(","), c = 0; c < a.length; c++) CKEDITOR.skin.icons[a[c]] = {
  21752. path: g,
  21753. offset: -a[++c],
  21754. bgsize: a[++c]
  21755. }
  21756. };
  21757. CKEDITOR.env.hidpi ? a("about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,codesnippet,384,,bgcolor,408,,textcolor,432,,creatediv,456,,docprops-rtl,480,,docprops,504,,find-rtl,528,,find,552,,replace,576,,flash,600,,button,624,,checkbox,648,,form,672,,hiddenfield,696,,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,,justifyblock,1080,,justifycenter,1104,,justifyleft,1128,,justifyright,1152,,language,1176,,anchor-rtl,1200,,anchor,1224,,link,1248,,unlink,1272,,bulletedlist-rtl,1296,,bulletedlist,1320,,numberedlist-rtl,1344,,numberedlist,1368,,mathjax,1392,,maximize,1416,,newpage-rtl,1440,,newpage,1464,,pagebreak-rtl,1488,,pagebreak,1512,,pastefromword-rtl,1536,,pastefromword,1560,,pastetext-rtl,1584,,pastetext,1608,,placeholder,1632,,preview-rtl,1656,,preview,1680,,print,1704,,removeformat,1728,,save,1752,,scayt,1776,,selectall,1800,,showblocks-rtl,1824,,showblocks,1848,,smiley,1872,,source-rtl,1896,,source,1920,,sourcedialog-rtl,1944,,sourcedialog,1968,,specialchar,1992,,table,2016,,templates-rtl,2040,,templates,2064,,uicolor,2088,,redo-rtl,2112,,redo,2136,,undo-rtl,2160,,undo,2184,,simplebox,4416,auto,spellchecker,2232,",
  21758. "icons_hidpi.png") : a("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,codesnippet,384,auto,bgcolor,408,auto,textcolor,432,auto,creatediv,456,auto,docprops-rtl,480,auto,docprops,504,auto,find-rtl,528,auto,find,552,auto,replace,576,auto,flash,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,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,justifyblock,1080,auto,justifycenter,1104,auto,justifyleft,1128,auto,justifyright,1152,auto,language,1176,auto,anchor-rtl,1200,auto,anchor,1224,auto,link,1248,auto,unlink,1272,auto,bulletedlist-rtl,1296,auto,bulletedlist,1320,auto,numberedlist-rtl,1344,auto,numberedlist,1368,auto,mathjax,1392,auto,maximize,1416,auto,newpage-rtl,1440,auto,newpage,1464,auto,pagebreak-rtl,1488,auto,pagebreak,1512,auto,pastefromword-rtl,1536,auto,pastefromword,1560,auto,pastetext-rtl,1584,auto,pastetext,1608,auto,placeholder,1632,auto,preview-rtl,1656,auto,preview,1680,auto,print,1704,auto,removeformat,1728,auto,save,1752,auto,scayt,1776,auto,selectall,1800,auto,showblocks-rtl,1824,auto,showblocks,1848,auto,smiley,1872,auto,source-rtl,1896,auto,source,1920,auto,sourcedialog-rtl,1944,auto,sourcedialog,1968,auto,specialchar,1992,auto,table,2016,auto,templates-rtl,2040,auto,templates,2064,auto,uicolor,2088,auto,redo-rtl,2112,auto,redo,2136,auto,undo-rtl,2160,auto,undo,2184,auto,simplebox,2208,auto,spellchecker,2232,auto",
  21759. "icons.png")
  21760. }()
  21761. })();