Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ckeditor.js 1.0MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412
  1. /*
  2. Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.md or http://ckeditor.com/license
  4. */
  5. (function() {
  6. window.CKEDITOR && window.CKEDITOR.dom || (window.CKEDITOR || (window.CKEDITOR = function() {
  7. var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,
  8. f = {
  9. timestamp: "GB8C",
  10. version: "4.6.1 (Standard)",
  11. revision: "580bcaf",
  12. rnd: Math.floor(900 * Math.random()) + 100,
  13. _: {
  14. pending: [],
  15. basePathSrcPattern: a
  16. },
  17. status: "unloaded",
  18. basePath: function() {
  19. var b = window.CKEDITOR_BASEPATH || "";
  20. if (!b)
  21. for (var c = document.getElementsByTagName("script"), f = 0; f < c.length; f++) {
  22. var d = c[f].src.match(a);
  23. if (d) {
  24. b = d[1];
  25. break
  26. }
  27. } - 1 == b.indexOf(":/") && "//" !=
  28. b.slice(0, 2) && (b = 0 === b.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] + b : location.href.match(/^[^\?]*\/(?:)/)[0] + b);
  29. if (!b) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
  30. return b
  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("?") ? "\x26" : "?") + "t\x3d" + this.timestamp);
  35. return a
  36. },
  37. domReady: function() {
  38. function a() {
  39. try {
  40. document.addEventListener ? (document.removeEventListener("DOMContentLoaded", a, !1), b()) : document.attachEvent && "complete" === document.readyState && (document.detachEvent("onreadystatechange", a), b())
  41. } catch (d) {}
  42. }
  43. function b() {
  44. for (var a; a = c.shift();) a()
  45. }
  46. var c = [];
  47. return function(d) {
  48. function b() {
  49. try {
  50. document.documentElement.doScroll("left")
  51. } catch (g) {
  52. setTimeout(b, 1);
  53. return
  54. }
  55. a()
  56. }
  57. c.push(d);
  58. "complete" === document.readyState && setTimeout(a, 1);
  59. if (1 == c.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 (k) {}
  69. document.documentElement.doScroll && d && b()
  70. }
  71. }
  72. }()
  73. },
  74. b = window.CKEDITOR_GETURL;
  75. if (b) {
  76. var c = f.getUrl;
  77. f.getUrl = function(a) {
  78. return b.call(f, a) || c.call(f, a)
  79. }
  80. }
  81. return f
  82. }()), CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(a) {
  83. var f = CKEDITOR.event.prototype,
  84. b;
  85. for (b in f) null == a[b] && (a[b] = f[b])
  86. },
  87. CKEDITOR.event.prototype = function() {
  88. function a(a) {
  89. var e = f(this);
  90. return e[a] || (e[a] = new b(a))
  91. }
  92. var f = 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 b = 0, f = this.listeners; b < f.length; b++)
  103. if (f[b].fn == a) return b;
  104. return -1
  105. }
  106. };
  107. return {
  108. define: function(b, e) {
  109. var f = a.call(this, b);
  110. CKEDITOR.tools.extend(f, e, !0)
  111. },
  112. on: function(b, e, f, l, d) {
  113. function h(a, g, d, h) {
  114. a = {
  115. name: b,
  116. sender: this,
  117. editor: a,
  118. data: g,
  119. listenerData: l,
  120. stop: d,
  121. cancel: h,
  122. removeListener: k
  123. };
  124. return !1 === e.call(f, a) ? !1 : a.data
  125. }
  126. function k() {
  127. n.removeListener(b, e)
  128. }
  129. var g = a.call(this, b);
  130. if (0 > g.getListenerIndex(e)) {
  131. g = g.listeners;
  132. f || (f = this);
  133. isNaN(d) && (d = 10);
  134. var n = this;
  135. h.fn = e;
  136. h.priority = d;
  137. for (var w = g.length - 1; 0 <= w; w--)
  138. if (g[w].priority <= d) return g.splice(w + 1, 0, h), {
  139. removeListener: k
  140. };
  141. g.unshift(h)
  142. }
  143. return {
  144. removeListener: k
  145. }
  146. },
  147. once: function() {
  148. var a = Array.prototype.slice.call(arguments),
  149. b = a[1];
  150. a[1] = function(a) {
  151. a.removeListener();
  152. return b.apply(this,
  153. arguments)
  154. };
  155. return this.on.apply(this, a)
  156. },
  157. capture: function() {
  158. CKEDITOR.event.useCapture = 1;
  159. var a = this.on.apply(this, arguments);
  160. CKEDITOR.event.useCapture = 0;
  161. return a
  162. },
  163. fire: function() {
  164. var a = 0,
  165. b = function() {
  166. a = 1
  167. },
  168. m = 0,
  169. l = function() {
  170. m = 1
  171. };
  172. return function(d, h, k) {
  173. var g = f(this)[d];
  174. d = a;
  175. var n = m;
  176. a = m = 0;
  177. if (g) {
  178. var w = g.listeners;
  179. if (w.length)
  180. for (var w = w.slice(0), q, v = 0; v < w.length; v++) {
  181. if (g.errorProof) try {
  182. q = w[v].call(this, k, h, b, l)
  183. } catch (u) {} else q = w[v].call(this, k, h, b, l);
  184. !1 === q ? m = 1 : "undefined" != typeof q && (h = q);
  185. if (a || m) break
  186. }
  187. }
  188. h =
  189. m ? !1 : "undefined" == typeof h ? !0 : h;
  190. a = d;
  191. m = n;
  192. return h
  193. }
  194. }(),
  195. fireOnce: function(a, b, m) {
  196. b = this.fire(a, b, m);
  197. delete f(this)[a];
  198. return b
  199. },
  200. removeListener: function(a, b) {
  201. var m = f(this)[a];
  202. if (m) {
  203. var l = m.getListenerIndex(b);
  204. 0 <= l && m.listeners.splice(l, 1)
  205. }
  206. },
  207. removeAllListeners: function() {
  208. var a = f(this),
  209. b;
  210. for (b in a) delete a[b]
  211. },
  212. hasListeners: function(a) {
  213. return (a = f(this)[a]) && 0 < a.listeners.length
  214. }
  215. }
  216. }()), CKEDITOR.editor || (CKEDITOR.editor = function() {
  217. CKEDITOR._.pending.push([this, arguments]);
  218. CKEDITOR.event.call(this)
  219. }, CKEDITOR.editor.prototype.fire =
  220. function(a, f) {
  221. a in {
  222. instanceReady: 1,
  223. loaded: 1
  224. } && (this[a] = !0);
  225. return CKEDITOR.event.prototype.fire.call(this, a, f, this)
  226. }, CKEDITOR.editor.prototype.fireOnce = function(a, f) {
  227. a in {
  228. instanceReady: 1,
  229. loaded: 1
  230. } && (this[a] = !0);
  231. return CKEDITOR.event.prototype.fireOnce.call(this, a, f, this)
  232. }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)), CKEDITOR.env || (CKEDITOR.env = function() {
  233. var a = navigator.userAgent.toLowerCase(),
  234. f = a.match(/edge[ \/](\d+.?\d*)/),
  235. b = -1 < a.indexOf("trident/"),
  236. b = !(!f && !b),
  237. b = {
  238. ie: b,
  239. edge: !!f,
  240. webkit: !b &&
  241. -1 < a.indexOf(" applewebkit/"),
  242. air: -1 < a.indexOf(" adobeair/"),
  243. mac: -1 < a.indexOf("macintosh"),
  244. quirks: "BackCompat" == document.compatMode && (!document.documentMode || 10 > document.documentMode),
  245. mobile: -1 < a.indexOf("mobile"),
  246. iOS: /(ipad|iphone|ipod)/.test(a),
  247. isCustomDomain: function() {
  248. if (!this.ie) return !1;
  249. var a = document.domain,
  250. b = window.location.hostname;
  251. return a != b && a != "[" + b + "]"
  252. },
  253. secure: "https:" == location.protocol
  254. };
  255. b.gecko = "Gecko" == navigator.product && !b.webkit && !b.ie;
  256. b.webkit && (-1 < a.indexOf("chrome") ? b.chrome = !0 : b.safari = !0);
  257. var c = 0;
  258. b.ie && (c = f ? parseFloat(f[1]) : b.quirks || !document.documentMode ? parseFloat(a.match(/msie (\d+)/)[1]) : document.documentMode, b.ie9Compat = 9 == c, b.ie8Compat = 8 == c, b.ie7Compat = 7 == c, b.ie6Compat = 7 > c || b.quirks);
  259. b.gecko && (f = a.match(/rv:([\d\.]+)/)) && (f = f[1].split("."), c = 1E4 * f[0] + 100 * (f[1] || 0) + 1 * (f[2] || 0));
  260. b.air && (c = parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
  261. b.webkit && (c = parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
  262. b.version = c;
  263. b.isCompatible = !(b.ie && 7 > c) && !(b.gecko && 4E4 > c) && !(b.webkit &&
  264. 534 > c);
  265. b.hidpi = 2 <= window.devicePixelRatio;
  266. b.needsBrFiller = b.gecko || b.webkit || b.ie && 10 < c;
  267. b.needsNbspFiller = b.ie && 11 > c;
  268. b.cssClass = "cke_browser_" + (b.ie ? "ie" : b.gecko ? "gecko" : b.webkit ? "webkit" : "unknown");
  269. b.quirks && (b.cssClass += " cke_browser_quirks");
  270. b.ie && (b.cssClass += " cke_browser_ie" + (b.quirks ? "6 cke_browser_iequirks" : b.version));
  271. b.air && (b.cssClass += " cke_browser_air");
  272. b.iOS && (b.cssClass += " cke_browser_ios");
  273. b.hidpi && (b.cssClass += " cke_hidpi");
  274. return b
  275. }()), "unloaded" == CKEDITOR.status && function() {
  276. CKEDITOR.event.implementOn(CKEDITOR);
  277. CKEDITOR.loadFullCore = function() {
  278. if ("basic_ready" != CKEDITOR.status) CKEDITOR.loadFullCore._load = 1;
  279. else {
  280. delete CKEDITOR.loadFullCore;
  281. var a = document.createElement("script");
  282. a.type = "text/javascript";
  283. a.src = CKEDITOR.basePath + "ckeditor.js";
  284. document.getElementsByTagName("head")[0].appendChild(a)
  285. }
  286. };
  287. CKEDITOR.loadFullCoreTimeout = 0;
  288. CKEDITOR.add = function(a) {
  289. (this._.pending || (this._.pending = [])).push(a)
  290. };
  291. (function() {
  292. CKEDITOR.domReady(function() {
  293. var a = CKEDITOR.loadFullCore,
  294. f = CKEDITOR.loadFullCoreTimeout;
  295. a && (CKEDITOR.status =
  296. "basic_ready", a && a._load ? a() : f && setTimeout(function() {
  297. CKEDITOR.loadFullCore && CKEDITOR.loadFullCore()
  298. }, 1E3 * f))
  299. })
  300. })();
  301. CKEDITOR.status = "basic_loaded"
  302. }(), "use strict", CKEDITOR.VERBOSITY_WARN = 1, CKEDITOR.VERBOSITY_ERROR = 2, CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR, CKEDITOR.warn = function(a, f) {
  303. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN && CKEDITOR.fire("log", {
  304. type: "warn",
  305. errorCode: a,
  306. additionalData: f
  307. })
  308. }, CKEDITOR.error = function(a, f) {
  309. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR && CKEDITOR.fire("log", {
  310. type: "error",
  311. errorCode: a,
  312. additionalData: f
  313. })
  314. }, CKEDITOR.on("log", function(a) {
  315. if (window.console && window.console.log) {
  316. var f = console[a.data.type] ? a.data.type : "log",
  317. b = a.data.errorCode;
  318. if (a = a.data.additionalData) console[f]("[CKEDITOR] Error code: " + b + ".", a);
  319. else console[f]("[CKEDITOR] Error code: " + b + ".");
  320. console[f]("[CKEDITOR] For more information about this error go to http://docs.ckeditor.com/#!/guide/dev_errors-section-" + b)
  321. }
  322. }, null, null, 999), CKEDITOR.dom = {}, function() {
  323. var a = [],
  324. f = CKEDITOR.env.gecko ? "-moz-" :
  325. CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "",
  326. b = /&/g,
  327. c = />/g,
  328. e = /</g,
  329. m = /"/g,
  330. l = /&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,
  331. d = {
  332. lt: "\x3c",
  333. gt: "\x3e",
  334. amp: "\x26",
  335. quot: '"',
  336. nbsp: " ",
  337. shy: "­"
  338. },
  339. h = function(a, g) {
  340. return "#" == g[0] ? String.fromCharCode(parseInt(g.slice(1), 10)) : d[g]
  341. };
  342. CKEDITOR.on("reset", function() {
  343. a = []
  344. });
  345. CKEDITOR.tools = {
  346. arrayCompare: function(a, g) {
  347. if (!a && !g) return !0;
  348. if (!a || !g || a.length != g.length) return !1;
  349. for (var d = 0; d < a.length; d++)
  350. if (a[d] != g[d]) return !1;
  351. return !0
  352. },
  353. getIndex: function(a, g) {
  354. for (var d =
  355. 0; d < a.length; ++d)
  356. if (g(a[d])) return d;
  357. return -1
  358. },
  359. clone: function(a) {
  360. var g;
  361. if (a && a instanceof Array) {
  362. g = [];
  363. for (var d = 0; d < a.length; d++) g[d] = CKEDITOR.tools.clone(a[d]);
  364. return g
  365. }
  366. if (null === a || "object" != typeof a || a instanceof String || a instanceof Number || a instanceof Boolean || a instanceof Date || a instanceof RegExp || a.nodeType || a.window === a) return a;
  367. g = new a.constructor;
  368. for (d in a) g[d] = CKEDITOR.tools.clone(a[d]);
  369. return g
  370. },
  371. capitalize: function(a, g) {
  372. return a.charAt(0).toUpperCase() + (g ? a.slice(1) : a.slice(1).toLowerCase())
  373. },
  374. extend: function(a) {
  375. var g = arguments.length,
  376. d, b;
  377. "boolean" == typeof(d = arguments[g - 1]) ? g-- : "boolean" == typeof(d = arguments[g - 2]) && (b = arguments[g - 1], g -= 2);
  378. for (var h = 1; h < g; h++) {
  379. var c = arguments[h],
  380. e;
  381. for (e in c)
  382. if (!0 === d || null == a[e])
  383. if (!b || e in b) a[e] = c[e]
  384. }
  385. return a
  386. },
  387. prototypedCopy: function(a) {
  388. var g = function() {};
  389. g.prototype = a;
  390. return new g
  391. },
  392. copy: function(a) {
  393. var g = {},
  394. d;
  395. for (d in a) g[d] = a[d];
  396. return g
  397. },
  398. isArray: function(a) {
  399. return "[object Array]" == Object.prototype.toString.call(a)
  400. },
  401. isEmpty: function(a) {
  402. for (var g in a)
  403. if (a.hasOwnProperty(g)) return !1;
  404. return !0
  405. },
  406. cssVendorPrefix: function(a, g, d) {
  407. if (d) return f + a + ":" + g + ";" + a + ":" + g;
  408. d = {};
  409. d[a] = g;
  410. d[f + a] = g;
  411. return d
  412. },
  413. cssStyleToDomStyle: function() {
  414. var a = document.createElement("div").style,
  415. g = "undefined" != typeof a.cssFloat ? "cssFloat" : "undefined" != typeof a.styleFloat ? "styleFloat" : "float";
  416. return function(a) {
  417. return "float" == a ? g : a.replace(/-./g, function(a) {
  418. return a.substr(1).toUpperCase()
  419. })
  420. }
  421. }(),
  422. buildStyleHtml: function(a) {
  423. a = [].concat(a);
  424. for (var g, d = [], b = 0; b < a.length; b++)
  425. if (g = a[b]) /@import|[{}]/.test(g) ? d.push("\x3cstyle\x3e" +
  426. g + "\x3c/style\x3e") : d.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"' + g + '"\x3e');
  427. return d.join("")
  428. },
  429. htmlEncode: function(a) {
  430. return void 0 === a || null === a ? "" : String(a).replace(b, "\x26amp;").replace(c, "\x26gt;").replace(e, "\x26lt;")
  431. },
  432. htmlDecode: function(a) {
  433. return a.replace(l, h)
  434. },
  435. htmlEncodeAttr: function(a) {
  436. return CKEDITOR.tools.htmlEncode(a).replace(m, "\x26quot;")
  437. },
  438. htmlDecodeAttr: function(a) {
  439. return CKEDITOR.tools.htmlDecode(a)
  440. },
  441. transformPlainTextToHtml: function(a, g) {
  442. var d = g == CKEDITOR.ENTER_BR,
  443. b = this.htmlEncode(a.replace(/\r\n/g, "\n")),
  444. b = b.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;"),
  445. h = g == CKEDITOR.ENTER_P ? "p" : "div";
  446. if (!d) {
  447. var c = /\n{2}/g;
  448. if (c.test(b)) var e = "\x3c" + h + "\x3e",
  449. f = "\x3c/" + h + "\x3e",
  450. b = e + b.replace(c, function() {
  451. return f + e
  452. }) + f
  453. }
  454. b = b.replace(/\n/g, "\x3cbr\x3e");
  455. d || (b = b.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/" + h + "\x3e)"), function(a) {
  456. return CKEDITOR.tools.repeat(a, 2)
  457. }));
  458. b = b.replace(/^ | $/g, "\x26nbsp;");
  459. return b = b.replace(/(>|\s) /g, function(a, g) {
  460. return g + "\x26nbsp;"
  461. }).replace(/ (?=<)/g,
  462. "\x26nbsp;")
  463. },
  464. getNextNumber: function() {
  465. var a = 0;
  466. return function() {
  467. return ++a
  468. }
  469. }(),
  470. getNextId: function() {
  471. return "cke_" + this.getNextNumber()
  472. },
  473. getUniqueId: function() {
  474. for (var a = "e", g = 0; 8 > g; g++) a += Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
  475. return a
  476. },
  477. override: function(a, g) {
  478. var d = g(a);
  479. d.prototype = a.prototype;
  480. return d
  481. },
  482. setTimeout: function(a, g, d, b, h) {
  483. h || (h = window);
  484. d || (d = h);
  485. return h.setTimeout(function() {
  486. b ? a.apply(d, [].concat(b)) : a.apply(d)
  487. }, g || 0)
  488. },
  489. trim: function() {
  490. var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
  491. return function(g) {
  492. return g.replace(a, "")
  493. }
  494. }(),
  495. ltrim: function() {
  496. var a = /^[ \t\n\r]+/g;
  497. return function(g) {
  498. return g.replace(a, "")
  499. }
  500. }(),
  501. rtrim: function() {
  502. var a = /[ \t\n\r]+$/g;
  503. return function(g) {
  504. return g.replace(a, "")
  505. }
  506. }(),
  507. indexOf: function(a, g) {
  508. if ("function" == typeof g)
  509. for (var d = 0, b = a.length; d < b; d++) {
  510. if (g(a[d])) return d
  511. } else {
  512. if (a.indexOf) return a.indexOf(g);
  513. d = 0;
  514. for (b = a.length; d < b; d++)
  515. if (a[d] === g) return d
  516. }
  517. return -1
  518. },
  519. search: function(a, g) {
  520. var d = CKEDITOR.tools.indexOf(a, g);
  521. return 0 <= d ? a[d] : null
  522. },
  523. bind: function(a,
  524. g) {
  525. return function() {
  526. return a.apply(g, arguments)
  527. }
  528. },
  529. createClass: function(a) {
  530. var g = a.$,
  531. d = a.base,
  532. b = a.privates || a._,
  533. h = a.proto;
  534. a = a.statics;
  535. !g && (g = function() {
  536. d && this.base.apply(this, arguments)
  537. });
  538. if (b) var c = g,
  539. g = function() {
  540. var a = this._ || (this._ = {}),
  541. g;
  542. for (g in b) {
  543. var d = b[g];
  544. a[g] = "function" == typeof d ? CKEDITOR.tools.bind(d, this) : d
  545. }
  546. c.apply(this, arguments)
  547. };
  548. d && (g.prototype = this.prototypedCopy(d.prototype), g.prototype.constructor = g, g.base = d, g.baseProto = d.prototype, g.prototype.base = function() {
  549. this.base = d.prototype.base;
  550. d.apply(this, arguments);
  551. this.base = arguments.callee
  552. });
  553. h && this.extend(g.prototype, h, !0);
  554. a && this.extend(g, a, !0);
  555. return g
  556. },
  557. addFunction: function(d, g) {
  558. return a.push(function() {
  559. return d.apply(g || this, arguments)
  560. }) - 1
  561. },
  562. removeFunction: function(d) {
  563. a[d] = null
  564. },
  565. callFunction: function(d) {
  566. var g = a[d];
  567. return g && g.apply(window, Array.prototype.slice.call(arguments, 1))
  568. },
  569. cssLength: function() {
  570. var a = /^-?\d+\.?\d*px$/,
  571. g;
  572. return function(d) {
  573. g = CKEDITOR.tools.trim(d + "") + "px";
  574. return a.test(g) ? g : d || ""
  575. }
  576. }(),
  577. convertToPx: function() {
  578. var a;
  579. return function(g) {
  580. a || (a = CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"\x3e\x3c/div\x3e', CKEDITOR.document), CKEDITOR.document.getBody().append(a));
  581. return /%$/.test(g) ? g : (a.setStyle("width", g), a.$.clientWidth)
  582. }
  583. }(),
  584. repeat: function(a, g) {
  585. return Array(g + 1).join(a)
  586. },
  587. tryThese: function() {
  588. for (var a, g = 0, d = arguments.length; g < d; g++) {
  589. var b = arguments[g];
  590. try {
  591. a = b();
  592. break
  593. } catch (h) {}
  594. }
  595. return a
  596. },
  597. genKey: function() {
  598. return Array.prototype.slice.call(arguments).join("-")
  599. },
  600. defer: function(a) {
  601. return function() {
  602. var g = arguments,
  603. d = this;
  604. window.setTimeout(function() {
  605. a.apply(d, g)
  606. }, 0)
  607. }
  608. },
  609. normalizeCssText: function(a, g) {
  610. var d = [],
  611. b, h = CKEDITOR.tools.parseCssText(a, !0, g);
  612. for (b in h) d.push(b + ":" + h[b]);
  613. d.sort();
  614. return d.length ? d.join(";") + ";" : ""
  615. },
  616. convertRgbToHex: function(a) {
  617. return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function(a, d, b, k) {
  618. a = [d, b, k];
  619. for (d = 0; 3 > d; d++) a[d] = ("0" + parseInt(a[d], 10).toString(16)).slice(-2);
  620. return "#" + a.join("")
  621. })
  622. },
  623. normalizeHex: function(a) {
  624. return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,
  625. function(a, d, b, k) {
  626. a = d.toLowerCase();
  627. 3 == a.length && (a = a.split(""), a = [a[0], a[0], a[1], a[1], a[2], a[2]].join(""));
  628. return "#" + a + k
  629. })
  630. },
  631. parseCssText: function(a, g, d) {
  632. var b = {};
  633. d && (a = (new CKEDITOR.dom.element("span")).setAttribute("style", a).getAttribute("style") || "");
  634. a && (a = CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));
  635. if (!a || ";" == a) return b;
  636. a.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, d, k) {
  637. g && (d = d.toLowerCase(), "font-family" == d && (k = k.replace(/\s*,\s*/g,
  638. ",")), k = CKEDITOR.tools.trim(k));
  639. b[d] = k
  640. });
  641. return b
  642. },
  643. writeCssText: function(a, g) {
  644. var d, b = [];
  645. for (d in a) b.push(d + ":" + a[d]);
  646. g && b.sort();
  647. return b.join("; ")
  648. },
  649. objectCompare: function(a, g, d) {
  650. var b;
  651. if (!a && !g) return !0;
  652. if (!a || !g) return !1;
  653. for (b in a)
  654. if (a[b] != g[b]) return !1;
  655. if (!d)
  656. for (b in g)
  657. if (a[b] != g[b]) return !1;
  658. return !0
  659. },
  660. objectKeys: function(a) {
  661. var g = [],
  662. d;
  663. for (d in a) g.push(d);
  664. return g
  665. },
  666. convertArrayToObject: function(a, g) {
  667. var d = {};
  668. 1 == arguments.length && (g = !0);
  669. for (var b = 0, h = a.length; b < h; ++b) d[a[b]] = g;
  670. return d
  671. },
  672. fixDomain: function() {
  673. for (var a;;) try {
  674. a =
  675. window.parent.document.domain;
  676. break
  677. } catch (g) {
  678. a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain;
  679. if (!a) break;
  680. document.domain = a
  681. }
  682. return !!a
  683. },
  684. eventsBuffer: function(a, g, d) {
  685. function b() {
  686. c = (new Date).getTime();
  687. h = !1;
  688. d ? g.call(d) : g()
  689. }
  690. var h, c = 0;
  691. return {
  692. input: function() {
  693. if (!h) {
  694. var g = (new Date).getTime() - c;
  695. g < a ? h = setTimeout(b, a - g) : b()
  696. }
  697. },
  698. reset: function() {
  699. h && clearTimeout(h);
  700. h = c = 0
  701. }
  702. }
  703. },
  704. enableHtml5Elements: function(a, g) {
  705. for (var d = "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "),
  706. b = d.length, h; b--;) h = a.createElement(d[b]), g && a.appendChild(h)
  707. },
  708. checkIfAnyArrayItemMatches: function(a, g) {
  709. for (var d = 0, b = a.length; d < b; ++d)
  710. if (a[d].match(g)) return !0;
  711. return !1
  712. },
  713. checkIfAnyObjectPropertyMatches: function(a, g) {
  714. for (var d in a)
  715. if (d.match(g)) return !0;
  716. return !1
  717. },
  718. keystrokeToString: function(a, g) {
  719. var d = g & 16711680,
  720. b = g & 65535,
  721. h = CKEDITOR.env.mac,
  722. c = [],
  723. e = [];
  724. d & CKEDITOR.CTRL && (c.push(h ? "⌘" : a[17]), e.push(h ? a[224] : a[17]));
  725. d & CKEDITOR.ALT && (c.push(h ? "⌥" : a[18]), e.push(a[18]));
  726. d & CKEDITOR.SHIFT && (c.push(h ? "⇧" : a[16]),
  727. e.push(a[16]));
  728. b && (a[b] ? (c.push(a[b]), e.push(a[b])) : (c.push(String.fromCharCode(b)), e.push(String.fromCharCode(b))));
  729. return {
  730. display: c.join("+"),
  731. aria: e.join("+")
  732. }
  733. },
  734. transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",
  735. getCookie: function(a) {
  736. a = a.toLowerCase();
  737. for (var g = document.cookie.split(";"), d, b, h = 0; h < g.length; h++)
  738. if (d = g[h].split("\x3d"), b = decodeURIComponent(CKEDITOR.tools.trim(d[0]).toLowerCase()), b === a) return decodeURIComponent(1 < d.length ?
  739. d[1] : "");
  740. return null
  741. },
  742. setCookie: function(a, g) {
  743. document.cookie = encodeURIComponent(a) + "\x3d" + encodeURIComponent(g) + ";path\x3d/"
  744. },
  745. getCsrfToken: function() {
  746. var a = CKEDITOR.tools.getCookie("ckCsrfToken");
  747. if (!a || 40 != a.length) {
  748. var a = [],
  749. g = "";
  750. if (window.crypto && window.crypto.getRandomValues) a = new Uint8Array(40), window.crypto.getRandomValues(a);
  751. else
  752. for (var d = 0; 40 > d; d++) a.push(Math.floor(256 * Math.random()));
  753. for (d = 0; d < a.length; d++) var b = "abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[d] % 36),
  754. g = g + (.5 < Math.random() ?
  755. b.toUpperCase() : b);
  756. a = g;
  757. CKEDITOR.tools.setCookie("ckCsrfToken", a)
  758. }
  759. return a
  760. },
  761. escapeCss: function(a) {
  762. return a ? window.CSS && CSS.escape ? CSS.escape(a) : isNaN(parseInt(a.charAt(0), 10)) ? a : "\\3" + a.charAt(0) + " " + a.substring(1, a.length) : ""
  763. },
  764. style: {
  765. parse: {
  766. _colors: {
  767. aliceblue: "#F0F8FF",
  768. antiquewhite: "#FAEBD7",
  769. aqua: "#00FFFF",
  770. aquamarine: "#7FFFD4",
  771. azure: "#F0FFFF",
  772. beige: "#F5F5DC",
  773. bisque: "#FFE4C4",
  774. black: "#000000",
  775. blanchedalmond: "#FFEBCD",
  776. blue: "#0000FF",
  777. blueviolet: "#8A2BE2",
  778. brown: "#A52A2A",
  779. burlywood: "#DEB887",
  780. cadetblue: "#5F9EA0",
  781. chartreuse: "#7FFF00",
  782. chocolate: "#D2691E",
  783. coral: "#FF7F50",
  784. cornflowerblue: "#6495ED",
  785. cornsilk: "#FFF8DC",
  786. crimson: "#DC143C",
  787. cyan: "#00FFFF",
  788. darkblue: "#00008B",
  789. darkcyan: "#008B8B",
  790. darkgoldenrod: "#B8860B",
  791. darkgray: "#A9A9A9",
  792. darkgreen: "#006400",
  793. darkgrey: "#A9A9A9",
  794. darkkhaki: "#BDB76B",
  795. darkmagenta: "#8B008B",
  796. darkolivegreen: "#556B2F",
  797. darkorange: "#FF8C00",
  798. darkorchid: "#9932CC",
  799. darkred: "#8B0000",
  800. darksalmon: "#E9967A",
  801. darkseagreen: "#8FBC8F",
  802. darkslateblue: "#483D8B",
  803. darkslategray: "#2F4F4F",
  804. darkslategrey: "#2F4F4F",
  805. darkturquoise: "#00CED1",
  806. darkviolet: "#9400D3",
  807. deeppink: "#FF1493",
  808. deepskyblue: "#00BFFF",
  809. dimgray: "#696969",
  810. dimgrey: "#696969",
  811. dodgerblue: "#1E90FF",
  812. firebrick: "#B22222",
  813. floralwhite: "#FFFAF0",
  814. forestgreen: "#228B22",
  815. fuchsia: "#FF00FF",
  816. gainsboro: "#DCDCDC",
  817. ghostwhite: "#F8F8FF",
  818. gold: "#FFD700",
  819. goldenrod: "#DAA520",
  820. gray: "#808080",
  821. green: "#008000",
  822. greenyellow: "#ADFF2F",
  823. grey: "#808080",
  824. honeydew: "#F0FFF0",
  825. hotpink: "#FF69B4",
  826. indianred: "#CD5C5C",
  827. indigo: "#4B0082",
  828. ivory: "#FFFFF0",
  829. khaki: "#F0E68C",
  830. lavender: "#E6E6FA",
  831. lavenderblush: "#FFF0F5",
  832. lawngreen: "#7CFC00",
  833. lemonchiffon: "#FFFACD",
  834. lightblue: "#ADD8E6",
  835. lightcoral: "#F08080",
  836. lightcyan: "#E0FFFF",
  837. lightgoldenrodyellow: "#FAFAD2",
  838. lightgray: "#D3D3D3",
  839. lightgreen: "#90EE90",
  840. lightgrey: "#D3D3D3",
  841. lightpink: "#FFB6C1",
  842. lightsalmon: "#FFA07A",
  843. lightseagreen: "#20B2AA",
  844. lightskyblue: "#87CEFA",
  845. lightslategray: "#778899",
  846. lightslategrey: "#778899",
  847. lightsteelblue: "#B0C4DE",
  848. lightyellow: "#FFFFE0",
  849. lime: "#00FF00",
  850. limegreen: "#32CD32",
  851. linen: "#FAF0E6",
  852. magenta: "#FF00FF",
  853. maroon: "#800000",
  854. mediumaquamarine: "#66CDAA",
  855. mediumblue: "#0000CD",
  856. mediumorchid: "#BA55D3",
  857. mediumpurple: "#9370DB",
  858. mediumseagreen: "#3CB371",
  859. mediumslateblue: "#7B68EE",
  860. mediumspringgreen: "#00FA9A",
  861. mediumturquoise: "#48D1CC",
  862. mediumvioletred: "#C71585",
  863. midnightblue: "#191970",
  864. mintcream: "#F5FFFA",
  865. mistyrose: "#FFE4E1",
  866. moccasin: "#FFE4B5",
  867. navajowhite: "#FFDEAD",
  868. navy: "#000080",
  869. oldlace: "#FDF5E6",
  870. olive: "#808000",
  871. olivedrab: "#6B8E23",
  872. orange: "#FFA500",
  873. orangered: "#FF4500",
  874. orchid: "#DA70D6",
  875. palegoldenrod: "#EEE8AA",
  876. palegreen: "#98FB98",
  877. paleturquoise: "#AFEEEE",
  878. palevioletred: "#DB7093",
  879. papayawhip: "#FFEFD5",
  880. peachpuff: "#FFDAB9",
  881. peru: "#CD853F",
  882. pink: "#FFC0CB",
  883. plum: "#DDA0DD",
  884. powderblue: "#B0E0E6",
  885. purple: "#800080",
  886. rebeccapurple: "#663399",
  887. red: "#FF0000",
  888. rosybrown: "#BC8F8F",
  889. royalblue: "#4169E1",
  890. saddlebrown: "#8B4513",
  891. salmon: "#FA8072",
  892. sandybrown: "#F4A460",
  893. seagreen: "#2E8B57",
  894. seashell: "#FFF5EE",
  895. sienna: "#A0522D",
  896. silver: "#C0C0C0",
  897. skyblue: "#87CEEB",
  898. slateblue: "#6A5ACD",
  899. slategray: "#708090",
  900. slategrey: "#708090",
  901. snow: "#FFFAFA",
  902. springgreen: "#00FF7F",
  903. steelblue: "#4682B4",
  904. tan: "#D2B48C",
  905. teal: "#008080",
  906. thistle: "#D8BFD8",
  907. tomato: "#FF6347",
  908. turquoise: "#40E0D0",
  909. violet: "#EE82EE",
  910. wheat: "#F5DEB3",
  911. white: "#FFFFFF",
  912. whitesmoke: "#F5F5F5",
  913. yellow: "#FFFF00",
  914. yellowgreen: "#9ACD32"
  915. },
  916. _rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  917. _hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  918. background: function(a) {
  919. var g = [],
  920. d = [],
  921. d = this._findColor(a);
  922. d.length && (g.color = d[0], CKEDITOR.tools.array.forEach(d, function(g) {
  923. a = a.replace(g, "")
  924. }));
  925. if (a = CKEDITOR.tools.trim(a)) g.unprocessed = a;
  926. return g
  927. },
  928. margin: function(a) {
  929. function g(a) {
  930. d.top =
  931. b[a[0]];
  932. d.right = b[a[1]];
  933. d.bottom = b[a[2]];
  934. d.left = b[a[3]]
  935. }
  936. var d = {},
  937. b = a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset)/g) || ["0px"];
  938. switch (b.length) {
  939. case 1:
  940. g([0, 0, 0, 0]);
  941. break;
  942. case 2:
  943. g([0, 1, 0, 1]);
  944. break;
  945. case 3:
  946. g([0, 1, 2, 1]);
  947. break;
  948. case 4:
  949. g([0, 1, 2, 3])
  950. }
  951. return d
  952. },
  953. _findColor: function(a) {
  954. var g = [],
  955. d = CKEDITOR.tools.array,
  956. g = g.concat(a.match(this._rgbaRegExp) || []),
  957. g = g.concat(a.match(this._hslaRegExp) || []);
  958. return g = g.concat(d.filter(a.split(/\s+/), function(a) {
  959. return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi) ?
  960. !0 : a.toLowerCase() in CKEDITOR.tools.style.parse._colors
  961. }))
  962. }
  963. }
  964. },
  965. array: {
  966. filter: function(a, g, d) {
  967. var b = [];
  968. this.forEach(a, function(h, c) {
  969. g.call(d, h, c, a) && b.push(h)
  970. });
  971. return b
  972. },
  973. forEach: function(a, g, d) {
  974. var b = a.length,
  975. h;
  976. for (h = 0; h < b; h++) g.call(d, a[h], h, a)
  977. }
  978. }
  979. };
  980. CKEDITOR.tools.array.indexOf = CKEDITOR.tools.indexOf;
  981. CKEDITOR.tools.array.isArray = CKEDITOR.tools.isArray
  982. }(), CKEDITOR.dtd = function() {
  983. var a = CKEDITOR.tools.extend,
  984. f = function(a, g) {
  985. for (var d = CKEDITOR.tools.clone(a), b = 1; b < arguments.length; b++) {
  986. g = arguments[b];
  987. for (var h in g) delete d[h]
  988. }
  989. return d
  990. },
  991. b = {},
  992. c = {},
  993. e = {
  994. address: 1,
  995. article: 1,
  996. aside: 1,
  997. blockquote: 1,
  998. details: 1,
  999. div: 1,
  1000. dl: 1,
  1001. fieldset: 1,
  1002. figure: 1,
  1003. footer: 1,
  1004. form: 1,
  1005. h1: 1,
  1006. h2: 1,
  1007. h3: 1,
  1008. h4: 1,
  1009. h5: 1,
  1010. h6: 1,
  1011. header: 1,
  1012. hgroup: 1,
  1013. hr: 1,
  1014. main: 1,
  1015. menu: 1,
  1016. nav: 1,
  1017. ol: 1,
  1018. p: 1,
  1019. pre: 1,
  1020. section: 1,
  1021. table: 1,
  1022. ul: 1
  1023. },
  1024. m = {
  1025. command: 1,
  1026. link: 1,
  1027. meta: 1,
  1028. noscript: 1,
  1029. script: 1,
  1030. style: 1
  1031. },
  1032. l = {},
  1033. d = {
  1034. "#": 1
  1035. },
  1036. h = {
  1037. center: 1,
  1038. dir: 1,
  1039. noframes: 1
  1040. };
  1041. a(b, {
  1042. a: 1,
  1043. abbr: 1,
  1044. area: 1,
  1045. audio: 1,
  1046. b: 1,
  1047. bdi: 1,
  1048. bdo: 1,
  1049. br: 1,
  1050. button: 1,
  1051. canvas: 1,
  1052. cite: 1,
  1053. code: 1,
  1054. command: 1,
  1055. datalist: 1,
  1056. del: 1,
  1057. dfn: 1,
  1058. em: 1,
  1059. embed: 1,
  1060. i: 1,
  1061. iframe: 1,
  1062. img: 1,
  1063. input: 1,
  1064. ins: 1,
  1065. kbd: 1,
  1066. keygen: 1,
  1067. label: 1,
  1068. map: 1,
  1069. mark: 1,
  1070. meter: 1,
  1071. noscript: 1,
  1072. object: 1,
  1073. output: 1,
  1074. progress: 1,
  1075. q: 1,
  1076. ruby: 1,
  1077. s: 1,
  1078. samp: 1,
  1079. script: 1,
  1080. select: 1,
  1081. small: 1,
  1082. span: 1,
  1083. strong: 1,
  1084. sub: 1,
  1085. sup: 1,
  1086. textarea: 1,
  1087. time: 1,
  1088. u: 1,
  1089. "var": 1,
  1090. video: 1,
  1091. wbr: 1
  1092. }, d, {
  1093. acronym: 1,
  1094. applet: 1,
  1095. basefont: 1,
  1096. big: 1,
  1097. font: 1,
  1098. isindex: 1,
  1099. strike: 1,
  1100. style: 1,
  1101. tt: 1
  1102. });
  1103. a(c, e, b, h);
  1104. f = {
  1105. a: f(b, {
  1106. a: 1,
  1107. button: 1
  1108. }),
  1109. abbr: b,
  1110. address: c,
  1111. area: l,
  1112. article: c,
  1113. aside: c,
  1114. audio: a({
  1115. source: 1,
  1116. track: 1
  1117. }, c),
  1118. b: b,
  1119. base: l,
  1120. bdi: b,
  1121. bdo: b,
  1122. blockquote: c,
  1123. body: c,
  1124. br: l,
  1125. button: f(b, {
  1126. a: 1,
  1127. button: 1
  1128. }),
  1129. canvas: b,
  1130. caption: c,
  1131. cite: b,
  1132. code: b,
  1133. col: l,
  1134. colgroup: {
  1135. col: 1
  1136. },
  1137. command: l,
  1138. datalist: a({
  1139. option: 1
  1140. }, b),
  1141. dd: c,
  1142. del: b,
  1143. details: a({
  1144. summary: 1
  1145. }, c),
  1146. dfn: b,
  1147. div: c,
  1148. dl: {
  1149. dt: 1,
  1150. dd: 1
  1151. },
  1152. dt: c,
  1153. em: b,
  1154. embed: l,
  1155. fieldset: a({
  1156. legend: 1
  1157. }, c),
  1158. figcaption: c,
  1159. figure: a({
  1160. figcaption: 1
  1161. }, c),
  1162. footer: c,
  1163. form: c,
  1164. h1: b,
  1165. h2: b,
  1166. h3: b,
  1167. h4: b,
  1168. h5: b,
  1169. h6: b,
  1170. head: a({
  1171. title: 1,
  1172. base: 1
  1173. }, m),
  1174. header: c,
  1175. hgroup: {
  1176. h1: 1,
  1177. h2: 1,
  1178. h3: 1,
  1179. h4: 1,
  1180. h5: 1,
  1181. h6: 1
  1182. },
  1183. hr: l,
  1184. html: a({
  1185. head: 1,
  1186. body: 1
  1187. }, c, m),
  1188. i: b,
  1189. iframe: d,
  1190. img: l,
  1191. input: l,
  1192. ins: b,
  1193. kbd: b,
  1194. keygen: l,
  1195. label: b,
  1196. legend: b,
  1197. li: c,
  1198. link: l,
  1199. main: c,
  1200. map: c,
  1201. mark: b,
  1202. menu: a({
  1203. li: 1
  1204. }, c),
  1205. meta: l,
  1206. meter: f(b, {
  1207. meter: 1
  1208. }),
  1209. nav: c,
  1210. noscript: a({
  1211. link: 1,
  1212. meta: 1,
  1213. style: 1
  1214. }, b),
  1215. object: a({
  1216. param: 1
  1217. }, b),
  1218. ol: {
  1219. li: 1
  1220. },
  1221. optgroup: {
  1222. option: 1
  1223. },
  1224. option: d,
  1225. output: b,
  1226. p: b,
  1227. param: l,
  1228. pre: b,
  1229. progress: f(b, {
  1230. progress: 1
  1231. }),
  1232. q: b,
  1233. rp: b,
  1234. rt: b,
  1235. ruby: a({
  1236. rp: 1,
  1237. rt: 1
  1238. }, b),
  1239. s: b,
  1240. samp: b,
  1241. script: d,
  1242. section: c,
  1243. select: {
  1244. optgroup: 1,
  1245. option: 1
  1246. },
  1247. small: b,
  1248. source: l,
  1249. span: b,
  1250. strong: b,
  1251. style: d,
  1252. sub: b,
  1253. summary: a({
  1254. h1: 1,
  1255. h2: 1,
  1256. h3: 1,
  1257. h4: 1,
  1258. h5: 1,
  1259. h6: 1
  1260. }, b),
  1261. sup: b,
  1262. table: {
  1263. caption: 1,
  1264. colgroup: 1,
  1265. thead: 1,
  1266. tfoot: 1,
  1267. tbody: 1,
  1268. tr: 1
  1269. },
  1270. tbody: {
  1271. tr: 1
  1272. },
  1273. td: c,
  1274. textarea: d,
  1275. tfoot: {
  1276. tr: 1
  1277. },
  1278. th: c,
  1279. thead: {
  1280. tr: 1
  1281. },
  1282. time: f(b, {
  1283. time: 1
  1284. }),
  1285. title: d,
  1286. tr: {
  1287. th: 1,
  1288. td: 1
  1289. },
  1290. track: l,
  1291. u: b,
  1292. ul: {
  1293. li: 1
  1294. },
  1295. "var": b,
  1296. video: a({
  1297. source: 1,
  1298. track: 1
  1299. }, c),
  1300. wbr: l,
  1301. acronym: b,
  1302. applet: a({
  1303. param: 1
  1304. }, c),
  1305. basefont: l,
  1306. big: b,
  1307. center: c,
  1308. dialog: l,
  1309. dir: {
  1310. li: 1
  1311. },
  1312. font: b,
  1313. isindex: l,
  1314. noframes: c,
  1315. strike: b,
  1316. tt: b
  1317. };
  1318. a(f, {
  1319. $block: a({
  1320. audio: 1,
  1321. dd: 1,
  1322. dt: 1,
  1323. figcaption: 1,
  1324. li: 1,
  1325. video: 1
  1326. }, e, h),
  1327. $blockLimit: {
  1328. article: 1,
  1329. aside: 1,
  1330. audio: 1,
  1331. body: 1,
  1332. caption: 1,
  1333. details: 1,
  1334. dir: 1,
  1335. div: 1,
  1336. dl: 1,
  1337. fieldset: 1,
  1338. figcaption: 1,
  1339. figure: 1,
  1340. footer: 1,
  1341. form: 1,
  1342. header: 1,
  1343. hgroup: 1,
  1344. main: 1,
  1345. menu: 1,
  1346. nav: 1,
  1347. ol: 1,
  1348. section: 1,
  1349. table: 1,
  1350. td: 1,
  1351. th: 1,
  1352. tr: 1,
  1353. ul: 1,
  1354. video: 1
  1355. },
  1356. $cdata: {
  1357. script: 1,
  1358. style: 1
  1359. },
  1360. $editable: {
  1361. address: 1,
  1362. article: 1,
  1363. aside: 1,
  1364. blockquote: 1,
  1365. body: 1,
  1366. details: 1,
  1367. div: 1,
  1368. fieldset: 1,
  1369. figcaption: 1,
  1370. footer: 1,
  1371. form: 1,
  1372. h1: 1,
  1373. h2: 1,
  1374. h3: 1,
  1375. h4: 1,
  1376. h5: 1,
  1377. h6: 1,
  1378. header: 1,
  1379. hgroup: 1,
  1380. main: 1,
  1381. nav: 1,
  1382. p: 1,
  1383. pre: 1,
  1384. section: 1
  1385. },
  1386. $empty: {
  1387. area: 1,
  1388. base: 1,
  1389. basefont: 1,
  1390. br: 1,
  1391. col: 1,
  1392. command: 1,
  1393. dialog: 1,
  1394. embed: 1,
  1395. hr: 1,
  1396. img: 1,
  1397. input: 1,
  1398. isindex: 1,
  1399. keygen: 1,
  1400. link: 1,
  1401. meta: 1,
  1402. param: 1,
  1403. source: 1,
  1404. track: 1,
  1405. wbr: 1
  1406. },
  1407. $inline: b,
  1408. $list: {
  1409. dl: 1,
  1410. ol: 1,
  1411. ul: 1
  1412. },
  1413. $listItem: {
  1414. dd: 1,
  1415. dt: 1,
  1416. li: 1
  1417. },
  1418. $nonBodyContent: a({
  1419. body: 1,
  1420. head: 1,
  1421. html: 1
  1422. }, f.head),
  1423. $nonEditable: {
  1424. applet: 1,
  1425. audio: 1,
  1426. button: 1,
  1427. embed: 1,
  1428. iframe: 1,
  1429. map: 1,
  1430. object: 1,
  1431. option: 1,
  1432. param: 1,
  1433. script: 1,
  1434. textarea: 1,
  1435. video: 1
  1436. },
  1437. $object: {
  1438. applet: 1,
  1439. audio: 1,
  1440. button: 1,
  1441. hr: 1,
  1442. iframe: 1,
  1443. img: 1,
  1444. input: 1,
  1445. object: 1,
  1446. select: 1,
  1447. table: 1,
  1448. textarea: 1,
  1449. video: 1
  1450. },
  1451. $removeEmpty: {
  1452. abbr: 1,
  1453. acronym: 1,
  1454. b: 1,
  1455. bdi: 1,
  1456. bdo: 1,
  1457. big: 1,
  1458. cite: 1,
  1459. code: 1,
  1460. del: 1,
  1461. dfn: 1,
  1462. em: 1,
  1463. font: 1,
  1464. i: 1,
  1465. ins: 1,
  1466. label: 1,
  1467. kbd: 1,
  1468. mark: 1,
  1469. meter: 1,
  1470. output: 1,
  1471. q: 1,
  1472. ruby: 1,
  1473. s: 1,
  1474. samp: 1,
  1475. small: 1,
  1476. span: 1,
  1477. strike: 1,
  1478. strong: 1,
  1479. sub: 1,
  1480. sup: 1,
  1481. time: 1,
  1482. tt: 1,
  1483. u: 1,
  1484. "var": 1
  1485. },
  1486. $tabIndex: {
  1487. a: 1,
  1488. area: 1,
  1489. button: 1,
  1490. input: 1,
  1491. object: 1,
  1492. select: 1,
  1493. textarea: 1
  1494. },
  1495. $tableContent: {
  1496. caption: 1,
  1497. col: 1,
  1498. colgroup: 1,
  1499. tbody: 1,
  1500. td: 1,
  1501. tfoot: 1,
  1502. th: 1,
  1503. thead: 1,
  1504. tr: 1
  1505. },
  1506. $transparent: {
  1507. a: 1,
  1508. audio: 1,
  1509. canvas: 1,
  1510. del: 1,
  1511. ins: 1,
  1512. map: 1,
  1513. noscript: 1,
  1514. object: 1,
  1515. video: 1
  1516. },
  1517. $intermediate: {
  1518. caption: 1,
  1519. colgroup: 1,
  1520. dd: 1,
  1521. dt: 1,
  1522. figcaption: 1,
  1523. legend: 1,
  1524. li: 1,
  1525. optgroup: 1,
  1526. option: 1,
  1527. rp: 1,
  1528. rt: 1,
  1529. summary: 1,
  1530. tbody: 1,
  1531. td: 1,
  1532. tfoot: 1,
  1533. th: 1,
  1534. thead: 1,
  1535. tr: 1
  1536. }
  1537. });
  1538. return f
  1539. }(), CKEDITOR.dom.event = function(a) {
  1540. this.$ = a
  1541. }, CKEDITOR.dom.event.prototype = {
  1542. getKey: function() {
  1543. return this.$.keyCode || this.$.which
  1544. },
  1545. getKeystroke: function() {
  1546. var a = this.getKey();
  1547. if (this.$.ctrlKey || this.$.metaKey) a += CKEDITOR.CTRL;
  1548. this.$.shiftKey && (a += CKEDITOR.SHIFT);
  1549. this.$.altKey && (a += CKEDITOR.ALT);
  1550. return a
  1551. },
  1552. preventDefault: function(a) {
  1553. var f = this.$;
  1554. f.preventDefault ? f.preventDefault() : f.returnValue = !1;
  1555. a && this.stopPropagation()
  1556. },
  1557. stopPropagation: function() {
  1558. var a = this.$;
  1559. a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0
  1560. },
  1561. getTarget: function() {
  1562. var a = this.$.target || this.$.srcElement;
  1563. return a ? new CKEDITOR.dom.node(a) : null
  1564. },
  1565. getPhase: function() {
  1566. return this.$.eventPhase || 2
  1567. },
  1568. getPageOffset: function() {
  1569. var a = this.getTarget().getDocument().$;
  1570. return {
  1571. x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft),
  1572. y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop)
  1573. }
  1574. }
  1575. }, CKEDITOR.CTRL = 1114112, CKEDITOR.SHIFT = 2228224, CKEDITOR.ALT = 4456448, CKEDITOR.EVENT_PHASE_CAPTURING = 1, CKEDITOR.EVENT_PHASE_AT_TARGET = 2, CKEDITOR.EVENT_PHASE_BUBBLING = 3, CKEDITOR.dom.domObject = function(a) {
  1576. a && (this.$ = a)
  1577. }, CKEDITOR.dom.domObject.prototype = function() {
  1578. var a = function(a, b) {
  1579. return function(c) {
  1580. "undefined" != typeof CKEDITOR && a.fire(b,
  1581. new CKEDITOR.dom.event(c))
  1582. }
  1583. };
  1584. return {
  1585. getPrivate: function() {
  1586. var a;
  1587. (a = this.getCustomData("_")) || this.setCustomData("_", a = {});
  1588. return a
  1589. },
  1590. on: function(f) {
  1591. var b = this.getCustomData("_cke_nativeListeners");
  1592. b || (b = {}, this.setCustomData("_cke_nativeListeners", b));
  1593. b[f] || (b = b[f] = a(this, f), this.$.addEventListener ? this.$.addEventListener(f, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" + f, b));
  1594. return CKEDITOR.event.prototype.on.apply(this, arguments)
  1595. },
  1596. removeListener: function(a) {
  1597. CKEDITOR.event.prototype.removeListener.apply(this,
  1598. arguments);
  1599. if (!this.hasListeners(a)) {
  1600. var b = this.getCustomData("_cke_nativeListeners"),
  1601. c = b && b[a];
  1602. c && (this.$.removeEventListener ? this.$.removeEventListener(a, c, !1) : this.$.detachEvent && this.$.detachEvent("on" + a, c), delete b[a])
  1603. }
  1604. },
  1605. removeAllListeners: function() {
  1606. var a = this.getCustomData("_cke_nativeListeners"),
  1607. b;
  1608. for (b in a) {
  1609. var c = a[b];
  1610. this.$.detachEvent ? this.$.detachEvent("on" + b, c) : this.$.removeEventListener && this.$.removeEventListener(b, c, !1);
  1611. delete a[b]
  1612. }
  1613. CKEDITOR.event.prototype.removeAllListeners.call(this)
  1614. }
  1615. }
  1616. }(),
  1617. function(a) {
  1618. var f = {};
  1619. CKEDITOR.on("reset", function() {
  1620. f = {}
  1621. });
  1622. a.equals = function(a) {
  1623. try {
  1624. return a && a.$ === this.$
  1625. } catch (c) {
  1626. return !1
  1627. }
  1628. };
  1629. a.setCustomData = function(a, c) {
  1630. var e = this.getUniqueId();
  1631. (f[e] || (f[e] = {}))[a] = c;
  1632. return this
  1633. };
  1634. a.getCustomData = function(a) {
  1635. var c = this.$["data-cke-expando"];
  1636. return (c = c && f[c]) && a in c ? c[a] : null
  1637. };
  1638. a.removeCustomData = function(a) {
  1639. var c = this.$["data-cke-expando"],
  1640. c = c && f[c],
  1641. e, m;
  1642. c && (e = c[a], m = a in c, delete c[a]);
  1643. return m ? e : null
  1644. };
  1645. a.clearCustomData = function() {
  1646. this.removeAllListeners();
  1647. var a =
  1648. this.$["data-cke-expando"];
  1649. a && delete f[a]
  1650. };
  1651. a.getUniqueId = function() {
  1652. return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber())
  1653. };
  1654. CKEDITOR.event.implementOn(a)
  1655. }(CKEDITOR.dom.domObject.prototype), CKEDITOR.dom.node = function(a) {
  1656. 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 ?
  1657. "documentFragment" : "domObject"](a) : this
  1658. }, 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 = 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, {
  1659. appendTo: function(a, f) {
  1660. a.append(this, f);
  1661. return a
  1662. },
  1663. clone: function(a, f) {
  1664. function b(c) {
  1665. c["data-cke-expando"] && (c["data-cke-expando"] = !1);
  1666. if (c.nodeType == CKEDITOR.NODE_ELEMENT || c.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  1667. if (f || c.nodeType != CKEDITOR.NODE_ELEMENT || c.removeAttribute("id", !1), a) {
  1668. c = c.childNodes;
  1669. for (var e = 0; e < c.length; e++) b(c[e])
  1670. }
  1671. }
  1672. function c(b) {
  1673. if (b.type == CKEDITOR.NODE_ELEMENT || b.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1674. if (b.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1675. var e = b.getName();
  1676. ":" == e[0] && b.renameNode(e.substring(1))
  1677. }
  1678. if (a)
  1679. for (e = 0; e <
  1680. b.getChildCount(); e++) c(b.getChild(e))
  1681. }
  1682. }
  1683. var e = this.$.cloneNode(a);
  1684. b(e);
  1685. e = new CKEDITOR.dom.node(e);
  1686. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (this.type == CKEDITOR.NODE_ELEMENT || this.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) && c(e);
  1687. return e
  1688. },
  1689. hasPrevious: function() {
  1690. return !!this.$.previousSibling
  1691. },
  1692. hasNext: function() {
  1693. return !!this.$.nextSibling
  1694. },
  1695. insertAfter: function(a) {
  1696. a.$.parentNode.insertBefore(this.$, a.$.nextSibling);
  1697. return a
  1698. },
  1699. insertBefore: function(a) {
  1700. a.$.parentNode.insertBefore(this.$, a.$);
  1701. return a
  1702. },
  1703. insertBeforeMe: function(a) {
  1704. this.$.parentNode.insertBefore(a.$,
  1705. this.$);
  1706. return a
  1707. },
  1708. getAddress: function(a) {
  1709. for (var f = [], b = this.getDocument().$.documentElement, c = this.$; c && c != b;) {
  1710. var e = c.parentNode;
  1711. e && f.unshift(this.getIndex.call({
  1712. $: c
  1713. }, a));
  1714. c = e
  1715. }
  1716. return f
  1717. },
  1718. getDocument: function() {
  1719. return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument)
  1720. },
  1721. getIndex: function(a) {
  1722. function f(a, d) {
  1723. var h = d ? a.nextSibling : a.previousSibling;
  1724. return h && h.nodeType == CKEDITOR.NODE_TEXT ? b(h) ? f(h, d) : h : null
  1725. }
  1726. function b(a) {
  1727. return !a.nodeValue || a.nodeValue == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE
  1728. }
  1729. var c = this.$,
  1730. e = -1,
  1731. m;
  1732. if (!this.$.parentNode || a && c.nodeType == CKEDITOR.NODE_TEXT && b(c) && !f(c) && !f(c, !0)) return -1;
  1733. do a && c != this.$ && c.nodeType == CKEDITOR.NODE_TEXT && (m || b(c)) || (e++, m = c.nodeType == CKEDITOR.NODE_TEXT); while (c = c.previousSibling);
  1734. return e
  1735. },
  1736. getNextSourceNode: function(a, f, b) {
  1737. if (b && !b.call) {
  1738. var c = b;
  1739. b = function(a) {
  1740. return !a.equals(c)
  1741. }
  1742. }
  1743. a = !a && this.getFirst && this.getFirst();
  1744. var e;
  1745. if (!a) {
  1746. if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  1747. a = this.getNext()
  1748. }
  1749. for (; !a && (e = (e || this).getParent());) {
  1750. if (b &&
  1751. !1 === b(e, !0)) return null;
  1752. a = e.getNext()
  1753. }
  1754. return !a || b && !1 === b(a) ? null : f && f != a.type ? a.getNextSourceNode(!1, f, b) : a
  1755. },
  1756. getPreviousSourceNode: function(a, f, b) {
  1757. if (b && !b.call) {
  1758. var c = b;
  1759. b = function(a) {
  1760. return !a.equals(c)
  1761. }
  1762. }
  1763. a = !a && this.getLast && this.getLast();
  1764. var e;
  1765. if (!a) {
  1766. if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  1767. a = this.getPrevious()
  1768. }
  1769. for (; !a && (e = (e || this).getParent());) {
  1770. if (b && !1 === b(e, !0)) return null;
  1771. a = e.getPrevious()
  1772. }
  1773. return !a || b && !1 === b(a) ? null : f && a.type != f ? a.getPreviousSourceNode(!1, f, b) :
  1774. a
  1775. },
  1776. getPrevious: function(a) {
  1777. var f = this.$,
  1778. b;
  1779. do b = (f = f.previousSibling) && 10 != f.nodeType && new CKEDITOR.dom.node(f); while (b && a && !a(b));
  1780. return b
  1781. },
  1782. getNext: function(a) {
  1783. var f = this.$,
  1784. b;
  1785. do b = (f = f.nextSibling) && new CKEDITOR.dom.node(f); while (b && a && !a(b));
  1786. return b
  1787. },
  1788. getParent: function(a) {
  1789. var f = this.$.parentNode;
  1790. return f && (f.nodeType == CKEDITOR.NODE_ELEMENT || a && f.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ? new CKEDITOR.dom.node(f) : null
  1791. },
  1792. getParents: function(a) {
  1793. var f = this,
  1794. b = [];
  1795. do b[a ? "push" : "unshift"](f); while (f = f.getParent());
  1796. return b
  1797. },
  1798. getCommonAncestor: function(a) {
  1799. if (a.equals(this)) return this;
  1800. if (a.contains && a.contains(this)) return a;
  1801. var f = this.contains ? this : this.getParent();
  1802. do
  1803. if (f.contains(a)) return f;
  1804. while (f = f.getParent());
  1805. return null
  1806. },
  1807. getPosition: function(a) {
  1808. var f = this.$,
  1809. b = a.$;
  1810. if (f.compareDocumentPosition) return f.compareDocumentPosition(b);
  1811. if (f == b) return CKEDITOR.POSITION_IDENTICAL;
  1812. if (this.type == CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) {
  1813. if (f.contains) {
  1814. if (f.contains(b)) return CKEDITOR.POSITION_CONTAINS +
  1815. CKEDITOR.POSITION_PRECEDING;
  1816. if (b.contains(f)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1817. }
  1818. if ("sourceIndex" in f) return 0 > f.sourceIndex || 0 > b.sourceIndex ? CKEDITOR.POSITION_DISCONNECTED : f.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
  1819. }
  1820. f = this.getAddress();
  1821. a = a.getAddress();
  1822. for (var b = Math.min(f.length, a.length), c = 0; c < b; c++)
  1823. if (f[c] != a[c]) return f[c] < a[c] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
  1824. return f.length < a.length ? CKEDITOR.POSITION_CONTAINS +
  1825. CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1826. },
  1827. getAscendant: function(a, f) {
  1828. var b = this.$,
  1829. c, e;
  1830. f || (b = b.parentNode);
  1831. "function" == typeof a ? (e = !0, c = a) : (e = !1, c = function(b) {
  1832. b = "string" == typeof b.nodeName ? b.nodeName.toLowerCase() : "";
  1833. return "string" == typeof a ? b == a : b in a
  1834. });
  1835. for (; b;) {
  1836. if (c(e ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b);
  1837. try {
  1838. b = b.parentNode
  1839. } catch (m) {
  1840. b = null
  1841. }
  1842. }
  1843. return null
  1844. },
  1845. hasAscendant: function(a, f) {
  1846. var b = this.$;
  1847. f || (b = b.parentNode);
  1848. for (; b;) {
  1849. if (b.nodeName &&
  1850. b.nodeName.toLowerCase() == a) return !0;
  1851. b = b.parentNode
  1852. }
  1853. return !1
  1854. },
  1855. move: function(a, f) {
  1856. a.append(this.remove(), f)
  1857. },
  1858. remove: function(a) {
  1859. var f = this.$,
  1860. b = f.parentNode;
  1861. if (b) {
  1862. if (a)
  1863. for (; a = f.firstChild;) b.insertBefore(f.removeChild(a), f);
  1864. b.removeChild(f)
  1865. }
  1866. return this
  1867. },
  1868. replace: function(a) {
  1869. this.insertBefore(a);
  1870. a.remove()
  1871. },
  1872. trim: function() {
  1873. this.ltrim();
  1874. this.rtrim()
  1875. },
  1876. ltrim: function() {
  1877. for (var a; this.getFirst && (a = this.getFirst());) {
  1878. if (a.type == CKEDITOR.NODE_TEXT) {
  1879. var f = CKEDITOR.tools.ltrim(a.getText()),
  1880. b = a.getLength();
  1881. if (f) f.length <
  1882. b && (a.split(b - f.length), this.$.removeChild(this.$.firstChild));
  1883. else {
  1884. a.remove();
  1885. continue
  1886. }
  1887. }
  1888. break
  1889. }
  1890. },
  1891. rtrim: function() {
  1892. for (var a; this.getLast && (a = this.getLast());) {
  1893. if (a.type == CKEDITOR.NODE_TEXT) {
  1894. var f = CKEDITOR.tools.rtrim(a.getText()),
  1895. b = a.getLength();
  1896. if (f) f.length < b && (a.split(f.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild));
  1897. else {
  1898. a.remove();
  1899. continue
  1900. }
  1901. }
  1902. break
  1903. }
  1904. CKEDITOR.env.needsBrFiller && (a = this.$.lastChild) && 1 == a.type && "br" == a.nodeName.toLowerCase() && a.parentNode.removeChild(a)
  1905. },
  1906. isReadOnly: function(a) {
  1907. var f =
  1908. this;
  1909. this.type != CKEDITOR.NODE_ELEMENT && (f = this.getParent());
  1910. CKEDITOR.env.edge && f && f.is("textarea", "input") && (a = !0);
  1911. if (!a && f && "undefined" != typeof f.$.isContentEditable) return !(f.$.isContentEditable || f.data("cke-editable"));
  1912. for (; f;) {
  1913. if (f.data("cke-editable")) return !1;
  1914. if (f.hasAttribute("contenteditable")) return "false" == f.getAttribute("contenteditable");
  1915. f = f.getParent()
  1916. }
  1917. return !0
  1918. }
  1919. }), CKEDITOR.dom.window = function(a) {
  1920. CKEDITOR.dom.domObject.call(this, a)
  1921. }, CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject,
  1922. CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
  1923. focus: function() {
  1924. this.$.focus()
  1925. },
  1926. getViewPaneSize: function() {
  1927. var a = this.$.document,
  1928. f = "CSS1Compat" == a.compatMode;
  1929. return {
  1930. width: (f ? a.documentElement.clientWidth : a.body.clientWidth) || 0,
  1931. height: (f ? a.documentElement.clientHeight : a.body.clientHeight) || 0
  1932. }
  1933. },
  1934. getScrollPosition: function() {
  1935. var a = this.$;
  1936. if ("pageXOffset" in a) return {
  1937. x: a.pageXOffset || 0,
  1938. y: a.pageYOffset || 0
  1939. };
  1940. a = a.document;
  1941. return {
  1942. x: a.documentElement.scrollLeft || a.body.scrollLeft || 0,
  1943. y: a.documentElement.scrollTop ||
  1944. a.body.scrollTop || 0
  1945. }
  1946. },
  1947. getFrame: function() {
  1948. var a = this.$.frameElement;
  1949. return a ? new CKEDITOR.dom.element.get(a) : null
  1950. }
  1951. }), CKEDITOR.dom.document = function(a) {
  1952. CKEDITOR.dom.domObject.call(this, a)
  1953. }, CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject, CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
  1954. type: CKEDITOR.NODE_DOCUMENT,
  1955. appendStyleSheet: function(a) {
  1956. if (this.$.createStyleSheet) this.$.createStyleSheet(a);
  1957. else {
  1958. var f = new CKEDITOR.dom.element("link");
  1959. f.setAttributes({
  1960. rel: "stylesheet",
  1961. type: "text/css",
  1962. href: a
  1963. });
  1964. this.getHead().append(f)
  1965. }
  1966. },
  1967. appendStyleText: function(a) {
  1968. if (this.$.createStyleSheet) {
  1969. var f = this.$.createStyleSheet("");
  1970. f.cssText = a
  1971. } else {
  1972. var b = new CKEDITOR.dom.element("style", this);
  1973. b.append(new CKEDITOR.dom.text(a, this));
  1974. this.getHead().append(b)
  1975. }
  1976. return f || b.$.sheet
  1977. },
  1978. createElement: function(a, f) {
  1979. var b = new CKEDITOR.dom.element(a, this);
  1980. f && (f.attributes && b.setAttributes(f.attributes), f.styles && b.setStyles(f.styles));
  1981. return b
  1982. },
  1983. createText: function(a) {
  1984. return new CKEDITOR.dom.text(a, this)
  1985. },
  1986. focus: function() {
  1987. this.getWindow().focus()
  1988. },
  1989. getActive: function() {
  1990. var a;
  1991. try {
  1992. a = this.$.activeElement
  1993. } catch (f) {
  1994. return null
  1995. }
  1996. return new CKEDITOR.dom.element(a)
  1997. },
  1998. getById: function(a) {
  1999. return (a = this.$.getElementById(a)) ? new CKEDITOR.dom.element(a) : null
  2000. },
  2001. getByAddress: function(a, f) {
  2002. for (var b = this.$.documentElement, c = 0; b && c < a.length; c++) {
  2003. var e = a[c];
  2004. if (f)
  2005. for (var m = -1, l = 0; l < b.childNodes.length; l++) {
  2006. var d = b.childNodes[l];
  2007. if (!0 !== f || 3 != d.nodeType || !d.previousSibling || 3 != d.previousSibling.nodeType)
  2008. if (m++, m == e) {
  2009. b = d;
  2010. break
  2011. }
  2012. } else b = b.childNodes[e]
  2013. }
  2014. return b ? new CKEDITOR.dom.node(b) :
  2015. null
  2016. },
  2017. getElementsByTag: function(a, f) {
  2018. CKEDITOR.env.ie && 8 >= document.documentMode || !f || (a = f + ":" + a);
  2019. return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))
  2020. },
  2021. getHead: function() {
  2022. var a = this.$.getElementsByTagName("head")[0];
  2023. return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), !0)
  2024. },
  2025. getBody: function() {
  2026. return new CKEDITOR.dom.element(this.$.body)
  2027. },
  2028. getDocumentElement: function() {
  2029. return new CKEDITOR.dom.element(this.$.documentElement)
  2030. },
  2031. getWindow: function() {
  2032. return new CKEDITOR.dom.window(this.$.parentWindow ||
  2033. this.$.defaultView)
  2034. },
  2035. write: function(a) {
  2036. this.$.open("text/html", "replace");
  2037. CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i, '$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e(' + CKEDITOR.tools.fixDomain + ")();\x3c/script\x3e"));
  2038. this.$.write(a);
  2039. this.$.close()
  2040. },
  2041. find: function(a) {
  2042. return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))
  2043. },
  2044. findOne: function(a) {
  2045. return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null
  2046. },
  2047. _getHtml5ShivFrag: function() {
  2048. var a = this.getCustomData("html5ShivFrag");
  2049. a ||
  2050. (a = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(a, !0), this.setCustomData("html5ShivFrag", a));
  2051. return a
  2052. }
  2053. }), CKEDITOR.dom.nodeList = function(a) {
  2054. this.$ = a
  2055. }, CKEDITOR.dom.nodeList.prototype = {
  2056. count: function() {
  2057. return this.$.length
  2058. },
  2059. getItem: function(a) {
  2060. return 0 > a || a >= this.$.length ? null : (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null
  2061. }
  2062. }, CKEDITOR.dom.element = function(a, f) {
  2063. "string" == typeof a && (a = (f ? f.$ : document).createElement(a));
  2064. CKEDITOR.dom.domObject.call(this, a)
  2065. }, CKEDITOR.dom.element.get = function(a) {
  2066. return (a =
  2067. "string" == typeof a ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a))
  2068. }, CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node, CKEDITOR.dom.element.createFromHtml = function(a, f) {
  2069. var b = new CKEDITOR.dom.element("div", f);
  2070. b.setHtml(a);
  2071. return b.getFirst().remove()
  2072. }, CKEDITOR.dom.element.setMarker = function(a, f, b, c) {
  2073. var e = f.getCustomData("list_marker_id") || f.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
  2074. m = f.getCustomData("list_marker_names") ||
  2075. f.setCustomData("list_marker_names", {}).getCustomData("list_marker_names");
  2076. a[e] = f;
  2077. m[b] = 1;
  2078. return f.setCustomData(b, c)
  2079. }, CKEDITOR.dom.element.clearAllMarkers = function(a) {
  2080. for (var f in a) CKEDITOR.dom.element.clearMarkers(a, a[f], 1)
  2081. }, CKEDITOR.dom.element.clearMarkers = function(a, f, b) {
  2082. var c = f.getCustomData("list_marker_names"),
  2083. e = f.getCustomData("list_marker_id"),
  2084. m;
  2085. for (m in c) f.removeCustomData(m);
  2086. f.removeCustomData("list_marker_names");
  2087. b && (f.removeCustomData("list_marker_id"), delete a[e])
  2088. },
  2089. function() {
  2090. function a(a,
  2091. b) {
  2092. return -1 < (" " + a + " ").replace(m, " ").indexOf(" " + b + " ")
  2093. }
  2094. function f(a) {
  2095. var b = !0;
  2096. a.$.id || (a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber(), b = !1);
  2097. return function() {
  2098. b || a.removeAttribute("id")
  2099. }
  2100. }
  2101. function b(a, b) {
  2102. var c = CKEDITOR.tools.escapeCss(a.$.id);
  2103. return "#" + c + " " + b.split(/,\s*/).join(", #" + c + " ")
  2104. }
  2105. function c(a) {
  2106. for (var b = 0, c = 0, g = l[a].length; c < g; c++) b += parseInt(this.getComputedStyle(l[a][c]) || 0, 10) || 0;
  2107. return b
  2108. }
  2109. var e = document.createElement("_").classList,
  2110. e = "undefined" !== typeof e && null !== String(e.add).match(/\[Native code\]/gi),
  2111. m = /[\n\t\r]/g;
  2112. CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
  2113. type: CKEDITOR.NODE_ELEMENT,
  2114. addClass: e ? function(a) {
  2115. this.$.classList.add(a);
  2116. return this
  2117. } : function(d) {
  2118. var b = this.$.className;
  2119. b && (a(b, d) || (b += " " + d));
  2120. this.$.className = b || d;
  2121. return this
  2122. },
  2123. removeClass: e ? function(a) {
  2124. var b = this.$;
  2125. b.classList.remove(a);
  2126. b.className || b.removeAttribute("class");
  2127. return this
  2128. } : function(d) {
  2129. var b = this.getAttribute("class");
  2130. b && a(b, d) && ((b = b.replace(new RegExp("(?:^|\\s+)" + d + "(?\x3d\\s|$)"), "").replace(/^\s+/, "")) ? this.setAttribute("class",
  2131. b) : this.removeAttribute("class"));
  2132. return this
  2133. },
  2134. hasClass: function(d) {
  2135. return a(this.$.className, d)
  2136. },
  2137. append: function(a, b) {
  2138. "string" == typeof a && (a = this.getDocument().createElement(a));
  2139. b ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$);
  2140. return a
  2141. },
  2142. appendHtml: function(a) {
  2143. if (this.$.childNodes.length) {
  2144. var b = new CKEDITOR.dom.element("div", this.getDocument());
  2145. b.setHtml(a);
  2146. b.moveChildren(this)
  2147. } else this.setHtml(a)
  2148. },
  2149. appendText: function(a) {
  2150. null != this.$.text && CKEDITOR.env.ie && 9 > CKEDITOR.env.version ?
  2151. this.$.text += a : this.append(new CKEDITOR.dom.text(a))
  2152. },
  2153. appendBogus: function(a) {
  2154. if (a || CKEDITOR.env.needsBrFiller) {
  2155. for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) a = a.getPrevious();
  2156. a && a.is && a.is("br") || (a = this.getDocument().createElement("br"), CKEDITOR.env.gecko && a.setAttribute("type", "_moz"), this.append(a))
  2157. }
  2158. },
  2159. breakParent: function(a, b) {
  2160. var c = new CKEDITOR.dom.range(this.getDocument());
  2161. c.setStartAfter(this);
  2162. c.setEndAfter(a);
  2163. var g = c.extractContents(!1, b || !1),
  2164. e;
  2165. c.insertNode(this.remove());
  2166. if (CKEDITOR.env.ie && !CKEDITOR.env.edge) {
  2167. for (c = new CKEDITOR.dom.element("div"); e = g.getFirst();) e.$.style.backgroundColor && (e.$.style.backgroundColor = e.$.style.backgroundColor), c.append(e);
  2168. c.insertAfter(this);
  2169. c.remove(!0)
  2170. } else g.insertAfterNode(this)
  2171. },
  2172. contains: document.compareDocumentPosition ? function(a) {
  2173. return !!(this.$.compareDocumentPosition(a.$) & 16)
  2174. } : function(a) {
  2175. var b = this.$;
  2176. return a.type != CKEDITOR.NODE_ELEMENT ? b.contains(a.getParent().$) : b != a.$ && b.contains(a.$)
  2177. },
  2178. focus: function() {
  2179. function a() {
  2180. try {
  2181. this.$.focus()
  2182. } catch (b) {}
  2183. }
  2184. return function(b) {
  2185. b ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this)
  2186. }
  2187. }(),
  2188. getHtml: function() {
  2189. var a = this.$.innerHTML;
  2190. return CKEDITOR.env.ie ? a.replace(/<\?[^>]*>/g, "") : a
  2191. },
  2192. getOuterHtml: function() {
  2193. if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
  2194. var a = this.$.ownerDocument.createElement("div");
  2195. a.appendChild(this.$.cloneNode(!0));
  2196. return a.innerHTML
  2197. },
  2198. getClientRect: function() {
  2199. var a = CKEDITOR.tools.extend({}, this.$.getBoundingClientRect());
  2200. !a.width && (a.width = a.right - a.left);
  2201. !a.height &&
  2202. (a.height = a.bottom - a.top);
  2203. return a
  2204. },
  2205. setHtml: CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? function(a) {
  2206. try {
  2207. var b = this.$;
  2208. if (this.getParent()) return b.innerHTML = a;
  2209. var c = this.getDocument()._getHtml5ShivFrag();
  2210. c.appendChild(b);
  2211. b.innerHTML = a;
  2212. c.removeChild(b);
  2213. return a
  2214. } catch (g) {
  2215. this.$.innerHTML = "";
  2216. b = new CKEDITOR.dom.element("body", this.getDocument());
  2217. b.$.innerHTML = a;
  2218. for (b = b.getChildren(); b.count();) this.append(b.getItem(0));
  2219. return a
  2220. }
  2221. } : function(a) {
  2222. return this.$.innerHTML = a
  2223. },
  2224. setText: function() {
  2225. var a = document.createElement("p");
  2226. a.innerHTML = "x";
  2227. a = a.textContent;
  2228. return function(b) {
  2229. this.$[a ? "textContent" : "innerText"] = b
  2230. }
  2231. }(),
  2232. getAttribute: function() {
  2233. var a = function(a) {
  2234. return this.$.getAttribute(a, 2)
  2235. };
  2236. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  2237. switch (a) {
  2238. case "class":
  2239. a = "className";
  2240. break;
  2241. case "http-equiv":
  2242. a = "httpEquiv";
  2243. break;
  2244. case "name":
  2245. return this.$.name;
  2246. case "tabindex":
  2247. return a = this.$.getAttribute(a, 2), 0 !== a && 0 === this.$.tabIndex && (a = null), a;
  2248. case "checked":
  2249. return a = this.$.attributes.getNamedItem(a), (a.specified ? a.nodeValue : this.$.checked) ? "checked" : null;
  2250. case "hspace":
  2251. case "value":
  2252. return this.$[a];
  2253. case "style":
  2254. return this.$.style.cssText;
  2255. case "contenteditable":
  2256. case "contentEditable":
  2257. return this.$.attributes.getNamedItem("contentEditable").specified ? this.$.getAttribute("contentEditable") : null
  2258. }
  2259. return this.$.getAttribute(a, 2)
  2260. } : a
  2261. }(),
  2262. getAttributes: function(a) {
  2263. var b = {},
  2264. c = this.$.attributes,
  2265. g;
  2266. a = CKEDITOR.tools.isArray(a) ? a : [];
  2267. for (g = 0; g < c.length; g++) - 1 === CKEDITOR.tools.indexOf(a, c[g].name) && (b[c[g].name] =
  2268. c[g].value);
  2269. return b
  2270. },
  2271. getChildren: function() {
  2272. return new CKEDITOR.dom.nodeList(this.$.childNodes)
  2273. },
  2274. getComputedStyle: document.defaultView && document.defaultView.getComputedStyle ? function(a) {
  2275. var b = this.getWindow().$.getComputedStyle(this.$, null);
  2276. return b ? b.getPropertyValue(a) : ""
  2277. } : function(a) {
  2278. return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2279. },
  2280. getDtd: function() {
  2281. var a = CKEDITOR.dtd[this.getName()];
  2282. this.getDtd = function() {
  2283. return a
  2284. };
  2285. return a
  2286. },
  2287. getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag,
  2288. getTabIndex: function() {
  2289. var a = this.$.tabIndex;
  2290. return 0 !== a || CKEDITOR.dtd.$tabIndex[this.getName()] || 0 === parseInt(this.getAttribute("tabindex"), 10) ? a : -1
  2291. },
  2292. getText: function() {
  2293. return this.$.textContent || this.$.innerText || ""
  2294. },
  2295. getWindow: function() {
  2296. return this.getDocument().getWindow()
  2297. },
  2298. getId: function() {
  2299. return this.$.id || null
  2300. },
  2301. getNameAtt: function() {
  2302. return this.$.name || null
  2303. },
  2304. getName: function() {
  2305. var a = this.$.nodeName.toLowerCase();
  2306. if (CKEDITOR.env.ie && 8 >= document.documentMode) {
  2307. var b = this.$.scopeName;
  2308. "HTML" !=
  2309. b && (a = b.toLowerCase() + ":" + a)
  2310. }
  2311. this.getName = function() {
  2312. return a
  2313. };
  2314. return this.getName()
  2315. },
  2316. getValue: function() {
  2317. return this.$.value
  2318. },
  2319. getFirst: function(a) {
  2320. var b = this.$.firstChild;
  2321. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getNext(a));
  2322. return b
  2323. },
  2324. getLast: function(a) {
  2325. var b = this.$.lastChild;
  2326. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getPrevious(a));
  2327. return b
  2328. },
  2329. getStyle: function(a) {
  2330. return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2331. },
  2332. is: function() {
  2333. var a = this.getName();
  2334. if ("object" == typeof arguments[0]) return !!arguments[0][a];
  2335. for (var b = 0; b < arguments.length; b++)
  2336. if (arguments[b] == a) return !0;
  2337. return !1
  2338. },
  2339. isEditable: function(a) {
  2340. var b = this.getName();
  2341. return this.isReadOnly() || "none" == this.getComputedStyle("display") || "hidden" == this.getComputedStyle("visibility") || CKEDITOR.dtd.$nonEditable[b] || CKEDITOR.dtd.$empty[b] || this.is("a") && (this.data("cke-saved-name") || this.hasAttribute("name")) && !this.getChildCount() ? !1 : !1 !== a ? (a = CKEDITOR.dtd[b] || CKEDITOR.dtd.span, !(!a || !a["#"])) : !0
  2342. },
  2343. isIdentical: function(a) {
  2344. var b = this.clone(0, 1);
  2345. a = a.clone(0,
  2346. 1);
  2347. b.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2348. a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2349. if (b.$.isEqualNode) return b.$.style.cssText = CKEDITOR.tools.normalizeCssText(b.$.style.cssText), a.$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText), b.$.isEqualNode(a.$);
  2350. b = b.getOuterHtml();
  2351. a = a.getOuterHtml();
  2352. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && this.is("a")) {
  2353. var c = this.getParent();
  2354. c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(b), b = c.getHtml(), c.setHtml(a), a = c.getHtml())
  2355. }
  2356. return b == a
  2357. },
  2358. isVisible: function() {
  2359. var a = (this.$.offsetHeight || this.$.offsetWidth) && "hidden" != this.getComputedStyle("visibility"),
  2360. b, c;
  2361. a && CKEDITOR.env.webkit && (b = this.getWindow(), !b.equals(CKEDITOR.document.getWindow()) && (c = b.$.frameElement) && (a = (new CKEDITOR.dom.element(c)).isVisible()));
  2362. return !!a
  2363. },
  2364. isEmptyInlineRemoveable: function() {
  2365. if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return !1;
  2366. for (var a = this.getChildren(),
  2367. b = 0, c = a.count(); b < c; b++) {
  2368. var g = a.getItem(b);
  2369. if (g.type != CKEDITOR.NODE_ELEMENT || !g.data("cke-bookmark"))
  2370. if (g.type == CKEDITOR.NODE_ELEMENT && !g.isEmptyInlineRemoveable() || g.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(g.getText())) return !1
  2371. }
  2372. return !0
  2373. },
  2374. hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function() {
  2375. for (var a = this.$.attributes, b = 0; b < a.length; b++) {
  2376. var c = a[b];
  2377. switch (c.nodeName) {
  2378. case "class":
  2379. if (this.getAttribute("class")) return !0;
  2380. case "data-cke-expando":
  2381. continue;
  2382. default:
  2383. if (c.specified) return !0
  2384. }
  2385. }
  2386. return !1
  2387. } : function() {
  2388. var a = this.$.attributes,
  2389. b = a.length,
  2390. c = {
  2391. "data-cke-expando": 1,
  2392. _moz_dirty: 1
  2393. };
  2394. return 0 < b && (2 < b || !c[a[0].nodeName] || 2 == b && !c[a[1].nodeName])
  2395. },
  2396. hasAttribute: function() {
  2397. function a(b) {
  2398. var d = this.$.attributes.getNamedItem(b);
  2399. if ("input" == this.getName()) switch (b) {
  2400. case "class":
  2401. return 0 < this.$.className.length;
  2402. case "checked":
  2403. return !!this.$.checked;
  2404. case "value":
  2405. return b = this.getAttribute("type"), "checkbox" == b || "radio" == b ? "on" != this.$.value : !!this.$.value
  2406. }
  2407. return d ? d.specified : !1
  2408. }
  2409. return CKEDITOR.env.ie ?
  2410. 8 > CKEDITOR.env.version ? function(b) {
  2411. return "name" == b ? !!this.$.name : a.call(this, b)
  2412. } : a : function(a) {
  2413. return !!this.$.attributes.getNamedItem(a)
  2414. }
  2415. }(),
  2416. hide: function() {
  2417. this.setStyle("display", "none")
  2418. },
  2419. moveChildren: function(a, b) {
  2420. var c = this.$;
  2421. a = a.$;
  2422. if (c != a) {
  2423. var g;
  2424. if (b)
  2425. for (; g = c.lastChild;) a.insertBefore(c.removeChild(g), a.firstChild);
  2426. else
  2427. for (; g = c.firstChild;) a.appendChild(c.removeChild(g))
  2428. }
  2429. },
  2430. mergeSiblings: function() {
  2431. function a(b, d, g) {
  2432. if (d && d.type == CKEDITOR.NODE_ELEMENT) {
  2433. for (var c = []; d.data("cke-bookmark") || d.isEmptyInlineRemoveable();)
  2434. if (c.push(d),
  2435. d = g ? d.getNext() : d.getPrevious(), !d || d.type != CKEDITOR.NODE_ELEMENT) return;
  2436. if (b.isIdentical(d)) {
  2437. for (var e = g ? b.getLast() : b.getFirst(); c.length;) c.shift().move(b, !g);
  2438. d.moveChildren(b, !g);
  2439. d.remove();
  2440. e && e.type == CKEDITOR.NODE_ELEMENT && e.mergeSiblings()
  2441. }
  2442. }
  2443. }
  2444. return function(b) {
  2445. if (!1 === b || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) a(this, this.getNext(), !0), a(this, this.getPrevious())
  2446. }
  2447. }(),
  2448. show: function() {
  2449. this.setStyles({
  2450. display: "",
  2451. visibility: ""
  2452. })
  2453. },
  2454. setAttribute: function() {
  2455. var a = function(a, b) {
  2456. this.$.setAttribute(a,
  2457. b);
  2458. return this
  2459. };
  2460. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(b, c) {
  2461. "class" == b ? this.$.className = c : "style" == b ? this.$.style.cssText = c : "tabindex" == b ? this.$.tabIndex = c : "checked" == b ? this.$.checked = c : "contenteditable" == b ? a.call(this, "contentEditable", c) : a.apply(this, arguments);
  2462. return this
  2463. } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(b, c) {
  2464. if ("src" == b && c.match(/^http:\/\//)) try {
  2465. a.apply(this, arguments)
  2466. } catch (g) {} else a.apply(this, arguments);
  2467. return this
  2468. } : a
  2469. }(),
  2470. setAttributes: function(a) {
  2471. for (var b in a) this.setAttribute(b,
  2472. a[b]);
  2473. return this
  2474. },
  2475. setValue: function(a) {
  2476. this.$.value = a;
  2477. return this
  2478. },
  2479. removeAttribute: function() {
  2480. var a = function(a) {
  2481. this.$.removeAttribute(a)
  2482. };
  2483. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  2484. "class" == a ? a = "className" : "tabindex" == a ? a = "tabIndex" : "contenteditable" == a && (a = "contentEditable");
  2485. this.$.removeAttribute(a)
  2486. } : a
  2487. }(),
  2488. removeAttributes: function(a) {
  2489. if (CKEDITOR.tools.isArray(a))
  2490. for (var b = 0; b < a.length; b++) this.removeAttribute(a[b]);
  2491. else
  2492. for (b in a = a || this.getAttributes(),
  2493. a) a.hasOwnProperty(b) && this.removeAttribute(b)
  2494. },
  2495. removeStyle: function(a) {
  2496. var b = this.$.style;
  2497. if (b.removeProperty || "border" != a && "margin" != a && "padding" != a) b.removeProperty ? b.removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)), this.$.style.cssText || this.removeAttribute("style");
  2498. else {
  2499. var c = ["top", "left", "right", "bottom"],
  2500. g;
  2501. "border" == a && (g = ["color", "style", "width"]);
  2502. for (var b = [], e = 0; e < c.length; e++)
  2503. if (g)
  2504. for (var f = 0; f < g.length; f++) b.push([a, c[e], g[f]].join("-"));
  2505. else b.push([a, c[e]].join("-"));
  2506. for (a = 0; a < b.length; a++) this.removeStyle(b[a])
  2507. }
  2508. },
  2509. setStyle: function(a, b) {
  2510. this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b;
  2511. return this
  2512. },
  2513. setStyles: function(a) {
  2514. for (var b in a) this.setStyle(b, a[b]);
  2515. return this
  2516. },
  2517. setOpacity: function(a) {
  2518. CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? (a = Math.round(100 * a), this.setStyle("filter", 100 <= a ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity\x3d" + a + ")")) : this.setStyle("opacity", a)
  2519. },
  2520. unselectable: function() {
  2521. this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "none"));
  2522. if (CKEDITOR.env.ie) {
  2523. this.setAttribute("unselectable", "on");
  2524. for (var a, b = this.getElementsByTag("*"), c = 0, g = b.count(); c < g; c++) a = b.getItem(c), a.setAttribute("unselectable", "on")
  2525. }
  2526. },
  2527. getPositionedAncestor: function() {
  2528. for (var a = this;
  2529. "html" != a.getName();) {
  2530. if ("static" != a.getComputedStyle("position")) return a;
  2531. a = a.getParent()
  2532. }
  2533. return null
  2534. },
  2535. getDocumentPosition: function(a) {
  2536. var b = 0,
  2537. c = 0,
  2538. g = this.getDocument(),
  2539. e = g.getBody(),
  2540. f = "BackCompat" == g.$.compatMode;
  2541. if (document.documentElement.getBoundingClientRect && (CKEDITOR.env.ie ?
  2542. 8 !== CKEDITOR.env.version : 1)) {
  2543. var m = this.$.getBoundingClientRect(),
  2544. l = g.$.documentElement,
  2545. u = l.clientTop || e.$.clientTop || 0,
  2546. r = l.clientLeft || e.$.clientLeft || 0,
  2547. p = !0;
  2548. CKEDITOR.env.ie && (p = g.getDocumentElement().contains(this), g = g.getBody().contains(this), p = f && g || !f && p);
  2549. p && (CKEDITOR.env.webkit || CKEDITOR.env.ie && 12 <= CKEDITOR.env.version ? (b = e.$.scrollLeft || l.scrollLeft, c = e.$.scrollTop || l.scrollTop) : (c = f ? e.$ : l, b = c.scrollLeft, c = c.scrollTop), b = m.left + b - r, c = m.top + c - u)
  2550. } else
  2551. for (u = this, r = null; u && "body" != u.getName() &&
  2552. "html" != u.getName();) {
  2553. b += u.$.offsetLeft - u.$.scrollLeft;
  2554. c += u.$.offsetTop - u.$.scrollTop;
  2555. u.equals(this) || (b += u.$.clientLeft || 0, c += u.$.clientTop || 0);
  2556. for (; r && !r.equals(u);) b -= r.$.scrollLeft, c -= r.$.scrollTop, r = r.getParent();
  2557. r = u;
  2558. u = (m = u.$.offsetParent) ? new CKEDITOR.dom.element(m) : null
  2559. }
  2560. a && (m = this.getWindow(), u = a.getWindow(), !m.equals(u) && m.$.frameElement && (a = (new CKEDITOR.dom.element(m.$.frameElement)).getDocumentPosition(a), b += a.x, c += a.y));
  2561. document.documentElement.getBoundingClientRect || !CKEDITOR.env.gecko ||
  2562. f || (b += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0);
  2563. return {
  2564. x: b,
  2565. y: c
  2566. }
  2567. },
  2568. scrollIntoView: function(a) {
  2569. var b = this.getParent();
  2570. if (b) {
  2571. do
  2572. if ((b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1), b.is("html")) {
  2573. var c = b.getWindow();
  2574. try {
  2575. var g = c.$.frameElement;
  2576. g && (b = new CKEDITOR.dom.element(g))
  2577. } catch (e) {}
  2578. }
  2579. while (b = b.getParent())
  2580. }
  2581. },
  2582. scrollIntoParent: function(a, b, c) {
  2583. var g, e, f, m;
  2584. function l(b, g) {
  2585. /body|html/.test(a.getName()) ?
  2586. a.getWindow().$.scrollBy(b, g) : (a.$.scrollLeft += b, a.$.scrollTop += g)
  2587. }
  2588. function u(a, b) {
  2589. var g = {
  2590. x: 0,
  2591. y: 0
  2592. };
  2593. if (!a.is(p ? "body" : "html")) {
  2594. var c = a.$.getBoundingClientRect();
  2595. g.x = c.left;
  2596. g.y = c.top
  2597. }
  2598. c = a.getWindow();
  2599. c.equals(b) || (c = u(CKEDITOR.dom.element.get(c.$.frameElement), b), g.x += c.x, g.y += c.y);
  2600. return g
  2601. }
  2602. function r(a, b) {
  2603. return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0
  2604. }!a && (a = this.getWindow());
  2605. f = a.getDocument();
  2606. var p = "BackCompat" == f.$.compatMode;
  2607. a instanceof CKEDITOR.dom.window && (a = p ? f.getBody() : f.getDocumentElement());
  2608. CKEDITOR.env.webkit && (f = this.getEditor(!1)) && (f._.previousScrollTop = null);
  2609. f = a.getWindow();
  2610. e = u(this, f);
  2611. var z = u(a, f),
  2612. B = this.$.offsetHeight;
  2613. g = this.$.offsetWidth;
  2614. var t = a.$.clientHeight,
  2615. y = a.$.clientWidth;
  2616. f = e.x - r(this, "left") - z.x || 0;
  2617. m = e.y - r(this, "top") - z.y || 0;
  2618. g = e.x + g + r(this, "right") - (z.x + y) || 0;
  2619. e = e.y + B + r(this, "bottom") - (z.y + t) || 0;
  2620. (0 > m || 0 < e) && l(0, !0 === b ? m : !1 === b ? e : 0 > m ? m : e);
  2621. c && (0 > f || 0 < g) && l(0 > f ? f : g, 0)
  2622. },
  2623. setState: function(a, b, c) {
  2624. b = b || "cke";
  2625. switch (a) {
  2626. case CKEDITOR.TRISTATE_ON:
  2627. this.addClass(b + "_on");
  2628. this.removeClass(b +
  2629. "_off");
  2630. this.removeClass(b + "_disabled");
  2631. c && this.setAttribute("aria-pressed", !0);
  2632. c && this.removeAttribute("aria-disabled");
  2633. break;
  2634. case CKEDITOR.TRISTATE_DISABLED:
  2635. this.addClass(b + "_disabled");
  2636. this.removeClass(b + "_off");
  2637. this.removeClass(b + "_on");
  2638. c && this.setAttribute("aria-disabled", !0);
  2639. c && this.removeAttribute("aria-pressed");
  2640. break;
  2641. default:
  2642. this.addClass(b + "_off"), this.removeClass(b + "_on"), this.removeClass(b + "_disabled"), c && this.removeAttribute("aria-pressed"), c && this.removeAttribute("aria-disabled")
  2643. }
  2644. },
  2645. getFrameDocument: function() {
  2646. var a = this.$;
  2647. try {
  2648. a.contentWindow.document
  2649. } catch (b) {
  2650. a.src = a.src
  2651. }
  2652. return a && new CKEDITOR.dom.document(a.contentWindow.document)
  2653. },
  2654. copyAttributes: function(a, b) {
  2655. var c = this.$.attributes;
  2656. b = b || {};
  2657. for (var g = 0; g < c.length; g++) {
  2658. var e = c[g],
  2659. f = e.nodeName.toLowerCase(),
  2660. m;
  2661. if (!(f in b))
  2662. if ("checked" == f && (m = this.getAttribute(f))) a.setAttribute(f, m);
  2663. else if (!CKEDITOR.env.ie || this.hasAttribute(f)) m = this.getAttribute(f), null === m && (m = e.nodeValue), a.setAttribute(f, m)
  2664. }
  2665. "" !== this.$.style.cssText &&
  2666. (a.$.style.cssText = this.$.style.cssText)
  2667. },
  2668. renameNode: function(a) {
  2669. if (this.getName() != a) {
  2670. var b = this.getDocument();
  2671. a = new CKEDITOR.dom.element(a, b);
  2672. this.copyAttributes(a);
  2673. this.moveChildren(a);
  2674. this.getParent(!0) && this.$.parentNode.replaceChild(a.$, this.$);
  2675. a.$["data-cke-expando"] = this.$["data-cke-expando"];
  2676. this.$ = a.$;
  2677. delete this.getName
  2678. }
  2679. },
  2680. getChild: function() {
  2681. function a(b, c) {
  2682. var g = b.childNodes;
  2683. if (0 <= c && c < g.length) return g[c]
  2684. }
  2685. return function(b) {
  2686. var c = this.$;
  2687. if (b.slice)
  2688. for (b = b.slice(); 0 < b.length && c;) c = a(c,
  2689. b.shift());
  2690. else c = a(c, b);
  2691. return c ? new CKEDITOR.dom.node(c) : null
  2692. }
  2693. }(),
  2694. getChildCount: function() {
  2695. return this.$.childNodes.length
  2696. },
  2697. disableContextMenu: function() {
  2698. function a(b) {
  2699. return b.type == CKEDITOR.NODE_ELEMENT && b.hasClass("cke_enable_context_menu")
  2700. }
  2701. this.on("contextmenu", function(b) {
  2702. b.data.getTarget().getAscendant(a, !0) || b.data.preventDefault()
  2703. })
  2704. },
  2705. getDirection: function(a) {
  2706. return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() && this.getParent().getDirection(1) || this.getDocument().$.dir ||
  2707. "ltr" : this.getStyle("direction") || this.getAttribute("dir")
  2708. },
  2709. data: function(a, b) {
  2710. a = "data-" + a;
  2711. if (void 0 === b) return this.getAttribute(a);
  2712. !1 === b ? this.removeAttribute(a) : this.setAttribute(a, b);
  2713. return null
  2714. },
  2715. getEditor: function(a) {
  2716. var b = CKEDITOR.instances,
  2717. c, g, e;
  2718. a = a || void 0 === a;
  2719. for (c in b)
  2720. if (g = b[c], g.element.equals(this) && g.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || !a && (e = g.editable()) && (e.equals(this) || e.contains(this))) return g;
  2721. return null
  2722. },
  2723. find: function(a) {
  2724. var c = f(this);
  2725. a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this,
  2726. a)));
  2727. c();
  2728. return a
  2729. },
  2730. findOne: function(a) {
  2731. var c = f(this);
  2732. a = this.$.querySelector(b(this, a));
  2733. c();
  2734. return a ? new CKEDITOR.dom.element(a) : null
  2735. },
  2736. forEach: function(a, b, c) {
  2737. if (!(c || b && this.type != b)) var g = a(this);
  2738. if (!1 !== g) {
  2739. c = this.getChildren();
  2740. for (var e = 0; e < c.count(); e++) g = c.getItem(e), g.type == CKEDITOR.NODE_ELEMENT ? g.forEach(a, b) : b && g.type != b || a(g)
  2741. }
  2742. }
  2743. });
  2744. var l = {
  2745. width: ["border-left-width", "border-right-width", "padding-left", "padding-right"],
  2746. height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"]
  2747. };
  2748. CKEDITOR.dom.element.prototype.setSize = function(a, b, e) {
  2749. "number" == typeof b && (!e || CKEDITOR.env.ie && CKEDITOR.env.quirks || (b -= c.call(this, a)), this.setStyle(a, b + "px"))
  2750. };
  2751. CKEDITOR.dom.element.prototype.getSize = function(a, b) {
  2752. var e = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0;
  2753. b && (e -= c.call(this, a));
  2754. return e
  2755. }
  2756. }(), CKEDITOR.dom.documentFragment = function(a) {
  2757. a = a || CKEDITOR.document;
  2758. this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() : a
  2759. }, CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,
  2760. CKEDITOR.dom.element.prototype, {
  2761. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  2762. insertAfterNode: function(a) {
  2763. a = a.$;
  2764. a.parentNode.insertBefore(this.$, a.nextSibling)
  2765. },
  2766. getHtml: function() {
  2767. var a = new CKEDITOR.dom.element("div");
  2768. this.clone(1, 1).appendTo(a);
  2769. return a.getHtml().replace(/\s*data-cke-expando=".*?"/g, "")
  2770. }
  2771. }, !0, {
  2772. append: 1,
  2773. appendBogus: 1,
  2774. clone: 1,
  2775. getFirst: 1,
  2776. getHtml: 1,
  2777. getLast: 1,
  2778. getParent: 1,
  2779. getNext: 1,
  2780. getPrevious: 1,
  2781. appendTo: 1,
  2782. moveChildren: 1,
  2783. insertBefore: 1,
  2784. insertAfterNode: 1,
  2785. replace: 1,
  2786. trim: 1,
  2787. type: 1,
  2788. ltrim: 1,
  2789. rtrim: 1,
  2790. getDocument: 1,
  2791. getChildCount: 1,
  2792. getChild: 1,
  2793. getChildren: 1
  2794. }),
  2795. function() {
  2796. function a(a, b) {
  2797. var g = this.range;
  2798. if (this._.end) return null;
  2799. if (!this._.start) {
  2800. this._.start = 1;
  2801. if (g.collapsed) return this.end(), null;
  2802. g.optimize()
  2803. }
  2804. var c, d = g.startContainer;
  2805. c = g.endContainer;
  2806. var e = g.startOffset,
  2807. k = g.endOffset,
  2808. f, t = this.guard,
  2809. h = this.type,
  2810. n = a ? "getPreviousSourceNode" : "getNextSourceNode";
  2811. if (!a && !this._.guardLTR) {
  2812. var m = c.type == CKEDITOR.NODE_ELEMENT ? c : c.getParent(),
  2813. l = c.type == CKEDITOR.NODE_ELEMENT ? c.getChild(k) : c.getNext();
  2814. this._.guardLTR = function(a,
  2815. b) {
  2816. return (!b || !m.equals(a)) && (!l || !a.equals(l)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(g.root))
  2817. }
  2818. }
  2819. if (a && !this._.guardRTL) {
  2820. var C = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(),
  2821. F = d.type == CKEDITOR.NODE_ELEMENT ? e ? d.getChild(e - 1) : null : d.getPrevious();
  2822. this._.guardRTL = function(a, b) {
  2823. return (!b || !C.equals(a)) && (!F || !a.equals(F)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(g.root))
  2824. }
  2825. }
  2826. var G = a ? this._.guardRTL : this._.guardLTR;
  2827. f = t ? function(a, b) {
  2828. return !1 === G(a, b) ? !1 : t(a, b)
  2829. } : G;
  2830. this.current ? c = this.current[n](!1,
  2831. h, f) : (a ? c.type == CKEDITOR.NODE_ELEMENT && (c = 0 < k ? c.getChild(k - 1) : !1 === f(c, !0) ? null : c.getPreviousSourceNode(!0, h, f)) : (c = d, c.type == CKEDITOR.NODE_ELEMENT && ((c = c.getChild(e)) || (c = !1 === f(d, !0) ? null : d.getNextSourceNode(!0, h, f)))), c && !1 === f(c) && (c = null));
  2832. for (; c && !this._.end;) {
  2833. this.current = c;
  2834. if (!this.evaluator || !1 !== this.evaluator(c)) {
  2835. if (!b) return c
  2836. } else if (b && this.evaluator) return !1;
  2837. c = c[n](!1, h, f)
  2838. }
  2839. this.end();
  2840. return this.current = null
  2841. }
  2842. function f(b) {
  2843. for (var g, c = null; g = a.call(this, b);) c = g;
  2844. return c
  2845. }
  2846. CKEDITOR.dom.walker =
  2847. CKEDITOR.tools.createClass({
  2848. $: function(a) {
  2849. this.range = a;
  2850. this._ = {}
  2851. },
  2852. proto: {
  2853. end: function() {
  2854. this._.end = 1
  2855. },
  2856. next: function() {
  2857. return a.call(this)
  2858. },
  2859. previous: function() {
  2860. return a.call(this, 1)
  2861. },
  2862. checkForward: function() {
  2863. return !1 !== a.call(this, 0, 1)
  2864. },
  2865. checkBackward: function() {
  2866. return !1 !== a.call(this, 1, 1)
  2867. },
  2868. lastForward: function() {
  2869. return f.call(this)
  2870. },
  2871. lastBackward: function() {
  2872. return f.call(this, 1)
  2873. },
  2874. reset: function() {
  2875. delete this.current;
  2876. this._ = {}
  2877. }
  2878. }
  2879. });
  2880. var b = {
  2881. block: 1,
  2882. "list-item": 1,
  2883. table: 1,
  2884. "table-row-group": 1,
  2885. "table-header-group": 1,
  2886. "table-footer-group": 1,
  2887. "table-row": 1,
  2888. "table-column-group": 1,
  2889. "table-column": 1,
  2890. "table-cell": 1,
  2891. "table-caption": 1
  2892. },
  2893. c = {
  2894. absolute: 1,
  2895. fixed: 1
  2896. };
  2897. CKEDITOR.dom.element.prototype.isBlockBoundary = function(a) {
  2898. return "none" != this.getComputedStyle("float") || this.getComputedStyle("position") in c || !b[this.getComputedStyle("display")] ? !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) : !0
  2899. };
  2900. CKEDITOR.dom.walker.blockBoundary = function(a) {
  2901. return function(b) {
  2902. return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a))
  2903. }
  2904. };
  2905. CKEDITOR.dom.walker.listItemBoundary =
  2906. function() {
  2907. return this.blockBoundary({
  2908. br: 1
  2909. })
  2910. };
  2911. CKEDITOR.dom.walker.bookmark = function(a, b) {
  2912. function g(a) {
  2913. return a && a.getName && "span" == a.getName() && a.data("cke-bookmark")
  2914. }
  2915. return function(c) {
  2916. var d, e;
  2917. d = c && c.type != CKEDITOR.NODE_ELEMENT && (e = c.getParent()) && g(e);
  2918. d = a ? d : d || g(c);
  2919. return !!(b ^ d)
  2920. }
  2921. };
  2922. CKEDITOR.dom.walker.whitespaces = function(a) {
  2923. return function(b) {
  2924. var g;
  2925. b && b.type == CKEDITOR.NODE_TEXT && (g = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);
  2926. return !!(a ^ g)
  2927. }
  2928. };
  2929. CKEDITOR.dom.walker.invisible = function(a) {
  2930. var b = CKEDITOR.dom.walker.whitespaces(),
  2931. g = CKEDITOR.env.webkit ? 1 : 0;
  2932. return function(c) {
  2933. b(c) ? c = 1 : (c.type == CKEDITOR.NODE_TEXT && (c = c.getParent()), c = c.$.offsetWidth <= g);
  2934. return !!(a ^ c)
  2935. }
  2936. };
  2937. CKEDITOR.dom.walker.nodeType = function(a, b) {
  2938. return function(g) {
  2939. return !!(b ^ g.type == a)
  2940. }
  2941. };
  2942. CKEDITOR.dom.walker.bogus = function(a) {
  2943. function b(a) {
  2944. return !m(a) && !l(a)
  2945. }
  2946. return function(g) {
  2947. var c = CKEDITOR.env.needsBrFiller ? g.is && g.is("br") : g.getText && e.test(g.getText());
  2948. c && (c = g.getParent(),
  2949. g = g.getNext(b), c = c.isBlockBoundary() && (!g || g.type == CKEDITOR.NODE_ELEMENT && g.isBlockBoundary()));
  2950. return !!(a ^ c)
  2951. }
  2952. };
  2953. CKEDITOR.dom.walker.temp = function(a) {
  2954. return function(b) {
  2955. b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  2956. b = b && b.hasAttribute("data-cke-temp");
  2957. return !!(a ^ b)
  2958. }
  2959. };
  2960. var e = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  2961. m = CKEDITOR.dom.walker.whitespaces(),
  2962. l = CKEDITOR.dom.walker.bookmark(),
  2963. d = CKEDITOR.dom.walker.temp(),
  2964. h = function(a) {
  2965. return l(a) || m(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty)
  2966. };
  2967. CKEDITOR.dom.walker.ignored = function(a) {
  2968. return function(b) {
  2969. b = m(b) || l(b) || d(b);
  2970. return !!(a ^ b)
  2971. }
  2972. };
  2973. var k = CKEDITOR.dom.walker.ignored();
  2974. CKEDITOR.dom.walker.empty = function(a) {
  2975. return function(b) {
  2976. for (var g = 0, c = b.getChildCount(); g < c; ++g)
  2977. if (!k(b.getChild(g))) return !!a;
  2978. return !a
  2979. }
  2980. };
  2981. var g = CKEDITOR.dom.walker.empty(),
  2982. n = CKEDITOR.dom.walker.validEmptyBlockContainers = CKEDITOR.tools.extend(function(a) {
  2983. var b = {},
  2984. g;
  2985. for (g in a) CKEDITOR.dtd[g]["#"] && (b[g] = 1);
  2986. return b
  2987. }(CKEDITOR.dtd.$block), {
  2988. caption: 1,
  2989. td: 1,
  2990. th: 1
  2991. });
  2992. CKEDITOR.dom.walker.editable =
  2993. function(a) {
  2994. return function(b) {
  2995. b = k(b) ? !1 : b.type == CKEDITOR.NODE_TEXT || b.type == CKEDITOR.NODE_ELEMENT && (b.is(CKEDITOR.dtd.$inline) || b.is("hr") || "false" == b.getAttribute("contenteditable") || !CKEDITOR.env.needsBrFiller && b.is(n) && g(b)) ? !0 : !1;
  2996. return !!(a ^ b)
  2997. }
  2998. };
  2999. CKEDITOR.dom.element.prototype.getBogus = function() {
  3000. var a = this;
  3001. do a = a.getPreviousSourceNode(); while (h(a));
  3002. return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && e.test(a.getText())) ? a : !1
  3003. }
  3004. }(), CKEDITOR.dom.range = function(a) {
  3005. this.endOffset = this.endContainer =
  3006. this.startOffset = this.startContainer = null;
  3007. this.collapsed = !0;
  3008. var f = a instanceof CKEDITOR.dom.document;
  3009. this.document = f ? a : a.getDocument();
  3010. this.root = f ? a.getBody() : a
  3011. },
  3012. function() {
  3013. function a(a) {
  3014. a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset
  3015. }
  3016. function f(a, b, c, d, e) {
  3017. function k(a, b, g, c) {
  3018. var d = g ? a.getPrevious() : a.getNext();
  3019. if (c && m) return d;
  3020. t || c ? b.append(a.clone(!0, e), g) : (a.remove(), l && b.append(a));
  3021. return d
  3022. }
  3023. function f() {
  3024. var a, b, g, c = Math.min(J.length,
  3025. E.length);
  3026. for (a = 0; a < c; a++)
  3027. if (b = J[a], g = E[a], !b.equals(g)) return a;
  3028. return a - 1
  3029. }
  3030. function h() {
  3031. var b = S - 1,
  3032. c = G && I && !y.equals(D);
  3033. b < O - 1 || b < T - 1 || c ? (c ? a.moveToPosition(D, CKEDITOR.POSITION_BEFORE_START) : T == b + 1 && F ? a.moveToPosition(E[b], CKEDITOR.POSITION_BEFORE_END) : a.moveToPosition(E[b + 1], CKEDITOR.POSITION_BEFORE_START), d && (b = J[b + 1]) && b.type == CKEDITOR.NODE_ELEMENT && (c = CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e', a.document), c.insertAfter(b),
  3034. b.mergeSiblings(!1), a.moveToBookmark({
  3035. startNode: c
  3036. }))) : a.collapse(!0)
  3037. }
  3038. a.optimizeBookmark();
  3039. var m = 0 === b,
  3040. l = 1 == b,
  3041. t = 2 == b;
  3042. b = t || l;
  3043. var y = a.startContainer,
  3044. D = a.endContainer,
  3045. x = a.startOffset,
  3046. A = a.endOffset,
  3047. C, F, G, I, H, K;
  3048. if (t && D.type == CKEDITOR.NODE_TEXT && y.equals(D)) y = a.document.createText(y.substring(x, A)), c.append(y);
  3049. else {
  3050. D.type == CKEDITOR.NODE_TEXT ? t ? K = !0 : D = D.split(A) : 0 < D.getChildCount() ? A >= D.getChildCount() ? (D = D.getChild(A - 1), F = !0) : D = D.getChild(A) : I = F = !0;
  3051. y.type == CKEDITOR.NODE_TEXT ? t ? H = !0 : y.split(x) : 0 < y.getChildCount() ?
  3052. 0 === x ? (y = y.getChild(x), C = !0) : y = y.getChild(x - 1) : G = C = !0;
  3053. for (var J = y.getParents(), E = D.getParents(), S = f(), O = J.length - 1, T = E.length - 1, M = c, V, da, ca, ga = -1, N = S; N <= O; N++) {
  3054. da = J[N];
  3055. ca = da.getNext();
  3056. for (N != O || da.equals(E[N]) && O < T ? b && (V = M.append(da.clone(0, e))) : C ? k(da, M, !1, G) : H && M.append(a.document.createText(da.substring(x))); ca;) {
  3057. if (ca.equals(E[N])) {
  3058. ga = N;
  3059. break
  3060. }
  3061. ca = k(ca, M)
  3062. }
  3063. M = V
  3064. }
  3065. M = c;
  3066. for (N = S; N <= T; N++)
  3067. if (c = E[N], ca = c.getPrevious(), c.equals(J[N])) b && (M = M.getChild(0));
  3068. else {
  3069. N != T || c.equals(J[N]) && T < O ? b && (V = M.append(c.clone(0,
  3070. e))) : F ? k(c, M, !1, I) : K && M.append(a.document.createText(c.substring(0, A)));
  3071. if (N > ga)
  3072. for (; ca;) ca = k(ca, M, !0);
  3073. M = V
  3074. }
  3075. t || h()
  3076. }
  3077. }
  3078. function b() {
  3079. var a = !1,
  3080. b = CKEDITOR.dom.walker.whitespaces(),
  3081. c = CKEDITOR.dom.walker.bookmark(!0),
  3082. d = CKEDITOR.dom.walker.bogus();
  3083. return function(e) {
  3084. return c(e) || b(e) ? !0 : d(e) && !a ? a = !0 : e.type == CKEDITOR.NODE_TEXT && (e.hasAscendant("pre") || CKEDITOR.tools.trim(e.getText()).length) || e.type == CKEDITOR.NODE_ELEMENT && !e.is(m) ? !1 : !0
  3085. }
  3086. }
  3087. function c(a) {
  3088. var b = CKEDITOR.dom.walker.whitespaces(),
  3089. c = CKEDITOR.dom.walker.bookmark(1);
  3090. return function(d) {
  3091. return c(d) || b(d) ? !0 : !a && l(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty)
  3092. }
  3093. }
  3094. function e(a) {
  3095. return function() {
  3096. var b;
  3097. return this[a ? "getPreviousNode" : "getNextNode"](function(a) {
  3098. !b && k(a) && (b = a);
  3099. return h(a) && !(l(a) && a.equals(b))
  3100. })
  3101. }
  3102. }
  3103. var m = {
  3104. abbr: 1,
  3105. acronym: 1,
  3106. b: 1,
  3107. bdo: 1,
  3108. big: 1,
  3109. cite: 1,
  3110. code: 1,
  3111. del: 1,
  3112. dfn: 1,
  3113. em: 1,
  3114. font: 1,
  3115. i: 1,
  3116. ins: 1,
  3117. label: 1,
  3118. kbd: 1,
  3119. q: 1,
  3120. samp: 1,
  3121. small: 1,
  3122. span: 1,
  3123. strike: 1,
  3124. strong: 1,
  3125. sub: 1,
  3126. sup: 1,
  3127. tt: 1,
  3128. u: 1,
  3129. "var": 1
  3130. },
  3131. l = CKEDITOR.dom.walker.bogus(),
  3132. d = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  3133. h = CKEDITOR.dom.walker.editable(),
  3134. k = CKEDITOR.dom.walker.ignored(!0);
  3135. CKEDITOR.dom.range.prototype = {
  3136. clone: function() {
  3137. var a = new CKEDITOR.dom.range(this.root);
  3138. a._setStartContainer(this.startContainer);
  3139. a.startOffset = this.startOffset;
  3140. a._setEndContainer(this.endContainer);
  3141. a.endOffset = this.endOffset;
  3142. a.collapsed = this.collapsed;
  3143. return a
  3144. },
  3145. collapse: function(a) {
  3146. a ? (this._setEndContainer(this.startContainer), this.endOffset = this.startOffset) : (this._setStartContainer(this.endContainer), this.startOffset = this.endOffset);
  3147. this.collapsed = !0
  3148. },
  3149. cloneContents: function(a) {
  3150. var b = new CKEDITOR.dom.documentFragment(this.document);
  3151. this.collapsed || f(this, 2, b, !1, "undefined" == typeof a ? !0 : a);
  3152. return b
  3153. },
  3154. deleteContents: function(a) {
  3155. this.collapsed || f(this, 0, null, a)
  3156. },
  3157. extractContents: function(a, b) {
  3158. var c = new CKEDITOR.dom.documentFragment(this.document);
  3159. this.collapsed || f(this, 1, c, a, "undefined" == typeof b ? !0 : b);
  3160. return c
  3161. },
  3162. createBookmark: function(a) {
  3163. var b, c, d, e, k = this.collapsed;
  3164. b = this.document.createElement("span");
  3165. b.data("cke-bookmark", 1);
  3166. b.setStyle("display",
  3167. "none");
  3168. b.setHtml("\x26nbsp;");
  3169. a && (d = "cke_bm_" + CKEDITOR.tools.getNextNumber(), b.setAttribute("id", d + (k ? "C" : "S")));
  3170. k || (c = b.clone(), c.setHtml("\x26nbsp;"), a && c.setAttribute("id", d + "E"), e = this.clone(), e.collapse(), e.insertNode(c));
  3171. e = this.clone();
  3172. e.collapse(!0);
  3173. e.insertNode(b);
  3174. c ? (this.setStartAfter(b), this.setEndBefore(c)) : this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END);
  3175. return {
  3176. startNode: a ? d + (k ? "C" : "S") : b,
  3177. endNode: a ? d + "E" : c,
  3178. serializable: a,
  3179. collapsed: k
  3180. }
  3181. },
  3182. createBookmark2: function() {
  3183. function a(b) {
  3184. var g =
  3185. b.container,
  3186. d = b.offset,
  3187. e;
  3188. e = g;
  3189. var k = d;
  3190. e = e.type != CKEDITOR.NODE_ELEMENT || 0 === k || k == e.getChildCount() ? 0 : e.getChild(k - 1).type == CKEDITOR.NODE_TEXT && e.getChild(k).type == CKEDITOR.NODE_TEXT;
  3191. e && (g = g.getChild(d - 1), d = g.getLength());
  3192. if (g.type == CKEDITOR.NODE_ELEMENT && 0 < d) {
  3193. a: {
  3194. for (e = g; d--;)
  3195. if (k = e.getChild(d).getIndex(!0), 0 <= k) {
  3196. d = k;
  3197. break a
  3198. }
  3199. d = -1
  3200. }
  3201. d += 1
  3202. }
  3203. if (g.type == CKEDITOR.NODE_TEXT) {
  3204. e = g;
  3205. for (k = 0;
  3206. (e = e.getPrevious()) && e.type == CKEDITOR.NODE_TEXT;) k += e.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE, "").length;
  3207. e = k;
  3208. g.getText() ? d += e : (k = g.getPrevious(c), e ? (d = e, g = k ? k.getNext() : g.getParent().getFirst()) : (g = g.getParent(), d = k ? k.getIndex(!0) + 1 : 0))
  3209. }
  3210. b.container = g;
  3211. b.offset = d
  3212. }
  3213. function b(a, g) {
  3214. var c = g.getCustomData("cke-fillingChar");
  3215. if (c) {
  3216. var d = a.container;
  3217. c.equals(d) && (a.offset -= CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length, 0 >= a.offset && (a.offset = d.getIndex(), a.container = d.getParent()))
  3218. }
  3219. }
  3220. var c = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, !0);
  3221. return function(c) {
  3222. var d = this.collapsed,
  3223. e = {
  3224. container: this.startContainer,
  3225. offset: this.startOffset
  3226. },
  3227. k = {
  3228. container: this.endContainer,
  3229. offset: this.endOffset
  3230. };
  3231. c && (a(e), b(e, this.root), d || (a(k), b(k, this.root)));
  3232. return {
  3233. start: e.container.getAddress(c),
  3234. end: d ? null : k.container.getAddress(c),
  3235. startOffset: e.offset,
  3236. endOffset: k.offset,
  3237. normalized: c,
  3238. collapsed: d,
  3239. is2: !0
  3240. }
  3241. }
  3242. }(),
  3243. moveToBookmark: function(a) {
  3244. if (a.is2) {
  3245. var b = this.document.getByAddress(a.start, a.normalized),
  3246. c = a.startOffset,
  3247. d = a.end && this.document.getByAddress(a.end, a.normalized);
  3248. a = a.endOffset;
  3249. this.setStart(b, c);
  3250. d ? this.setEnd(d, a) : this.collapse(!0)
  3251. } else b =
  3252. (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode, a = c ? this.document.getById(a.endNode) : a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(!0)
  3253. },
  3254. getBoundaryNodes: function() {
  3255. var a = this.startContainer,
  3256. b = this.endContainer,
  3257. c = this.startOffset,
  3258. d = this.endOffset,
  3259. e;
  3260. if (a.type == CKEDITOR.NODE_ELEMENT)
  3261. if (e = a.getChildCount(), e > c) a = a.getChild(c);
  3262. else if (1 > e) a = a.getPreviousSourceNode();
  3263. else {
  3264. for (a = a.$; a.lastChild;) a = a.lastChild;
  3265. a = new CKEDITOR.dom.node(a);
  3266. a =
  3267. a.getNextSourceNode() || a
  3268. }
  3269. if (b.type == CKEDITOR.NODE_ELEMENT)
  3270. if (e = b.getChildCount(), e > d) b = b.getChild(d).getPreviousSourceNode(!0);
  3271. else if (1 > e) b = b.getPreviousSourceNode();
  3272. else {
  3273. for (b = b.$; b.lastChild;) b = b.lastChild;
  3274. b = new CKEDITOR.dom.node(b)
  3275. }
  3276. a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b);
  3277. return {
  3278. startNode: a,
  3279. endNode: b
  3280. }
  3281. },
  3282. getCommonAncestor: function(a, b) {
  3283. var c = this.startContainer,
  3284. d = this.endContainer,
  3285. c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c.getChild(this.startOffset) :
  3286. c : c.getCommonAncestor(d);
  3287. return b && !c.is ? c.getParent() : c
  3288. },
  3289. optimize: function() {
  3290. var a = this.startContainer,
  3291. b = this.startOffset;
  3292. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a));
  3293. a = this.endContainer;
  3294. b = this.endOffset;
  3295. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a))
  3296. },
  3297. optimizeBookmark: function() {
  3298. var a = this.startContainer,
  3299. b = this.endContainer;
  3300. a.is && a.is("span") && a.data("cke-bookmark") && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
  3301. b && b.is && b.is("span") && b.data("cke-bookmark") && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
  3302. },
  3303. trim: function(a, b) {
  3304. var c = this.startContainer,
  3305. d = this.startOffset,
  3306. e = this.collapsed;
  3307. if ((!a || e) && c && c.type == CKEDITOR.NODE_TEXT) {
  3308. if (d)
  3309. if (d >= c.getLength()) d = c.getIndex() + 1, c = c.getParent();
  3310. else {
  3311. var k = c.split(d),
  3312. d = c.getIndex() + 1,
  3313. c = c.getParent();
  3314. this.startContainer.equals(this.endContainer) ? this.setEnd(k, this.endOffset - this.startOffset) : c.equals(this.endContainer) && (this.endOffset += 1)
  3315. } else d = c.getIndex(), c = c.getParent();
  3316. this.setStart(c, d);
  3317. if (e) {
  3318. this.collapse(!0);
  3319. return
  3320. }
  3321. }
  3322. c = this.endContainer;
  3323. d = this.endOffset;
  3324. b || e || !c || c.type != CKEDITOR.NODE_TEXT || (d ? (d >= c.getLength() || c.split(d), d = c.getIndex() + 1) : d = c.getIndex(), c = c.getParent(), this.setEnd(c, d))
  3325. },
  3326. enlarge: function(a, b) {
  3327. function c(a) {
  3328. return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a
  3329. }
  3330. var d = new RegExp(/[^\s\ufeff]/);
  3331. switch (a) {
  3332. case CKEDITOR.ENLARGE_INLINE:
  3333. var e = 1;
  3334. case CKEDITOR.ENLARGE_ELEMENT:
  3335. var k = function(a, b) {
  3336. var c = new CKEDITOR.dom.range(h);
  3337. c.setStart(a, b);
  3338. c.setEndAt(h, CKEDITOR.POSITION_BEFORE_END);
  3339. var c = new CKEDITOR.dom.walker(c),
  3340. g;
  3341. for (c.guard = function(a) {
  3342. return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary())
  3343. }; g = c.next();) {
  3344. if (g.type != CKEDITOR.NODE_TEXT) return !1;
  3345. C = g != a ? g.getText() : g.substring(b);
  3346. if (d.test(C)) return !1
  3347. }
  3348. return !0
  3349. };
  3350. if (this.collapsed) break;
  3351. var f = this.getCommonAncestor(),
  3352. h = this.root,
  3353. m, l, t, y, D, x = !1,
  3354. A, C;
  3355. A = this.startContainer;
  3356. var F = this.startOffset;
  3357. A.type == CKEDITOR.NODE_TEXT ? (F && (A = !CKEDITOR.tools.trim(A.substring(0, F)).length &&
  3358. A, x = !!A), A && ((y = A.getPrevious()) || (t = A.getParent()))) : (F && (y = A.getChild(F - 1) || A.getLast()), y || (t = A));
  3359. for (t = c(t); t || y;) {
  3360. if (t && !y) {
  3361. !D && t.equals(f) && (D = !0);
  3362. if (e ? t.isBlockBoundary() : !h.contains(t)) break;
  3363. x && "inline" == t.getComputedStyle("display") || (x = !1, D ? m = t : this.setStartBefore(t));
  3364. y = t.getPrevious()
  3365. }
  3366. for (; y;)
  3367. if (A = !1, y.type == CKEDITOR.NODE_COMMENT) y = y.getPrevious();
  3368. else {
  3369. if (y.type == CKEDITOR.NODE_TEXT) C = y.getText(), d.test(C) && (y = null), A = /[\s\ufeff]$/.test(C);
  3370. else if ((y.$.offsetWidth > (CKEDITOR.env.webkit ? 1 :
  3371. 0) || b && y.is("br")) && !y.data("cke-bookmark"))
  3372. if (x && CKEDITOR.dtd.$removeEmpty[y.getName()]) {
  3373. C = y.getText();
  3374. if (d.test(C)) y = null;
  3375. else
  3376. for (var F = y.$.getElementsByTagName("*"), G = 0, I; I = F[G++];)
  3377. if (!CKEDITOR.dtd.$removeEmpty[I.nodeName.toLowerCase()]) {
  3378. y = null;
  3379. break
  3380. }
  3381. y && (A = !!C.length)
  3382. } else y = null;
  3383. A && (x ? D ? m = t : t && this.setStartBefore(t) : x = !0);
  3384. if (y) {
  3385. A = y.getPrevious();
  3386. if (!t && !A) {
  3387. t = y;
  3388. y = null;
  3389. break
  3390. }
  3391. y = A
  3392. } else t = null
  3393. }
  3394. t && (t = c(t.getParent()))
  3395. }
  3396. A = this.endContainer;
  3397. F = this.endOffset;
  3398. t = y = null;
  3399. D = x = !1;
  3400. A.type == CKEDITOR.NODE_TEXT ?
  3401. CKEDITOR.tools.trim(A.substring(F)).length ? x = !0 : (x = !A.getLength(), F == A.getLength() ? (y = A.getNext()) || (t = A.getParent()) : k(A, F) && (t = A.getParent())) : (y = A.getChild(F)) || (t = A);
  3402. for (; t || y;) {
  3403. if (t && !y) {
  3404. !D && t.equals(f) && (D = !0);
  3405. if (e ? t.isBlockBoundary() : !h.contains(t)) break;
  3406. x && "inline" == t.getComputedStyle("display") || (x = !1, D ? l = t : t && this.setEndAfter(t));
  3407. y = t.getNext()
  3408. }
  3409. for (; y;) {
  3410. A = !1;
  3411. if (y.type == CKEDITOR.NODE_TEXT) C = y.getText(), k(y, 0) || (y = null), A = /^[\s\ufeff]/.test(C);
  3412. else if (y.type == CKEDITOR.NODE_ELEMENT) {
  3413. if ((0 < y.$.offsetWidth ||
  3414. b && y.is("br")) && !y.data("cke-bookmark"))
  3415. if (x && CKEDITOR.dtd.$removeEmpty[y.getName()]) {
  3416. C = y.getText();
  3417. if (d.test(C)) y = null;
  3418. else
  3419. for (F = y.$.getElementsByTagName("*"), G = 0; I = F[G++];)
  3420. if (!CKEDITOR.dtd.$removeEmpty[I.nodeName.toLowerCase()]) {
  3421. y = null;
  3422. break
  3423. }
  3424. y && (A = !!C.length)
  3425. } else y = null
  3426. } else A = 1;
  3427. A && x && (D ? l = t : this.setEndAfter(t));
  3428. if (y) {
  3429. A = y.getNext();
  3430. if (!t && !A) {
  3431. t = y;
  3432. y = null;
  3433. break
  3434. }
  3435. y = A
  3436. } else t = null
  3437. }
  3438. t && (t = c(t.getParent()))
  3439. }
  3440. m && l && (f = m.contains(l) ? l : m, this.setStartBefore(f), this.setEndAfter(f));
  3441. break;
  3442. case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
  3443. case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
  3444. t =
  3445. new CKEDITOR.dom.range(this.root);
  3446. h = this.root;
  3447. t.setStartAt(h, CKEDITOR.POSITION_AFTER_START);
  3448. t.setEnd(this.startContainer, this.startOffset);
  3449. t = new CKEDITOR.dom.walker(t);
  3450. var H, K, J = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? {
  3451. br: 1
  3452. } : null),
  3453. E = null,
  3454. S = function(a) {
  3455. if (a.type == CKEDITOR.NODE_ELEMENT && "false" == a.getAttribute("contenteditable"))
  3456. if (E) {
  3457. if (E.equals(a)) {
  3458. E = null;
  3459. return
  3460. }
  3461. } else E = a;
  3462. else if (E) return;
  3463. var b = J(a);
  3464. b || (H = a);
  3465. return b
  3466. },
  3467. e = function(a) {
  3468. var b = S(a);
  3469. !b && a.is && a.is("br") &&
  3470. (K = a);
  3471. return b
  3472. };
  3473. t.guard = S;
  3474. t = t.lastBackward();
  3475. H = H || h;
  3476. this.setStartAt(H, !H.is("br") && (!t && this.checkStartOfBlock() || t && H.contains(t)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
  3477. if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
  3478. t = this.clone();
  3479. t = new CKEDITOR.dom.walker(t);
  3480. var O = CKEDITOR.dom.walker.whitespaces(),
  3481. T = CKEDITOR.dom.walker.bookmark();
  3482. t.evaluator = function(a) {
  3483. return !O(a) && !T(a)
  3484. };
  3485. if ((t = t.previous()) && t.type == CKEDITOR.NODE_ELEMENT && t.is("br")) break
  3486. }
  3487. t = this.clone();
  3488. t.collapse();
  3489. t.setEndAt(h,
  3490. CKEDITOR.POSITION_BEFORE_END);
  3491. t = new CKEDITOR.dom.walker(t);
  3492. t.guard = a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? e : S;
  3493. H = E = K = null;
  3494. t = t.lastForward();
  3495. H = H || h;
  3496. this.setEndAt(H, !t && this.checkEndOfBlock() || t && H.contains(t) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START);
  3497. K && this.setEndAfter(K)
  3498. }
  3499. },
  3500. shrink: function(a, b, c) {
  3501. if (!this.collapsed) {
  3502. a = a || CKEDITOR.SHRINK_TEXT;
  3503. var d = this.clone(),
  3504. e = this.startContainer,
  3505. k = this.endContainer,
  3506. f = this.startOffset,
  3507. h = this.endOffset,
  3508. m = 1,
  3509. l = 1;
  3510. e && e.type == CKEDITOR.NODE_TEXT && (f ?
  3511. f >= e.getLength() ? d.setStartAfter(e) : (d.setStartBefore(e), m = 0) : d.setStartBefore(e));
  3512. k && k.type == CKEDITOR.NODE_TEXT && (h ? h >= k.getLength() ? d.setEndAfter(k) : (d.setEndAfter(k), l = 0) : d.setEndBefore(k));
  3513. var d = new CKEDITOR.dom.walker(d),
  3514. t = CKEDITOR.dom.walker.bookmark();
  3515. d.evaluator = function(b) {
  3516. return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT)
  3517. };
  3518. var y;
  3519. d.guard = function(b, d) {
  3520. if (t(b)) return !0;
  3521. if (a == CKEDITOR.SHRINK_ELEMENT && b.type == CKEDITOR.NODE_TEXT || d && b.equals(y) || !1 === c && b.type ==
  3522. CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute("contenteditable")) return !1;
  3523. d || b.type != CKEDITOR.NODE_ELEMENT || (y = b);
  3524. return !0
  3525. };
  3526. m && (e = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(e, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
  3527. l && (d.reset(), (d = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(d, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END));
  3528. return !(!m && !l)
  3529. }
  3530. },
  3531. insertNode: function(a) {
  3532. this.optimizeBookmark();
  3533. this.trim(!1, !0);
  3534. var b = this.startContainer,
  3535. c = b.getChild(this.startOffset);
  3536. c ? a.insertBefore(c) : b.append(a);
  3537. a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
  3538. this.setStartBefore(a)
  3539. },
  3540. moveToPosition: function(a, b) {
  3541. this.setStartAt(a, b);
  3542. this.collapse(!0)
  3543. },
  3544. moveToRange: function(a) {
  3545. this.setStart(a.startContainer, a.startOffset);
  3546. this.setEnd(a.endContainer, a.endOffset)
  3547. },
  3548. selectNodeContents: function(a) {
  3549. this.setStart(a, 0);
  3550. this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
  3551. },
  3552. setStart: function(b, c) {
  3553. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex(), b = b.getParent());
  3554. this._setStartContainer(b);
  3555. this.startOffset = c;
  3556. this.endContainer || (this._setEndContainer(b), this.endOffset = c);
  3557. a(this)
  3558. },
  3559. setEnd: function(b, c) {
  3560. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b.getParent());
  3561. this._setEndContainer(b);
  3562. this.endOffset = c;
  3563. this.startContainer || (this._setStartContainer(b), this.startOffset = c);
  3564. a(this)
  3565. },
  3566. setStartAfter: function(a) {
  3567. this.setStart(a.getParent(),
  3568. a.getIndex() + 1)
  3569. },
  3570. setStartBefore: function(a) {
  3571. this.setStart(a.getParent(), a.getIndex())
  3572. },
  3573. setEndAfter: function(a) {
  3574. this.setEnd(a.getParent(), a.getIndex() + 1)
  3575. },
  3576. setEndBefore: function(a) {
  3577. this.setEnd(a.getParent(), a.getIndex())
  3578. },
  3579. setStartAt: function(b, c) {
  3580. switch (c) {
  3581. case CKEDITOR.POSITION_AFTER_START:
  3582. this.setStart(b, 0);
  3583. break;
  3584. case CKEDITOR.POSITION_BEFORE_END:
  3585. b.type == CKEDITOR.NODE_TEXT ? this.setStart(b, b.getLength()) : this.setStart(b, b.getChildCount());
  3586. break;
  3587. case CKEDITOR.POSITION_BEFORE_START:
  3588. this.setStartBefore(b);
  3589. break;
  3590. case CKEDITOR.POSITION_AFTER_END:
  3591. this.setStartAfter(b)
  3592. }
  3593. a(this)
  3594. },
  3595. setEndAt: function(b, c) {
  3596. switch (c) {
  3597. case CKEDITOR.POSITION_AFTER_START:
  3598. this.setEnd(b, 0);
  3599. break;
  3600. case CKEDITOR.POSITION_BEFORE_END:
  3601. b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount());
  3602. break;
  3603. case CKEDITOR.POSITION_BEFORE_START:
  3604. this.setEndBefore(b);
  3605. break;
  3606. case CKEDITOR.POSITION_AFTER_END:
  3607. this.setEndAfter(b)
  3608. }
  3609. a(this)
  3610. },
  3611. fixBlock: function(a, b) {
  3612. var c = this.createBookmark(),
  3613. d = this.document.createElement(b);
  3614. this.collapse(a);
  3615. this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  3616. this.extractContents().appendTo(d);
  3617. d.trim();
  3618. this.insertNode(d);
  3619. var e = d.getBogus();
  3620. e && e.remove();
  3621. d.appendBogus();
  3622. this.moveToBookmark(c);
  3623. return d
  3624. },
  3625. splitBlock: function(a, b) {
  3626. var c = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
  3627. d = new CKEDITOR.dom.elementPath(this.endContainer, this.root),
  3628. e = c.block,
  3629. k = d.block,
  3630. f = null;
  3631. if (!c.blockLimit.equals(d.blockLimit)) return null;
  3632. "br" != a && (e || (e = this.fixBlock(!0, a), k = (new CKEDITOR.dom.elementPath(this.endContainer,
  3633. this.root)).block), k || (k = this.fixBlock(!1, a)));
  3634. c = e && this.checkStartOfBlock();
  3635. d = k && this.checkEndOfBlock();
  3636. this.deleteContents();
  3637. e && e.equals(k) && (d ? (f = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(k, CKEDITOR.POSITION_AFTER_END), k = null) : c ? (f = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(e, CKEDITOR.POSITION_BEFORE_START), e = null) : (k = this.splitElement(e, b || !1), e.is("ul", "ol") || e.appendBogus()));
  3638. return {
  3639. previousBlock: e,
  3640. nextBlock: k,
  3641. wasStartOfBlock: c,
  3642. wasEndOfBlock: d,
  3643. elementPath: f
  3644. }
  3645. },
  3646. splitElement: function(a, b) {
  3647. if (!this.collapsed) return null;
  3648. this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
  3649. var c = this.extractContents(!1, b || !1),
  3650. d = a.clone(!1, b || !1);
  3651. c.appendTo(d);
  3652. d.insertAfter(a);
  3653. this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  3654. return d
  3655. },
  3656. removeEmptyBlocksAtEnd: function() {
  3657. function a(g) {
  3658. return function(a) {
  3659. return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() || g.is("table") && a.is("caption") ? !1 : !0
  3660. }
  3661. }
  3662. var b = CKEDITOR.dom.walker.whitespaces(),
  3663. c = CKEDITOR.dom.walker.bookmark(!1);
  3664. return function(b) {
  3665. for (var c = this.createBookmark(), d = this[b ? "endPath" : "startPath"](), e = d.block || d.blockLimit, k; e && !e.equals(d.root) && !e.getFirst(a(e));) k = e.getParent(), this[b ? "setEndAt" : "setStartAt"](e, CKEDITOR.POSITION_AFTER_END), e.remove(1), e = k;
  3666. this.moveToBookmark(c)
  3667. }
  3668. }(),
  3669. startPath: function() {
  3670. return new CKEDITOR.dom.elementPath(this.startContainer, this.root)
  3671. },
  3672. endPath: function() {
  3673. return new CKEDITOR.dom.elementPath(this.endContainer, this.root)
  3674. },
  3675. checkBoundaryOfElement: function(a,
  3676. b) {
  3677. var d = b == CKEDITOR.START,
  3678. e = this.clone();
  3679. e.collapse(d);
  3680. e[d ? "setStartAt" : "setEndAt"](a, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
  3681. e = new CKEDITOR.dom.walker(e);
  3682. e.evaluator = c(d);
  3683. return e[d ? "checkBackward" : "checkForward"]()
  3684. },
  3685. checkStartOfBlock: function() {
  3686. var a = this.startContainer,
  3687. c = this.startOffset;
  3688. CKEDITOR.env.ie && c && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.ltrim(a.substring(0, c)), d.test(a) && this.trim(0, 1));
  3689. this.trim();
  3690. a = new CKEDITOR.dom.elementPath(this.startContainer, this.root);
  3691. c = this.clone();
  3692. c.collapse(!0);
  3693. c.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START);
  3694. a = new CKEDITOR.dom.walker(c);
  3695. a.evaluator = b();
  3696. return a.checkBackward()
  3697. },
  3698. checkEndOfBlock: function() {
  3699. var a = this.endContainer,
  3700. c = this.endOffset;
  3701. CKEDITOR.env.ie && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.rtrim(a.substring(c)), d.test(a) && this.trim(1, 0));
  3702. this.trim();
  3703. a = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
  3704. c = this.clone();
  3705. c.collapse(!1);
  3706. c.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END);
  3707. a = new CKEDITOR.dom.walker(c);
  3708. a.evaluator = b();
  3709. return a.checkForward()
  3710. },
  3711. getPreviousNode: function(a, b, c) {
  3712. var d = this.clone();
  3713. d.collapse(1);
  3714. d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START);
  3715. c = new CKEDITOR.dom.walker(d);
  3716. c.evaluator = a;
  3717. c.guard = b;
  3718. return c.previous()
  3719. },
  3720. getNextNode: function(a, b, c) {
  3721. var d = this.clone();
  3722. d.collapse();
  3723. d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
  3724. c = new CKEDITOR.dom.walker(d);
  3725. c.evaluator = a;
  3726. c.guard = b;
  3727. return c.next()
  3728. },
  3729. checkReadOnly: function() {
  3730. function a(b, c) {
  3731. for (; b;) {
  3732. if (b.type ==
  3733. CKEDITOR.NODE_ELEMENT) {
  3734. if ("false" == b.getAttribute("contentEditable") && !b.data("cke-editable")) return 0;
  3735. if (b.is("html") || "true" == b.getAttribute("contentEditable") && (b.contains(c) || b.equals(c))) break
  3736. }
  3737. b = b.getParent()
  3738. }
  3739. return 1
  3740. }
  3741. return function() {
  3742. var b = this.startContainer,
  3743. c = this.endContainer;
  3744. return !(a(b, c) && a(c, b))
  3745. }
  3746. }(),
  3747. moveToElementEditablePosition: function(a, b) {
  3748. if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) return this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START), !0;
  3749. for (var c = 0; a;) {
  3750. if (a.type == CKEDITOR.NODE_TEXT) {
  3751. b && this.endContainer && this.checkEndOfBlock() && d.test(a.getText()) ? this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START) : this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START);
  3752. c = 1;
  3753. break
  3754. }
  3755. if (a.type == CKEDITOR.NODE_ELEMENT)
  3756. if (a.isEditable()) this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START), c = 1;
  3757. else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START);
  3758. else if ("false" == a.getAttribute("contenteditable") && a.is(CKEDITOR.dtd.$block)) return this.setStartBefore(a), this.setEndAfter(a), !0;
  3759. var e = a,
  3760. f = c,
  3761. h = void 0;
  3762. e.type == CKEDITOR.NODE_ELEMENT && e.isEditable(!1) && (h = e[b ? "getLast" : "getFirst"](k));
  3763. f || h || (h = e[b ? "getPrevious" : "getNext"](k));
  3764. a = h
  3765. }
  3766. return !!c
  3767. },
  3768. moveToClosestEditablePosition: function(a, b) {
  3769. var c, d = 0,
  3770. e, k, f = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
  3771. a ? (c = new CKEDITOR.dom.range(this.root), c.moveToPosition(a, f[b ? 0 : 1])) : c = this.clone();
  3772. if (a &&
  3773. !a.is(CKEDITOR.dtd.$block)) d = 1;
  3774. else if (e = c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) d = 1, (k = e.type == CKEDITOR.NODE_ELEMENT) && e.is(CKEDITOR.dtd.$block) && "false" == e.getAttribute("contenteditable") ? (c.setStartAt(e, CKEDITOR.POSITION_BEFORE_START), c.setEndAt(e, CKEDITOR.POSITION_AFTER_END)) : !CKEDITOR.env.needsBrFiller && k && e.is(CKEDITOR.dom.walker.validEmptyBlockContainers) ? (c.setEnd(e, 0), c.collapse()) : c.moveToPosition(e, f[b ? 1 : 0]);
  3775. d && this.moveToRange(c);
  3776. return !!d
  3777. },
  3778. moveToElementEditStart: function(a) {
  3779. return this.moveToElementEditablePosition(a)
  3780. },
  3781. moveToElementEditEnd: function(a) {
  3782. return this.moveToElementEditablePosition(a, !0)
  3783. },
  3784. getEnclosedNode: function() {
  3785. var a = this.clone();
  3786. a.optimize();
  3787. if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null;
  3788. var a = new CKEDITOR.dom.walker(a),
  3789. b = CKEDITOR.dom.walker.bookmark(!1, !0),
  3790. c = CKEDITOR.dom.walker.whitespaces(!0);
  3791. a.evaluator = function(a) {
  3792. return c(a) && b(a)
  3793. };
  3794. var d = a.next();
  3795. a.reset();
  3796. return d && d.equals(a.previous()) ? d : null
  3797. },
  3798. getTouchedStartNode: function() {
  3799. var a = this.startContainer;
  3800. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a
  3801. },
  3802. getTouchedEndNode: function() {
  3803. var a = this.endContainer;
  3804. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
  3805. },
  3806. getNextEditableNode: e(),
  3807. getPreviousEditableNode: e(1),
  3808. scrollIntoView: function() {
  3809. var a = new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", this.document),
  3810. b, c, d, e = this.clone();
  3811. e.optimize();
  3812. (d = e.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = e.startContainer.getText(),
  3813. b = e.startContainer.split(e.startOffset), a.insertAfter(e.startContainer)) : e.insertNode(a);
  3814. a.scrollIntoView();
  3815. d && (e.startContainer.setText(c), b.remove());
  3816. a.remove()
  3817. },
  3818. _setStartContainer: function(a) {
  3819. this.startContainer = a
  3820. },
  3821. _setEndContainer: function(a) {
  3822. this.endContainer = a
  3823. },
  3824. _find: function(a, b) {
  3825. var c = this.getCommonAncestor(),
  3826. d = this.getBoundaryNodes(),
  3827. e = [],
  3828. k, f, h, m;
  3829. if (c && c.find)
  3830. for (f = c.find(a), k = 0; k < f.count(); k++)
  3831. if (c = f.getItem(k), b || !c.isReadOnly()) h = c.getPosition(d.startNode) & CKEDITOR.POSITION_FOLLOWING ||
  3832. d.startNode.equals(c), m = c.getPosition(d.endNode) & CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IS_CONTAINED, h && m && e.push(c);
  3833. return e
  3834. }
  3835. }
  3836. }(), 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",
  3837. function() {
  3838. function a(a) {
  3839. 1 >
  3840. arguments.length || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks = 0, this._ || (this._ = {}))
  3841. }
  3842. function f(a) {
  3843. var b = [];
  3844. a.forEach(function(a) {
  3845. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  3846. }, CKEDITOR.NODE_ELEMENT, !0);
  3847. return b
  3848. }
  3849. function b(a, c, d, e) {
  3850. a: {
  3851. null == e && (e = f(d));
  3852. for (var h; h = e.shift();)
  3853. if (h.getDtd().p) {
  3854. e = {
  3855. element: h,
  3856. remaining: e
  3857. };
  3858. break a
  3859. }
  3860. e = null
  3861. }
  3862. if (!e) return 0;
  3863. if ((h = CKEDITOR.filter.instances[e.element.data("cke-filter")]) && !h.check(c)) return b(a, c, d, e.remaining);
  3864. c = new CKEDITOR.dom.range(e.element);c.selectNodeContents(e.element);c = c.createIterator();c.enlargeBr = a.enlargeBr;c.enforceRealBlocks = a.enforceRealBlocks;c.activeFilter = c.filter = h;a._.nestedEditable = {
  3865. element: e.element,
  3866. container: d,
  3867. remaining: e.remaining,
  3868. iterator: c
  3869. };
  3870. return 1
  3871. }
  3872. function c(a, b, c) {
  3873. if (!b) return !1;
  3874. a = a.clone();
  3875. a.collapse(!c);
  3876. return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END)
  3877. }
  3878. var e = /^[\r\n\t ]+$/,
  3879. m = CKEDITOR.dom.walker.bookmark(!1, !0),
  3880. l = CKEDITOR.dom.walker.whitespaces(!0),
  3881. d = function(a) {
  3882. return m(a) &&
  3883. l(a)
  3884. },
  3885. h = {
  3886. dd: 1,
  3887. dt: 1,
  3888. li: 1
  3889. };
  3890. a.prototype = {
  3891. getNextParagraph: function(a) {
  3892. var g, f, l, q, v;
  3893. a = a || "p";
  3894. if (this._.nestedEditable) {
  3895. if (g = this._.nestedEditable.iterator.getNextParagraph(a)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, g;
  3896. this.activeFilter = this.filter;
  3897. if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, this._.nestedEditable.iterator.getNextParagraph(a);
  3898. this._.nestedEditable = null
  3899. }
  3900. if (!this.range.root.getDtd()[a]) return null;
  3901. if (!this._.started) {
  3902. var u = this.range.clone();
  3903. f = u.startPath();
  3904. var r = u.endPath(),
  3905. p = !u.collapsed && c(u, f.block),
  3906. z = !u.collapsed && c(u, r.block, 1);
  3907. u.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
  3908. p && u.setStartAt(f.block, CKEDITOR.POSITION_BEFORE_END);
  3909. z && u.setEndAt(r.block, CKEDITOR.POSITION_AFTER_START);
  3910. f = u.endContainer.hasAscendant("pre", !0) || u.startContainer.hasAscendant("pre", !0);
  3911. u.enlarge(this.forceBrBreak && !f || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  3912. u.collapsed || (f = new CKEDITOR.dom.walker(u.clone()),
  3913. r = CKEDITOR.dom.walker.bookmark(!0, !0), f.evaluator = r, this._.nextNode = f.next(), f = new CKEDITOR.dom.walker(u.clone()), f.evaluator = r, f = f.previous(), this._.lastNode = f.getNextSourceNode(!0, null, u.root), this._.lastNode && this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary() && (r = this.range.clone(), r.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END), r.checkEndOfBlock() && (r = new CKEDITOR.dom.elementPath(r.endContainer,
  3914. r.root), this._.lastNode = (r.block || r.blockLimit).getNextSourceNode(!0))), this._.lastNode && u.root.contains(this._.lastNode) || (this._.lastNode = this._.docEndMarker = u.document.createText(""), this._.lastNode.insertAfter(f)), u = null);
  3915. this._.started = 1;
  3916. f = u
  3917. }
  3918. r = this._.nextNode;
  3919. u = this._.lastNode;
  3920. for (this._.nextNode = null; r;) {
  3921. var p = 0,
  3922. z = r.hasAscendant("pre"),
  3923. B = r.type != CKEDITOR.NODE_ELEMENT,
  3924. t = 0;
  3925. if (B) r.type == CKEDITOR.NODE_TEXT && e.test(r.getText()) && (B = 0);
  3926. else {
  3927. var y = r.getName();
  3928. if (CKEDITOR.dtd.$block[y] && "false" == r.getAttribute("contenteditable")) {
  3929. g =
  3930. r;
  3931. b(this, a, g);
  3932. break
  3933. } else if (r.isBlockBoundary(this.forceBrBreak && !z && {
  3934. br: 1
  3935. })) {
  3936. if ("br" == y) B = 1;
  3937. else if (!f && !r.getChildCount() && "hr" != y) {
  3938. g = r;
  3939. l = r.equals(u);
  3940. break
  3941. }
  3942. f && (f.setEndAt(r, CKEDITOR.POSITION_BEFORE_START), "br" != y && (this._.nextNode = r));
  3943. p = 1
  3944. } else {
  3945. if (r.getFirst()) {
  3946. f || (f = this.range.clone(), f.setStartAt(r, CKEDITOR.POSITION_BEFORE_START));
  3947. r = r.getFirst();
  3948. continue
  3949. }
  3950. B = 1
  3951. }
  3952. }
  3953. B && !f && (f = this.range.clone(), f.setStartAt(r, CKEDITOR.POSITION_BEFORE_START));
  3954. l = (!p || B) && r.equals(u);
  3955. if (f && !p)
  3956. for (; !r.getNext(d) && !l;) {
  3957. y =
  3958. r.getParent();
  3959. if (y.isBlockBoundary(this.forceBrBreak && !z && {
  3960. br: 1
  3961. })) {
  3962. p = 1;
  3963. B = 0;
  3964. l || y.equals(u);
  3965. f.setEndAt(y, CKEDITOR.POSITION_BEFORE_END);
  3966. break
  3967. }
  3968. r = y;
  3969. B = 1;
  3970. l = r.equals(u);
  3971. t = 1
  3972. }
  3973. B && f.setEndAt(r, CKEDITOR.POSITION_AFTER_END);
  3974. r = this._getNextSourceNode(r, t, u);
  3975. if ((l = !r) || p && f) break
  3976. }
  3977. if (!g) {
  3978. if (!f) return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null;
  3979. g = new CKEDITOR.dom.elementPath(f.startContainer, f.root);
  3980. r = g.blockLimit;
  3981. p = {
  3982. div: 1,
  3983. th: 1,
  3984. td: 1
  3985. };
  3986. g = g.block;
  3987. !g && r && !this.enforceRealBlocks && p[r.getName()] &&
  3988. f.checkStartOfBlock() && f.checkEndOfBlock() && !r.equals(f.root) ? g = r : !g || this.enforceRealBlocks && g.is(h) ? (g = this.range.document.createElement(a), f.extractContents().appendTo(g), g.trim(), f.insertNode(g), q = v = !0) : "li" != g.getName() ? f.checkStartOfBlock() && f.checkEndOfBlock() || (g = g.clone(!1), f.extractContents().appendTo(g), g.trim(), v = f.splitBlock(), q = !v.wasStartOfBlock, v = !v.wasEndOfBlock, f.insertNode(g)) : l || (this._.nextNode = g.equals(u) ? null : this._getNextSourceNode(f.getBoundaryNodes().endNode, 1, u))
  3989. }
  3990. q && (q =
  3991. g.getPrevious()) && q.type == CKEDITOR.NODE_ELEMENT && ("br" == q.getName() ? q.remove() : q.getLast() && "br" == q.getLast().$.nodeName.toLowerCase() && q.getLast().remove());
  3992. v && (q = g.getLast()) && q.type == CKEDITOR.NODE_ELEMENT && "br" == q.getName() && (!CKEDITOR.env.needsBrFiller || q.getPrevious(m) || q.getNext(m)) && q.remove();
  3993. this._.nextNode || (this._.nextNode = l || g.equals(u) || !u ? null : this._getNextSourceNode(g, 1, u));
  3994. return g
  3995. },
  3996. _getNextSourceNode: function(a, b, c) {
  3997. function d(a) {
  3998. return !(a.equals(c) || a.equals(e))
  3999. }
  4000. var e = this.range.root;
  4001. for (a = a.getNextSourceNode(b, null, d); !m(a);) a = a.getNextSourceNode(b, null, d);
  4002. return a
  4003. }
  4004. };
  4005. CKEDITOR.dom.range.prototype.createIterator = function() {
  4006. return new a(this)
  4007. }
  4008. }(), CKEDITOR.command = function(a, f) {
  4009. this.uiItems = [];
  4010. this.exec = function(b) {
  4011. if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return !1;
  4012. this.editorFocus && a.focus();
  4013. return !1 === this.fire("exec") ? !0 : !1 !== f.exec.call(this, a, b)
  4014. };
  4015. this.refresh = function(a, b) {
  4016. if (!this.readOnly && a.readOnly) return !0;
  4017. if (this.context && !b.isContextFor(this.context) ||
  4018. !this.checkAllowed(!0)) return this.disable(), !0;
  4019. this.startDisabled || this.enable();
  4020. this.modes && !this.modes[a.mode] && this.disable();
  4021. return !1 === this.fire("refresh", {
  4022. editor: a,
  4023. path: b
  4024. }) ? !0 : f.refresh && !1 !== f.refresh.apply(this, arguments)
  4025. };
  4026. var b;
  4027. this.checkAllowed = function(c) {
  4028. return c || "boolean" != typeof b ? b = a.activeFilter.checkFeature(this) : b
  4029. };
  4030. CKEDITOR.tools.extend(this, f, {
  4031. modes: {
  4032. wysiwyg: 1
  4033. },
  4034. editorFocus: 1,
  4035. contextSensitive: !!f.context,
  4036. state: CKEDITOR.TRISTATE_DISABLED
  4037. });
  4038. CKEDITOR.event.call(this)
  4039. }, CKEDITOR.command.prototype = {
  4040. enable: function() {
  4041. this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(this.preserveState && "undefined" != typeof this.previousState ? this.previousState : CKEDITOR.TRISTATE_OFF)
  4042. },
  4043. disable: function() {
  4044. this.setState(CKEDITOR.TRISTATE_DISABLED)
  4045. },
  4046. setState: function(a) {
  4047. if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return !1;
  4048. this.previousState = this.state;
  4049. this.state = a;
  4050. this.fire("state");
  4051. return !0
  4052. },
  4053. toggleState: function() {
  4054. this.state == CKEDITOR.TRISTATE_OFF ? this.setState(CKEDITOR.TRISTATE_ON) :
  4055. this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF)
  4056. }
  4057. }, CKEDITOR.event.implementOn(CKEDITOR.command.prototype), CKEDITOR.ENTER_P = 1, CKEDITOR.ENTER_BR = 2, CKEDITOR.ENTER_DIV = 3, CKEDITOR.config = {
  4058. customConfig: "config.js",
  4059. autoUpdateElement: !0,
  4060. language: "",
  4061. defaultLanguage: "en",
  4062. contentsLangDirection: "",
  4063. enterMode: CKEDITOR.ENTER_P,
  4064. forceEnterMode: !1,
  4065. shiftEnterMode: CKEDITOR.ENTER_BR,
  4066. docType: "\x3c!DOCTYPE html\x3e",
  4067. bodyId: "",
  4068. bodyClass: "",
  4069. fullPage: !1,
  4070. height: 200,
  4071. contentsCss: CKEDITOR.getUrl("contents.css"),
  4072. extraPlugins: "",
  4073. removePlugins: "",
  4074. protectedSource: [],
  4075. tabIndex: 0,
  4076. width: "",
  4077. baseFloatZIndex: 1E4,
  4078. blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85]
  4079. },
  4080. function() {
  4081. function a(a, b, c, d, e) {
  4082. var g, f;
  4083. a = [];
  4084. for (g in b) {
  4085. f = b[g];
  4086. f = "boolean" == typeof f ? {} : "function" == typeof f ? {
  4087. match: f
  4088. } : G(f);
  4089. "$" != g.charAt(0) && (f.elements = g);
  4090. c && (f.featureName = c.toLowerCase());
  4091. var k = f;
  4092. k.elements = l(k.elements, /\s+/) || null;
  4093. k.propertiesOnly = k.propertiesOnly || !0 === k.elements;
  4094. var h = /\s*,\s*/,
  4095. t = void 0;
  4096. for (t in K) {
  4097. k[t] = l(k[t],
  4098. h) || null;
  4099. var m = k,
  4100. y = J[t],
  4101. u = l(k[J[t]], h),
  4102. r = k[t],
  4103. n = [],
  4104. D = !0,
  4105. E = void 0;
  4106. u ? D = !1 : u = {};
  4107. for (E in r) "!" == E.charAt(0) && (E = E.slice(1), n.push(E), u[E] = !0, D = !1);
  4108. for (; E = n.pop();) r[E] = r["!" + E], delete r["!" + E];
  4109. m[y] = (D ? !1 : u) || null
  4110. }
  4111. k.match = k.match || null;
  4112. d.push(f);
  4113. a.push(f)
  4114. }
  4115. b = e.elements;
  4116. e = e.generic;
  4117. var x;
  4118. c = 0;
  4119. for (d = a.length; c < d; ++c) {
  4120. g = G(a[c]);
  4121. f = !0 === g.classes || !0 === g.styles || !0 === g.attributes;
  4122. k = g;
  4123. t = y = h = void 0;
  4124. for (h in K) k[h] = p(k[h]);
  4125. m = !0;
  4126. for (t in J) {
  4127. h = J[t];
  4128. y = k[h];
  4129. u = [];
  4130. r = void 0;
  4131. for (r in y) - 1 < r.indexOf("*") ? u.push(new RegExp("^" +
  4132. r.replace(/\*/g, ".*") + "$")) : u.push(r);
  4133. y = u;
  4134. y.length && (k[h] = y, m = !1)
  4135. }
  4136. k.nothingRequired = m;
  4137. k.noProperties = !(k.attributes || k.classes || k.styles);
  4138. if (!0 === g.elements || null === g.elements) e[f ? "unshift" : "push"](g);
  4139. else
  4140. for (x in k = g.elements, delete g.elements, k)
  4141. if (b[x]) b[x][f ? "unshift" : "push"](g);
  4142. else b[x] = [g]
  4143. }
  4144. }
  4145. function f(a, c, e, g) {
  4146. if (!a.match || a.match(c))
  4147. if (g || d(a, c))
  4148. if (a.propertiesOnly || (e.valid = !0), e.allAttributes || (e.allAttributes = b(a.attributes, c.attributes, e.validAttributes)), e.allStyles || (e.allStyles = b(a.styles,
  4149. c.styles, e.validStyles)), !e.allClasses) {
  4150. a = a.classes;
  4151. c = c.classes;
  4152. g = e.validClasses;
  4153. if (a)
  4154. if (!0 === a) a = !0;
  4155. else {
  4156. for (var f = 0, k = c.length, h; f < k; ++f) h = c[f], g[h] || (g[h] = a(h));
  4157. a = !1
  4158. } else a = !1;
  4159. e.allClasses = a
  4160. }
  4161. }
  4162. function b(a, b, c) {
  4163. if (!a) return !1;
  4164. if (!0 === a) return !0;
  4165. for (var d in b) c[d] || (c[d] = a(d));
  4166. return !1
  4167. }
  4168. function c(a, b, c) {
  4169. if (!a.match || a.match(b)) {
  4170. if (a.noProperties) return !1;
  4171. c.hadInvalidAttribute = e(a.attributes, b.attributes) || c.hadInvalidAttribute;
  4172. c.hadInvalidStyle = e(a.styles, b.styles) || c.hadInvalidStyle;
  4173. a = a.classes;
  4174. b = b.classes;
  4175. if (a) {
  4176. for (var d = !1, g = !0 === a, f = b.length; f--;)
  4177. if (g || a(b[f])) b.splice(f, 1), d = !0;
  4178. a = d
  4179. } else a = !1;
  4180. c.hadInvalidClass = a || c.hadInvalidClass
  4181. }
  4182. }
  4183. function e(a, b) {
  4184. if (!a) return !1;
  4185. var c = !1,
  4186. d = !0 === a,
  4187. e;
  4188. for (e in b)
  4189. if (d || a(e)) delete b[e], c = !0;
  4190. return c
  4191. }
  4192. function m(a, b, c) {
  4193. if (a.disabled || a.customConfig && !c || !b) return !1;
  4194. a._.cachedChecks = {};
  4195. return !0
  4196. }
  4197. function l(a, b) {
  4198. if (!a) return !1;
  4199. if (!0 === a) return a;
  4200. if ("string" == typeof a) return a = I(a), "*" == a ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b));
  4201. if (CKEDITOR.tools.isArray(a)) return a.length ?
  4202. CKEDITOR.tools.convertArrayToObject(a) : !1;
  4203. var c = {},
  4204. d = 0,
  4205. e;
  4206. for (e in a) c[e] = a[e], d++;
  4207. return d ? c : !1
  4208. }
  4209. function d(a, b) {
  4210. if (a.nothingRequired) return !0;
  4211. var c, d, e, g;
  4212. if (e = a.requiredClasses)
  4213. for (g = b.classes, c = 0; c < e.length; ++c)
  4214. if (d = e[c], "string" == typeof d) {
  4215. if (-1 == CKEDITOR.tools.indexOf(g, d)) return !1
  4216. } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(g, d)) return !1;
  4217. return h(b.styles, a.requiredStyles) && h(b.attributes, a.requiredAttributes)
  4218. }
  4219. function h(a, b) {
  4220. if (!b) return !0;
  4221. for (var c = 0, d; c < b.length; ++c)
  4222. if (d = b[c], "string" ==
  4223. typeof d) {
  4224. if (!(d in a)) return !1
  4225. } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) return !1;
  4226. return !0
  4227. }
  4228. function k(a) {
  4229. if (!a) return {};
  4230. a = a.split(/\s*,\s*/).sort();
  4231. for (var b = {}; a.length;) b[a.shift()] = "cke-test";
  4232. return b
  4233. }
  4234. function g(a) {
  4235. var b, c, d, e, g = {},
  4236. f = 1;
  4237. for (a = I(a); b = a.match(E);)(c = b[2]) ? (d = n(c, "styles"), e = n(c, "attrs"), c = n(c, "classes")) : d = e = c = null, g["$" + f++] = {
  4238. elements: b[1],
  4239. classes: c,
  4240. styles: d,
  4241. attributes: e
  4242. }, a = a.slice(b[0].length);
  4243. return g
  4244. }
  4245. function n(a, b) {
  4246. var c = a.match(S[b]);
  4247. return c ? I(c[1]) : null
  4248. }
  4249. function w(a) {
  4250. var b = a.styleBackup = a.attributes.style,
  4251. c = a.classBackup = a.attributes["class"];
  4252. a.styles || (a.styles = CKEDITOR.tools.parseCssText(b || "", 1));
  4253. a.classes || (a.classes = c ? c.split(/\s+/) : [])
  4254. }
  4255. function q(a, b, d, e) {
  4256. var g = 0,
  4257. k;
  4258. e.toHtml && (b.name = b.name.replace(O, "$1"));
  4259. if (e.doCallbacks && a.elementCallbacks) {
  4260. a: {
  4261. k = a.elementCallbacks;
  4262. for (var h = 0, t = k.length, m; h < t; ++h)
  4263. if (m = k[h](b)) {
  4264. k = m;
  4265. break a
  4266. }
  4267. k = void 0
  4268. }
  4269. if (k) return k
  4270. }
  4271. if (e.doTransform && (k = a._.transformations[b.name])) {
  4272. w(b);
  4273. for (h = 0; h < k.length; ++h) y(a, b, k[h]);
  4274. u(b)
  4275. }
  4276. if (e.doFilter) {
  4277. a: {
  4278. h =
  4279. b.name;
  4280. t = a._;
  4281. a = t.allowedRules.elements[h];
  4282. k = t.allowedRules.generic;
  4283. h = t.disallowedRules.elements[h];
  4284. t = t.disallowedRules.generic;
  4285. m = e.skipRequired;
  4286. var l = {
  4287. valid: !1,
  4288. validAttributes: {},
  4289. validClasses: {},
  4290. validStyles: {},
  4291. allAttributes: !1,
  4292. allClasses: !1,
  4293. allStyles: !1,
  4294. hadInvalidAttribute: !1,
  4295. hadInvalidClass: !1,
  4296. hadInvalidStyle: !1
  4297. },
  4298. p, n;
  4299. if (a || k) {
  4300. w(b);
  4301. if (h)
  4302. for (p = 0, n = h.length; p < n; ++p)
  4303. if (!1 === c(h[p], b, l)) {
  4304. a = null;
  4305. break a
  4306. }
  4307. if (t)
  4308. for (p = 0, n = t.length; p < n; ++p) c(t[p], b, l);
  4309. if (a)
  4310. for (p = 0, n = a.length; p < n; ++p) f(a[p], b, l, m);
  4311. if (k)
  4312. for (p =
  4313. 0, n = k.length; p < n; ++p) f(k[p], b, l, m);
  4314. a = l
  4315. } else a = null
  4316. }
  4317. if (!a || !a.valid) return d.push(b), 1;n = a.validAttributes;
  4318. var D = a.validStyles;k = a.validClasses;
  4319. var h = b.attributes,
  4320. E = b.styles,
  4321. t = b.classes;m = b.classBackup;
  4322. var x = b.styleBackup,
  4323. J, v, q = [],
  4324. l = [],
  4325. z = /^data-cke-/;p = !1;delete h.style;delete h["class"];delete b.classBackup;delete b.styleBackup;
  4326. if (!a.allAttributes)
  4327. for (J in h) n[J] || (z.test(J) ? J == (v = J.replace(/^data-cke-saved-/, "")) || n[v] || (delete h[J], p = !0) : (delete h[J], p = !0));
  4328. if (!a.allStyles || a.hadInvalidStyle) {
  4329. for (J in E) a.allStyles ||
  4330. D[J] ? q.push(J + ":" + E[J]) : p = !0;
  4331. q.length && (h.style = q.sort().join("; "))
  4332. } else x && (h.style = x);
  4333. if (!a.allClasses || a.hadInvalidClass) {
  4334. for (J = 0; J < t.length; ++J)(a.allClasses || k[t[J]]) && l.push(t[J]);
  4335. l.length && (h["class"] = l.sort().join(" "));
  4336. m && l.length < m.split(/\s+/).length && (p = !0)
  4337. } else m && (h["class"] = m);p && (g = 1);
  4338. if (!e.skipFinalValidation && !r(b)) return d.push(b), 1
  4339. }
  4340. e.toHtml && (b.name = b.name.replace(T, "cke:$1"));
  4341. return g
  4342. }
  4343. function v(a) {
  4344. var b = [],
  4345. c;
  4346. for (c in a) - 1 < c.indexOf("*") && b.push(c.replace(/\*/g, ".*"));
  4347. return b.length ?
  4348. new RegExp("^(?:" + b.join("|") + ")$") : null
  4349. }
  4350. function u(a) {
  4351. var b = a.attributes,
  4352. c;
  4353. delete b.style;
  4354. delete b["class"];
  4355. if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) b.style = c;
  4356. a.classes.length && (b["class"] = a.classes.sort().join(" "))
  4357. }
  4358. function r(a) {
  4359. switch (a.name) {
  4360. case "a":
  4361. if (!(a.children.length || a.attributes.name || a.attributes.id)) return !1;
  4362. break;
  4363. case "img":
  4364. if (!a.attributes.src) return !1
  4365. }
  4366. return !0
  4367. }
  4368. function p(a) {
  4369. if (!a) return !1;
  4370. if (!0 === a) return !0;
  4371. var b = v(a);
  4372. return function(c) {
  4373. return c in a || b && c.match(b)
  4374. }
  4375. }
  4376. function z() {
  4377. return new CKEDITOR.htmlParser.element("br")
  4378. }
  4379. function B(a) {
  4380. return a.type == CKEDITOR.NODE_ELEMENT && ("br" == a.name || F.$block[a.name])
  4381. }
  4382. function t(a, b, c) {
  4383. var d = a.name;
  4384. if (F.$empty[d] || !a.children.length) "hr" == d && "br" == b ? a.replaceWith(z()) : (a.parent && c.push({
  4385. check: "it",
  4386. el: a.parent
  4387. }), a.remove());
  4388. else if (F.$block[d] || "tr" == d)
  4389. if ("br" == b) a.previous && !B(a.previous) && (b = z(), b.insertBefore(a)), a.next && !B(a.next) && (b = z(), b.insertAfter(a)), a.replaceWithChildren();
  4390. else {
  4391. var d = a.children,
  4392. e;
  4393. b: {
  4394. e = F[b];
  4395. for (var g = 0, k = d.length, f; g < k; ++g)
  4396. if (f = d[g], f.type == CKEDITOR.NODE_ELEMENT &&
  4397. !e[f.name]) {
  4398. e = !1;
  4399. break b
  4400. }
  4401. e = !0
  4402. }
  4403. if (e) a.name = b, a.attributes = {}, c.push({
  4404. check: "parent-down",
  4405. el: a
  4406. });
  4407. else {
  4408. e = a.parent;
  4409. for (var g = e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || "body" == e.name, h, t, k = d.length; 0 < k;) f = d[--k], g && (f.type == CKEDITOR.NODE_TEXT || f.type == CKEDITOR.NODE_ELEMENT && F.$inline[f.name]) ? (h || (h = new CKEDITOR.htmlParser.element(b), h.insertAfter(a), c.push({
  4410. check: "parent-down",
  4411. el: h
  4412. })), h.add(f, 0)) : (h = null, t = F[e.name] || F.span, f.insertAfter(a), e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || f.type != CKEDITOR.NODE_ELEMENT ||
  4413. t[f.name] || c.push({
  4414. check: "el-up",
  4415. el: f
  4416. }));
  4417. a.remove()
  4418. }
  4419. } else d in {
  4420. style: 1,
  4421. script: 1
  4422. } ? a.remove() : (a.parent && c.push({
  4423. check: "it",
  4424. el: a.parent
  4425. }), a.replaceWithChildren())
  4426. }
  4427. function y(a, b, c) {
  4428. var d, e;
  4429. for (d = 0; d < c.length; ++d)
  4430. if (e = c[d], !(e.check && !a.check(e.check, !1) || e.left && !e.left(b))) {
  4431. e.right(b, M);
  4432. break
  4433. }
  4434. }
  4435. function D(a, b) {
  4436. var c = b.getDefinition(),
  4437. d = c.attributes,
  4438. e = c.styles,
  4439. g, k, f, h;
  4440. if (a.name != c.element) return !1;
  4441. for (g in d)
  4442. if ("class" == g)
  4443. for (c = d[g].split(/\s+/), f = a.classes.join("|"); h = c.pop();) {
  4444. if (-1 == f.indexOf(h)) return !1
  4445. } else if (a.attributes[g] !=
  4446. d[g]) return !1;
  4447. for (k in e)
  4448. if (a.styles[k] != e[k]) return !1;
  4449. return !0
  4450. }
  4451. function x(a, b) {
  4452. var c, d;
  4453. "string" == typeof a ? c = a : a instanceof CKEDITOR.style ? d = a : (c = a[0], d = a[1]);
  4454. return [{
  4455. element: c,
  4456. left: d,
  4457. right: function(a, c) {
  4458. c.transform(a, b)
  4459. }
  4460. }]
  4461. }
  4462. function A(a) {
  4463. return function(b) {
  4464. return D(b, a)
  4465. }
  4466. }
  4467. function C(a) {
  4468. return function(b, c) {
  4469. c[a](b)
  4470. }
  4471. }
  4472. var F = CKEDITOR.dtd,
  4473. G = CKEDITOR.tools.copy,
  4474. I = CKEDITOR.tools.trim,
  4475. H = ["", "p", "br", "div"];
  4476. CKEDITOR.FILTER_SKIP_TREE = 2;
  4477. CKEDITOR.filter = function(a) {
  4478. this.allowedContent = [];
  4479. this.disallowedContent = [];
  4480. this.elementCallbacks = null;
  4481. this.disabled = !1;
  4482. this.editor = null;
  4483. this.id = CKEDITOR.tools.getNextNumber();
  4484. this._ = {
  4485. allowedRules: {
  4486. elements: {},
  4487. generic: []
  4488. },
  4489. disallowedRules: {
  4490. elements: {},
  4491. generic: []
  4492. },
  4493. transformations: {},
  4494. cachedTests: {}
  4495. };
  4496. CKEDITOR.filter.instances[this.id] = this;
  4497. if (a instanceof CKEDITOR.editor) {
  4498. a = this.editor = a;
  4499. this.customConfig = !0;
  4500. var b = a.config.allowedContent;
  4501. !0 === b ? this.disabled = !0 : (b || (this.customConfig = !1), this.allow(b, "config", 1), this.allow(a.config.extraAllowedContent, "extra", 1), this.allow(H[a.enterMode] +
  4502. " " + H[a.shiftEnterMode], "default", 1), this.disallow(a.config.disallowedContent))
  4503. } else this.customConfig = !1, this.allow(a, "default", 1)
  4504. };
  4505. CKEDITOR.filter.instances = {};
  4506. CKEDITOR.filter.prototype = {
  4507. allow: function(b, c, d) {
  4508. if (!m(this, b, d)) return !1;
  4509. var e, k;
  4510. if ("string" == typeof b) b = g(b);
  4511. else if (b instanceof CKEDITOR.style) {
  4512. if (b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, d);
  4513. e = b.getDefinition();
  4514. b = {};
  4515. d = e.attributes;
  4516. b[e.element] = e = {
  4517. styles: e.styles,
  4518. requiredStyles: e.styles && CKEDITOR.tools.objectKeys(e.styles)
  4519. };
  4520. d && (d = G(d), e.classes = d["class"] ? d["class"].split(/\s+/) : null, e.requiredClasses = e.classes, delete d["class"], e.attributes = d, e.requiredAttributes = d && CKEDITOR.tools.objectKeys(d))
  4521. } else if (CKEDITOR.tools.isArray(b)) {
  4522. for (e = 0; e < b.length; ++e) k = this.allow(b[e], c, d);
  4523. return k
  4524. }
  4525. a(this, b, c, this.allowedContent, this._.allowedRules);
  4526. return !0
  4527. },
  4528. applyTo: function(a, b, c, d) {
  4529. if (this.disabled) return !1;
  4530. var e = this,
  4531. g = [],
  4532. k = this.editor && this.editor.config.protectedSource,
  4533. f, h = !1,
  4534. m = {
  4535. doFilter: !c,
  4536. doTransform: !0,
  4537. doCallbacks: !0,
  4538. toHtml: b
  4539. };
  4540. a.forEach(function(a) {
  4541. if (a.type == CKEDITOR.NODE_ELEMENT) {
  4542. if ("off" == a.attributes["data-cke-filter"]) return !1;
  4543. if (!b || "span" != a.name || !~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))
  4544. if (f = q(e, a, g, m), f & 1) h = !0;
  4545. else if (f & 2) return !1
  4546. } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
  4547. var c;
  4548. a: {
  4549. var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));
  4550. c = [];
  4551. var t, l, y;
  4552. if (k)
  4553. for (l = 0; l < k.length; ++l)
  4554. if ((y = d.match(k[l])) && y[0].length == d.length) {
  4555. c = !0;
  4556. break a
  4557. }
  4558. d = CKEDITOR.htmlParser.fragment.fromHtml(d);
  4559. 1 == d.children.length && (t = d.children[0]).type == CKEDITOR.NODE_ELEMENT && q(e, t, c, m);
  4560. c = !c.length
  4561. }
  4562. c || g.push(a)
  4563. }
  4564. }, null, !0);
  4565. g.length && (h = !0);
  4566. var l;
  4567. a = [];
  4568. d = H[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)];
  4569. for (var y; c = g.pop();) c.type == CKEDITOR.NODE_ELEMENT ? t(c, d, a) : c.remove();
  4570. for (; l = a.pop();)
  4571. if (c = l.el, c.parent) switch (y = F[c.parent.name] || F.span, l.check) {
  4572. case "it":
  4573. F.$removeEmpty[c.name] && !c.children.length ? t(c, d, a) : r(c) || t(c, d, a);
  4574. break;
  4575. case "el-up":
  4576. c.parent.type ==
  4577. CKEDITOR.NODE_DOCUMENT_FRAGMENT || y[c.name] || t(c, d, a);
  4578. break;
  4579. case "parent-down":
  4580. c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || y[c.name] || t(c.parent, d, a)
  4581. }
  4582. return h
  4583. },
  4584. checkFeature: function(a) {
  4585. if (this.disabled || !a) return !0;
  4586. a.toFeature && (a = a.toFeature(this.editor));
  4587. return !a.requiredContent || this.check(a.requiredContent)
  4588. },
  4589. disable: function() {
  4590. this.disabled = !0
  4591. },
  4592. disallow: function(b) {
  4593. if (!m(this, b, !0)) return !1;
  4594. "string" == typeof b && (b = g(b));
  4595. a(this, b, null, this.disallowedContent, this._.disallowedRules);
  4596. return !0
  4597. },
  4598. addContentForms: function(a) {
  4599. if (!this.disabled && a) {
  4600. var b, c, d = [],
  4601. e;
  4602. for (b = 0; b < a.length && !e; ++b) c = a[b], ("string" == typeof c || c instanceof CKEDITOR.style) && this.check(c) && (e = c);
  4603. if (e) {
  4604. for (b = 0; b < a.length; ++b) d.push(x(a[b], e));
  4605. this.addTransformations(d)
  4606. }
  4607. }
  4608. },
  4609. addElementCallback: function(a) {
  4610. this.elementCallbacks || (this.elementCallbacks = []);
  4611. this.elementCallbacks.push(a)
  4612. },
  4613. addFeature: function(a) {
  4614. if (this.disabled || !a) return !0;
  4615. a.toFeature && (a = a.toFeature(this.editor));
  4616. this.allow(a.allowedContent, a.name);
  4617. this.addTransformations(a.contentTransformations);
  4618. this.addContentForms(a.contentForms);
  4619. return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : !0
  4620. },
  4621. addTransformations: function(a) {
  4622. var b, c;
  4623. if (!this.disabled && a) {
  4624. var d = this._.transformations,
  4625. e;
  4626. for (e = 0; e < a.length; ++e) {
  4627. b = a[e];
  4628. var g = void 0,
  4629. k = void 0,
  4630. f = void 0,
  4631. h = void 0,
  4632. t = void 0,
  4633. m = void 0;
  4634. c = [];
  4635. for (k = 0; k < b.length; ++k) f = b[k], "string" == typeof f ? (f = f.split(/\s*:\s*/), h = f[0], t = null, m = f[1]) : (h = f.check, t = f.left, m = f.right), g || (g = f, g = g.element ? g.element : h ? h.match(/^([a-z0-9]+)/i)[0] :
  4636. g.left.getDefinition().element), t instanceof CKEDITOR.style && (t = A(t)), c.push({
  4637. check: h == g ? null : h,
  4638. left: t,
  4639. right: "string" == typeof m ? C(m) : m
  4640. });
  4641. b = g;
  4642. d[b] || (d[b] = []);
  4643. d[b].push(c)
  4644. }
  4645. }
  4646. },
  4647. check: function(a, b, c) {
  4648. if (this.disabled) return !0;
  4649. if (CKEDITOR.tools.isArray(a)) {
  4650. for (var d = a.length; d--;)
  4651. if (this.check(a[d], b, c)) return !0;
  4652. return !1
  4653. }
  4654. var e, f;
  4655. if ("string" == typeof a) {
  4656. f = a + "\x3c" + (!1 === b ? "0" : "1") + (c ? "1" : "0") + "\x3e";
  4657. if (f in this._.cachedChecks) return this._.cachedChecks[f];
  4658. d = g(a).$1;
  4659. e = d.styles;
  4660. var h = d.classes;
  4661. d.name = d.elements;
  4662. d.classes = h = h ? h.split(/\s*,\s*/) : [];
  4663. d.styles = k(e);
  4664. d.attributes = k(d.attributes);
  4665. d.children = [];
  4666. h.length && (d.attributes["class"] = h.join(" "));
  4667. e && (d.attributes.style = CKEDITOR.tools.writeCssText(d.styles));
  4668. e = d
  4669. } else d = a.getDefinition(), e = d.styles, h = d.attributes || {}, e && !CKEDITOR.tools.isEmpty(e) ? (e = G(e), h.style = CKEDITOR.tools.writeCssText(e, !0)) : e = {}, e = {
  4670. name: d.element,
  4671. attributes: h,
  4672. classes: h["class"] ? h["class"].split(/\s+/) : [],
  4673. styles: e,
  4674. children: []
  4675. };
  4676. var h = CKEDITOR.tools.clone(e),
  4677. t = [],
  4678. m;
  4679. if (!1 !== b && (m = this._.transformations[e.name])) {
  4680. for (d =
  4681. 0; d < m.length; ++d) y(this, e, m[d]);
  4682. u(e)
  4683. }
  4684. q(this, h, t, {
  4685. doFilter: !0,
  4686. doTransform: !1 !== b,
  4687. skipRequired: !c,
  4688. skipFinalValidation: !c
  4689. });
  4690. b = 0 < t.length ? !1 : CKEDITOR.tools.objectCompare(e.attributes, h.attributes, !0) ? !0 : !1;
  4691. "string" == typeof a && (this._.cachedChecks[f] = b);
  4692. return b
  4693. },
  4694. getAllowedEnterMode: function() {
  4695. var a = ["p", "div", "br"],
  4696. b = {
  4697. p: CKEDITOR.ENTER_P,
  4698. div: CKEDITOR.ENTER_DIV,
  4699. br: CKEDITOR.ENTER_BR
  4700. };
  4701. return function(c, d) {
  4702. var e = a.slice(),
  4703. g;
  4704. if (this.check(H[c])) return c;
  4705. for (d || (e = e.reverse()); g = e.pop();)
  4706. if (this.check(g)) return b[g];
  4707. return CKEDITOR.ENTER_BR
  4708. }
  4709. }(),
  4710. destroy: function() {
  4711. delete CKEDITOR.filter.instances[this.id];
  4712. delete this._;
  4713. delete this.allowedContent;
  4714. delete this.disallowedContent
  4715. }
  4716. };
  4717. var K = {
  4718. styles: 1,
  4719. attributes: 1,
  4720. classes: 1
  4721. },
  4722. J = {
  4723. styles: "requiredStyles",
  4724. attributes: "requiredAttributes",
  4725. classes: "requiredClasses"
  4726. },
  4727. E = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
  4728. S = {
  4729. styles: /{([^}]+)}/,
  4730. attrs: /\[([^\]]+)\]/,
  4731. classes: /\(([^\)]+)\)/
  4732. },
  4733. O = /^cke:(object|embed|param)$/,
  4734. T = /^(object|embed|param)$/,
  4735. M;
  4736. M = CKEDITOR.filter.transformationsTools = {
  4737. sizeToStyle: function(a) {
  4738. this.lengthToStyle(a, "width");
  4739. this.lengthToStyle(a, "height")
  4740. },
  4741. sizeToAttribute: function(a) {
  4742. this.lengthToAttribute(a, "width");
  4743. this.lengthToAttribute(a, "height")
  4744. },
  4745. lengthToStyle: function(a, b, c) {
  4746. c = c || b;
  4747. if (!(c in a.styles)) {
  4748. var d = a.attributes[b];
  4749. d && (/^\d+$/.test(d) && (d += "px"), a.styles[c] = d)
  4750. }
  4751. delete a.attributes[b]
  4752. },
  4753. lengthToAttribute: function(a, b, c) {
  4754. c = c || b;
  4755. if (!(c in a.attributes)) {
  4756. var d = a.styles[b],
  4757. e = d && d.match(/^(\d+)(?:\.\d*)?px$/);
  4758. e ? a.attributes[c] = e[1] : "cke-test" == d && (a.attributes[c] = "cke-test")
  4759. }
  4760. delete a.styles[b]
  4761. },
  4762. alignmentToStyle: function(a) {
  4763. if (!("float" in a.styles)) {
  4764. var b = a.attributes.align;
  4765. if ("left" == b || "right" == b) a.styles["float"] = b
  4766. }
  4767. delete a.attributes.align
  4768. },
  4769. alignmentToAttribute: function(a) {
  4770. if (!("align" in a.attributes)) {
  4771. var b = a.styles["float"];
  4772. if ("left" == b || "right" == b) a.attributes.align = b
  4773. }
  4774. delete a.styles["float"]
  4775. },
  4776. splitBorderShorthand: function(a) {
  4777. function b(d) {
  4778. a.styles["border-top-width"] = c[d[0]];
  4779. a.styles["border-right-width"] =
  4780. c[d[1]];
  4781. a.styles["border-bottom-width"] = c[d[2]];
  4782. a.styles["border-left-width"] = c[d[3]]
  4783. }
  4784. if (a.styles.border) {
  4785. var c = a.styles.border.match(/([\.\d]+\w+)/g) || ["0px"];
  4786. switch (c.length) {
  4787. case 1:
  4788. a.styles["border-width"] = c[0];
  4789. break;
  4790. case 2:
  4791. b([0, 1, 0, 1]);
  4792. break;
  4793. case 3:
  4794. b([0, 1, 2, 1]);
  4795. break;
  4796. case 4:
  4797. b([0, 1, 2, 3])
  4798. }
  4799. a.styles["border-style"] = a.styles["border-style"] || (a.styles.border.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|initial|inherit)/) || [])[0];
  4800. a.styles["border-style"] || delete a.styles["border-style"];
  4801. delete a.styles.border
  4802. }
  4803. },
  4804. listTypeToStyle: function(a) {
  4805. if (a.attributes.type) switch (a.attributes.type) {
  4806. case "a":
  4807. a.styles["list-style-type"] = "lower-alpha";
  4808. break;
  4809. case "A":
  4810. a.styles["list-style-type"] = "upper-alpha";
  4811. break;
  4812. case "i":
  4813. a.styles["list-style-type"] = "lower-roman";
  4814. break;
  4815. case "I":
  4816. a.styles["list-style-type"] = "upper-roman";
  4817. break;
  4818. case "1":
  4819. a.styles["list-style-type"] = "decimal";
  4820. break;
  4821. default:
  4822. a.styles["list-style-type"] = a.attributes.type
  4823. }
  4824. },
  4825. splitMarginShorthand: function(a) {
  4826. function b(d) {
  4827. a.styles["margin-top"] =
  4828. c[d[0]];
  4829. a.styles["margin-right"] = c[d[1]];
  4830. a.styles["margin-bottom"] = c[d[2]];
  4831. a.styles["margin-left"] = c[d[3]]
  4832. }
  4833. if (a.styles.margin) {
  4834. var c = a.styles.margin.match(/(\-?[\.\d]+\w+)/g) || ["0px"];
  4835. switch (c.length) {
  4836. case 1:
  4837. a.styles.margin = c[0];
  4838. break;
  4839. case 2:
  4840. b([0, 1, 0, 1]);
  4841. break;
  4842. case 3:
  4843. b([0, 1, 2, 1]);
  4844. break;
  4845. case 4:
  4846. b([0, 1, 2, 3])
  4847. }
  4848. delete a.styles.margin
  4849. }
  4850. },
  4851. matchesStyle: D,
  4852. transform: function(a, b) {
  4853. if ("string" == typeof b) a.name = b;
  4854. else {
  4855. var c = b.getDefinition(),
  4856. d = c.styles,
  4857. e = c.attributes,
  4858. g, f, k, h;
  4859. a.name = c.element;
  4860. for (g in e)
  4861. if ("class" ==
  4862. g)
  4863. for (c = a.classes.join("|"), k = e[g].split(/\s+/); h = k.pop();) - 1 == c.indexOf(h) && a.classes.push(h);
  4864. else a.attributes[g] = e[g];
  4865. for (f in d) a.styles[f] = d[f]
  4866. }
  4867. }
  4868. }
  4869. }(),
  4870. function() {
  4871. CKEDITOR.focusManager = function(a) {
  4872. if (a.focusManager) return a.focusManager;
  4873. this.hasFocus = !1;
  4874. this.currentActive = null;
  4875. this._ = {
  4876. editor: a
  4877. };
  4878. return this
  4879. };
  4880. CKEDITOR.focusManager._ = {
  4881. blurDelay: 200
  4882. };
  4883. CKEDITOR.focusManager.prototype = {
  4884. focus: function(a) {
  4885. this._.timer && clearTimeout(this._.timer);
  4886. a && (this.currentActive = a);
  4887. this.hasFocus || this._.locked || ((a =
  4888. CKEDITOR.currentInstance) && a.focusManager.blur(1), this.hasFocus = !0, (a = this._.editor.container) && a.addClass("cke_focus"), this._.editor.fire("focus"))
  4889. },
  4890. lock: function() {
  4891. this._.locked = 1
  4892. },
  4893. unlock: function() {
  4894. delete this._.locked
  4895. },
  4896. blur: function(a) {
  4897. function f() {
  4898. if (this.hasFocus) {
  4899. this.hasFocus = !1;
  4900. var a = this._.editor.container;
  4901. a && a.removeClass("cke_focus");
  4902. this._.editor.fire("blur")
  4903. }
  4904. }
  4905. if (!this._.locked) {
  4906. this._.timer && clearTimeout(this._.timer);
  4907. var b = CKEDITOR.focusManager._.blurDelay;
  4908. a || !b ? f.call(this) : this._.timer =
  4909. CKEDITOR.tools.setTimeout(function() {
  4910. delete this._.timer;
  4911. f.call(this)
  4912. }, b, this)
  4913. }
  4914. },
  4915. add: function(a, f) {
  4916. var b = a.getCustomData("focusmanager");
  4917. if (!b || b != this) {
  4918. b && b.remove(a);
  4919. var b = "focus",
  4920. c = "blur";
  4921. f && (CKEDITOR.env.ie ? (b = "focusin", c = "focusout") : CKEDITOR.event.useCapture = 1);
  4922. var e = {
  4923. blur: function() {
  4924. a.equals(this.currentActive) && this.blur()
  4925. },
  4926. focus: function() {
  4927. this.focus(a)
  4928. }
  4929. };
  4930. a.on(b, e.focus, this);
  4931. a.on(c, e.blur, this);
  4932. f && (CKEDITOR.event.useCapture = 0);
  4933. a.setCustomData("focusmanager", this);
  4934. a.setCustomData("focusmanager_handlers",
  4935. e)
  4936. }
  4937. },
  4938. remove: function(a) {
  4939. a.removeCustomData("focusmanager");
  4940. var f = a.removeCustomData("focusmanager_handlers");
  4941. a.removeListener("blur", f.blur);
  4942. a.removeListener("focus", f.focus)
  4943. }
  4944. }
  4945. }(), CKEDITOR.keystrokeHandler = function(a) {
  4946. if (a.keystrokeHandler) return a.keystrokeHandler;
  4947. this.keystrokes = {};
  4948. this.blockedKeystrokes = {};
  4949. this._ = {
  4950. editor: a
  4951. };
  4952. return this
  4953. },
  4954. function() {
  4955. var a, f = function(b) {
  4956. b = b.data;
  4957. var e = b.getKeystroke(),
  4958. f = this.keystrokes[e],
  4959. l = this._.editor;
  4960. a = !1 === l.fire("key", {
  4961. keyCode: e,
  4962. domEvent: b
  4963. });
  4964. a || (f && (a = !1 !==
  4965. l.execCommand(f, {
  4966. from: "keystrokeHandler"
  4967. })), a || (a = !!this.blockedKeystrokes[e]));
  4968. a && b.preventDefault(!0);
  4969. return !a
  4970. },
  4971. b = function(b) {
  4972. a && (a = !1, b.data.preventDefault(!0))
  4973. };
  4974. CKEDITOR.keystrokeHandler.prototype = {
  4975. attach: function(a) {
  4976. a.on("keydown", f, this);
  4977. if (CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this)
  4978. }
  4979. }
  4980. }(),
  4981. function() {
  4982. CKEDITOR.lang = {
  4983. languages: {
  4984. af: 1,
  4985. ar: 1,
  4986. bg: 1,
  4987. bn: 1,
  4988. bs: 1,
  4989. ca: 1,
  4990. cs: 1,
  4991. cy: 1,
  4992. da: 1,
  4993. de: 1,
  4994. "de-ch": 1,
  4995. el: 1,
  4996. "en-au": 1,
  4997. "en-ca": 1,
  4998. "en-gb": 1,
  4999. en: 1,
  5000. eo: 1,
  5001. es: 1,
  5002. et: 1,
  5003. eu: 1,
  5004. fa: 1,
  5005. fi: 1,
  5006. fo: 1,
  5007. "fr-ca": 1,
  5008. fr: 1,
  5009. gl: 1,
  5010. gu: 1,
  5011. he: 1,
  5012. hi: 1,
  5013. hr: 1,
  5014. hu: 1,
  5015. id: 1,
  5016. is: 1,
  5017. it: 1,
  5018. ja: 1,
  5019. ka: 1,
  5020. km: 1,
  5021. ko: 1,
  5022. ku: 1,
  5023. lt: 1,
  5024. lv: 1,
  5025. mk: 1,
  5026. mn: 1,
  5027. ms: 1,
  5028. nb: 1,
  5029. nl: 1,
  5030. no: 1,
  5031. oc: 1,
  5032. pl: 1,
  5033. "pt-br": 1,
  5034. pt: 1,
  5035. ro: 1,
  5036. ru: 1,
  5037. si: 1,
  5038. sk: 1,
  5039. sl: 1,
  5040. sq: 1,
  5041. "sr-latn": 1,
  5042. sr: 1,
  5043. sv: 1,
  5044. th: 1,
  5045. tr: 1,
  5046. tt: 1,
  5047. ug: 1,
  5048. uk: 1,
  5049. vi: 1,
  5050. "zh-cn": 1,
  5051. zh: 1
  5052. },
  5053. rtl: {
  5054. ar: 1,
  5055. fa: 1,
  5056. he: 1,
  5057. ku: 1,
  5058. ug: 1
  5059. },
  5060. load: function(a, f, b) {
  5061. a && CKEDITOR.lang.languages[a] || (a = this.detect(f, a));
  5062. var c = this;
  5063. f = function() {
  5064. c[a].dir = c.rtl[a] ? "rtl" : "ltr";
  5065. b(a, c[a])
  5066. };
  5067. this[a] ? f() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), f, this)
  5068. },
  5069. detect: function(a, f) {
  5070. var b =
  5071. this.languages;
  5072. f = f || navigator.userLanguage || navigator.language || a;
  5073. var c = f.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
  5074. e = c[1],
  5075. c = c[2];
  5076. b[e + "-" + c] ? e = e + "-" + c : b[e] || (e = null);
  5077. CKEDITOR.lang.detect = e ? function() {
  5078. return e
  5079. } : function(a) {
  5080. return a
  5081. };
  5082. return e || a
  5083. }
  5084. }
  5085. }(), CKEDITOR.scriptLoader = function() {
  5086. var a = {},
  5087. f = {};
  5088. return {
  5089. load: function(b, c, e, m) {
  5090. var l = "string" == typeof b;
  5091. l && (b = [b]);
  5092. e || (e = CKEDITOR);
  5093. var d = b.length,
  5094. h = [],
  5095. k = [],
  5096. g = function(a) {
  5097. c && (l ? c.call(e, a) : c.call(e, h, k))
  5098. };
  5099. if (0 === d) g(!0);
  5100. else {
  5101. var n = function(a, b) {
  5102. (b ? h : k).push(a);
  5103. 0 >= --d && (m && CKEDITOR.document.getDocumentElement().removeStyle("cursor"), g(b))
  5104. },
  5105. w = function(b, c) {
  5106. a[b] = 1;
  5107. var d = f[b];
  5108. delete f[b];
  5109. for (var e = 0; e < d.length; e++) d[e](b, c)
  5110. },
  5111. q = function(b) {
  5112. if (a[b]) n(b, !0);
  5113. else {
  5114. var d = f[b] || (f[b] = []);
  5115. d.push(n);
  5116. if (!(1 < d.length)) {
  5117. var e = new CKEDITOR.dom.element("script");
  5118. e.setAttributes({
  5119. type: "text/javascript",
  5120. src: b
  5121. });
  5122. c && (CKEDITOR.env.ie && (8 >= CKEDITOR.env.version || CKEDITOR.env.ie9Compat) ? e.$.onreadystatechange = function() {
  5123. if ("loaded" == e.$.readyState || "complete" == e.$.readyState) e.$.onreadystatechange =
  5124. null, w(b, !0)
  5125. } : (e.$.onload = function() {
  5126. setTimeout(function() {
  5127. w(b, !0)
  5128. }, 0)
  5129. }, e.$.onerror = function() {
  5130. w(b, !1)
  5131. }));
  5132. e.appendTo(CKEDITOR.document.getHead())
  5133. }
  5134. }
  5135. };
  5136. m && CKEDITOR.document.getDocumentElement().setStyle("cursor", "wait");
  5137. for (var v = 0; v < d; v++) q(b[v])
  5138. }
  5139. },
  5140. queue: function() {
  5141. function a() {
  5142. var b;
  5143. (b = c[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0)
  5144. }
  5145. var c = [];
  5146. return function(e, f) {
  5147. var l = this;
  5148. c.push({
  5149. scriptUrl: e,
  5150. callback: function() {
  5151. f && f.apply(this, arguments);
  5152. c.shift();
  5153. a.call(l)
  5154. }
  5155. });
  5156. 1 == c.length && a.call(this)
  5157. }
  5158. }()
  5159. }
  5160. }(),
  5161. CKEDITOR.resourceManager = function(a, f) {
  5162. this.basePath = a;
  5163. this.fileName = f;
  5164. this.registered = {};
  5165. this.loaded = {};
  5166. this.externals = {};
  5167. this._ = {
  5168. waitingList: {}
  5169. }
  5170. }, CKEDITOR.resourceManager.prototype = {
  5171. add: function(a, f) {
  5172. if (this.registered[a]) throw Error('[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.');
  5173. var b = this.registered[a] = f || {};
  5174. b.name = a;
  5175. b.path = this.getPath(a);
  5176. CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b);
  5177. return this.get(a)
  5178. },
  5179. get: function(a) {
  5180. return this.registered[a] ||
  5181. null
  5182. },
  5183. getPath: function(a) {
  5184. var f = this.externals[a];
  5185. return CKEDITOR.getUrl(f && f.dir || this.basePath + a + "/")
  5186. },
  5187. getFilePath: function(a) {
  5188. var f = this.externals[a];
  5189. return CKEDITOR.getUrl(this.getPath(a) + (f ? f.file : this.fileName + ".js"))
  5190. },
  5191. addExternal: function(a, f, b) {
  5192. a = a.split(",");
  5193. for (var c = 0; c < a.length; c++) {
  5194. var e = a[c];
  5195. b || (f = f.replace(/[^\/]+$/, function(a) {
  5196. b = a;
  5197. return ""
  5198. }));
  5199. this.externals[e] = {
  5200. dir: f,
  5201. file: b || this.fileName + ".js"
  5202. }
  5203. }
  5204. },
  5205. load: function(a, f, b) {
  5206. CKEDITOR.tools.isArray(a) || (a = a ? [a] : []);
  5207. for (var c = this.loaded, e =
  5208. this.registered, m = [], l = {}, d = {}, h = 0; h < a.length; h++) {
  5209. var k = a[h];
  5210. if (k)
  5211. if (c[k] || e[k]) d[k] = this.get(k);
  5212. else {
  5213. var g = this.getFilePath(k);
  5214. m.push(g);
  5215. g in l || (l[g] = []);
  5216. l[g].push(k)
  5217. }
  5218. }
  5219. CKEDITOR.scriptLoader.load(m, function(a, e) {
  5220. if (e.length) throw Error('[CKEDITOR.resourceManager.load] Resource name "' + l[e[0]].join(",") + '" was not found at "' + e[0] + '".');
  5221. for (var g = 0; g < a.length; g++)
  5222. for (var k = l[a[g]], h = 0; h < k.length; h++) {
  5223. var m = k[h];
  5224. d[m] = this.get(m);
  5225. c[m] = 1
  5226. }
  5227. f.call(b, d)
  5228. }, this)
  5229. }
  5230. }, CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/",
  5231. "plugin"), CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(a) {
  5232. var f = {};
  5233. return function(b, c, e) {
  5234. var m = {},
  5235. l = function(b) {
  5236. a.call(this, b, function(a) {
  5237. CKEDITOR.tools.extend(m, a);
  5238. var b = [],
  5239. d;
  5240. for (d in a) {
  5241. var n = a[d],
  5242. w = n && n.requires;
  5243. if (!f[d]) {
  5244. if (n.icons)
  5245. for (var q = n.icons.split(","), v = q.length; v--;) CKEDITOR.skin.addIcon(q[v], n.path + "icons/" + (CKEDITOR.env.hidpi && n.hidpi ? "hidpi/" : "") + q[v] + ".png");
  5246. f[d] = 1
  5247. }
  5248. if (w)
  5249. for (w.split && (w = w.split(",")), n = 0; n < w.length; n++) m[w[n]] || b.push(w[n])
  5250. }
  5251. if (b.length) l.call(this,
  5252. b);
  5253. else {
  5254. for (d in m) n = m[d], n.onLoad && !n.onLoad._called && (!1 === n.onLoad() && delete m[d], n.onLoad._called = 1);
  5255. c && c.call(e || window, m)
  5256. }
  5257. }, this)
  5258. };
  5259. l.call(this, b)
  5260. }
  5261. }), CKEDITOR.plugins.setLang = function(a, f, b) {
  5262. var c = this.get(a);
  5263. a = c.langEntries || (c.langEntries = {});
  5264. c = c.lang || (c.lang = []);
  5265. c.split && (c = c.split(",")); - 1 == CKEDITOR.tools.indexOf(c, f) && c.push(f);
  5266. a[f] = b
  5267. }, CKEDITOR.ui = function(a) {
  5268. if (a.ui) return a.ui;
  5269. this.items = {};
  5270. this.instances = {};
  5271. this.editor = a;
  5272. this._ = {
  5273. handlers: {}
  5274. };
  5275. return this
  5276. }, CKEDITOR.ui.prototype = {
  5277. add: function(a,
  5278. f, b) {
  5279. b.name = a.toLowerCase();
  5280. var c = this.items[a] = {
  5281. type: f,
  5282. command: b.command || null,
  5283. args: Array.prototype.slice.call(arguments, 2)
  5284. };
  5285. CKEDITOR.tools.extend(c, b)
  5286. },
  5287. get: function(a) {
  5288. return this.instances[a]
  5289. },
  5290. create: function(a) {
  5291. var f = this.items[a],
  5292. b = f && this._.handlers[f.type],
  5293. c = f && f.command && this.editor.getCommand(f.command),
  5294. b = b && b.create.apply(this, f.args);
  5295. this.instances[a] = b;
  5296. c && c.uiItems.push(b);
  5297. b && !b.type && (b.type = f.type);
  5298. return b
  5299. },
  5300. addHandler: function(a, f) {
  5301. this._.handlers[a] = f
  5302. },
  5303. space: function(a) {
  5304. return CKEDITOR.document.getById(this.spaceId(a))
  5305. },
  5306. spaceId: function(a) {
  5307. return this.editor.id + "_" + a
  5308. }
  5309. }, CKEDITOR.event.implementOn(CKEDITOR.ui),
  5310. function() {
  5311. function a(a, e, g) {
  5312. CKEDITOR.event.call(this);
  5313. a = a && CKEDITOR.tools.clone(a);
  5314. if (void 0 !== e) {
  5315. if (!(e instanceof CKEDITOR.dom.element)) throw Error("Expect element of type CKEDITOR.dom.element.");
  5316. if (!g) throw Error("One of the element modes must be specified.");
  5317. if (CKEDITOR.env.ie && CKEDITOR.env.quirks && g == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks.");
  5318. if (!b(e,
  5319. g)) throw Error('The specified element mode is not supported on element: "' + e.getName() + '".');
  5320. this.element = e;
  5321. this.elementMode = g;
  5322. this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (e.getId() || e.getNameAtt())
  5323. } else this.elementMode = CKEDITOR.ELEMENT_MODE_NONE;
  5324. this._ = {};
  5325. this.commands = {};
  5326. this.templates = {};
  5327. this.name = this.name || f();
  5328. this.id = CKEDITOR.tools.getNextId();
  5329. this.status = "unloaded";
  5330. this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
  5331. this.ui = new CKEDITOR.ui(this);
  5332. this.focusManager = new CKEDITOR.focusManager(this);
  5333. this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
  5334. this.on("readOnly", c);
  5335. this.on("selectionChange", function(a) {
  5336. m(this, a.data.path)
  5337. });
  5338. this.on("activeFilterChange", function() {
  5339. m(this, this.elementPath(), !0)
  5340. });
  5341. this.on("mode", c);
  5342. this.on("instanceReady", function() {
  5343. this.config.startupFocus && this.focus()
  5344. });
  5345. CKEDITOR.fire("instanceCreated", null, this);
  5346. CKEDITOR.add(this);
  5347. CKEDITOR.tools.setTimeout(function() {
  5348. "destroyed" !== this.status ? d(this, a) : CKEDITOR.warn("editor-incorrect-destroy")
  5349. }, 0, this)
  5350. }
  5351. function f() {
  5352. do var a =
  5353. "editor" + ++q; while (CKEDITOR.instances[a]);
  5354. return a
  5355. }
  5356. function b(a, b) {
  5357. return b == CKEDITOR.ELEMENT_MODE_INLINE ? a.is(CKEDITOR.dtd.$editable) || a.is("textarea") : b == CKEDITOR.ELEMENT_MODE_REPLACE ? !a.is(CKEDITOR.dtd.$nonBodyContent) : 1
  5358. }
  5359. function c() {
  5360. var a = this.commands,
  5361. b;
  5362. for (b in a) e(this, a[b])
  5363. }
  5364. function e(a, b) {
  5365. b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" : b.modes[a.mode] ? "enable" : "disable"]()
  5366. }
  5367. function m(a, b, c) {
  5368. if (b) {
  5369. var d, e, g = a.commands;
  5370. for (e in g) d = g[e], (c || d.contextSensitive) && d.refresh(a, b)
  5371. }
  5372. }
  5373. function l(a) {
  5374. var b = a.config.customConfig;
  5375. if (!b) return !1;
  5376. var b = CKEDITOR.getUrl(b),
  5377. c = v[b] || (v[b] = {});
  5378. c.fn ? (c.fn.call(a, a.config), CKEDITOR.getUrl(a.config.customConfig) != b && l(a) || a.fireOnce("customConfigLoaded")) : CKEDITOR.scriptLoader.queue(b, function() {
  5379. c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function() {};
  5380. l(a)
  5381. });
  5382. return !0
  5383. }
  5384. function d(a, b) {
  5385. a.on("customConfigLoaded", function() {
  5386. if (b) {
  5387. if (b.on)
  5388. for (var c in b.on) a.on(c, b.on[c]);
  5389. CKEDITOR.tools.extend(a.config, b, !0);
  5390. delete a.config.on
  5391. }
  5392. c = a.config;
  5393. a.readOnly =
  5394. c.readOnly ? !0 : a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is("textarea") ? a.element.hasAttribute("disabled") || a.element.hasAttribute("readonly") : a.element.isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.element.hasAttribute("disabled") || a.element.hasAttribute("readonly") : !1;
  5395. a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) : !1;
  5396. a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") || 0;
  5397. a.activeEnterMode =
  5398. a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
  5399. a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
  5400. c.skin && (CKEDITOR.skinName = c.skin);
  5401. a.fireOnce("configLoaded");
  5402. a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
  5403. a.filter = a.activeFilter = new CKEDITOR.filter(a);
  5404. h(a)
  5405. });
  5406. b && null != b.customConfig && (a.config.customConfig = b.customConfig);
  5407. l(a) || a.fireOnce("customConfigLoaded")
  5408. }
  5409. function h(a) {
  5410. CKEDITOR.skin.loadPart("editor", function() {
  5411. k(a)
  5412. })
  5413. }
  5414. function k(a) {
  5415. CKEDITOR.lang.load(a.config.language,
  5416. a.config.defaultLanguage,
  5417. function(b, c) {
  5418. var d = a.config.title;
  5419. a.langCode = b;
  5420. a.lang = CKEDITOR.tools.prototypedCopy(c);
  5421. a.title = "string" == typeof d || !1 === d ? d : [a.lang.editor, a.name].join(", ");
  5422. a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir);
  5423. a.fire("langLoaded");
  5424. g(a)
  5425. })
  5426. }
  5427. function g(a) {
  5428. a.getStylesSet(function(b) {
  5429. a.once("loaded", function() {
  5430. a.fire("stylesSet", {
  5431. styles: b
  5432. })
  5433. }, null, null, 1);
  5434. n(a)
  5435. })
  5436. }
  5437. function n(a) {
  5438. var b = a.config,
  5439. c = b.plugins,
  5440. d = b.extraPlugins,
  5441. e = b.removePlugins;
  5442. if (d) var g = new RegExp("(?:^|,)(?:" + d.replace(/\s*,\s*/g, "|") + ")(?\x3d,|$)", "g"),
  5443. c = c.replace(g, ""),
  5444. c = c + ("," + d);
  5445. if (e) var f = new RegExp("(?:^|,)(?:" + e.replace(/\s*,\s*/g, "|") + ")(?\x3d,|$)", "g"),
  5446. c = c.replace(f, "");
  5447. CKEDITOR.env.air && (c += ",adobeair");
  5448. CKEDITOR.plugins.load(c.split(","), function(c) {
  5449. var d = [],
  5450. e = [],
  5451. g = [];
  5452. a.plugins = c;
  5453. for (var k in c) {
  5454. var h = c[k],
  5455. t = h.lang,
  5456. m = null,
  5457. l = h.requires,
  5458. n;
  5459. CKEDITOR.tools.isArray(l) && (l = l.join(","));
  5460. if (l && (n = l.match(f)))
  5461. for (; l = n.pop();) CKEDITOR.error("editor-plugin-required", {
  5462. plugin: l.replace(",", ""),
  5463. requiredBy: k
  5464. });
  5465. t && !a.lang[k] && (t.split && (t = t.split(",")), 0 <= CKEDITOR.tools.indexOf(t, a.langCode) ? m = a.langCode : (m = a.langCode.replace(/-.*/, ""), m = m != a.langCode && 0 <= CKEDITOR.tools.indexOf(t, m) ? m : 0 <= CKEDITOR.tools.indexOf(t, "en") ? "en" : t[0]), h.langEntries && h.langEntries[m] ? (a.lang[k] = h.langEntries[m], m = null) : g.push(CKEDITOR.getUrl(h.path + "lang/" + m + ".js")));
  5466. e.push(m);
  5467. d.push(h)
  5468. }
  5469. CKEDITOR.scriptLoader.load(g, function() {
  5470. for (var c = ["beforeInit", "init", "afterInit"], g = 0; g < c.length; g++)
  5471. for (var f =
  5472. 0; f < d.length; f++) {
  5473. var k = d[f];
  5474. 0 === g && e[f] && k.lang && k.langEntries && (a.lang[k.name] = k.langEntries[e[f]]);
  5475. if (k[c[g]]) k[c[g]](a)
  5476. }
  5477. a.fireOnce("pluginsLoaded");
  5478. b.keystrokes && a.setKeystroke(a.config.keystrokes);
  5479. for (f = 0; f < a.config.blockedKeystrokes.length; f++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[f]] = 1;
  5480. a.status = "loaded";
  5481. a.fireOnce("loaded");
  5482. CKEDITOR.fire("instanceLoaded", null, a)
  5483. })
  5484. })
  5485. }
  5486. function w() {
  5487. var a = this.element;
  5488. if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
  5489. var b = this.getData();
  5490. this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
  5491. a.is("textarea") ? a.setValue(b) : a.setHtml(b);
  5492. return !0
  5493. }
  5494. return !1
  5495. }
  5496. a.prototype = CKEDITOR.editor.prototype;
  5497. CKEDITOR.editor = a;
  5498. var q = 0,
  5499. v = {};
  5500. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  5501. addCommand: function(a, b) {
  5502. b.name = a.toLowerCase();
  5503. var c = new CKEDITOR.command(this, b);
  5504. this.mode && e(this, c);
  5505. return this.commands[a] = c
  5506. },
  5507. _attachToForm: function() {
  5508. function a(b) {
  5509. c.updateElement();
  5510. c._.required && !d.getValue() && !1 === c.fire("required") && b.data.preventDefault()
  5511. }
  5512. function b(a) {
  5513. return !!(a && a.call && a.apply)
  5514. }
  5515. var c = this,
  5516. d = c.element,
  5517. e = new CKEDITOR.dom.element(d.$.form);
  5518. d.is("textarea") && e && (e.on("submit", a), b(e.$.submit) && (e.$.submit = CKEDITOR.tools.override(e.$.submit, function(b) {
  5519. return function() {
  5520. a();
  5521. b.apply ? b.apply(this) : b()
  5522. }
  5523. })), c.on("destroy", function() {
  5524. e.removeListener("submit", a)
  5525. }))
  5526. },
  5527. destroy: function(a) {
  5528. this.fire("beforeDestroy");
  5529. !a && w.call(this);
  5530. this.editable(null);
  5531. this.filter && (this.filter.destroy(), delete this.filter);
  5532. delete this.activeFilter;
  5533. this.status =
  5534. "destroyed";
  5535. this.fire("destroy");
  5536. this.removeAllListeners();
  5537. CKEDITOR.remove(this);
  5538. CKEDITOR.fire("instanceDestroyed", null, this)
  5539. },
  5540. elementPath: function(a) {
  5541. if (!a) {
  5542. a = this.getSelection();
  5543. if (!a) return null;
  5544. a = a.getStartElement()
  5545. }
  5546. return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
  5547. },
  5548. createRange: function() {
  5549. var a = this.editable();
  5550. return a ? new CKEDITOR.dom.range(a) : null
  5551. },
  5552. execCommand: function(a, b) {
  5553. var c = this.getCommand(a),
  5554. d = {
  5555. name: a,
  5556. commandData: b,
  5557. command: c
  5558. };
  5559. return c && c.state != CKEDITOR.TRISTATE_DISABLED &&
  5560. !1 !== this.fire("beforeCommandExec", d) && (d.returnValue = c.exec(d.commandData), !c.async && !1 !== this.fire("afterCommandExec", d)) ? d.returnValue : !1
  5561. },
  5562. getCommand: function(a) {
  5563. return this.commands[a]
  5564. },
  5565. getData: function(a) {
  5566. !a && this.fire("beforeGetData");
  5567. var b = this._.data;
  5568. "string" != typeof b && (b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ? b.getValue() : b.getHtml() : "");
  5569. b = {
  5570. dataValue: b
  5571. };
  5572. !a && this.fire("getData", b);
  5573. return b.dataValue
  5574. },
  5575. getSnapshot: function() {
  5576. var a = this.fire("getSnapshot");
  5577. "string" != typeof a && (a = (a = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.is("textarea") ? a.getValue() : a.getHtml() : "");
  5578. return a
  5579. },
  5580. loadSnapshot: function(a) {
  5581. this.fire("loadSnapshot", a)
  5582. },
  5583. setData: function(a, b, c) {
  5584. var d = !0,
  5585. e = b;
  5586. b && "object" == typeof b && (c = b.internal, e = b.callback, d = !b.noSnapshot);
  5587. !c && d && this.fire("saveSnapshot");
  5588. if (e || !c) this.once("dataReady", function(a) {
  5589. !c && d && this.fire("saveSnapshot");
  5590. e && e.call(a.editor)
  5591. });
  5592. a = {
  5593. dataValue: a
  5594. };
  5595. !c && this.fire("setData", a);
  5596. this._.data = a.dataValue;
  5597. !c && this.fire("afterSetData", a)
  5598. },
  5599. setReadOnly: function(a) {
  5600. a = null == a || a;
  5601. this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this.editable().setReadOnly(a), this.fire("readOnly"))
  5602. },
  5603. insertHtml: function(a, b, c) {
  5604. this.fire("insertHtml", {
  5605. dataValue: a,
  5606. mode: b,
  5607. range: c
  5608. })
  5609. },
  5610. insertText: function(a) {
  5611. this.fire("insertText", a)
  5612. },
  5613. insertElement: function(a) {
  5614. this.fire("insertElement", a)
  5615. },
  5616. getSelectedHtml: function(a) {
  5617. var b = this.editable(),
  5618. c = this.getSelection(),
  5619. c = c && c.getRanges();
  5620. if (!b || !c || 0 === c.length) return null;
  5621. for (var d = new CKEDITOR.dom.documentFragment, e, g, f, k = 0; k < c.length; k++) {
  5622. var h = c[k],
  5623. m = h.startContainer;
  5624. m.getName && "tr" == m.getName() ? (e || (e = m.getAscendant("table").clone(), e.append(m.getAscendant("tbody").clone()), d.append(e), e = e.findOne("tbody")), g && g.equals(m) || (g = m, f = m.clone(), e.append(f)), f.append(h.cloneContents())) : d.append(h.cloneContents())
  5625. }
  5626. b = e ? d : b.getHtmlFromRange(c[0]);
  5627. return a ? b.getHtml() : b
  5628. },
  5629. extractSelectedHtml: function(a, b) {
  5630. var c = this.editable(),
  5631. d = this.getSelection().getRanges();
  5632. if (!c || 0 ===
  5633. d.length) return null;
  5634. d = d[0];
  5635. c = c.extractHtmlFromRange(d, b);
  5636. b || this.getSelection().selectRanges([d]);
  5637. return a ? c.getHtml() : c
  5638. },
  5639. focus: function() {
  5640. this.fire("beforeFocus")
  5641. },
  5642. checkDirty: function() {
  5643. return "ready" == this.status && this._.previousValue !== this.getSnapshot()
  5644. },
  5645. resetDirty: function() {
  5646. this._.previousValue = this.getSnapshot()
  5647. },
  5648. updateElement: function() {
  5649. return w.call(this)
  5650. },
  5651. setKeystroke: function() {
  5652. for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [
  5653. [].slice.call(arguments,
  5654. 0)
  5655. ], c, d, e = b.length; e--;) c = b[e], d = 0, CKEDITOR.tools.isArray(c) && (d = c[1], c = c[0]), d ? a[c] = d : delete a[c]
  5656. },
  5657. getCommandKeystroke: function(a) {
  5658. var b = a.name,
  5659. c = this.keystrokeHandler.keystrokes,
  5660. d;
  5661. if (a.fakeKeystroke) return a.fakeKeystroke;
  5662. for (d in c)
  5663. if (c.hasOwnProperty(d) && c[d] == b) return d;
  5664. return null
  5665. },
  5666. addFeature: function(a) {
  5667. return this.filter.addFeature(a)
  5668. },
  5669. setActiveFilter: function(a) {
  5670. a || (a = this.filter);
  5671. this.activeFilter !== a && (this.activeFilter = a, this.fire("activeFilterChange"), a === this.filter ? this.setActiveEnterMode(null,
  5672. null) : this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode), a.getAllowedEnterMode(this.shiftEnterMode, !0)))
  5673. },
  5674. setActiveEnterMode: function(a, b) {
  5675. a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
  5676. b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
  5677. if (this.activeEnterMode != a || this.activeShiftEnterMode != b) this.activeEnterMode = a, this.activeShiftEnterMode = b, this.fire("activeEnterModeChange")
  5678. },
  5679. showNotification: function(a) {
  5680. alert(a)
  5681. }
  5682. })
  5683. }(), CKEDITOR.ELEMENT_MODE_NONE = 0, CKEDITOR.ELEMENT_MODE_REPLACE =
  5684. 1, CKEDITOR.ELEMENT_MODE_APPENDTO = 2, CKEDITOR.ELEMENT_MODE_INLINE = 3, CKEDITOR.htmlParser = function() {
  5685. this._ = {
  5686. htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g
  5687. }
  5688. },
  5689. function() {
  5690. var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
  5691. f = {
  5692. checked: 1,
  5693. compact: 1,
  5694. declare: 1,
  5695. defer: 1,
  5696. disabled: 1,
  5697. ismap: 1,
  5698. multiple: 1,
  5699. nohref: 1,
  5700. noresize: 1,
  5701. noshade: 1,
  5702. nowrap: 1,
  5703. readonly: 1,
  5704. selected: 1
  5705. };
  5706. CKEDITOR.htmlParser.prototype = {
  5707. onTagOpen: function() {},
  5708. onTagClose: function() {},
  5709. onText: function() {},
  5710. onCDATA: function() {},
  5711. onComment: function() {},
  5712. parse: function(b) {
  5713. for (var c, e, m = 0, l; c = this._.htmlPartsRegex.exec(b);) {
  5714. e = c.index;
  5715. if (e > m)
  5716. if (m = b.substring(m, e), l) l.push(m);
  5717. else this.onText(m);
  5718. m = this._.htmlPartsRegex.lastIndex;
  5719. if (e = c[1])
  5720. if (e = e.toLowerCase(), l && CKEDITOR.dtd.$cdata[e] && (this.onCDATA(l.join("")), l = null), !l) {
  5721. this.onTagClose(e);
  5722. continue
  5723. }
  5724. if (l) l.push(c[0]);
  5725. else if (e = c[3]) {
  5726. if (e = e.toLowerCase(), !/="/.test(e)) {
  5727. var d = {},
  5728. h, k = c[4];
  5729. c = !!c[5];
  5730. if (k)
  5731. for (; h = a.exec(k);) {
  5732. var g = h[1].toLowerCase();
  5733. h = h[2] || h[3] || h[4] || "";
  5734. d[g] = !h && f[g] ? g : CKEDITOR.tools.htmlDecodeAttr(h)
  5735. }
  5736. this.onTagOpen(e, d, c);
  5737. !l && CKEDITOR.dtd.$cdata[e] && (l = [])
  5738. }
  5739. } else if (e = c[2]) this.onComment(e)
  5740. }
  5741. if (b.length > m) this.onText(b.substring(m, b.length))
  5742. }
  5743. }
  5744. }(), CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
  5745. $: function() {
  5746. this._ = {
  5747. output: []
  5748. }
  5749. },
  5750. proto: {
  5751. openTag: function(a) {
  5752. this._.output.push("\x3c", a)
  5753. },
  5754. openTagClose: function(a, f) {
  5755. f ? this._.output.push(" /\x3e") : this._.output.push("\x3e")
  5756. },
  5757. attribute: function(a, f) {
  5758. "string" == typeof f && (f = CKEDITOR.tools.htmlEncodeAttr(f));
  5759. this._.output.push(" ", a, '\x3d"', f, '"')
  5760. },
  5761. closeTag: function(a) {
  5762. this._.output.push("\x3c/", a, "\x3e")
  5763. },
  5764. text: function(a) {
  5765. this._.output.push(a)
  5766. },
  5767. comment: function(a) {
  5768. this._.output.push("\x3c!--", a, "--\x3e")
  5769. },
  5770. write: function(a) {
  5771. this._.output.push(a)
  5772. },
  5773. reset: function() {
  5774. this._.output = [];
  5775. this._.indent = !1
  5776. },
  5777. getHtml: function(a) {
  5778. var f = this._.output.join("");
  5779. a && this.reset();
  5780. return f
  5781. }
  5782. }
  5783. }), "use strict",
  5784. function() {
  5785. CKEDITOR.htmlParser.node =
  5786. function() {};
  5787. CKEDITOR.htmlParser.node.prototype = {
  5788. remove: function() {
  5789. var a = this.parent.children,
  5790. f = CKEDITOR.tools.indexOf(a, this),
  5791. b = this.previous,
  5792. c = this.next;
  5793. b && (b.next = c);
  5794. c && (c.previous = b);
  5795. a.splice(f, 1);
  5796. this.parent = null
  5797. },
  5798. replaceWith: function(a) {
  5799. var f = this.parent.children,
  5800. b = CKEDITOR.tools.indexOf(f, this),
  5801. c = a.previous = this.previous,
  5802. e = a.next = this.next;
  5803. c && (c.next = a);
  5804. e && (e.previous = a);
  5805. f[b] = a;
  5806. a.parent = this.parent;
  5807. this.parent = null
  5808. },
  5809. insertAfter: function(a) {
  5810. var f = a.parent.children,
  5811. b = CKEDITOR.tools.indexOf(f,
  5812. a),
  5813. c = a.next;
  5814. f.splice(b + 1, 0, this);
  5815. this.next = a.next;
  5816. this.previous = a;
  5817. a.next = this;
  5818. c && (c.previous = this);
  5819. this.parent = a.parent
  5820. },
  5821. insertBefore: function(a) {
  5822. var f = a.parent.children,
  5823. b = CKEDITOR.tools.indexOf(f, a);
  5824. f.splice(b, 0, this);
  5825. this.next = a;
  5826. (this.previous = a.previous) && (a.previous.next = this);
  5827. a.previous = this;
  5828. this.parent = a.parent
  5829. },
  5830. getAscendant: function(a) {
  5831. var f = "function" == typeof a ? a : "string" == typeof a ? function(b) {
  5832. return b.name == a
  5833. } : function(b) {
  5834. return b.name in a
  5835. },
  5836. b = this.parent;
  5837. for (; b && b.type == CKEDITOR.NODE_ELEMENT;) {
  5838. if (f(b)) return b;
  5839. b = b.parent
  5840. }
  5841. return null
  5842. },
  5843. wrapWith: function(a) {
  5844. this.replaceWith(a);
  5845. a.add(this);
  5846. return a
  5847. },
  5848. getIndex: function() {
  5849. return CKEDITOR.tools.indexOf(this.parent.children, this)
  5850. },
  5851. getFilterContext: function(a) {
  5852. return a || {}
  5853. }
  5854. }
  5855. }(), "use strict", CKEDITOR.htmlParser.comment = function(a) {
  5856. this.value = a;
  5857. this._ = {
  5858. isBlockLike: !1
  5859. }
  5860. }, CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5861. type: CKEDITOR.NODE_COMMENT,
  5862. filter: function(a, f) {
  5863. var b = this.value;
  5864. if (!(b = a.onComment(f, b, this))) return this.remove(), !1;
  5865. if ("string" != typeof b) return this.replaceWith(b), !1;
  5866. this.value = b;
  5867. return !0
  5868. },
  5869. writeHtml: function(a, f) {
  5870. f && this.filter(f);
  5871. a.comment(this.value)
  5872. }
  5873. }), "use strict",
  5874. function() {
  5875. CKEDITOR.htmlParser.text = function(a) {
  5876. this.value = a;
  5877. this._ = {
  5878. isBlockLike: !1
  5879. }
  5880. };
  5881. CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5882. type: CKEDITOR.NODE_TEXT,
  5883. filter: function(a, f) {
  5884. if (!(this.value = a.onText(f, this.value, this))) return this.remove(), !1
  5885. },
  5886. writeHtml: function(a, f) {
  5887. f && this.filter(f);
  5888. a.text(this.value)
  5889. }
  5890. })
  5891. }(),
  5892. "use strict",
  5893. function() {
  5894. CKEDITOR.htmlParser.cdata = function(a) {
  5895. this.value = a
  5896. };
  5897. CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  5898. type: CKEDITOR.NODE_TEXT,
  5899. filter: function() {},
  5900. writeHtml: function(a) {
  5901. a.write(this.value)
  5902. }
  5903. })
  5904. }(), "use strict", CKEDITOR.htmlParser.fragment = function() {
  5905. this.children = [];
  5906. this.parent = null;
  5907. this._ = {
  5908. isBlockLike: !0,
  5909. hasInlineStarted: !1
  5910. }
  5911. },
  5912. function() {
  5913. function a(a) {
  5914. return a.attributes["data-cke-survive"] ? !1 : "a" == a.name && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name]
  5915. }
  5916. var f = CKEDITOR.tools.extend({
  5917. table: 1,
  5918. ul: 1,
  5919. ol: 1,
  5920. dl: 1
  5921. }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl),
  5922. b = {
  5923. ol: 1,
  5924. ul: 1
  5925. },
  5926. c = CKEDITOR.tools.extend({}, {
  5927. html: 1
  5928. }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, {
  5929. style: 1,
  5930. script: 1
  5931. }),
  5932. e = {
  5933. ul: "li",
  5934. ol: "li",
  5935. dl: "dd",
  5936. table: "tbody",
  5937. tbody: "tr",
  5938. thead: "tr",
  5939. tfoot: "tr",
  5940. tr: "td"
  5941. };
  5942. CKEDITOR.htmlParser.fragment.fromHtml = function(m, l, d) {
  5943. function h(a) {
  5944. var b;
  5945. if (0 < r.length)
  5946. for (var c = 0; c < r.length; c++) {
  5947. var d = r[c],
  5948. e = d.name,
  5949. g = CKEDITOR.dtd[e],
  5950. f = z.name && CKEDITOR.dtd[z.name];
  5951. f && !f[e] || a && g && !g[a] && CKEDITOR.dtd[a] ? e == z.name && (n(z, z.parent, 1), c--) : (b || (k(), b = 1), d = d.clone(), d.parent = z, z = d, r.splice(c, 1), c--)
  5952. }
  5953. }
  5954. function k() {
  5955. for (; p.length;) n(p.shift(), z)
  5956. }
  5957. function g(a) {
  5958. if (a._.isBlockLike && "pre" != a.name && "textarea" != a.name) {
  5959. var b = a.children.length,
  5960. c = a.children[b - 1],
  5961. d;
  5962. c && c.type == CKEDITOR.NODE_TEXT && ((d = CKEDITOR.tools.rtrim(c.value)) ? c.value = d : a.children.length = b - 1)
  5963. }
  5964. }
  5965. function n(b, c, e) {
  5966. c = c || z || u;
  5967. var f = z;
  5968. void 0 === b.previous && (w(c, b) && (z = c, v.onTagOpen(d, {}), b.returnPoint = c = z), g(b),
  5969. a(b) && !b.children.length || c.add(b), "pre" == b.name && (t = !1), "textarea" == b.name && (B = !1));
  5970. b.returnPoint ? (z = b.returnPoint, delete b.returnPoint) : z = e ? c : f
  5971. }
  5972. function w(a, b) {
  5973. if ((a == u || "body" == a.name) && d && (!a.name || CKEDITOR.dtd[a.name][d])) {
  5974. var c, e;
  5975. return (c = b.attributes && (e = b.attributes["data-cke-real-element-type"]) ? e : b.name) && c in CKEDITOR.dtd.$inline && !(c in CKEDITOR.dtd.head) && !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
  5976. }
  5977. }
  5978. function q(a, b) {
  5979. return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b ||
  5980. "dt" == a && "dd" == b || "dd" == a && "dt" == b : !1
  5981. }
  5982. var v = new CKEDITOR.htmlParser,
  5983. u = l instanceof CKEDITOR.htmlParser.element ? l : "string" == typeof l ? new CKEDITOR.htmlParser.element(l) : new CKEDITOR.htmlParser.fragment,
  5984. r = [],
  5985. p = [],
  5986. z = u,
  5987. B = "textarea" == u.name,
  5988. t = "pre" == u.name;
  5989. v.onTagOpen = function(d, e, g, m) {
  5990. e = new CKEDITOR.htmlParser.element(d, e);
  5991. e.isUnknown && g && (e.isEmpty = !0);
  5992. e.isOptionalClose = m;
  5993. if (a(e)) r.push(e);
  5994. else {
  5995. if ("pre" == d) t = !0;
  5996. else {
  5997. if ("br" == d && t) {
  5998. z.add(new CKEDITOR.htmlParser.text("\n"));
  5999. return
  6000. }
  6001. "textarea" == d && (B = !0)
  6002. }
  6003. if ("br" ==
  6004. d) p.push(e);
  6005. else {
  6006. for (; !(m = (g = z.name) ? CKEDITOR.dtd[g] || (z._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c, e.isUnknown || z.isUnknown || m[d]);)
  6007. if (z.isOptionalClose) v.onTagClose(g);
  6008. else if (d in b && g in b) g = z.children, (g = g[g.length - 1]) && "li" == g.name || n(g = new CKEDITOR.htmlParser.element("li"), z), !e.returnPoint && (e.returnPoint = z), z = g;
  6009. else if (d in CKEDITOR.dtd.$listItem && !q(d, g)) v.onTagOpen("li" == d ? "ul" : "dl", {}, 0, 1);
  6010. else if (g in f && !q(d, g)) !e.returnPoint && (e.returnPoint = z), z = z.parent;
  6011. else if (g in CKEDITOR.dtd.$inline &&
  6012. r.unshift(z), z.parent) n(z, z.parent, 1);
  6013. else {
  6014. e.isOrphan = 1;
  6015. break
  6016. }
  6017. h(d);
  6018. k();
  6019. e.parent = z;
  6020. e.isEmpty ? n(e) : z = e
  6021. }
  6022. }
  6023. };
  6024. v.onTagClose = function(a) {
  6025. for (var b = r.length - 1; 0 <= b; b--)
  6026. if (a == r[b].name) {
  6027. r.splice(b, 1);
  6028. return
  6029. }
  6030. for (var c = [], e = [], g = z; g != u && g.name != a;) g._.isBlockLike || e.unshift(g), c.push(g), g = g.returnPoint || g.parent;
  6031. if (g != u) {
  6032. for (b = 0; b < c.length; b++) {
  6033. var f = c[b];
  6034. n(f, f.parent)
  6035. }
  6036. z = g;
  6037. g._.isBlockLike && k();
  6038. n(g, g.parent);
  6039. g == z && (z = z.parent);
  6040. r = r.concat(e)
  6041. }
  6042. "body" == a && (d = !1)
  6043. };
  6044. v.onText = function(a) {
  6045. if (!(z._.hasInlineStarted && !p.length ||
  6046. t || B) && (a = CKEDITOR.tools.ltrim(a), 0 === a.length)) return;
  6047. var b = z.name,
  6048. g = b ? CKEDITOR.dtd[b] || (z._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c;
  6049. if (!B && !g["#"] && b in f) v.onTagOpen(e[b] || ""), v.onText(a);
  6050. else {
  6051. k();
  6052. h();
  6053. t || B || (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
  6054. a = new CKEDITOR.htmlParser.text(a);
  6055. if (w(z, a)) this.onTagOpen(d, {}, 0, 1);
  6056. z.add(a)
  6057. }
  6058. };
  6059. v.onCDATA = function(a) {
  6060. z.add(new CKEDITOR.htmlParser.cdata(a))
  6061. };
  6062. v.onComment = function(a) {
  6063. k();
  6064. h();
  6065. z.add(new CKEDITOR.htmlParser.comment(a))
  6066. };
  6067. v.parse(m);
  6068. for (k(); z !=
  6069. u;) n(z, z.parent, 1);
  6070. g(u);
  6071. return u
  6072. };
  6073. CKEDITOR.htmlParser.fragment.prototype = {
  6074. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  6075. add: function(a, b) {
  6076. isNaN(b) && (b = this.children.length);
  6077. var c = 0 < b ? this.children[b - 1] : null;
  6078. if (c) {
  6079. if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT && (c.value = CKEDITOR.tools.rtrim(c.value), 0 === c.value.length)) {
  6080. this.children.pop();
  6081. this.add(a);
  6082. return
  6083. }
  6084. c.next = a
  6085. }
  6086. a.previous = c;
  6087. a.parent = this;
  6088. this.children.splice(b, 0, a);
  6089. this._.hasInlineStarted || (this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type ==
  6090. CKEDITOR.NODE_ELEMENT && !a._.isBlockLike)
  6091. },
  6092. filter: function(a, b) {
  6093. b = this.getFilterContext(b);
  6094. a.onRoot(b, this);
  6095. this.filterChildren(a, !1, b)
  6096. },
  6097. filterChildren: function(a, b, c) {
  6098. if (this.childrenFilteredBy != a.id) {
  6099. c = this.getFilterContext(c);
  6100. if (b && !this.parent) a.onRoot(c, this);
  6101. this.childrenFilteredBy = a.id;
  6102. for (b = 0; b < this.children.length; b++) !1 === this.children[b].filter(a, c) && b--
  6103. }
  6104. },
  6105. writeHtml: function(a, b) {
  6106. b && this.filter(b);
  6107. this.writeChildrenHtml(a)
  6108. },
  6109. writeChildrenHtml: function(a, b, c) {
  6110. var e = this.getFilterContext();
  6111. if (c && !this.parent && b) b.onRoot(e, this);
  6112. b && this.filterChildren(b, !1, e);
  6113. b = 0;
  6114. c = this.children;
  6115. for (e = c.length; b < e; b++) c[b].writeHtml(a)
  6116. },
  6117. forEach: function(a, b, c) {
  6118. if (!(c || b && this.type != b)) var e = a(this);
  6119. if (!1 !== e) {
  6120. c = this.children;
  6121. for (var f = 0; f < c.length; f++) e = c[f], e.type == CKEDITOR.NODE_ELEMENT ? e.forEach(a, b) : b && e.type != b || a(e)
  6122. }
  6123. },
  6124. getFilterContext: function(a) {
  6125. return a || {}
  6126. }
  6127. }
  6128. }(), "use strict",
  6129. function() {
  6130. function a() {
  6131. this.rules = []
  6132. }
  6133. function f(b, c, e, f) {
  6134. var l, d;
  6135. for (l in c)(d = b[l]) || (d = b[l] = new a), d.add(c[l], e, f)
  6136. }
  6137. CKEDITOR.htmlParser.filter =
  6138. CKEDITOR.tools.createClass({
  6139. $: function(b) {
  6140. this.id = CKEDITOR.tools.getNextNumber();
  6141. this.elementNameRules = new a;
  6142. this.attributeNameRules = new a;
  6143. this.elementsRules = {};
  6144. this.attributesRules = {};
  6145. this.textRules = new a;
  6146. this.commentRules = new a;
  6147. this.rootRules = new a;
  6148. b && this.addRules(b, 10)
  6149. },
  6150. proto: {
  6151. addRules: function(a, c) {
  6152. var e;
  6153. "number" == typeof c ? e = c : c && "priority" in c && (e = c.priority);
  6154. "number" != typeof e && (e = 10);
  6155. "object" != typeof c && (c = {});
  6156. a.elementNames && this.elementNameRules.addMany(a.elementNames, e, c);
  6157. a.attributeNames &&
  6158. this.attributeNameRules.addMany(a.attributeNames, e, c);
  6159. a.elements && f(this.elementsRules, a.elements, e, c);
  6160. a.attributes && f(this.attributesRules, a.attributes, e, c);
  6161. a.text && this.textRules.add(a.text, e, c);
  6162. a.comment && this.commentRules.add(a.comment, e, c);
  6163. a.root && this.rootRules.add(a.root, e, c)
  6164. },
  6165. applyTo: function(a) {
  6166. a.filter(this)
  6167. },
  6168. onElementName: function(a, c) {
  6169. return this.elementNameRules.execOnName(a, c)
  6170. },
  6171. onAttributeName: function(a, c) {
  6172. return this.attributeNameRules.execOnName(a, c)
  6173. },
  6174. onText: function(a, c, e) {
  6175. return this.textRules.exec(a,
  6176. c, e)
  6177. },
  6178. onComment: function(a, c, e) {
  6179. return this.commentRules.exec(a, c, e)
  6180. },
  6181. onRoot: function(a, c) {
  6182. return this.rootRules.exec(a, c)
  6183. },
  6184. onElement: function(a, c) {
  6185. for (var e = [this.elementsRules["^"], this.elementsRules[c.name], this.elementsRules.$], f, l = 0; 3 > l; l++)
  6186. if (f = e[l]) {
  6187. f = f.exec(a, c, this);
  6188. if (!1 === f) return null;
  6189. if (f && f != c) return this.onNode(a, f);
  6190. if (c.parent && !c.name) break
  6191. }
  6192. return c
  6193. },
  6194. onNode: function(a, c) {
  6195. var e = c.type;
  6196. return e == CKEDITOR.NODE_ELEMENT ? this.onElement(a, c) : e == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(a,
  6197. c.value)) : e == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(a, c.value)) : null
  6198. },
  6199. onAttribute: function(a, c, e, f) {
  6200. return (e = this.attributesRules[e]) ? e.exec(a, f, c, this) : f
  6201. }
  6202. }
  6203. });
  6204. CKEDITOR.htmlParser.filterRulesGroup = a;
  6205. a.prototype = {
  6206. add: function(a, c, e) {
  6207. this.rules.splice(this.findIndex(c), 0, {
  6208. value: a,
  6209. priority: c,
  6210. options: e
  6211. })
  6212. },
  6213. addMany: function(a, c, e) {
  6214. for (var f = [this.findIndex(c), 0], l = 0, d = a.length; l < d; l++) f.push({
  6215. value: a[l],
  6216. priority: c,
  6217. options: e
  6218. });
  6219. this.rules.splice.apply(this.rules, f)
  6220. },
  6221. findIndex: function(a) {
  6222. for (var c =
  6223. this.rules, e = c.length - 1; 0 <= e && a < c[e].priority;) e--;
  6224. return e + 1
  6225. },
  6226. exec: function(a, c) {
  6227. var e = c instanceof CKEDITOR.htmlParser.node || c instanceof CKEDITOR.htmlParser.fragment,
  6228. f = Array.prototype.slice.call(arguments, 1),
  6229. l = this.rules,
  6230. d = l.length,
  6231. h, k, g, n;
  6232. for (n = 0; n < d; n++)
  6233. if (e && (h = c.type, k = c.name), g = l[n], !(a.nonEditable && !g.options.applyToAll || a.nestedEditable && g.options.excludeNestedEditable)) {
  6234. g = g.value.apply(null, f);
  6235. if (!1 === g || e && g && (g.name != k || g.type != h)) return g;
  6236. null != g && (f[0] = c = g)
  6237. }
  6238. return c
  6239. },
  6240. execOnName: function(a,
  6241. c) {
  6242. for (var e = 0, f = this.rules, l = f.length, d; c && e < l; e++) d = f[e], a.nonEditable && !d.options.applyToAll || a.nestedEditable && d.options.excludeNestedEditable || (c = c.replace(d.value[0], d.value[1]));
  6243. return c
  6244. }
  6245. }
  6246. }(),
  6247. function() {
  6248. function a(a, d) {
  6249. function g(a) {
  6250. return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") : new CKEDITOR.htmlParser.element("br", {
  6251. "data-cke-bogus": 1
  6252. })
  6253. }
  6254. function f(a, d) {
  6255. return function(e) {
  6256. if (e.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  6257. var f = [],
  6258. h = b(e),
  6259. t, l;
  6260. if (h)
  6261. for (k(h, 1) && f.push(h); h;) m(h) &&
  6262. (t = c(h)) && k(t) && ((l = c(t)) && !m(l) ? f.push(t) : (g(y).insertAfter(t), t.remove())), h = h.previous;
  6263. for (h = 0; h < f.length; h++) f[h].remove();
  6264. if (f = !a || !1 !== ("function" == typeof d ? d(e) : d)) y || CKEDITOR.env.needsBrFiller || e.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT ? y || CKEDITOR.env.needsBrFiller || !(7 < document.documentMode || e.name in CKEDITOR.dtd.tr || e.name in CKEDITOR.dtd.$listItem) ? (f = b(e), f = !f || "form" == e.name && "input" == f.name) : f = !1 : f = !1;
  6265. f && e.add(g(a))
  6266. }
  6267. }
  6268. }
  6269. function k(a, b) {
  6270. if ((!y || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT &&
  6271. "br" == a.name && !a.attributes["data-cke-eol"]) return !0;
  6272. var c;
  6273. return a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(r)) && (c.index && ((new CKEDITOR.htmlParser.text(a.value.substring(0, c.index))).insertBefore(a), a.value = c[0]), !CKEDITOR.env.needsBrFiller && y && (!b || a.parent.name in n) || !y && ((c = a.previous) && "br" == c.name || !c || m(c))) ? !0 : !1
  6274. }
  6275. var h = {
  6276. elements: {}
  6277. },
  6278. y = "html" == d,
  6279. n = CKEDITOR.tools.extend({}, t),
  6280. E;
  6281. for (E in n) "#" in z[E] || delete n[E];
  6282. for (E in n) h.elements[E] = f(y, a.config.fillEmptyBlocks);
  6283. h.root = f(y, !1);
  6284. h.elements.br =
  6285. function(a) {
  6286. return function(b) {
  6287. if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  6288. var d = b.attributes;
  6289. if ("data-cke-bogus" in d || "data-cke-eol" in d) delete d["data-cke-bogus"];
  6290. else {
  6291. for (d = b.next; d && e(d);) d = d.next;
  6292. var f = c(b);
  6293. !d && m(b.parent) ? l(b.parent, g(a)) : m(d) && f && !m(f) && g(a).insertBefore(d)
  6294. }
  6295. }
  6296. }
  6297. }(y);
  6298. return h
  6299. }
  6300. function f(a, b) {
  6301. return a != CKEDITOR.ENTER_BR && !1 !== b ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
  6302. }
  6303. function b(a) {
  6304. for (a = a.children[a.children.length - 1]; a && e(a);) a = a.previous;
  6305. return a
  6306. }
  6307. function c(a) {
  6308. for (a = a.previous; a &&
  6309. e(a);) a = a.previous;
  6310. return a
  6311. }
  6312. function e(a) {
  6313. return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"]
  6314. }
  6315. function m(a) {
  6316. return a && (a.type == CKEDITOR.NODE_ELEMENT && a.name in t || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  6317. }
  6318. function l(a, b) {
  6319. var c = a.children[a.children.length - 1];
  6320. a.children.push(b);
  6321. b.parent = a;
  6322. c && (c.next = b, b.previous = c)
  6323. }
  6324. function d(a) {
  6325. a = a.attributes;
  6326. "false" != a.contenteditable && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
  6327. a.contenteditable = "false"
  6328. }
  6329. function h(a) {
  6330. a = a.attributes;
  6331. switch (a["data-cke-editable"]) {
  6332. case "true":
  6333. a.contenteditable = "true";
  6334. break;
  6335. case "1":
  6336. delete a.contenteditable
  6337. }
  6338. }
  6339. function k(a) {
  6340. return a.replace(C, function(a, b, c) {
  6341. return "\x3c" + b + c.replace(F, function(a, b) {
  6342. return G.test(b) && -1 == c.indexOf("data-cke-saved-" + b) ? " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a : a
  6343. }) + "\x3e"
  6344. })
  6345. }
  6346. function g(a, b) {
  6347. return a.replace(b, function(a, b, c) {
  6348. 0 === a.indexOf("\x3ctextarea") && (a = b + q(c).replace(/</g, "\x26lt;").replace(/>/g,
  6349. "\x26gt;") + "\x3c/textarea\x3e");
  6350. return "\x3ccke:encoded\x3e" + encodeURIComponent(a) + "\x3c/cke:encoded\x3e"
  6351. })
  6352. }
  6353. function n(a) {
  6354. return a.replace(K, function(a, b) {
  6355. return decodeURIComponent(b)
  6356. })
  6357. }
  6358. function w(a) {
  6359. return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, function(a) {
  6360. return "\x3c!--" + p + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\x3e"
  6361. })
  6362. }
  6363. function q(a) {
  6364. return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, function(a, b) {
  6365. return decodeURIComponent(b)
  6366. })
  6367. }
  6368. function v(a, b) {
  6369. var c = b._.dataStore;
  6370. return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g, function(a, b) {
  6371. return decodeURIComponent(b)
  6372. }).replace(/\{cke_protected_(\d+)\}/g, function(a, b) {
  6373. return c && c[b] || ""
  6374. })
  6375. }
  6376. function u(a, b) {
  6377. var c = [],
  6378. d = b.config.protectedSource,
  6379. e = b._.dataStore || (b._.dataStore = {
  6380. id: 1
  6381. }),
  6382. g = /<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,
  6383. d = [/<script[\s\S]*?(<\/script>|$)/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(d);
  6384. a = a.replace(/\x3c!--[\s\S]*?--\x3e/g, function(a) {
  6385. return "\x3c!--{cke_tempcomment}" + (c.push(a) -
  6386. 1) + "--\x3e"
  6387. });
  6388. for (var f = 0; f < d.length; f++) a = a.replace(d[f], function(a) {
  6389. a = a.replace(g, function(a, b, d) {
  6390. return c[d]
  6391. });
  6392. return /cke_temp(comment)?/.test(a) ? a : "\x3c!--{cke_temp}" + (c.push(a) - 1) + "--\x3e"
  6393. });
  6394. a = a.replace(g, function(a, b, d) {
  6395. return "\x3c!--" + p + (b ? "{C}" : "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "--\x3e"
  6396. });
  6397. a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, function(a) {
  6398. return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, function(a, b) {
  6399. e[e.id] =
  6400. decodeURIComponent(b);
  6401. return "{cke_protected_" + e.id++ + "}"
  6402. })
  6403. });
  6404. return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function(a, c, d, e) {
  6405. return "\x3c" + c + d + "\x3e" + v(q(e), b) + "\x3c/" + c + "\x3e"
  6406. })
  6407. }
  6408. CKEDITOR.htmlDataProcessor = function(b) {
  6409. var c, d, e = this;
  6410. this.editor = b;
  6411. this.dataFilter = c = new CKEDITOR.htmlParser.filter;
  6412. this.htmlFilter = d = new CKEDITOR.htmlParser.filter;
  6413. this.writer = new CKEDITOR.htmlParser.basicWriter;
  6414. c.addRules(y);
  6415. c.addRules(D, {
  6416. applyToAll: !0
  6417. });
  6418. c.addRules(a(b, "data"), {
  6419. applyToAll: !0
  6420. });
  6421. d.addRules(x);
  6422. d.addRules(A, {
  6423. applyToAll: !0
  6424. });
  6425. d.addRules(a(b, "html"), {
  6426. applyToAll: !0
  6427. });
  6428. b.on("toHtml", function(a) {
  6429. a = a.data;
  6430. var c = a.dataValue,
  6431. d, c = u(c, b),
  6432. c = g(c, H),
  6433. c = k(c),
  6434. c = g(c, I),
  6435. c = c.replace(J, "$1cke:$2"),
  6436. c = c.replace(S, "\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),
  6437. c = c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"),
  6438. c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + CKEDITOR.rnd + "-$2");
  6439. d = a.context || b.editable().getName();
  6440. var e;
  6441. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && "pre" == d && (d = "div", c = "\x3cpre\x3e" + c + "\x3c/pre\x3e",
  6442. e = 1);
  6443. d = b.document.createElement(d);
  6444. d.setHtml("a" + c);
  6445. c = d.getHtml().substr(1);
  6446. c = c.replace(new RegExp("data-cke-" + CKEDITOR.rnd + "-", "ig"), "");
  6447. e && (c = c.replace(/^<pre>|<\/pre>$/gi, ""));
  6448. c = c.replace(E, "$1$2");
  6449. c = n(c);
  6450. c = q(c);
  6451. d = !1 === a.fixForBody ? !1 : f(a.enterMode, b.config.autoParagraph);
  6452. c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, d);
  6453. d && (e = c, !e.children.length && CKEDITOR.dtd[e.name][d] && (d = new CKEDITOR.htmlParser.element(d), e.add(d)));
  6454. a.dataValue = c
  6455. }, null, null, 5);
  6456. b.on("toHtml", function(a) {
  6457. a.data.filter.applyTo(a.data.dataValue, !0, a.data.dontFilter, a.data.enterMode) && b.fire("dataFiltered")
  6458. }, null, null, 6);
  6459. b.on("toHtml", function(a) {
  6460. a.data.dataValue.filterChildren(e.dataFilter, !0)
  6461. }, null, null, 10);
  6462. b.on("toHtml", function(a) {
  6463. a = a.data;
  6464. var b = a.dataValue,
  6465. c = new CKEDITOR.htmlParser.basicWriter;
  6466. b.writeChildrenHtml(c);
  6467. b = c.getHtml(!0);
  6468. a.dataValue = w(b)
  6469. }, null, null, 15);
  6470. b.on("toDataFormat", function(a) {
  6471. var c = a.data.dataValue;
  6472. a.data.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/^<br *\/?>/i, ""));
  6473. a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c,
  6474. a.data.context, f(a.data.enterMode, b.config.autoParagraph))
  6475. }, null, null, 5);
  6476. b.on("toDataFormat", function(a) {
  6477. a.data.dataValue.filterChildren(e.htmlFilter, !0)
  6478. }, null, null, 10);
  6479. b.on("toDataFormat", function(a) {
  6480. a.data.filter.applyTo(a.data.dataValue, !1, !0)
  6481. }, null, null, 11);
  6482. b.on("toDataFormat", function(a) {
  6483. var c = a.data.dataValue,
  6484. d = e.writer;
  6485. d.reset();
  6486. c.writeChildrenHtml(d);
  6487. c = d.getHtml(!0);
  6488. c = q(c);
  6489. c = v(c, b);
  6490. a.data.dataValue = c
  6491. }, null, null, 15)
  6492. };
  6493. CKEDITOR.htmlDataProcessor.prototype = {
  6494. toHtml: function(a, b, c, d) {
  6495. var e = this.editor,
  6496. g, f, k, h;
  6497. b && "object" == typeof b ? (g = b.context, c = b.fixForBody, d = b.dontFilter, f = b.filter, k = b.enterMode, h = b.protectedWhitespaces) : g = b;
  6498. g || null === g || (g = e.editable().getName());
  6499. return e.fire("toHtml", {
  6500. dataValue: a,
  6501. context: g,
  6502. fixForBody: c,
  6503. dontFilter: d,
  6504. filter: f || e.filter,
  6505. enterMode: k || e.enterMode,
  6506. protectedWhitespaces: h
  6507. }).dataValue
  6508. },
  6509. toDataFormat: function(a, b) {
  6510. var c, d, e;
  6511. b && (c = b.context, d = b.filter, e = b.enterMode);
  6512. c || null === c || (c = this.editor.editable().getName());
  6513. return this.editor.fire("toDataFormat", {
  6514. dataValue: a,
  6515. filter: d || this.editor.filter,
  6516. context: c,
  6517. enterMode: e || this.editor.enterMode
  6518. }).dataValue
  6519. }
  6520. };
  6521. var r = /(?:&nbsp;|\xa0)$/,
  6522. p = "{cke_protected}",
  6523. z = CKEDITOR.dtd,
  6524. B = "caption colgroup col thead tfoot tbody".split(" "),
  6525. t = CKEDITOR.tools.extend({}, z.$blockLimit, z.$block),
  6526. y = {
  6527. elements: {
  6528. input: d,
  6529. textarea: d
  6530. }
  6531. },
  6532. D = {
  6533. attributeNames: [
  6534. [/^on/, "data-cke-pa-on"],
  6535. [/^data-cke-expando$/, ""]
  6536. ]
  6537. },
  6538. x = {
  6539. elements: {
  6540. embed: function(a) {
  6541. var b = a.parent;
  6542. if (b && "object" == b.name) {
  6543. var c = b.attributes.width,
  6544. b = b.attributes.height;
  6545. c && (a.attributes.width = c);
  6546. b && (a.attributes.height = b)
  6547. }
  6548. },
  6549. a: function(a) {
  6550. var b = a.attributes;
  6551. if (!(a.children.length || b.name || b.id || a.attributes["data-cke-saved-name"])) return !1
  6552. }
  6553. }
  6554. },
  6555. A = {
  6556. elementNames: [
  6557. [/^cke:/, ""],
  6558. [/^\?xml:namespace$/, ""]
  6559. ],
  6560. attributeNames: [
  6561. [/^data-cke-(saved|pa)-/, ""],
  6562. [/^data-cke-.*/, ""],
  6563. ["hidefocus", ""]
  6564. ],
  6565. elements: {
  6566. $: function(a) {
  6567. var b = a.attributes;
  6568. if (b) {
  6569. if (b["data-cke-temp"]) return !1;
  6570. for (var c = ["name", "href", "src"], d, e = 0; e < c.length; e++) d = "data-cke-saved-" + c[e], d in b && delete b[c[e]]
  6571. }
  6572. return a
  6573. },
  6574. table: function(a) {
  6575. a.children.slice(0).sort(function(a,
  6576. b) {
  6577. var c, d;
  6578. a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type && (c = CKEDITOR.tools.indexOf(B, a.name), d = CKEDITOR.tools.indexOf(B, b.name)); - 1 < c && -1 < d && c != d || (c = a.parent ? a.getIndex() : -1, d = b.parent ? b.getIndex() : -1);
  6579. return c > d ? 1 : -1
  6580. })
  6581. },
  6582. param: function(a) {
  6583. a.children = [];
  6584. a.isEmpty = !0;
  6585. return a
  6586. },
  6587. span: function(a) {
  6588. "Apple-style-span" == a.attributes["class"] && delete a.name
  6589. },
  6590. html: function(a) {
  6591. delete a.attributes.contenteditable;
  6592. delete a.attributes["class"]
  6593. },
  6594. body: function(a) {
  6595. delete a.attributes.spellcheck;
  6596. delete a.attributes.contenteditable
  6597. },
  6598. style: function(a) {
  6599. var b = a.children[0];
  6600. b && b.value && (b.value = CKEDITOR.tools.trim(b.value));
  6601. a.attributes.type || (a.attributes.type = "text/css")
  6602. },
  6603. title: function(a) {
  6604. var b = a.children[0];
  6605. !b && l(a, b = new CKEDITOR.htmlParser.text);
  6606. b.value = a.attributes["data-cke-title"] || ""
  6607. },
  6608. input: h,
  6609. textarea: h
  6610. },
  6611. attributes: {
  6612. "class": function(a) {
  6613. return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || !1
  6614. }
  6615. }
  6616. };
  6617. CKEDITOR.env.ie && (A.attributes.style = function(a) {
  6618. return a.replace(/(^|;)([^\:]+)/g, function(a) {
  6619. return a.toLowerCase()
  6620. })
  6621. });
  6622. var C = /<(a|area|img|input|source)\b([^>]*)>/gi,
  6623. F = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
  6624. G = /^(href|src|name)$/i,
  6625. I = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
  6626. H = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
  6627. K = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
  6628. J = /(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,
  6629. E = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,
  6630. S = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi
  6631. }(), "use strict", CKEDITOR.htmlParser.element =
  6632. function(a, f) {
  6633. this.name = a;
  6634. this.attributes = f || {};
  6635. this.children = [];
  6636. var b = a || "",
  6637. c = b.match(/^cke:(.*)/);
  6638. c && (b = c[1]);
  6639. b = !!(CKEDITOR.dtd.$nonBodyContent[b] || CKEDITOR.dtd.$block[b] || CKEDITOR.dtd.$listItem[b] || CKEDITOR.dtd.$tableContent[b] || CKEDITOR.dtd.$nonEditable[b] || "br" == b);
  6640. this.isEmpty = !!CKEDITOR.dtd.$empty[a];
  6641. this.isUnknown = !CKEDITOR.dtd[a];
  6642. this._ = {
  6643. isBlockLike: b,
  6644. hasInlineStarted: this.isEmpty || !b
  6645. }
  6646. }, CKEDITOR.htmlParser.cssStyle = function(a) {
  6647. var f = {};
  6648. ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style :
  6649. a) || "").replace(/&quot;/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, c, e) {
  6650. "font-family" == c && (e = e.replace(/["']/g, ""));
  6651. f[c.toLowerCase()] = e
  6652. });
  6653. return {
  6654. rules: f,
  6655. populate: function(a) {
  6656. var c = this.toString();
  6657. c && (a instanceof CKEDITOR.dom.element ? a.setAttribute("style", c) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = c : a.style = c)
  6658. },
  6659. toString: function() {
  6660. var a = [],
  6661. c;
  6662. for (c in f) f[c] && a.push(c, ":", f[c], ";");
  6663. return a.join("")
  6664. }
  6665. }
  6666. },
  6667. function() {
  6668. function a(a) {
  6669. return function(b) {
  6670. return b.type ==
  6671. CKEDITOR.NODE_ELEMENT && ("string" == typeof a ? b.name == a : b.name in a)
  6672. }
  6673. }
  6674. var f = function(a, b) {
  6675. a = a[0];
  6676. b = b[0];
  6677. return a < b ? -1 : a > b ? 1 : 0
  6678. },
  6679. b = CKEDITOR.htmlParser.fragment.prototype;
  6680. CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6681. type: CKEDITOR.NODE_ELEMENT,
  6682. add: b.add,
  6683. clone: function() {
  6684. return new CKEDITOR.htmlParser.element(this.name, this.attributes)
  6685. },
  6686. filter: function(a, b) {
  6687. var f = this,
  6688. l, d;
  6689. b = f.getFilterContext(b);
  6690. if (b.off) return !0;
  6691. if (!f.parent) a.onRoot(b, f);
  6692. for (;;) {
  6693. l = f.name;
  6694. if (!(d =
  6695. a.onElementName(b, l))) return this.remove(), !1;
  6696. f.name = d;
  6697. if (!(f = a.onElement(b, f))) return this.remove(), !1;
  6698. if (f !== this) return this.replaceWith(f), !1;
  6699. if (f.name == l) break;
  6700. if (f.type != CKEDITOR.NODE_ELEMENT) return this.replaceWith(f), !1;
  6701. if (!f.name) return this.replaceWithChildren(), !1
  6702. }
  6703. l = f.attributes;
  6704. var h, k;
  6705. for (h in l) {
  6706. for (d = l[h];;)
  6707. if (k = a.onAttributeName(b, h))
  6708. if (k != h) delete l[h], h = k;
  6709. else break;
  6710. else {
  6711. delete l[h];
  6712. break
  6713. }
  6714. k && (!1 === (d = a.onAttribute(b, f, k, d)) ? delete l[k] : l[k] = d)
  6715. }
  6716. f.isEmpty || this.filterChildren(a, !1,
  6717. b);
  6718. return !0
  6719. },
  6720. filterChildren: b.filterChildren,
  6721. writeHtml: function(a, b) {
  6722. b && this.filter(b);
  6723. var m = this.name,
  6724. l = [],
  6725. d = this.attributes,
  6726. h, k;
  6727. a.openTag(m, d);
  6728. for (h in d) l.push([h, d[h]]);
  6729. a.sortAttributes && l.sort(f);
  6730. h = 0;
  6731. for (k = l.length; h < k; h++) d = l[h], a.attribute(d[0], d[1]);
  6732. a.openTagClose(m, this.isEmpty);
  6733. this.writeChildrenHtml(a);
  6734. this.isEmpty || a.closeTag(m)
  6735. },
  6736. writeChildrenHtml: b.writeChildrenHtml,
  6737. replaceWithChildren: function() {
  6738. for (var a = this.children, b = a.length; b;) a[--b].insertAfter(this);
  6739. this.remove()
  6740. },
  6741. forEach: b.forEach,
  6742. getFirst: function(b) {
  6743. if (!b) return this.children.length ? this.children[0] : null;
  6744. "function" != typeof b && (b = a(b));
  6745. for (var e = 0, f = this.children.length; e < f; ++e)
  6746. if (b(this.children[e])) return this.children[e];
  6747. return null
  6748. },
  6749. getHtml: function() {
  6750. var a = new CKEDITOR.htmlParser.basicWriter;
  6751. this.writeChildrenHtml(a);
  6752. return a.getHtml()
  6753. },
  6754. setHtml: function(a) {
  6755. a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children;
  6756. for (var b = 0, f = a.length; b < f; ++b) a[b].parent = this
  6757. },
  6758. getOuterHtml: function() {
  6759. var a = new CKEDITOR.htmlParser.basicWriter;
  6760. this.writeHtml(a);
  6761. return a.getHtml()
  6762. },
  6763. split: function(a) {
  6764. for (var b = this.children.splice(a, this.children.length - a), f = this.clone(), l = 0; l < b.length; ++l) b[l].parent = f;
  6765. f.children = b;
  6766. b[0] && (b[0].previous = null);
  6767. 0 < a && (this.children[a - 1].next = null);
  6768. this.parent.add(f, this.getIndex() + 1);
  6769. return f
  6770. },
  6771. find: function(a, b) {
  6772. void 0 === b && (b = !1);
  6773. var f = [],
  6774. l;
  6775. for (l = 0; l < this.children.length; l++) {
  6776. var d = this.children[l];
  6777. "function" == typeof a && a(d) ? f.push(d) : "string" == typeof a && d.name === a && f.push(d);
  6778. b && d.find && (f = f.concat(d.find(a,
  6779. b)))
  6780. }
  6781. return f
  6782. },
  6783. addClass: function(a) {
  6784. if (!this.hasClass(a)) {
  6785. var b = this.attributes["class"] || "";
  6786. this.attributes["class"] = b + (b ? " " : "") + a
  6787. }
  6788. },
  6789. removeClass: function(a) {
  6790. var b = this.attributes["class"];
  6791. b && ((b = CKEDITOR.tools.trim(b.replace(new RegExp("(?:\\s+|^)" + a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"])
  6792. },
  6793. hasClass: function(a) {
  6794. var b = this.attributes["class"];
  6795. return b ? (new RegExp("(?:^|\\s)" + a + "(?\x3d\\s|$)")).test(b) : !1
  6796. },
  6797. getFilterContext: function(a) {
  6798. var b = [];
  6799. a || (a = {
  6800. off: !1,
  6801. nonEditable: !1,
  6802. nestedEditable: !1
  6803. });
  6804. a.off || "off" != this.attributes["data-cke-processor"] || b.push("off", !0);
  6805. a.nonEditable || "false" != this.attributes.contenteditable ? a.nonEditable && !a.nestedEditable && "true" == this.attributes.contenteditable && b.push("nestedEditable", !0) : b.push("nonEditable", !0);
  6806. if (b.length) {
  6807. a = CKEDITOR.tools.copy(a);
  6808. for (var f = 0; f < b.length; f += 2) a[b[f]] = b[f + 1]
  6809. }
  6810. return a
  6811. }
  6812. }, !0)
  6813. }(),
  6814. function() {
  6815. var a = {},
  6816. f = /{([^}]+)}/g,
  6817. b = /([\\'])/g,
  6818. c = /\n/g,
  6819. e = /\r/g;
  6820. CKEDITOR.template = function(m) {
  6821. if (a[m]) this.output =
  6822. a[m];
  6823. else {
  6824. var l = m.replace(b, "\\$1").replace(c, "\\n").replace(e, "\\r").replace(f, function(a, b) {
  6825. return "',data['" + b + "']\x3d\x3dundefined?'{" + b + "}':data['" + b + "'],'"
  6826. });
  6827. this.output = a[m] = Function("data", "buffer", "return buffer?buffer.push('" + l + "'):['" + l + "'].join('');")
  6828. }
  6829. }
  6830. }(), delete CKEDITOR.loadFullCore, CKEDITOR.instances = {}, CKEDITOR.document = new CKEDITOR.dom.document(document), CKEDITOR.add = function(a) {
  6831. CKEDITOR.instances[a.name] = a;
  6832. a.on("focus", function() {
  6833. CKEDITOR.currentInstance != a && (CKEDITOR.currentInstance =
  6834. a, CKEDITOR.fire("currentInstance"))
  6835. });
  6836. a.on("blur", function() {
  6837. CKEDITOR.currentInstance == a && (CKEDITOR.currentInstance = null, CKEDITOR.fire("currentInstance"))
  6838. });
  6839. CKEDITOR.fire("instance", null, a)
  6840. }, CKEDITOR.remove = function(a) {
  6841. delete CKEDITOR.instances[a.name]
  6842. },
  6843. function() {
  6844. var a = {};
  6845. CKEDITOR.addTemplate = function(f, b) {
  6846. var c = a[f];
  6847. if (c) return c;
  6848. c = {
  6849. name: f,
  6850. source: b
  6851. };
  6852. CKEDITOR.fire("template", c);
  6853. return a[f] = new CKEDITOR.template(c.source)
  6854. };
  6855. CKEDITOR.getTemplate = function(f) {
  6856. return a[f]
  6857. }
  6858. }(),
  6859. function() {
  6860. var a = [];
  6861. CKEDITOR.addCss =
  6862. function(f) {
  6863. a.push(f)
  6864. };
  6865. CKEDITOR.getCss = function() {
  6866. return a.join("\n")
  6867. }
  6868. }(), CKEDITOR.on("instanceDestroyed", function() {
  6869. CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset")
  6870. }), CKEDITOR.TRISTATE_ON = 1, CKEDITOR.TRISTATE_OFF = 2, CKEDITOR.TRISTATE_DISABLED = 0,
  6871. function() {
  6872. CKEDITOR.inline = function(a, f) {
  6873. if (!CKEDITOR.env.isCompatible) return null;
  6874. a = CKEDITOR.dom.element.get(a);
  6875. if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  6876. var b = new CKEDITOR.editor(f,
  6877. a, CKEDITOR.ELEMENT_MODE_INLINE),
  6878. c = a.is("textarea") ? a : null;
  6879. c ? (b.setData(c.getValue(), null, !0), a = CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"' + !!b.readOnly + '" class\x3d"cke_textarea_inline"\x3e' + c.getValue() + "\x3c/div\x3e", CKEDITOR.document), a.insertAfter(c), c.hide(), c.$.form && b._attachToForm()) : b.setData(a.getHtml(), null, !0);
  6880. b.on("loaded", function() {
  6881. b.fire("uiReady");
  6882. b.editable(a);
  6883. b.container = a;
  6884. b.ui.contentsElement = a;
  6885. b.setData(b.getData(1));
  6886. b.resetDirty();
  6887. b.fire("contentDom");
  6888. b.mode = "wysiwyg";
  6889. b.fire("mode");
  6890. b.status = "ready";
  6891. b.fireOnce("instanceReady");
  6892. CKEDITOR.fire("instanceReady", null, b)
  6893. }, null, null, 1E4);
  6894. b.on("destroy", function() {
  6895. c && (b.container.clearCustomData(), b.container.remove(), c.show());
  6896. b.element.clearCustomData();
  6897. delete b.element
  6898. });
  6899. return b
  6900. };
  6901. CKEDITOR.inlineAll = function() {
  6902. var a, f, b;
  6903. for (b in CKEDITOR.dtd.$editable)
  6904. for (var c = CKEDITOR.document.getElementsByTag(b), e = 0, m = c.count(); e < m; e++) a = c.getItem(e), "true" == a.getAttribute("contenteditable") && (f = {
  6905. element: a,
  6906. config: {}
  6907. }, !1 !== CKEDITOR.fire("inline", f) && CKEDITOR.inline(a, f.config))
  6908. };
  6909. CKEDITOR.domReady(function() {
  6910. !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll()
  6911. })
  6912. }(), CKEDITOR.replaceClass = "ckeditor",
  6913. function() {
  6914. function a(a, e, m, l) {
  6915. if (!CKEDITOR.env.isCompatible) return null;
  6916. a = CKEDITOR.dom.element.get(a);
  6917. if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  6918. var d = new CKEDITOR.editor(e, a, l);
  6919. l == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle("visibility", "hidden"), d._.required =
  6920. a.hasAttribute("required"), a.removeAttribute("required"));
  6921. m && d.setData(m, null, !0);
  6922. d.on("loaded", function() {
  6923. b(d);
  6924. l == CKEDITOR.ELEMENT_MODE_REPLACE && d.config.autoUpdateElement && a.$.form && d._attachToForm();
  6925. d.setMode(d.config.startupMode, function() {
  6926. d.resetDirty();
  6927. d.status = "ready";
  6928. d.fireOnce("instanceReady");
  6929. CKEDITOR.fire("instanceReady", null, d)
  6930. })
  6931. });
  6932. d.on("destroy", f);
  6933. return d
  6934. }
  6935. function f() {
  6936. var a = this.container,
  6937. b = this.element;
  6938. a && (a.clearCustomData(), a.remove());
  6939. b && (b.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE &&
  6940. (b.show(), this._.required && b.setAttribute("required", "required")), delete this.element)
  6941. }
  6942. function b(a) {
  6943. var b = a.name,
  6944. f = a.element,
  6945. l = a.elementMode,
  6946. d = a.fire("uiSpace", {
  6947. space: "top",
  6948. html: ""
  6949. }).html,
  6950. h = a.fire("uiSpace", {
  6951. space: "bottom",
  6952. html: ""
  6953. }).html,
  6954. k = new CKEDITOR.template('\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"' + (a.title ? ' aria-labelledby\x3d"cke_{name}_arialbl"' :
  6955. "") + "\x3e" + (a.title ? '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' : "") + '\x3c{outerEl} class\x3d"cke_inner cke_reset" role\x3d"presentation"\x3e{topHtml}\x3c{outerEl} id\x3d"{contentId}" class\x3d"cke_contents cke_reset" role\x3d"presentation"\x3e\x3c/{outerEl}\x3e{bottomHtml}\x3c/{outerEl}\x3e\x3c/{outerEl}\x3e'),
  6956. b = CKEDITOR.dom.element.createFromHtml(k.output({
  6957. id: a.id,
  6958. name: b,
  6959. langDir: a.lang.dir,
  6960. langCode: a.langCode,
  6961. voiceLabel: a.title,
  6962. topHtml: d ? '\x3cspan id\x3d"' +
  6963. a.ui.spaceId("top") + '" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e' + d + "\x3c/span\x3e" : "",
  6964. contentId: a.ui.spaceId("contents"),
  6965. bottomHtml: h ? '\x3cspan id\x3d"' + a.ui.spaceId("bottom") + '" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e' + h + "\x3c/span\x3e" : "",
  6966. outerEl: CKEDITOR.env.ie ? "span" : "div"
  6967. }));
  6968. l == CKEDITOR.ELEMENT_MODE_REPLACE ? (f.hide(), b.insertAfter(f)) : f.append(b);
  6969. a.container = b;
  6970. a.ui.contentsElement = a.ui.space("contents");
  6971. d && a.ui.space("top").unselectable();
  6972. h && a.ui.space("bottom").unselectable();
  6973. f = a.config.width;
  6974. l = a.config.height;
  6975. f && b.setStyle("width", CKEDITOR.tools.cssLength(f));
  6976. l && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(l));
  6977. b.disableContextMenu();
  6978. CKEDITOR.env.webkit && b.on("focus", function() {
  6979. a.focus()
  6980. });
  6981. a.fireOnce("uiReady")
  6982. }
  6983. CKEDITOR.replace = function(b, e) {
  6984. return a(b, e, null, CKEDITOR.ELEMENT_MODE_REPLACE)
  6985. };
  6986. CKEDITOR.appendTo = function(b, e, f) {
  6987. return a(b, e, f, CKEDITOR.ELEMENT_MODE_APPENDTO)
  6988. };
  6989. CKEDITOR.replaceAll = function() {
  6990. for (var a =
  6991. document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) {
  6992. var f = null,
  6993. l = a[b];
  6994. if (l.name || l.id) {
  6995. if ("string" == typeof arguments[0]) {
  6996. if (!(new RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)")).test(l.className)) continue
  6997. } else if ("function" == typeof arguments[0] && (f = {}, !1 === arguments[0](l, f))) continue;
  6998. this.replace(l, f)
  6999. }
  7000. }
  7001. };
  7002. CKEDITOR.editor.prototype.addMode = function(a, b) {
  7003. (this._.modes || (this._.modes = {}))[a] = b
  7004. };
  7005. CKEDITOR.editor.prototype.setMode = function(a, b) {
  7006. var f = this,
  7007. l = this._.modes;
  7008. if (a != f.mode && l && l[a]) {
  7009. f.fire("beforeSetMode",
  7010. a);
  7011. if (f.mode) {
  7012. var d = f.checkDirty(),
  7013. l = f._.previousModeData,
  7014. h, k = 0;
  7015. f.fire("beforeModeUnload");
  7016. f.editable(0);
  7017. f._.previousMode = f.mode;
  7018. f._.previousModeData = h = f.getData(1);
  7019. "source" == f.mode && l == h && (f.fire("lockSnapshot", {
  7020. forceUpdate: !0
  7021. }), k = 1);
  7022. f.ui.space("contents").setHtml("");
  7023. f.mode = ""
  7024. } else f._.previousModeData = f.getData(1);
  7025. this._.modes[a](function() {
  7026. f.mode = a;
  7027. void 0 !== d && !d && f.resetDirty();
  7028. k ? f.fire("unlockSnapshot") : "wysiwyg" == a && f.fire("saveSnapshot");
  7029. setTimeout(function() {
  7030. f.fire("mode");
  7031. b && b.call(f)
  7032. },
  7033. 0)
  7034. })
  7035. }
  7036. };
  7037. CKEDITOR.editor.prototype.resize = function(a, b, f, l) {
  7038. var d = this.container,
  7039. h = this.ui.space("contents"),
  7040. k = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement;
  7041. l = l ? this.container.getFirst(function(a) {
  7042. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  7043. }) : d;
  7044. l.setSize("width", a, !0);
  7045. k && (k.style.width = "1%");
  7046. var g = (l.$.offsetHeight || 0) - (h.$.clientHeight || 0),
  7047. d = Math.max(b - (f ? 0 : g), 0);
  7048. b = f ? b + g : b;
  7049. h.setStyle("height", d + "px");
  7050. k && (k.style.width = "100%");
  7051. this.fire("resize", {
  7052. outerHeight: b,
  7053. contentsHeight: d,
  7054. outerWidth: a || l.getSize("width")
  7055. })
  7056. };
  7057. CKEDITOR.editor.prototype.getResizable = function(a) {
  7058. return a ? this.ui.space("contents") : this.container
  7059. };
  7060. CKEDITOR.domReady(function() {
  7061. CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass)
  7062. })
  7063. }(), CKEDITOR.config.startupMode = "wysiwyg",
  7064. function() {
  7065. function a(a) {
  7066. var b = a.editor,
  7067. d = a.data.path,
  7068. e = d.blockLimit,
  7069. g = a.data.selection,
  7070. k = g.getRanges()[0],
  7071. h;
  7072. if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller)
  7073. if (g = f(g, d)) g.appendBogus(), h = CKEDITOR.env.ie;
  7074. l(b, d.block, e) && k.collapsed && !k.getCommonAncestor().isReadOnly() && (d = k.clone(), d.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS), e = new CKEDITOR.dom.walker(d), e.guard = function(a) {
  7075. return !c(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly()
  7076. }, !e.checkForward() || d.checkStartOfBlock() && d.checkEndOfBlock()) && (b = k.fixBlock(!0, b.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p"), CKEDITOR.env.needsBrFiller || (b = b.getFirst(c)) && b.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/) && b.remove(),
  7077. h = 1, a.cancel());
  7078. h && k.select()
  7079. }
  7080. function f(a, b) {
  7081. if (a.isFake) return 0;
  7082. var d = b.block || b.blockLimit,
  7083. e = d && d.getLast(c);
  7084. if (!(!d || !d.isBlockBoundary() || e && e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary() || d.is("pre") || d.getBogus())) return d
  7085. }
  7086. function b(a) {
  7087. var b = a.data.getTarget();
  7088. b.is("input") && (b = b.getAttribute("type"), "submit" != b && "reset" != b || a.data.preventDefault())
  7089. }
  7090. function c(a) {
  7091. return g(a) && n(a)
  7092. }
  7093. function e(a, b) {
  7094. return function(c) {
  7095. var d = c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget;
  7096. (d = d && d.nodeType == CKEDITOR.NODE_ELEMENT ? new CKEDITOR.dom.element(d) : null) && (b.equals(d) || b.contains(d)) || a.call(this, c)
  7097. }
  7098. }
  7099. function m(a) {
  7100. function b(a) {
  7101. return function(b, e) {
  7102. e && b.type == CKEDITOR.NODE_ELEMENT && b.is(g) && (d = b);
  7103. if (!(e || !c(b) || a && q(b))) return !1
  7104. }
  7105. }
  7106. var d, e = a.getRanges()[0];
  7107. a = a.root;
  7108. var g = {
  7109. table: 1,
  7110. ul: 1,
  7111. ol: 1,
  7112. dl: 1
  7113. };
  7114. if (e.startPath().contains(g)) {
  7115. var f = e.clone();
  7116. f.collapse(1);
  7117. f.setStartAt(a, CKEDITOR.POSITION_AFTER_START);
  7118. a = new CKEDITOR.dom.walker(f);
  7119. a.guard = b();
  7120. a.checkBackward();
  7121. if (d) return f = e.clone(),
  7122. f.collapse(), f.setEndAt(d, CKEDITOR.POSITION_AFTER_END), a = new CKEDITOR.dom.walker(f), a.guard = b(!0), d = !1, a.checkForward(), d
  7123. }
  7124. return null
  7125. }
  7126. function l(a, b, c) {
  7127. return !1 !== a.config.autoParagraph && a.activeEnterMode != CKEDITOR.ENTER_BR && (a.editable().equals(c) && !b || b && "true" == b.getAttribute("contenteditable"))
  7128. }
  7129. function d(a) {
  7130. return a.activeEnterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? a.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
  7131. }
  7132. function h(a) {
  7133. var b = a.editor;
  7134. b.getSelection().scrollIntoView();
  7135. setTimeout(function() {
  7136. b.fire("saveSnapshot")
  7137. }, 0)
  7138. }
  7139. function k(a, b, c) {
  7140. var d = a.getCommonAncestor(b);
  7141. for (b = a = c ? b : a;
  7142. (a = a.getParent()) && !d.equals(a) && 1 == a.getChildCount();) b = a;
  7143. b.remove()
  7144. }
  7145. var g, n, w, q, v, u, r, p, z, B;
  7146. CKEDITOR.editable = CKEDITOR.tools.createClass({
  7147. base: CKEDITOR.dom.element,
  7148. $: function(a, b) {
  7149. this.base(b.$ || b);
  7150. this.editor = a;
  7151. this.status = "unloaded";
  7152. this.hasFocus = !1;
  7153. this.setup()
  7154. },
  7155. proto: {
  7156. focus: function() {
  7157. var a;
  7158. if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument().getActive(),
  7159. this.contains(a))) {
  7160. a.focus();
  7161. return
  7162. }
  7163. CKEDITOR.env.edge && 14 < CKEDITOR.env.version && !this.hasFocus && this.getDocument().equals(CKEDITOR.document) && (this.editor._.previousScrollTop = this.$.scrollTop);
  7164. try {
  7165. !CKEDITOR.env.ie || CKEDITOR.env.edge && 14 < CKEDITOR.env.version || !this.getDocument().equals(CKEDITOR.document) ? this.$.focus() : this.$.setActive()
  7166. } catch (b) {
  7167. if (!CKEDITOR.env.ie) throw b;
  7168. }
  7169. CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(), a.equals(this.getWindow().getFrame()) || this.getWindow().focus())
  7170. },
  7171. on: function(a, b) {
  7172. var c = Array.prototype.slice.call(arguments, 0);
  7173. CKEDITOR.env.ie && /^focus|blur$/.exec(a) && (a = "focus" == a ? "focusin" : "focusout", b = e(b, this), c[0] = a, c[1] = b);
  7174. return CKEDITOR.dom.element.prototype.on.apply(this, c)
  7175. },
  7176. attachListener: function(a) {
  7177. !this._.listeners && (this._.listeners = []);
  7178. var b = Array.prototype.slice.call(arguments, 1),
  7179. b = a.on.apply(a, b);
  7180. this._.listeners.push(b);
  7181. return b
  7182. },
  7183. clearListeners: function() {
  7184. var a = this._.listeners;
  7185. try {
  7186. for (; a.length;) a.pop().removeListener()
  7187. } catch (b) {}
  7188. },
  7189. restoreAttrs: function() {
  7190. var a =
  7191. this._.attrChanges,
  7192. b, c;
  7193. for (c in a) a.hasOwnProperty(c) && (b = a[c], null !== b ? this.setAttribute(c, b) : this.removeAttribute(c))
  7194. },
  7195. attachClass: function(a) {
  7196. var b = this.getCustomData("classes");
  7197. this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData("classes", b), this.addClass(a))
  7198. },
  7199. changeAttr: function(a, b) {
  7200. var c = this.getAttribute(a);
  7201. b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._.attrChanges[a] = c), this.setAttribute(a, b))
  7202. },
  7203. insertText: function(a) {
  7204. this.editor.focus();
  7205. this.insertHtml(this.transformPlainTextToHtml(a),
  7206. "text")
  7207. },
  7208. transformPlainTextToHtml: function(a) {
  7209. var b = this.editor.getSelection().getStartElement().hasAscendant("pre", !0) ? CKEDITOR.ENTER_BR : this.editor.activeEnterMode;
  7210. return CKEDITOR.tools.transformPlainTextToHtml(a, b)
  7211. },
  7212. insertHtml: function(a, b, c) {
  7213. var d = this.editor;
  7214. d.focus();
  7215. d.fire("saveSnapshot");
  7216. c || (c = d.getSelection().getRanges()[0]);
  7217. u(this, b || "html", a, c);
  7218. c.select();
  7219. h(this);
  7220. this.editor.fire("afterInsertHtml", {})
  7221. },
  7222. insertHtmlIntoRange: function(a, b, c) {
  7223. u(this, c || "html", a, b);
  7224. this.editor.fire("afterInsertHtml", {
  7225. intoRange: b
  7226. })
  7227. },
  7228. insertElement: function(a, b) {
  7229. var d = this.editor;
  7230. d.focus();
  7231. d.fire("saveSnapshot");
  7232. var e = d.activeEnterMode,
  7233. d = d.getSelection(),
  7234. g = a.getName(),
  7235. g = CKEDITOR.dtd.$block[g];
  7236. b || (b = d.getRanges()[0]);
  7237. this.insertElementIntoRange(a, b) && (b.moveToPosition(a, CKEDITOR.POSITION_AFTER_END), g && ((g = a.getNext(function(a) {
  7238. return c(a) && !q(a)
  7239. })) && g.type == CKEDITOR.NODE_ELEMENT && g.is(CKEDITOR.dtd.$block) ? g.getDtd()["#"] ? b.moveToElementEditStart(g) : b.moveToElementEditEnd(a) : g || e == CKEDITOR.ENTER_BR || (g = b.fixBlock(!0,
  7240. e == CKEDITOR.ENTER_DIV ? "div" : "p"), b.moveToElementEditStart(g))));
  7241. d.selectRanges([b]);
  7242. h(this)
  7243. },
  7244. insertElementIntoSelection: function(a) {
  7245. this.insertElement(a)
  7246. },
  7247. insertElementIntoRange: function(a, b) {
  7248. var c = this.editor,
  7249. d = c.config.enterMode,
  7250. e = a.getName(),
  7251. g = CKEDITOR.dtd.$block[e];
  7252. if (b.checkReadOnly()) return !1;
  7253. b.deleteContents(1);
  7254. b.startContainer.type == CKEDITOR.NODE_ELEMENT && (b.startContainer.is({
  7255. tr: 1,
  7256. table: 1,
  7257. tbody: 1,
  7258. thead: 1,
  7259. tfoot: 1
  7260. }) ? r(b) : b.startContainer.is(CKEDITOR.dtd.$list) && p(b));
  7261. var f, k;
  7262. if (g)
  7263. for (;
  7264. (f = b.getCommonAncestor(0,
  7265. 1)) && (k = CKEDITOR.dtd[f.getName()]) && (!k || !k[e]);) f.getName() in CKEDITOR.dtd.span ? b.splitElement(f) : b.checkStartOfBlock() && b.checkEndOfBlock() ? (b.setStartBefore(f), b.collapse(!0), f.remove()) : b.splitBlock(d == CKEDITOR.ENTER_DIV ? "div" : "p", c.editable());
  7266. b.insertNode(a);
  7267. return !0
  7268. },
  7269. setData: function(a, b) {
  7270. b || (a = this.editor.dataProcessor.toHtml(a));
  7271. this.setHtml(a);
  7272. this.fixInitialSelection();
  7273. "unloaded" == this.status && (this.status = "ready");
  7274. this.editor.fire("dataReady")
  7275. },
  7276. getData: function(a) {
  7277. var b = this.getHtml();
  7278. a || (b = this.editor.dataProcessor.toDataFormat(b));
  7279. return b
  7280. },
  7281. setReadOnly: function(a) {
  7282. this.setAttribute("contenteditable", !a)
  7283. },
  7284. detach: function() {
  7285. this.removeClass("cke_editable");
  7286. this.status = "detached";
  7287. var a = this.editor;
  7288. this._.detach();
  7289. delete a.document;
  7290. delete a.window
  7291. },
  7292. isInline: function() {
  7293. return this.getDocument().equals(CKEDITOR.document)
  7294. },
  7295. fixInitialSelection: function() {
  7296. function a() {
  7297. var b = c.getDocument().$,
  7298. d = b.getSelection(),
  7299. e;
  7300. a: if (d.anchorNode && d.anchorNode == c.$) e = !0;
  7301. else {
  7302. if (CKEDITOR.env.webkit && (e =
  7303. c.getDocument().getActive()) && e.equals(c) && !d.anchorNode) {
  7304. e = !0;
  7305. break a
  7306. }
  7307. e = void 0
  7308. }
  7309. e && (e = new CKEDITOR.dom.range(c), e.moveToElementEditStart(c), b = b.createRange(), b.setStart(e.startContainer.$, e.startOffset), b.collapse(!0), d.removeAllRanges(), d.addRange(b))
  7310. }
  7311. function b() {
  7312. var a = c.getDocument().$,
  7313. d = a.selection,
  7314. e = c.getDocument().getActive();
  7315. "None" == d.type && e.equals(c) && (d = new CKEDITOR.dom.range(c), a = a.body.createTextRange(), d.moveToElementEditStart(c), d = d.startContainer, d.type != CKEDITOR.NODE_ELEMENT && (d = d.getParent()),
  7316. a.moveToElementText(d.$), a.collapse(!0), a.select())
  7317. }
  7318. var c = this;
  7319. if (CKEDITOR.env.ie && (9 > CKEDITOR.env.version || CKEDITOR.env.quirks)) this.hasFocus && (this.focus(), b());
  7320. else if (this.hasFocus) this.focus(), a();
  7321. else this.once("focus", function() {
  7322. a()
  7323. }, null, null, -999)
  7324. },
  7325. getHtmlFromRange: function(a) {
  7326. if (a.collapsed) return new CKEDITOR.dom.documentFragment(a.document);
  7327. a = {
  7328. doc: this.getDocument(),
  7329. range: a.clone()
  7330. };
  7331. z.eol.detect(a, this);
  7332. z.bogus.exclude(a);
  7333. z.cell.shrink(a);
  7334. a.fragment = a.range.cloneContents();
  7335. z.tree.rebuild(a,
  7336. this);
  7337. z.eol.fix(a, this);
  7338. return new CKEDITOR.dom.documentFragment(a.fragment.$)
  7339. },
  7340. extractHtmlFromRange: function(a, b) {
  7341. var c = B,
  7342. d = {
  7343. range: a,
  7344. doc: a.document
  7345. },
  7346. e = this.getHtmlFromRange(a);
  7347. if (a.collapsed) return a.optimize(), e;
  7348. a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  7349. c.table.detectPurge(d);
  7350. d.bookmark = a.createBookmark();
  7351. delete d.range;
  7352. var g = this.editor.createRange();
  7353. g.moveToPosition(d.bookmark.startNode, CKEDITOR.POSITION_BEFORE_START);
  7354. d.targetBookmark = g.createBookmark();
  7355. c.list.detectMerge(d, this);
  7356. c.table.detectRanges(d,
  7357. this);
  7358. c.block.detectMerge(d, this);
  7359. d.tableContentsRanges ? (c.table.deleteRanges(d), a.moveToBookmark(d.bookmark), d.range = a) : (a.moveToBookmark(d.bookmark), d.range = a, a.extractContents(c.detectExtractMerge(d)));
  7360. a.moveToBookmark(d.targetBookmark);
  7361. a.optimize();
  7362. c.fixUneditableRangePosition(a);
  7363. c.list.merge(d, this);
  7364. c.table.purge(d, this);
  7365. c.block.merge(d, this);
  7366. if (b) {
  7367. c = a.startPath();
  7368. if (d = a.checkStartOfBlock() && a.checkEndOfBlock() && c.block && !a.root.equals(c.block)) {
  7369. a: {
  7370. var d = c.block.getElementsByTag("span"),
  7371. g = 0,
  7372. f;
  7373. if (d)
  7374. for (; f = d.getItem(g++);)
  7375. if (!n(f)) {
  7376. d = !0;
  7377. break a
  7378. }
  7379. d = !1
  7380. }
  7381. d = !d
  7382. }
  7383. d && (a.moveToPosition(c.block, CKEDITOR.POSITION_BEFORE_START), c.block.remove())
  7384. } else c.autoParagraph(this.editor, a), w(a.startContainer) && a.startContainer.appendBogus();
  7385. a.startContainer.mergeSiblings();
  7386. return e
  7387. },
  7388. setup: function() {
  7389. var a = this.editor;
  7390. this.attachListener(a, "beforeGetData", function() {
  7391. var b = this.getData();
  7392. this.is("textarea") || !1 !== a.config.ignoreEmptyParagraph && (b = b.replace(v, function(a, b) {
  7393. return b
  7394. }));
  7395. a.setData(b, null, 1)
  7396. }, this);
  7397. this.attachListener(a, "getSnapshot", function(a) {
  7398. a.data = this.getData(1)
  7399. }, this);
  7400. this.attachListener(a, "afterSetData", function() {
  7401. this.setData(a.getData(1))
  7402. }, this);
  7403. this.attachListener(a, "loadSnapshot", function(a) {
  7404. this.setData(a.data, 1)
  7405. }, this);
  7406. this.attachListener(a, "beforeFocus", function() {
  7407. var b = a.getSelection();
  7408. (b = b && b.getNative()) && "Control" == b.type || this.focus()
  7409. }, this);
  7410. this.attachListener(a, "insertHtml", function(a) {
  7411. this.insertHtml(a.data.dataValue, a.data.mode, a.data.range)
  7412. }, this);
  7413. this.attachListener(a,
  7414. "insertElement",
  7415. function(a) {
  7416. this.insertElement(a.data)
  7417. }, this);
  7418. this.attachListener(a, "insertText", function(a) {
  7419. this.insertText(a.data)
  7420. }, this);
  7421. this.setReadOnly(a.readOnly);
  7422. this.attachClass("cke_editable");
  7423. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? this.attachClass("cke_editable_inline") : a.elementMode != CKEDITOR.ELEMENT_MODE_REPLACE && a.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || this.attachClass("cke_editable_themed");
  7424. this.attachClass("cke_contents_" + a.config.contentsLangDirection);
  7425. a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly;
  7426. a.keystrokeHandler.attach(this);
  7427. this.on("blur", function() {
  7428. this.hasFocus = !1
  7429. }, null, null, -1);
  7430. this.on("focus", function() {
  7431. this.hasFocus = !0
  7432. }, null, null, -1);
  7433. if (CKEDITOR.env.webkit) this.on("scroll", function() {
  7434. a._.previousScrollTop = a.editable().$.scrollTop
  7435. }, null, null, -1);
  7436. if (CKEDITOR.env.edge && 14 < CKEDITOR.env.version) {
  7437. var d = function() {
  7438. var b = a.editable();
  7439. null != a._.previousScrollTop && b.getDocument().equals(CKEDITOR.document) && (b.$.scrollTop = a._.previousScrollTop, a._.previousScrollTop = null, this.removeListener("scroll",
  7440. d))
  7441. };
  7442. this.on("scroll", d)
  7443. }
  7444. a.focusManager.add(this);
  7445. this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, a.once("contentDom", function() {
  7446. a.focusManager.focus(this)
  7447. }, this));
  7448. this.isInline() && this.changeAttr("tabindex", a.tabIndex);
  7449. if (!this.is("textarea")) {
  7450. a.document = this.getDocument();
  7451. a.window = this.getWindow();
  7452. var e = a.document;
  7453. this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker);
  7454. var f = a.config.contentsLangDirection;
  7455. this.getDirection(1) != f && this.changeAttr("dir", f);
  7456. var h = CKEDITOR.getCss();
  7457. if (h) {
  7458. var f = e.getHead(),
  7459. l = f.getCustomData("stylesheet");
  7460. l ? h != l.getText() && (CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? l.$.styleSheet.cssText = h : l.setText(h)) : (h = e.appendStyleText(h), h = new CKEDITOR.dom.element(h.ownerNode || h.owningElement), f.setCustomData("stylesheet", h), h.data("cke-temp", 1))
  7461. }
  7462. f = e.getCustomData("stylesheet_ref") || 0;
  7463. e.setCustomData("stylesheet_ref", f + 1);
  7464. this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling);
  7465. this.attachListener(this, "click", function(a) {
  7466. a = a.data;
  7467. var b =
  7468. (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a");
  7469. b && 2 != a.$.button && b.isReadOnly() && a.preventDefault()
  7470. });
  7471. var n = {
  7472. 8: 1,
  7473. 46: 1
  7474. };
  7475. this.attachListener(a, "key", function(b) {
  7476. if (a.readOnly) return !0;
  7477. var c = b.data.domEvent.getKey(),
  7478. d;
  7479. if (c in n) {
  7480. b = a.getSelection();
  7481. var e, f = b.getRanges()[0],
  7482. k = f.startPath(),
  7483. h, l, p, c = 8 == c;
  7484. CKEDITOR.env.ie && 11 > CKEDITOR.env.version && (e = b.getSelectedElement()) || (e = m(b)) ? (a.fire("saveSnapshot"), f.moveToPosition(e, CKEDITOR.POSITION_BEFORE_START), e.remove(), f.select(), a.fire("saveSnapshot"),
  7485. d = 1) : f.collapsed && ((h = k.block) && (p = h[c ? "getPrevious" : "getNext"](g)) && p.type == CKEDITOR.NODE_ELEMENT && p.is("table") && f[c ? "checkStartOfBlock" : "checkEndOfBlock"]() ? (a.fire("saveSnapshot"), f[c ? "checkEndOfBlock" : "checkStartOfBlock"]() && h.remove(), f["moveToElementEdit" + (c ? "End" : "Start")](p), f.select(), a.fire("saveSnapshot"), d = 1) : k.blockLimit && k.blockLimit.is("td") && (l = k.blockLimit.getAscendant("table")) && f.checkBoundaryOfElement(l, c ? CKEDITOR.START : CKEDITOR.END) && (p = l[c ? "getPrevious" : "getNext"](g)) ? (a.fire("saveSnapshot"),
  7486. f["moveToElementEdit" + (c ? "End" : "Start")](p), f.checkStartOfBlock() && f.checkEndOfBlock() ? p.remove() : f.select(), a.fire("saveSnapshot"), d = 1) : (l = k.contains(["td", "th", "caption"])) && f.checkBoundaryOfElement(l, c ? CKEDITOR.START : CKEDITOR.END) && (d = 1))
  7487. }
  7488. return !d
  7489. });
  7490. a.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && this.attachListener(this, "keyup", function(b) {
  7491. b.data.getKeystroke() in n && !this.getFirst(c) && (this.appendBogus(), b = a.createRange(), b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), b.select())
  7492. });
  7493. this.attachListener(this, "dblclick", function(b) {
  7494. if (a.readOnly) return !1;
  7495. b = {
  7496. element: b.data.getTarget()
  7497. };
  7498. a.fire("doubleclick", b)
  7499. });
  7500. CKEDITOR.env.ie && this.attachListener(this, "click", b);
  7501. CKEDITOR.env.ie && !CKEDITOR.env.edge || this.attachListener(this, "mousedown", function(b) {
  7502. var c = b.data.getTarget();
  7503. c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly() && (a.getSelection().selectElement(c), c.is("input", "textarea", "select") && b.data.preventDefault())
  7504. });
  7505. CKEDITOR.env.edge && this.attachListener(this, "mouseup",
  7506. function(b) {
  7507. (b = b.data.getTarget()) && b.is("img") && a.getSelection().selectElement(b)
  7508. });
  7509. CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(b) {
  7510. if (2 == b.data.$.button && (b = b.data.getTarget(), !b.getOuterHtml().replace(v, ""))) {
  7511. var c = a.createRange();
  7512. c.moveToElementEditStart(b);
  7513. c.select(!0)
  7514. }
  7515. });
  7516. CKEDITOR.env.webkit && (this.attachListener(this, "click", function(a) {
  7517. a.data.getTarget().is("input", "select") && a.data.preventDefault()
  7518. }), this.attachListener(this, "mouseup", function(a) {
  7519. a.data.getTarget().is("input",
  7520. "textarea") && a.data.preventDefault()
  7521. }));
  7522. CKEDITOR.env.webkit && this.attachListener(a, "key", function(b) {
  7523. if (a.readOnly) return !0;
  7524. b = b.data.domEvent.getKey();
  7525. if (b in n) {
  7526. var c = 8 == b,
  7527. d = a.getSelection().getRanges()[0];
  7528. b = d.startPath();
  7529. if (d.collapsed) a: {
  7530. var e = b.block;
  7531. if (e && d[c ? "checkStartOfBlock" : "checkEndOfBlock"]() && d.moveToClosestEditablePosition(e, !c) && d.collapsed) {
  7532. if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) {
  7533. var g = d.startContainer.getChild(d.startOffset - (c ? 1 : 0));
  7534. if (g && g.type == CKEDITOR.NODE_ELEMENT && g.is("hr")) {
  7535. a.fire("saveSnapshot");
  7536. g.remove();
  7537. b = !0;
  7538. break a
  7539. }
  7540. }
  7541. d = d.startPath().block;
  7542. if (!d || d && d.contains(e)) b = void 0;
  7543. else {
  7544. a.fire("saveSnapshot");
  7545. var f;
  7546. (f = (c ? d : e).getBogus()) && f.remove();
  7547. f = a.getSelection();
  7548. g = f.createBookmarks();
  7549. (c ? e : d).moveChildren(c ? d : e, !1);
  7550. b.lastElement.mergeSiblings();
  7551. k(e, d, !c);
  7552. f.selectBookmarks(g);
  7553. b = !0
  7554. }
  7555. } else b = !1
  7556. } else c = d, f = b.block, d = c.endPath().block, f && d && !f.equals(d) ? (a.fire("saveSnapshot"), (e = f.getBogus()) && e.remove(), c.enlarge(CKEDITOR.ENLARGE_INLINE), c.deleteContents(), d.getParent() && (d.moveChildren(f, !1), b.lastElement.mergeSiblings(),
  7557. k(f, d, !0)), c = a.getSelection().getRanges()[0], c.collapse(1), c.optimize(), "" === c.startContainer.getHtml() && c.startContainer.appendBogus(), c.select(), b = !0) : b = !1;
  7558. if (!b) return;
  7559. a.getSelection().scrollIntoView();
  7560. a.fire("saveSnapshot");
  7561. return !1
  7562. }
  7563. }, this, null, 100)
  7564. }
  7565. }
  7566. },
  7567. _: {
  7568. detach: function() {
  7569. this.editor.setData(this.editor.getData(), 0, 1);
  7570. this.clearListeners();
  7571. this.restoreAttrs();
  7572. var a;
  7573. if (a = this.removeCustomData("classes"))
  7574. for (; a.length;) this.removeClass(a.pop());
  7575. if (!this.is("textarea")) {
  7576. a = this.getDocument();
  7577. var b =
  7578. a.getHead();
  7579. if (b.getCustomData("stylesheet")) {
  7580. var c = a.getCustomData("stylesheet_ref");
  7581. --c ? a.setCustomData("stylesheet_ref", c) : (a.removeCustomData("stylesheet_ref"), b.removeCustomData("stylesheet").remove())
  7582. }
  7583. }
  7584. this.editor.fire("contentDomUnload");
  7585. delete this.editor
  7586. }
  7587. }
  7588. });
  7589. CKEDITOR.editor.prototype.editable = function(a) {
  7590. var b = this._.editable;
  7591. if (b && a) return 0;
  7592. arguments.length && (b = this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null));
  7593. return b
  7594. };
  7595. CKEDITOR.on("instanceLoaded",
  7596. function(b) {
  7597. var c = b.editor;
  7598. c.on("insertElement", function(a) {
  7599. a = a.data;
  7600. a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") || a.is("textarea")) && ("false" != a.getAttribute("contentEditable") && a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1"), a.setAttribute("contentEditable", !1))
  7601. });
  7602. c.on("selectionChange", function(b) {
  7603. if (!c.readOnly) {
  7604. var d = c.getSelection();
  7605. d && !d.isLocked && (d = c.checkDirty(), c.fire("lockSnapshot"), a(b), c.fire("unlockSnapshot"), !d && c.resetDirty())
  7606. }
  7607. })
  7608. });
  7609. CKEDITOR.on("instanceCreated",
  7610. function(a) {
  7611. var b = a.editor;
  7612. b.on("mode", function() {
  7613. var a = b.editable();
  7614. if (a && a.isInline()) {
  7615. var c = b.title;
  7616. a.changeAttr("role", "textbox");
  7617. a.changeAttr("aria-label", c);
  7618. c && a.changeAttr("title", c);
  7619. var d = b.fire("ariaEditorHelpLabel", {}).label;
  7620. if (d && (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents"))) {
  7621. var e = CKEDITOR.tools.getNextId(),
  7622. d = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + e + '" class\x3d"cke_voice_label"\x3e' + d + "\x3c/span\x3e");
  7623. c.append(d);
  7624. a.changeAttr("aria-describedby",
  7625. e)
  7626. }
  7627. }
  7628. })
  7629. });
  7630. CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
  7631. g = CKEDITOR.dom.walker.whitespaces(!0);
  7632. n = CKEDITOR.dom.walker.bookmark(!1, !0);
  7633. w = CKEDITOR.dom.walker.empty();
  7634. q = CKEDITOR.dom.walker.bogus();
  7635. v = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
  7636. u = function() {
  7637. function a(b) {
  7638. return b.type == CKEDITOR.NODE_ELEMENT
  7639. }
  7640. function b(c, d) {
  7641. var e, g, f, k, h = [],
  7642. l = d.range.startContainer;
  7643. e = d.range.startPath();
  7644. for (var l = m[l.getName()], n = 0, p = c.getChildren(), r = p.count(), v = -1, q = -1, u = 0, D = e.contains(m.$list); n < r; ++n) e = p.getItem(n), a(e) ? (f = e.getName(), D && f in CKEDITOR.dtd.$list ? h = h.concat(b(e, d)) : (k = !!l[f], "br" != f || !e.data("cke-eol") || n && n != r - 1 || (u = (g = n ? h[n - 1].node : p.getItem(n + 1)) && (!a(g) || !g.is("br")), g = g && a(g) && m.$block[g.getName()]), -1 != v || k || (v = n), k || (q = n), h.push({
  7645. isElement: 1,
  7646. isLineBreak: u,
  7647. isBlock: e.isBlockBoundary(),
  7648. hasBlockSibling: g,
  7649. node: e,
  7650. name: f,
  7651. allowed: k
  7652. }), g = u = 0)) : h.push({
  7653. isElement: 0,
  7654. node: e,
  7655. allowed: 1
  7656. }); - 1 < v && (h[v].firstNotAllowed = 1); - 1 < q && (h[q].lastNotAllowed = 1);
  7657. return h
  7658. }
  7659. function e(b, c) {
  7660. var d = [],
  7661. g = b.getChildren(),
  7662. f = g.count(),
  7663. k, h = 0,
  7664. l = m[c],
  7665. n = !b.is(m.$inline) || b.is("br");
  7666. for (n && d.push(" "); h < f; h++) k = g.getItem(h), a(k) && !k.is(l) ? d = d.concat(e(k, c)) : d.push(k);
  7667. n && d.push(" ");
  7668. return d
  7669. }
  7670. function g(b) {
  7671. return a(b.startContainer) && b.startContainer.getChild(b.startOffset - 1)
  7672. }
  7673. function f(b) {
  7674. return b && a(b) && (b.is(m.$removeEmpty) || b.is("a") && !b.isBlockBoundary())
  7675. }
  7676. function k(b, c, d, e) {
  7677. var g = b.clone(),
  7678. f, h;
  7679. g.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  7680. (f = (new CKEDITOR.dom.walker(g)).next()) && a(f) && n[f.getName()] && (h = f.getPrevious()) && a(h) && !h.getParent().equals(b.startContainer) && d.contains(h) && e.contains(f) && f.isIdentical(h) && (f.moveChildren(h), f.remove(), k(b, c, d, e))
  7681. }
  7682. function h(b, c) {
  7683. function d(b, c) {
  7684. if (c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) return b.remove(), 1
  7685. }
  7686. var e = c.endContainer.getChild(c.endOffset),
  7687. g = c.endContainer.getChild(c.endOffset - 1);
  7688. e && d(e, b[b.length - 1]);
  7689. g && d(g, b[0]) &&
  7690. (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse())
  7691. }
  7692. var m = CKEDITOR.dtd,
  7693. n = {
  7694. p: 1,
  7695. div: 1,
  7696. h1: 1,
  7697. h2: 1,
  7698. h3: 1,
  7699. h4: 1,
  7700. h5: 1,
  7701. h6: 1,
  7702. ul: 1,
  7703. ol: 1,
  7704. li: 1,
  7705. pre: 1,
  7706. dl: 1,
  7707. blockquote: 1
  7708. },
  7709. p = {
  7710. p: 1,
  7711. div: 1,
  7712. h1: 1,
  7713. h2: 1,
  7714. h3: 1,
  7715. h4: 1,
  7716. h5: 1,
  7717. h6: 1
  7718. },
  7719. r = CKEDITOR.tools.extend({}, m.$inline);
  7720. delete r.br;
  7721. return function(n, E, v, q) {
  7722. var u = n.editor,
  7723. z = !1;
  7724. "unfiltered_html" == E && (E = "html", z = !0);
  7725. if (!q.checkReadOnly()) {
  7726. var w = (new CKEDITOR.dom.elementPath(q.startContainer, q.root)).blockLimit || q.root;
  7727. n = {
  7728. type: E,
  7729. dontFilter: z,
  7730. editable: n,
  7731. editor: u,
  7732. range: q,
  7733. blockLimit: w,
  7734. mergeCandidates: [],
  7735. zombies: []
  7736. };
  7737. E = n.range;
  7738. q = n.mergeCandidates;
  7739. var B, I;
  7740. "text" == n.type && E.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (B = CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", E.document), E.insertNode(B), E.setStartAfter(B));
  7741. z = new CKEDITOR.dom.elementPath(E.startContainer);
  7742. n.endPath = w = new CKEDITOR.dom.elementPath(E.endContainer);
  7743. if (!E.collapsed) {
  7744. var u = w.block || w.blockLimit,
  7745. ga = E.getCommonAncestor();
  7746. u && !u.equals(ga) && !u.contains(ga) && E.checkEndOfBlock() && n.zombies.push(u);
  7747. E.deleteContents()
  7748. }
  7749. for (;
  7750. (I =
  7751. g(E)) && a(I) && I.isBlockBoundary() && z.contains(I);) E.moveToPosition(I, CKEDITOR.POSITION_BEFORE_END);
  7752. k(E, n.blockLimit, z, w);
  7753. B && (E.setEndBefore(B), E.collapse(), B.remove());
  7754. B = E.startPath();
  7755. if (u = B.contains(f, !1, 1)) E.splitElement(u), n.inlineStylesRoot = u, n.inlineStylesPeak = B.lastElement;
  7756. B = E.createBookmark();
  7757. (u = B.startNode.getPrevious(c)) && a(u) && f(u) && q.push(u);
  7758. (u = B.startNode.getNext(c)) && a(u) && f(u) && q.push(u);
  7759. for (u = B.startNode;
  7760. (u = u.getParent()) && f(u);) q.push(u);
  7761. E.moveToBookmark(B);
  7762. if (B = v) {
  7763. B = n.range;
  7764. if ("text" ==
  7765. n.type && n.inlineStylesRoot) {
  7766. I = n.inlineStylesPeak;
  7767. E = I.getDocument().createText("{cke-peak}");
  7768. for (q = n.inlineStylesRoot.getParent(); !I.equals(q);) E = E.appendTo(I.clone()), I = I.getParent();
  7769. v = E.getOuterHtml().split("{cke-peak}").join(v)
  7770. }
  7771. I = n.blockLimit.getName();
  7772. if (/^\s+|\s+$/.test(v) && "span" in CKEDITOR.dtd[I]) {
  7773. var N = '\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';
  7774. v = N + v + N
  7775. }
  7776. v = n.editor.dataProcessor.toHtml(v, {
  7777. context: null,
  7778. fixForBody: !1,
  7779. protectedWhitespaces: !!N,
  7780. dontFilter: n.dontFilter,
  7781. filter: n.editor.activeFilter,
  7782. enterMode: n.editor.activeEnterMode
  7783. });
  7784. I = B.document.createElement("body");
  7785. I.setHtml(v);
  7786. N && (I.getFirst().remove(), I.getLast().remove());
  7787. if ((N = B.startPath().block) && (1 != N.getChildCount() || !N.getBogus())) a: {
  7788. var P;
  7789. if (1 == I.getChildCount() && a(P = I.getFirst()) && P.is(p) && !P.hasAttribute("contenteditable")) {
  7790. N = P.getElementsByTag("*");
  7791. B = 0;
  7792. for (q = N.count(); B < q; B++)
  7793. if (E = N.getItem(B), !E.is(r)) break a;
  7794. P.moveChildren(P.getParent(1));
  7795. P.remove()
  7796. }
  7797. }
  7798. n.dataWrapper = I;
  7799. B = v
  7800. }
  7801. if (B) {
  7802. P = n.range;
  7803. B = P.document;
  7804. var L;
  7805. I = n.blockLimit;
  7806. q =
  7807. 0;
  7808. var R, N = [],
  7809. Q, Y;
  7810. v = u = 0;
  7811. var U, Z;
  7812. E = P.startContainer;
  7813. var z = n.endPath.elements[0],
  7814. aa, w = z.getPosition(E),
  7815. ga = !!z.getCommonAncestor(E) && w != CKEDITOR.POSITION_IDENTICAL && !(w & CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED);
  7816. E = b(n.dataWrapper, n);
  7817. for (h(E, P); q < E.length; q++) {
  7818. w = E[q];
  7819. if (L = w.isLineBreak) {
  7820. L = P;
  7821. U = I;
  7822. var X = void 0,
  7823. ba = void 0;
  7824. w.hasBlockSibling ? L = 1 : (X = L.startContainer.getAscendant(m.$block, 1)) && X.is({
  7825. div: 1,
  7826. p: 1
  7827. }) ? (ba = X.getPosition(U), ba == CKEDITOR.POSITION_IDENTICAL || ba == CKEDITOR.POSITION_CONTAINS ?
  7828. L = 0 : (U = L.splitElement(X), L.moveToPosition(U, CKEDITOR.POSITION_AFTER_START), L = 1)) : L = 0
  7829. }
  7830. if (L) v = 0 < q;
  7831. else {
  7832. L = P.startPath();
  7833. !w.isBlock && l(n.editor, L.block, L.blockLimit) && (Y = d(n.editor)) && (Y = B.createElement(Y), Y.appendBogus(), P.insertNode(Y), CKEDITOR.env.needsBrFiller && (R = Y.getBogus()) && R.remove(), P.moveToPosition(Y, CKEDITOR.POSITION_BEFORE_END));
  7834. if ((L = P.startPath().block) && !L.equals(Q)) {
  7835. if (R = L.getBogus()) R.remove(), N.push(L);
  7836. Q = L
  7837. }
  7838. w.firstNotAllowed && (u = 1);
  7839. if (u && w.isElement) {
  7840. L = P.startContainer;
  7841. for (U = null; L &&
  7842. !m[L.getName()][w.name];) {
  7843. if (L.equals(I)) {
  7844. L = null;
  7845. break
  7846. }
  7847. U = L;
  7848. L = L.getParent()
  7849. }
  7850. if (L) U && (Z = P.splitElement(U), n.zombies.push(Z), n.zombies.push(U));
  7851. else {
  7852. U = I.getName();
  7853. aa = !q;
  7854. L = q == E.length - 1;
  7855. U = e(w.node, U);
  7856. for (var X = [], ba = U.length, ea = 0, ha = void 0, ia = 0, fa = -1; ea < ba; ea++) ha = U[ea], " " == ha ? (ia || aa && !ea || (X.push(new CKEDITOR.dom.text(" ")), fa = X.length), ia = 1) : (X.push(ha), ia = 0);
  7857. L && fa == X.length && X.pop();
  7858. aa = X
  7859. }
  7860. }
  7861. if (aa) {
  7862. for (; L = aa.pop();) P.insertNode(L);
  7863. aa = 0
  7864. } else P.insertNode(w.node);
  7865. w.lastNotAllowed && q < E.length - 1 && ((Z = ga ?
  7866. z : Z) && P.setEndAt(Z, CKEDITOR.POSITION_AFTER_START), u = 0);
  7867. P.collapse()
  7868. }
  7869. }
  7870. 1 != E.length ? R = !1 : (R = E[0], R = R.isElement && "false" == R.node.getAttribute("contenteditable"));
  7871. R && (v = !0, L = E[0].node, P.setStartAt(L, CKEDITOR.POSITION_BEFORE_START), P.setEndAt(L, CKEDITOR.POSITION_AFTER_END));
  7872. n.dontMoveCaret = v;
  7873. n.bogusNeededBlocks = N
  7874. }
  7875. R = n.range;
  7876. var W;
  7877. Z = n.bogusNeededBlocks;
  7878. for (aa = R.createBookmark(); Q = n.zombies.pop();) Q.getParent() && (Y = R.clone(), Y.moveToElementEditStart(Q), Y.removeEmptyBlocksAtEnd());
  7879. if (Z)
  7880. for (; Q = Z.pop();) CKEDITOR.env.needsBrFiller ?
  7881. Q.appendBogus() : Q.append(R.document.createText(" "));
  7882. for (; Q = n.mergeCandidates.pop();) Q.mergeSiblings();
  7883. R.moveToBookmark(aa);
  7884. if (!n.dontMoveCaret) {
  7885. for (Q = g(R); Q && a(Q) && !Q.is(m.$empty);) {
  7886. if (Q.isBlockBoundary()) R.moveToPosition(Q, CKEDITOR.POSITION_BEFORE_END);
  7887. else {
  7888. if (f(Q) && Q.getHtml().match(/(\s|&nbsp;)$/g)) {
  7889. W = null;
  7890. break
  7891. }
  7892. W = R.clone();
  7893. W.moveToPosition(Q, CKEDITOR.POSITION_BEFORE_END)
  7894. }
  7895. Q = Q.getLast(c)
  7896. }
  7897. W && R.moveToRange(W)
  7898. }
  7899. }
  7900. }
  7901. }();
  7902. r = function() {
  7903. function a(b) {
  7904. b = new CKEDITOR.dom.walker(b);
  7905. b.guard = function(a, b) {
  7906. if (b) return !1;
  7907. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent)
  7908. };
  7909. b.evaluator = function(a) {
  7910. return a.type == CKEDITOR.NODE_ELEMENT
  7911. };
  7912. return b
  7913. }
  7914. function b(a, c, d) {
  7915. c = a.getDocument().createElement(c);
  7916. a.append(c, d);
  7917. return c
  7918. }
  7919. function c(a) {
  7920. var b = a.count(),
  7921. d;
  7922. for (b; 0 < b--;) d = a.getItem(b), CKEDITOR.tools.trim(d.getHtml()) || (d.appendBogus(), CKEDITOR.env.ie && 9 > CKEDITOR.env.version && d.getChildCount() && d.getFirst().remove())
  7923. }
  7924. return function(d) {
  7925. var e = d.startContainer,
  7926. g = e.getAscendant("table", 1),
  7927. f = !1;
  7928. c(g.getElementsByTag("td"));
  7929. c(g.getElementsByTag("th"));
  7930. g = d.clone();
  7931. g.setStart(e, 0);
  7932. g = a(g).lastBackward();
  7933. g || (g = d.clone(), g.setEndAt(e, CKEDITOR.POSITION_BEFORE_END), g = a(g).lastForward(), f = !0);
  7934. g || (g = e);
  7935. g.is("table") ? (d.setStartAt(g, CKEDITOR.POSITION_BEFORE_START), d.collapse(!0), g.remove()) : (g.is({
  7936. tbody: 1,
  7937. thead: 1,
  7938. tfoot: 1
  7939. }) && (g = b(g, "tr", f)), g.is("tr") && (g = b(g, g.getParent().is("thead") ? "th" : "td", f)), (e = g.getBogus()) && e.remove(), d.moveToPosition(g, f ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END))
  7940. }
  7941. }();
  7942. p = function() {
  7943. function a(b) {
  7944. b =
  7945. new CKEDITOR.dom.walker(b);
  7946. b.guard = function(a, b) {
  7947. if (b) return !1;
  7948. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$list) || a.is(CKEDITOR.dtd.$listItem)
  7949. };
  7950. b.evaluator = function(a) {
  7951. return a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$listItem)
  7952. };
  7953. return b
  7954. }
  7955. return function(b) {
  7956. var c = b.startContainer,
  7957. d = !1,
  7958. e;
  7959. e = b.clone();
  7960. e.setStart(c, 0);
  7961. e = a(e).lastBackward();
  7962. e || (e = b.clone(), e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END), e = a(e).lastForward(), d = !0);
  7963. e || (e = c);
  7964. e.is(CKEDITOR.dtd.$list) ? (b.setStartAt(e, CKEDITOR.POSITION_BEFORE_START),
  7965. b.collapse(!0), e.remove()) : ((c = e.getBogus()) && c.remove(), b.moveToPosition(e, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END), b.select())
  7966. }
  7967. }();
  7968. z = {
  7969. eol: {
  7970. detect: function(a, b) {
  7971. var c = a.range,
  7972. d = c.clone(),
  7973. e = c.clone(),
  7974. g = new CKEDITOR.dom.elementPath(c.startContainer, b),
  7975. f = new CKEDITOR.dom.elementPath(c.endContainer, b);
  7976. d.collapse(1);
  7977. e.collapse();
  7978. g.block && d.checkBoundaryOfElement(g.block, CKEDITOR.END) && (c.setStartAfter(g.block), a.prependEolBr = 1);
  7979. f.block && e.checkBoundaryOfElement(f.block, CKEDITOR.START) &&
  7980. (c.setEndBefore(f.block), a.appendEolBr = 1)
  7981. },
  7982. fix: function(a, b) {
  7983. var c = b.getDocument(),
  7984. d;
  7985. a.appendEolBr && (d = this.createEolBr(c), a.fragment.append(d));
  7986. !a.prependEolBr || d && !d.getPrevious() || a.fragment.append(this.createEolBr(c), 1)
  7987. },
  7988. createEolBr: function(a) {
  7989. return a.createElement("br", {
  7990. attributes: {
  7991. "data-cke-eol": 1
  7992. }
  7993. })
  7994. }
  7995. },
  7996. bogus: {
  7997. exclude: function(a) {
  7998. var b = a.range.getBoundaryNodes(),
  7999. c = b.startNode,
  8000. b = b.endNode;
  8001. !b || !q(b) || c && c.equals(b) || a.range.setEndBefore(b)
  8002. }
  8003. },
  8004. tree: {
  8005. rebuild: function(a, b) {
  8006. var c = a.range,
  8007. d = c.getCommonAncestor(),
  8008. e = new CKEDITOR.dom.elementPath(d, b),
  8009. g = new CKEDITOR.dom.elementPath(c.startContainer, b),
  8010. c = new CKEDITOR.dom.elementPath(c.endContainer, b),
  8011. f;
  8012. d.type == CKEDITOR.NODE_TEXT && (d = d.getParent());
  8013. if (e.blockLimit.is({
  8014. tr: 1,
  8015. table: 1
  8016. })) {
  8017. var k = e.contains("table").getParent();
  8018. f = function(a) {
  8019. return !a.equals(k)
  8020. }
  8021. } else if (e.block && e.block.is(CKEDITOR.dtd.$listItem) && (g = g.contains(CKEDITOR.dtd.$list), c = c.contains(CKEDITOR.dtd.$list), !g.equals(c))) {
  8022. var h = e.contains(CKEDITOR.dtd.$list).getParent();
  8023. f = function(a) {
  8024. return !a.equals(h)
  8025. }
  8026. }
  8027. f ||
  8028. (f = function(a) {
  8029. return !a.equals(e.block) && !a.equals(e.blockLimit)
  8030. });
  8031. this.rebuildFragment(a, b, d, f)
  8032. },
  8033. rebuildFragment: function(a, b, c, d) {
  8034. for (var e; c && !c.equals(b) && d(c);) e = c.clone(0, 1), a.fragment.appendTo(e), a.fragment = e, c = c.getParent()
  8035. }
  8036. },
  8037. cell: {
  8038. shrink: function(a) {
  8039. a = a.range;
  8040. var b = a.startContainer,
  8041. c = a.endContainer,
  8042. d = a.startOffset,
  8043. e = a.endOffset;
  8044. b.type == CKEDITOR.NODE_ELEMENT && b.equals(c) && b.is("tr") && ++d == e && a.shrink(CKEDITOR.SHRINK_TEXT)
  8045. }
  8046. }
  8047. };
  8048. B = function() {
  8049. function a(b, c) {
  8050. var d = b.getParent();
  8051. if (d.is(CKEDITOR.dtd.$inline)) b[c ?
  8052. "insertBefore" : "insertAfter"](d)
  8053. }
  8054. function b(c, d, e) {
  8055. a(d);
  8056. a(e, 1);
  8057. for (var g; g = e.getNext();) g.insertAfter(d), d = g;
  8058. w(c) && c.remove()
  8059. }
  8060. function c(a, b) {
  8061. var d = new CKEDITOR.dom.range(a);
  8062. d.setStartAfter(b.startNode);
  8063. d.setEndBefore(b.endNode);
  8064. return d
  8065. }
  8066. return {
  8067. list: {
  8068. detectMerge: function(a, b) {
  8069. var d = c(b, a.bookmark),
  8070. e = d.startPath(),
  8071. g = d.endPath(),
  8072. f = e.contains(CKEDITOR.dtd.$list),
  8073. k = g.contains(CKEDITOR.dtd.$list);
  8074. a.mergeList = f && k && f.getParent().equals(k.getParent()) && !f.equals(k);
  8075. a.mergeListItems = e.block && g.block && e.block.is(CKEDITOR.dtd.$listItem) &&
  8076. g.block.is(CKEDITOR.dtd.$listItem);
  8077. if (a.mergeList || a.mergeListItems) d = d.clone(), d.setStartBefore(a.bookmark.startNode), d.setEndAfter(a.bookmark.endNode), a.mergeListBookmark = d.createBookmark()
  8078. },
  8079. merge: function(a, c) {
  8080. if (a.mergeListBookmark) {
  8081. var d = a.mergeListBookmark.startNode,
  8082. e = a.mergeListBookmark.endNode,
  8083. g = new CKEDITOR.dom.elementPath(d, c),
  8084. f = new CKEDITOR.dom.elementPath(e, c);
  8085. if (a.mergeList) {
  8086. var k = g.contains(CKEDITOR.dtd.$list),
  8087. h = f.contains(CKEDITOR.dtd.$list);
  8088. k.equals(h) || (h.moveChildren(k), h.remove())
  8089. }
  8090. a.mergeListItems &&
  8091. (g = g.contains(CKEDITOR.dtd.$listItem), f = f.contains(CKEDITOR.dtd.$listItem), g.equals(f) || b(f, d, e));
  8092. d.remove();
  8093. e.remove()
  8094. }
  8095. }
  8096. },
  8097. block: {
  8098. detectMerge: function(a, b) {
  8099. if (!a.tableContentsRanges && !a.mergeListBookmark) {
  8100. var c = new CKEDITOR.dom.range(b);
  8101. c.setStartBefore(a.bookmark.startNode);
  8102. c.setEndAfter(a.bookmark.endNode);
  8103. a.mergeBlockBookmark = c.createBookmark()
  8104. }
  8105. },
  8106. merge: function(a, c) {
  8107. if (a.mergeBlockBookmark && !a.purgeTableBookmark) {
  8108. var d = a.mergeBlockBookmark.startNode,
  8109. e = a.mergeBlockBookmark.endNode,
  8110. g = new CKEDITOR.dom.elementPath(d,
  8111. c),
  8112. f = new CKEDITOR.dom.elementPath(e, c),
  8113. g = g.block,
  8114. f = f.block;
  8115. g && f && !g.equals(f) && b(f, d, e);
  8116. d.remove();
  8117. e.remove()
  8118. }
  8119. }
  8120. },
  8121. table: function() {
  8122. function a(c) {
  8123. var e = [],
  8124. g, f = new CKEDITOR.dom.walker(c),
  8125. k = c.startPath().contains(d),
  8126. h = c.endPath().contains(d),
  8127. l = {};
  8128. f.guard = function(a, f) {
  8129. if (a.type == CKEDITOR.NODE_ELEMENT) {
  8130. var m = "visited_" + (f ? "out" : "in");
  8131. if (a.getCustomData(m)) return;
  8132. CKEDITOR.dom.element.setMarker(l, a, m, 1)
  8133. }
  8134. if (f && k && a.equals(k)) g = c.clone(), g.setEndAt(k, CKEDITOR.POSITION_BEFORE_END), e.push(g);
  8135. else if (!f && h &&
  8136. a.equals(h)) g = c.clone(), g.setStartAt(h, CKEDITOR.POSITION_AFTER_START), e.push(g);
  8137. else {
  8138. if (m = !f) m = a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && (!k || b(a, k)) && (!h || b(a, h));
  8139. m && (g = c.clone(), g.selectNodeContents(a), e.push(g))
  8140. }
  8141. };
  8142. f.lastForward();
  8143. CKEDITOR.dom.element.clearAllMarkers(l);
  8144. return e
  8145. }
  8146. function b(a, c) {
  8147. var d = CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED,
  8148. e = a.getPosition(c);
  8149. return e === CKEDITOR.POSITION_IDENTICAL ? !1 : 0 === (e & d)
  8150. }
  8151. var d = {
  8152. td: 1,
  8153. th: 1,
  8154. caption: 1
  8155. };
  8156. return {
  8157. detectPurge: function(a) {
  8158. var b = a.range,
  8159. c = b.clone();
  8160. c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  8161. var c = new CKEDITOR.dom.walker(c),
  8162. e = 0;
  8163. c.evaluator = function(a) {
  8164. a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && ++e
  8165. };
  8166. c.checkForward();
  8167. if (1 < e) {
  8168. var c = b.startPath().contains("table"),
  8169. g = b.endPath().contains("table");
  8170. c && g && b.checkBoundaryOfElement(c, CKEDITOR.START) && b.checkBoundaryOfElement(g, CKEDITOR.END) && (b = a.range.clone(), b.setStartBefore(c), b.setEndAfter(g), a.purgeTableBookmark = b.createBookmark())
  8171. }
  8172. },
  8173. detectRanges: function(e, g) {
  8174. var f = c(g, e.bookmark),
  8175. k = f.clone(),
  8176. h, l, m = f.getCommonAncestor();
  8177. m.is(CKEDITOR.dtd.$tableContent) && !m.is(d) && (m = m.getAscendant("table", !0));
  8178. l = m;
  8179. m = new CKEDITOR.dom.elementPath(f.startContainer, l);
  8180. l = new CKEDITOR.dom.elementPath(f.endContainer, l);
  8181. m = m.contains("table");
  8182. l = l.contains("table");
  8183. if (m || l) m && l && b(m, l) ? (e.tableSurroundingRange = k, k.setStartAt(m, CKEDITOR.POSITION_AFTER_END), k.setEndAt(l, CKEDITOR.POSITION_BEFORE_START), k = f.clone(), k.setEndAt(m, CKEDITOR.POSITION_AFTER_END), h = f.clone(), h.setStartAt(l, CKEDITOR.POSITION_BEFORE_START),
  8184. h = a(k).concat(a(h))) : m ? l || (e.tableSurroundingRange = k, k.setStartAt(m, CKEDITOR.POSITION_AFTER_END), f.setEndAt(m, CKEDITOR.POSITION_AFTER_END)) : (e.tableSurroundingRange = k, k.setEndAt(l, CKEDITOR.POSITION_BEFORE_START), f.setStartAt(l, CKEDITOR.POSITION_AFTER_START)), e.tableContentsRanges = h ? h : a(f)
  8185. },
  8186. deleteRanges: function(a) {
  8187. for (var b; b = a.tableContentsRanges.pop();) b.extractContents(), w(b.startContainer) && b.startContainer.appendBogus();
  8188. a.tableSurroundingRange && a.tableSurroundingRange.extractContents()
  8189. },
  8190. purge: function(a) {
  8191. if (a.purgeTableBookmark) {
  8192. var b =
  8193. a.doc,
  8194. c = a.range.clone(),
  8195. b = b.createElement("p");
  8196. b.insertBefore(a.purgeTableBookmark.startNode);
  8197. c.moveToBookmark(a.purgeTableBookmark);
  8198. c.deleteContents();
  8199. a.range.moveToPosition(b, CKEDITOR.POSITION_AFTER_START)
  8200. }
  8201. }
  8202. }
  8203. }(),
  8204. detectExtractMerge: function(a) {
  8205. return !(a.range.startPath().contains(CKEDITOR.dtd.$listItem) && a.range.endPath().contains(CKEDITOR.dtd.$listItem))
  8206. },
  8207. fixUneditableRangePosition: function(a) {
  8208. a.startContainer.getDtd()["#"] || a.moveToClosestEditablePosition(null, !0)
  8209. },
  8210. autoParagraph: function(a, b) {
  8211. var c =
  8212. b.startPath(),
  8213. e;
  8214. l(a, c.block, c.blockLimit) && (e = d(a)) && (e = b.document.createElement(e), e.appendBogus(), b.insertNode(e), b.moveToPosition(e, CKEDITOR.POSITION_AFTER_START))
  8215. }
  8216. }
  8217. }()
  8218. }(),
  8219. function() {
  8220. function a() {
  8221. var a = this._.fakeSelection,
  8222. b;
  8223. a && (b = this.getSelection(1), b && b.isHidden() || (a.reset(), a = 0));
  8224. if (!a && (a = b || this.getSelection(1), !a || a.getType() == CKEDITOR.SELECTION_NONE)) return;
  8225. this.fire("selectionCheck", a);
  8226. b = this.elementPath();
  8227. if (!b.compare(this._.selectionPreviousPath)) {
  8228. var c = this._.selectionPreviousPath &&
  8229. this._.selectionPreviousPath.blockLimit.equals(b.blockLimit);
  8230. CKEDITOR.env.webkit && !c && (this._.previousActive = this.document.getActive());
  8231. this._.selectionPreviousPath = b;
  8232. this.fire("selectionChange", {
  8233. selection: a,
  8234. path: b
  8235. })
  8236. }
  8237. }
  8238. function f() {
  8239. r = !0;
  8240. u || (b.call(this), u = CKEDITOR.tools.setTimeout(b, 200, this))
  8241. }
  8242. function b() {
  8243. u = null;
  8244. r && (CKEDITOR.tools.setTimeout(a, 0, this), r = !1)
  8245. }
  8246. function c(a) {
  8247. return p(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? !0 : !1
  8248. }
  8249. function e(a) {
  8250. function b(c, d) {
  8251. return c && c.type != CKEDITOR.NODE_TEXT ?
  8252. a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c) : !1
  8253. }
  8254. if (!(a.root instanceof CKEDITOR.editable)) return !1;
  8255. var d = a.startContainer,
  8256. e = a.getPreviousNode(c, null, d),
  8257. g = a.getNextNode(c, null, d);
  8258. return b(e) || b(g, 1) || !(e || g || d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary() && d.getBogus()) ? !0 : !1
  8259. }
  8260. function m(a) {
  8261. l(a, !1);
  8262. var b = a.getDocument().createText(q);
  8263. a.setCustomData("cke-fillingChar", b);
  8264. return b
  8265. }
  8266. function l(a, b) {
  8267. var c = a && a.removeCustomData("cke-fillingChar");
  8268. if (c) {
  8269. if (!1 !== b) {
  8270. var e = a.getDocument().getSelection().getNative(),
  8271. g = e && "None" != e.type && e.getRangeAt(0),
  8272. f = q.length;
  8273. if (c.getLength() > f && g && g.intersectsNode(c.$)) {
  8274. var k = [{
  8275. node: e.anchorNode,
  8276. offset: e.anchorOffset
  8277. }, {
  8278. node: e.focusNode,
  8279. offset: e.focusOffset
  8280. }];
  8281. e.anchorNode == c.$ && e.anchorOffset > f && (k[0].offset -= f);
  8282. e.focusNode == c.$ && e.focusOffset > f && (k[1].offset -= f)
  8283. }
  8284. }
  8285. c.setText(d(c.getText(), 1));
  8286. k && (c = a.getDocument().$, e = c.getSelection(), c = c.createRange(), c.setStart(k[0].node, k[0].offset), c.collapse(!0), e.removeAllRanges(), e.addRange(c), e.extend(k[1].node, k[1].offset))
  8287. }
  8288. }
  8289. function d(a,
  8290. b) {
  8291. return b ? a.replace(v, function(a, b) {
  8292. return b ? " " : ""
  8293. }) : a.replace(q, "")
  8294. }
  8295. function h(a, b) {
  8296. var c = CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"' + (CKEDITOR.env.ie && 14 > CKEDITOR.env.version ? "display:none" : "position:fixed;top:0;left:-1000px") + '"\x3e' + (b || "\x26nbsp;") + "\x3c/div\x3e", a.document);
  8297. a.fire("lockSnapshot");
  8298. a.editable().append(c);
  8299. var d = a.getSelection(1),
  8300. e = a.createRange(),
  8301. g = d.root.on("selectionchange", function(a) {
  8302. a.cancel()
  8303. }, null, null, 0);
  8304. e.setStartAt(c,
  8305. CKEDITOR.POSITION_AFTER_START);
  8306. e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  8307. d.selectRanges([e]);
  8308. g.removeListener();
  8309. a.fire("unlockSnapshot");
  8310. a._.hiddenSelectionContainer = c
  8311. }
  8312. function k(a) {
  8313. var b = {
  8314. 37: 1,
  8315. 39: 1,
  8316. 8: 1,
  8317. 46: 1
  8318. };
  8319. return function(c) {
  8320. var d = c.data.getKeystroke();
  8321. if (b[d]) {
  8322. var e = a.getSelection().getRanges(),
  8323. g = e[0];
  8324. 1 == e.length && g.collapsed && (d = g[38 > d ? "getPreviousEditableNode" : "getNextEditableNode"]()) && d.type == CKEDITOR.NODE_ELEMENT && "false" == d.getAttribute("contenteditable") && (a.getSelection().fake(d), c.data.preventDefault(),
  8325. c.cancel())
  8326. }
  8327. }
  8328. }
  8329. function g(a) {
  8330. for (var b = 0; b < a.length; b++) {
  8331. var c = a[b];
  8332. c.getCommonAncestor().isReadOnly() && a.splice(b, 1);
  8333. if (!c.collapsed) {
  8334. if (c.startContainer.isReadOnly())
  8335. for (var d = c.startContainer, e; d && !((e = d.type == CKEDITOR.NODE_ELEMENT) && d.is("body") || !d.isReadOnly());) e && "false" == d.getAttribute("contentEditable") && c.setStartAfter(d), d = d.getParent();
  8336. d = c.startContainer;
  8337. e = c.endContainer;
  8338. var g = c.startOffset,
  8339. f = c.endOffset,
  8340. k = c.clone();
  8341. d && d.type == CKEDITOR.NODE_TEXT && (g >= d.getLength() ? k.setStartAfter(d) : k.setStartBefore(d));
  8342. e && e.type == CKEDITOR.NODE_TEXT && (f ? k.setEndAfter(e) : k.setEndBefore(e));
  8343. d = new CKEDITOR.dom.walker(k);
  8344. d.evaluator = function(d) {
  8345. if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) {
  8346. var e = c.clone();
  8347. c.setEndBefore(d);
  8348. c.collapsed && a.splice(b--, 1);
  8349. d.getPosition(k.endContainer) & CKEDITOR.POSITION_CONTAINS || (e.setStartAfter(d), e.collapsed || a.splice(b + 1, 0, e));
  8350. return !0
  8351. }
  8352. return !1
  8353. };
  8354. d.next()
  8355. }
  8356. }
  8357. return a
  8358. }
  8359. var n = "function" != typeof window.getSelection,
  8360. w = 1,
  8361. q = CKEDITOR.tools.repeat("​", 7),
  8362. v = new RegExp(q + "( )?", "g"),
  8363. u, r, p = CKEDITOR.dom.walker.invisible(1),
  8364. z = function() {
  8365. function a(b) {
  8366. return function(a) {
  8367. var c = a.editor.createRange();
  8368. c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
  8369. return !1
  8370. }
  8371. }
  8372. function b(a) {
  8373. return function(b) {
  8374. var c = b.editor,
  8375. d = c.createRange(),
  8376. e;
  8377. (e = d.moveToClosestEditablePosition(b.selected, a)) || (e = d.moveToClosestEditablePosition(b.selected, !a));
  8378. e && c.getSelection().selectRanges([d]);
  8379. c.fire("saveSnapshot");
  8380. b.selected.remove();
  8381. e || (d.moveToElementEditablePosition(c.editable()), c.getSelection().selectRanges([d]));
  8382. c.fire("saveSnapshot");
  8383. return !1
  8384. }
  8385. }
  8386. var c = a(),
  8387. d = a(1);
  8388. return {
  8389. 37: c,
  8390. 38: c,
  8391. 39: d,
  8392. 40: d,
  8393. 8: b(),
  8394. 46: b(1)
  8395. }
  8396. }();
  8397. CKEDITOR.on("instanceCreated", function(b) {
  8398. function c() {
  8399. var a = d.getSelection();
  8400. a && a.removeAllRanges()
  8401. }
  8402. var d = b.editor;
  8403. d.on("contentDom", function() {
  8404. function b() {
  8405. E = new CKEDITOR.dom.selection(d.getSelection());
  8406. E.lock()
  8407. }
  8408. function c() {
  8409. g.removeListener("mouseup", c);
  8410. p.removeListener("mouseup", c);
  8411. var a = CKEDITOR.document.$.selection,
  8412. b = a.createRange();
  8413. "None" != a.type && b.parentElement().ownerDocument == e.$ && b.select()
  8414. }
  8415. var e = d.document,
  8416. g = CKEDITOR.document,
  8417. h = d.editable(),
  8418. m = e.getBody(),
  8419. p = e.getDocumentElement(),
  8420. t = h.isInline(),
  8421. r, E;
  8422. CKEDITOR.env.gecko && h.attachListener(h, "focus", function(a) {
  8423. a.removeListener();
  8424. 0 !== r && (a = d.getSelection().getNative()) && a.isCollapsed && a.anchorNode == h.$ && (a = d.createRange(), a.moveToElementEditStart(h), a.select())
  8425. }, null, null, -2);
  8426. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  8427. r && CKEDITOR.env.webkit && (r = d._.previousActive && d._.previousActive.equals(e.getActive())) && null !=
  8428. d._.previousScrollTop && d._.previousScrollTop != h.$.scrollTop && (h.$.scrollTop = d._.previousScrollTop);
  8429. d.unlockSelection(r);
  8430. r = 0
  8431. }, null, null, -1);
  8432. h.attachListener(h, "mousedown", function() {
  8433. r = 0
  8434. });
  8435. if (CKEDITOR.env.ie || t) n ? h.attachListener(h, "beforedeactivate", b, null, null, -1) : h.attachListener(d, "selectionCheck", b, null, null, -1), h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusOut" : "blur", function() {
  8436. d.lockSelection(E);
  8437. r = 1
  8438. }, null, null, -1), h.attachListener(h, "mousedown", function() {
  8439. r = 0
  8440. });
  8441. if (CKEDITOR.env.ie && !t) {
  8442. var v;
  8443. h.attachListener(h, "mousedown", function(a) {
  8444. 2 == a.data.$.button && ((a = d.document.getSelection()) && a.getType() != CKEDITOR.SELECTION_NONE || (v = d.window.getScrollPosition()))
  8445. });
  8446. h.attachListener(h, "mouseup", function(a) {
  8447. 2 == a.data.$.button && v && (d.document.$.documentElement.scrollLeft = v.x, d.document.$.documentElement.scrollTop = v.y);
  8448. v = null
  8449. });
  8450. if ("BackCompat" != e.$.compatMode) {
  8451. if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) {
  8452. var q, u;
  8453. p.on("mousedown", function(a) {
  8454. function b(a) {
  8455. a = a.data.$;
  8456. if (q) {
  8457. var c = m.$.createTextRange();
  8458. try {
  8459. c.moveToPoint(a.clientX, a.clientY)
  8460. } catch (d) {}
  8461. q.setEndPoint(0 > u.compareEndPoints("StartToStart", c) ? "EndToEnd" : "StartToStart", c);
  8462. q.select()
  8463. }
  8464. }
  8465. function c() {
  8466. p.removeListener("mousemove", b);
  8467. g.removeListener("mouseup", c);
  8468. p.removeListener("mouseup", c);
  8469. q.select()
  8470. }
  8471. a = a.data;
  8472. if (a.getTarget().is("html") && a.$.y < p.$.clientHeight && a.$.x < p.$.clientWidth) {
  8473. q = m.$.createTextRange();
  8474. try {
  8475. q.moveToPoint(a.$.clientX, a.$.clientY)
  8476. } catch (d) {}
  8477. u = q.duplicate();
  8478. p.on("mousemove", b);
  8479. g.on("mouseup", c);
  8480. p.on("mouseup", c)
  8481. }
  8482. })
  8483. }
  8484. if (7 <
  8485. CKEDITOR.env.version && 11 > CKEDITOR.env.version) p.on("mousedown", function(a) {
  8486. a.data.getTarget().is("html") && (g.on("mouseup", c), p.on("mouseup", c))
  8487. })
  8488. }
  8489. }
  8490. h.attachListener(h, "selectionchange", a, d);
  8491. h.attachListener(h, "keyup", f, d);
  8492. h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  8493. d.forceNextSelectionCheck();
  8494. d.selectionChange(1)
  8495. });
  8496. if (t && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
  8497. var y;
  8498. h.attachListener(h, "mousedown", function() {
  8499. y = 1
  8500. });
  8501. h.attachListener(e.getDocumentElement(), "mouseup", function() {
  8502. y &&
  8503. f.call(d);
  8504. y = 0
  8505. })
  8506. } else h.attachListener(CKEDITOR.env.ie ? h : e.getDocumentElement(), "mouseup", f, d);
  8507. CKEDITOR.env.webkit && h.attachListener(e, "keydown", function(a) {
  8508. switch (a.data.getKey()) {
  8509. case 13:
  8510. case 33:
  8511. case 34:
  8512. case 35:
  8513. case 36:
  8514. case 37:
  8515. case 39:
  8516. case 8:
  8517. case 45:
  8518. case 46:
  8519. l(h)
  8520. }
  8521. }, null, null, -1);
  8522. h.attachListener(h, "keydown", k(d), null, null, -1)
  8523. });
  8524. d.on("setData", function() {
  8525. d.unlockSelection();
  8526. CKEDITOR.env.webkit && c()
  8527. });
  8528. d.on("contentDomUnload", function() {
  8529. d.unlockSelection()
  8530. });
  8531. if (CKEDITOR.env.ie9Compat) d.on("beforeDestroy",
  8532. c, null, null, 9);
  8533. d.on("dataReady", function() {
  8534. delete d._.fakeSelection;
  8535. delete d._.hiddenSelectionContainer;
  8536. d.selectionChange(1)
  8537. });
  8538. d.on("loadSnapshot", function() {
  8539. var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),
  8540. b = d.editable().getLast(a);
  8541. b && b.hasAttribute("data-cke-hidden-sel") && (b.remove(), CKEDITOR.env.gecko && (a = d.editable().getFirst(a)) && a.is("br") && a.getAttribute("_moz_editor_bogus_node") && a.remove())
  8542. }, null, null, 100);
  8543. d.on("key", function(a) {
  8544. if ("wysiwyg" == d.mode) {
  8545. var b = d.getSelection();
  8546. if (b.isFake) {
  8547. var c =
  8548. z[a.data.keyCode];
  8549. if (c) return c({
  8550. editor: d,
  8551. selected: b.getSelectedElement(),
  8552. selection: b,
  8553. keyEvent: a
  8554. })
  8555. }
  8556. }
  8557. })
  8558. });
  8559. if (CKEDITOR.env.webkit) CKEDITOR.on("instanceReady", function(a) {
  8560. var b = a.editor;
  8561. b.on("selectionChange", function() {
  8562. var a = b.editable(),
  8563. c = a.getCustomData("cke-fillingChar");
  8564. c && (c.getCustomData("ready") ? l(a) : c.setCustomData("ready", 1))
  8565. }, null, null, -1);
  8566. b.on("beforeSetMode", function() {
  8567. l(b.editable())
  8568. }, null, null, -1);
  8569. b.on("getSnapshot", function(a) {
  8570. a.data && (a.data = d(a.data))
  8571. }, b, null, 20);
  8572. b.on("toDataFormat",
  8573. function(a) {
  8574. a.data.dataValue = d(a.data.dataValue)
  8575. }, null, null, 0)
  8576. });
  8577. CKEDITOR.editor.prototype.selectionChange = function(b) {
  8578. (b ? a : f).call(this)
  8579. };
  8580. CKEDITOR.editor.prototype.getSelection = function(a) {
  8581. return !this._.savedSelection && !this._.fakeSelection || a ? (a = this.editable()) && "wysiwyg" == this.mode ? new CKEDITOR.dom.selection(a) : null : this._.savedSelection || this._.fakeSelection
  8582. };
  8583. CKEDITOR.editor.prototype.lockSelection = function(a) {
  8584. a = a || this.getSelection(1);
  8585. return a.getType() != CKEDITOR.SELECTION_NONE ? (!a.isLocked &&
  8586. a.lock(), this._.savedSelection = a, !0) : !1
  8587. };
  8588. CKEDITOR.editor.prototype.unlockSelection = function(a) {
  8589. var b = this._.savedSelection;
  8590. return b ? (b.unlock(a), delete this._.savedSelection, !0) : !1
  8591. };
  8592. CKEDITOR.editor.prototype.forceNextSelectionCheck = function() {
  8593. delete this._.selectionPreviousPath
  8594. };
  8595. CKEDITOR.dom.document.prototype.getSelection = function() {
  8596. return new CKEDITOR.dom.selection(this)
  8597. };
  8598. CKEDITOR.dom.range.prototype.select = function() {
  8599. var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() :
  8600. new CKEDITOR.dom.selection(this.root);
  8601. a.selectRanges([this]);
  8602. return a
  8603. };
  8604. CKEDITOR.SELECTION_NONE = 1;
  8605. CKEDITOR.SELECTION_TEXT = 2;
  8606. CKEDITOR.SELECTION_ELEMENT = 3;
  8607. CKEDITOR.dom.selection = function(a) {
  8608. if (a instanceof CKEDITOR.dom.selection) {
  8609. var b = a;
  8610. a = a.root
  8611. }
  8612. var c = a instanceof CKEDITOR.dom.element;
  8613. this.rev = b ? b.rev : w++;
  8614. this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
  8615. this.root = c ? a : this.document.getBody();
  8616. this.isLocked = 0;
  8617. this._ = {
  8618. cache: {}
  8619. };
  8620. if (b) return CKEDITOR.tools.extend(this._.cache, b._.cache),
  8621. this.isFake = b.isFake, this.isLocked = b.isLocked, this;
  8622. a = this.getNative();
  8623. var d, e;
  8624. if (a)
  8625. if (a.getRangeAt) d = (e = a.rangeCount && a.getRangeAt(0)) && new CKEDITOR.dom.node(e.commonAncestorContainer);
  8626. else {
  8627. try {
  8628. e = a.createRange()
  8629. } catch (g) {}
  8630. d = e && CKEDITOR.dom.element.get(e.item && e.item(0) || e.parentElement())
  8631. }
  8632. if (!d || d.type != CKEDITOR.NODE_ELEMENT && d.type != CKEDITOR.NODE_TEXT || !this.root.equals(d) && !this.root.contains(d)) this._.cache.type = CKEDITOR.SELECTION_NONE, this._.cache.startElement = null, this._.cache.selectedElement =
  8633. null, this._.cache.selectedText = "", this._.cache.ranges = new CKEDITOR.dom.rangeList;
  8634. return this
  8635. };
  8636. var B = {
  8637. img: 1,
  8638. hr: 1,
  8639. li: 1,
  8640. table: 1,
  8641. tr: 1,
  8642. td: 1,
  8643. th: 1,
  8644. embed: 1,
  8645. object: 1,
  8646. ol: 1,
  8647. ul: 1,
  8648. a: 1,
  8649. input: 1,
  8650. form: 1,
  8651. select: 1,
  8652. textarea: 1,
  8653. button: 1,
  8654. fieldset: 1,
  8655. thead: 1,
  8656. tfoot: 1
  8657. };
  8658. CKEDITOR.tools.extend(CKEDITOR.dom.selection, {
  8659. _removeFillingCharSequenceString: d,
  8660. _createFillingCharSequenceNode: m,
  8661. FILLING_CHAR_SEQUENCE: q
  8662. });
  8663. CKEDITOR.dom.selection.prototype = {
  8664. getNative: function() {
  8665. return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel =
  8666. n ? this.document.$.selection : this.document.getWindow().$.getSelection()
  8667. },
  8668. getType: n ? function() {
  8669. var a = this._.cache;
  8670. if (a.type) return a.type;
  8671. var b = CKEDITOR.SELECTION_NONE;
  8672. try {
  8673. var c = this.getNative(),
  8674. d = c.type;
  8675. "Text" == d && (b = CKEDITOR.SELECTION_TEXT);
  8676. "Control" == d && (b = CKEDITOR.SELECTION_ELEMENT);
  8677. c.createRange().parentElement() && (b = CKEDITOR.SELECTION_TEXT)
  8678. } catch (e) {}
  8679. return a.type = b
  8680. } : function() {
  8681. var a = this._.cache;
  8682. if (a.type) return a.type;
  8683. var b = CKEDITOR.SELECTION_TEXT,
  8684. c = this.getNative();
  8685. if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
  8686. else if (1 == c.rangeCount) {
  8687. var c = c.getRangeAt(0),
  8688. d = c.startContainer;
  8689. d == c.endContainer && 1 == d.nodeType && 1 == c.endOffset - c.startOffset && B[d.childNodes[c.startOffset].nodeName.toLowerCase()] && (b = CKEDITOR.SELECTION_ELEMENT)
  8690. }
  8691. return a.type = b
  8692. },
  8693. getRanges: function() {
  8694. var a = n ? function() {
  8695. function a(b) {
  8696. return (new CKEDITOR.dom.node(b)).getIndex()
  8697. }
  8698. var b = function(b, c) {
  8699. b = b.duplicate();
  8700. b.collapse(c);
  8701. var d = b.parentElement();
  8702. if (!d.hasChildNodes()) return {
  8703. container: d,
  8704. offset: 0
  8705. };
  8706. for (var e = d.children, g, f, k = b.duplicate(), h = 0,
  8707. l = e.length - 1, m = -1, n, p; h <= l;)
  8708. if (m = Math.floor((h + l) / 2), g = e[m], k.moveToElementText(g), n = k.compareEndPoints("StartToStart", b), 0 < n) l = m - 1;
  8709. else if (0 > n) h = m + 1;
  8710. else return {
  8711. container: d,
  8712. offset: a(g)
  8713. };
  8714. if (-1 == m || m == e.length - 1 && 0 > n) {
  8715. k.moveToElementText(d);
  8716. k.setEndPoint("StartToStart", b);
  8717. k = k.text.replace(/(\r\n|\r)/g, "\n").length;
  8718. e = d.childNodes;
  8719. if (!k) return g = e[e.length - 1], g.nodeType != CKEDITOR.NODE_TEXT ? {
  8720. container: d,
  8721. offset: e.length
  8722. } : {
  8723. container: g,
  8724. offset: g.nodeValue.length
  8725. };
  8726. for (d = e.length; 0 < k && 0 < d;) f = e[--d], f.nodeType ==
  8727. CKEDITOR.NODE_TEXT && (p = f, k -= f.nodeValue.length);
  8728. return {
  8729. container: p,
  8730. offset: -k
  8731. }
  8732. }
  8733. k.collapse(0 < n ? !0 : !1);
  8734. k.setEndPoint(0 < n ? "StartToStart" : "EndToStart", b);
  8735. k = k.text.replace(/(\r\n|\r)/g, "\n").length;
  8736. if (!k) return {
  8737. container: d,
  8738. offset: a(g) + (0 < n ? 0 : 1)
  8739. };
  8740. for (; 0 < k;) try {
  8741. f = g[0 < n ? "previousSibling" : "nextSibling"], f.nodeType == CKEDITOR.NODE_TEXT && (k -= f.nodeValue.length, p = f), g = f
  8742. } catch (r) {
  8743. return {
  8744. container: d,
  8745. offset: a(g)
  8746. }
  8747. }
  8748. return {
  8749. container: p,
  8750. offset: 0 < n ? -k : p.nodeValue.length + k
  8751. }
  8752. };
  8753. return function() {
  8754. var a = this.getNative(),
  8755. c = a &&
  8756. a.createRange(),
  8757. d = this.getType();
  8758. if (!a) return [];
  8759. if (d == CKEDITOR.SELECTION_TEXT) return a = new CKEDITOR.dom.range(this.root), d = b(c, !0), a.setStart(new CKEDITOR.dom.node(d.container), d.offset), d = b(c), a.setEnd(new CKEDITOR.dom.node(d.container), d.offset), a.endContainer.getPosition(a.startContainer) & CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer.getIndex() && a.collapse(), [a];
  8760. if (d == CKEDITOR.SELECTION_ELEMENT) {
  8761. for (var d = [], e = 0; e < c.length; e++) {
  8762. for (var g = c.item(e), f = g.parentNode, k = 0, a = new CKEDITOR.dom.range(this.root); k <
  8763. f.childNodes.length && f.childNodes[k] != g; k++);
  8764. a.setStart(new CKEDITOR.dom.node(f), k);
  8765. a.setEnd(new CKEDITOR.dom.node(f), k + 1);
  8766. d.push(a)
  8767. }
  8768. return d
  8769. }
  8770. return []
  8771. }
  8772. }() : function() {
  8773. var a = [],
  8774. b, c = this.getNative();
  8775. if (!c) return a;
  8776. for (var d = 0; d < c.rangeCount; d++) {
  8777. var e = c.getRangeAt(d);
  8778. b = new CKEDITOR.dom.range(this.root);
  8779. b.setStart(new CKEDITOR.dom.node(e.startContainer), e.startOffset);
  8780. b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset);
  8781. a.push(b)
  8782. }
  8783. return a
  8784. };
  8785. return function(b) {
  8786. var c = this._.cache,
  8787. d = c.ranges;
  8788. d || (c.ranges =
  8789. d = new CKEDITOR.dom.rangeList(a.call(this)));
  8790. return b ? g(new CKEDITOR.dom.rangeList(d.slice())) : d
  8791. }
  8792. }(),
  8793. getStartElement: function() {
  8794. var a = this._.cache;
  8795. if (void 0 !== a.startElement) return a.startElement;
  8796. var b;
  8797. switch (this.getType()) {
  8798. case CKEDITOR.SELECTION_ELEMENT:
  8799. return this.getSelectedElement();
  8800. case CKEDITOR.SELECTION_TEXT:
  8801. var c = this.getRanges()[0];
  8802. if (c) {
  8803. if (c.collapsed) b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  8804. else {
  8805. for (c.optimize(); b = c.startContainer, c.startOffset == (b.getChildCount ?
  8806. b.getChildCount() : b.getLength()) && !b.isBlockBoundary();) c.setStartAfter(b);
  8807. b = c.startContainer;
  8808. if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
  8809. if ((b = b.getChild(c.startOffset)) && b.type == CKEDITOR.NODE_ELEMENT)
  8810. for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) b = c, c = c.getFirst();
  8811. else b = c.startContainer
  8812. }
  8813. b = b.$
  8814. }
  8815. }
  8816. return a.startElement = b ? new CKEDITOR.dom.element(b) : null
  8817. },
  8818. getSelectedElement: function() {
  8819. var a = this._.cache;
  8820. if (void 0 !== a.selectedElement) return a.selectedElement;
  8821. var b = this,
  8822. c = CKEDITOR.tools.tryThese(function() {
  8823. return b.getNative().createRange().item(0)
  8824. },
  8825. function() {
  8826. for (var a = b.getRanges()[0].clone(), c, d, e = 2; e && !((c = a.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && B[c.getName()] && (d = c)); e--) a.shrink(CKEDITOR.SHRINK_ELEMENT);
  8827. return d && d.$
  8828. });
  8829. return a.selectedElement = c ? new CKEDITOR.dom.element(c) : null
  8830. },
  8831. getSelectedText: function() {
  8832. var a = this._.cache;
  8833. if (void 0 !== a.selectedText) return a.selectedText;
  8834. var b = this.getNative(),
  8835. b = n ? "Control" == b.type ? "" : b.createRange().text : b.toString();
  8836. return a.selectedText = b
  8837. },
  8838. lock: function() {
  8839. this.getRanges();
  8840. this.getStartElement();
  8841. this.getSelectedElement();
  8842. this.getSelectedText();
  8843. this._.cache.nativeSel = null;
  8844. this.isLocked = 1
  8845. },
  8846. unlock: function(a) {
  8847. if (this.isLocked) {
  8848. if (a) var b = this.getSelectedElement(),
  8849. c = !b && this.getRanges(),
  8850. d = this.isFake;
  8851. this.isLocked = 0;
  8852. this.reset();
  8853. a && (a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 1) && (d ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c))
  8854. }
  8855. },
  8856. reset: function() {
  8857. this._.cache = {};
  8858. this.isFake = 0;
  8859. var a = this.root.editor;
  8860. if (a && a._.fakeSelection)
  8861. if (this.rev == a._.fakeSelection.rev) {
  8862. delete a._.fakeSelection;
  8863. var b = a._.hiddenSelectionContainer;
  8864. if (b) {
  8865. var c = a.checkDirty();
  8866. a.fire("lockSnapshot");
  8867. b.remove();
  8868. a.fire("unlockSnapshot");
  8869. !c && a.resetDirty()
  8870. }
  8871. delete a._.hiddenSelectionContainer
  8872. } else CKEDITOR.warn("selection-fake-reset");
  8873. this.rev = w++
  8874. },
  8875. selectElement: function(a) {
  8876. var b = new CKEDITOR.dom.range(this.root);
  8877. b.setStartBefore(a);
  8878. b.setEndAfter(a);
  8879. this.selectRanges([b])
  8880. },
  8881. selectRanges: function(a) {
  8882. var b = this.root.editor,
  8883. b = b && b._.hiddenSelectionContainer;
  8884. this.reset();
  8885. if (b)
  8886. for (var b = this.root, c, d = 0; d < a.length; ++d) c =
  8887. a[d], c.endContainer.equals(b) && (c.endOffset = Math.min(c.endOffset, b.getChildCount()));
  8888. if (a.length)
  8889. if (this.isLocked) {
  8890. var g = CKEDITOR.document.getActive();
  8891. this.unlock();
  8892. this.selectRanges(a);
  8893. this.lock();
  8894. g && !g.equals(this.root) && g.focus()
  8895. } else {
  8896. var f;
  8897. a: {
  8898. var k, h;
  8899. if (1 == a.length && !(h = a[0]).collapsed && (f = h.getEnclosedNode()) && f.type == CKEDITOR.NODE_ELEMENT && (h = h.clone(), h.shrink(CKEDITOR.SHRINK_ELEMENT, !0), (k = h.getEnclosedNode()) && k.type == CKEDITOR.NODE_ELEMENT && (f = k), "false" == f.getAttribute("contenteditable"))) break a;
  8900. f = void 0
  8901. }
  8902. if (f) this.fake(f);
  8903. else {
  8904. if (n) {
  8905. h = CKEDITOR.dom.walker.whitespaces(!0);
  8906. k = /\ufeff|\u00a0/;
  8907. b = {
  8908. table: 1,
  8909. tbody: 1,
  8910. tr: 1
  8911. };
  8912. 1 < a.length && (f = a[a.length - 1], a[0].setEnd(f.endContainer, f.endOffset));
  8913. f = a[0];
  8914. a = f.collapsed;
  8915. var p, r, v;
  8916. if ((c = f.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in B && (!c.is("a") || !c.getText())) try {
  8917. v = c.$.createControlRange();
  8918. v.addElement(c.$);
  8919. v.select();
  8920. return
  8921. } catch (q) {}
  8922. if (f.startContainer.type == CKEDITOR.NODE_ELEMENT && f.startContainer.getName() in b || f.endContainer.type ==
  8923. CKEDITOR.NODE_ELEMENT && f.endContainer.getName() in b) f.shrink(CKEDITOR.NODE_ELEMENT, !0), a = f.collapsed;
  8924. v = f.createBookmark();
  8925. b = v.startNode;
  8926. a || (g = v.endNode);
  8927. v = f.document.$.body.createTextRange();
  8928. v.moveToElementText(b.$);
  8929. v.moveStart("character", 1);
  8930. g ? (k = f.document.$.body.createTextRange(), k.moveToElementText(g.$), v.setEndPoint("EndToEnd", k), v.moveEnd("character", -1)) : (p = b.getNext(h), r = b.hasAscendant("pre"), p = !(p && p.getText && p.getText().match(k)) && (r || !b.hasPrevious() || b.getPrevious().is && b.getPrevious().is("br")),
  8931. r = f.document.createElement("span"), r.setHtml("\x26#65279;"), r.insertBefore(b), p && f.document.createText("").insertBefore(b));
  8932. f.setStartBefore(b);
  8933. b.remove();
  8934. a ? (p ? (v.moveStart("character", -1), v.select(), f.document.$.selection.clear()) : v.select(), f.moveToPosition(r, CKEDITOR.POSITION_BEFORE_START), r.remove()) : (f.setEndBefore(g), g.remove(), v.select())
  8935. } else {
  8936. g = this.getNative();
  8937. if (!g) return;
  8938. this.removeAllRanges();
  8939. for (v = 0; v < a.length; v++) {
  8940. if (v < a.length - 1 && (p = a[v], r = a[v + 1], k = p.clone(), k.setStart(p.endContainer,
  8941. p.endOffset), k.setEnd(r.startContainer, r.startOffset), !k.collapsed && (k.shrink(CKEDITOR.NODE_ELEMENT, !0), f = k.getCommonAncestor(), k = k.getEnclosedNode(), f.isReadOnly() || k && k.isReadOnly()))) {
  8942. r.setStart(p.startContainer, p.startOffset);
  8943. a.splice(v--, 1);
  8944. continue
  8945. }
  8946. f = a[v];
  8947. r = this.document.$.createRange();
  8948. f.collapsed && CKEDITOR.env.webkit && e(f) && (k = m(this.root), f.insertNode(k), (p = k.getNext()) && !k.getPrevious() && p.type == CKEDITOR.NODE_ELEMENT && "br" == p.getName() ? (l(this.root), f.moveToPosition(p, CKEDITOR.POSITION_BEFORE_START)) :
  8949. f.moveToPosition(k, CKEDITOR.POSITION_AFTER_END));
  8950. r.setStart(f.startContainer.$, f.startOffset);
  8951. try {
  8952. r.setEnd(f.endContainer.$, f.endOffset)
  8953. } catch (E) {
  8954. if (0 <= E.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")) f.collapse(1), r.setEnd(f.endContainer.$, f.endOffset);
  8955. else throw E;
  8956. }
  8957. g.addRange(r)
  8958. }
  8959. }
  8960. this.reset();
  8961. this.root.fire("selectionchange")
  8962. }
  8963. }
  8964. },
  8965. fake: function(a, b) {
  8966. var c = this.root.editor;
  8967. void 0 === b && a.hasAttribute("aria-label") && (b = a.getAttribute("aria-label"));
  8968. this.reset();
  8969. h(c, b);
  8970. var d = this._.cache,
  8971. e = new CKEDITOR.dom.range(this.root);
  8972. e.setStartBefore(a);
  8973. e.setEndAfter(a);
  8974. d.ranges = new CKEDITOR.dom.rangeList(e);
  8975. d.selectedElement = d.startElement = a;
  8976. d.type = CKEDITOR.SELECTION_ELEMENT;
  8977. d.selectedText = d.nativeSel = null;
  8978. this.isFake = 1;
  8979. this.rev = w++;
  8980. c._.fakeSelection = this;
  8981. this.root.fire("selectionchange")
  8982. },
  8983. isHidden: function() {
  8984. var a = this.getCommonAncestor();
  8985. a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
  8986. return !(!a || !a.data("cke-hidden-sel"))
  8987. },
  8988. createBookmarks: function(a) {
  8989. a = this.getRanges().createBookmarks(a);
  8990. this.isFake && (a.isFake = 1);
  8991. return a
  8992. },
  8993. createBookmarks2: function(a) {
  8994. a = this.getRanges().createBookmarks2(a);
  8995. this.isFake && (a.isFake = 1);
  8996. return a
  8997. },
  8998. selectBookmarks: function(a) {
  8999. for (var b = [], c, d = 0; d < a.length; d++) {
  9000. var e = new CKEDITOR.dom.range(this.root);
  9001. e.moveToBookmark(a[d]);
  9002. b.push(e)
  9003. }
  9004. a.isFake && (c = b[0].getEnclosedNode(), c && c.type == CKEDITOR.NODE_ELEMENT || (CKEDITOR.warn("selection-not-fake"), a.isFake = 0));
  9005. a.isFake ? this.fake(c) : this.selectRanges(b);
  9006. return this
  9007. },
  9008. getCommonAncestor: function() {
  9009. var a = this.getRanges();
  9010. return a.length ? a[0].startContainer.getCommonAncestor(a[a.length -
  9011. 1].endContainer) : null
  9012. },
  9013. scrollIntoView: function() {
  9014. this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView()
  9015. },
  9016. removeAllRanges: function() {
  9017. if (this.getType() != CKEDITOR.SELECTION_NONE) {
  9018. var a = this.getNative();
  9019. try {
  9020. a && a[n ? "empty" : "removeAllRanges"]()
  9021. } catch (b) {}
  9022. this.reset()
  9023. }
  9024. }
  9025. }
  9026. }(), "use strict", CKEDITOR.STYLE_BLOCK = 1, CKEDITOR.STYLE_INLINE = 2, CKEDITOR.STYLE_OBJECT = 3,
  9027. function() {
  9028. function a(a, b) {
  9029. for (var c, d;
  9030. (a = a.getParent()) && !a.equals(b);)
  9031. if (a.getAttribute("data-nostyle")) c = a;
  9032. else if (!d) {
  9033. var e = a.getAttribute("contentEditable");
  9034. "false" == e ? c = a : "true" == e && (d = 1)
  9035. }
  9036. return c
  9037. }
  9038. function f(a, b, c, d) {
  9039. return (a.getPosition(b) | d) == d && (!c.childRule || c.childRule(a))
  9040. }
  9041. function b(c) {
  9042. var d = c.document;
  9043. if (c.collapsed) d = p(this, d), c.insertNode(d), c.moveToPosition(d, CKEDITOR.POSITION_BEFORE_END);
  9044. else {
  9045. var g = this.element,
  9046. k = this._.definition,
  9047. h, l = k.ignoreReadonly,
  9048. m = l || k.includeReadonly;
  9049. null == m && (m = c.root.getCustomData("cke_includeReadonly"));
  9050. var n = CKEDITOR.dtd[g];
  9051. n || (h = !0, n = CKEDITOR.dtd.span);
  9052. c.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  9053. c.trim();
  9054. var r = c.createBookmark(),
  9055. q = r.startNode,
  9056. u = r.endNode,
  9057. t = q,
  9058. z;
  9059. if (!l) {
  9060. var w = c.getCommonAncestor(),
  9061. l = a(q, w),
  9062. w = a(u, w);
  9063. l && (t = l.getNextSourceNode(!0));
  9064. w && (u = w)
  9065. }
  9066. for (t.getPosition(u) == CKEDITOR.POSITION_FOLLOWING && (t = 0); t;) {
  9067. l = !1;
  9068. if (t.equals(u)) t = null, l = !0;
  9069. else {
  9070. var B = t.type == CKEDITOR.NODE_ELEMENT ? t.getName() : null,
  9071. w = B && "false" == t.getAttribute("contentEditable"),
  9072. y = B && t.getAttribute("data-nostyle");
  9073. if (B && t.data("cke-bookmark")) {
  9074. t = t.getNextSourceNode(!0);
  9075. continue
  9076. }
  9077. if (w && m && CKEDITOR.dtd.$block[B])
  9078. for (var D = t, x = e(D), A = void 0, C = x.length, ea = 0,
  9079. D = C && new CKEDITOR.dom.range(D.getDocument()); ea < C; ++ea) {
  9080. var A = x[ea],
  9081. ha = CKEDITOR.filter.instances[A.data("cke-filter")];
  9082. if (ha ? ha.check(this) : 1) D.selectNodeContents(A), b.call(this, D)
  9083. }
  9084. x = B ? !n[B] || y ? 0 : w && !m ? 0 : f(t, u, k, K) : 1;
  9085. if (x)
  9086. if (A = t.getParent(), x = k, C = g, ea = h, !A || !(A.getDtd() || CKEDITOR.dtd.span)[C] && !ea || x.parentRule && !x.parentRule(A)) l = !0;
  9087. else {
  9088. if (z || B && CKEDITOR.dtd.$removeEmpty[B] && (t.getPosition(u) | K) != K || (z = c.clone(), z.setStartBefore(t)), B = t.type, B == CKEDITOR.NODE_TEXT || w || B == CKEDITOR.NODE_ELEMENT && !t.getChildCount()) {
  9089. for (var B =
  9090. t, H;
  9091. (l = !B.getNext(I)) && (H = B.getParent(), n[H.getName()]) && f(H, q, k, J);) B = H;
  9092. z.setEndAfter(B)
  9093. }
  9094. } else l = !0;
  9095. t = t.getNextSourceNode(y || w)
  9096. }
  9097. if (l && z && !z.collapsed) {
  9098. for (var l = p(this, d), w = l.hasAttributes(), y = z.getCommonAncestor(), B = {}, x = {}, A = {}, C = {}, fa, W, F; l && y;) {
  9099. if (y.getName() == g) {
  9100. for (fa in k.attributes) !C[fa] && (F = y.getAttribute(W)) && (l.getAttribute(fa) == F ? x[fa] = 1 : C[fa] = 1);
  9101. for (W in k.styles) !A[W] && (F = y.getStyle(W)) && (l.getStyle(W) == F ? B[W] = 1 : A[W] = 1)
  9102. }
  9103. y = y.getParent()
  9104. }
  9105. for (fa in x) l.removeAttribute(fa);
  9106. for (W in B) l.removeStyle(W);
  9107. w && !l.hasAttributes() && (l = null);
  9108. l ? (z.extractContents().appendTo(l), z.insertNode(l), v.call(this, l), l.mergeSiblings(), CKEDITOR.env.ie || l.$.normalize()) : (l = new CKEDITOR.dom.element("span"), z.extractContents().appendTo(l), z.insertNode(l), v.call(this, l), l.remove(!0));
  9109. z = null
  9110. }
  9111. }
  9112. c.moveToBookmark(r);
  9113. c.shrink(CKEDITOR.SHRINK_TEXT);
  9114. c.shrink(CKEDITOR.NODE_ELEMENT, !0)
  9115. }
  9116. }
  9117. function c(a) {
  9118. function b() {
  9119. for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(l.getParent()), e = null, g = null, f =
  9120. 0; f < a.elements.length; f++) {
  9121. var k = a.elements[f];
  9122. if (k == a.block || k == a.blockLimit) break;
  9123. m.checkElementRemovable(k, !0) && (e = k)
  9124. }
  9125. for (f = 0; f < c.elements.length; f++) {
  9126. k = c.elements[f];
  9127. if (k == c.block || k == c.blockLimit) break;
  9128. m.checkElementRemovable(k, !0) && (g = k)
  9129. }
  9130. g && l.breakParent(g);
  9131. e && d.breakParent(e)
  9132. }
  9133. a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  9134. var c = a.createBookmark(),
  9135. d = c.startNode;
  9136. if (a.collapsed) {
  9137. for (var e = new CKEDITOR.dom.elementPath(d.getParent(), a.root), g, f = 0, k; f < e.elements.length && (k = e.elements[f]) && k != e.block && k != e.blockLimit; f++)
  9138. if (this.checkElementRemovable(k)) {
  9139. var h;
  9140. a.collapsed && (a.checkBoundaryOfElement(k, CKEDITOR.END) || (h = a.checkBoundaryOfElement(k, CKEDITOR.START))) ? (g = k, g.match = h ? "start" : "end") : (k.mergeSiblings(), k.is(this.element) ? q.call(this, k) : u(k, t(this)[k.getName()]))
  9141. }
  9142. if (g) {
  9143. k = d;
  9144. for (f = 0;; f++) {
  9145. h = e.elements[f];
  9146. if (h.equals(g)) break;
  9147. else if (h.match) continue;
  9148. else h = h.clone();
  9149. h.append(k);
  9150. k = h
  9151. }
  9152. k["start" == g.match ? "insertBefore" : "insertAfter"](g)
  9153. }
  9154. } else {
  9155. var l = c.endNode,
  9156. m = this;
  9157. b();
  9158. for (e = d; !e.equals(l);) g = e.getNextSourceNode(), e.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(e) &&
  9159. (e.getName() == this.element ? q.call(this, e) : u(e, t(this)[e.getName()]), g.type == CKEDITOR.NODE_ELEMENT && g.contains(d) && (b(), g = d.getNext())), e = g
  9160. }
  9161. a.moveToBookmark(c);
  9162. a.shrink(CKEDITOR.NODE_ELEMENT, !0)
  9163. }
  9164. function e(a) {
  9165. var b = [];
  9166. a.forEach(function(a) {
  9167. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  9168. }, CKEDITOR.NODE_ELEMENT, !0);
  9169. return b
  9170. }
  9171. function m(a) {
  9172. var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0);
  9173. (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && z(a, this)
  9174. }
  9175. function l(a) {
  9176. var b = a.getCommonAncestor(!0, !0);
  9177. if (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) {
  9178. var b = this._.definition,
  9179. c = b.attributes;
  9180. if (c)
  9181. for (var d in c) a.removeAttribute(d, c[d]);
  9182. if (b.styles)
  9183. for (var e in b.styles) b.styles.hasOwnProperty(e) && a.removeStyle(e)
  9184. }
  9185. }
  9186. function d(a) {
  9187. var b = a.createBookmark(!0),
  9188. c = a.createIterator();
  9189. c.enforceRealBlocks = !0;
  9190. this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR);
  9191. for (var d, e = a.document, g; d = c.getNextParagraph();) !d.isReadOnly() &&
  9192. (c.activeFilter ? c.activeFilter.check(this) : 1) && (g = p(this, e, d), k(d, g));
  9193. a.moveToBookmark(b)
  9194. }
  9195. function h(a) {
  9196. var b = a.createBookmark(1),
  9197. c = a.createIterator();
  9198. c.enforceRealBlocks = !0;
  9199. c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  9200. for (var d, e; d = c.getNextParagraph();) this.checkElementRemovable(d) && (d.is("pre") ? ((e = this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div")) && d.copyAttributes(e), k(d, e)) : q.call(this, d));
  9201. a.moveToBookmark(b)
  9202. }
  9203. function k(a, b) {
  9204. var c = !b;
  9205. c && (b = a.getDocument().createElement("div"), a.copyAttributes(b));
  9206. var d = b && b.is("pre"),
  9207. e = a.is("pre"),
  9208. f = !d && e;
  9209. if (d && !e) {
  9210. e = b;
  9211. (f = a.getBogus()) && f.remove();
  9212. f = a.getHtml();
  9213. f = n(f, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
  9214. f = f.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
  9215. f = f.replace(/([ \t\n\r]+|&nbsp;)/g, " ");
  9216. f = f.replace(/<br\b[^>]*>/gi, "\n");
  9217. if (CKEDITOR.env.ie) {
  9218. var k = a.getDocument().createElement("div");
  9219. k.append(e);
  9220. e.$.outerHTML = "\x3cpre\x3e" + f + "\x3c/pre\x3e";
  9221. e.copyAttributes(k.getFirst());
  9222. e = k.getFirst().remove()
  9223. } else e.setHtml(f);
  9224. b = e
  9225. } else f ? b = w(c ? [a.getHtml()] : g(a), b) : a.moveChildren(b);
  9226. b.replace(a);
  9227. if (d) {
  9228. var c = b,
  9229. h;
  9230. (h = c.getPrevious(H)) && h.type == CKEDITOR.NODE_ELEMENT && h.is("pre") && (d = n(h.getHtml(), /\n$/, "") + "\n\n" + n(c.getHtml(), /^\n/, ""), CKEDITOR.env.ie ? c.$.outerHTML = "\x3cpre\x3e" + d + "\x3c/pre\x3e" : c.setHtml(d), h.remove())
  9231. } else c && r(b)
  9232. }
  9233. function g(a) {
  9234. var b = [];
  9235. n(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) {
  9236. return b + "\x3c/pre\x3e" + c + "\x3cpre\x3e"
  9237. }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,
  9238. function(a, c) {
  9239. b.push(c)
  9240. });
  9241. return b
  9242. }
  9243. function n(a, b, c) {
  9244. var d = "",
  9245. e = "";
  9246. a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function(a, b, c) {
  9247. b && (d = b);
  9248. c && (e = c);
  9249. return ""
  9250. });
  9251. return d + a.replace(b, c) + e
  9252. }
  9253. function w(a, b) {
  9254. var c;
  9255. 1 < a.length && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
  9256. for (var d = 0; d < a.length; d++) {
  9257. var e = a[d],
  9258. e = e.replace(/(\r\n|\r)/g, "\n"),
  9259. e = n(e, /^[ \t]*\n/, ""),
  9260. e = n(e, /\n$/, ""),
  9261. e = n(e, /^[ \t]+|[ \t]+$/g, function(a, b) {
  9262. return 1 == a.length ? "\x26nbsp;" :
  9263. b ? " " + CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) : CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " "
  9264. }),
  9265. e = e.replace(/\n/g, "\x3cbr\x3e"),
  9266. e = e.replace(/[ \t]{2,}/g, function(a) {
  9267. return CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " "
  9268. });
  9269. if (c) {
  9270. var g = b.clone();
  9271. g.setHtml(e);
  9272. c.append(g)
  9273. } else b.setHtml(e)
  9274. }
  9275. return c || b
  9276. }
  9277. function q(a, b) {
  9278. var c = this._.definition,
  9279. d = c.attributes,
  9280. c = c.styles,
  9281. e = t(this)[a.getName()],
  9282. g = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c),
  9283. f;
  9284. for (f in d)
  9285. if ("class" != f && !this._.definition.fullMatch ||
  9286. a.getAttribute(f) == y(f, d[f])) b && "data-" == f.slice(0, 5) || (g = a.hasAttribute(f), a.removeAttribute(f));
  9287. for (var k in c) this._.definition.fullMatch && a.getStyle(k) != y(k, c[k], !0) || (g = g || !!a.getStyle(k), a.removeStyle(k));
  9288. u(a, e, A[a.getName()]);
  9289. g && (this._.definition.alwaysRemoveElement ? r(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode == CKEDITOR.ENTER_BR && !a.hasAttributes() ? r(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div"))
  9290. }
  9291. function v(a) {
  9292. for (var b = t(this), c = a.getElementsByTag(this.element),
  9293. d, e = c.count(); 0 <= --e;) d = c.getItem(e), d.isReadOnly() || q.call(this, d, !0);
  9294. for (var g in b)
  9295. if (g != this.element)
  9296. for (c = a.getElementsByTag(g), e = c.count() - 1; 0 <= e; e--) d = c.getItem(e), d.isReadOnly() || u(d, b[g])
  9297. }
  9298. function u(a, b, c) {
  9299. if (b = b && b.attributes)
  9300. for (var d = 0; d < b.length; d++) {
  9301. var e = b[d][0],
  9302. g;
  9303. if (g = a.getAttribute(e)) {
  9304. var f = b[d][1];
  9305. (null === f || f.test && f.test(g) || "string" == typeof f && g == f) && a.removeAttribute(e)
  9306. }
  9307. }
  9308. c || r(a)
  9309. }
  9310. function r(a, b) {
  9311. if (!a.hasAttributes() || b)
  9312. if (CKEDITOR.dtd.$block[a.getName()]) {
  9313. var c = a.getPrevious(H),
  9314. d = a.getNext(H);
  9315. !c || c.type != CKEDITOR.NODE_TEXT && c.isBlockBoundary({
  9316. br: 1
  9317. }) || a.append("br", 1);
  9318. !d || d.type != CKEDITOR.NODE_TEXT && d.isBlockBoundary({
  9319. br: 1
  9320. }) || a.append("br");
  9321. a.remove(!0)
  9322. } else c = a.getFirst(), d = a.getLast(), a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(), d && !c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT && d.mergeSiblings())
  9323. }
  9324. function p(a, b, c) {
  9325. var d;
  9326. d = a.element;
  9327. "*" == d && (d = "span");
  9328. d = new CKEDITOR.dom.element(d, b);
  9329. c && c.copyAttributes(d);
  9330. d = z(d, a);
  9331. b.getCustomData("doc_processing_style") &&
  9332. d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style", 1);
  9333. return d
  9334. }
  9335. function z(a, b) {
  9336. var c = b._.definition,
  9337. d = c.attributes,
  9338. c = CKEDITOR.style.getStyleText(c);
  9339. if (d)
  9340. for (var e in d) a.setAttribute(e, d[e]);
  9341. c && a.setAttribute("style", c);
  9342. return a
  9343. }
  9344. function B(a, b) {
  9345. for (var c in a) a[c] = a[c].replace(G, function(a, c) {
  9346. return b[c]
  9347. })
  9348. }
  9349. function t(a) {
  9350. if (a._.overrides) return a._.overrides;
  9351. var b = a._.overrides = {},
  9352. c = a._.definition.overrides;
  9353. if (c) {
  9354. CKEDITOR.tools.isArray(c) || (c = [c]);
  9355. for (var d = 0; d < c.length; d++) {
  9356. var e =
  9357. c[d],
  9358. g, f;
  9359. "string" == typeof e ? g = e.toLowerCase() : (g = e.element ? e.element.toLowerCase() : a.element, f = e.attributes);
  9360. e = b[g] || (b[g] = {});
  9361. if (f) {
  9362. var e = e.attributes = e.attributes || [],
  9363. k;
  9364. for (k in f) e.push([k.toLowerCase(), f[k]])
  9365. }
  9366. }
  9367. }
  9368. return b
  9369. }
  9370. function y(a, b, c) {
  9371. var d = new CKEDITOR.dom.element("span");
  9372. d[c ? "setStyle" : "setAttribute"](a, b);
  9373. return d[c ? "getStyle" : "getAttribute"](a)
  9374. }
  9375. function D(a, b) {
  9376. function c(a, b) {
  9377. return "font-family" == b.toLowerCase() ? a.replace(/["']/g, "") : a
  9378. }
  9379. "string" == typeof a && (a = CKEDITOR.tools.parseCssText(a));
  9380. "string" == typeof b && (b = CKEDITOR.tools.parseCssText(b, !0));
  9381. for (var d in a)
  9382. if (!(d in b) || c(b[d], d) != c(a[d], d) && "inherit" != a[d] && "inherit" != b[d]) return !1;
  9383. return !0
  9384. }
  9385. function x(a, b, c) {
  9386. var d = a.document,
  9387. e = a.getRanges();
  9388. b = b ? this.removeFromRange : this.applyToRange;
  9389. for (var g, f = e.createIterator(); g = f.getNextRange();) b.call(this, g, c);
  9390. a.selectRanges(e);
  9391. d.removeCustomData("doc_processing_style")
  9392. }
  9393. var A = {
  9394. address: 1,
  9395. div: 1,
  9396. h1: 1,
  9397. h2: 1,
  9398. h3: 1,
  9399. h4: 1,
  9400. h5: 1,
  9401. h6: 1,
  9402. p: 1,
  9403. pre: 1,
  9404. section: 1,
  9405. header: 1,
  9406. footer: 1,
  9407. nav: 1,
  9408. article: 1,
  9409. aside: 1,
  9410. figure: 1,
  9411. dialog: 1,
  9412. hgroup: 1,
  9413. time: 1,
  9414. meter: 1,
  9415. menu: 1,
  9416. command: 1,
  9417. keygen: 1,
  9418. output: 1,
  9419. progress: 1,
  9420. details: 1,
  9421. datagrid: 1,
  9422. datalist: 1
  9423. },
  9424. C = {
  9425. a: 1,
  9426. blockquote: 1,
  9427. embed: 1,
  9428. hr: 1,
  9429. img: 1,
  9430. li: 1,
  9431. object: 1,
  9432. ol: 1,
  9433. table: 1,
  9434. td: 1,
  9435. tr: 1,
  9436. th: 1,
  9437. ul: 1,
  9438. dl: 1,
  9439. dt: 1,
  9440. dd: 1,
  9441. form: 1,
  9442. audio: 1,
  9443. video: 1
  9444. },
  9445. F = /\s*(?:;\s*|$)/,
  9446. G = /#\((.+?)\)/g,
  9447. I = CKEDITOR.dom.walker.bookmark(0, 1),
  9448. H = CKEDITOR.dom.walker.whitespaces(1);
  9449. CKEDITOR.style = function(a, b) {
  9450. if ("string" == typeof a.type) return new CKEDITOR.style.customHandlers[a.type](a);
  9451. var c = a.attributes;
  9452. c && c.style && (a.styles = CKEDITOR.tools.extend({},
  9453. a.styles, CKEDITOR.tools.parseCssText(c.style)), delete c.style);
  9454. b && (a = CKEDITOR.tools.clone(a), B(a.attributes, b), B(a.styles, b));
  9455. c = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() : a.element : "*";
  9456. this.type = a.type || (A[c] ? CKEDITOR.STYLE_BLOCK : C[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
  9457. "object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT);
  9458. this._ = {
  9459. definition: a
  9460. }
  9461. };
  9462. CKEDITOR.style.prototype = {
  9463. apply: function(a) {
  9464. if (a instanceof CKEDITOR.dom.document) return x.call(this, a.getSelection());
  9465. if (this.checkApplicable(a.elementPath(), a)) {
  9466. var b = this._.enterMode;
  9467. b || (this._.enterMode = a.activeEnterMode);
  9468. x.call(this, a.getSelection(), 0, a);
  9469. this._.enterMode = b
  9470. }
  9471. },
  9472. remove: function(a) {
  9473. if (a instanceof CKEDITOR.dom.document) return x.call(this, a.getSelection(), 1);
  9474. if (this.checkApplicable(a.elementPath(), a)) {
  9475. var b = this._.enterMode;
  9476. b || (this._.enterMode = a.activeEnterMode);
  9477. x.call(this, a.getSelection(), 1, a);
  9478. this._.enterMode = b
  9479. }
  9480. },
  9481. applyToRange: function(a) {
  9482. this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? b : this.type ==
  9483. CKEDITOR.STYLE_BLOCK ? d : this.type == CKEDITOR.STYLE_OBJECT ? m : null;
  9484. return this.applyToRange(a)
  9485. },
  9486. removeFromRange: function(a) {
  9487. this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ? h : this.type == CKEDITOR.STYLE_OBJECT ? l : null;
  9488. return this.removeFromRange(a)
  9489. },
  9490. applyToObject: function(a) {
  9491. z(a, this)
  9492. },
  9493. checkActive: function(a, b) {
  9494. switch (this.type) {
  9495. case CKEDITOR.STYLE_BLOCK:
  9496. return this.checkElementRemovable(a.block || a.blockLimit, !0, b);
  9497. case CKEDITOR.STYLE_OBJECT:
  9498. case CKEDITOR.STYLE_INLINE:
  9499. for (var c =
  9500. a.elements, d = 0, e; d < c.length; d++)
  9501. if (e = c[d], this.type != CKEDITOR.STYLE_INLINE || e != a.block && e != a.blockLimit) {
  9502. if (this.type == CKEDITOR.STYLE_OBJECT) {
  9503. var g = e.getName();
  9504. if (!("string" == typeof this.element ? g == this.element : g in this.element)) continue
  9505. }
  9506. if (this.checkElementRemovable(e, !0, b)) return !0
  9507. }
  9508. }
  9509. return !1
  9510. },
  9511. checkApplicable: function(a, b, c) {
  9512. b && b instanceof CKEDITOR.filter && (c = b);
  9513. if (c && !c.check(this)) return !1;
  9514. switch (this.type) {
  9515. case CKEDITOR.STYLE_OBJECT:
  9516. return !!a.contains(this.element);
  9517. case CKEDITOR.STYLE_BLOCK:
  9518. return !!a.blockLimit.getDtd()[this.element]
  9519. }
  9520. return !0
  9521. },
  9522. checkElementMatch: function(a, b) {
  9523. var c = this._.definition;
  9524. if (!a || !c.ignoreReadonly && a.isReadOnly()) return !1;
  9525. var d = a.getName();
  9526. if ("string" == typeof this.element ? d == this.element : d in this.element) {
  9527. if (!b && !a.hasAttributes()) return !0;
  9528. if (d = c._AC) c = d;
  9529. else {
  9530. var d = {},
  9531. e = 0,
  9532. g = c.attributes;
  9533. if (g)
  9534. for (var f in g) e++, d[f] = g[f];
  9535. if (f = CKEDITOR.style.getStyleText(c)) d.style || e++, d.style = f;
  9536. d._length = e;
  9537. c = c._AC = d
  9538. }
  9539. if (c._length) {
  9540. for (var k in c)
  9541. if ("_length" != k)
  9542. if (d = a.getAttribute(k) || "", "style" == k ? D(c[k], d) : c[k] == d) {
  9543. if (!b) return !0
  9544. } else if (b) return !1;
  9545. if (b) return !0
  9546. } else return !0
  9547. }
  9548. return !1
  9549. },
  9550. checkElementRemovable: function(a, b, c) {
  9551. if (this.checkElementMatch(a, b, c)) return !0;
  9552. if (b = t(this)[a.getName()]) {
  9553. var d;
  9554. if (!(b = b.attributes)) return !0;
  9555. for (c = 0; c < b.length; c++)
  9556. if (d = b[c][0], d = a.getAttribute(d)) {
  9557. var e = b[c][1];
  9558. if (null === e) return !0;
  9559. if ("string" == typeof e) {
  9560. if (d == e) return !0
  9561. } else if (e.test(d)) return !0
  9562. }
  9563. }
  9564. return !1
  9565. },
  9566. buildPreview: function(a) {
  9567. var b = this._.definition,
  9568. c = [],
  9569. d = b.element;
  9570. "bdo" == d && (d = "span");
  9571. var c = ["\x3c", d],
  9572. e = b.attributes;
  9573. if (e)
  9574. for (var g in e) c.push(" ",
  9575. g, '\x3d"', e[g], '"');
  9576. (e = CKEDITOR.style.getStyleText(b)) && c.push(' style\x3d"', e, '"');
  9577. c.push("\x3e", a || b.name, "\x3c/", d, "\x3e");
  9578. return c.join("")
  9579. },
  9580. getDefinition: function() {
  9581. return this._.definition
  9582. }
  9583. };
  9584. CKEDITOR.style.getStyleText = function(a) {
  9585. var b = a._ST;
  9586. if (b) return b;
  9587. var b = a.styles,
  9588. c = a.attributes && a.attributes.style || "",
  9589. d = "";
  9590. c.length && (c = c.replace(F, ";"));
  9591. for (var e in b) {
  9592. var g = b[e],
  9593. f = (e + ":" + g).replace(F, ";");
  9594. "inherit" == g ? d += f : c += f
  9595. }
  9596. c.length && (c = CKEDITOR.tools.normalizeCssText(c, !0));
  9597. return a._ST = c + d
  9598. };
  9599. CKEDITOR.style.customHandlers = {};
  9600. CKEDITOR.style.addCustomHandler = function(a) {
  9601. var b = function(a) {
  9602. this._ = {
  9603. definition: a
  9604. };
  9605. this.setup && this.setup(a)
  9606. };
  9607. b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), {
  9608. assignedTo: CKEDITOR.STYLE_OBJECT
  9609. }, a, !0);
  9610. return this.customHandlers[a.type] = b
  9611. };
  9612. var K = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
  9613. J = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
  9614. }(), CKEDITOR.styleCommand = function(a,
  9615. f) {
  9616. this.requiredContent = this.allowedContent = this.style = a;
  9617. CKEDITOR.tools.extend(this, f, !0)
  9618. }, CKEDITOR.styleCommand.prototype.exec = function(a) {
  9619. a.focus();
  9620. this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON && a.removeStyle(this.style)
  9621. }, CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet"), CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet), CKEDITOR.loadStylesSet = function(a, f, b) {
  9622. CKEDITOR.stylesSet.addExternal(a, f, "");
  9623. CKEDITOR.stylesSet.load(a,
  9624. b)
  9625. }, CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  9626. attachStyleStateChange: function(a, f) {
  9627. var b = this._.styleStateChangeCallbacks;
  9628. b || (b = this._.styleStateChangeCallbacks = [], this.on("selectionChange", function(a) {
  9629. for (var e = 0; e < b.length; e++) {
  9630. var f = b[e],
  9631. l = f.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
  9632. f.fn.call(this, l)
  9633. }
  9634. }));
  9635. b.push({
  9636. style: a,
  9637. fn: f
  9638. })
  9639. },
  9640. applyStyle: function(a) {
  9641. a.apply(this)
  9642. },
  9643. removeStyle: function(a) {
  9644. a.remove(this)
  9645. },
  9646. getStylesSet: function(a) {
  9647. if (this._.stylesDefinitions) a(this._.stylesDefinitions);
  9648. else {
  9649. var f = this,
  9650. b = f.config.stylesCombo_stylesSet || f.config.stylesSet;
  9651. if (!1 === b) a(null);
  9652. else if (b instanceof Array) f._.stylesDefinitions = b, a(b);
  9653. else {
  9654. b || (b = "default");
  9655. var b = b.split(":"),
  9656. c = b[0];
  9657. CKEDITOR.stylesSet.addExternal(c, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
  9658. CKEDITOR.stylesSet.load(c, function(b) {
  9659. f._.stylesDefinitions = b[c];
  9660. a(f._.stylesDefinitions)
  9661. })
  9662. }
  9663. }
  9664. }
  9665. }), CKEDITOR.dom.comment = function(a, f) {
  9666. "string" == typeof a && (a = (f ? f.$ : document).createComment(a));
  9667. CKEDITOR.dom.domObject.call(this,
  9668. a)
  9669. }, CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node, CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
  9670. type: CKEDITOR.NODE_COMMENT,
  9671. getOuterHtml: function() {
  9672. return "\x3c!--" + this.$.nodeValue + "--\x3e"
  9673. }
  9674. }), "use strict",
  9675. function() {
  9676. var a = {},
  9677. f = {},
  9678. b;
  9679. for (b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1);
  9680. for (b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (f[b] = 1);
  9681. CKEDITOR.dom.elementPath = function(b, e) {
  9682. var m = null,
  9683. l = null,
  9684. d = [],
  9685. h = b,
  9686. k;
  9687. e = e || b.getDocument().getBody();
  9688. do
  9689. if (h.type == CKEDITOR.NODE_ELEMENT) {
  9690. d.push(h);
  9691. if (!this.lastElement && (this.lastElement = h, h.is(CKEDITOR.dtd.$object) || "false" == h.getAttribute("contenteditable"))) continue;
  9692. if (h.equals(e)) break;
  9693. if (!l && (k = h.getName(), "true" == h.getAttribute("contenteditable") ? l = h : !m && f[k] && (m = h), a[k])) {
  9694. if (k = !m && "div" == k) {
  9695. a: {
  9696. k = h.getChildren();
  9697. for (var g = 0, n = k.count(); g < n; g++) {
  9698. var w = k.getItem(g);
  9699. if (w.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[w.getName()]) {
  9700. k = !0;
  9701. break a
  9702. }
  9703. }
  9704. k = !1
  9705. }
  9706. k = !k
  9707. }
  9708. k ? m = h : l = h
  9709. }
  9710. }
  9711. while (h = h.getParent());
  9712. l ||
  9713. (l = e);
  9714. this.block = m;
  9715. this.blockLimit = l;
  9716. this.root = e;
  9717. this.elements = d
  9718. }
  9719. }(), CKEDITOR.dom.elementPath.prototype = {
  9720. compare: function(a) {
  9721. var f = this.elements;
  9722. a = a && a.elements;
  9723. if (!a || f.length != a.length) return !1;
  9724. for (var b = 0; b < f.length; b++)
  9725. if (!f[b].equals(a[b])) return !1;
  9726. return !0
  9727. },
  9728. contains: function(a, f, b) {
  9729. var c;
  9730. "string" == typeof a && (c = function(b) {
  9731. return b.getName() == a
  9732. });
  9733. a instanceof CKEDITOR.dom.element ? c = function(b) {
  9734. return b.equals(a)
  9735. } : CKEDITOR.tools.isArray(a) ? c = function(b) {
  9736. return -1 < CKEDITOR.tools.indexOf(a, b.getName())
  9737. } :
  9738. "function" == typeof a ? c = a : "object" == typeof a && (c = function(b) {
  9739. return b.getName() in a
  9740. });
  9741. var e = this.elements,
  9742. m = e.length;
  9743. f && m--;
  9744. b && (e = Array.prototype.slice.call(e, 0), e.reverse());
  9745. for (f = 0; f < m; f++)
  9746. if (c(e[f])) return e[f];
  9747. return null
  9748. },
  9749. isContextFor: function(a) {
  9750. var f;
  9751. return a in CKEDITOR.dtd.$block ? (f = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this.block) && this.block || this.blockLimit, !!f.getDtd()[a]) : !0
  9752. },
  9753. direction: function() {
  9754. return (this.block || this.blockLimit || this.root).getDirection(1)
  9755. }
  9756. }, CKEDITOR.dom.text =
  9757. function(a, f) {
  9758. "string" == typeof a && (a = (f ? f.$ : document).createTextNode(a));
  9759. this.$ = a
  9760. }, CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node, CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
  9761. type: CKEDITOR.NODE_TEXT,
  9762. getLength: function() {
  9763. return this.$.nodeValue.length
  9764. },
  9765. getText: function() {
  9766. return this.$.nodeValue
  9767. },
  9768. setText: function(a) {
  9769. this.$.nodeValue = a
  9770. },
  9771. split: function(a) {
  9772. var f = this.$.parentNode,
  9773. b = f.childNodes.length,
  9774. c = this.getLength(),
  9775. e = this.getDocument(),
  9776. m = new CKEDITOR.dom.text(this.$.splitText(a), e);
  9777. f.childNodes.length ==
  9778. b && (a >= c ? (m = e.createText(""), m.insertAfter(this)) : (a = e.createText(""), a.insertAfter(m), a.remove()));
  9779. return m
  9780. },
  9781. substring: function(a, f) {
  9782. return "number" != typeof f ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, f)
  9783. }
  9784. }),
  9785. function() {
  9786. function a(a, c, e) {
  9787. var f = a.serializable,
  9788. l = c[e ? "endContainer" : "startContainer"],
  9789. d = e ? "endOffset" : "startOffset",
  9790. h = f ? c.document.getById(a.startNode) : a.startNode;
  9791. a = f ? c.document.getById(a.endNode) : a.endNode;
  9792. l.equals(h.getPrevious()) ? (c.startOffset = c.startOffset - l.getLength() -
  9793. a.getPrevious().getLength(), l = a.getNext()) : l.equals(a.getPrevious()) && (c.startOffset -= l.getLength(), l = a.getNext());
  9794. l.equals(h.getParent()) && c[d]++;
  9795. l.equals(a.getParent()) && c[d]++;
  9796. c[e ? "endContainer" : "startContainer"] = l;
  9797. return c
  9798. }
  9799. CKEDITOR.dom.rangeList = function(a) {
  9800. if (a instanceof CKEDITOR.dom.rangeList) return a;
  9801. a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = [];
  9802. return CKEDITOR.tools.extend(a, f)
  9803. };
  9804. var f = {
  9805. createIterator: function() {
  9806. var a = this,
  9807. c = CKEDITOR.dom.walker.bookmark(),
  9808. e = [],
  9809. f;
  9810. return {
  9811. getNextRange: function(l) {
  9812. f =
  9813. void 0 === f ? 0 : f + 1;
  9814. var d = a[f];
  9815. if (d && 1 < a.length) {
  9816. if (!f)
  9817. for (var h = a.length - 1; 0 <= h; h--) e.unshift(a[h].createBookmark(!0));
  9818. if (l)
  9819. for (var k = 0; a[f + k + 1];) {
  9820. var g = d.document;
  9821. l = 0;
  9822. h = g.getById(e[k].endNode);
  9823. for (g = g.getById(e[k + 1].startNode);;) {
  9824. h = h.getNextSourceNode(!1);
  9825. if (g.equals(h)) l = 1;
  9826. else if (c(h) || h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) continue;
  9827. break
  9828. }
  9829. if (!l) break;
  9830. k++
  9831. }
  9832. for (d.moveToBookmark(e.shift()); k--;) h = a[++f], h.moveToBookmark(e.shift()), d.setEnd(h.endContainer, h.endOffset)
  9833. }
  9834. return d
  9835. }
  9836. }
  9837. },
  9838. createBookmarks: function(b) {
  9839. for (var c = [], e, f = 0; f < this.length; f++) {
  9840. c.push(e = this[f].createBookmark(b, !0));
  9841. for (var l = f + 1; l < this.length; l++) this[l] = a(e, this[l]), this[l] = a(e, this[l], !0)
  9842. }
  9843. return c
  9844. },
  9845. createBookmarks2: function(a) {
  9846. for (var c = [], e = 0; e < this.length; e++) c.push(this[e].createBookmark2(a));
  9847. return c
  9848. },
  9849. moveToBookmarks: function(a) {
  9850. for (var c = 0; c < this.length; c++) this[c].moveToBookmark(a[c])
  9851. }
  9852. }
  9853. }(),
  9854. function() {
  9855. function a() {
  9856. return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/")
  9857. }
  9858. function f(b) {
  9859. var c =
  9860. CKEDITOR.skin["ua_" + b],
  9861. d = CKEDITOR.env;
  9862. if (c)
  9863. for (var c = c.split(",").sort(function(a, b) {
  9864. return a > b ? -1 : 1
  9865. }), e = 0, f; e < c.length; e++)
  9866. if (f = c[e], d.ie && (f.replace(/^ie/, "") == d.version || d.quirks && "iequirks" == f) && (f = "ie"), d[f]) {
  9867. b += "_" + c[e];
  9868. break
  9869. }
  9870. return CKEDITOR.getUrl(a() + b + ".css")
  9871. }
  9872. function b(a, b) {
  9873. m[a] || (CKEDITOR.document.appendStyleSheet(f(a)), m[a] = 1);
  9874. b && b()
  9875. }
  9876. function c(a) {
  9877. var b = a.getById(l);
  9878. b || (b = a.getHead().append("style"), b.setAttribute("id", l), b.setAttribute("type", "text/css"));
  9879. return b
  9880. }
  9881. function e(a, b, c) {
  9882. var d,
  9883. e, f;
  9884. if (CKEDITOR.env.webkit)
  9885. for (b = b.split("}").slice(0, -1), e = 0; e < b.length; e++) b[e] = b[e].split("{");
  9886. for (var h = 0; h < a.length; h++)
  9887. if (CKEDITOR.env.webkit)
  9888. for (e = 0; e < b.length; e++) {
  9889. f = b[e][1];
  9890. for (d = 0; d < c.length; d++) f = f.replace(c[d][0], c[d][1]);
  9891. a[h].$.sheet.addRule(b[e][0], f)
  9892. } else {
  9893. f = b;
  9894. for (d = 0; d < c.length; d++) f = f.replace(c[d][0], c[d][1]);
  9895. CKEDITOR.env.ie && 11 > CKEDITOR.env.version ? a[h].$.styleSheet.cssText += f : a[h].$.innerHTML += f
  9896. }
  9897. }
  9898. var m = {};
  9899. CKEDITOR.skin = {
  9900. path: a,
  9901. loadPart: function(c, d) {
  9902. CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ?
  9903. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() + "skin.js"), function() {
  9904. b(c, d)
  9905. }) : b(c, d)
  9906. },
  9907. getPath: function(a) {
  9908. return CKEDITOR.getUrl(f(a))
  9909. },
  9910. icons: {},
  9911. addIcon: function(a, b, c, d) {
  9912. a = a.toLowerCase();
  9913. this.icons[a] || (this.icons[a] = {
  9914. path: b,
  9915. offset: c || 0,
  9916. bgsize: d || "16px"
  9917. })
  9918. },
  9919. getIconStyle: function(a, b, c, d, e) {
  9920. var f;
  9921. a && (a = a.toLowerCase(), b && (f = this.icons[a + "-rtl"]), f || (f = this.icons[a]));
  9922. a = c || f && f.path || "";
  9923. d = d || f && f.offset;
  9924. e = e || f && f.bgsize || "16px";
  9925. a && (a = a.replace(/'/g, "\\'"));
  9926. return a && "background-image:url('" + CKEDITOR.getUrl(a) +
  9927. "');background-position:0 " + d + "px;background-size:" + e + ";"
  9928. }
  9929. };
  9930. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  9931. getUiColor: function() {
  9932. return this.uiColor
  9933. },
  9934. setUiColor: function(a) {
  9935. var b = c(CKEDITOR.document);
  9936. return (this.setUiColor = function(a) {
  9937. this.uiColor = a;
  9938. var c = CKEDITOR.skin.chameleon,
  9939. f = "",
  9940. k = "";
  9941. "function" == typeof c && (f = c(this, "editor"), k = c(this, "panel"));
  9942. a = [
  9943. [h, a]
  9944. ];
  9945. e([b], f, a);
  9946. e(d, k, a)
  9947. }).call(this, a)
  9948. }
  9949. });
  9950. var l = "cke_ui_color",
  9951. d = [],
  9952. h = /\$color/g;
  9953. CKEDITOR.on("instanceLoaded", function(a) {
  9954. if (!CKEDITOR.env.ie ||
  9955. !CKEDITOR.env.quirks) {
  9956. var b = a.editor;
  9957. a = function(a) {
  9958. a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
  9959. if (!a.getById("cke_ui_color")) {
  9960. a = c(a);
  9961. d.push(a);
  9962. var f = b.getUiColor();
  9963. f && e([a], CKEDITOR.skin.chameleon(b, "panel"), [
  9964. [h, f]
  9965. ])
  9966. }
  9967. };
  9968. b.on("panelShow", a);
  9969. b.on("menuShow", a);
  9970. b.config.uiColor && b.setUiColor(b.config.uiColor)
  9971. }
  9972. })
  9973. }(),
  9974. function() {
  9975. if (CKEDITOR.env.webkit) CKEDITOR.env.hc = !1;
  9976. else {
  9977. var a = CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',
  9978. CKEDITOR.document);
  9979. a.appendTo(CKEDITOR.document.getHead());
  9980. try {
  9981. var f = a.getComputedStyle("border-top-color"),
  9982. b = a.getComputedStyle("border-right-color");
  9983. CKEDITOR.env.hc = !(!f || f != b)
  9984. } catch (c) {
  9985. CKEDITOR.env.hc = !1
  9986. }
  9987. a.remove()
  9988. }
  9989. CKEDITOR.env.hc && (CKEDITOR.env.cssClass += " cke_hc");
  9990. CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
  9991. CKEDITOR.status = "loaded";
  9992. CKEDITOR.fireOnce("loaded");
  9993. if (a = CKEDITOR._.pending)
  9994. for (delete CKEDITOR._.pending, f = 0; f < a.length; f++) CKEDITOR.editor.prototype.constructor.apply(a[f][0],
  9995. a[f][1]), CKEDITOR.add(a[f][0])
  9996. }(), CKEDITOR.skin.name = "moono-lisa", CKEDITOR.skin.ua_editor = "ie,iequirks,ie8,gecko", CKEDITOR.skin.ua_dialog = "ie,iequirks,ie8", CKEDITOR.skin.chameleon = function() {
  9997. var a = function() {
  9998. return function(a, c) {
  9999. for (var e = a.match(/[^#]./g), f = 0; 3 > f; f++) {
  10000. var l = f,
  10001. d;
  10002. d = parseInt(e[f], 16);
  10003. d = ("0" + (0 > c ? 0 | d * (1 + c) : 0 | d + (255 - d) * c).toString(16)).slice(-2);
  10004. e[l] = d
  10005. }
  10006. return "#" + e.join("")
  10007. }
  10008. }(),
  10009. f = {
  10010. editor: new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "),
  10011. panel: new CKEDITOR.template(".cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")
  10012. };
  10013. return function(b, c) {
  10014. var e = a(b.uiColor, .4),
  10015. e = {
  10016. id: "." + b.id,
  10017. defaultBorder: a(e, -.2),
  10018. toolbarElementsBorder: a(e, -.25),
  10019. defaultBackground: e,
  10020. lightBackground: a(e, .8),
  10021. darkBackground: a(e, -.15),
  10022. ckeButtonOn: a(e, .4),
  10023. ckeResizer: a(e, -.4),
  10024. ckeColorauto: a(e, .8),
  10025. dialogBody: a(e, .7),
  10026. dialogTab: a(e, .65),
  10027. dialogTabSelected: "#FFF",
  10028. dialogTabSelectedBorder: "#FFF",
  10029. elementsPathColor: a(e, -.6),
  10030. menubuttonHover: a(e, .1),
  10031. menubuttonIcon: a(e, .5),
  10032. menubuttonIconHover: a(e, .3)
  10033. };
  10034. return f[c].output(e).replace(/\[/g, "{").replace(/\]/g, "}")
  10035. }
  10036. }(),
  10037. CKEDITOR.plugins.add("dialogui", {
  10038. onLoad: function() {
  10039. var a = function(a) {
  10040. this._ || (this._ = {});
  10041. this._["default"] = this._.initValue = a["default"] || "";
  10042. this._.required = a.required || !1;
  10043. for (var b = [this._], c = 1; c < arguments.length; c++) b.push(arguments[c]);
  10044. b.push(!0);
  10045. CKEDITOR.tools.extend.apply(CKEDITOR.tools, b);
  10046. return this._
  10047. },
  10048. f = {
  10049. build: function(a, b, c) {
  10050. return new CKEDITOR.ui.dialog.textInput(a, b, c)
  10051. }
  10052. },
  10053. b = {
  10054. build: function(a, b, c) {
  10055. return new CKEDITOR.ui.dialog[b.type](a, b, c)
  10056. }
  10057. },
  10058. c = {
  10059. isChanged: function() {
  10060. return this.getValue() !=
  10061. this.getInitValue()
  10062. },
  10063. reset: function(a) {
  10064. this.setValue(this.getInitValue(), a)
  10065. },
  10066. setInitValue: function() {
  10067. this._.initValue = this.getValue()
  10068. },
  10069. resetInitValue: function() {
  10070. this._.initValue = this._["default"]
  10071. },
  10072. getInitValue: function() {
  10073. return this._.initValue
  10074. }
  10075. },
  10076. e = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  10077. onChange: function(a, b) {
  10078. this._.domOnChangeRegistered || (a.on("load", function() {
  10079. this.getInputElement().on("change", function() {
  10080. a.parts.dialog.isVisible() && this.fire("change", {
  10081. value: this.getValue()
  10082. })
  10083. },
  10084. this)
  10085. }, this), this._.domOnChangeRegistered = !0);
  10086. this.on("change", b)
  10087. }
  10088. }, !0),
  10089. m = /^on([A-Z]\w+)/,
  10090. l = function(a) {
  10091. for (var b in a)(m.test(b) || "title" == b || "type" == b) && delete a[b];
  10092. return a
  10093. },
  10094. d = function(a) {
  10095. a = a.data.getKeystroke();
  10096. a == CKEDITOR.SHIFT + CKEDITOR.ALT + 36 ? this.setDirectionMarker("ltr") : a == CKEDITOR.SHIFT + CKEDITOR.ALT + 35 && this.setDirectionMarker("rtl")
  10097. };
  10098. CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
  10099. labeledElement: function(b, c, d, e) {
  10100. if (!(4 > arguments.length)) {
  10101. var f = a.call(this, c);
  10102. f.labelId = CKEDITOR.tools.getNextId() +
  10103. "_label";
  10104. this._.children = [];
  10105. var l = {
  10106. role: c.role || "presentation"
  10107. };
  10108. c.includeLabel && (l["aria-labelledby"] = f.labelId);
  10109. CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "div", null, l, function() {
  10110. var a = [],
  10111. d = c.required ? " cke_required" : "";
  10112. "horizontal" != c.labelLayout ? a.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label' + d + '" ', ' id\x3d"' + f.labelId + '"', f.inputId ? ' for\x3d"' + f.inputId + '"' : "", (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : "") + "\x3e", c.label, "\x3c/label\x3e", '\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',
  10113. c.controlStyle ? ' style\x3d"' + c.controlStyle + '"' : "", ' role\x3d"presentation"\x3e', e.call(this, b, c), "\x3c/div\x3e") : (d = {
  10114. type: "hbox",
  10115. widths: c.widths,
  10116. padding: 0,
  10117. children: [{
  10118. type: "html",
  10119. html: '\x3clabel class\x3d"cke_dialog_ui_labeled_label' + d + '" id\x3d"' + f.labelId + '" for\x3d"' + f.inputId + '"' + (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : "") + "\x3e" + CKEDITOR.tools.htmlEncode(c.label) + "\x3c/label\x3e"
  10120. }, {
  10121. type: "html",
  10122. html: '\x3cspan class\x3d"cke_dialog_ui_labeled_content"' + (c.controlStyle ? ' style\x3d"' + c.controlStyle +
  10123. '"' : "") + "\x3e" + e.call(this, b, c) + "\x3c/span\x3e"
  10124. }]
  10125. }, CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, d, a));
  10126. return a.join("")
  10127. })
  10128. }
  10129. },
  10130. textInput: function(b, c, e) {
  10131. if (!(3 > arguments.length)) {
  10132. a.call(this, c);
  10133. var f = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
  10134. l = {
  10135. "class": "cke_dialog_ui_input_" + c.type,
  10136. id: f,
  10137. type: c.type
  10138. };
  10139. c.validate && (this.validate = c.validate);
  10140. c.maxLength && (l.maxlength = c.maxLength);
  10141. c.size && (l.size = c.size);
  10142. c.inputStyle && (l.style = c.inputStyle);
  10143. var m = this,
  10144. v = !1;
  10145. b.on("load", function() {
  10146. m.getInputElement().on("keydown",
  10147. function(a) {
  10148. 13 == a.data.getKeystroke() && (v = !0)
  10149. });
  10150. m.getInputElement().on("keyup", function(a) {
  10151. 13 == a.data.getKeystroke() && v && (b.getButton("ok") && setTimeout(function() {
  10152. b.getButton("ok").click()
  10153. }, 0), v = !1);
  10154. m.bidi && d.call(m, a)
  10155. }, null, null, 1E3)
  10156. });
  10157. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, e, function() {
  10158. var a = ['\x3cdiv class\x3d"cke_dialog_ui_input_', c.type, '" role\x3d"presentation"'];
  10159. c.width && a.push('style\x3d"width:' + c.width + '" ');
  10160. a.push("\x3e\x3cinput ");
  10161. l["aria-labelledby"] = this._.labelId;
  10162. this._.required &&
  10163. (l["aria-required"] = this._.required);
  10164. for (var b in l) a.push(b + '\x3d"' + l[b] + '" ');
  10165. a.push(" /\x3e\x3c/div\x3e");
  10166. return a.join("")
  10167. })
  10168. }
  10169. },
  10170. textarea: function(b, c, e) {
  10171. if (!(3 > arguments.length)) {
  10172. a.call(this, c);
  10173. var f = this,
  10174. l = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea",
  10175. m = {};
  10176. c.validate && (this.validate = c.validate);
  10177. m.rows = c.rows || 5;
  10178. m.cols = c.cols || 20;
  10179. m["class"] = "cke_dialog_ui_input_textarea " + (c["class"] || "");
  10180. "undefined" != typeof c.inputStyle && (m.style = c.inputStyle);
  10181. c.dir && (m.dir = c.dir);
  10182. if (f.bidi) b.on("load",
  10183. function() {
  10184. f.getInputElement().on("keyup", d)
  10185. }, f);
  10186. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, e, function() {
  10187. m["aria-labelledby"] = this._.labelId;
  10188. this._.required && (m["aria-required"] = this._.required);
  10189. var a = ['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"', l, '" '],
  10190. b;
  10191. for (b in m) a.push(b + '\x3d"' + CKEDITOR.tools.htmlEncode(m[b]) + '" ');
  10192. a.push("\x3e", CKEDITOR.tools.htmlEncode(f._["default"]), "\x3c/textarea\x3e\x3c/div\x3e");
  10193. return a.join("")
  10194. })
  10195. }
  10196. },
  10197. checkbox: function(b,
  10198. c, d) {
  10199. if (!(3 > arguments.length)) {
  10200. var e = a.call(this, c, {
  10201. "default": !!c["default"]
  10202. });
  10203. c.validate && (this.validate = c.validate);
  10204. CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "span", null, null, function() {
  10205. var a = CKEDITOR.tools.extend({}, c, {
  10206. id: c.id ? c.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox"
  10207. }, !0),
  10208. d = [],
  10209. f = CKEDITOR.tools.getNextId() + "_label",
  10210. g = {
  10211. "class": "cke_dialog_ui_checkbox_input",
  10212. type: "checkbox",
  10213. "aria-labelledby": f
  10214. };
  10215. l(a);
  10216. c["default"] && (g.checked = "checked");
  10217. "undefined" != typeof a.inputStyle && (a.style = a.inputStyle);
  10218. e.checkbox = new CKEDITOR.ui.dialog.uiElement(b, a, d, "input", null, g);
  10219. d.push(' \x3clabel id\x3d"', f, '" for\x3d"', g.id, '"' + (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : "") + "\x3e", CKEDITOR.tools.htmlEncode(c.label), "\x3c/label\x3e");
  10220. return d.join("")
  10221. })
  10222. }
  10223. },
  10224. radio: function(b, c, d) {
  10225. if (!(3 > arguments.length)) {
  10226. a.call(this, c);
  10227. this._["default"] || (this._["default"] = this._.initValue = c.items[0][1]);
  10228. c.validate && (this.validate = c.validate);
  10229. var e = [],
  10230. f = this;
  10231. c.role = "radiogroup";
  10232. c.includeLabel = !0;
  10233. CKEDITOR.ui.dialog.labeledElement.call(this,
  10234. b, c, d,
  10235. function() {
  10236. for (var a = [], d = [], g = (c.id ? c.id : CKEDITOR.tools.getNextId()) + "_radio", m = 0; m < c.items.length; m++) {
  10237. var p = c.items[m],
  10238. z = void 0 !== p[2] ? p[2] : p[0],
  10239. B = void 0 !== p[1] ? p[1] : p[0],
  10240. t = CKEDITOR.tools.getNextId() + "_radio_input",
  10241. y = t + "_label",
  10242. t = CKEDITOR.tools.extend({}, c, {
  10243. id: t,
  10244. title: null,
  10245. type: null
  10246. }, !0),
  10247. z = CKEDITOR.tools.extend({}, t, {
  10248. title: z
  10249. }, !0),
  10250. D = {
  10251. type: "radio",
  10252. "class": "cke_dialog_ui_radio_input",
  10253. name: g,
  10254. value: B,
  10255. "aria-labelledby": y
  10256. },
  10257. x = [];
  10258. f._["default"] == B && (D.checked = "checked");
  10259. l(t);
  10260. l(z);
  10261. "undefined" != typeof t.inputStyle &&
  10262. (t.style = t.inputStyle);
  10263. t.keyboardFocusable = !0;
  10264. e.push(new CKEDITOR.ui.dialog.uiElement(b, t, x, "input", null, D));
  10265. x.push(" ");
  10266. new CKEDITOR.ui.dialog.uiElement(b, z, x, "label", null, {
  10267. id: y,
  10268. "for": D.id
  10269. }, p[0]);
  10270. a.push(x.join(""))
  10271. }
  10272. new CKEDITOR.ui.dialog.hbox(b, e, a, d);
  10273. return d.join("")
  10274. });
  10275. this._.children = e
  10276. }
  10277. },
  10278. button: function(b, c, d) {
  10279. if (arguments.length) {
  10280. "function" == typeof c && (c = c(b.getParentEditor()));
  10281. a.call(this, c, {
  10282. disabled: c.disabled || !1
  10283. });
  10284. CKEDITOR.event.implementOn(this);
  10285. var e = this;
  10286. b.on("load", function() {
  10287. var a = this.getElement();
  10288. (function() {
  10289. a.on("click", function(a) {
  10290. e.click();
  10291. a.data.preventDefault()
  10292. });
  10293. a.on("keydown", function(a) {
  10294. a.data.getKeystroke() in {
  10295. 32: 1
  10296. } && (e.click(), a.data.preventDefault())
  10297. })
  10298. })();
  10299. a.unselectable()
  10300. }, this);
  10301. var f = CKEDITOR.tools.extend({}, c);
  10302. delete f.style;
  10303. var l = CKEDITOR.tools.getNextId() + "_label";
  10304. CKEDITOR.ui.dialog.uiElement.call(this, b, f, d, "a", null, {
  10305. style: c.style,
  10306. href: "javascript:void(0)",
  10307. title: c.label,
  10308. hidefocus: "true",
  10309. "class": c["class"],
  10310. role: "button",
  10311. "aria-labelledby": l
  10312. }, '\x3cspan id\x3d"' + l + '" class\x3d"cke_dialog_ui_button"\x3e' +
  10313. CKEDITOR.tools.htmlEncode(c.label) + "\x3c/span\x3e")
  10314. }
  10315. },
  10316. select: function(b, c, d) {
  10317. if (!(3 > arguments.length)) {
  10318. var e = a.call(this, c);
  10319. c.validate && (this.validate = c.validate);
  10320. e.inputId = CKEDITOR.tools.getNextId() + "_select";
  10321. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  10322. var a = CKEDITOR.tools.extend({}, c, {
  10323. id: c.id ? c.id + "_select" : CKEDITOR.tools.getNextId() + "_select"
  10324. }, !0),
  10325. d = [],
  10326. f = [],
  10327. g = {
  10328. id: e.inputId,
  10329. "class": "cke_dialog_ui_input_select",
  10330. "aria-labelledby": this._.labelId
  10331. };
  10332. d.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
  10333. c.type, '" role\x3d"presentation"');
  10334. c.width && d.push('style\x3d"width:' + c.width + '" ');
  10335. d.push("\x3e");
  10336. void 0 !== c.size && (g.size = c.size);
  10337. void 0 !== c.multiple && (g.multiple = c.multiple);
  10338. l(a);
  10339. for (var m = 0, p; m < c.items.length && (p = c.items[m]); m++) f.push('\x3coption value\x3d"', CKEDITOR.tools.htmlEncode(void 0 !== p[1] ? p[1] : p[0]).replace(/"/g, "\x26quot;"), '" /\x3e ', CKEDITOR.tools.htmlEncode(p[0]));
  10340. "undefined" != typeof a.inputStyle && (a.style = a.inputStyle);
  10341. e.select = new CKEDITOR.ui.dialog.uiElement(b, a, d, "select", null,
  10342. g, f.join(""));
  10343. d.push("\x3c/div\x3e");
  10344. return d.join("")
  10345. })
  10346. }
  10347. },
  10348. file: function(b, c, d) {
  10349. if (!(3 > arguments.length)) {
  10350. void 0 === c["default"] && (c["default"] = "");
  10351. var e = CKEDITOR.tools.extend(a.call(this, c), {
  10352. definition: c,
  10353. buttons: []
  10354. });
  10355. c.validate && (this.validate = c.validate);
  10356. b.on("load", function() {
  10357. CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")
  10358. });
  10359. CKEDITOR.ui.dialog.labeledElement.call(this, b, c, d, function() {
  10360. e.frameId = CKEDITOR.tools.getNextId() + "_fileInput";
  10361. var a = ['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
  10362. e.frameId, '" title\x3d"', c.label, '" src\x3d"javascript:void('
  10363. ];
  10364. a.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
  10365. a.push(')"\x3e\x3c/iframe\x3e');
  10366. return a.join("")
  10367. })
  10368. }
  10369. },
  10370. fileButton: function(b, c, d) {
  10371. var e = this;
  10372. if (!(3 > arguments.length)) {
  10373. a.call(this, c);
  10374. c.validate && (this.validate = c.validate);
  10375. var f = CKEDITOR.tools.extend({}, c),
  10376. l = f.onClick;
  10377. f.className = (f.className ? f.className + " " : "") + "cke_dialog_ui_button";
  10378. f.onClick = function(a) {
  10379. var d =
  10380. c["for"];
  10381. l && !1 === l.call(this, a) || (b.getContentElement(d[0], d[1]).submit(), this.disable())
  10382. };
  10383. b.on("load", function() {
  10384. b.getContentElement(c["for"][0], c["for"][1])._.buttons.push(e)
  10385. });
  10386. CKEDITOR.ui.dialog.button.call(this, b, f, d)
  10387. }
  10388. },
  10389. html: function() {
  10390. var a = /^\s*<[\w:]+\s+([^>]*)?>/,
  10391. b = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
  10392. c = /\/$/;
  10393. return function(d, e, f) {
  10394. if (!(3 > arguments.length)) {
  10395. var l = [],
  10396. m = e.html;
  10397. "\x3c" != m.charAt(0) && (m = "\x3cspan\x3e" + m + "\x3c/span\x3e");
  10398. var r = e.focus;
  10399. if (r) {
  10400. var p = this.focus;
  10401. this.focus = function() {
  10402. ("function" ==
  10403. typeof r ? r : p).call(this);
  10404. this.fire("focus")
  10405. };
  10406. e.isFocusable && (this.isFocusable = this.isFocusable);
  10407. this.keyboardFocusable = !0
  10408. }
  10409. CKEDITOR.ui.dialog.uiElement.call(this, d, e, l, "span", null, null, "");
  10410. l = l.join("").match(a);
  10411. m = m.match(b) || ["", "", ""];
  10412. c.test(m[1]) && (m[1] = m[1].slice(0, -1), m[2] = "/" + m[2]);
  10413. f.push([m[1], " ", l[1] || "", m[2]].join(""))
  10414. }
  10415. }
  10416. }(),
  10417. fieldset: function(a, b, c, d, e) {
  10418. var f = e.label;
  10419. this._ = {
  10420. children: b
  10421. };
  10422. CKEDITOR.ui.dialog.uiElement.call(this, a, e, d, "fieldset", null, null, function() {
  10423. var a = [];
  10424. f && a.push("\x3clegend" +
  10425. (e.labelStyle ? ' style\x3d"' + e.labelStyle + '"' : "") + "\x3e" + f + "\x3c/legend\x3e");
  10426. for (var b = 0; b < c.length; b++) a.push(c[b]);
  10427. return a.join("")
  10428. })
  10429. }
  10430. }, !0);
  10431. CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
  10432. CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  10433. setLabel: function(a) {
  10434. var b = CKEDITOR.document.getById(this._.labelId);
  10435. 1 > b.getChildCount() ? (new CKEDITOR.dom.text(a, CKEDITOR.document)).appendTo(b) : b.getChild(0).$.nodeValue = a;
  10436. return this
  10437. },
  10438. getLabel: function() {
  10439. var a =
  10440. CKEDITOR.document.getById(this._.labelId);
  10441. return !a || 1 > a.getChildCount() ? "" : a.getChild(0).getText()
  10442. },
  10443. eventProcessors: e
  10444. }, !0);
  10445. CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  10446. click: function() {
  10447. return this._.disabled ? !1 : this.fire("click", {
  10448. dialog: this._.dialog
  10449. })
  10450. },
  10451. enable: function() {
  10452. this._.disabled = !1;
  10453. var a = this.getElement();
  10454. a && a.removeClass("cke_disabled")
  10455. },
  10456. disable: function() {
  10457. this._.disabled = !0;
  10458. this.getElement().addClass("cke_disabled")
  10459. },
  10460. isVisible: function() {
  10461. return this.getElement().getFirst().isVisible()
  10462. },
  10463. isEnabled: function() {
  10464. return !this._.disabled
  10465. },
  10466. eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  10467. onClick: function(a, b) {
  10468. this.on("click", function() {
  10469. b.apply(this, arguments)
  10470. })
  10471. }
  10472. }, !0),
  10473. accessKeyUp: function() {
  10474. this.click()
  10475. },
  10476. accessKeyDown: function() {
  10477. this.focus()
  10478. },
  10479. keyboardFocusable: !0
  10480. }, !0);
  10481. CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  10482. getInputElement: function() {
  10483. return CKEDITOR.document.getById(this._.inputId)
  10484. },
  10485. focus: function() {
  10486. var a = this.selectParentTab();
  10487. setTimeout(function() {
  10488. var b = a.getInputElement();
  10489. b && b.$.focus()
  10490. }, 0)
  10491. },
  10492. select: function() {
  10493. var a = this.selectParentTab();
  10494. setTimeout(function() {
  10495. var b = a.getInputElement();
  10496. b && (b.$.focus(), b.$.select())
  10497. }, 0)
  10498. },
  10499. accessKeyUp: function() {
  10500. this.select()
  10501. },
  10502. setValue: function(a) {
  10503. if (this.bidi) {
  10504. var b = a && a.charAt(0);
  10505. (b = "‪" == b ? "ltr" : "‫" == b ? "rtl" : null) && (a = a.slice(1));
  10506. this.setDirectionMarker(b)
  10507. }
  10508. a || (a = "");
  10509. return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments)
  10510. },
  10511. getValue: function() {
  10512. var a = CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);
  10513. if (this.bidi && a) {
  10514. var b = this.getDirectionMarker();
  10515. b && (a = ("ltr" == b ? "‪" : "‫") + a)
  10516. }
  10517. return a
  10518. },
  10519. setDirectionMarker: function(a) {
  10520. var b = this.getInputElement();
  10521. a ? b.setAttributes({
  10522. dir: a,
  10523. "data-cke-dir-marker": a
  10524. }) : this.getDirectionMarker() && b.removeAttributes(["dir", "data-cke-dir-marker"])
  10525. },
  10526. getDirectionMarker: function() {
  10527. return this.getInputElement().data("cke-dir-marker")
  10528. },
  10529. keyboardFocusable: !0
  10530. }, c, !0);
  10531. CKEDITOR.ui.dialog.textarea.prototype =
  10532. new CKEDITOR.ui.dialog.textInput;
  10533. CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  10534. getInputElement: function() {
  10535. return this._.select.getElement()
  10536. },
  10537. add: function(a, b, c) {
  10538. var d = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
  10539. e = this.getInputElement().$;
  10540. d.$.text = a;
  10541. d.$.value = void 0 === b || null === b ? a : b;
  10542. void 0 === c || null === c ? CKEDITOR.env.ie ? e.add(d.$) : e.add(d.$, null) : e.add(d.$, c);
  10543. return this
  10544. },
  10545. remove: function(a) {
  10546. this.getInputElement().$.remove(a);
  10547. return this
  10548. },
  10549. clear: function() {
  10550. for (var a = this.getInputElement().$; 0 < a.length;) a.remove(0);
  10551. return this
  10552. },
  10553. keyboardFocusable: !0
  10554. }, c, !0);
  10555. CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  10556. getInputElement: function() {
  10557. return this._.checkbox.getElement()
  10558. },
  10559. setValue: function(a, b) {
  10560. this.getInputElement().$.checked = a;
  10561. !b && this.fire("change", {
  10562. value: a
  10563. })
  10564. },
  10565. getValue: function() {
  10566. return this.getInputElement().$.checked
  10567. },
  10568. accessKeyUp: function() {
  10569. this.setValue(!this.getValue())
  10570. },
  10571. eventProcessors: {
  10572. onChange: function(a,
  10573. b) {
  10574. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return e.onChange.apply(this, arguments);
  10575. a.on("load", function() {
  10576. var a = this._.checkbox.getElement();
  10577. a.on("propertychange", function(b) {
  10578. b = b.data.$;
  10579. "checked" == b.propertyName && this.fire("change", {
  10580. value: a.$.checked
  10581. })
  10582. }, this)
  10583. }, this);
  10584. this.on("change", b);
  10585. return null
  10586. }
  10587. },
  10588. keyboardFocusable: !0
  10589. }, c, !0);
  10590. CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  10591. setValue: function(a, b) {
  10592. for (var c = this._.children, d, e = 0; e < c.length && (d = c[e]); e++) d.getElement().$.checked =
  10593. d.getValue() == a;
  10594. !b && this.fire("change", {
  10595. value: a
  10596. })
  10597. },
  10598. getValue: function() {
  10599. for (var a = this._.children, b = 0; b < a.length; b++)
  10600. if (a[b].getElement().$.checked) return a[b].getValue();
  10601. return null
  10602. },
  10603. accessKeyUp: function() {
  10604. var a = this._.children,
  10605. b;
  10606. for (b = 0; b < a.length; b++)
  10607. if (a[b].getElement().$.checked) {
  10608. a[b].getElement().focus();
  10609. return
  10610. }
  10611. a[0].getElement().focus()
  10612. },
  10613. eventProcessors: {
  10614. onChange: function(a, b) {
  10615. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return e.onChange.apply(this, arguments);
  10616. a.on("load", function() {
  10617. for (var a =
  10618. this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function(a) {
  10619. a = a.data.$;
  10620. "checked" == a.propertyName && this.$.checked && b.fire("change", {
  10621. value: this.getAttribute("value")
  10622. })
  10623. })
  10624. }, this);
  10625. this.on("change", b);
  10626. return null
  10627. }
  10628. }
  10629. }, c, !0);
  10630. CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, c, {
  10631. getInputElement: function() {
  10632. var a = CKEDITOR.document.getById(this._.frameId).getFrameDocument();
  10633. return 0 < a.$.forms.length ? new CKEDITOR.dom.element(a.$.forms[0].elements[0]) :
  10634. this.getElement()
  10635. },
  10636. submit: function() {
  10637. this.getInputElement().getParent().$.submit();
  10638. return this
  10639. },
  10640. getAction: function() {
  10641. return this.getInputElement().getParent().$.action
  10642. },
  10643. registerEvents: function(a) {
  10644. var b = /^on([A-Z]\w+)/,
  10645. c, d = function(a, b, c, d) {
  10646. a.on("formLoaded", function() {
  10647. a.getInputElement().on(c, d, a)
  10648. })
  10649. },
  10650. e;
  10651. for (e in a)
  10652. if (c = e.match(b)) this.eventProcessors[e] ? this.eventProcessors[e].call(this, this._.dialog, a[e]) : d(this, this._.dialog, c[1].toLowerCase(), a[e]);
  10653. return this
  10654. },
  10655. reset: function() {
  10656. function a() {
  10657. c.$.open();
  10658. var h = "";
  10659. d.size && (h = d.size - (CKEDITOR.env.ie ? 7 : 0));
  10660. var z = b.frameId + "_input";
  10661. c.$.write(['\x3chtml dir\x3d"' + m + '" lang\x3d"' + r + '"\x3e\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e\x3cbody style\x3d"margin: 0; overflow: hidden; background: transparent;"\x3e', '\x3cform enctype\x3d"multipart/form-data" method\x3d"POST" dir\x3d"' + m + '" lang\x3d"' + r + '" action\x3d"', CKEDITOR.tools.htmlEncode(d.action), '"\x3e\x3clabel id\x3d"', b.labelId, '" for\x3d"', z, '" style\x3d"display:none"\x3e', CKEDITOR.tools.htmlEncode(d.label),
  10662. '\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"', z, '" aria-labelledby\x3d"', b.labelId, '" type\x3d"file" name\x3d"', CKEDITOR.tools.htmlEncode(d.id || "cke_upload"), '" size\x3d"', CKEDITOR.tools.htmlEncode(0 < h ? h : ""), '" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e', CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "", "window.parent.CKEDITOR.tools.callFunction(" + f + ");", "window.onbeforeunload \x3d function() {window.parent.CKEDITOR.tools.callFunction(" + l + ")}", "\x3c/script\x3e"
  10663. ].join(""));
  10664. c.$.close();
  10665. for (h = 0; h < e.length; h++) e[h].enable()
  10666. }
  10667. var b = this._,
  10668. c = CKEDITOR.document.getById(b.frameId).getFrameDocument(),
  10669. d = b.definition,
  10670. e = b.buttons,
  10671. f = this.formLoadedNumber,
  10672. l = this.formUnloadNumber,
  10673. m = b.dialog._.editor.lang.dir,
  10674. r = b.dialog._.editor.langCode;
  10675. f || (f = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() {
  10676. this.fire("formLoaded")
  10677. }, this), l = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() {
  10678. this.getInputElement().clearCustomData()
  10679. }, this), this.getDialog()._.editor.on("destroy", function() {
  10680. CKEDITOR.tools.removeFunction(f);
  10681. CKEDITOR.tools.removeFunction(l)
  10682. }));
  10683. CKEDITOR.env.gecko ? setTimeout(a, 500) : a()
  10684. },
  10685. getValue: function() {
  10686. return this.getInputElement().$.value || ""
  10687. },
  10688. setInitValue: function() {
  10689. this._.initValue = ""
  10690. },
  10691. eventProcessors: {
  10692. onChange: function(a, b) {
  10693. this._.domOnChangeRegistered || (this.on("formLoaded", function() {
  10694. this.getInputElement().on("change", function() {
  10695. this.fire("change", {
  10696. value: this.getValue()
  10697. })
  10698. }, this)
  10699. }, this), this._.domOnChangeRegistered = !0);
  10700. this.on("change", b)
  10701. }
  10702. },
  10703. keyboardFocusable: !0
  10704. }, !0);
  10705. CKEDITOR.ui.dialog.fileButton.prototype =
  10706. new CKEDITOR.ui.dialog.button;
  10707. CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
  10708. CKEDITOR.dialog.addUIElement("text", f);
  10709. CKEDITOR.dialog.addUIElement("password", f);
  10710. CKEDITOR.dialog.addUIElement("textarea", b);
  10711. CKEDITOR.dialog.addUIElement("checkbox", b);
  10712. CKEDITOR.dialog.addUIElement("radio", b);
  10713. CKEDITOR.dialog.addUIElement("button", b);
  10714. CKEDITOR.dialog.addUIElement("select", b);
  10715. CKEDITOR.dialog.addUIElement("file", b);
  10716. CKEDITOR.dialog.addUIElement("fileButton", b);
  10717. CKEDITOR.dialog.addUIElement("html",
  10718. b);
  10719. CKEDITOR.dialog.addUIElement("fieldset", {
  10720. build: function(a, b, c) {
  10721. for (var d = b.children, e, f = [], l = [], m = 0; m < d.length && (e = d[m]); m++) {
  10722. var r = [];
  10723. f.push(r);
  10724. l.push(CKEDITOR.dialog._.uiElementBuilders[e.type].build(a, e, r))
  10725. }
  10726. return new CKEDITOR.ui.dialog[b.type](a, l, f, c, b)
  10727. }
  10728. })
  10729. }
  10730. }), CKEDITOR.DIALOG_RESIZE_NONE = 0, CKEDITOR.DIALOG_RESIZE_WIDTH = 1, CKEDITOR.DIALOG_RESIZE_HEIGHT = 2, CKEDITOR.DIALOG_RESIZE_BOTH = 3, CKEDITOR.DIALOG_STATE_IDLE = 1, CKEDITOR.DIALOG_STATE_BUSY = 2,
  10731. function() {
  10732. function a() {
  10733. for (var a = this._.tabIdList.length,
  10734. b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--)
  10735. if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  10736. return null
  10737. }
  10738. function f() {
  10739. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++)
  10740. if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  10741. return null
  10742. }
  10743. function b(a, b) {
  10744. for (var c = a.$.getElementsByTagName("input"), d = 0, e = c.length; d < e; d++) {
  10745. var f = new CKEDITOR.dom.element(c[d]);
  10746. "text" == f.getAttribute("type").toLowerCase() && (b ? (f.setAttribute("value", f.getCustomData("fake_value") || ""), f.removeCustomData("fake_value")) : (f.setCustomData("fake_value", f.getAttribute("value")), f.setAttribute("value", "")))
  10747. }
  10748. }
  10749. function c(a, b) {
  10750. var c = this.getInputElement();
  10751. c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", !0));
  10752. a || (this.select ? this.select() : this.focus());
  10753. b && alert(b);
  10754. this.fire("validated", {
  10755. valid: a,
  10756. msg: b
  10757. })
  10758. }
  10759. function e() {
  10760. var a = this.getInputElement();
  10761. a && a.removeAttribute("aria-invalid")
  10762. }
  10763. function m(a) {
  10764. var b = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog", u).output({
  10765. id: CKEDITOR.tools.getNextNumber(),
  10766. editorId: a.id,
  10767. langDir: a.lang.dir,
  10768. langCode: a.langCode,
  10769. editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog",
  10770. closeTitle: a.lang.common.close,
  10771. hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : ""
  10772. })),
  10773. c = b.getChild([0, 0, 0, 0, 0]),
  10774. d = c.getChild(0),
  10775. e = c.getChild(1);
  10776. a.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c);
  10777. !CKEDITOR.env.ie || CKEDITOR.env.quirks ||
  10778. CKEDITOR.env.edge || (a = "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())", CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"' + a + '" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(c.getParent()));
  10779. d.unselectable();
  10780. e.unselectable();
  10781. return {
  10782. element: b,
  10783. parts: {
  10784. dialog: b.getChild(0),
  10785. title: d,
  10786. close: e,
  10787. tabs: c.getChild(2),
  10788. contents: c.getChild([3, 0, 0, 0]),
  10789. footer: c.getChild([3, 0, 1, 0])
  10790. }
  10791. }
  10792. }
  10793. function l(a,
  10794. b, c) {
  10795. this.element = b;
  10796. this.focusIndex = c;
  10797. this.tabIndex = 0;
  10798. this.isFocusable = function() {
  10799. return !b.getAttribute("disabled") && b.isVisible()
  10800. };
  10801. this.focus = function() {
  10802. a._.currentFocusIndex = this.focusIndex;
  10803. this.element.focus()
  10804. };
  10805. b.on("keydown", function(a) {
  10806. a.data.getKeystroke() in {
  10807. 32: 1,
  10808. 13: 1
  10809. } && this.fire("click")
  10810. });
  10811. b.on("focus", function() {
  10812. this.fire("mouseover")
  10813. });
  10814. b.on("blur", function() {
  10815. this.fire("mouseout")
  10816. })
  10817. }
  10818. function d(a) {
  10819. function b() {
  10820. a.layout()
  10821. }
  10822. var c = CKEDITOR.document.getWindow();
  10823. c.on("resize", b);
  10824. a.on("hide", function() {
  10825. c.removeListener("resize",
  10826. b)
  10827. })
  10828. }
  10829. function h(a, b) {
  10830. this._ = {
  10831. dialog: a
  10832. };
  10833. CKEDITOR.tools.extend(this, b)
  10834. }
  10835. function k(a) {
  10836. function b(c) {
  10837. var k = a.getSize(),
  10838. l = CKEDITOR.document.getWindow().getViewPaneSize(),
  10839. m = c.data.$.screenX,
  10840. n = c.data.$.screenY,
  10841. p = m - d.x,
  10842. r = n - d.y;
  10843. d = {
  10844. x: m,
  10845. y: n
  10846. };
  10847. e.x += p;
  10848. e.y += r;
  10849. a.move(e.x + h[3] < g ? -h[3] : e.x - h[1] > l.width - k.width - g ? l.width - k.width + ("rtl" == f.lang.dir ? 0 : h[1]) : e.x, e.y + h[0] < g ? -h[0] : e.y - h[2] > l.height - k.height - g ? l.height - k.height + h[2] : e.y, 1);
  10850. c.data.preventDefault()
  10851. }
  10852. function c() {
  10853. CKEDITOR.document.removeListener("mousemove",
  10854. b);
  10855. CKEDITOR.document.removeListener("mouseup", c);
  10856. if (CKEDITOR.env.ie6Compat) {
  10857. var a = x.getChild(0).getFrameDocument();
  10858. a.removeListener("mousemove", b);
  10859. a.removeListener("mouseup", c)
  10860. }
  10861. }
  10862. var d = null,
  10863. e = null,
  10864. f = a.getParentEditor(),
  10865. g = f.config.dialog_magnetDistance,
  10866. h = CKEDITOR.skin.margins || [0, 0, 0, 0];
  10867. "undefined" == typeof g && (g = 20);
  10868. a.parts.title.on("mousedown", function(f) {
  10869. d = {
  10870. x: f.data.$.screenX,
  10871. y: f.data.$.screenY
  10872. };
  10873. CKEDITOR.document.on("mousemove", b);
  10874. CKEDITOR.document.on("mouseup", c);
  10875. e = a.getPosition();
  10876. if (CKEDITOR.env.ie6Compat) {
  10877. var g =
  10878. x.getChild(0).getFrameDocument();
  10879. g.on("mousemove", b);
  10880. g.on("mouseup", c)
  10881. }
  10882. f.data.preventDefault()
  10883. }, a)
  10884. }
  10885. function g(a) {
  10886. function b(c) {
  10887. var n = "rtl" == f.lang.dir,
  10888. p = m.width,
  10889. r = m.height,
  10890. v = p + (c.data.$.screenX - l.x) * (n ? -1 : 1) * (a._.moved ? 1 : 2),
  10891. t = r + (c.data.$.screenY - l.y) * (a._.moved ? 1 : 2),
  10892. z = a._.element.getFirst(),
  10893. z = n && z.getComputedStyle("right"),
  10894. q = a.getPosition();
  10895. q.y + t > k.height && (t = k.height - q.y);
  10896. (n ? z : q.x) + v > k.width && (v = k.width - (n ? z : q.x));
  10897. if (e == CKEDITOR.DIALOG_RESIZE_WIDTH || e == CKEDITOR.DIALOG_RESIZE_BOTH) p = Math.max(d.minWidth ||
  10898. 0, v - g);
  10899. if (e == CKEDITOR.DIALOG_RESIZE_HEIGHT || e == CKEDITOR.DIALOG_RESIZE_BOTH) r = Math.max(d.minHeight || 0, t - h);
  10900. a.resize(p, r);
  10901. a._.moved || a.layout();
  10902. c.data.preventDefault()
  10903. }
  10904. function c() {
  10905. CKEDITOR.document.removeListener("mouseup", c);
  10906. CKEDITOR.document.removeListener("mousemove", b);
  10907. n && (n.remove(), n = null);
  10908. if (CKEDITOR.env.ie6Compat) {
  10909. var a = x.getChild(0).getFrameDocument();
  10910. a.removeListener("mouseup", c);
  10911. a.removeListener("mousemove", b)
  10912. }
  10913. }
  10914. var d = a.definition,
  10915. e = d.resizable;
  10916. if (e != CKEDITOR.DIALOG_RESIZE_NONE) {
  10917. var f = a.getParentEditor(),
  10918. g, h, k, l, m, n, p = CKEDITOR.tools.addFunction(function(d) {
  10919. m = a.getSize();
  10920. var e = a.parts.contents;
  10921. e.$.getElementsByTagName("iframe").length && (n = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%;"\x3e\x3c/div\x3e'), e.append(n));
  10922. h = m.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks));
  10923. g = m.width - a.parts.contents.getSize("width", 1);
  10924. l = {
  10925. x: d.screenX,
  10926. y: d.screenY
  10927. };
  10928. k = CKEDITOR.document.getWindow().getViewPaneSize();
  10929. CKEDITOR.document.on("mousemove", b);
  10930. CKEDITOR.document.on("mouseup", c);
  10931. CKEDITOR.env.ie6Compat && (e = x.getChild(0).getFrameDocument(), e.on("mousemove", b), e.on("mouseup", c));
  10932. d.preventDefault && d.preventDefault()
  10933. });
  10934. a.on("load", function() {
  10935. var b = "";
  10936. e == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = " cke_resizer_horizontal" : e == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical");
  10937. b = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer' + b + " cke_resizer_" + f.lang.dir + '" title\x3d"' + CKEDITOR.tools.htmlEncode(f.lang.common.resize) +
  10938. '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + p + ', event )"\x3e' + ("ltr" == f.lang.dir ? "◢" : "◣") + "\x3c/div\x3e");
  10939. a.parts.footer.append(b, 1)
  10940. });
  10941. f.on("destroy", function() {
  10942. CKEDITOR.tools.removeFunction(p)
  10943. })
  10944. }
  10945. }
  10946. function n(a) {
  10947. a.data.preventDefault(1)
  10948. }
  10949. function w(a) {
  10950. var b = CKEDITOR.document.getWindow(),
  10951. c = a.config,
  10952. d = CKEDITOR.skinName || a.config.skin,
  10953. e = c.dialog_backgroundCoverColor || ("moono-lisa" == d ? "black" : "white"),
  10954. d = c.dialog_backgroundCoverOpacity,
  10955. f = c.baseFloatZIndex,
  10956. c = CKEDITOR.tools.genKey(e, d, f),
  10957. g = D[c];
  10958. g ? g.show() :
  10959. (f = ['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ', CKEDITOR.env.ie6Compat ? "absolute" : "fixed", "; z-index: ", f, "; top: 0px; left: 0px; ", CKEDITOR.env.ie6Compat ? "" : "background-color: " + e, '" class\x3d"cke_dialog_background_cover"\x3e'], CKEDITOR.env.ie6Compat && (e = "\x3chtml\x3e\x3cbody style\x3d\\'background-color:" + e + ";\\'\x3e\x3c/body\x3e\x3c/html\x3e", f.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'), f.push("void((function(){" + encodeURIComponent("document.open();(" +
  10960. CKEDITOR.tools.fixDomain + ")();document.write( '" + e + "' );document.close();") + "})())"), f.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')), f.push("\x3c/div\x3e"), g = CKEDITOR.dom.element.createFromHtml(f.join("")), g.setOpacity(void 0 !== d ? d : .5), g.on("keydown", n), g.on("keypress", n), g.on("keyup", n), g.appendTo(CKEDITOR.document.getBody()), D[c] = g);
  10961. a.focusManager.add(g);
  10962. x = g;
  10963. a = function() {
  10964. var a = b.getViewPaneSize();
  10965. g.setStyles({
  10966. width: a.width + "px",
  10967. height: a.height + "px"
  10968. })
  10969. };
  10970. var h = function() {
  10971. var a = b.getScrollPosition(),
  10972. c = CKEDITOR.dialog._.currentTop;
  10973. g.setStyles({
  10974. left: a.x + "px",
  10975. top: a.y + "px"
  10976. });
  10977. if (c) {
  10978. do a = c.getPosition(), c.move(a.x, a.y); while (c = c._.parentDialog)
  10979. }
  10980. };
  10981. y = a;
  10982. b.on("resize", a);
  10983. a();
  10984. CKEDITOR.env.mac && CKEDITOR.env.webkit || g.focus();
  10985. if (CKEDITOR.env.ie6Compat) {
  10986. var k = function() {
  10987. h();
  10988. arguments.callee.prevScrollHandler.apply(this, arguments)
  10989. };
  10990. b.$.setTimeout(function() {
  10991. k.prevScrollHandler = window.onscroll || function() {};
  10992. window.onscroll = k
  10993. }, 0);
  10994. h()
  10995. }
  10996. }
  10997. function q(a) {
  10998. x && (a.focusManager.remove(x), a = CKEDITOR.document.getWindow(), x.hide(), a.removeListener("resize", y), CKEDITOR.env.ie6Compat && a.$.setTimeout(function() {
  10999. window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null
  11000. }, 0), y = null)
  11001. }
  11002. var v = CKEDITOR.tools.cssLength,
  11003. u = '\x3cdiv class\x3d"cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog ' +
  11004. CKEDITOR.env.cssClass + ' cke_{langDir}" style\x3d"position:absolute" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e';
  11005. CKEDITOR.dialog = function(b, d) {
  11006. function h() {
  11007. var a = x._.focusList;
  11008. a.sort(function(a, b) {
  11009. return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex
  11010. });
  11011. for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
  11012. }
  11013. function l(a) {
  11014. var b = x._.focusList;
  11015. a = a || 0;
  11016. if (!(1 > b.length)) {
  11017. var c = x._.currentFocusIndex;
  11018. x._.tabBarMode && 0 > a && (c = 0);
  11019. try {
  11020. b[c].getInputElement().$.blur()
  11021. } catch (d) {}
  11022. var e = c,
  11023. f = 1 < x._.pageCount;
  11024. do {
  11025. e += a;
  11026. if (f && !x._.tabBarMode && (e == b.length || -1 == e)) {
  11027. x._.tabBarMode = !0;
  11028. x._.tabs[x._.currentTabId][0].focus();
  11029. x._.currentFocusIndex = -1;
  11030. return
  11031. }
  11032. e = (e + b.length) % b.length;
  11033. if (e == c) break
  11034. } while (a && !b[e].isFocusable());
  11035. b[e].focus();
  11036. "text" == b[e].type && b[e].select()
  11037. }
  11038. }
  11039. function n(c) {
  11040. if (x == CKEDITOR.dialog._.currentTop) {
  11041. var d = c.data.getKeystroke(),
  11042. e = "rtl" == b.lang.dir,
  11043. g = [37, 38, 39, 40];
  11044. y = w = 0;
  11045. if (9 == d || d == CKEDITOR.SHIFT + 9) l(d == CKEDITOR.SHIFT + 9 ? -1 : 1), y = 1;
  11046. else if (d == CKEDITOR.ALT + 121 && !x._.tabBarMode && 1 < x.getPageCount()) x._.tabBarMode = !0, x._.tabs[x._.currentTabId][0].focus(), x._.currentFocusIndex = -1, y = 1;
  11047. else if (-1 != CKEDITOR.tools.indexOf(g,
  11048. d) && x._.tabBarMode) d = -1 != CKEDITOR.tools.indexOf([e ? 39 : 37, 38], d) ? a.call(x) : f.call(x), x.selectPage(d), x._.tabs[d][0].focus(), y = 1;
  11049. else if (13 != d && 32 != d || !x._.tabBarMode)
  11050. if (13 == d) d = c.data.getTarget(), d.is("a", "button", "select", "textarea") || d.is("input") && "button" == d.$.type || ((d = this.getButton("ok")) && CKEDITOR.tools.setTimeout(d.click, 0, d), y = 1), w = 1;
  11051. else if (27 == d)(d = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(d.click, 0, d) : !1 !== this.fire("cancel", {
  11052. hide: !0
  11053. }).hide && this.hide(), w = 1;
  11054. else return;
  11055. else this.selectPage(this._.currentTabId),
  11056. this._.tabBarMode = !1, this._.currentFocusIndex = -1, l(1), y = 1;
  11057. p(c)
  11058. }
  11059. }
  11060. function p(a) {
  11061. y ? a.data.preventDefault(1) : w && a.data.stopPropagation()
  11062. }
  11063. var v = CKEDITOR.dialog._.dialogDefinitions[d],
  11064. z = CKEDITOR.tools.clone(r),
  11065. q = b.config.dialog_buttonsOrder || "OS",
  11066. u = b.lang.dir,
  11067. B = {},
  11068. y, w;
  11069. ("OS" == q && CKEDITOR.env.mac || "rtl" == q && "ltr" == u || "ltr" == q && "rtl" == u) && z.buttons.reverse();
  11070. v = CKEDITOR.tools.extend(v(b), z);
  11071. v = CKEDITOR.tools.clone(v);
  11072. v = new t(this, v);
  11073. z = m(b);
  11074. this._ = {
  11075. editor: b,
  11076. element: z.element,
  11077. name: d,
  11078. contentSize: {
  11079. width: 0,
  11080. height: 0
  11081. },
  11082. size: {
  11083. width: 0,
  11084. height: 0
  11085. },
  11086. contents: {},
  11087. buttons: {},
  11088. accessKeyMap: {},
  11089. tabs: {},
  11090. tabIdList: [],
  11091. currentTabId: null,
  11092. currentTabIndex: null,
  11093. pageCount: 0,
  11094. lastTab: null,
  11095. tabBarMode: !1,
  11096. focusList: [],
  11097. currentFocusIndex: 0,
  11098. hasFocus: !1
  11099. };
  11100. this.parts = z.parts;
  11101. CKEDITOR.tools.setTimeout(function() {
  11102. b.fire("ariaWidget", this.parts.contents)
  11103. }, 0, this);
  11104. z = {
  11105. position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed",
  11106. top: 0,
  11107. visibility: "hidden"
  11108. };
  11109. z["rtl" == u ? "right" : "left"] = 0;
  11110. this.parts.dialog.setStyles(z);
  11111. CKEDITOR.event.call(this);
  11112. this.definition = v = CKEDITOR.fire("dialogDefinition", {
  11113. name: d,
  11114. definition: v
  11115. }, b).definition;
  11116. if (!("removeDialogTabs" in b._) && b.config.removeDialogTabs) {
  11117. z = b.config.removeDialogTabs.split(";");
  11118. for (u = 0; u < z.length; u++)
  11119. if (q = z[u].split(":"), 2 == q.length) {
  11120. var D = q[0];
  11121. B[D] || (B[D] = []);
  11122. B[D].push(q[1])
  11123. }
  11124. b._.removeDialogTabs = B
  11125. }
  11126. if (b._.removeDialogTabs && (B = b._.removeDialogTabs[d]))
  11127. for (u = 0; u < B.length; u++) v.removeContents(B[u]);
  11128. if (v.onLoad) this.on("load", v.onLoad);
  11129. if (v.onShow) this.on("show", v.onShow);
  11130. if (v.onHide) this.on("hide", v.onHide);
  11131. if (v.onOk) this.on("ok", function(a) {
  11132. b.fire("saveSnapshot");
  11133. setTimeout(function() {
  11134. b.fire("saveSnapshot")
  11135. }, 0);
  11136. !1 === v.onOk.call(this, a) && (a.data.hide = !1)
  11137. });
  11138. this.state = CKEDITOR.DIALOG_STATE_IDLE;
  11139. if (v.onCancel) this.on("cancel", function(a) {
  11140. !1 === v.onCancel.call(this, a) && (a.data.hide = !1)
  11141. });
  11142. var x = this,
  11143. A = function(a) {
  11144. var b = x._.contents,
  11145. c = !1,
  11146. d;
  11147. for (d in b)
  11148. for (var e in b[d])
  11149. if (c = a.call(this, b[d][e])) return
  11150. };
  11151. this.on("ok", function(a) {
  11152. A(function(b) {
  11153. if (b.validate) {
  11154. var d = b.validate(this),
  11155. e = "string" == typeof d || !1 === d;
  11156. e && (a.data.hide = !1, a.stop());
  11157. c.call(b, !e, "string" == typeof d ?
  11158. d : void 0);
  11159. return e
  11160. }
  11161. })
  11162. }, this, null, 0);
  11163. this.on("cancel", function(a) {
  11164. A(function(c) {
  11165. if (c.isChanged()) return b.config.dialog_noConfirmCancel || confirm(b.lang.common.confirmCancel) || (a.data.hide = !1), !0
  11166. })
  11167. }, this, null, 0);
  11168. this.parts.close.on("click", function(a) {
  11169. !1 !== this.fire("cancel", {
  11170. hide: !0
  11171. }).hide && this.hide();
  11172. a.data.preventDefault()
  11173. }, this);
  11174. this.changeFocus = l;
  11175. var C = this._.element;
  11176. b.focusManager.add(C, 1);
  11177. this.on("show", function() {
  11178. C.on("keydown", n, this);
  11179. if (CKEDITOR.env.gecko) C.on("keypress", p, this)
  11180. });
  11181. this.on("hide",
  11182. function() {
  11183. C.removeListener("keydown", n);
  11184. CKEDITOR.env.gecko && C.removeListener("keypress", p);
  11185. A(function(a) {
  11186. e.apply(a)
  11187. })
  11188. });
  11189. this.on("iframeAdded", function(a) {
  11190. (new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", n, this, null, 0)
  11191. });
  11192. this.on("show", function() {
  11193. h();
  11194. var a = 1 < x._.pageCount;
  11195. b.config.dialog_startupFocusTab && a ? (x._.tabBarMode = !0, x._.tabs[x._.currentTabId][0].focus(), x._.currentFocusIndex = -1) : this._.hasFocus || (this._.currentFocusIndex = a ? -1 : this._.focusList.length - 1, v.onFocus ?
  11196. (a = v.onFocus.call(this)) && a.focus() : l(1))
  11197. }, this, null, 4294967295);
  11198. if (CKEDITOR.env.ie6Compat) this.on("load", function() {
  11199. var a = this.getElement(),
  11200. b = a.getFirst();
  11201. b.remove();
  11202. b.appendTo(a)
  11203. }, this);
  11204. k(this);
  11205. g(this);
  11206. (new CKEDITOR.dom.text(v.title, CKEDITOR.document)).appendTo(this.parts.title);
  11207. for (u = 0; u < v.contents.length; u++)(B = v.contents[u]) && this.addPage(B);
  11208. this.parts.tabs.on("click", function(a) {
  11209. var b = a.data.getTarget();
  11210. b.hasClass("cke_dialog_tab") && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf("_"))),
  11211. this._.tabBarMode && (this._.tabBarMode = !1, this._.currentFocusIndex = -1, l(1)), a.data.preventDefault())
  11212. }, this);
  11213. u = [];
  11214. B = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, {
  11215. type: "hbox",
  11216. className: "cke_dialog_footer_buttons",
  11217. widths: [],
  11218. children: v.buttons
  11219. }, u).getChild();
  11220. this.parts.footer.setHtml(u.join(""));
  11221. for (u = 0; u < B.length; u++) this._.buttons[B[u].id] = B[u]
  11222. };
  11223. CKEDITOR.dialog.prototype = {
  11224. destroy: function() {
  11225. this.hide();
  11226. this._.element.remove()
  11227. },
  11228. resize: function() {
  11229. return function(a, b) {
  11230. this._.contentSize && this._.contentSize.width ==
  11231. a && this._.contentSize.height == b || (CKEDITOR.dialog.fire("resize", {
  11232. dialog: this,
  11233. width: a,
  11234. height: b
  11235. }, this._.editor), this.fire("resize", {
  11236. width: a,
  11237. height: b
  11238. }, this._.editor), this.parts.contents.setStyles({
  11239. width: a + "px",
  11240. height: b + "px"
  11241. }), "rtl" == this._.editor.lang.dir && this._.position && (this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle("right"), 10)), this._.contentSize = {
  11242. width: a,
  11243. height: b
  11244. })
  11245. }
  11246. }(),
  11247. getSize: function() {
  11248. var a = this._.element.getFirst();
  11249. return {
  11250. width: a.$.offsetWidth || 0,
  11251. height: a.$.offsetHeight || 0
  11252. }
  11253. },
  11254. move: function(a, b, c) {
  11255. var d = this._.element.getFirst(),
  11256. e = "rtl" == this._.editor.lang.dir,
  11257. f = "fixed" == d.getComputedStyle("position");
  11258. CKEDITOR.env.ie && d.setStyle("zoom", "100%");
  11259. f && this._.position && this._.position.x == a && this._.position.y == b || (this._.position = {
  11260. x: a,
  11261. y: b
  11262. }, f || (f = CKEDITOR.document.getWindow().getScrollPosition(), a += f.x, b += f.y), e && (f = this.getSize(), a = CKEDITOR.document.getWindow().getViewPaneSize().width - f.width - a), b = {
  11263. top: (0 < b ? b : 0) + "px"
  11264. },
  11265. b[e ? "right" : "left"] = (0 < a ? a : 0) + "px", d.setStyles(b), c && (this._.moved = 1))
  11266. },
  11267. getPosition: function() {
  11268. return CKEDITOR.tools.extend({}, this._.position)
  11269. },
  11270. show: function() {
  11271. var a = this._.element,
  11272. b = this.definition;
  11273. a.getParent() && a.getParent().equals(CKEDITOR.document.getBody()) ? a.setStyle("display", "block") : a.appendTo(CKEDITOR.document.getBody());
  11274. this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight);
  11275. this.reset();
  11276. this.selectPage(this.definition.contents[0].id);
  11277. null === CKEDITOR.dialog._.currentZIndex && (CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex);
  11278. this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex += 10);
  11279. null === CKEDITOR.dialog._.currentTop ? (CKEDITOR.dialog._.currentTop = this, this._.parentDialog = null, w(this._.editor)) : (this._.parentDialog = CKEDITOR.dialog._.currentTop, this._.parentDialog.getElement().getFirst().$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex / 2), CKEDITOR.dialog._.currentTop = this);
  11280. a.on("keydown", C);
  11281. a.on("keyup", F);
  11282. this._.hasFocus = !1;
  11283. for (var c in b.contents)
  11284. if (b.contents[c]) {
  11285. var a = b.contents[c],
  11286. e = this._.tabs[a.id],
  11287. f = a.requiredContent,
  11288. g = 0;
  11289. if (e) {
  11290. for (var h in this._.contents[a.id]) {
  11291. var k = this._.contents[a.id][h];
  11292. "hbox" != k.type && "vbox" != k.type && k.getInputElement() && (k.requiredContent && !this._.editor.activeFilter.check(k.requiredContent) ? k.disable() : (k.enable(), g++))
  11293. }!g || f && !this._.editor.activeFilter.check(f) ? e[0].addClass("cke_dialog_tab_disabled") : e[0].removeClass("cke_dialog_tab_disabled")
  11294. }
  11295. }
  11296. CKEDITOR.tools.setTimeout(function() {
  11297. this.layout();
  11298. d(this);
  11299. this.parts.dialog.setStyle("visibility", "");
  11300. this.fireOnce("load", {});
  11301. CKEDITOR.ui.fire("ready", this);
  11302. this.fire("show", {});
  11303. this._.editor.fire("dialogShow", this);
  11304. this._.parentDialog || this._.editor.focusManager.lock();
  11305. this.foreach(function(a) {
  11306. a.setInitValue && a.setInitValue()
  11307. })
  11308. }, 100, this)
  11309. },
  11310. layout: function() {
  11311. var a = this.parts.dialog,
  11312. b = this.getSize(),
  11313. c = CKEDITOR.document.getWindow().getViewPaneSize(),
  11314. d = (c.width - b.width) / 2,
  11315. e = (c.height - b.height) / 2;
  11316. CKEDITOR.env.ie6Compat || (b.height + (0 < e ? e : 0) > c.height ||
  11317. b.width + (0 < d ? d : 0) > c.width ? a.setStyle("position", "absolute") : a.setStyle("position", "fixed"));
  11318. this.move(this._.moved ? this._.position.x : d, this._.moved ? this._.position.y : e)
  11319. },
  11320. foreach: function(a) {
  11321. for (var b in this._.contents)
  11322. for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
  11323. return this
  11324. },
  11325. reset: function() {
  11326. var a = function(a) {
  11327. a.reset && a.reset(1)
  11328. };
  11329. return function() {
  11330. this.foreach(a);
  11331. return this
  11332. }
  11333. }(),
  11334. setupContent: function() {
  11335. var a = arguments;
  11336. this.foreach(function(b) {
  11337. b.setup && b.setup.apply(b, a)
  11338. })
  11339. },
  11340. commitContent: function() {
  11341. var a = arguments;
  11342. this.foreach(function(b) {
  11343. CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
  11344. b.commit && b.commit.apply(b, a)
  11345. })
  11346. },
  11347. hide: function() {
  11348. if (this.parts.dialog.isVisible()) {
  11349. this.fire("hide", {});
  11350. this._.editor.fire("dialogHide", this);
  11351. this.selectPage(this._.tabIdList[0]);
  11352. var a = this._.element;
  11353. a.setStyle("display", "none");
  11354. this.parts.dialog.setStyle("visibility", "hidden");
  11355. for (I(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
  11356. if (this._.parentDialog) {
  11357. var b = this._.parentDialog.getElement().getFirst();
  11358. b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2))
  11359. } else q(this._.editor);
  11360. if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex -= 10;
  11361. else {
  11362. CKEDITOR.dialog._.currentZIndex = null;
  11363. a.removeListener("keydown", C);
  11364. a.removeListener("keyup", F);
  11365. var c = this._.editor;
  11366. c.focus();
  11367. setTimeout(function() {
  11368. c.focusManager.unlock();
  11369. CKEDITOR.env.iOS && c.window.focus()
  11370. }, 0)
  11371. }
  11372. delete this._.parentDialog;
  11373. this.foreach(function(a) {
  11374. a.resetInitValue && a.resetInitValue()
  11375. });
  11376. this.setState(CKEDITOR.DIALOG_STATE_IDLE)
  11377. }
  11378. },
  11379. addPage: function(a) {
  11380. if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
  11381. for (var b = [], c = a.label ? ' title\x3d"' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", d = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, {
  11382. type: "vbox",
  11383. className: "cke_dialog_page_contents",
  11384. children: a.elements,
  11385. expand: !!a.expand,
  11386. padding: a.padding,
  11387. style: a.style || "width: 100%;"
  11388. }, b), e = this._.contents[a.id] = {}, f = d.getChild(),
  11389. g = 0; d = f.shift();) d.notAllowed || "hbox" == d.type || "vbox" == d.type || g++, e[d.id] = d, "function" == typeof d.getChild && f.push.apply(f, d.getChild());
  11390. g || (a.hidden = !0);
  11391. b = CKEDITOR.dom.element.createFromHtml(b.join(""));
  11392. b.setAttribute("role", "tabpanel");
  11393. d = CKEDITOR.env;
  11394. e = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
  11395. c = CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"', 0 < this._.pageCount ? " cke_last" : "cke_first", c, a.hidden ? ' style\x3d"display:none"' : "", ' id\x3d"', e, '"', d.gecko && !d.hc ? "" : ' href\x3d"javascript:void(0)"',
  11396. ' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e', a.label, "\x3c/a\x3e"
  11397. ].join(""));
  11398. b.setAttribute("aria-labelledby", e);
  11399. this._.tabs[a.id] = [c, b];
  11400. this._.tabIdList.push(a.id);
  11401. !a.hidden && this._.pageCount++;
  11402. this._.lastTab = c;
  11403. this.updateStyle();
  11404. b.setAttribute("name", a.id);
  11405. b.appendTo(this.parts.contents);
  11406. c.unselectable();
  11407. this.parts.tabs.append(c);
  11408. a.accessKey && (G(this, this, "CTRL+" + a.accessKey, K, H), this._.accessKeyMap["CTRL+" + a.accessKey] = a.id)
  11409. }
  11410. },
  11411. selectPage: function(a) {
  11412. if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") &&
  11413. !1 !== this.fire("selectPage", {
  11414. page: a,
  11415. currentPage: this._.currentTabId
  11416. })) {
  11417. for (var c in this._.tabs) {
  11418. var d = this._.tabs[c][0],
  11419. e = this._.tabs[c][1];
  11420. c != a && (d.removeClass("cke_dialog_tab_selected"), e.hide());
  11421. e.setAttribute("aria-hidden", c != a)
  11422. }
  11423. var f = this._.tabs[a];
  11424. f[0].addClass("cke_dialog_tab_selected");
  11425. CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ? (b(f[1]), f[1].show(), setTimeout(function() {
  11426. b(f[1], 1)
  11427. }, 0)) : f[1].show();
  11428. this._.currentTabId = a;
  11429. this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
  11430. }
  11431. },
  11432. updateStyle: function() {
  11433. this.parts.dialog[(1 === this._.pageCount ? "add" : "remove") + "Class"]("cke_single_page")
  11434. },
  11435. hidePage: function(b) {
  11436. var c = this._.tabs[b] && this._.tabs[b][0];
  11437. c && 1 != this._.pageCount && c.isVisible() && (b == this._.currentTabId && this.selectPage(a.call(this)), c.hide(), this._.pageCount--, this.updateStyle())
  11438. },
  11439. showPage: function(a) {
  11440. if (a = this._.tabs[a] && this._.tabs[a][0]) a.show(), this._.pageCount++, this.updateStyle()
  11441. },
  11442. getElement: function() {
  11443. return this._.element
  11444. },
  11445. getName: function() {
  11446. return this._.name
  11447. },
  11448. getContentElement: function(a, b) {
  11449. var c = this._.contents[a];
  11450. return c && c[b]
  11451. },
  11452. getValueOf: function(a, b) {
  11453. return this.getContentElement(a, b).getValue()
  11454. },
  11455. setValueOf: function(a, b, c) {
  11456. return this.getContentElement(a, b).setValue(c)
  11457. },
  11458. getButton: function(a) {
  11459. return this._.buttons[a]
  11460. },
  11461. click: function(a) {
  11462. return this._.buttons[a].click()
  11463. },
  11464. disableButton: function(a) {
  11465. return this._.buttons[a].disable()
  11466. },
  11467. enableButton: function(a) {
  11468. return this._.buttons[a].enable()
  11469. },
  11470. getPageCount: function() {
  11471. return this._.pageCount
  11472. },
  11473. getParentEditor: function() {
  11474. return this._.editor
  11475. },
  11476. getSelectedElement: function() {
  11477. return this.getParentEditor().getSelection().getSelectedElement()
  11478. },
  11479. addFocusable: function(a, b) {
  11480. if ("undefined" == typeof b) b = this._.focusList.length, this._.focusList.push(new l(this, a, b));
  11481. else {
  11482. this._.focusList.splice(b, 0, new l(this, a, b));
  11483. for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++
  11484. }
  11485. },
  11486. setState: function(a) {
  11487. if (this.state != a) {
  11488. this.state = a;
  11489. if (a == CKEDITOR.DIALOG_STATE_BUSY) {
  11490. if (!this.parts.spinner) {
  11491. var b = this.getParentEditor().lang.dir,
  11492. c = {
  11493. attributes: {
  11494. "class": "cke_dialog_spinner"
  11495. },
  11496. styles: {
  11497. "float": "rtl" == b ? "right" : "left"
  11498. }
  11499. };
  11500. c.styles["margin-" + ("rtl" == b ? "left" : "right")] = "8px";
  11501. this.parts.spinner = CKEDITOR.document.createElement("div", c);
  11502. this.parts.spinner.setHtml("\x26#8987;");
  11503. this.parts.spinner.appendTo(this.parts.title, 1)
  11504. }
  11505. this.parts.spinner.show();
  11506. this.getButton("ok").disable()
  11507. } else a == CKEDITOR.DIALOG_STATE_IDLE && (this.parts.spinner && this.parts.spinner.hide(), this.getButton("ok").enable());
  11508. this.fire("state", a)
  11509. }
  11510. }
  11511. };
  11512. CKEDITOR.tools.extend(CKEDITOR.dialog, {
  11513. add: function(a, b) {
  11514. this._.dialogDefinitions[a] &&
  11515. "function" != typeof b || (this._.dialogDefinitions[a] = b)
  11516. },
  11517. exists: function(a) {
  11518. return !!this._.dialogDefinitions[a]
  11519. },
  11520. getCurrent: function() {
  11521. return CKEDITOR.dialog._.currentTop
  11522. },
  11523. isTabEnabled: function(a, b, c) {
  11524. a = a.config.removeDialogTabs;
  11525. return !(a && a.match(new RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)", "i")))
  11526. },
  11527. okButton: function() {
  11528. var a = function(a, b) {
  11529. b = b || {};
  11530. return CKEDITOR.tools.extend({
  11531. id: "ok",
  11532. type: "button",
  11533. label: a.lang.common.ok,
  11534. "class": "cke_dialog_ui_button_ok",
  11535. onClick: function(a) {
  11536. a = a.data.dialog;
  11537. !1 !== a.fire("ok", {
  11538. hide: !0
  11539. }).hide && a.hide()
  11540. }
  11541. }, b, !0)
  11542. };
  11543. a.type = "button";
  11544. a.override = function(b) {
  11545. return CKEDITOR.tools.extend(function(c) {
  11546. return a(c, b)
  11547. }, {
  11548. type: "button"
  11549. }, !0)
  11550. };
  11551. return a
  11552. }(),
  11553. cancelButton: function() {
  11554. var a = function(a, b) {
  11555. b = b || {};
  11556. return CKEDITOR.tools.extend({
  11557. id: "cancel",
  11558. type: "button",
  11559. label: a.lang.common.cancel,
  11560. "class": "cke_dialog_ui_button_cancel",
  11561. onClick: function(a) {
  11562. a = a.data.dialog;
  11563. !1 !== a.fire("cancel", {
  11564. hide: !0
  11565. }).hide && a.hide()
  11566. }
  11567. }, b, !0)
  11568. };
  11569. a.type = "button";
  11570. a.override = function(b) {
  11571. return CKEDITOR.tools.extend(function(c) {
  11572. return a(c,
  11573. b)
  11574. }, {
  11575. type: "button"
  11576. }, !0)
  11577. };
  11578. return a
  11579. }(),
  11580. addUIElement: function(a, b) {
  11581. this._.uiElementBuilders[a] = b
  11582. }
  11583. });
  11584. CKEDITOR.dialog._ = {
  11585. uiElementBuilders: {},
  11586. dialogDefinitions: {},
  11587. currentTop: null,
  11588. currentZIndex: null
  11589. };
  11590. CKEDITOR.event.implementOn(CKEDITOR.dialog);
  11591. CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
  11592. var r = {
  11593. resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
  11594. minWidth: 600,
  11595. minHeight: 400,
  11596. buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton]
  11597. },
  11598. p = function(a, b, c) {
  11599. for (var d = 0, e; e = a[d]; d++)
  11600. if (e.id == b || c && e[c] && (e = p(e[c],
  11601. b, c))) return e;
  11602. return null
  11603. },
  11604. z = function(a, b, c, d, e) {
  11605. if (c) {
  11606. for (var f = 0, g; g = a[f]; f++) {
  11607. if (g.id == c) return a.splice(f, 0, b), b;
  11608. if (d && g[d] && (g = z(g[d], b, c, d, !0))) return g
  11609. }
  11610. if (e) return null
  11611. }
  11612. a.push(b);
  11613. return b
  11614. },
  11615. B = function(a, b, c) {
  11616. for (var d = 0, e; e = a[d]; d++) {
  11617. if (e.id == b) return a.splice(d, 1);
  11618. if (c && e[c] && (e = B(e[c], b, c))) return e
  11619. }
  11620. return null
  11621. },
  11622. t = function(a, b) {
  11623. this.dialog = a;
  11624. for (var c = b.contents, d = 0, e; e = c[d]; d++) c[d] = e && new h(a, e);
  11625. CKEDITOR.tools.extend(this, b)
  11626. };
  11627. t.prototype = {
  11628. getContents: function(a) {
  11629. return p(this.contents,
  11630. a)
  11631. },
  11632. getButton: function(a) {
  11633. return p(this.buttons, a)
  11634. },
  11635. addContents: function(a, b) {
  11636. return z(this.contents, a, b)
  11637. },
  11638. addButton: function(a, b) {
  11639. return z(this.buttons, a, b)
  11640. },
  11641. removeContents: function(a) {
  11642. B(this.contents, a)
  11643. },
  11644. removeButton: function(a) {
  11645. B(this.buttons, a)
  11646. }
  11647. };
  11648. h.prototype = {
  11649. get: function(a) {
  11650. return p(this.elements, a, "children")
  11651. },
  11652. add: function(a, b) {
  11653. return z(this.elements, a, b, "children")
  11654. },
  11655. remove: function(a) {
  11656. B(this.elements, a, "children")
  11657. }
  11658. };
  11659. var y, D = {},
  11660. x, A = {},
  11661. C = function(a) {
  11662. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  11663. c =
  11664. a.data.$.altKey,
  11665. d = a.data.$.shiftKey,
  11666. e = String.fromCharCode(a.data.$.keyCode);
  11667. (b = A[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + e]) && b.length && (b = b[b.length - 1], b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key), a.data.preventDefault())
  11668. },
  11669. F = function(a) {
  11670. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  11671. c = a.data.$.altKey,
  11672. d = a.data.$.shiftKey,
  11673. e = String.fromCharCode(a.data.$.keyCode);
  11674. (b = A[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + e]) && b.length && (b = b[b.length - 1], b.keyup && (b.keyup.call(b.uiElement, b.dialog, b.key),
  11675. a.data.preventDefault()))
  11676. },
  11677. G = function(a, b, c, d, e) {
  11678. (A[c] || (A[c] = [])).push({
  11679. uiElement: a,
  11680. dialog: b,
  11681. key: c,
  11682. keyup: e || a.accessKeyUp,
  11683. keydown: d || a.accessKeyDown
  11684. })
  11685. },
  11686. I = function(a) {
  11687. for (var b in A) {
  11688. for (var c = A[b], d = c.length - 1; 0 <= d; d--) c[d].dialog != a && c[d].uiElement != a || c.splice(d, 1);
  11689. 0 === c.length && delete A[b]
  11690. }
  11691. },
  11692. H = function(a, b) {
  11693. a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b])
  11694. },
  11695. K = function() {};
  11696. (function() {
  11697. CKEDITOR.ui.dialog = {
  11698. uiElement: function(a, b, c, d, e, f, g) {
  11699. if (!(4 > arguments.length)) {
  11700. var h = (d.call ? d(b) : d) || "div",
  11701. k = ["\x3c", h, " "],
  11702. l = (e && e.call ? e(b) : e) || {},
  11703. m = (f && f.call ? f(b) : f) || {},
  11704. n = (g && g.call ? g.call(this, a, b) : g) || "",
  11705. p = this.domId = m.id || CKEDITOR.tools.getNextId() + "_uiElement";
  11706. b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (l.display = "none", this.notAllowed = !0);
  11707. m.id = p;
  11708. var r = {};
  11709. b.type && (r["cke_dialog_ui_" + b.type] = 1);
  11710. b.className && (r[b.className] = 1);
  11711. b.disabled && (r.cke_disabled = 1);
  11712. for (var v = m["class"] && m["class"].split ? m["class"].split(" ") : [], p = 0; p < v.length; p++) v[p] && (r[v[p]] = 1);
  11713. v = [];
  11714. for (p in r) v.push(p);
  11715. m["class"] = v.join(" ");
  11716. b.title && (m.title = b.title);
  11717. r = (b.style || "").split(";");
  11718. b.align && (v = b.align, l["margin-left"] = "left" == v ? 0 : "auto", l["margin-right"] = "right" == v ? 0 : "auto");
  11719. for (p in l) r.push(p + ":" + l[p]);
  11720. b.hidden && r.push("display:none");
  11721. for (p = r.length - 1; 0 <= p; p--) "" === r[p] && r.splice(p, 1);
  11722. 0 < r.length && (m.style = (m.style ? m.style + "; " : "") + r.join("; "));
  11723. for (p in m) k.push(p + '\x3d"' + CKEDITOR.tools.htmlEncode(m[p]) + '" ');
  11724. k.push("\x3e", n, "\x3c/", h, "\x3e");
  11725. c.push(k.join(""));
  11726. (this._ || (this._ = {})).dialog = a;
  11727. "boolean" ==
  11728. typeof b.isChanged && (this.isChanged = function() {
  11729. return b.isChanged
  11730. });
  11731. "function" == typeof b.isChanged && (this.isChanged = b.isChanged);
  11732. "function" == typeof b.setValue && (this.setValue = CKEDITOR.tools.override(this.setValue, function(a) {
  11733. return function(c) {
  11734. a.call(this, b.setValue.call(this, c))
  11735. }
  11736. }));
  11737. "function" == typeof b.getValue && (this.getValue = CKEDITOR.tools.override(this.getValue, function(a) {
  11738. return function() {
  11739. return b.getValue.call(this, a.call(this))
  11740. }
  11741. }));
  11742. CKEDITOR.event.implementOn(this);
  11743. this.registerEvents(b);
  11744. this.accessKeyUp && this.accessKeyDown && b.accessKey && G(this, a, "CTRL+" + b.accessKey);
  11745. var t = this;
  11746. a.on("load", function() {
  11747. var b = t.getInputElement();
  11748. if (b) {
  11749. var c = t.type in {
  11750. checkbox: 1,
  11751. ratio: 1
  11752. } && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? "cke_dialog_ui_focused" : "";
  11753. b.on("focus", function() {
  11754. a._.tabBarMode = !1;
  11755. a._.hasFocus = !0;
  11756. t.fire("focus");
  11757. c && this.addClass(c)
  11758. });
  11759. b.on("blur", function() {
  11760. t.fire("blur");
  11761. c && this.removeClass(c)
  11762. })
  11763. }
  11764. });
  11765. CKEDITOR.tools.extend(this, b);
  11766. this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex =
  11767. a._.focusList.push(this) - 1, this.on("focus", function() {
  11768. a._.currentFocusIndex = t.focusIndex
  11769. }))
  11770. }
  11771. },
  11772. hbox: function(a, b, c, d, e) {
  11773. if (!(4 > arguments.length)) {
  11774. this._ || (this._ = {});
  11775. var f = this._.children = b,
  11776. g = e && e.widths || null,
  11777. h = e && e.height || null,
  11778. k, l = {
  11779. role: "presentation"
  11780. };
  11781. e && e.align && (l.align = e.align);
  11782. CKEDITOR.ui.dialog.uiElement.call(this, a, e || {
  11783. type: "hbox"
  11784. }, d, "table", {}, l, function() {
  11785. var a = ['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];
  11786. for (k = 0; k < c.length; k++) {
  11787. var b = "cke_dialog_ui_hbox_child",
  11788. d = [];
  11789. 0 === k &&
  11790. (b = "cke_dialog_ui_hbox_first");
  11791. k == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
  11792. a.push('\x3ctd class\x3d"', b, '" role\x3d"presentation" ');
  11793. g ? g[k] && d.push("width:" + v(g[k])) : d.push("width:" + Math.floor(100 / c.length) + "%");
  11794. h && d.push("height:" + v(h));
  11795. e && void 0 !== e.padding && d.push("padding:" + v(e.padding));
  11796. CKEDITOR.env.ie && CKEDITOR.env.quirks && f[k].align && d.push("text-align:" + f[k].align);
  11797. 0 < d.length && a.push('style\x3d"' + d.join("; ") + '" ');
  11798. a.push("\x3e", c[k], "\x3c/td\x3e")
  11799. }
  11800. a.push("\x3c/tr\x3e\x3c/tbody\x3e");
  11801. return a.join("")
  11802. })
  11803. }
  11804. },
  11805. vbox: function(a, b, c, d, e) {
  11806. if (!(3 > arguments.length)) {
  11807. this._ || (this._ = {});
  11808. var f = this._.children = b,
  11809. g = e && e.width || null,
  11810. h = e && e.heights || null;
  11811. CKEDITOR.ui.dialog.uiElement.call(this, a, e || {
  11812. type: "vbox"
  11813. }, d, "div", null, {
  11814. role: "presentation"
  11815. }, function() {
  11816. var b = ['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];
  11817. b.push('style\x3d"');
  11818. e && e.expand && b.push("height:100%;");
  11819. b.push("width:" + v(g || "100%"), ";");
  11820. CKEDITOR.env.webkit && b.push("float:none;");
  11821. b.push('"');
  11822. b.push('align\x3d"', CKEDITOR.tools.htmlEncode(e &&
  11823. e.align || ("ltr" == a.getParentEditor().lang.dir ? "left" : "right")), '" ');
  11824. b.push("\x3e\x3ctbody\x3e");
  11825. for (var d = 0; d < c.length; d++) {
  11826. var k = [];
  11827. b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');
  11828. g && k.push("width:" + v(g || "100%"));
  11829. h ? k.push("height:" + v(h[d])) : e && e.expand && k.push("height:" + Math.floor(100 / c.length) + "%");
  11830. e && void 0 !== e.padding && k.push("padding:" + v(e.padding));
  11831. CKEDITOR.env.ie && CKEDITOR.env.quirks && f[d].align && k.push("text-align:" + f[d].align);
  11832. 0 < k.length && b.push('style\x3d"', k.join("; "), '" ');
  11833. b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e',
  11834. c[d], "\x3c/td\x3e\x3c/tr\x3e")
  11835. }
  11836. b.push("\x3c/tbody\x3e\x3c/table\x3e");
  11837. return b.join("")
  11838. })
  11839. }
  11840. }
  11841. }
  11842. })();
  11843. CKEDITOR.ui.dialog.uiElement.prototype = {
  11844. getElement: function() {
  11845. return CKEDITOR.document.getById(this.domId)
  11846. },
  11847. getInputElement: function() {
  11848. return this.getElement()
  11849. },
  11850. getDialog: function() {
  11851. return this._.dialog
  11852. },
  11853. setValue: function(a, b) {
  11854. this.getInputElement().setValue(a);
  11855. !b && this.fire("change", {
  11856. value: a
  11857. });
  11858. return this
  11859. },
  11860. getValue: function() {
  11861. return this.getInputElement().getValue()
  11862. },
  11863. isChanged: function() {
  11864. return !1
  11865. },
  11866. selectParentTab: function() {
  11867. for (var a =
  11868. this.getInputElement();
  11869. (a = a.getParent()) && -1 == a.$.className.search("cke_dialog_page_contents"););
  11870. if (!a) return this;
  11871. a = a.getAttribute("name");
  11872. this._.dialog._.currentTabId != a && this._.dialog.selectPage(a);
  11873. return this
  11874. },
  11875. focus: function() {
  11876. this.selectParentTab().getInputElement().focus();
  11877. return this
  11878. },
  11879. registerEvents: function(a) {
  11880. var b = /^on([A-Z]\w+)/,
  11881. c, d = function(a, b, c, d) {
  11882. b.on("load", function() {
  11883. a.getInputElement().on(c, d, a)
  11884. })
  11885. },
  11886. e;
  11887. for (e in a)
  11888. if (c = e.match(b)) this.eventProcessors[e] ? this.eventProcessors[e].call(this,
  11889. this._.dialog, a[e]) : d(this, this._.dialog, c[1].toLowerCase(), a[e]);
  11890. return this
  11891. },
  11892. eventProcessors: {
  11893. onLoad: function(a, b) {
  11894. a.on("load", b, this)
  11895. },
  11896. onShow: function(a, b) {
  11897. a.on("show", b, this)
  11898. },
  11899. onHide: function(a, b) {
  11900. a.on("hide", b, this)
  11901. }
  11902. },
  11903. accessKeyDown: function() {
  11904. this.focus()
  11905. },
  11906. accessKeyUp: function() {},
  11907. disable: function() {
  11908. var a = this.getElement();
  11909. this.getInputElement().setAttribute("disabled", "true");
  11910. a.addClass("cke_disabled")
  11911. },
  11912. enable: function() {
  11913. var a = this.getElement();
  11914. this.getInputElement().removeAttribute("disabled");
  11915. a.removeClass("cke_disabled")
  11916. },
  11917. isEnabled: function() {
  11918. return !this.getElement().hasClass("cke_disabled")
  11919. },
  11920. isVisible: function() {
  11921. return this.getInputElement().isVisible()
  11922. },
  11923. isFocusable: function() {
  11924. return this.isEnabled() && this.isVisible() ? !0 : !1
  11925. }
  11926. };
  11927. CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  11928. getChild: function(a) {
  11929. if (1 > arguments.length) return this._.children.concat();
  11930. a.splice || (a = [a]);
  11931. return 2 > a.length ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ?
  11932. this._.children[a[0]].getChild(a.slice(1, a.length)) : null
  11933. }
  11934. }, !0);
  11935. CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
  11936. (function() {
  11937. var a = {
  11938. build: function(a, b, c) {
  11939. for (var d = b.children, e, f = [], g = [], h = 0; h < d.length && (e = d[h]); h++) {
  11940. var k = [];
  11941. f.push(k);
  11942. g.push(CKEDITOR.dialog._.uiElementBuilders[e.type].build(a, e, k))
  11943. }
  11944. return new CKEDITOR.ui.dialog[b.type](a, g, f, c, b)
  11945. }
  11946. };
  11947. CKEDITOR.dialog.addUIElement("hbox", a);
  11948. CKEDITOR.dialog.addUIElement("vbox", a)
  11949. })();
  11950. CKEDITOR.dialogCommand = function(a, b) {
  11951. this.dialogName = a;
  11952. CKEDITOR.tools.extend(this, b, !0)
  11953. };
  11954. CKEDITOR.dialogCommand.prototype = {
  11955. exec: function(a) {
  11956. a.openDialog(this.dialogName)
  11957. },
  11958. canUndo: !1,
  11959. editorFocus: 1
  11960. };
  11961. (function() {
  11962. var a = /^([a]|[^a])+$/,
  11963. b = /^\d*$/,
  11964. c = /^\d*(?:\.\d+)?$/,
  11965. d = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
  11966. e = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
  11967. f = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;
  11968. CKEDITOR.VALIDATE_OR = 1;
  11969. CKEDITOR.VALIDATE_AND = 2;
  11970. CKEDITOR.dialog.validate = {
  11971. functions: function() {
  11972. var a = arguments;
  11973. return function() {
  11974. var b = this && this.getValue ? this.getValue() :
  11975. a[0],
  11976. c, d = CKEDITOR.VALIDATE_AND,
  11977. e = [],
  11978. f;
  11979. for (f = 0; f < a.length; f++)
  11980. if ("function" == typeof a[f]) e.push(a[f]);
  11981. else break;
  11982. f < a.length && "string" == typeof a[f] && (c = a[f], f++);
  11983. f < a.length && "number" == typeof a[f] && (d = a[f]);
  11984. var g = d == CKEDITOR.VALIDATE_AND ? !0 : !1;
  11985. for (f = 0; f < e.length; f++) g = d == CKEDITOR.VALIDATE_AND ? g && e[f](b) : g || e[f](b);
  11986. return g ? !0 : c
  11987. }
  11988. },
  11989. regex: function(a, b) {
  11990. return function(c) {
  11991. c = this && this.getValue ? this.getValue() : c;
  11992. return a.test(c) ? !0 : b
  11993. }
  11994. },
  11995. notEmpty: function(b) {
  11996. return this.regex(a, b)
  11997. },
  11998. integer: function(a) {
  11999. return this.regex(b,
  12000. a)
  12001. },
  12002. number: function(a) {
  12003. return this.regex(c, a)
  12004. },
  12005. cssLength: function(a) {
  12006. return this.functions(function(a) {
  12007. return e.test(CKEDITOR.tools.trim(a))
  12008. }, a)
  12009. },
  12010. htmlLength: function(a) {
  12011. return this.functions(function(a) {
  12012. return d.test(CKEDITOR.tools.trim(a))
  12013. }, a)
  12014. },
  12015. inlineStyle: function(a) {
  12016. return this.functions(function(a) {
  12017. return f.test(CKEDITOR.tools.trim(a))
  12018. }, a)
  12019. },
  12020. equals: function(a, b) {
  12021. return this.functions(function(b) {
  12022. return b == a
  12023. }, b)
  12024. },
  12025. notEqual: function(a, b) {
  12026. return this.functions(function(b) {
  12027. return b != a
  12028. }, b)
  12029. }
  12030. };
  12031. CKEDITOR.on("instanceDestroyed",
  12032. function(a) {
  12033. if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
  12034. for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
  12035. for (var c in D) D[c].remove();
  12036. D = {}
  12037. }
  12038. a = a.editor._.storedDialogs;
  12039. for (var d in a) a[d].destroy()
  12040. })
  12041. })();
  12042. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  12043. openDialog: function(a, b) {
  12044. var c = null,
  12045. d = CKEDITOR.dialog._.dialogDefinitions[a];
  12046. null === CKEDITOR.dialog._.currentTop && w(this);
  12047. if ("function" == typeof d) c = this._.storedDialogs || (this._.storedDialogs = {}), c = c[a] || (c[a] = new CKEDITOR.dialog(this, a)), b && b.call(c,
  12048. c), c.show();
  12049. else {
  12050. if ("failed" == d) throw q(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.');
  12051. "string" == typeof d && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d), function() {
  12052. "function" != typeof CKEDITOR.dialog._.dialogDefinitions[a] && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed");
  12053. this.openDialog(a, b)
  12054. }, this, 0, 1)
  12055. }
  12056. CKEDITOR.skin.loadPart("dialog");
  12057. return c
  12058. }
  12059. })
  12060. }(), CKEDITOR.plugins.add("dialog", {
  12061. requires: "dialogui",
  12062. init: function(a) {
  12063. a.on("doubleclick", function(f) {
  12064. f.data.dialog &&
  12065. a.openDialog(f.data.dialog)
  12066. }, null, null, 999)
  12067. }
  12068. }),
  12069. function() {
  12070. CKEDITOR.plugins.add("a11yhelp", {
  12071. requires: "dialog",
  12072. availableLangs: {
  12073. af: 1,
  12074. ar: 1,
  12075. bg: 1,
  12076. ca: 1,
  12077. cs: 1,
  12078. cy: 1,
  12079. da: 1,
  12080. de: 1,
  12081. "de-ch": 1,
  12082. el: 1,
  12083. en: 1,
  12084. "en-gb": 1,
  12085. eo: 1,
  12086. es: 1,
  12087. et: 1,
  12088. eu: 1,
  12089. fa: 1,
  12090. fi: 1,
  12091. fo: 1,
  12092. fr: 1,
  12093. "fr-ca": 1,
  12094. gl: 1,
  12095. gu: 1,
  12096. he: 1,
  12097. hi: 1,
  12098. hr: 1,
  12099. hu: 1,
  12100. id: 1,
  12101. it: 1,
  12102. ja: 1,
  12103. km: 1,
  12104. ko: 1,
  12105. ku: 1,
  12106. lt: 1,
  12107. lv: 1,
  12108. mk: 1,
  12109. mn: 1,
  12110. nb: 1,
  12111. nl: 1,
  12112. no: 1,
  12113. oc: 1,
  12114. pl: 1,
  12115. pt: 1,
  12116. "pt-br": 1,
  12117. ro: 1,
  12118. ru: 1,
  12119. si: 1,
  12120. sk: 1,
  12121. sl: 1,
  12122. sq: 1,
  12123. sr: 1,
  12124. "sr-latn": 1,
  12125. sv: 1,
  12126. th: 1,
  12127. tr: 1,
  12128. tt: 1,
  12129. ug: 1,
  12130. uk: 1,
  12131. vi: 1,
  12132. zh: 1,
  12133. "zh-cn": 1
  12134. },
  12135. init: function(a) {
  12136. var f = this;
  12137. a.addCommand("a11yHelp", {
  12138. exec: function() {
  12139. var b = a.langCode,
  12140. b = f.availableLangs[b] ? b : f.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  12141. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f.path + "dialogs/lang/" + b + ".js"), function() {
  12142. a.lang.a11yhelp = f.langEntries[b];
  12143. a.openDialog("a11yHelp")
  12144. })
  12145. },
  12146. modes: {
  12147. wysiwyg: 1,
  12148. source: 1
  12149. },
  12150. readOnly: 1,
  12151. canUndo: !1
  12152. });
  12153. a.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp");
  12154. CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js");
  12155. a.on("ariaEditorHelpLabel", function(b) {
  12156. b.data.label = a.lang.common.editorHelp
  12157. })
  12158. }
  12159. })
  12160. }(),
  12161. CKEDITOR.plugins.add("about", {
  12162. requires: "dialog",
  12163. init: function(a) {
  12164. var f = a.addCommand("about", new CKEDITOR.dialogCommand("about"));
  12165. f.modes = {
  12166. wysiwyg: 1,
  12167. source: 1
  12168. };
  12169. f.canUndo = !1;
  12170. f.readOnly = 1;
  12171. a.ui.addButton && a.ui.addButton("About", {
  12172. label: a.lang.about.title,
  12173. command: "about",
  12174. toolbar: "about"
  12175. });
  12176. CKEDITOR.dialog.add("about", this.path + "dialogs/about.js")
  12177. }
  12178. }), CKEDITOR.plugins.add("basicstyles", {
  12179. init: function(a) {
  12180. var f = 0,
  12181. b = function(b, d, e, k) {
  12182. if (k) {
  12183. k = new CKEDITOR.style(k);
  12184. var g = c[e];
  12185. g.unshift(k);
  12186. a.attachStyleStateChange(k,
  12187. function(b) {
  12188. !a.readOnly && a.getCommand(e).setState(b)
  12189. });
  12190. a.addCommand(e, new CKEDITOR.styleCommand(k, {
  12191. contentForms: g
  12192. }));
  12193. a.ui.addButton && a.ui.addButton(b, {
  12194. label: d,
  12195. command: e,
  12196. toolbar: "basicstyles," + (f += 10)
  12197. })
  12198. }
  12199. },
  12200. c = {
  12201. bold: ["strong", "b", ["span", function(a) {
  12202. a = a.styles["font-weight"];
  12203. return "bold" == a || 700 <= +a
  12204. }]],
  12205. italic: ["em", "i", ["span", function(a) {
  12206. return "italic" == a.styles["font-style"]
  12207. }]],
  12208. underline: ["u", ["span", function(a) {
  12209. return "underline" == a.styles["text-decoration"]
  12210. }]],
  12211. strike: ["s", "strike", ["span", function(a) {
  12212. return "line-through" ==
  12213. a.styles["text-decoration"]
  12214. }]],
  12215. subscript: ["sub"],
  12216. superscript: ["sup"]
  12217. },
  12218. e = a.config,
  12219. m = a.lang.basicstyles;
  12220. b("Bold", m.bold, "bold", e.coreStyles_bold);
  12221. b("Italic", m.italic, "italic", e.coreStyles_italic);
  12222. b("Underline", m.underline, "underline", e.coreStyles_underline);
  12223. b("Strike", m.strike, "strike", e.coreStyles_strike);
  12224. b("Subscript", m.subscript, "subscript", e.coreStyles_subscript);
  12225. b("Superscript", m.superscript, "superscript", e.coreStyles_superscript);
  12226. a.setKeystroke([
  12227. [CKEDITOR.CTRL + 66, "bold"],
  12228. [CKEDITOR.CTRL + 73, "italic"],
  12229. [CKEDITOR.CTRL + 85, "underline"]
  12230. ])
  12231. }
  12232. }), CKEDITOR.config.coreStyles_bold = {
  12233. element: "strong",
  12234. overrides: "b"
  12235. }, CKEDITOR.config.coreStyles_italic = {
  12236. element: "em",
  12237. overrides: "i"
  12238. }, CKEDITOR.config.coreStyles_underline = {
  12239. element: "u"
  12240. }, CKEDITOR.config.coreStyles_strike = {
  12241. element: "s",
  12242. overrides: "strike"
  12243. }, CKEDITOR.config.coreStyles_subscript = {
  12244. element: "sub"
  12245. }, CKEDITOR.config.coreStyles_superscript = {
  12246. element: "sup"
  12247. },
  12248. function() {
  12249. var a = {
  12250. exec: function(a) {
  12251. var b = a.getCommand("blockquote").state,
  12252. c = a.getSelection(),
  12253. e = c && c.getRanges()[0];
  12254. if (e) {
  12255. var m = c.createBookmarks();
  12256. if (CKEDITOR.env.ie) {
  12257. var l = m[0].startNode,
  12258. d = m[0].endNode,
  12259. h;
  12260. if (l && "blockquote" == l.getParent().getName())
  12261. for (h = l; h = h.getNext();)
  12262. if (h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) {
  12263. l.move(h, !0);
  12264. break
  12265. }
  12266. if (d && "blockquote" == d.getParent().getName())
  12267. for (h = d; h = h.getPrevious();)
  12268. if (h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) {
  12269. d.move(h);
  12270. break
  12271. }
  12272. }
  12273. var k = e.createIterator();
  12274. k.enlargeBr = a.config.enterMode != CKEDITOR.ENTER_BR;
  12275. if (b == CKEDITOR.TRISTATE_OFF) {
  12276. for (l = []; b = k.getNextParagraph();) l.push(b);
  12277. 1 > l.length && (b = a.document.createElement(a.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), d = m.shift(), e.insertNode(b), b.append(new CKEDITOR.dom.text("", a.document)), e.moveToBookmark(d), e.selectNodeContents(b), e.collapse(!0), d = e.createBookmark(), l.push(b), m.unshift(d));
  12278. h = l[0].getParent();
  12279. e = [];
  12280. for (d = 0; d < l.length; d++) b = l[d], h = h.getCommonAncestor(b.getParent());
  12281. for (b = {
  12282. table: 1,
  12283. tbody: 1,
  12284. tr: 1,
  12285. ol: 1,
  12286. ul: 1
  12287. }; b[h.getName()];) h = h.getParent();
  12288. for (d = null; 0 < l.length;) {
  12289. for (b = l.shift(); !b.getParent().equals(h);) b = b.getParent();
  12290. b.equals(d) || e.push(b);
  12291. d = b
  12292. }
  12293. for (; 0 < e.length;)
  12294. if (b = e.shift(), "blockquote" == b.getName()) {
  12295. for (d = new CKEDITOR.dom.documentFragment(a.document); b.getFirst();) d.append(b.getFirst().remove()), l.push(d.getLast());
  12296. d.replace(b)
  12297. } else l.push(b);
  12298. e = a.document.createElement("blockquote");
  12299. for (e.insertBefore(l[0]); 0 < l.length;) b = l.shift(), e.append(b)
  12300. } else if (b == CKEDITOR.TRISTATE_ON) {
  12301. d = [];
  12302. for (h = {}; b = k.getNextParagraph();) {
  12303. for (l = e = null; b.getParent();) {
  12304. if ("blockquote" == b.getParent().getName()) {
  12305. e = b.getParent();
  12306. l = b;
  12307. break
  12308. }
  12309. b =
  12310. b.getParent()
  12311. }
  12312. e && l && !l.getCustomData("blockquote_moveout") && (d.push(l), CKEDITOR.dom.element.setMarker(h, l, "blockquote_moveout", !0))
  12313. }
  12314. CKEDITOR.dom.element.clearAllMarkers(h);
  12315. b = [];
  12316. l = [];
  12317. for (h = {}; 0 < d.length;) k = d.shift(), e = k.getParent(), k.getPrevious() ? k.getNext() ? (k.breakParent(k.getParent()), l.push(k.getNext())) : k.remove().insertAfter(e) : k.remove().insertBefore(e), e.getCustomData("blockquote_processed") || (l.push(e), CKEDITOR.dom.element.setMarker(h, e, "blockquote_processed", !0)), b.push(k);
  12318. CKEDITOR.dom.element.clearAllMarkers(h);
  12319. for (d = l.length - 1; 0 <= d; d--) {
  12320. e = l[d];
  12321. a: {
  12322. h = e;
  12323. for (var k = 0, g = h.getChildCount(), n = void 0; k < g && (n = h.getChild(k)); k++)
  12324. if (n.type == CKEDITOR.NODE_ELEMENT && n.isBlockBoundary()) {
  12325. h = !1;
  12326. break a
  12327. }
  12328. h = !0
  12329. }
  12330. h && e.remove()
  12331. }
  12332. if (a.config.enterMode == CKEDITOR.ENTER_BR)
  12333. for (e = !0; b.length;)
  12334. if (k = b.shift(), "div" == k.getName()) {
  12335. d = new CKEDITOR.dom.documentFragment(a.document);
  12336. !e || !k.getPrevious() || k.getPrevious().type == CKEDITOR.NODE_ELEMENT && k.getPrevious().isBlockBoundary() || d.append(a.document.createElement("br"));
  12337. for (e = k.getNext() &&
  12338. !(k.getNext().type == CKEDITOR.NODE_ELEMENT && k.getNext().isBlockBoundary()); k.getFirst();) k.getFirst().remove().appendTo(d);
  12339. e && d.append(a.document.createElement("br"));
  12340. d.replace(k);
  12341. e = !1
  12342. }
  12343. }
  12344. c.selectBookmarks(m);
  12345. a.focus()
  12346. }
  12347. },
  12348. refresh: function(a, b) {
  12349. this.setState(a.elementPath(b.block || b.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
  12350. },
  12351. context: "blockquote",
  12352. allowedContent: "blockquote",
  12353. requiredContent: "blockquote"
  12354. };
  12355. CKEDITOR.plugins.add("blockquote", {
  12356. init: function(f) {
  12357. f.blockless ||
  12358. (f.addCommand("blockquote", a), f.ui.addButton && f.ui.addButton("Blockquote", {
  12359. label: f.lang.blockquote.toolbar,
  12360. command: "blockquote",
  12361. toolbar: "blocks,10"
  12362. }))
  12363. }
  12364. })
  12365. }(), "use strict",
  12366. function() {
  12367. function a(a, b, c) {
  12368. b.type || (b.type = "auto");
  12369. if (c && !1 === a.fire("beforePaste", b) || !b.dataValue && b.dataTransfer.isEmpty()) return !1;
  12370. b.dataValue || (b.dataValue = "");
  12371. if (CKEDITOR.env.gecko && "drop" == b.method && a.toolbox) a.once("afterPaste", function() {
  12372. a.toolbox.focus()
  12373. });
  12374. return a.fire("paste", b)
  12375. }
  12376. function f(b) {
  12377. function c() {
  12378. var a = b.editable();
  12379. if (CKEDITOR.plugins.clipboard.isCustomCopyCutSupported) {
  12380. var d = function(a) {
  12381. b.readOnly && "cut" == a.name || A.initPasteDataTransfer(a, b);
  12382. a.data.preventDefault()
  12383. };
  12384. a.on("copy", d);
  12385. a.on("cut", d);
  12386. a.on("cut", function() {
  12387. b.readOnly || b.extractSelectedHtml()
  12388. }, null, null, 999)
  12389. }
  12390. a.on(A.mainPasteEvent, function(a) {
  12391. "beforepaste" == A.mainPasteEvent && C || y(a)
  12392. });
  12393. "beforepaste" == A.mainPasteEvent && (a.on("paste", function(a) {
  12394. F || (f(), a.data.preventDefault(), y(a), k("paste") || b.openDialog("paste"))
  12395. }), a.on("contextmenu", h, null, null, 0),
  12396. a.on("beforepaste", function(a) {
  12397. !a.data || a.data.$.ctrlKey || a.data.$.shiftKey || h()
  12398. }, null, null, 0));
  12399. a.on("beforecut", function() {
  12400. !C && l(b)
  12401. });
  12402. var e;
  12403. a.attachListener(CKEDITOR.env.ie ? a : b.document.getDocumentElement(), "mouseup", function() {
  12404. e = setTimeout(function() {
  12405. D()
  12406. }, 0)
  12407. });
  12408. b.on("destroy", function() {
  12409. clearTimeout(e)
  12410. });
  12411. a.on("keyup", D)
  12412. }
  12413. function d(a) {
  12414. return {
  12415. type: a,
  12416. canUndo: "cut" == a,
  12417. startDisabled: !0,
  12418. fakeKeystroke: "cut" == a ? CKEDITOR.CTRL + 88 : CKEDITOR.CTRL + 67,
  12419. exec: function() {
  12420. "cut" == this.type && l();
  12421. var a;
  12422. var c = this.type;
  12423. if (CKEDITOR.env.ie) a = k(c);
  12424. else try {
  12425. a = b.document.$.execCommand(c, !1, null)
  12426. } catch (d) {
  12427. a = !1
  12428. }
  12429. a || b.showNotification(b.lang.clipboard[this.type + "Error"]);
  12430. return a
  12431. }
  12432. }
  12433. }
  12434. function e() {
  12435. return {
  12436. canUndo: !1,
  12437. async: !0,
  12438. fakeKeystroke: CKEDITOR.CTRL + 86,
  12439. exec: function(b, c) {
  12440. var d = this,
  12441. e = function(c, e) {
  12442. c && a(b, c, !!e);
  12443. b.fire("afterCommandExec", {
  12444. name: "paste",
  12445. command: d,
  12446. returnValue: !!c
  12447. })
  12448. };
  12449. "string" == typeof c ? e({
  12450. dataValue: c,
  12451. method: "paste",
  12452. dataTransfer: A.initPasteDataTransfer()
  12453. }, 1) : b.getClipboardData(e)
  12454. }
  12455. }
  12456. }
  12457. function f() {
  12458. F = 1;
  12459. setTimeout(function() {
  12460. F =
  12461. 0
  12462. }, 100)
  12463. }
  12464. function h() {
  12465. C = 1;
  12466. setTimeout(function() {
  12467. C = 0
  12468. }, 10)
  12469. }
  12470. function k(a) {
  12471. var c = b.document,
  12472. d = c.getBody(),
  12473. e = !1,
  12474. f = function() {
  12475. e = !0
  12476. };
  12477. d.on(a, f);
  12478. 7 < CKEDITOR.env.version ? c.$.execCommand(a) : c.$.selection.createRange().execCommand(a);
  12479. d.removeListener(a, f);
  12480. return e
  12481. }
  12482. function l() {
  12483. if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  12484. var a = b.getSelection(),
  12485. c, d, e;
  12486. a.getType() == CKEDITOR.SELECTION_ELEMENT && (c = a.getSelectedElement()) && (d = a.getRanges()[0], e = b.document.createText(""), e.insertBefore(c), d.setStartBefore(e), d.setEndAfter(c),
  12487. a.selectRanges([d]), setTimeout(function() {
  12488. c.getParent() && (e.remove(), a.selectElement(c))
  12489. }, 0))
  12490. }
  12491. }
  12492. function m(a, c) {
  12493. var d = b.document,
  12494. e = b.editable(),
  12495. f = function(a) {
  12496. a.cancel()
  12497. },
  12498. h;
  12499. if (!d.getById("cke_pastebin")) {
  12500. var k = b.getSelection(),
  12501. l = k.createBookmarks();
  12502. CKEDITOR.env.ie && k.root.fire("selectionchange");
  12503. var p = new CKEDITOR.dom.element(!CKEDITOR.env.webkit && !e.is("body") || CKEDITOR.env.ie ? "div" : "body", d);
  12504. p.setAttributes({
  12505. id: "cke_pastebin",
  12506. "data-cke-temp": "1"
  12507. });
  12508. var n = 0,
  12509. d = d.getWindow();
  12510. CKEDITOR.env.webkit ? (e.append(p),
  12511. p.addClass("cke_editable"), e.is("body") || (n = "static" != e.getComputedStyle("position") ? e : CKEDITOR.dom.element.get(e.$.offsetParent), n = n.getDocumentPosition().y)) : e.getAscendant(CKEDITOR.env.ie ? "body" : "html", 1).append(p);
  12512. p.setStyles({
  12513. position: "absolute",
  12514. top: d.getScrollPosition().y - n + 10 + "px",
  12515. width: "1px",
  12516. height: Math.max(1, d.getViewPaneSize().height - 20) + "px",
  12517. overflow: "hidden",
  12518. margin: 0,
  12519. padding: 0
  12520. });
  12521. CKEDITOR.env.safari && p.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text"));
  12522. (n = p.getParent().isReadOnly()) ?
  12523. (p.setOpacity(0), p.setAttribute("contenteditable", !0)) : p.setStyle("ltr" == b.config.contentsLangDirection ? "left" : "right", "-10000px");
  12524. b.on("selectionChange", f, null, null, 0);
  12525. if (CKEDITOR.env.webkit || CKEDITOR.env.gecko) h = e.once("blur", f, null, null, -100);
  12526. n && p.focus();
  12527. n = new CKEDITOR.dom.range(p);
  12528. n.selectNodeContents(p);
  12529. var r = n.select();
  12530. CKEDITOR.env.ie && (h = e.once("blur", function() {
  12531. b.lockSelection(r)
  12532. }));
  12533. var v = CKEDITOR.document.getWindow().getScrollPosition().y;
  12534. setTimeout(function() {
  12535. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop =
  12536. v);
  12537. h && h.removeListener();
  12538. CKEDITOR.env.ie && e.focus();
  12539. k.selectBookmarks(l);
  12540. p.remove();
  12541. var a;
  12542. CKEDITOR.env.webkit && (a = p.getFirst()) && a.is && a.hasClass("Apple-style-span") && (p = a);
  12543. b.removeListener("selectionChange", f);
  12544. c(p.getHtml())
  12545. }, 0)
  12546. }
  12547. }
  12548. function B() {
  12549. if ("paste" == A.mainPasteEvent) return b.fire("beforePaste", {
  12550. type: "auto",
  12551. method: "paste"
  12552. }), !1;
  12553. b.focus();
  12554. f();
  12555. var a = b.focusManager;
  12556. a.lock();
  12557. if (b.editable().fire(A.mainPasteEvent) && !k("paste")) return a.unlock(), !1;
  12558. a.unlock();
  12559. return !0
  12560. }
  12561. function t(a) {
  12562. if ("wysiwyg" == b.mode) switch (a.data.keyCode) {
  12563. case CKEDITOR.CTRL +
  12564. 86:
  12565. case CKEDITOR.SHIFT + 45:
  12566. a = b.editable();
  12567. f();
  12568. "paste" == A.mainPasteEvent && a.fire("beforepaste");
  12569. break;
  12570. case CKEDITOR.CTRL + 88:
  12571. case CKEDITOR.SHIFT + 46:
  12572. b.fire("saveSnapshot"), setTimeout(function() {
  12573. b.fire("saveSnapshot")
  12574. }, 50)
  12575. }
  12576. }
  12577. function y(c) {
  12578. var d = {
  12579. type: "auto",
  12580. method: "paste",
  12581. dataTransfer: A.initPasteDataTransfer(c)
  12582. };
  12583. d.dataTransfer.cacheData();
  12584. var e = !1 !== b.fire("beforePaste", d);
  12585. e && A.canClipboardApiBeTrusted(d.dataTransfer, b) ? (c.data.preventDefault(), setTimeout(function() {
  12586. a(b, d)
  12587. }, 0)) : m(c, function(c) {
  12588. d.dataValue =
  12589. c.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig, "");
  12590. e && a(b, d)
  12591. })
  12592. }
  12593. function D() {
  12594. if ("wysiwyg" == b.mode) {
  12595. var a = x("paste");
  12596. b.getCommand("cut").setState(x("cut"));
  12597. b.getCommand("copy").setState(x("copy"));
  12598. b.getCommand("paste").setState(a);
  12599. b.fire("pasteState", a)
  12600. }
  12601. }
  12602. function x(a) {
  12603. if (G && a in {
  12604. paste: 1,
  12605. cut: 1
  12606. }) return CKEDITOR.TRISTATE_DISABLED;
  12607. if ("paste" == a) return CKEDITOR.TRISTATE_OFF;
  12608. a = b.getSelection();
  12609. var c = a.getRanges();
  12610. return a.getType() == CKEDITOR.SELECTION_NONE || 1 == c.length && c[0].collapsed ? CKEDITOR.TRISTATE_DISABLED :
  12611. CKEDITOR.TRISTATE_OFF
  12612. }
  12613. var A = CKEDITOR.plugins.clipboard,
  12614. C = 0,
  12615. F = 0,
  12616. G = 0;
  12617. (function() {
  12618. b.on("key", t);
  12619. b.on("contentDom", c);
  12620. b.on("selectionChange", function(a) {
  12621. G = a.data.selection.getRanges()[0].checkReadOnly();
  12622. D()
  12623. });
  12624. b.contextMenu && b.contextMenu.addListener(function(a, b) {
  12625. G = b.getRanges()[0].checkReadOnly();
  12626. return {
  12627. cut: x("cut"),
  12628. copy: x("copy"),
  12629. paste: x("paste")
  12630. }
  12631. })
  12632. })();
  12633. (function() {
  12634. function a(c, d, e, f, h) {
  12635. var k = b.lang.clipboard[d];
  12636. b.addCommand(d, e);
  12637. b.ui.addButton && b.ui.addButton(c, {
  12638. label: k,
  12639. command: d,
  12640. toolbar: "clipboard," +
  12641. f
  12642. });
  12643. b.addMenuItems && b.addMenuItem(d, {
  12644. label: k,
  12645. command: d,
  12646. group: "clipboard",
  12647. order: h
  12648. })
  12649. }
  12650. a("Cut", "cut", d("cut"), 10, 1);
  12651. a("Copy", "copy", d("copy"), 20, 4);
  12652. a("Paste", "paste", e(), 30, 8)
  12653. })();
  12654. b.getClipboardData = function(a, c) {
  12655. function d(a) {
  12656. a.removeListener();
  12657. a.cancel();
  12658. c(a.data)
  12659. }
  12660. function e(a) {
  12661. a.removeListener();
  12662. a.cancel();
  12663. l = !0;
  12664. c({
  12665. type: k,
  12666. dataValue: a.data.dataValue,
  12667. dataTransfer: a.data.dataTransfer,
  12668. method: "paste"
  12669. })
  12670. }
  12671. function f() {
  12672. this.customTitle = a && a.title
  12673. }
  12674. var h = !1,
  12675. k = "auto",
  12676. l = !1;
  12677. c || (c = a, a = null);
  12678. b.on("paste", d, null, null,
  12679. 0);
  12680. b.on("beforePaste", function(a) {
  12681. a.removeListener();
  12682. h = !0;
  12683. k = a.data.type
  12684. }, null, null, 1E3);
  12685. !1 === B() && (b.removeListener("paste", d), h && b.fire("pasteDialog", f) ? (b.on("pasteDialogCommit", e), b.on("dialogHide", function(a) {
  12686. a.removeListener();
  12687. a.data.removeListener("pasteDialogCommit", e);
  12688. setTimeout(function() {
  12689. l || c(null)
  12690. }, 10)
  12691. })) : c(null))
  12692. }
  12693. }
  12694. function b(a) {
  12695. if (CKEDITOR.env.webkit) {
  12696. if (!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html"
  12697. } else if (CKEDITOR.env.ie) {
  12698. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi) &&
  12699. !a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html"
  12700. } else if (CKEDITOR.env.gecko) {
  12701. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html"
  12702. } else return "html";
  12703. return "htmlifiedtext"
  12704. }
  12705. function c(a, b) {
  12706. function c(a) {
  12707. return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e", ~~(a / 2)) + (1 == a % 2 ? "\x3cbr\x3e" : "")
  12708. }
  12709. b = b.replace(/\s+/g, " ").replace(/> +</g, "\x3e\x3c").replace(/<br ?\/>/gi, "\x3cbr\x3e");
  12710. b = b.replace(/<\/?[A-Z]+>/g, function(a) {
  12711. return a.toLowerCase()
  12712. });
  12713. if (b.match(/^[^<]$/)) return b;
  12714. CKEDITOR.env.webkit &&
  12715. -1 < b.indexOf("\x3cdiv\x3e") && (b = b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "\x3cbr\x3e").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g, "\x3cdiv\x3e\x3c/div\x3e"), b.match(/<div>(<br>|)<\/div>/) && (b = "\x3cp\x3e" + b.replace(/(<div>(<br>|)<\/div>)+/g, function(a) {
  12716. return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length + 1)
  12717. }) + "\x3c/p\x3e"), b = b.replace(/<\/div><div>/g, "\x3cbr\x3e"), b = b.replace(/<\/?div>/g, ""));
  12718. CKEDITOR.env.gecko && a.enterMode != CKEDITOR.ENTER_BR && (CKEDITOR.env.gecko && (b = b.replace(/^<br><br>$/,
  12719. "\x3cbr\x3e")), -1 < b.indexOf("\x3cbr\x3e\x3cbr\x3e") && (b = "\x3cp\x3e" + b.replace(/(<br>){2,}/g, function(a) {
  12720. return c(a.length / 4)
  12721. }) + "\x3c/p\x3e"));
  12722. return l(a, b)
  12723. }
  12724. function e() {
  12725. function a() {
  12726. var b = {},
  12727. c;
  12728. for (c in CKEDITOR.dtd) "$" != c.charAt(0) && "div" != c && "span" != c && (b[c] = 1);
  12729. return b
  12730. }
  12731. var b = {};
  12732. return {
  12733. get: function(c) {
  12734. return "plain-text" == c ? b.plainText || (b.plainText = new CKEDITOR.filter("br")) : "semantic-content" == c ? ((c = b.semanticContent) || (c = new CKEDITOR.filter, c.allow({
  12735. $1: {
  12736. elements: a(),
  12737. attributes: !0,
  12738. styles: !1,
  12739. classes: !1
  12740. }
  12741. }),
  12742. c = b.semanticContent = c), c) : c ? new CKEDITOR.filter(c) : null
  12743. }
  12744. }
  12745. }
  12746. function m(a, b, c) {
  12747. b = CKEDITOR.htmlParser.fragment.fromHtml(b);
  12748. var d = new CKEDITOR.htmlParser.basicWriter;
  12749. c.applyTo(b, !0, !1, a.activeEnterMode);
  12750. b.writeHtml(d);
  12751. return d.getHtml()
  12752. }
  12753. function l(a, b) {
  12754. a.enterMode == CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function(a) {
  12755. return CKEDITOR.tools.repeat("\x3cbr\x3e", a.length / 7 * 2)
  12756. }).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, "\x3c$1div\x3e"));
  12757. return b
  12758. }
  12759. function d(a) {
  12760. a.data.preventDefault();
  12761. a.data.$.dataTransfer.dropEffect = "none"
  12762. }
  12763. function h(b) {
  12764. var c = CKEDITOR.plugins.clipboard;
  12765. b.on("contentDom", function() {
  12766. function d(c, e, f) {
  12767. e.select();
  12768. a(b, {
  12769. dataTransfer: f,
  12770. method: "drop"
  12771. }, 1);
  12772. f.sourceEditor.fire("saveSnapshot");
  12773. f.sourceEditor.editable().extractHtmlFromRange(c);
  12774. f.sourceEditor.getSelection().selectRanges([c]);
  12775. f.sourceEditor.fire("saveSnapshot")
  12776. }
  12777. function e(d, f) {
  12778. d.select();
  12779. a(b, {
  12780. dataTransfer: f,
  12781. method: "drop"
  12782. }, 1);
  12783. c.resetDragDataTransfer()
  12784. }
  12785. function f(a, c, d) {
  12786. var e = {
  12787. $: a.data.$,
  12788. target: a.data.getTarget()
  12789. };
  12790. c && (e.dragRange = c);
  12791. d && (e.dropRange = d);
  12792. !1 === b.fire(a.name, e) && a.data.preventDefault()
  12793. }
  12794. function h(a) {
  12795. a.type != CKEDITOR.NODE_ELEMENT && (a = a.getParent());
  12796. return a.getChildCount()
  12797. }
  12798. var k = b.editable(),
  12799. l = CKEDITOR.plugins.clipboard.getDropTarget(b),
  12800. m = b.ui.space("top"),
  12801. B = b.ui.space("bottom");
  12802. c.preventDefaultDropOnElement(m);
  12803. c.preventDefaultDropOnElement(B);
  12804. k.attachListener(l, "dragstart", f);
  12805. k.attachListener(b, "dragstart", c.resetDragDataTransfer, c, null, 1);
  12806. k.attachListener(b, "dragstart", function(a) {
  12807. c.initDragDataTransfer(a,
  12808. b)
  12809. }, null, null, 2);
  12810. k.attachListener(b, "dragstart", function() {
  12811. var a = c.dragRange = b.getSelection().getRanges()[0];
  12812. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (c.dragStartContainerChildCount = a ? h(a.startContainer) : null, c.dragEndContainerChildCount = a ? h(a.endContainer) : null)
  12813. }, null, null, 100);
  12814. k.attachListener(l, "dragend", f);
  12815. k.attachListener(b, "dragend", c.initDragDataTransfer, c, null, 1);
  12816. k.attachListener(b, "dragend", c.resetDragDataTransfer, c, null, 100);
  12817. k.attachListener(l, "dragover", function(a) {
  12818. var b = a.data.getTarget();
  12819. b && b.is && b.is("html") ? a.data.preventDefault() : CKEDITOR.env.ie && CKEDITOR.plugins.clipboard.isFileApiSupported && a.data.$.dataTransfer.types.contains("Files") && a.data.preventDefault()
  12820. });
  12821. k.attachListener(l, "drop", function(a) {
  12822. if (!a.data.$.defaultPrevented) {
  12823. a.data.preventDefault();
  12824. var d = a.data.getTarget();
  12825. if (!d.isReadOnly() || d.type == CKEDITOR.NODE_ELEMENT && d.is("html")) {
  12826. var d = c.getRangeAtDropPosition(a, b),
  12827. e = c.dragRange;
  12828. d && f(a, e, d)
  12829. }
  12830. }
  12831. }, null, null, 9999);
  12832. k.attachListener(b, "drop", c.initDragDataTransfer, c, null,
  12833. 1);
  12834. k.attachListener(b, "drop", function(a) {
  12835. if (a = a.data) {
  12836. var f = a.dropRange,
  12837. h = a.dragRange,
  12838. k = a.dataTransfer;
  12839. k.getTransferType(b) == CKEDITOR.DATA_TRANSFER_INTERNAL ? setTimeout(function() {
  12840. c.internalDrop(h, f, k, b)
  12841. }, 0) : k.getTransferType(b) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? d(h, f, k) : e(f, k)
  12842. }
  12843. }, null, null, 9999)
  12844. })
  12845. }
  12846. CKEDITOR.plugins.add("clipboard", {
  12847. requires: "dialog",
  12848. init: function(a) {
  12849. var d, k = e();
  12850. a.config.forcePasteAsPlainText ? d = "plain-text" : a.config.pasteFilter ? d = a.config.pasteFilter : !CKEDITOR.env.webkit || "pasteFilter" in
  12851. a.config || (d = "semantic-content");
  12852. a.pasteFilter = k.get(d);
  12853. f(a);
  12854. h(a);
  12855. CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path + "dialogs/paste.js"));
  12856. a.on("paste", function(b) {
  12857. b.data.dataTransfer || (b.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer);
  12858. if (!b.data.dataValue) {
  12859. var c = b.data.dataTransfer,
  12860. d = c.getData("text/html");
  12861. if (d) b.data.dataValue = d, b.data.type = "html";
  12862. else if (d = c.getData("text/plain")) b.data.dataValue = a.editable().transformPlainTextToHtml(d), b.data.type = "text"
  12863. }
  12864. }, null, null, 1);
  12865. a.on("paste",
  12866. function(a) {
  12867. var b = a.data.dataValue,
  12868. c = CKEDITOR.dtd.$block; - 1 < b.indexOf("Apple-") && (b = b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi, " "), "html" != a.data.type && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) {
  12869. return b.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;")
  12870. })), -1 < b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e') && (a.data.startsWithEOL = 1, a.data.preSniffing = "html", b = b.replace(/<br class="Apple-interchange-newline">/, "")), b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,
  12871. "$1"));
  12872. if (b.match(/^<[^<]+cke_(editable|contents)/i)) {
  12873. var d, e, f = new CKEDITOR.dom.element("div");
  12874. for (f.setHtml(b); 1 == f.getChildCount() && (d = f.getFirst()) && d.type == CKEDITOR.NODE_ELEMENT && (d.hasClass("cke_editable") || d.hasClass("cke_contents"));) f = e = d;
  12875. e && (b = e.getHtml().replace(/<br>$/i, ""))
  12876. }
  12877. CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function(b, d) {
  12878. return d.toLowerCase() in c ? (a.data.preSniffing = "html", "\x3c" + d) : b
  12879. }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, d) {
  12880. return d in
  12881. c ? (a.data.endsWithEOL = 1, "\x3c/" + d + "\x3e") : b
  12882. }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
  12883. a.data.dataValue = b
  12884. }, null, null, 3);
  12885. a.on("paste", function(d) {
  12886. d = d.data;
  12887. var e = d.type,
  12888. f = d.dataValue,
  12889. h, l = a.config.clipboard_defaultContentType || "html",
  12890. n = d.dataTransfer.getTransferType(a);
  12891. h = "html" == e || "html" == d.preSniffing ? "html" : b(f);
  12892. "htmlifiedtext" == h && (f = c(a.config, f));
  12893. "text" == e && "html" == h ? f = m(a, f, k.get("plain-text")) : n == CKEDITOR.DATA_TRANSFER_EXTERNAL && a.pasteFilter && !d.dontFilter && (f = m(a, f, a.pasteFilter));
  12894. d.startsWithEOL && (f = '\x3cbr data-cke-eol\x3d"1"\x3e' + f);
  12895. d.endsWithEOL && (f += '\x3cbr data-cke-eol\x3d"1"\x3e');
  12896. "auto" == e && (e = "html" == h || "html" == l ? "html" : "text");
  12897. d.type = e;
  12898. d.dataValue = f;
  12899. delete d.preSniffing;
  12900. delete d.startsWithEOL;
  12901. delete d.endsWithEOL
  12902. }, null, null, 6);
  12903. a.on("paste", function(b) {
  12904. b = b.data;
  12905. b.dataValue && (a.insertHtml(b.dataValue, b.type, b.range), setTimeout(function() {
  12906. a.fire("afterPaste")
  12907. }, 0))
  12908. }, null, null, 1E3);
  12909. a.on("pasteDialog", function(b) {
  12910. setTimeout(function() {
  12911. a.openDialog("paste", b.data)
  12912. }, 0)
  12913. })
  12914. }
  12915. });
  12916. CKEDITOR.plugins.clipboard = {
  12917. isCustomCopyCutSupported: !CKEDITOR.env.ie && !CKEDITOR.env.iOS,
  12918. isCustomDataTypesSupported: !CKEDITOR.env.ie,
  12919. isFileApiSupported: !CKEDITOR.env.ie || 9 < CKEDITOR.env.version,
  12920. mainPasteEvent: CKEDITOR.env.ie && !CKEDITOR.env.edge ? "beforepaste" : "paste",
  12921. canClipboardApiBeTrusted: function(a, b) {
  12922. return a.getTransferType(b) != CKEDITOR.DATA_TRANSFER_EXTERNAL || CKEDITOR.env.chrome && !a.isEmpty() || CKEDITOR.env.gecko && (a.getData("text/html") || a.getFilesCount()) ? !0 : !1
  12923. },
  12924. getDropTarget: function(a) {
  12925. var b =
  12926. a.editable();
  12927. return CKEDITOR.env.ie && 9 > CKEDITOR.env.version || b.isInline() ? b : a.document
  12928. },
  12929. fixSplitNodesAfterDrop: function(a, b, c, d) {
  12930. function e(a, c, d) {
  12931. var f = a;
  12932. f.type == CKEDITOR.NODE_TEXT && (f = a.getParent());
  12933. if (f.equals(c) && d != c.getChildCount()) return a = b.startContainer.getChild(b.startOffset - 1), c = b.startContainer.getChild(b.startOffset), a && a.type == CKEDITOR.NODE_TEXT && c && c.type == CKEDITOR.NODE_TEXT && (d = a.getLength(), a.setText(a.getText() + c.getText()), c.remove(), b.setStart(a, d), b.collapse(!0)), !0
  12934. }
  12935. var f = b.startContainer;
  12936. "number" == typeof d && "number" == typeof c && f.type == CKEDITOR.NODE_ELEMENT && (e(a.startContainer, f, c) || e(a.endContainer, f, d))
  12937. },
  12938. isDropRangeAffectedByDragRange: function(a, b) {
  12939. var c = b.startContainer,
  12940. d = b.endOffset;
  12941. return a.endContainer.equals(c) && a.endOffset <= d || a.startContainer.getParent().equals(c) && a.startContainer.getIndex() < d || a.endContainer.getParent().equals(c) && a.endContainer.getIndex() < d ? !0 : !1
  12942. },
  12943. internalDrop: function(b, c, d, e) {
  12944. var f = CKEDITOR.plugins.clipboard,
  12945. h = e.editable(),
  12946. k, l;
  12947. e.fire("saveSnapshot");
  12948. e.fire("lockSnapshot", {
  12949. dontUpdate: 1
  12950. });
  12951. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && this.fixSplitNodesAfterDrop(b, c, f.dragStartContainerChildCount, f.dragEndContainerChildCount);
  12952. (l = this.isDropRangeAffectedByDragRange(b, c)) || (k = b.createBookmark(!1));
  12953. f = c.clone().createBookmark(!1);
  12954. l && (k = b.createBookmark(!1));
  12955. b = k.startNode;
  12956. c = k.endNode;
  12957. l = f.startNode;
  12958. c && b.getPosition(l) & CKEDITOR.POSITION_PRECEDING && c.getPosition(l) & CKEDITOR.POSITION_FOLLOWING && l.insertBefore(b);
  12959. b = e.createRange();
  12960. b.moveToBookmark(k);
  12961. h.extractHtmlFromRange(b,
  12962. 1);
  12963. c = e.createRange();
  12964. c.moveToBookmark(f);
  12965. a(e, {
  12966. dataTransfer: d,
  12967. method: "drop",
  12968. range: c
  12969. }, 1);
  12970. e.fire("unlockSnapshot")
  12971. },
  12972. getRangeAtDropPosition: function(a, b) {
  12973. var c = a.data.$,
  12974. d = c.clientX,
  12975. e = c.clientY,
  12976. f = b.getSelection(!0).getRanges()[0],
  12977. h = b.createRange();
  12978. if (a.data.testRange) return a.data.testRange;
  12979. if (document.caretRangeFromPoint) c = b.document.$.caretRangeFromPoint(d, e), h.setStart(CKEDITOR.dom.node(c.startContainer), c.startOffset), h.collapse(!0);
  12980. else if (c.rangeParent) h.setStart(CKEDITOR.dom.node(c.rangeParent),
  12981. c.rangeOffset), h.collapse(!0);
  12982. else {
  12983. if (CKEDITOR.env.ie && 8 < CKEDITOR.env.version && f && b.editable().hasFocus) return f;
  12984. if (document.body.createTextRange) {
  12985. b.focus();
  12986. c = b.document.getBody().$.createTextRange();
  12987. try {
  12988. for (var k = !1, l = 0; 20 > l && !k; l++) {
  12989. if (!k) try {
  12990. c.moveToPoint(d, e - l), k = !0
  12991. } catch (m) {}
  12992. if (!k) try {
  12993. c.moveToPoint(d, e + l), k = !0
  12994. } catch (t) {}
  12995. }
  12996. if (k) {
  12997. var y = "cke-temp-" + (new Date).getTime();
  12998. c.pasteHTML('\x3cspan id\x3d"' + y + '"\x3e​\x3c/span\x3e');
  12999. var D = b.document.getById(y);
  13000. h.moveToPosition(D, CKEDITOR.POSITION_BEFORE_START);
  13001. D.remove()
  13002. } else {
  13003. var x = b.document.$.elementFromPoint(d, e),
  13004. A = new CKEDITOR.dom.element(x),
  13005. C;
  13006. if (A.equals(b.editable()) || "html" == A.getName()) return f && f.startContainer && !f.startContainer.equals(b.editable()) ? f : null;
  13007. C = A.getClientRect();
  13008. d < C.left ? h.setStartAt(A, CKEDITOR.POSITION_AFTER_START) : h.setStartAt(A, CKEDITOR.POSITION_BEFORE_END);
  13009. h.collapse(!0)
  13010. }
  13011. } catch (F) {
  13012. return null
  13013. }
  13014. } else return null
  13015. }
  13016. return h
  13017. },
  13018. initDragDataTransfer: function(a, b) {
  13019. var c = a.data.$ ? a.data.$.dataTransfer : null,
  13020. d = new this.dataTransfer(c, b);
  13021. c ? this.dragData && d.id == this.dragData.id ? d = this.dragData : this.dragData = d : this.dragData ? d = this.dragData : this.dragData = d;
  13022. a.data.dataTransfer = d
  13023. },
  13024. resetDragDataTransfer: function() {
  13025. this.dragData = null
  13026. },
  13027. initPasteDataTransfer: function(a, b) {
  13028. if (this.isCustomCopyCutSupported) {
  13029. if (a && a.data && a.data.$) {
  13030. var c = new this.dataTransfer(a.data.$.clipboardData, b);
  13031. this.copyCutData && c.id == this.copyCutData.id ? (c = this.copyCutData, c.$ = a.data.$.clipboardData) : this.copyCutData = c;
  13032. return c
  13033. }
  13034. return new this.dataTransfer(null, b)
  13035. }
  13036. return new this.dataTransfer(CKEDITOR.env.edge &&
  13037. a && a.data.$ && a.data.$.clipboardData || null, b)
  13038. },
  13039. preventDefaultDropOnElement: function(a) {
  13040. a && a.on("dragover", d)
  13041. }
  13042. };
  13043. var k = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? "cke/id" : "Text";
  13044. CKEDITOR.plugins.clipboard.dataTransfer = function(a, b) {
  13045. a && (this.$ = a);
  13046. this._ = {
  13047. metaRegExp: /^<meta.*?>/i,
  13048. bodyRegExp: /<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,
  13049. fragmentRegExp: /\x3c!--(?:Start|End)Fragment--\x3e/g,
  13050. data: {},
  13051. files: [],
  13052. normalizeType: function(a) {
  13053. a = a.toLowerCase();
  13054. return "text" == a || "text/plain" == a ? "Text" : "url" == a ? "URL" :
  13055. a
  13056. }
  13057. };
  13058. this.id = this.getData(k);
  13059. this.id || (this.id = "Text" == k ? "" : "cke-" + CKEDITOR.tools.getUniqueId());
  13060. if ("Text" != k) try {
  13061. this.$.setData(k, this.id)
  13062. } catch (c) {}
  13063. b && (this.sourceEditor = b, this.setData("text/html", b.getSelectedHtml(1)), "Text" == k || this.getData("text/plain") || this.setData("text/plain", b.getSelection().getSelectedText()))
  13064. };
  13065. CKEDITOR.DATA_TRANSFER_INTERNAL = 1;
  13066. CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2;
  13067. CKEDITOR.DATA_TRANSFER_EXTERNAL = 3;
  13068. CKEDITOR.plugins.clipboard.dataTransfer.prototype = {
  13069. getData: function(a) {
  13070. a =
  13071. this._.normalizeType(a);
  13072. var b = this._.data[a];
  13073. if (void 0 === b || null === b || "" === b) try {
  13074. b = this.$.getData(a)
  13075. } catch (c) {}
  13076. if (void 0 === b || null === b || "" === b) b = "";
  13077. "text/html" == a ? (b = b.replace(this._.metaRegExp, ""), (a = this._.bodyRegExp.exec(b)) && a.length && (b = a[1], b = b.replace(this._.fragmentRegExp, ""))) : "Text" == a && CKEDITOR.env.gecko && this.getFilesCount() && "file://" == b.substring(0, 7) && (b = "");
  13078. return b
  13079. },
  13080. setData: function(a, b) {
  13081. a = this._.normalizeType(a);
  13082. this._.data[a] = b;
  13083. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ||
  13084. "URL" == a || "Text" == a) {
  13085. "Text" == k && "Text" == a && (this.id = b);
  13086. try {
  13087. this.$.setData(a, b)
  13088. } catch (c) {}
  13089. }
  13090. },
  13091. getTransferType: function(a) {
  13092. return this.sourceEditor ? this.sourceEditor == a ? CKEDITOR.DATA_TRANSFER_INTERNAL : CKEDITOR.DATA_TRANSFER_CROSS_EDITORS : CKEDITOR.DATA_TRANSFER_EXTERNAL
  13093. },
  13094. cacheData: function() {
  13095. function a(c) {
  13096. c = b._.normalizeType(c);
  13097. var d = b.getData(c);
  13098. d && (b._.data[c] = d)
  13099. }
  13100. if (this.$) {
  13101. var b = this,
  13102. c, d;
  13103. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  13104. if (this.$.types)
  13105. for (c = 0; c < this.$.types.length; c++) a(this.$.types[c])
  13106. } else a("Text"),
  13107. a("URL");
  13108. d = this._getImageFromClipboard();
  13109. if (this.$ && this.$.files || d) {
  13110. this._.files = [];
  13111. if (this.$.files && this.$.files.length)
  13112. for (c = 0; c < this.$.files.length; c++) this._.files.push(this.$.files[c]);
  13113. 0 === this._.files.length && d && this._.files.push(d)
  13114. }
  13115. }
  13116. },
  13117. getFilesCount: function() {
  13118. return this._.files.length ? this._.files.length : this.$ && this.$.files && this.$.files.length ? this.$.files.length : this._getImageFromClipboard() ? 1 : 0
  13119. },
  13120. getFile: function(a) {
  13121. return this._.files.length ? this._.files[a] : this.$ && this.$.files && this.$.files.length ?
  13122. this.$.files[a] : 0 === a ? this._getImageFromClipboard() : void 0
  13123. },
  13124. isEmpty: function() {
  13125. var a = {},
  13126. b;
  13127. if (this.getFilesCount()) return !1;
  13128. for (b in this._.data) a[b] = 1;
  13129. if (this.$)
  13130. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  13131. if (this.$.types)
  13132. for (var c = 0; c < this.$.types.length; c++) a[this.$.types[c]] = 1
  13133. } else a.Text = 1, a.URL = 1;
  13134. "Text" != k && (a[k] = 0);
  13135. for (b in a)
  13136. if (a[b] && "" !== this.getData(b)) return !1;
  13137. return !0
  13138. },
  13139. _getImageFromClipboard: function() {
  13140. var a;
  13141. if (this.$ && this.$.items && this.$.items[0]) try {
  13142. if ((a = this.$.items[0].getAsFile()) &&
  13143. a.type) return a
  13144. } catch (b) {}
  13145. }
  13146. }
  13147. }(),
  13148. function() {
  13149. CKEDITOR.plugins.add("panel", {
  13150. beforeInit: function(a) {
  13151. a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler)
  13152. }
  13153. });
  13154. CKEDITOR.UI_PANEL = "panel";
  13155. CKEDITOR.ui.panel = function(a, b) {
  13156. b && CKEDITOR.tools.extend(this, b);
  13157. CKEDITOR.tools.extend(this, {
  13158. className: "",
  13159. css: []
  13160. });
  13161. this.id = CKEDITOR.tools.getNextId();
  13162. this.document = a;
  13163. this.isFramed = this.forceIFrame || this.css.length;
  13164. this._ = {
  13165. blocks: {}
  13166. }
  13167. };
  13168. CKEDITOR.ui.panel.handler = {
  13169. create: function(a) {
  13170. return new CKEDITOR.ui.panel(a)
  13171. }
  13172. };
  13173. var a =
  13174. CKEDITOR.addTemplate("panel", '\x3cdiv lang\x3d"{langCode}" id\x3d"{id}" dir\x3d{dir} class\x3d"cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style\x3d"z-index:{z-index}" role\x3d"presentation"\x3e{frame}\x3c/div\x3e'),
  13175. f = CKEDITOR.addTemplate("panel-frame", '\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'),
  13176. b = CKEDITOR.addTemplate("panel-frame-inner", '\x3c!DOCTYPE html\x3e\x3chtml class\x3d"cke_panel_container {env}" dir\x3d"{dir}" lang\x3d"{langCode}"\x3e\x3chead\x3e{css}\x3c/head\x3e\x3cbody class\x3d"cke_{dir}" style\x3d"margin:0;padding:0" onload\x3d"{onload}"\x3e\x3c/body\x3e\x3c/html\x3e');
  13177. CKEDITOR.ui.panel.prototype = {
  13178. render: function(c, e) {
  13179. this.getHolderElement = function() {
  13180. var a = this._.holder;
  13181. if (!a) {
  13182. if (this.isFramed) {
  13183. var a = this.document.getById(this.id + "_frame"),
  13184. c = a.getParent(),
  13185. a = a.getFrameDocument();
  13186. CKEDITOR.env.iOS && c.setStyles({
  13187. overflow: "scroll",
  13188. "-webkit-overflow-scrolling": "touch"
  13189. });
  13190. c = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() {
  13191. this.isLoaded = !0;
  13192. if (this.onLoad) this.onLoad()
  13193. }, this));
  13194. a.write(b.output(CKEDITOR.tools.extend({
  13195. css: CKEDITOR.tools.buildStyleHtml(this.css),
  13196. onload: "window.parent.CKEDITOR.tools.callFunction(" +
  13197. c + ");"
  13198. }, m)));
  13199. a.getWindow().$.CKEDITOR = CKEDITOR;
  13200. a.on("keydown", function(a) {
  13201. var b = a.data.getKeystroke(),
  13202. c = this.document.getById(this.id).getAttribute("dir");
  13203. this._.onKeyDown && !1 === this._.onKeyDown(b) ? a.data.preventDefault() : (27 == b || b == ("rtl" == c ? 39 : 37)) && this.onEscape && !1 === this.onEscape(b) && a.data.preventDefault()
  13204. }, this);
  13205. a = a.getBody();
  13206. a.unselectable();
  13207. CKEDITOR.env.air && CKEDITOR.tools.callFunction(c)
  13208. } else a = this.document.getById(this.id);
  13209. this._.holder = a
  13210. }
  13211. return a
  13212. };
  13213. var m = {
  13214. editorId: c.id,
  13215. id: this.id,
  13216. langCode: c.langCode,
  13217. dir: c.lang.dir,
  13218. cls: this.className,
  13219. frame: "",
  13220. env: CKEDITOR.env.cssClass,
  13221. "z-index": c.config.baseFloatZIndex + 1
  13222. };
  13223. if (this.isFramed) {
  13224. var l = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : "";
  13225. m.frame = f.output({
  13226. id: this.id + "_frame",
  13227. src: l
  13228. })
  13229. }
  13230. l = a.output(m);
  13231. e && e.push(l);
  13232. return l
  13233. },
  13234. addBlock: function(a, b) {
  13235. b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(),
  13236. b);
  13237. this._.currentBlock || this.showBlock(a);
  13238. return b
  13239. },
  13240. getBlock: function(a) {
  13241. return this._.blocks[a]
  13242. },
  13243. showBlock: function(a) {
  13244. a = this._.blocks[a];
  13245. var b = this._.currentBlock,
  13246. f = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + "_frame");
  13247. b && b.hide();
  13248. this._.currentBlock = a;
  13249. CKEDITOR.fire("ariaWidget", f);
  13250. a._.focusIndex = -1;
  13251. this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
  13252. a.show();
  13253. return a
  13254. },
  13255. destroy: function() {
  13256. this.element && this.element.remove()
  13257. }
  13258. };
  13259. CKEDITOR.ui.panel.block =
  13260. CKEDITOR.tools.createClass({
  13261. $: function(a, b) {
  13262. this.element = a.append(a.getDocument().createElement("div", {
  13263. attributes: {
  13264. tabindex: -1,
  13265. "class": "cke_panel_block"
  13266. },
  13267. styles: {
  13268. display: "none"
  13269. }
  13270. }));
  13271. b && CKEDITOR.tools.extend(this, b);
  13272. this.element.setAttributes({
  13273. role: this.attributes.role || "presentation",
  13274. "aria-label": this.attributes["aria-label"],
  13275. title: this.attributes.title || this.attributes["aria-label"]
  13276. });
  13277. this.keys = {};
  13278. this._.focusIndex = -1;
  13279. this.element.disableContextMenu()
  13280. },
  13281. _: {
  13282. markItem: function(a) {
  13283. -1 != a && (a = this.element.getElementsByTag("a").getItem(this._.focusIndex =
  13284. a), CKEDITOR.env.webkit && a.getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a))
  13285. }
  13286. },
  13287. proto: {
  13288. show: function() {
  13289. this.element.setStyle("display", "")
  13290. },
  13291. hide: function() {
  13292. this.onHide && !0 === this.onHide.call(this) || this.element.setStyle("display", "none")
  13293. },
  13294. onKeyDown: function(a, b) {
  13295. var f = this.keys[a];
  13296. switch (f) {
  13297. case "next":
  13298. for (var l = this._.focusIndex, f = this.element.getElementsByTag("a"), d; d = f.getItem(++l);)
  13299. if (d.getAttribute("_cke_focus") && d.$.offsetWidth) {
  13300. this._.focusIndex = l;
  13301. d.focus();
  13302. break
  13303. }
  13304. return d ||
  13305. b ? !1 : (this._.focusIndex = -1, this.onKeyDown(a, 1));
  13306. case "prev":
  13307. l = this._.focusIndex;
  13308. for (f = this.element.getElementsByTag("a"); 0 < l && (d = f.getItem(--l));) {
  13309. if (d.getAttribute("_cke_focus") && d.$.offsetWidth) {
  13310. this._.focusIndex = l;
  13311. d.focus();
  13312. break
  13313. }
  13314. d = null
  13315. }
  13316. return d || b ? !1 : (this._.focusIndex = f.count(), this.onKeyDown(a, 1));
  13317. case "click":
  13318. case "mouseup":
  13319. return l = this._.focusIndex, (d = 0 <= l && this.element.getElementsByTag("a").getItem(l)) && (d.$[f] ? d.$[f]() : d.$["on" + f]()), !1
  13320. }
  13321. return !0
  13322. }
  13323. }
  13324. })
  13325. }(), CKEDITOR.plugins.add("floatpanel", {
  13326. requires: "panel"
  13327. }),
  13328. function() {
  13329. function a(a, c, e, m, l) {
  13330. l = CKEDITOR.tools.genKey(c.getUniqueId(), e.getUniqueId(), a.lang.dir, a.uiColor || "", m.css || "", l || "");
  13331. var d = f[l];
  13332. d || (d = f[l] = new CKEDITOR.ui.panel(c, m), d.element = e.append(CKEDITOR.dom.element.createFromHtml(d.render(a), c)), d.element.setStyles({
  13333. display: "none",
  13334. position: "absolute"
  13335. }));
  13336. return d
  13337. }
  13338. var f = {};
  13339. CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
  13340. $: function(b, c, e, f) {
  13341. function l() {
  13342. g.hide()
  13343. }
  13344. e.forceIFrame = 1;
  13345. e.toolbarRelated && b.elementMode == CKEDITOR.ELEMENT_MODE_INLINE &&
  13346. (c = CKEDITOR.document.getById("cke_" + b.name));
  13347. var d = c.getDocument();
  13348. f = a(b, d, c, e, f || 0);
  13349. var h = f.element,
  13350. k = h.getFirst(),
  13351. g = this;
  13352. h.disableContextMenu();
  13353. this.element = h;
  13354. this._ = {
  13355. editor: b,
  13356. panel: f,
  13357. parentElement: c,
  13358. definition: e,
  13359. document: d,
  13360. iframe: k,
  13361. children: [],
  13362. dir: b.lang.dir,
  13363. showBlockParams: null
  13364. };
  13365. b.on("mode", l);
  13366. b.on("resize", l);
  13367. d.getWindow().on("resize", function() {
  13368. this.reposition()
  13369. }, this)
  13370. },
  13371. proto: {
  13372. addBlock: function(a, c) {
  13373. return this._.panel.addBlock(a, c)
  13374. },
  13375. addListBlock: function(a, c) {
  13376. return this._.panel.addListBlock(a,
  13377. c)
  13378. },
  13379. getBlock: function(a) {
  13380. return this._.panel.getBlock(a)
  13381. },
  13382. showBlock: function(a, c, e, f, l, d) {
  13383. var h = this._.panel,
  13384. k = h.showBlock(a);
  13385. this._.showBlockParams = [].slice.call(arguments);
  13386. this.allowBlur(!1);
  13387. var g = this._.editor.editable();
  13388. this._.returnFocus = g.hasFocus ? g : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
  13389. this._.hideTimeout = 0;
  13390. var n = this.element,
  13391. g = this._.iframe,
  13392. g = CKEDITOR.env.ie && !CKEDITOR.env.edge ? g : new CKEDITOR.dom.window(g.$.contentWindow),
  13393. w = n.getDocument(),
  13394. q = this._.parentElement.getPositionedAncestor(),
  13395. v = c.getDocumentPosition(w),
  13396. w = q ? q.getDocumentPosition(w) : {
  13397. x: 0,
  13398. y: 0
  13399. },
  13400. u = "rtl" == this._.dir,
  13401. r = v.x + (f || 0) - w.x,
  13402. p = v.y + (l || 0) - w.y;
  13403. !u || 1 != e && 4 != e ? u || 2 != e && 3 != e || (r += c.$.offsetWidth - 1) : r += c.$.offsetWidth;
  13404. if (3 == e || 4 == e) p += c.$.offsetHeight - 1;
  13405. this._.panel._.offsetParentId = c.getId();
  13406. n.setStyles({
  13407. top: p + "px",
  13408. left: 0,
  13409. display: ""
  13410. });
  13411. n.setOpacity(0);
  13412. n.getFirst().removeStyle("width");
  13413. this._.editor.focusManager.add(g);
  13414. this._.blurSet || (CKEDITOR.event.useCapture = !0, g.on("blur", function(a) {
  13415. function b() {
  13416. delete this._.returnFocus;
  13417. this.hide()
  13418. }
  13419. this.allowBlur() && a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !this._.activeChild && (CKEDITOR.env.iOS ? this._.hideTimeout || (this._.hideTimeout = CKEDITOR.tools.setTimeout(b, 0, this)) : b.call(this))
  13420. }, this), g.on("focus", function() {
  13421. this._.focused = !0;
  13422. this.hideChild();
  13423. this.allowBlur(!0)
  13424. }, this), CKEDITOR.env.iOS && (g.on("touchstart", function() {
  13425. clearTimeout(this._.hideTimeout)
  13426. }, this), g.on("touchend", function() {
  13427. this._.hideTimeout = 0;
  13428. this.focus()
  13429. }, this)), CKEDITOR.event.useCapture = !1,
  13430. this._.blurSet = 1);
  13431. h.onEscape = CKEDITOR.tools.bind(function(a) {
  13432. if (this.onEscape && !1 === this.onEscape(a)) return !1
  13433. }, this);
  13434. CKEDITOR.tools.setTimeout(function() {
  13435. var a = CKEDITOR.tools.bind(function() {
  13436. var a = n;
  13437. a.removeStyle("width");
  13438. if (k.autoSize) {
  13439. var b = k.element.getDocument(),
  13440. b = (CKEDITOR.env.webkit || CKEDITOR.env.edge ? k.element : b.getBody()).$.scrollWidth;
  13441. CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetWidth || 0) - (a.$.clientWidth || 0) + 3);
  13442. a.setStyle("width", b + 10 + "px");
  13443. b = k.element.$.scrollHeight;
  13444. CKEDITOR.env.ie &&
  13445. CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetHeight || 0) - (a.$.clientHeight || 0) + 3);
  13446. a.setStyle("height", b + "px");
  13447. h._.currentBlock.element.setStyle("display", "none").removeStyle("display")
  13448. } else a.removeStyle("height");
  13449. u && (r -= n.$.offsetWidth);
  13450. n.setStyle("left", r + "px");
  13451. var b = h.element.getWindow(),
  13452. a = n.$.getBoundingClientRect(),
  13453. b = b.getViewPaneSize(),
  13454. c = a.width || a.right - a.left,
  13455. e = a.height || a.bottom - a.top,
  13456. f = u ? a.right : b.width - a.left,
  13457. g = u ? b.width - a.right : a.left;
  13458. u ? f < c && (r = g > c ? r + c : b.width > c ? r - a.left : r - a.right + b.width) :
  13459. f < c && (r = g > c ? r - c : b.width > c ? r - a.right + b.width : r - a.left);
  13460. c = a.top;
  13461. b.height - a.top < e && (p = c > e ? p - e : b.height > e ? p - a.bottom + b.height : p - a.top);
  13462. CKEDITOR.env.ie && (b = a = new CKEDITOR.dom.element(n.$.offsetParent), "html" == b.getName() && (b = b.getDocument().getBody()), "rtl" == b.getComputedStyle("direction") && (r = CKEDITOR.env.ie8Compat ? r - 2 * n.getDocument().getDocumentElement().$.scrollLeft : r - (a.$.scrollWidth - a.$.clientWidth)));
  13463. var a = n.getFirst(),
  13464. l;
  13465. (l = a.getCustomData("activePanel")) && l.onHide && l.onHide.call(this, 1);
  13466. a.setCustomData("activePanel",
  13467. this);
  13468. n.setStyles({
  13469. top: p + "px",
  13470. left: r + "px"
  13471. });
  13472. n.setOpacity(1);
  13473. d && d()
  13474. }, this);
  13475. h.isLoaded ? a() : h.onLoad = a;
  13476. CKEDITOR.tools.setTimeout(function() {
  13477. var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
  13478. this.focus();
  13479. k.element.focus();
  13480. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a);
  13481. this.allowBlur(!0);
  13482. this._.editor.fire("panelShow", this)
  13483. }, 0, this)
  13484. }, CKEDITOR.env.air ? 200 : 0, this);
  13485. this.visible = 1;
  13486. this.onShow && this.onShow.call(this)
  13487. },
  13488. reposition: function() {
  13489. var a = this._.showBlockParams;
  13490. this.visible && this._.showBlockParams && (this.hide(), this.showBlock.apply(this, a))
  13491. },
  13492. focus: function() {
  13493. if (CKEDITOR.env.webkit) {
  13494. var a = CKEDITOR.document.getActive();
  13495. a && !a.equals(this._.iframe) && a.$.blur()
  13496. }(this._.lastFocused || this._.iframe.getFrameDocument().getWindow()).focus()
  13497. },
  13498. blur: function() {
  13499. var a = this._.iframe.getFrameDocument().getActive();
  13500. a && a.is("a") && (this._.lastFocused = a)
  13501. },
  13502. hide: function(a) {
  13503. if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) {
  13504. this.hideChild();
  13505. CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
  13506. this.element.setStyle("display", "none");
  13507. this.visible = 0;
  13508. this.element.getFirst().removeCustomData("activePanel");
  13509. if (a = a && this._.returnFocus) CKEDITOR.env.webkit && a.type && a.getWindow().$.focus(), a.focus();
  13510. delete this._.lastFocused;
  13511. this._.showBlockParams = null;
  13512. this._.editor.fire("panelHide", this)
  13513. }
  13514. },
  13515. allowBlur: function(a) {
  13516. var c = this._.panel;
  13517. void 0 !== a && (c.allowBlur = a);
  13518. return c.allowBlur
  13519. },
  13520. showAsChild: function(a, c, e, f, l, d) {
  13521. if (this._.activeChild != a || a._.panel._.offsetParentId != e.getId()) this.hideChild(), a.onHide =
  13522. CKEDITOR.tools.bind(function() {
  13523. CKEDITOR.tools.setTimeout(function() {
  13524. this._.focused || this.hide()
  13525. }, 0, this)
  13526. }, this), this._.activeChild = a, this._.focused = !1, a.showBlock(c, e, f, l, d), this.blur(), (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() {
  13527. a.element.getChild(0).$.style.cssText += ""
  13528. }, 100)
  13529. },
  13530. hideChild: function(a) {
  13531. var c = this._.activeChild;
  13532. c && (delete c.onHide, delete this._.activeChild, c.hide(), a && this.focus())
  13533. }
  13534. }
  13535. });
  13536. CKEDITOR.on("instanceDestroyed", function() {
  13537. var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances),
  13538. c;
  13539. for (c in f) {
  13540. var e = f[c];
  13541. a ? e.destroy() : e.element.hide()
  13542. }
  13543. a && (f = {})
  13544. })
  13545. }(), CKEDITOR.plugins.add("menu", {
  13546. requires: "floatpanel",
  13547. beforeInit: function(a) {
  13548. for (var f = a.config.menu_groups.split(","), b = a._.menuGroups = {}, c = a._.menuItems = {}, e = 0; e < f.length; e++) b[f[e]] = e + 1;
  13549. a.addMenuGroup = function(a, c) {
  13550. b[a] = c || 100
  13551. };
  13552. a.addMenuItem = function(a, e) {
  13553. b[e.group] && (c[a] = new CKEDITOR.menuItem(this, a, e))
  13554. };
  13555. a.addMenuItems = function(a) {
  13556. for (var b in a) this.addMenuItem(b, a[b])
  13557. };
  13558. a.getMenuItem = function(a) {
  13559. return c[a]
  13560. };
  13561. a.removeMenuItem =
  13562. function(a) {
  13563. delete c[a]
  13564. }
  13565. }
  13566. }),
  13567. function() {
  13568. function a(a) {
  13569. a.sort(function(a, b) {
  13570. return a.group < b.group ? -1 : a.group > b.group ? 1 : a.order < b.order ? -1 : a.order > b.order ? 1 : 0
  13571. })
  13572. }
  13573. var f = '\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1" _cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-label\x3d"{label}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked}';
  13574. CKEDITOR.env.gecko && CKEDITOR.env.mac && (f += ' onkeypress\x3d"return false;"');
  13575. CKEDITOR.env.gecko && (f += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  13576. var f = f + (' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" ' + (CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e'),
  13577. b = CKEDITOR.addTemplate("menuItem", f + '\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{shortcutHtml}{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_voice_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e\x3c/span\x3e'),
  13578. c = CKEDITOR.addTemplate("menuArrow", '\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),
  13579. e = CKEDITOR.addTemplate("menuShortcut", '\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');
  13580. CKEDITOR.menu = CKEDITOR.tools.createClass({
  13581. $: function(a, b) {
  13582. b = this._.definition = b || {};
  13583. this.id = CKEDITOR.tools.getNextId();
  13584. this.editor = a;
  13585. this.items = [];
  13586. this._.listeners = [];
  13587. this._.level = b.level || 1;
  13588. var c = CKEDITOR.tools.extend({}, b.panel, {
  13589. css: [CKEDITOR.skin.getPath("editor")],
  13590. level: this._.level - 1,
  13591. block: {}
  13592. }),
  13593. e = c.block.attributes = c.attributes || {};
  13594. !e.role && (e.role = "menu");
  13595. this._.panelDefinition = c
  13596. },
  13597. _: {
  13598. onShow: function() {
  13599. var a = this.editor.getSelection(),
  13600. b = a && a.getStartElement(),
  13601. c = this.editor.elementPath(),
  13602. e = this._.listeners;
  13603. this.removeAll();
  13604. for (var f = 0; f < e.length; f++) {
  13605. var g = e[f](b, a, c);
  13606. if (g)
  13607. for (var n in g) {
  13608. var w = this.editor.getMenuItem(n);
  13609. !w || w.command && !this.editor.getCommand(w.command).state || (w.state = g[n], this.add(w))
  13610. }
  13611. }
  13612. },
  13613. onClick: function(a) {
  13614. this.hide();
  13615. if (a.onClick) a.onClick();
  13616. else a.command && this.editor.execCommand(a.command)
  13617. },
  13618. onEscape: function(a) {
  13619. var b = this.parent;
  13620. b ? b._.panel.hideChild(1) : 27 == a && this.hide(1);
  13621. return !1
  13622. },
  13623. onHide: function() {
  13624. this.onHide && this.onHide()
  13625. },
  13626. showSubMenu: function(a) {
  13627. var b = this._.subMenu,
  13628. c = this.items[a];
  13629. if (c = c.getItems && c.getItems()) {
  13630. b ? b.removeAll() : (b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, {
  13631. level: this._.level + 1
  13632. }, !0)), b.parent = this, b._.onClick = CKEDITOR.tools.bind(this._.onClick, this));
  13633. for (var e in c) {
  13634. var f =
  13635. this.editor.getMenuItem(e);
  13636. f && (f.state = c[e], b.add(f))
  13637. }
  13638. var g = this._.panel.getBlock(this.id).element.getDocument().getById(this.id + String(a));
  13639. setTimeout(function() {
  13640. b.show(g, 2)
  13641. }, 0)
  13642. } else this._.panel.hideChild(1)
  13643. }
  13644. },
  13645. proto: {
  13646. add: function(a) {
  13647. a.order || (a.order = this.items.length);
  13648. this.items.push(a)
  13649. },
  13650. removeAll: function() {
  13651. this.items = []
  13652. },
  13653. show: function(b, c, d, e) {
  13654. if (!this.parent && (this._.onShow(), !this.items.length)) return;
  13655. c = c || ("rtl" == this.editor.lang.dir ? 2 : 1);
  13656. var f = this.items,
  13657. g = this.editor,
  13658. n = this._.panel,
  13659. w = this._.element;
  13660. if (!n) {
  13661. n = this._.panel = new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level);
  13662. n.onEscape = CKEDITOR.tools.bind(function(a) {
  13663. if (!1 === this._.onEscape(a)) return !1
  13664. }, this);
  13665. n.onShow = function() {
  13666. n._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")
  13667. };
  13668. n.onHide = CKEDITOR.tools.bind(function() {
  13669. this._.onHide && this._.onHide()
  13670. }, this);
  13671. w = n.addBlock(this.id, this._.panelDefinition.block);
  13672. w.autoSize = !0;
  13673. var q = w.keys;
  13674. q[40] = "next";
  13675. q[9] = "next";
  13676. q[38] =
  13677. "prev";
  13678. q[CKEDITOR.SHIFT + 9] = "prev";
  13679. q["rtl" == g.lang.dir ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click";
  13680. q[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  13681. CKEDITOR.env.ie && (q[13] = "mouseup");
  13682. w = this._.element = w.element;
  13683. q = w.getDocument();
  13684. q.getBody().setStyle("overflow", "hidden");
  13685. q.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden");
  13686. this._.itemOverFn = CKEDITOR.tools.addFunction(function(a) {
  13687. clearTimeout(this._.showSubTimeout);
  13688. this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, g.config.menu_subMenuDelay ||
  13689. 400, this, [a])
  13690. }, this);
  13691. this._.itemOutFn = CKEDITOR.tools.addFunction(function() {
  13692. clearTimeout(this._.showSubTimeout)
  13693. }, this);
  13694. this._.itemClickFn = CKEDITOR.tools.addFunction(function(a) {
  13695. var b = this.items[a];
  13696. if (b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1);
  13697. else if (b.getItems) this._.showSubMenu(a);
  13698. else this._.onClick(b)
  13699. }, this)
  13700. }
  13701. a(f);
  13702. for (var q = g.elementPath(), q = ['\x3cdiv class\x3d"cke_menu' + (q && q.direction() != g.lang.dir ? " cke_mixed_dir_content" : "") + '" role\x3d"presentation"\x3e'], v = f.length, u = v && f[0].group,
  13703. r = 0; r < v; r++) {
  13704. var p = f[r];
  13705. u != p.group && (q.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'), u = p.group);
  13706. p.render(this, r, q)
  13707. }
  13708. q.push("\x3c/div\x3e");
  13709. w.setHtml(q.join(""));
  13710. CKEDITOR.ui.fire("ready", this);
  13711. this.parent ? this.parent._.panel.showAsChild(n, this.id, b, c, d, e) : n.showBlock(this.id, b, c, d, e);
  13712. g.fire("menuShow", [n])
  13713. },
  13714. addListener: function(a) {
  13715. this._.listeners.push(a)
  13716. },
  13717. hide: function(a) {
  13718. this._.onHide && this._.onHide();
  13719. this._.panel && this._.panel.hide(a)
  13720. }
  13721. }
  13722. });
  13723. CKEDITOR.menuItem = CKEDITOR.tools.createClass({
  13724. $: function(a,
  13725. b, c) {
  13726. CKEDITOR.tools.extend(this, c, {
  13727. order: 0,
  13728. className: "cke_menubutton__" + b
  13729. });
  13730. this.group = a._.menuGroups[this.group];
  13731. this.editor = a;
  13732. this.name = b
  13733. },
  13734. proto: {
  13735. render: function(a, f, d) {
  13736. var h = a.id + String(f),
  13737. k = "undefined" == typeof this.state ? CKEDITOR.TRISTATE_OFF : this.state,
  13738. g = "",
  13739. n = this.editor,
  13740. w, q, v = k == CKEDITOR.TRISTATE_ON ? "on" : k == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off";
  13741. this.role in {
  13742. menuitemcheckbox: 1,
  13743. menuitemradio: 1
  13744. } && (g = ' aria-checked\x3d"' + (k == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"');
  13745. var u = this.getItems,
  13746. r =
  13747. "\x26#" + ("rtl" == this.editor.lang.dir ? "9668" : "9658") + ";",
  13748. p = this.name;
  13749. this.icon && !/\./.test(this.icon) && (p = this.icon);
  13750. this.command && (w = n.getCommand(this.command), (w = n.getCommandKeystroke(w)) && (q = CKEDITOR.tools.keystrokeToString(n.lang.common.keyboard, w)));
  13751. a = {
  13752. id: h,
  13753. name: this.name,
  13754. iconName: p,
  13755. label: this.label,
  13756. cls: this.className || "",
  13757. state: v,
  13758. hasPopup: u ? "true" : "false",
  13759. disabled: k == CKEDITOR.TRISTATE_DISABLED,
  13760. title: this.label + (q ? " (" + q.display + ")" : ""),
  13761. ariaShortcut: q ? n.lang.common.keyboardShortcut + " " + q.aria : "",
  13762. href: "javascript:void('" + (this.label || "").replace("'") + "')",
  13763. hoverFn: a._.itemOverFn,
  13764. moveOutFn: a._.itemOutFn,
  13765. clickFn: a._.itemClickFn,
  13766. index: f,
  13767. iconStyle: CKEDITOR.skin.getIconStyle(p, "rtl" == this.editor.lang.dir, p == this.icon ? null : this.icon, this.iconOffset),
  13768. shortcutHtml: q ? e.output({
  13769. shortcut: q.display
  13770. }) : "",
  13771. arrowHtml: u ? c.output({
  13772. label: r
  13773. }) : "",
  13774. role: this.role ? this.role : "menuitem",
  13775. ariaChecked: g
  13776. };
  13777. b.output(a, d)
  13778. }
  13779. }
  13780. })
  13781. }(), CKEDITOR.config.menu_groups = "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div",
  13782. CKEDITOR.plugins.add("contextmenu", {
  13783. requires: "menu",
  13784. onLoad: function() {
  13785. CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({
  13786. base: CKEDITOR.menu,
  13787. $: function(a) {
  13788. this.base.call(this, a, {
  13789. panel: {
  13790. className: "cke_menu_panel",
  13791. attributes: {
  13792. "aria-label": a.lang.contextmenu.options
  13793. }
  13794. }
  13795. })
  13796. },
  13797. proto: {
  13798. addTarget: function(a, f) {
  13799. a.on("contextmenu", function(a) {
  13800. a = a.data;
  13801. var c = CKEDITOR.env.webkit ? b : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey;
  13802. if (!f || !c) {
  13803. a.preventDefault();
  13804. if (CKEDITOR.env.mac && CKEDITOR.env.webkit) {
  13805. var c = this.editor,
  13806. l = (new CKEDITOR.dom.elementPath(a.getTarget(), c.editable())).contains(function(a) {
  13807. return a.hasAttribute("contenteditable")
  13808. }, !0);
  13809. l && "false" == l.getAttribute("contenteditable") && c.getSelection().fake(l)
  13810. }
  13811. var l = a.getTarget().getDocument(),
  13812. d = a.getTarget().getDocument().getDocumentElement(),
  13813. c = !l.equals(CKEDITOR.document),
  13814. l = l.getWindow().getScrollPosition(),
  13815. h = c ? a.$.clientX : a.$.pageX || l.x + a.$.clientX,
  13816. k = c ? a.$.clientY : a.$.pageY || l.y + a.$.clientY;
  13817. CKEDITOR.tools.setTimeout(function() {
  13818. this.open(d, null, h, k)
  13819. }, CKEDITOR.env.ie ?
  13820. 200 : 0, this)
  13821. }
  13822. }, this);
  13823. if (CKEDITOR.env.webkit) {
  13824. var b, c = function() {
  13825. b = 0
  13826. };
  13827. a.on("keydown", function(a) {
  13828. b = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey
  13829. });
  13830. a.on("keyup", c);
  13831. a.on("contextmenu", c)
  13832. }
  13833. },
  13834. open: function(a, f, b, c) {
  13835. this.editor.focus();
  13836. a = a || CKEDITOR.document.getDocumentElement();
  13837. this.editor.selectionChange(1);
  13838. this.show(a, f, b, c)
  13839. }
  13840. }
  13841. })
  13842. },
  13843. beforeInit: function(a) {
  13844. var f = a.contextMenu = new CKEDITOR.plugins.contextMenu(a);
  13845. a.on("contentDom", function() {
  13846. f.addTarget(a.editable(), !1 !== a.config.browserContextMenuOnCtrl)
  13847. });
  13848. a.addCommand("contextMenu", {
  13849. exec: function() {
  13850. a.contextMenu.open(a.document.getBody())
  13851. }
  13852. });
  13853. a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu");
  13854. a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu")
  13855. }
  13856. }),
  13857. function() {
  13858. function a(a, b) {
  13859. function l(b) {
  13860. b = g.list[b];
  13861. var c;
  13862. b.equals(a.editable()) || "true" == b.getAttribute("contenteditable") ? (c = a.createRange(), c.selectNodeContents(b), c = c.select()) : (c = a.getSelection(), c.selectElement(b));
  13863. CKEDITOR.env.ie && a.fire("selectionChange", {
  13864. selection: c,
  13865. path: new CKEDITOR.dom.elementPath(b)
  13866. });
  13867. a.focus()
  13868. }
  13869. function d() {
  13870. k && k.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  13871. delete g.list
  13872. }
  13873. var h = a.ui.spaceId("path"),
  13874. k, g = a._.elementsPath,
  13875. n = g.idBase;
  13876. b.html += '\x3cspan id\x3d"' + h + '_label" class\x3d"cke_voice_label"\x3e' + a.lang.elementspath.eleLabel + '\x3c/span\x3e\x3cspan id\x3d"' + h + '" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"' + h + '_label"\x3e\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e\x3c/span\x3e';
  13877. a.on("uiReady", function() {
  13878. var b = a.ui.space("path");
  13879. b && a.focusManager.add(b, 1)
  13880. });
  13881. g.onClick = l;
  13882. var w = CKEDITOR.tools.addFunction(l),
  13883. q = CKEDITOR.tools.addFunction(function(b, c) {
  13884. var d = g.idBase,
  13885. f;
  13886. c = new CKEDITOR.dom.event(c);
  13887. f = "rtl" == a.lang.dir;
  13888. switch (c.getKeystroke()) {
  13889. case f ? 39:
  13890. 37:
  13891. case 9:
  13892. return (f = CKEDITOR.document.getById(d + (b + 1))) || (f = CKEDITOR.document.getById(d + "0")), f.focus(), !1;
  13893. case f ? 37:
  13894. 39:
  13895. case CKEDITOR.SHIFT + 9:
  13896. return (f = CKEDITOR.document.getById(d + (b - 1))) || (f = CKEDITOR.document.getById(d + (g.list.length - 1))), f.focus(), !1;
  13897. case 27:
  13898. return a.focus(), !1;
  13899. case 13:
  13900. case 32:
  13901. return l(b), !1
  13902. }
  13903. return !0
  13904. });
  13905. a.on("selectionChange", function() {
  13906. for (var b = [], d = g.list = [], f = [], l = g.filters, m = !0, B = a.elementPath().elements, t, y = B.length; y--;) {
  13907. var D = B[y],
  13908. x = 0;
  13909. t = D.data("cke-display-name") ? D.data("cke-display-name") : D.data("cke-real-element-type") ? D.data("cke-real-element-type") : D.getName();
  13910. (m = D.hasAttribute("contenteditable") ? "true" == D.getAttribute("contenteditable") : m) || D.hasAttribute("contenteditable") || (x = 1);
  13911. for (var A = 0; A < l.length; A++) {
  13912. var C = l[A](D, t);
  13913. if (!1 === C) {
  13914. x = 1;
  13915. break
  13916. }
  13917. t = C || t
  13918. }
  13919. x || (d.unshift(D),
  13920. f.unshift(t))
  13921. }
  13922. d = d.length;
  13923. for (l = 0; l < d; l++) t = f[l], m = a.lang.elementspath.eleTitle.replace(/%1/, t), t = c.output({
  13924. id: n + l,
  13925. label: m,
  13926. text: t,
  13927. jsTitle: "javascript:void('" + t + "')",
  13928. index: l,
  13929. keyDownFn: q,
  13930. clickFn: w
  13931. }), b.unshift(t);
  13932. k || (k = CKEDITOR.document.getById(h));
  13933. f = k;
  13934. f.setHtml(b.join("") + '\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  13935. a.fire("elementsPathUpdate", {
  13936. space: f
  13937. })
  13938. });
  13939. a.on("readOnly", d);
  13940. a.on("contentDomUnload", d);
  13941. a.addCommand("elementsPathFocus", f.toolbarFocus);
  13942. a.setKeystroke(CKEDITOR.ALT + 122,
  13943. "elementsPathFocus")
  13944. }
  13945. var f = {
  13946. toolbarFocus: {
  13947. editorFocus: !1,
  13948. readOnly: 1,
  13949. exec: function(a) {
  13950. (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air)
  13951. }
  13952. }
  13953. },
  13954. b = "";
  13955. CKEDITOR.env.gecko && CKEDITOR.env.mac && (b += ' onkeypress\x3d"return false;"');
  13956. CKEDITOR.env.gecko && (b += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  13957. var c = CKEDITOR.addTemplate("pathItem", '\x3ca id\x3d"{id}" href\x3d"{jsTitle}" tabindex\x3d"-1" class\x3d"cke_path_item" title\x3d"{label}"' + b + ' hidefocus\x3d"true" onkeydown\x3d"return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role\x3d"button" aria-label\x3d"{label}"\x3e{text}\x3c/a\x3e');
  13958. CKEDITOR.plugins.add("elementspath", {
  13959. init: function(b) {
  13960. b._.elementsPath = {
  13961. idBase: "cke_elementspath_" + CKEDITOR.tools.getNextNumber() + "_",
  13962. filters: []
  13963. };
  13964. b.on("uiSpace", function(c) {
  13965. "bottom" == c.data.space && a(b, c.data)
  13966. })
  13967. }
  13968. })
  13969. }(),
  13970. function() {
  13971. function a(a, e) {
  13972. var m, l;
  13973. e.on("refresh", function(a) {
  13974. var c = [f],
  13975. e;
  13976. for (e in a.data.states) c.push(a.data.states[e]);
  13977. this.setState(CKEDITOR.tools.search(c, b) ? b : f)
  13978. }, e, null, 100);
  13979. e.on("exec", function(b) {
  13980. m = a.getSelection();
  13981. l = m.createBookmarks(1);
  13982. b.data || (b.data = {});
  13983. b.data.done = !1
  13984. }, e,
  13985. null, 0);
  13986. e.on("exec", function() {
  13987. a.forceNextSelectionCheck();
  13988. m.selectBookmarks(l)
  13989. }, e, null, 100)
  13990. }
  13991. var f = CKEDITOR.TRISTATE_DISABLED,
  13992. b = CKEDITOR.TRISTATE_OFF;
  13993. CKEDITOR.plugins.add("indent", {
  13994. init: function(b) {
  13995. var e = CKEDITOR.plugins.indent.genericDefinition;
  13996. a(b, b.addCommand("indent", new e(!0)));
  13997. a(b, b.addCommand("outdent", new e));
  13998. b.ui.addButton && (b.ui.addButton("Indent", {
  13999. label: b.lang.indent.indent,
  14000. command: "indent",
  14001. directional: !0,
  14002. toolbar: "indent,20"
  14003. }), b.ui.addButton("Outdent", {
  14004. label: b.lang.indent.outdent,
  14005. command: "outdent",
  14006. directional: !0,
  14007. toolbar: "indent,10"
  14008. }));
  14009. b.on("dirChanged", function(a) {
  14010. var e = b.createRange(),
  14011. d = a.data.node;
  14012. e.setStartBefore(d);
  14013. e.setEndAfter(d);
  14014. for (var f = new CKEDITOR.dom.walker(e), k; k = f.next();)
  14015. if (k.type == CKEDITOR.NODE_ELEMENT)
  14016. if (!k.equals(d) && k.getDirection()) e.setStartAfter(k), f = new CKEDITOR.dom.walker(e);
  14017. else {
  14018. var g = b.config.indentClasses;
  14019. if (g)
  14020. for (var n = "ltr" == a.data.dir ? ["_rtl", ""] : ["", "_rtl"], w = 0; w < g.length; w++) k.hasClass(g[w] + n[0]) && (k.removeClass(g[w] + n[0]), k.addClass(g[w] + n[1]));
  14021. g = k.getStyle("margin-right");
  14022. n = k.getStyle("margin-left");
  14023. g ? k.setStyle("margin-left", g) : k.removeStyle("margin-left");
  14024. n ? k.setStyle("margin-right", n) : k.removeStyle("margin-right")
  14025. }
  14026. })
  14027. }
  14028. });
  14029. CKEDITOR.plugins.indent = {
  14030. genericDefinition: function(a) {
  14031. this.isIndent = !!a;
  14032. this.startDisabled = !this.isIndent
  14033. },
  14034. specificDefinition: function(a, b, f) {
  14035. this.name = b;
  14036. this.editor = a;
  14037. this.jobs = {};
  14038. this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
  14039. this.isIndent = !!f;
  14040. this.relatedGlobal = f ? "indent" : "outdent";
  14041. this.indentKey = f ? 9 : CKEDITOR.SHIFT + 9;
  14042. this.database = {}
  14043. },
  14044. registerCommands: function(a,
  14045. b) {
  14046. a.on("pluginsLoaded", function() {
  14047. for (var a in b)(function(a, b) {
  14048. var c = a.getCommand(b.relatedGlobal),
  14049. e;
  14050. for (e in b.jobs) c.on("exec", function(c) {
  14051. c.data.done || (a.fire("lockSnapshot"), b.execJob(a, e) && (c.data.done = !0), a.fire("unlockSnapshot"), CKEDITOR.dom.element.clearAllMarkers(b.database))
  14052. }, this, null, e), c.on("refresh", function(c) {
  14053. c.data.states || (c.data.states = {});
  14054. c.data.states[b.name + "@" + e] = b.refreshJob(a, e, c.data.path)
  14055. }, this, null, e);
  14056. a.addFeature(b)
  14057. })(this, b[a])
  14058. })
  14059. }
  14060. };
  14061. CKEDITOR.plugins.indent.genericDefinition.prototype = {
  14062. context: "p",
  14063. exec: function() {}
  14064. };
  14065. CKEDITOR.plugins.indent.specificDefinition.prototype = {
  14066. execJob: function(a, b) {
  14067. var m = this.jobs[b];
  14068. if (m.state != f) return m.exec.call(this, a)
  14069. },
  14070. refreshJob: function(a, b, m) {
  14071. b = this.jobs[b];
  14072. a.activeFilter.checkFeature(this) ? b.state = b.refresh.call(this, a, m) : b.state = f;
  14073. return b.state
  14074. },
  14075. getContext: function(a) {
  14076. return a.contains(this.context)
  14077. }
  14078. }
  14079. }(),
  14080. function() {
  14081. function a(a) {
  14082. function c(f) {
  14083. for (var h = q.startContainer, m = q.endContainer; h && !h.getParent().equals(f);) h = h.getParent();
  14084. for (; m && !m.getParent().equals(f);) m =
  14085. m.getParent();
  14086. if (!h || !m) return !1;
  14087. for (var v = h, h = [], u = !1; !u;) v.equals(m) && (u = !0), h.push(v), v = v.getNext();
  14088. if (1 > h.length) return !1;
  14089. v = f.getParents(!0);
  14090. for (m = 0; m < v.length; m++)
  14091. if (v[m].getName && l[v[m].getName()]) {
  14092. f = v[m];
  14093. break
  14094. }
  14095. for (var v = e.isIndent ? 1 : -1, m = h[0], h = h[h.length - 1], u = CKEDITOR.plugins.list.listToArray(f, g), y = u[h.getCustomData("listarray_index")].indent, m = m.getCustomData("listarray_index"); m <= h.getCustomData("listarray_index"); m++)
  14096. if (u[m].indent += v, 0 < v) {
  14097. var w = u[m].parent;
  14098. u[m].parent = new CKEDITOR.dom.element(w.getName(),
  14099. w.getDocument())
  14100. }
  14101. for (m = h.getCustomData("listarray_index") + 1; m < u.length && u[m].indent > y; m++) u[m].indent += v;
  14102. h = CKEDITOR.plugins.list.arrayToList(u, g, null, a.config.enterMode, f.getDirection());
  14103. if (!e.isIndent) {
  14104. var x;
  14105. if ((x = f.getParent()) && x.is("li"))
  14106. for (var v = h.listNode.getChildren(), A = [], C, m = v.count() - 1; 0 <= m; m--)(C = v.getItem(m)) && C.is && C.is("li") && A.push(C)
  14107. }
  14108. h && h.listNode.replace(f);
  14109. if (A && A.length)
  14110. for (m = 0; m < A.length; m++) {
  14111. for (C = f = A[m];
  14112. (C = C.getNext()) && C.is && C.getName() in l;) CKEDITOR.env.needsNbspFiller && !f.getFirst(b) &&
  14113. f.append(q.document.createText(" ")), f.append(C);
  14114. f.insertAfter(x)
  14115. }
  14116. h && a.fire("contentDomInvalidated");
  14117. return !0
  14118. }
  14119. for (var e = this, g = this.database, l = this.context, m = a.getSelection(), m = (m && m.getRanges()).createIterator(), q; q = m.getNextRange();) {
  14120. for (var v = q.getCommonAncestor(); v && (v.type != CKEDITOR.NODE_ELEMENT || !l[v.getName()]);) {
  14121. if (a.editable().equals(v)) {
  14122. v = !1;
  14123. break
  14124. }
  14125. v = v.getParent()
  14126. }
  14127. v || (v = q.startPath().contains(l)) && q.setEndAt(v, CKEDITOR.POSITION_BEFORE_END);
  14128. if (!v) {
  14129. var u = q.getEnclosedNode();
  14130. u && u.type == CKEDITOR.NODE_ELEMENT &&
  14131. u.getName() in l && (q.setStartAt(u, CKEDITOR.POSITION_AFTER_START), q.setEndAt(u, CKEDITOR.POSITION_BEFORE_END), v = u)
  14132. }
  14133. v && q.startContainer.type == CKEDITOR.NODE_ELEMENT && q.startContainer.getName() in l && (u = new CKEDITOR.dom.walker(q), u.evaluator = f, q.startContainer = u.next());
  14134. v && q.endContainer.type == CKEDITOR.NODE_ELEMENT && q.endContainer.getName() in l && (u = new CKEDITOR.dom.walker(q), u.evaluator = f, q.endContainer = u.previous());
  14135. if (v) return c(v)
  14136. }
  14137. return 0
  14138. }
  14139. function f(a) {
  14140. return a.type == CKEDITOR.NODE_ELEMENT && a.is("li")
  14141. }
  14142. function b(a) {
  14143. return c(a) && e(a)
  14144. }
  14145. var c = CKEDITOR.dom.walker.whitespaces(!0),
  14146. e = CKEDITOR.dom.walker.bookmark(!1, !0),
  14147. m = CKEDITOR.TRISTATE_DISABLED,
  14148. l = CKEDITOR.TRISTATE_OFF;
  14149. CKEDITOR.plugins.add("indentlist", {
  14150. requires: "indent",
  14151. init: function(b) {
  14152. function c(b) {
  14153. e.specificDefinition.apply(this, arguments);
  14154. this.requiredContent = ["ul", "ol"];
  14155. b.on("key", function(a) {
  14156. if ("wysiwyg" == b.mode && a.data.keyCode == this.indentKey) {
  14157. var c = this.getContext(b.elementPath());
  14158. !c || this.isIndent && CKEDITOR.plugins.indentList.firstItemInPath(this.context,
  14159. b.elementPath(), c) || (b.execCommand(this.relatedGlobal), a.cancel())
  14160. }
  14161. }, this);
  14162. this.jobs[this.isIndent ? 10 : 30] = {
  14163. refresh: this.isIndent ? function(a, b) {
  14164. var c = this.getContext(b),
  14165. d = CKEDITOR.plugins.indentList.firstItemInPath(this.context, b, c);
  14166. return c && this.isIndent && !d ? l : m
  14167. } : function(a, b) {
  14168. return !this.getContext(b) || this.isIndent ? m : l
  14169. },
  14170. exec: CKEDITOR.tools.bind(a, this)
  14171. }
  14172. }
  14173. var e = CKEDITOR.plugins.indent;
  14174. e.registerCommands(b, {
  14175. indentlist: new c(b, "indentlist", !0),
  14176. outdentlist: new c(b, "outdentlist")
  14177. });
  14178. CKEDITOR.tools.extend(c.prototype,
  14179. e.specificDefinition.prototype, {
  14180. context: {
  14181. ol: 1,
  14182. ul: 1
  14183. }
  14184. })
  14185. }
  14186. });
  14187. CKEDITOR.plugins.indentList = {};
  14188. CKEDITOR.plugins.indentList.firstItemInPath = function(a, b, c) {
  14189. var e = b.contains(f);
  14190. c || (c = b.contains(a));
  14191. return c && e && e.equals(c.getFirst(f))
  14192. }
  14193. }(),
  14194. function() {
  14195. function a(a, b, c) {
  14196. function d(c) {
  14197. if (!(!(l = k[c ? "getFirst" : "getLast"]()) || l.is && l.isBlockBoundary() || !(m = b.root[c ? "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(!0))) || m.is && m.isBlockBoundary({
  14198. br: 1
  14199. }))) a.document.createElement("br")[c ? "insertBefore" : "insertAfter"](l)
  14200. }
  14201. for (var e = CKEDITOR.plugins.list.listToArray(b.root, c), f = [], g = 0; g < b.contents.length; g++) {
  14202. var h = b.contents[g];
  14203. (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (f.push(h), CKEDITOR.dom.element.setMarker(c, h, "list_item_processed", !0))
  14204. }
  14205. h = null;
  14206. for (g = 0; g < f.length; g++) h = f[g].getCustomData("listarray_index"), e[h].indent = -1;
  14207. for (g = h + 1; g < e.length; g++)
  14208. if (e[g].indent > e[g - 1].indent + 1) {
  14209. f = e[g - 1].indent + 1 - e[g].indent;
  14210. for (h = e[g].indent; e[g] && e[g].indent >= h;) e[g].indent += f, g++;
  14211. g--
  14212. }
  14213. var k = CKEDITOR.plugins.list.arrayToList(e,
  14214. c, null, a.config.enterMode, b.root.getAttribute("dir")).listNode,
  14215. l, m;
  14216. d(!0);
  14217. d();
  14218. k.replace(b.root);
  14219. a.fire("contentDomInvalidated")
  14220. }
  14221. function f(a, b) {
  14222. this.name = a;
  14223. this.context = this.type = b;
  14224. this.allowedContent = b + " li";
  14225. this.requiredContent = b
  14226. }
  14227. function b(a, b, c, d) {
  14228. for (var e, f; e = a[d ? "getLast" : "getFirst"](q);)(f = e.getDirection(1)) !== b.getDirection(1) && e.setAttribute("dir", f), e.remove(), c ? e[d ? "insertBefore" : "insertAfter"](c) : b.append(e, d)
  14229. }
  14230. function c(a) {
  14231. function c(d) {
  14232. var e = a[d ? "getPrevious" : "getNext"](g);
  14233. e && e.type ==
  14234. CKEDITOR.NODE_ELEMENT && e.is(a.getName()) && (b(a, e, null, !d), a.remove(), a = e)
  14235. }
  14236. c();
  14237. c(1)
  14238. }
  14239. function e(a) {
  14240. return a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in CKEDITOR.dtd.$block || a.getName() in CKEDITOR.dtd.$listItem) && CKEDITOR.dtd[a.getName()]["#"]
  14241. }
  14242. function m(a, d, e) {
  14243. a.fire("saveSnapshot");
  14244. e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
  14245. var f = e.extractContents();
  14246. d.trim(!1, !0);
  14247. var h = d.createBookmark(),
  14248. k = new CKEDITOR.dom.elementPath(d.startContainer),
  14249. m = k.block,
  14250. k = k.lastElement.getAscendant("li", 1) || m,
  14251. q = new CKEDITOR.dom.elementPath(e.startContainer),
  14252. w = q.contains(CKEDITOR.dtd.$listItem),
  14253. q = q.contains(CKEDITOR.dtd.$list);
  14254. m ? (m = m.getBogus()) && m.remove() : q && (m = q.getPrevious(g)) && n(m) && m.remove();
  14255. (m = f.getLast()) && m.type == CKEDITOR.NODE_ELEMENT && m.is("br") && m.remove();
  14256. (m = d.startContainer.getChild(d.startOffset)) ? f.insertBefore(m): d.startContainer.append(f);
  14257. w && (f = l(w)) && (k.contains(w) ? (b(f, w.getParent(), w), f.remove()) : k.append(f));
  14258. for (; e.checkStartOfBlock() && e.checkEndOfBlock();) {
  14259. q = e.startPath();
  14260. f = q.block;
  14261. if (!f) break;
  14262. f.is("li") && (k = f.getParent(), f.equals(k.getLast(g)) &&
  14263. f.equals(k.getFirst(g)) && (f = k));
  14264. e.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START);
  14265. f.remove()
  14266. }
  14267. e = e.clone();
  14268. f = a.editable();
  14269. e.setEndAt(f, CKEDITOR.POSITION_BEFORE_END);
  14270. e = new CKEDITOR.dom.walker(e);
  14271. e.evaluator = function(a) {
  14272. return g(a) && !n(a)
  14273. };
  14274. (e = e.next()) && e.type == CKEDITOR.NODE_ELEMENT && e.getName() in CKEDITOR.dtd.$list && c(e);
  14275. d.moveToBookmark(h);
  14276. d.select();
  14277. a.fire("saveSnapshot")
  14278. }
  14279. function l(a) {
  14280. return (a = a.getLast(g)) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in d ? a : null
  14281. }
  14282. var d = {
  14283. ol: 1,
  14284. ul: 1
  14285. },
  14286. h = CKEDITOR.dom.walker.whitespaces(),
  14287. k = CKEDITOR.dom.walker.bookmark(),
  14288. g = function(a) {
  14289. return !(h(a) || k(a))
  14290. },
  14291. n = CKEDITOR.dom.walker.bogus();
  14292. CKEDITOR.plugins.list = {
  14293. listToArray: function(a, b, c, e, f) {
  14294. if (!d[a.getName()]) return [];
  14295. e || (e = 0);
  14296. c || (c = []);
  14297. for (var g = 0, h = a.getChildCount(); g < h; g++) {
  14298. var k = a.getChild(g);
  14299. k.type == CKEDITOR.NODE_ELEMENT && k.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(k, b, c, e + 1);
  14300. if ("li" == k.$.nodeName.toLowerCase()) {
  14301. var l = {
  14302. parent: a,
  14303. indent: e,
  14304. element: k,
  14305. contents: []
  14306. };
  14307. f ? l.grandparent = f : (l.grandparent = a.getParent(),
  14308. l.grandparent && "li" == l.grandparent.$.nodeName.toLowerCase() && (l.grandparent = l.grandparent.getParent()));
  14309. b && CKEDITOR.dom.element.setMarker(b, k, "listarray_index", c.length);
  14310. c.push(l);
  14311. for (var m = 0, n = k.getChildCount(), q; m < n; m++) q = k.getChild(m), q.type == CKEDITOR.NODE_ELEMENT && d[q.getName()] ? CKEDITOR.plugins.list.listToArray(q, b, c, e + 1, l.grandparent) : l.contents.push(q)
  14312. }
  14313. }
  14314. return c
  14315. },
  14316. arrayToList: function(a, b, c, e, f) {
  14317. c || (c = 0);
  14318. if (!a || a.length < c + 1) return null;
  14319. for (var h, l = a[c].parent.getDocument(), m = new CKEDITOR.dom.documentFragment(l),
  14320. n = null, q = c, w = Math.max(a[c].indent, 0), C = null, F, G, I = e == CKEDITOR.ENTER_P ? "p" : "div";;) {
  14321. var H = a[q];
  14322. h = H.grandparent;
  14323. F = H.element.getDirection(1);
  14324. if (H.indent == w) {
  14325. n && a[q].parent.getName() == n.getName() || (n = a[q].parent.clone(!1, 1), f && n.setAttribute("dir", f), m.append(n));
  14326. C = n.append(H.element.clone(0, 1));
  14327. F != n.getDirection(1) && C.setAttribute("dir", F);
  14328. for (h = 0; h < H.contents.length; h++) C.append(H.contents[h].clone(1, 1));
  14329. q++
  14330. } else if (H.indent == Math.max(w, 0) + 1) H = a[q - 1].element.getDirection(1), q = CKEDITOR.plugins.list.arrayToList(a,
  14331. null, q, e, H != F ? F : null), !C.getChildCount() && CKEDITOR.env.needsNbspFiller && 7 >= l.$.documentMode && C.append(l.createText(" ")), C.append(q.listNode), q = q.nextIndex;
  14332. else if (-1 == H.indent && !c && h) {
  14333. d[h.getName()] ? (C = H.element.clone(!1, !0), F != h.getDirection(1) && C.setAttribute("dir", F)) : C = new CKEDITOR.dom.documentFragment(l);
  14334. var n = h.getDirection(1) != F,
  14335. K = H.element,
  14336. J = K.getAttribute("class"),
  14337. E = K.getAttribute("style"),
  14338. S = C.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (e != CKEDITOR.ENTER_BR || n || E || J),
  14339. O, T = H.contents.length,
  14340. M;
  14341. for (h = 0; h < T; h++)
  14342. if (O = H.contents[h], k(O) && 1 < T) S ? M = O.clone(1, 1) : C.append(O.clone(1, 1));
  14343. else if (O.type == CKEDITOR.NODE_ELEMENT && O.isBlockBoundary()) {
  14344. n && !O.getDirection() && O.setAttribute("dir", F);
  14345. G = O;
  14346. var V = K.getAttribute("style");
  14347. V && G.setAttribute("style", V.replace(/([^;])$/, "$1;") + (G.getAttribute("style") || ""));
  14348. J && O.addClass(J);
  14349. G = null;
  14350. M && (C.append(M), M = null);
  14351. C.append(O.clone(1, 1))
  14352. } else S ? (G || (G = l.createElement(I), C.append(G), n && G.setAttribute("dir", F)), E && G.setAttribute("style", E), J && G.setAttribute("class",
  14353. J), M && (G.append(M), M = null), G.append(O.clone(1, 1))) : C.append(O.clone(1, 1));
  14354. M && ((G || C).append(M), M = null);
  14355. C.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && q != a.length - 1 && (CKEDITOR.env.needsBrFiller && (F = C.getLast()) && F.type == CKEDITOR.NODE_ELEMENT && F.is("br") && F.remove(), (F = C.getLast(g)) && F.type == CKEDITOR.NODE_ELEMENT && F.is(CKEDITOR.dtd.$block) || C.append(l.createElement("br")));
  14356. F = C.$.nodeName.toLowerCase();
  14357. "div" != F && "p" != F || C.appendBogus();
  14358. m.append(C);
  14359. n = null;
  14360. q++
  14361. } else return null;
  14362. G = null;
  14363. if (a.length <= q || Math.max(a[q].indent,
  14364. 0) < w) break
  14365. }
  14366. if (b)
  14367. for (a = m.getFirst(); a;) {
  14368. if (a.type == CKEDITOR.NODE_ELEMENT && (CKEDITOR.dom.element.clearMarkers(b, a), a.getName() in CKEDITOR.dtd.$listItem && (c = a, l = f = e = void 0, e = c.getDirection()))) {
  14369. for (f = c.getParent(); f && !(l = f.getDirection());) f = f.getParent();
  14370. e == l && c.removeAttribute("dir")
  14371. }
  14372. a = a.getNextSourceNode()
  14373. }
  14374. return {
  14375. listNode: m,
  14376. nextIndex: q
  14377. }
  14378. }
  14379. };
  14380. var w = /^h[1-6]$/,
  14381. q = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
  14382. f.prototype = {
  14383. exec: function(b) {
  14384. this.refresh(b, b.elementPath());
  14385. var e = b.config,
  14386. f = b.getSelection(),
  14387. h = f && f.getRanges();
  14388. if (this.state == CKEDITOR.TRISTATE_OFF) {
  14389. var k = b.editable();
  14390. if (k.getFirst(g)) {
  14391. var l = 1 == h.length && h[0];
  14392. (e = l && l.getEnclosedNode()) && e.is && this.type == e.getName() && this.setState(CKEDITOR.TRISTATE_ON)
  14393. } else e.enterMode == CKEDITOR.ENTER_BR ? k.appendBogus() : h[0].fixBlock(1, e.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), f.selectRanges(h)
  14394. }
  14395. for (var e = f.createBookmarks(!0), k = [], m = {}, h = h.createIterator(), n = 0;
  14396. (l = h.getNextRange()) && ++n;) {
  14397. var q = l.getBoundaryNodes(),
  14398. x = q.startNode,
  14399. A = q.endNode;
  14400. x.type == CKEDITOR.NODE_ELEMENT &&
  14401. "td" == x.getName() && l.setStartAt(q.startNode, CKEDITOR.POSITION_AFTER_START);
  14402. A.type == CKEDITOR.NODE_ELEMENT && "td" == A.getName() && l.setEndAt(q.endNode, CKEDITOR.POSITION_BEFORE_END);
  14403. l = l.createIterator();
  14404. for (l.forceBrBreak = this.state == CKEDITOR.TRISTATE_OFF; q = l.getNextParagraph();)
  14405. if (!q.getCustomData("list_block")) {
  14406. CKEDITOR.dom.element.setMarker(m, q, "list_block", 1);
  14407. for (var C = b.elementPath(q), x = C.elements, A = 0, C = C.blockLimit, F, G = x.length - 1; 0 <= G && (F = x[G]); G--)
  14408. if (d[F.getName()] && C.contains(F)) {
  14409. C.removeCustomData("list_group_object_" +
  14410. n);
  14411. (x = F.getCustomData("list_group_object")) ? x.contents.push(q): (x = {
  14412. root: F,
  14413. contents: [q]
  14414. }, k.push(x), CKEDITOR.dom.element.setMarker(m, F, "list_group_object", x));
  14415. A = 1;
  14416. break
  14417. }
  14418. A || (A = C, A.getCustomData("list_group_object_" + n) ? A.getCustomData("list_group_object_" + n).contents.push(q) : (x = {
  14419. root: A,
  14420. contents: [q]
  14421. }, CKEDITOR.dom.element.setMarker(m, A, "list_group_object_" + n, x), k.push(x)))
  14422. }
  14423. }
  14424. for (F = []; 0 < k.length;)
  14425. if (x = k.shift(), this.state == CKEDITOR.TRISTATE_OFF)
  14426. if (d[x.root.getName()]) {
  14427. h = b;
  14428. n = x;
  14429. x = m;
  14430. l = F;
  14431. A = CKEDITOR.plugins.list.listToArray(n.root,
  14432. x);
  14433. C = [];
  14434. for (q = 0; q < n.contents.length; q++) G = n.contents[q], (G = G.getAscendant("li", !0)) && !G.getCustomData("list_item_processed") && (C.push(G), CKEDITOR.dom.element.setMarker(x, G, "list_item_processed", !0));
  14435. for (var G = n.root.getDocument(), I = void 0, H = void 0, q = 0; q < C.length; q++) {
  14436. var K = C[q].getCustomData("listarray_index"),
  14437. I = A[K].parent;
  14438. I.is(this.type) || (H = G.createElement(this.type), I.copyAttributes(H, {
  14439. start: 1,
  14440. type: 1
  14441. }), H.removeStyle("list-style-type"), A[K].parent = H)
  14442. }
  14443. x = CKEDITOR.plugins.list.arrayToList(A, x, null,
  14444. h.config.enterMode);
  14445. A = void 0;
  14446. C = x.listNode.getChildCount();
  14447. for (q = 0; q < C && (A = x.listNode.getChild(q)); q++) A.getName() == this.type && l.push(A);
  14448. x.listNode.replace(n.root);
  14449. h.fire("contentDomInvalidated")
  14450. } else {
  14451. A = b;
  14452. l = x;
  14453. q = F;
  14454. C = l.contents;
  14455. h = l.root.getDocument();
  14456. n = [];
  14457. 1 == C.length && C[0].equals(l.root) && (x = h.createElement("div"), C[0].moveChildren && C[0].moveChildren(x), C[0].append(x), C[0] = x);
  14458. l = l.contents[0].getParent();
  14459. for (G = 0; G < C.length; G++) l = l.getCommonAncestor(C[G].getParent());
  14460. I = A.config.useComputedState;
  14461. A = x = void 0;
  14462. I = void 0 === I || I;
  14463. for (G = 0; G < C.length; G++)
  14464. for (H = C[G]; K = H.getParent();) {
  14465. if (K.equals(l)) {
  14466. n.push(H);
  14467. !A && H.getDirection() && (A = 1);
  14468. H = H.getDirection(I);
  14469. null !== x && (x = x && x != H ? null : H);
  14470. break
  14471. }
  14472. H = K
  14473. }
  14474. if (!(1 > n.length)) {
  14475. C = n[n.length - 1].getNext();
  14476. G = h.createElement(this.type);
  14477. q.push(G);
  14478. for (I = q = void 0; n.length;) q = n.shift(), I = h.createElement("li"), H = q, H.is("pre") || w.test(H.getName()) || "false" == H.getAttribute("contenteditable") ? q.appendTo(I) : (q.copyAttributes(I), x && q.getDirection() && (I.removeStyle("direction"), I.removeAttribute("dir")),
  14479. q.moveChildren(I), q.remove()), I.appendTo(G);
  14480. x && A && G.setAttribute("dir", x);
  14481. C ? G.insertBefore(C) : G.appendTo(l)
  14482. }
  14483. } else this.state == CKEDITOR.TRISTATE_ON && d[x.root.getName()] && a.call(this, b, x, m);
  14484. for (G = 0; G < F.length; G++) c(F[G]);
  14485. CKEDITOR.dom.element.clearAllMarkers(m);
  14486. f.selectBookmarks(e);
  14487. b.focus()
  14488. },
  14489. refresh: function(a, b) {
  14490. var c = b.contains(d, 1),
  14491. e = b.blockLimit || b.root;
  14492. c && e.contains(c) ? this.setState(c.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF)
  14493. }
  14494. };
  14495. CKEDITOR.plugins.add("list", {
  14496. requires: "indentlist",
  14497. init: function(a) {
  14498. a.blockless || (a.addCommand("numberedlist", new f("numberedlist", "ol")), a.addCommand("bulletedlist", new f("bulletedlist", "ul")), a.ui.addButton && (a.ui.addButton("NumberedList", {
  14499. label: a.lang.list.numberedlist,
  14500. command: "numberedlist",
  14501. directional: !0,
  14502. toolbar: "list,10"
  14503. }), a.ui.addButton("BulletedList", {
  14504. label: a.lang.list.bulletedlist,
  14505. command: "bulletedlist",
  14506. directional: !0,
  14507. toolbar: "list,20"
  14508. })), a.on("key", function(b) {
  14509. var c = b.data.domEvent.getKey(),
  14510. f;
  14511. if ("wysiwyg" == a.mode &&
  14512. c in {
  14513. 8: 1,
  14514. 46: 1
  14515. }) {
  14516. var h = a.getSelection().getRanges()[0],
  14517. k = h && h.startPath();
  14518. if (h && h.collapsed) {
  14519. var q = 8 == c,
  14520. w = a.editable(),
  14521. D = new CKEDITOR.dom.walker(h.clone());
  14522. D.evaluator = function(a) {
  14523. return g(a) && !n(a)
  14524. };
  14525. D.guard = function(a, b) {
  14526. return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table"))
  14527. };
  14528. c = h.clone();
  14529. if (q) {
  14530. var x;
  14531. (x = k.contains(d)) && h.checkBoundaryOfElement(x, CKEDITOR.START) && (x = x.getParent()) && x.is("li") && (x = l(x)) ? (f = x, x = x.getPrevious(g), c.moveToPosition(x && n(x) ? x : f, CKEDITOR.POSITION_BEFORE_START)) : (D.range.setStartAt(w,
  14532. CKEDITOR.POSITION_AFTER_START), D.range.setEnd(h.startContainer, h.startOffset), (x = D.previous()) && x.type == CKEDITOR.NODE_ELEMENT && (x.getName() in d || x.is("li")) && (x.is("li") || (D.range.selectNodeContents(x), D.reset(), D.evaluator = e, x = D.previous()), f = x, c.moveToElementEditEnd(f), c.moveToPosition(c.endPath().block, CKEDITOR.POSITION_BEFORE_END)));
  14533. if (f) m(a, c, h), b.cancel();
  14534. else {
  14535. var A = k.contains(d);
  14536. A && h.checkBoundaryOfElement(A, CKEDITOR.START) && (f = A.getFirst(g), h.checkBoundaryOfElement(f, CKEDITOR.START) && (x = A.getPrevious(g),
  14537. l(f) ? x && (h.moveToElementEditEnd(x), h.select()) : a.execCommand("outdent"), b.cancel()))
  14538. }
  14539. } else if (f = k.contains("li")) {
  14540. if (D.range.setEndAt(w, CKEDITOR.POSITION_BEFORE_END), q = (w = f.getLast(g)) && e(w) ? w : f, k = 0, (x = D.next()) && x.type == CKEDITOR.NODE_ELEMENT && x.getName() in d && x.equals(w) ? (k = 1, x = D.next()) : h.checkBoundaryOfElement(q, CKEDITOR.END) && (k = 2), k && x) {
  14541. h = h.clone();
  14542. h.moveToElementEditStart(x);
  14543. if (1 == k && (c.optimize(), !c.startContainer.equals(f))) {
  14544. for (f = c.startContainer; f.is(CKEDITOR.dtd.$inline);) A = f, f = f.getParent();
  14545. A && c.moveToPosition(A, CKEDITOR.POSITION_AFTER_END)
  14546. }
  14547. 2 == k && (c.moveToPosition(c.endPath().block, CKEDITOR.POSITION_BEFORE_END), h.endPath().block && h.moveToPosition(h.endPath().block, CKEDITOR.POSITION_AFTER_START));
  14548. m(a, c, h);
  14549. b.cancel()
  14550. }
  14551. } else D.range.setEndAt(w, CKEDITOR.POSITION_BEFORE_END), (x = D.next()) && x.type == CKEDITOR.NODE_ELEMENT && x.is(d) && (x = x.getFirst(g), k.block && h.checkStartOfBlock() && h.checkEndOfBlock() ? (k.block.remove(), h.moveToElementEditStart(x), h.select()) : l(x) ? (h.moveToElementEditStart(x), h.select()) :
  14552. (h = h.clone(), h.moveToElementEditStart(x), m(a, c, h)), b.cancel());
  14553. setTimeout(function() {
  14554. a.selectionChange(1)
  14555. })
  14556. }
  14557. }
  14558. }))
  14559. }
  14560. })
  14561. }(),
  14562. function() {
  14563. function a(a, b, c) {
  14564. c = a.config.forceEnterMode || c;
  14565. "wysiwyg" == a.mode && (b || (b = a.activeEnterMode), a.elementPath().isContextFor("p") || (b = CKEDITOR.ENTER_BR, c = 1), a.fire("saveSnapshot"), b == CKEDITOR.ENTER_BR ? l(a, b, null, c) : d(a, b, null, c), a.fire("saveSnapshot"))
  14566. }
  14567. function f(a) {
  14568. a = a.getSelection().getRanges(!0);
  14569. for (var b = a.length - 1; 0 < b; b--) a[b].deleteContents();
  14570. return a[0]
  14571. }
  14572. function b(a) {
  14573. var b =
  14574. a.startContainer.getAscendant(function(a) {
  14575. return a.type == CKEDITOR.NODE_ELEMENT && "true" == a.getAttribute("contenteditable")
  14576. }, !0);
  14577. if (a.root.equals(b)) return a;
  14578. b = new CKEDITOR.dom.range(b);
  14579. b.moveToRange(a);
  14580. return b
  14581. }
  14582. CKEDITOR.plugins.add("enterkey", {
  14583. init: function(b) {
  14584. b.addCommand("enter", {
  14585. modes: {
  14586. wysiwyg: 1
  14587. },
  14588. editorFocus: !1,
  14589. exec: function(b) {
  14590. a(b)
  14591. }
  14592. });
  14593. b.addCommand("shiftEnter", {
  14594. modes: {
  14595. wysiwyg: 1
  14596. },
  14597. editorFocus: !1,
  14598. exec: function(b) {
  14599. a(b, b.activeShiftEnterMode, 1)
  14600. }
  14601. });
  14602. b.setKeystroke([
  14603. [13, "enter"],
  14604. [CKEDITOR.SHIFT + 13, "shiftEnter"]
  14605. ])
  14606. }
  14607. });
  14608. var c = CKEDITOR.dom.walker.whitespaces(),
  14609. e = CKEDITOR.dom.walker.bookmark();
  14610. CKEDITOR.plugins.enterkey = {
  14611. enterBlock: function(a, d, m, w) {
  14612. if (m = m || f(a)) {
  14613. m = b(m);
  14614. var q = m.document,
  14615. v = m.checkStartOfBlock(),
  14616. u = m.checkEndOfBlock(),
  14617. r = a.elementPath(m.startContainer),
  14618. p = r.block,
  14619. z = d == CKEDITOR.ENTER_DIV ? "div" : "p",
  14620. B;
  14621. if (v && u) {
  14622. if (p && (p.is("li") || p.getParent().is("li"))) {
  14623. p.is("li") || (p = p.getParent());
  14624. m = p.getParent();
  14625. B = m.getParent();
  14626. w = !p.hasPrevious();
  14627. var t = !p.hasNext(),
  14628. z = a.getSelection(),
  14629. y = z.createBookmarks(),
  14630. v = p.getDirection(1),
  14631. u = p.getAttribute("class"),
  14632. D = p.getAttribute("style"),
  14633. x = B.getDirection(1) != v;
  14634. a = a.enterMode != CKEDITOR.ENTER_BR || x || D || u;
  14635. if (B.is("li")) w || t ? (w && t && m.remove(), p[t ? "insertAfter" : "insertBefore"](B)) : p.breakParent(B);
  14636. else {
  14637. if (a)
  14638. if (r.block.is("li") ? (B = q.createElement(d == CKEDITOR.ENTER_P ? "p" : "div"), x && B.setAttribute("dir", v), D && B.setAttribute("style", D), u && B.setAttribute("class", u), p.moveChildren(B)) : B = r.block, w || t) B[w ? "insertBefore" : "insertAfter"](m);
  14639. else p.breakParent(m), B.insertAfter(m);
  14640. else if (p.appendBogus(!0),
  14641. w || t)
  14642. for (; q = p[w ? "getFirst" : "getLast"]();) q[w ? "insertBefore" : "insertAfter"](m);
  14643. else
  14644. for (p.breakParent(m); q = p.getLast();) q.insertAfter(m);
  14645. p.remove()
  14646. }
  14647. z.selectBookmarks(y);
  14648. return
  14649. }
  14650. if (p && p.getParent().is("blockquote")) {
  14651. p.breakParent(p.getParent());
  14652. p.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || p.getPrevious().remove();
  14653. p.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || p.getNext().remove();
  14654. m.moveToElementEditStart(p);
  14655. m.select();
  14656. return
  14657. }
  14658. } else if (p && p.is("pre") && !u) {
  14659. l(a, d, m, w);
  14660. return
  14661. }
  14662. if (v =
  14663. m.splitBlock(z)) {
  14664. d = v.previousBlock;
  14665. p = v.nextBlock;
  14666. r = v.wasStartOfBlock;
  14667. a = v.wasEndOfBlock;
  14668. p ? (y = p.getParent(), y.is("li") && (p.breakParent(y), p.move(p.getNext(), 1))) : d && (y = d.getParent()) && y.is("li") && (d.breakParent(y), y = d.getNext(), m.moveToElementEditStart(y), d.move(d.getPrevious()));
  14669. if (r || a) {
  14670. if (d) {
  14671. if (d.is("li") || !h.test(d.getName()) && !d.is("pre")) B = d.clone()
  14672. } else p && (B = p.clone());
  14673. B ? w && !B.is("li") && B.renameNode(z) : y && y.is("li") ? B = y : (B = q.createElement(z), d && (t = d.getDirection()) && B.setAttribute("dir", t));
  14674. if (q = v.elementPath)
  14675. for (w = 0, z = q.elements.length; w < z; w++) {
  14676. y = q.elements[w];
  14677. if (y.equals(q.block) || y.equals(q.blockLimit)) break;
  14678. CKEDITOR.dtd.$removeEmpty[y.getName()] && (y = y.clone(), B.moveChildren(y), B.append(y))
  14679. }
  14680. B.appendBogus();
  14681. B.getParent() || m.insertNode(B);
  14682. B.is("li") && B.removeAttribute("value");
  14683. !CKEDITOR.env.ie || !r || a && d.getChildCount() || (m.moveToElementEditStart(a ? d : B), m.select());
  14684. m.moveToElementEditStart(r && !a ? p : B)
  14685. } else p.is("li") && (B = m.clone(), B.selectNodeContents(p), B = new CKEDITOR.dom.walker(B),
  14686. B.evaluator = function(a) {
  14687. return !(e(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in CKEDITOR.dtd.$empty))
  14688. }, (y = B.next()) && y.type == CKEDITOR.NODE_ELEMENT && y.is("ul", "ol") && (CKEDITOR.env.needsBrFiller ? q.createElement("br") : q.createText(" ")).insertBefore(y)), p && m.moveToElementEditStart(p);
  14689. m.select();
  14690. m.scrollIntoView()
  14691. }
  14692. }
  14693. },
  14694. enterBr: function(a, b, c, e) {
  14695. if (c = c || f(a)) {
  14696. var l = c.document,
  14697. m = c.checkEndOfBlock(),
  14698. u = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),
  14699. r = u.block,
  14700. p = r && u.block.getName();
  14701. e || "li" != p ? (!e && m && h.test(p) ? (m = r.getDirection()) ? (l = l.createElement("div"), l.setAttribute("dir", m), l.insertAfter(r), c.setStart(l, 0)) : (l.createElement("br").insertAfter(r), CKEDITOR.env.gecko && l.createText("").insertAfter(r), c.setStartAt(r.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)) : (a = "pre" == p && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? l.createText("\r") : l.createElement("br"), c.deleteContents(), c.insertNode(a), CKEDITOR.env.needsBrFiller ?
  14702. (l.createText("").insertAfter(a), m && (r || u.blockLimit).appendBogus(), a.getNext().$.nodeValue = "", c.setStartAt(a.getNext(), CKEDITOR.POSITION_AFTER_START)) : c.setStartAt(a, CKEDITOR.POSITION_AFTER_END)), c.collapse(!0), c.select(), c.scrollIntoView()) : d(a, b, c, e)
  14703. }
  14704. }
  14705. };
  14706. var m = CKEDITOR.plugins.enterkey,
  14707. l = m.enterBr,
  14708. d = m.enterBlock,
  14709. h = /^h[1-6]$/
  14710. }(),
  14711. function() {
  14712. function a(a, b) {
  14713. var c = {},
  14714. e = [],
  14715. m = {
  14716. nbsp: " ",
  14717. shy: "­",
  14718. gt: "\x3e",
  14719. lt: "\x3c",
  14720. amp: "\x26",
  14721. apos: "'",
  14722. quot: '"'
  14723. };
  14724. a = a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function(a,
  14725. d) {
  14726. var f = b ? "\x26" + d + ";" : m[d];
  14727. c[f] = b ? m[d] : "\x26" + d + ";";
  14728. e.push(f);
  14729. return ""
  14730. });
  14731. if (!b && a) {
  14732. a = a.split(",");
  14733. var l = document.createElement("div"),
  14734. d;
  14735. l.innerHTML = "\x26" + a.join(";\x26") + ";";
  14736. d = l.innerHTML;
  14737. l = null;
  14738. for (l = 0; l < d.length; l++) {
  14739. var h = d.charAt(l);
  14740. c[h] = "\x26" + a[l] + ";";
  14741. e.push(h)
  14742. }
  14743. }
  14744. c.regex = e.join(b ? "|" : "");
  14745. return c
  14746. }
  14747. CKEDITOR.plugins.add("entities", {
  14748. afterInit: function(f) {
  14749. function b(a) {
  14750. return h[a]
  14751. }
  14752. function c(a) {
  14753. return "force" != e.entities_processNumerical && l[a] ? l[a] : "\x26#" + a.charCodeAt(0) + ";"
  14754. }
  14755. var e = f.config;
  14756. if (f =
  14757. (f = f.dataProcessor) && f.htmlFilter) {
  14758. var m = [];
  14759. !1 !== e.basicEntities && m.push("nbsp,gt,lt,amp");
  14760. e.entities && (m.length && m.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"),
  14761. e.entities_latin && m.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"), e.entities_greek && m.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"),
  14762. e.entities_additional && m.push(e.entities_additional));
  14763. var l = a(m.join(",")),
  14764. d = l.regex ? "[" + l.regex + "]" : "a^";
  14765. delete l.regex;
  14766. e.entities && e.entities_processNumerical && (d = "[^ -~]|" + d);
  14767. var d = new RegExp(d, "g"),
  14768. h = a("nbsp,gt,lt,amp,shy", !0),
  14769. k = new RegExp(h.regex, "g");
  14770. f.addRules({
  14771. text: function(a) {
  14772. return a.replace(k, b).replace(d, c)
  14773. }
  14774. }, {
  14775. applyToAll: !0,
  14776. excludeNestedEditable: !0
  14777. })
  14778. }
  14779. }
  14780. })
  14781. }(), CKEDITOR.config.basicEntities = !0, CKEDITOR.config.entities = !0, CKEDITOR.config.entities_latin = !0, CKEDITOR.config.entities_greek = !0,
  14782. CKEDITOR.config.entities_additional = "#39", CKEDITOR.plugins.add("popup"), CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  14783. popup: function(a, f, b, c) {
  14784. f = f || "80%";
  14785. b = b || "70%";
  14786. "string" == typeof f && 1 < f.length && "%" == f.substr(f.length - 1, 1) && (f = parseInt(window.screen.width * parseInt(f, 10) / 100, 10));
  14787. "string" == typeof b && 1 < b.length && "%" == b.substr(b.length - 1, 1) && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10));
  14788. 640 > f && (f = 640);
  14789. 420 > b && (b = 420);
  14790. var e = parseInt((window.screen.height - b) / 2, 10),
  14791. m = parseInt((window.screen.width -
  14792. f) / 2, 10);
  14793. c = (c || "location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes") + ",width\x3d" + f + ",height\x3d" + b + ",top\x3d" + e + ",left\x3d" + m;
  14794. var l = window.open("", null, c, !0);
  14795. if (!l) return !1;
  14796. try {
  14797. -1 == navigator.userAgent.toLowerCase().indexOf(" chrome/") && (l.moveTo(m, e), l.resizeTo(f, b)), l.focus(), l.location.href = a
  14798. } catch (d) {
  14799. window.open(a, null, c, !0)
  14800. }
  14801. return !0
  14802. }
  14803. }),
  14804. function() {
  14805. function a(a, b) {
  14806. var c = [];
  14807. if (b)
  14808. for (var d in b) c.push(d +
  14809. "\x3d" + encodeURIComponent(b[d]));
  14810. else return a;
  14811. return a + (-1 != a.indexOf("?") ? "\x26" : "?") + c.join("\x26")
  14812. }
  14813. function f(a) {
  14814. a += "";
  14815. return a.charAt(0).toUpperCase() + a.substr(1)
  14816. }
  14817. function b() {
  14818. var b = this.getDialog(),
  14819. c = b.getParentEditor();
  14820. c._.filebrowserSe = this;
  14821. var d = c.config["filebrowser" + f(b.getName()) + "WindowWidth"] || c.config.filebrowserWindowWidth || "80%",
  14822. b = c.config["filebrowser" + f(b.getName()) + "WindowHeight"] || c.config.filebrowserWindowHeight || "70%",
  14823. e = this.filebrowser.params || {};
  14824. e.CKEditor = c.name;
  14825. e.CKEditorFuncNum =
  14826. c._.filebrowserFn;
  14827. e.langCode || (e.langCode = c.langCode);
  14828. e = a(this.filebrowser.url, e);
  14829. c.popup(e, d, b, c.config.filebrowserWindowFeatures || c.config.fileBrowserWindowFeatures)
  14830. }
  14831. function c() {
  14832. var a = this.getDialog();
  14833. a.getParentEditor()._.filebrowserSe = this;
  14834. return a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value && a.getContentElement(this["for"][0], this["for"][1]).getAction() ? !0 : !1
  14835. }
  14836. function e(b, c, d) {
  14837. var e = d.params || {};
  14838. e.CKEditor = b.name;
  14839. e.CKEditorFuncNum = b._.filebrowserFn;
  14840. e.langCode ||
  14841. (e.langCode = b.langCode);
  14842. c.action = a(d.url, e);
  14843. c.filebrowser = d
  14844. }
  14845. function m(a, d, g, l) {
  14846. if (l && l.length)
  14847. for (var w, q = l.length; q--;)
  14848. if (w = l[q], "hbox" != w.type && "vbox" != w.type && "fieldset" != w.type || m(a, d, g, w.children), w.filebrowser)
  14849. if ("string" == typeof w.filebrowser && (w.filebrowser = {
  14850. action: "fileButton" == w.type ? "QuickUpload" : "Browse",
  14851. target: w.filebrowser
  14852. }), "Browse" == w.filebrowser.action) {
  14853. var v = w.filebrowser.url;
  14854. void 0 === v && (v = a.config["filebrowser" + f(d) + "BrowseUrl"], void 0 === v && (v = a.config.filebrowserBrowseUrl));
  14855. v && (w.onClick = b, w.filebrowser.url = v, w.hidden = !1)
  14856. } else if ("QuickUpload" == w.filebrowser.action && w["for"] && (v = w.filebrowser.url, void 0 === v && (v = a.config["filebrowser" + f(d) + "UploadUrl"], void 0 === v && (v = a.config.filebrowserUploadUrl)), v)) {
  14857. var u = w.onClick;
  14858. w.onClick = function(a) {
  14859. var b = a.sender;
  14860. if (u && !1 === u.call(b, a)) return !1;
  14861. if (c.call(b, a)) {
  14862. a = b.getDialog().getContentElement(this["for"][0], this["for"][1]).getInputElement();
  14863. if (b = new CKEDITOR.dom.element(a.$.form))(a = b.$.elements.ckCsrfToken) ? a = new CKEDITOR.dom.element(a) :
  14864. (a = new CKEDITOR.dom.element("input"), a.setAttributes({
  14865. name: "ckCsrfToken",
  14866. type: "hidden"
  14867. }), b.append(a)), a.setAttribute("value", CKEDITOR.tools.getCsrfToken());
  14868. return !0
  14869. }
  14870. return !1
  14871. };
  14872. w.filebrowser.url = v;
  14873. w.hidden = !1;
  14874. e(a, g.getContents(w["for"][0]).get(w["for"][1]), w.filebrowser)
  14875. }
  14876. }
  14877. function l(a, b, c) {
  14878. if (-1 !== c.indexOf(";")) {
  14879. c = c.split(";");
  14880. for (var d = 0; d < c.length; d++)
  14881. if (l(a, b, c[d])) return !0;
  14882. return !1
  14883. }
  14884. return (a = a.getContents(b).get(c).filebrowser) && a.url
  14885. }
  14886. function d(a, b) {
  14887. var c = this._.filebrowserSe.getDialog(),
  14888. d = this._.filebrowserSe["for"],
  14889. e = this._.filebrowserSe.filebrowser.onSelect;
  14890. d && c.getContentElement(d[0], d[1]).reset();
  14891. if ("function" != typeof b || !1 !== b.call(this._.filebrowserSe))
  14892. if (!e || !1 !== e.call(this._.filebrowserSe, a, b))
  14893. if ("string" == typeof b && b && alert(b), a && (d = this._.filebrowserSe, c = d.getDialog(), d = d.filebrowser.target || null))
  14894. if (d = d.split(":"), e = c.getContentElement(d[0], d[1])) e.setValue(a), c.selectPage(d[0])
  14895. }
  14896. CKEDITOR.plugins.add("filebrowser", {
  14897. requires: "popup",
  14898. init: function(a) {
  14899. a._.filebrowserFn = CKEDITOR.tools.addFunction(d, a);
  14900. a.on("destroy", function() {
  14901. CKEDITOR.tools.removeFunction(this._.filebrowserFn)
  14902. })
  14903. }
  14904. });
  14905. CKEDITOR.on("dialogDefinition", function(a) {
  14906. if (a.editor.plugins.filebrowser)
  14907. for (var b = a.data.definition, c, d = 0; d < b.contents.length; ++d)
  14908. if (c = b.contents[d]) m(a.editor, a.data.name, b, c.elements), c.hidden && c.filebrowser && (c.hidden = !l(b, c.id, c.filebrowser))
  14909. })
  14910. }(),
  14911. function() {
  14912. function a(a) {
  14913. var e = a.config,
  14914. m = a.fire("uiSpace", {
  14915. space: "top",
  14916. html: ""
  14917. }).html,
  14918. l = function() {
  14919. function d(a, c, e) {
  14920. h.setStyle(c, b(e));
  14921. h.setStyle("position", a)
  14922. }
  14923. function g(a) {
  14924. var b =
  14925. m.getDocumentPosition();
  14926. switch (a) {
  14927. case "top":
  14928. d("absolute", "top", b.y - z - y);
  14929. break;
  14930. case "pin":
  14931. d("fixed", "top", x);
  14932. break;
  14933. case "bottom":
  14934. d("absolute", "top", b.y + (r.height || r.bottom - r.top) + y)
  14935. }
  14936. k = a
  14937. }
  14938. var k, m, u, r, p, z, B, t = e.floatSpaceDockedOffsetX || 0,
  14939. y = e.floatSpaceDockedOffsetY || 0,
  14940. D = e.floatSpacePinnedOffsetX || 0,
  14941. x = e.floatSpacePinnedOffsetY || 0;
  14942. return function(d) {
  14943. if (m = a.editable()) {
  14944. var n = d && "focus" == d.name;
  14945. n && h.show();
  14946. a.fire("floatingSpaceLayout", {
  14947. show: n
  14948. });
  14949. h.removeStyle("left");
  14950. h.removeStyle("right");
  14951. u = h.getClientRect();
  14952. r = m.getClientRect();
  14953. p = f.getViewPaneSize();
  14954. z = u.height;
  14955. B = "pageXOffset" in f.$ ? f.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft;
  14956. k ? (z + y <= r.top ? g("top") : z + y > p.height - r.bottom ? g("pin") : g("bottom"), d = p.width / 2, d = e.floatSpacePreferRight ? "right" : 0 < r.left && r.right < p.width && r.width > u.width ? "rtl" == e.contentsLangDirection ? "right" : "left" : d - r.left > r.right - d ? "left" : "right", u.width > p.width ? (d = "left", n = 0) : (n = "left" == d ? 0 < r.left ? r.left : 0 : r.right < p.width ? p.width - r.right : 0, n + u.width > p.width && (d = "left" == d ?
  14957. "right" : "left", n = 0)), h.setStyle(d, b(("pin" == k ? D : t) + n + ("pin" == k ? 0 : "left" == d ? B : -B)))) : (k = "pin", g("pin"), l(d))
  14958. }
  14959. }
  14960. }();
  14961. if (m) {
  14962. var d = new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" title\x3d"' + (CKEDITOR.env.gecko ? " " : "") + '" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"' + (a.title ? ' aria-labelledby\x3d"cke_{name}_arialbl"' : " ") + "\x3e" + (a.title ? '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' :
  14963. " ") + '\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),
  14964. h = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(d.output({
  14965. content: m,
  14966. id: a.id,
  14967. langDir: a.lang.dir,
  14968. langCode: a.langCode,
  14969. name: a.name,
  14970. style: "display:none;z-index:" + (e.baseFloatZIndex - 1),
  14971. topId: a.ui.spaceId("top"),
  14972. voiceLabel: a.title
  14973. }))),
  14974. k = CKEDITOR.tools.eventsBuffer(500, l),
  14975. g = CKEDITOR.tools.eventsBuffer(100, l);
  14976. h.unselectable();
  14977. h.on("mousedown",
  14978. function(a) {
  14979. a = a.data;
  14980. a.getTarget().hasAscendant("a", 1) || a.preventDefault()
  14981. });
  14982. a.on("focus", function(b) {
  14983. l(b);
  14984. a.on("change", k.input);
  14985. f.on("scroll", g.input);
  14986. f.on("resize", g.input)
  14987. });
  14988. a.on("blur", function() {
  14989. h.hide();
  14990. a.removeListener("change", k.input);
  14991. f.removeListener("scroll", g.input);
  14992. f.removeListener("resize", g.input)
  14993. });
  14994. a.on("destroy", function() {
  14995. f.removeListener("scroll", g.input);
  14996. f.removeListener("resize", g.input);
  14997. h.clearCustomData();
  14998. h.remove()
  14999. });
  15000. a.focusManager.hasFocus && h.show();
  15001. a.focusManager.add(h,
  15002. 1)
  15003. }
  15004. }
  15005. var f = CKEDITOR.document.getWindow(),
  15006. b = CKEDITOR.tools.cssLength;
  15007. CKEDITOR.plugins.add("floatingspace", {
  15008. init: function(b) {
  15009. b.on("loaded", function() {
  15010. a(this)
  15011. }, null, null, 20)
  15012. }
  15013. })
  15014. }(), CKEDITOR.plugins.add("listblock", {
  15015. requires: "panel",
  15016. onLoad: function() {
  15017. var a = CKEDITOR.addTemplate("panel-list", '\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),
  15018. f = CKEDITOR.addTemplate("panel-list-item", '\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" href\x3d"javascript:void(\'{val}\')" {onclick}\x3d"CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),
  15019. b = CKEDITOR.addTemplate("panel-list-group", '\x3ch1 id\x3d"{id}" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),
  15020. c = /\'/g;
  15021. CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) {
  15022. return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b))
  15023. };
  15024. CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
  15025. base: CKEDITOR.ui.panel.block,
  15026. $: function(a, b) {
  15027. b = b || {};
  15028. var c = b.attributes || (b.attributes = {});
  15029. (this.multiSelect = !!b.multiSelect) && (c["aria-multiselectable"] = !0);
  15030. !c.role &&
  15031. (c.role = "listbox");
  15032. this.base.apply(this, arguments);
  15033. this.element.setAttribute("role", c.role);
  15034. c = this.keys;
  15035. c[40] = "next";
  15036. c[9] = "next";
  15037. c[38] = "prev";
  15038. c[CKEDITOR.SHIFT + 9] = "prev";
  15039. c[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  15040. CKEDITOR.env.ie && (c[13] = "mouseup");
  15041. this._.pendingHtml = [];
  15042. this._.pendingList = [];
  15043. this._.items = {};
  15044. this._.groups = {}
  15045. },
  15046. _: {
  15047. close: function() {
  15048. if (this._.started) {
  15049. var b = a.output({
  15050. items: this._.pendingList.join("")
  15051. });
  15052. this._.pendingList = [];
  15053. this._.pendingHtml.push(b);
  15054. delete this._.started
  15055. }
  15056. },
  15057. getClick: function() {
  15058. this._.click ||
  15059. (this._.click = CKEDITOR.tools.addFunction(function(a) {
  15060. var b = this.toggle(a);
  15061. if (this.onClick) this.onClick(a, b)
  15062. }, this));
  15063. return this._.click
  15064. }
  15065. },
  15066. proto: {
  15067. add: function(a, b, l) {
  15068. var d = CKEDITOR.tools.getNextId();
  15069. this._.started || (this._.started = 1, this._.size = this._.size || 0);
  15070. this._.items[a] = d;
  15071. var h;
  15072. h = CKEDITOR.tools.htmlEncodeAttr(a).replace(c, "\\'");
  15073. a = {
  15074. id: d,
  15075. val: h,
  15076. onclick: CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick",
  15077. clickFn: this._.getClick(),
  15078. title: CKEDITOR.tools.htmlEncodeAttr(l || a),
  15079. text: b || a
  15080. };
  15081. this._.pendingList.push(f.output(a))
  15082. },
  15083. startGroup: function(a) {
  15084. this._.close();
  15085. var c = CKEDITOR.tools.getNextId();
  15086. this._.groups[a] = c;
  15087. this._.pendingHtml.push(b.output({
  15088. id: c,
  15089. label: a
  15090. }))
  15091. },
  15092. commit: function() {
  15093. this._.close();
  15094. this.element.appendHtml(this._.pendingHtml.join(""));
  15095. delete this._.size;
  15096. this._.pendingHtml = []
  15097. },
  15098. toggle: function(a) {
  15099. var b = this.isMarked(a);
  15100. b ? this.unmark(a) : this.mark(a);
  15101. return !b
  15102. },
  15103. hideGroup: function(a) {
  15104. var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext();
  15105. a && (a.setStyle("display",
  15106. "none"), b && "ul" == b.getName() && b.setStyle("display", "none"))
  15107. },
  15108. hideItem: function(a) {
  15109. this.element.getDocument().getById(this._.items[a]).setStyle("display", "none")
  15110. },
  15111. showAll: function() {
  15112. var a = this._.items,
  15113. b = this._.groups,
  15114. c = this.element.getDocument(),
  15115. d;
  15116. for (d in a) c.getById(a[d]).setStyle("display", "");
  15117. for (var f in b) a = c.getById(b[f]), d = a.getNext(), a.setStyle("display", ""), d && "ul" == d.getName() && d.setStyle("display", "")
  15118. },
  15119. mark: function(a) {
  15120. this.multiSelect || this.unmarkAll();
  15121. a = this._.items[a];
  15122. var b = this.element.getDocument().getById(a);
  15123. b.addClass("cke_selected");
  15124. this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", !0);
  15125. this.onMark && this.onMark(b)
  15126. },
  15127. unmark: function(a) {
  15128. var b = this.element.getDocument();
  15129. a = this._.items[a];
  15130. var c = b.getById(a);
  15131. c.removeClass("cke_selected");
  15132. b.getById(a + "_option").removeAttribute("aria-selected");
  15133. this.onUnmark && this.onUnmark(c)
  15134. },
  15135. unmarkAll: function() {
  15136. var a = this._.items,
  15137. b = this.element.getDocument(),
  15138. c;
  15139. for (c in a) {
  15140. var d = a[c];
  15141. b.getById(d).removeClass("cke_selected");
  15142. b.getById(d + "_option").removeAttribute("aria-selected")
  15143. }
  15144. this.onUnmark &&
  15145. this.onUnmark()
  15146. },
  15147. isMarked: function(a) {
  15148. return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")
  15149. },
  15150. focus: function(a) {
  15151. this._.focusIndex = -1;
  15152. var b = this.element.getElementsByTag("a"),
  15153. c, d = -1;
  15154. if (a)
  15155. for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++d);) {
  15156. if (a.equals(c)) {
  15157. this._.focusIndex = d;
  15158. break
  15159. }
  15160. } else this.element.focus();
  15161. c && setTimeout(function() {
  15162. c.focus()
  15163. }, 0)
  15164. }
  15165. }
  15166. })
  15167. }
  15168. }),
  15169. function() {
  15170. var a = '\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"' +
  15171. (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href\x3d\"javascript:void('{titleJs}')\"") + ' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';
  15172. CKEDITOR.env.gecko && CKEDITOR.env.mac && (a += ' onkeypress\x3d"return false;"');
  15173. CKEDITOR.env.gecko && (a += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  15174. var a = a + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" ' +
  15175. (CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"'),
  15176. a = a + '\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',
  15177. f = CKEDITOR.addTemplate("buttonArrow", '\x3cspan class\x3d"cke_button_arrow"\x3e' + (CKEDITOR.env.hc ? "\x26#9660;" : "") + "\x3c/span\x3e"),
  15178. b = CKEDITOR.addTemplate("button", a);
  15179. CKEDITOR.plugins.add("button", {
  15180. beforeInit: function(a) {
  15181. a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler)
  15182. }
  15183. });
  15184. CKEDITOR.UI_BUTTON = "button";
  15185. CKEDITOR.ui.button = function(a) {
  15186. CKEDITOR.tools.extend(this, a, {
  15187. title: a.label,
  15188. click: a.click || function(b) {
  15189. b.execCommand(a.command)
  15190. }
  15191. });
  15192. this._ = {}
  15193. };
  15194. CKEDITOR.ui.button.handler = {
  15195. create: function(a) {
  15196. return new CKEDITOR.ui.button(a)
  15197. }
  15198. };
  15199. CKEDITOR.ui.button.prototype = {
  15200. render: function(a, e) {
  15201. function m() {
  15202. var b = a.mode;
  15203. b && (b = this.modes[b] ? void 0 !== p[b] ? p[b] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, b = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : b, this.setState(b), this.refresh && this.refresh())
  15204. }
  15205. var l = CKEDITOR.env,
  15206. d = this._.id = CKEDITOR.tools.getNextId(),
  15207. h = "",
  15208. k = this.command,
  15209. g, n, w;
  15210. this._.editor = a;
  15211. var q = {
  15212. id: d,
  15213. button: this,
  15214. editor: a,
  15215. focus: function() {
  15216. CKEDITOR.document.getById(d).focus()
  15217. },
  15218. execute: function() {
  15219. this.button.click(a)
  15220. },
  15221. attach: function(a) {
  15222. this.button.attach(a)
  15223. }
  15224. },
  15225. v = CKEDITOR.tools.addFunction(function(a) {
  15226. if (q.onkey) return a = new CKEDITOR.dom.event(a), !1 !== q.onkey(q, a.getKeystroke())
  15227. }),
  15228. u = CKEDITOR.tools.addFunction(function(a) {
  15229. var b;
  15230. q.onfocus && (b = !1 !== q.onfocus(q, new CKEDITOR.dom.event(a)));
  15231. return b
  15232. }),
  15233. r = 0;
  15234. q.clickFn = g = CKEDITOR.tools.addFunction(function() {
  15235. r && (a.unlockSelection(1), r = 0);
  15236. q.execute();
  15237. l.iOS && a.focus()
  15238. });
  15239. if (this.modes) {
  15240. var p = {};
  15241. a.on("beforeModeUnload", function() {
  15242. a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (p[a.mode] = this._.state)
  15243. }, this);
  15244. a.on("activeFilterChange",
  15245. m, this);
  15246. a.on("mode", m, this);
  15247. !this.readOnly && a.on("readOnly", m, this)
  15248. } else k && (k = a.getCommand(k)) && (k.on("state", function() {
  15249. this.setState(k.state)
  15250. }, this), h += k.state == CKEDITOR.TRISTATE_ON ? "on" : k.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off");
  15251. if (this.directional) a.on("contentDirChanged", function(b) {
  15252. var d = CKEDITOR.document.getById(this._.id),
  15253. e = d.getFirst();
  15254. b = b.data;
  15255. b != a.lang.dir ? d.addClass("cke_" + b) : d.removeClass("cke_ltr").removeClass("cke_rtl");
  15256. e.setAttribute("style", CKEDITOR.skin.getIconStyle(z,
  15257. "rtl" == b, this.icon, this.iconOffset))
  15258. }, this);
  15259. k ? (n = a.getCommandKeystroke(k)) && (w = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, n)) : h += "off";
  15260. var z = n = this.name || this.command;
  15261. this.icon && !/\./.test(this.icon) && (z = this.icon, this.icon = null);
  15262. h = {
  15263. id: d,
  15264. name: n,
  15265. iconName: z,
  15266. label: this.label,
  15267. cls: this.className || "",
  15268. state: h,
  15269. ariaDisabled: "disabled" == h ? "true" : "false",
  15270. title: this.title + (w ? " (" + w.display + ")" : ""),
  15271. ariaShortcut: w ? a.lang.common.keyboardShortcut + " " + w.aria : "",
  15272. titleJs: l.gecko && !l.hc ? "" : (this.title ||
  15273. "").replace("'", ""),
  15274. hasArrow: this.hasArrow ? "true" : "false",
  15275. keydownFn: v,
  15276. focusFn: u,
  15277. clickFn: g,
  15278. style: CKEDITOR.skin.getIconStyle(z, "rtl" == a.lang.dir, this.icon, this.iconOffset),
  15279. arrowHtml: this.hasArrow ? f.output() : ""
  15280. };
  15281. b.output(h, e);
  15282. if (this.onRender) this.onRender();
  15283. return q
  15284. },
  15285. setState: function(a) {
  15286. if (this._.state == a) return !1;
  15287. this._.state = a;
  15288. var b = CKEDITOR.document.getById(this._.id);
  15289. return b ? (b.setState(a, "cke_button"), a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled"),
  15290. this.hasArrow ? (a = a == CKEDITOR.TRISTATE_ON ? this._.editor.lang.button.selectedLabel.replace(/%1/g, this.label) : this.label, CKEDITOR.document.getById(this._.id + "_label").setText(a)) : a == CKEDITOR.TRISTATE_ON ? b.setAttribute("aria-pressed", !0) : b.removeAttribute("aria-pressed"), !0) : !1
  15291. },
  15292. getState: function() {
  15293. return this._.state
  15294. },
  15295. toFeature: function(a) {
  15296. if (this._.feature) return this._.feature;
  15297. var b = this;
  15298. this.allowedContent || this.requiredContent || !this.command || (b = a.getCommand(this.command) || b);
  15299. return this._.feature =
  15300. b
  15301. }
  15302. };
  15303. CKEDITOR.ui.prototype.addButton = function(a, b) {
  15304. this.add(a, CKEDITOR.UI_BUTTON, b)
  15305. }
  15306. }(), CKEDITOR.plugins.add("richcombo", {
  15307. requires: "floatpanel,listblock,button",
  15308. beforeInit: function(a) {
  15309. a.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler)
  15310. }
  15311. }),
  15312. function() {
  15313. var a = '\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"' +
  15314. (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href\x3d\"javascript:void('{titleJs}')\"") + ' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"true"';
  15315. CKEDITOR.env.gecko && CKEDITOR.env.mac && (a += ' onkeypress\x3d"return false;"');
  15316. CKEDITOR.env.gecko && (a += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  15317. var a = a + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ?
  15318. 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e' + (CKEDITOR.env.hc ? "\x26#9660;" : CKEDITOR.env.air ? "\x26nbsp;" : "") + "\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),
  15319. f = CKEDITOR.addTemplate("combo", a);
  15320. CKEDITOR.UI_RICHCOMBO = "richcombo";
  15321. CKEDITOR.ui.richCombo =
  15322. CKEDITOR.tools.createClass({
  15323. $: function(a) {
  15324. CKEDITOR.tools.extend(this, a, {
  15325. canGroup: !1,
  15326. title: a.label,
  15327. modes: {
  15328. wysiwyg: 1
  15329. },
  15330. editorFocus: 1
  15331. });
  15332. a = this.panel || {};
  15333. delete this.panel;
  15334. this.id = CKEDITOR.tools.getNextNumber();
  15335. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  15336. a.className = "cke_combopanel";
  15337. a.block = {
  15338. multiSelect: a.multiSelect,
  15339. attributes: a.attributes
  15340. };
  15341. a.toolbarRelated = !0;
  15342. this._ = {
  15343. panelDefinition: a,
  15344. items: {}
  15345. }
  15346. },
  15347. proto: {
  15348. renderHtml: function(a) {
  15349. var c = [];
  15350. this.render(a, c);
  15351. return c.join("")
  15352. },
  15353. render: function(a,
  15354. c) {
  15355. function e() {
  15356. if (this.getState() != CKEDITOR.TRISTATE_ON) {
  15357. var c = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  15358. a.readOnly && !this.readOnly && (c = CKEDITOR.TRISTATE_DISABLED);
  15359. this.setState(c);
  15360. this.setValue("");
  15361. c != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
  15362. }
  15363. }
  15364. var m = CKEDITOR.env,
  15365. l = "cke_" + this.id,
  15366. d = CKEDITOR.tools.addFunction(function(c) {
  15367. w && (a.unlockSelection(1), w = 0);
  15368. k.execute(c)
  15369. }, this),
  15370. h = this,
  15371. k = {
  15372. id: l,
  15373. combo: this,
  15374. focus: function() {
  15375. CKEDITOR.document.getById(l).getChild(1).focus()
  15376. },
  15377. execute: function(c) {
  15378. var d = h._;
  15379. if (d.state != CKEDITOR.TRISTATE_DISABLED)
  15380. if (h.createPanel(a), d.on) d.panel.hide();
  15381. else {
  15382. h.commit();
  15383. var e = h.getValue();
  15384. e ? d.list.mark(e) : d.list.unmarkAll();
  15385. d.panel.showBlock(h.id, new CKEDITOR.dom.element(c), 4)
  15386. }
  15387. },
  15388. clickFn: d
  15389. };
  15390. a.on("activeFilterChange", e, this);
  15391. a.on("mode", e, this);
  15392. a.on("selectionChange", e, this);
  15393. !this.readOnly && a.on("readOnly", e, this);
  15394. var g = CKEDITOR.tools.addFunction(function(c, e) {
  15395. c = new CKEDITOR.dom.event(c);
  15396. var f = c.getKeystroke();
  15397. if (40 == f) a.once("panelShow", function(a) {
  15398. a.data._.panel._.currentBlock.onKeyDown(40)
  15399. });
  15400. switch (f) {
  15401. case 13:
  15402. case 32:
  15403. case 40:
  15404. CKEDITOR.tools.callFunction(d, e);
  15405. break;
  15406. default:
  15407. k.onkey(k, f)
  15408. }
  15409. c.preventDefault()
  15410. }),
  15411. n = CKEDITOR.tools.addFunction(function() {
  15412. k.onfocus && k.onfocus()
  15413. }),
  15414. w = 0;
  15415. k.keyDownFn = g;
  15416. m = {
  15417. id: l,
  15418. name: this.name || this.command,
  15419. label: this.label,
  15420. title: this.title,
  15421. cls: this.className || "",
  15422. titleJs: m.gecko && !m.hc ? "" : (this.title || "").replace("'", ""),
  15423. keydownFn: g,
  15424. focusFn: n,
  15425. clickFn: d
  15426. };
  15427. f.output(m, c);
  15428. if (this.onRender) this.onRender();
  15429. return k
  15430. },
  15431. createPanel: function(a) {
  15432. if (!this._.panel) {
  15433. var c = this._.panelDefinition,
  15434. e = this._.panelDefinition.block,
  15435. f = c.parent || CKEDITOR.document.getBody(),
  15436. l = "cke_combopanel__" + this.name,
  15437. d = new CKEDITOR.ui.floatPanel(a, f, c),
  15438. h = d.addListBlock(this.id, e),
  15439. k = this;
  15440. d.onShow = function() {
  15441. this.element.addClass(l);
  15442. k.setState(CKEDITOR.TRISTATE_ON);
  15443. k._.on = 1;
  15444. k.editorFocus && !a.focusManager.hasFocus && a.focus();
  15445. if (k.onOpen) k.onOpen();
  15446. a.once("panelShow", function() {
  15447. h.focus(!h.multiSelect && k.getValue())
  15448. })
  15449. };
  15450. d.onHide = function(c) {
  15451. this.element.removeClass(l);
  15452. k.setState(k.modes && k.modes[a.mode] ? CKEDITOR.TRISTATE_OFF :
  15453. CKEDITOR.TRISTATE_DISABLED);
  15454. k._.on = 0;
  15455. if (!c && k.onClose) k.onClose()
  15456. };
  15457. d.onEscape = function() {
  15458. d.hide(1)
  15459. };
  15460. h.onClick = function(a, b) {
  15461. k.onClick && k.onClick.call(k, a, b);
  15462. d.hide()
  15463. };
  15464. this._.panel = d;
  15465. this._.list = h;
  15466. d.getBlock(this.id).onHide = function() {
  15467. k._.on = 0;
  15468. k.setState(CKEDITOR.TRISTATE_OFF)
  15469. };
  15470. this.init && this.init()
  15471. }
  15472. },
  15473. setValue: function(a, c) {
  15474. this._.value = a;
  15475. var e = this.document.getById("cke_" + this.id + "_text");
  15476. e && (a || c ? e.removeClass("cke_combo_inlinelabel") : (c = this.label, e.addClass("cke_combo_inlinelabel")), e.setText("undefined" !=
  15477. typeof c ? c : a))
  15478. },
  15479. getValue: function() {
  15480. return this._.value || ""
  15481. },
  15482. unmarkAll: function() {
  15483. this._.list.unmarkAll()
  15484. },
  15485. mark: function(a) {
  15486. this._.list.mark(a)
  15487. },
  15488. hideItem: function(a) {
  15489. this._.list.hideItem(a)
  15490. },
  15491. hideGroup: function(a) {
  15492. this._.list.hideGroup(a)
  15493. },
  15494. showAll: function() {
  15495. this._.list.showAll()
  15496. },
  15497. add: function(a, c, e) {
  15498. this._.items[a] = e || a;
  15499. this._.list.add(a, c, e)
  15500. },
  15501. startGroup: function(a) {
  15502. this._.list.startGroup(a)
  15503. },
  15504. commit: function() {
  15505. this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire("ready", this));
  15506. this._.committed = 1
  15507. },
  15508. setState: function(a) {
  15509. if (this._.state != a) {
  15510. var c = this.document.getById("cke_" + this.id);
  15511. c.setState(a, "cke_combo");
  15512. a == CKEDITOR.TRISTATE_DISABLED ? c.setAttribute("aria-disabled", !0) : c.removeAttribute("aria-disabled");
  15513. this._.state = a
  15514. }
  15515. },
  15516. getState: function() {
  15517. return this._.state
  15518. },
  15519. enable: function() {
  15520. this._.state == CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
  15521. },
  15522. disable: function() {
  15523. this._.state != CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(CKEDITOR.TRISTATE_DISABLED))
  15524. }
  15525. },
  15526. statics: {
  15527. handler: {
  15528. create: function(a) {
  15529. return new CKEDITOR.ui.richCombo(a)
  15530. }
  15531. }
  15532. }
  15533. });
  15534. CKEDITOR.ui.prototype.addRichCombo = function(a, c) {
  15535. this.add(a, CKEDITOR.UI_RICHCOMBO, c)
  15536. }
  15537. }(), CKEDITOR.plugins.add("format", {
  15538. requires: "richcombo",
  15539. init: function(a) {
  15540. if (!a.blockless) {
  15541. for (var f = a.config, b = a.lang.format, c = f.format_tags.split(";"), e = {}, m = 0, l = [], d = 0; d < c.length; d++) {
  15542. var h = c[d],
  15543. k = new CKEDITOR.style(f["format_" + h]);
  15544. if (!a.filter.customConfig || a.filter.check(k)) m++, e[h] = k, e[h]._.enterMode = a.config.enterMode, l.push(k)
  15545. }
  15546. 0 !==
  15547. m && a.ui.addRichCombo("Format", {
  15548. label: b.label,
  15549. title: b.panelTitle,
  15550. toolbar: "styles,20",
  15551. allowedContent: l,
  15552. panel: {
  15553. css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
  15554. multiSelect: !1,
  15555. attributes: {
  15556. "aria-label": b.panelTitle
  15557. }
  15558. },
  15559. init: function() {
  15560. this.startGroup(b.panelTitle);
  15561. for (var a in e) {
  15562. var c = b["tag_" + a];
  15563. this.add(a, e[a].buildPreview(c), c)
  15564. }
  15565. },
  15566. onClick: function(b) {
  15567. a.focus();
  15568. a.fire("saveSnapshot");
  15569. b = e[b];
  15570. var c = a.elementPath();
  15571. a[b.checkActive(c, a) ? "removeStyle" : "applyStyle"](b);
  15572. setTimeout(function() {
  15573. a.fire("saveSnapshot")
  15574. },
  15575. 0)
  15576. },
  15577. onRender: function() {
  15578. a.on("selectionChange", function(b) {
  15579. var c = this.getValue();
  15580. b = b.data.path;
  15581. this.refresh();
  15582. for (var d in e)
  15583. if (e[d].checkActive(b, a)) {
  15584. d != c && this.setValue(d, a.lang.format["tag_" + d]);
  15585. return
  15586. }
  15587. this.setValue("")
  15588. }, this)
  15589. },
  15590. onOpen: function() {
  15591. this.showAll();
  15592. for (var b in e) a.activeFilter.check(e[b]) || this.hideItem(b)
  15593. },
  15594. refresh: function() {
  15595. var b = a.elementPath();
  15596. if (b) {
  15597. if (b.isContextFor("p"))
  15598. for (var c in e)
  15599. if (a.activeFilter.check(e[c])) return;
  15600. this.setState(CKEDITOR.TRISTATE_DISABLED)
  15601. }
  15602. }
  15603. })
  15604. }
  15605. }
  15606. }), CKEDITOR.config.format_tags =
  15607. "p;h1;h2;h3;h4;h5;h6;pre;address;div", CKEDITOR.config.format_p = {
  15608. element: "p"
  15609. }, CKEDITOR.config.format_div = {
  15610. element: "div"
  15611. }, CKEDITOR.config.format_pre = {
  15612. element: "pre"
  15613. }, CKEDITOR.config.format_address = {
  15614. element: "address"
  15615. }, CKEDITOR.config.format_h1 = {
  15616. element: "h1"
  15617. }, CKEDITOR.config.format_h2 = {
  15618. element: "h2"
  15619. }, CKEDITOR.config.format_h3 = {
  15620. element: "h3"
  15621. }, CKEDITOR.config.format_h4 = {
  15622. element: "h4"
  15623. }, CKEDITOR.config.format_h5 = {
  15624. element: "h5"
  15625. }, CKEDITOR.config.format_h6 = {
  15626. element: "h6"
  15627. },
  15628. function() {
  15629. var a = {
  15630. canUndo: !1,
  15631. exec: function(a) {
  15632. var b =
  15633. a.document.createElement("hr");
  15634. a.insertElement(b)
  15635. },
  15636. allowedContent: "hr",
  15637. requiredContent: "hr"
  15638. };
  15639. CKEDITOR.plugins.add("horizontalrule", {
  15640. init: function(f) {
  15641. f.blockless || (f.addCommand("horizontalrule", a), f.ui.addButton && f.ui.addButton("HorizontalRule", {
  15642. label: f.lang.horizontalrule.toolbar,
  15643. command: "horizontalrule",
  15644. toolbar: "insert,40"
  15645. }))
  15646. }
  15647. })
  15648. }(), CKEDITOR.plugins.add("htmlwriter", {
  15649. init: function(a) {
  15650. var f = new CKEDITOR.htmlWriter;
  15651. f.forceSimpleAmpersand = a.config.forceSimpleAmpersand;
  15652. f.indentationChars = a.config.dataIndentationChars ||
  15653. "\t";
  15654. a.dataProcessor.writer = f
  15655. }
  15656. }), CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({
  15657. base: CKEDITOR.htmlParser.basicWriter,
  15658. $: function() {
  15659. this.base();
  15660. this.indentationChars = "\t";
  15661. this.selfClosingEnd = " /\x3e";
  15662. this.lineBreakChars = "\n";
  15663. this.sortAttributes = 1;
  15664. this._.indent = 0;
  15665. this._.indentation = "";
  15666. this._.inPre = 0;
  15667. this._.rules = {};
  15668. var a = CKEDITOR.dtd,
  15669. f;
  15670. for (f in CKEDITOR.tools.extend({}, a.$nonBodyContent, a.$block, a.$listItem, a.$tableContent)) this.setRules(f, {
  15671. indent: !a[f]["#"],
  15672. breakBeforeOpen: 1,
  15673. breakBeforeClose: !a[f]["#"],
  15674. breakAfterClose: 1,
  15675. needsSpace: f in a.$block && !(f in {
  15676. li: 1,
  15677. dt: 1,
  15678. dd: 1
  15679. })
  15680. });
  15681. this.setRules("br", {
  15682. breakAfterOpen: 1
  15683. });
  15684. this.setRules("title", {
  15685. indent: 0,
  15686. breakAfterOpen: 0
  15687. });
  15688. this.setRules("style", {
  15689. indent: 0,
  15690. breakBeforeClose: 1
  15691. });
  15692. this.setRules("pre", {
  15693. breakAfterOpen: 1,
  15694. indent: 0
  15695. })
  15696. },
  15697. proto: {
  15698. openTag: function(a) {
  15699. var f = this._.rules[a];
  15700. this._.afterCloser && f && f.needsSpace && this._.needsSpace && this._.output.push("\n");
  15701. this._.indent ? this.indentation() : f && f.breakBeforeOpen && (this.lineBreak(), this.indentation());
  15702. this._.output.push("\x3c",
  15703. a);
  15704. this._.afterCloser = 0
  15705. },
  15706. openTagClose: function(a, f) {
  15707. var b = this._.rules[a];
  15708. f ? (this._.output.push(this.selfClosingEnd), b && b.breakAfterClose && (this._.needsSpace = b.needsSpace)) : (this._.output.push("\x3e"), b && b.indent && (this._.indentation += this.indentationChars));
  15709. b && b.breakAfterOpen && this.lineBreak();
  15710. "pre" == a && (this._.inPre = 1)
  15711. },
  15712. attribute: function(a, f) {
  15713. "string" == typeof f && (this.forceSimpleAmpersand && (f = f.replace(/&amp;/g, "\x26")), f = CKEDITOR.tools.htmlEncodeAttr(f));
  15714. this._.output.push(" ", a, '\x3d"', f, '"')
  15715. },
  15716. closeTag: function(a) {
  15717. var f = this._.rules[a];
  15718. f && f.indent && (this._.indentation = this._.indentation.substr(this.indentationChars.length));
  15719. this._.indent ? this.indentation() : f && f.breakBeforeClose && (this.lineBreak(), this.indentation());
  15720. this._.output.push("\x3c/", a, "\x3e");
  15721. "pre" == a && (this._.inPre = 0);
  15722. f && f.breakAfterClose && (this.lineBreak(), this._.needsSpace = f.needsSpace);
  15723. this._.afterCloser = 1
  15724. },
  15725. text: function(a) {
  15726. this._.indent && (this.indentation(), !this._.inPre && (a = CKEDITOR.tools.ltrim(a)));
  15727. this._.output.push(a)
  15728. },
  15729. comment: function(a) {
  15730. this._.indent && this.indentation();
  15731. this._.output.push("\x3c!--", a, "--\x3e")
  15732. },
  15733. lineBreak: function() {
  15734. !this._.inPre && 0 < this._.output.length && this._.output.push(this.lineBreakChars);
  15735. this._.indent = 1
  15736. },
  15737. indentation: function() {
  15738. !this._.inPre && this._.indentation && this._.output.push(this._.indentation);
  15739. this._.indent = 0
  15740. },
  15741. reset: function() {
  15742. this._.output = [];
  15743. this._.indent = 0;
  15744. this._.indentation = "";
  15745. this._.afterCloser = 0;
  15746. this._.inPre = 0;
  15747. this._.needsSpace = 0
  15748. },
  15749. setRules: function(a, f) {
  15750. var b = this._.rules[a];
  15751. b ? CKEDITOR.tools.extend(b, f, !0) : this._.rules[a] = f
  15752. }
  15753. }
  15754. }),
  15755. function() {
  15756. function a(a, c) {
  15757. c || (c = a.getSelection().getSelectedElement());
  15758. if (c && c.is("img") && !c.data("cke-realelement") && !c.isReadOnly()) return c
  15759. }
  15760. function f(a) {
  15761. var c = a.getStyle("float");
  15762. if ("inherit" == c || "none" == c) c = 0;
  15763. c || (c = a.getAttribute("align"));
  15764. return c
  15765. }
  15766. CKEDITOR.plugins.add("image", {
  15767. requires: "dialog",
  15768. init: function(b) {
  15769. if (!b.plugins.image2) {
  15770. CKEDITOR.dialog.add("image", this.path + "dialogs/image.js");
  15771. var c = "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
  15772. CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (c = "img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");
  15773. b.addCommand("image", new CKEDITOR.dialogCommand("image", {
  15774. allowedContent: c,
  15775. requiredContent: "img[alt,src]",
  15776. contentTransformations: [
  15777. ["img{width}: sizeToStyle", "img[width]: sizeToAttribute"],
  15778. ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"]
  15779. ]
  15780. }));
  15781. b.ui.addButton && b.ui.addButton("Image", {
  15782. label: b.lang.common.image,
  15783. command: "image",
  15784. toolbar: "insert,10"
  15785. });
  15786. b.on("doubleclick", function(a) {
  15787. var b =
  15788. a.data.element;
  15789. !b.is("img") || b.data("cke-realelement") || b.isReadOnly() || (a.data.dialog = "image")
  15790. });
  15791. b.addMenuItems && b.addMenuItems({
  15792. image: {
  15793. label: b.lang.image.menu,
  15794. command: "image",
  15795. group: "image"
  15796. }
  15797. });
  15798. b.contextMenu && b.contextMenu.addListener(function(c) {
  15799. if (a(b, c)) return {
  15800. image: CKEDITOR.TRISTATE_OFF
  15801. }
  15802. })
  15803. }
  15804. },
  15805. afterInit: function(b) {
  15806. function c(c) {
  15807. var m = b.getCommand("justify" + c);
  15808. if (m) {
  15809. if ("left" == c || "right" == c) m.on("exec", function(l) {
  15810. var d = a(b),
  15811. h;
  15812. d && (h = f(d), h == c ? (d.removeStyle("float"), c == f(d) && d.removeAttribute("align")) :
  15813. d.setStyle("float", c), l.cancel())
  15814. });
  15815. m.on("refresh", function(l) {
  15816. var d = a(b);
  15817. d && (d = f(d), this.setState(d == c ? CKEDITOR.TRISTATE_ON : "right" == c || "left" == c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED), l.cancel())
  15818. })
  15819. }
  15820. }
  15821. b.plugins.image2 || (c("left"), c("right"), c("center"), c("block"))
  15822. }
  15823. })
  15824. }(), CKEDITOR.config.image_removeLinkByEmptyURL = !0,
  15825. function() {
  15826. function a(a, b) {
  15827. var d = c.exec(a),
  15828. e = c.exec(b);
  15829. if (d) {
  15830. if (!d[2] && "px" == e[2]) return e[1];
  15831. if ("px" == d[2] && !e[2]) return e[1] + "px"
  15832. }
  15833. return b
  15834. }
  15835. var f = CKEDITOR.htmlParser.cssStyle,
  15836. b = CKEDITOR.tools.cssLength,
  15837. c = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,
  15838. e = {
  15839. elements: {
  15840. $: function(b) {
  15841. var c = b.attributes;
  15842. if ((c = (c = (c = c && c["data-cke-realelement"]) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(c))) && c.children[0]) && b.attributes["data-cke-resizable"]) {
  15843. var d = (new f(b)).rules;
  15844. b = c.attributes;
  15845. var e = d.width,
  15846. d = d.height;
  15847. e && (b.width = a(b.width, e));
  15848. d && (b.height = a(b.height, d))
  15849. }
  15850. return c
  15851. }
  15852. }
  15853. };
  15854. CKEDITOR.plugins.add("fakeobjects", {
  15855. init: function(a) {
  15856. a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}",
  15857. "fakeobjects")
  15858. },
  15859. afterInit: function(a) {
  15860. (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(e, {
  15861. applyToAll: !0
  15862. })
  15863. }
  15864. });
  15865. CKEDITOR.editor.prototype.createFakeElement = function(a, c, d, e) {
  15866. var k = this.lang.fakeobjects,
  15867. k = k[d] || k.unknown;
  15868. c = {
  15869. "class": c,
  15870. "data-cke-realelement": encodeURIComponent(a.getOuterHtml()),
  15871. "data-cke-real-node-type": a.type,
  15872. alt: k,
  15873. title: k,
  15874. align: a.getAttribute("align") || ""
  15875. };
  15876. CKEDITOR.env.hc || (c.src = CKEDITOR.tools.transparentImageData);
  15877. d && (c["data-cke-real-element-type"] = d);
  15878. e && (c["data-cke-resizable"] =
  15879. e, d = new f, e = a.getAttribute("width"), a = a.getAttribute("height"), e && (d.rules.width = b(e)), a && (d.rules.height = b(a)), d.populate(c));
  15880. return this.document.createElement("img", {
  15881. attributes: c
  15882. })
  15883. };
  15884. CKEDITOR.editor.prototype.createFakeParserElement = function(a, c, d, e) {
  15885. var k = this.lang.fakeobjects,
  15886. k = k[d] || k.unknown,
  15887. g;
  15888. g = new CKEDITOR.htmlParser.basicWriter;
  15889. a.writeHtml(g);
  15890. g = g.getHtml();
  15891. c = {
  15892. "class": c,
  15893. "data-cke-realelement": encodeURIComponent(g),
  15894. "data-cke-real-node-type": a.type,
  15895. alt: k,
  15896. title: k,
  15897. align: a.attributes.align || ""
  15898. };
  15899. CKEDITOR.env.hc || (c.src = CKEDITOR.tools.transparentImageData);
  15900. d && (c["data-cke-real-element-type"] = d);
  15901. e && (c["data-cke-resizable"] = e, e = a.attributes, a = new f, d = e.width, e = e.height, void 0 !== d && (a.rules.width = b(d)), void 0 !== e && (a.rules.height = b(e)), a.populate(c));
  15902. return new CKEDITOR.htmlParser.element("img", c)
  15903. };
  15904. CKEDITOR.editor.prototype.restoreRealElement = function(b) {
  15905. if (b.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null;
  15906. var c = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(b.data("cke-realelement")),
  15907. this.document);
  15908. if (b.data("cke-resizable")) {
  15909. var d = b.getStyle("width");
  15910. b = b.getStyle("height");
  15911. d && c.setAttribute("width", a(c.getAttribute("width"), d));
  15912. b && c.setAttribute("height", a(c.getAttribute("height"), b))
  15913. }
  15914. return c
  15915. }
  15916. }(), "use strict",
  15917. function() {
  15918. function a(a) {
  15919. return a.replace(/'/g, "\\$\x26")
  15920. }
  15921. function f(a) {
  15922. for (var b, c = a.length, d = [], e = 0; e < c; e++) b = a.charCodeAt(e), d.push(b);
  15923. return "String.fromCharCode(" + d.join(",") + ")"
  15924. }
  15925. function b(b, c) {
  15926. var d = b.plugins.link,
  15927. e = d.compiledProtectionFunction.params,
  15928. f, g;
  15929. g = [d.compiledProtectionFunction.name,
  15930. "("
  15931. ];
  15932. for (var h = 0; h < e.length; h++) d = e[h].toLowerCase(), f = c[d], 0 < h && g.push(","), g.push("'", f ? a(encodeURIComponent(c[d])) : "", "'");
  15933. g.push(")");
  15934. return g.join("")
  15935. }
  15936. function c(a) {
  15937. a = a.config.emailProtection || "";
  15938. var b;
  15939. a && "encode" != a && (b = {}, a.replace(/^([^(]+)\(([^)]+)\)$/, function(a, c, d) {
  15940. b.name = c;
  15941. b.params = [];
  15942. d.replace(/[^,\s]+/g, function(a) {
  15943. b.params.push(a)
  15944. })
  15945. }));
  15946. return b
  15947. }
  15948. CKEDITOR.plugins.add("link", {
  15949. requires: "dialog,fakeobjects",
  15950. onLoad: function() {
  15951. function a(b) {
  15952. return c.replace(/%1/g, "rtl" == b ? "right" : "left").replace(/%2/g,
  15953. "cke_contents_" + b)
  15954. }
  15955. 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;",
  15956. c = ".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{" + b + "padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{" + b + "width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
  15957. CKEDITOR.addCss(a("ltr") + a("rtl"))
  15958. },
  15959. init: function(a) {
  15960. var b = "a[!href]";
  15961. CKEDITOR.dialog.isTabEnabled(a, "link", "advanced") && (b = b.replace("]", ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)"));
  15962. CKEDITOR.dialog.isTabEnabled(a, "link", "target") && (b = b.replace("]", ",target,onclick]"));
  15963. a.addCommand("link", new CKEDITOR.dialogCommand("link", {
  15964. allowedContent: b,
  15965. requiredContent: "a[href]"
  15966. }));
  15967. a.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", {
  15968. allowedContent: "a[!name,id]",
  15969. requiredContent: "a[name]"
  15970. }));
  15971. a.addCommand("unlink", new CKEDITOR.unlinkCommand);
  15972. a.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand);
  15973. a.setKeystroke(CKEDITOR.CTRL + 76, "link");
  15974. a.ui.addButton && (a.ui.addButton("Link", {
  15975. label: a.lang.link.toolbar,
  15976. command: "link",
  15977. toolbar: "links,10"
  15978. }), a.ui.addButton("Unlink", {
  15979. label: a.lang.link.unlink,
  15980. command: "unlink",
  15981. toolbar: "links,20"
  15982. }), a.ui.addButton("Anchor", {
  15983. label: a.lang.link.anchor.toolbar,
  15984. command: "anchor",
  15985. toolbar: "links,30"
  15986. }));
  15987. CKEDITOR.dialog.add("link", this.path + "dialogs/link.js");
  15988. CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js");
  15989. a.on("doubleclick", function(b) {
  15990. var c = CKEDITOR.plugins.link.getSelectedLink(a) || b.data.element;
  15991. c.isReadOnly() || (c.is("a") ? (b.data.dialog = !c.getAttribute("name") || c.getAttribute("href") && c.getChildCount() ? "link" : "anchor", b.data.link = c) : CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, c) && (b.data.dialog = "anchor"))
  15992. }, null, null, 0);
  15993. a.on("doubleclick", function(b) {
  15994. b.data.dialog in {
  15995. link: 1,
  15996. anchor: 1
  15997. } && b.data.link && a.getSelection().selectElement(b.data.link)
  15998. }, null, null, 20);
  15999. a.addMenuItems && a.addMenuItems({
  16000. anchor: {
  16001. label: a.lang.link.anchor.menu,
  16002. command: "anchor",
  16003. group: "anchor",
  16004. order: 1
  16005. },
  16006. removeAnchor: {
  16007. label: a.lang.link.anchor.remove,
  16008. command: "removeAnchor",
  16009. group: "anchor",
  16010. order: 5
  16011. },
  16012. link: {
  16013. label: a.lang.link.menu,
  16014. command: "link",
  16015. group: "link",
  16016. order: 1
  16017. },
  16018. unlink: {
  16019. label: a.lang.link.unlink,
  16020. command: "unlink",
  16021. group: "link",
  16022. order: 5
  16023. }
  16024. });
  16025. a.contextMenu && a.contextMenu.addListener(function(b) {
  16026. if (!b || b.isReadOnly()) return null;
  16027. b = CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, b);
  16028. if (!b && !(b = CKEDITOR.plugins.link.getSelectedLink(a))) return null;
  16029. var c = {};
  16030. b.getAttribute("href") &&
  16031. b.getChildCount() && (c = {
  16032. link: CKEDITOR.TRISTATE_OFF,
  16033. unlink: CKEDITOR.TRISTATE_OFF
  16034. });
  16035. b && b.hasAttribute("name") && (c.anchor = c.removeAnchor = CKEDITOR.TRISTATE_OFF);
  16036. return c
  16037. });
  16038. this.compiledProtectionFunction = c(a)
  16039. },
  16040. afterInit: function(a) {
  16041. a.dataProcessor.dataFilter.addRules({
  16042. elements: {
  16043. a: function(b) {
  16044. return b.attributes.name ? b.children.length ? null : a.createFakeParserElement(b, "cke_anchor", "anchor") : null
  16045. }
  16046. }
  16047. });
  16048. var b = a._.elementsPath && a._.elementsPath.filters;
  16049. b && b.push(function(b, c) {
  16050. if ("a" == c && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,
  16051. b) || b.getAttribute("name") && (!b.getAttribute("href") || !b.getChildCount()))) return "anchor"
  16052. })
  16053. }
  16054. });
  16055. var e = /^javascript:/,
  16056. m = /^mailto:([^?]+)(?:\?(.+))?$/,
  16057. l = /subject=([^;?:@&=$,\/]*)/i,
  16058. d = /body=([^;?:@&=$,\/]*)/i,
  16059. h = /^#(.*)$/,
  16060. k = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
  16061. g = /^(_(?:self|top|parent|blank))$/,
  16062. n = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
  16063. w = /^javascript:([^(]+)\(([^)]+)\)$/,
  16064. q = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
  16065. v = /(?:^|,)([^=]+)=(\d+|yes|no)/gi,
  16066. u = {
  16067. id: "advId",
  16068. dir: "advLangDir",
  16069. accessKey: "advAccessKey",
  16070. name: "advName",
  16071. lang: "advLangCode",
  16072. tabindex: "advTabIndex",
  16073. title: "advTitle",
  16074. type: "advContentType",
  16075. "class": "advCSSClasses",
  16076. charset: "advCharset",
  16077. style: "advStyles",
  16078. rel: "advRel"
  16079. };
  16080. CKEDITOR.plugins.link = {
  16081. getSelectedLink: function(a) {
  16082. var b = a.getSelection(),
  16083. c = b.getSelectedElement();
  16084. return c && c.is("a") ? c : (b = b.getRanges()[0]) ? (b.shrink(CKEDITOR.SHRINK_TEXT), a.elementPath(b.getCommonAncestor()).contains("a", 1)) : null
  16085. },
  16086. getEditorAnchors: function(a) {
  16087. for (var b =
  16088. a.editable(), c = b.isInline() && !a.plugins.divarea ? a.document : b, b = c.getElementsByTag("a"), c = c.getElementsByTag("img"), d = [], e = 0, f; f = b.getItem(e++);)(f.data("cke-saved-name") || f.hasAttribute("name")) && d.push({
  16089. name: f.data("cke-saved-name") || f.getAttribute("name"),
  16090. id: f.getAttribute("id")
  16091. });
  16092. for (e = 0; f = c.getItem(e++);)(f = this.tryRestoreFakeAnchor(a, f)) && d.push({
  16093. name: f.getAttribute("name"),
  16094. id: f.getAttribute("id")
  16095. });
  16096. return d
  16097. },
  16098. fakeAnchor: !0,
  16099. tryRestoreFakeAnchor: function(a, b) {
  16100. if (b && b.data("cke-real-element-type") &&
  16101. "anchor" == b.data("cke-real-element-type")) {
  16102. var c = a.restoreRealElement(b);
  16103. if (c.data("cke-saved-name")) return c
  16104. }
  16105. },
  16106. parseLinkAttributes: function(a, b) {
  16107. var c = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "",
  16108. f = a.plugins.link.compiledProtectionFunction,
  16109. t = a.config.emailProtection,
  16110. y, D = {};
  16111. c.match(e) && ("encode" == t ? c = c.replace(n, function(a, b, c) {
  16112. c = c || "";
  16113. return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + c.replace(/\\'/g, "'")
  16114. }) : t && c.replace(w, function(a, b, c) {
  16115. if (b == f.name) {
  16116. D.type = "email";
  16117. a = D.email = {};
  16118. b = /(^')|('$)/g;
  16119. c = c.match(/[^,\s]+/g);
  16120. for (var d = c.length, e, g, h = 0; h < d; h++) e = decodeURIComponent, g = c[h].replace(b, "").replace(/\\'/g, "'"), g = e(g), e = f.params[h].toLowerCase(), a[e] = g;
  16121. a.address = [a.name, a.domain].join("@")
  16122. }
  16123. }));
  16124. if (!D.type)
  16125. if (t = c.match(h)) D.type = "anchor", D.anchor = {}, D.anchor.name = D.anchor.id = t[1];
  16126. else if (t = c.match(m)) {
  16127. y = c.match(l);
  16128. c = c.match(d);
  16129. D.type = "email";
  16130. var x = D.email = {};
  16131. x.address = t[1];
  16132. y && (x.subject = decodeURIComponent(y[1]));
  16133. c && (x.body = decodeURIComponent(c[1]))
  16134. } else c && (y = c.match(k)) &&
  16135. (D.type = "url", D.url = {}, D.url.protocol = y[1], D.url.url = y[2]);
  16136. if (b) {
  16137. if (c = b.getAttribute("target")) D.target = {
  16138. type: c.match(g) ? c : "frame",
  16139. name: c
  16140. };
  16141. else if (c = (c = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && c.match(q))
  16142. for (D.target = {
  16143. type: "popup",
  16144. name: c[1]
  16145. }; t = v.exec(c[2]);) "yes" != t[2] && "1" != t[2] || t[1] in {
  16146. height: 1,
  16147. width: 1,
  16148. top: 1,
  16149. left: 1
  16150. } ? isFinite(t[2]) && (D.target[t[1]] = t[2]) : D.target[t[1]] = !0;
  16151. null !== b.getAttribute("download") && (D.download = !0);
  16152. var c = {},
  16153. A;
  16154. for (A in u)(t = b.getAttribute(A)) && (c[u[A]] = t);
  16155. if (A =
  16156. b.data("cke-saved-name") || c.advName) c.advName = A;
  16157. CKEDITOR.tools.isEmpty(c) || (D.advanced = c)
  16158. }
  16159. return D
  16160. },
  16161. getLinkAttributes: function(c, d) {
  16162. var e = c.config.emailProtection || "",
  16163. g = {};
  16164. switch (d.type) {
  16165. case "url":
  16166. var e = d.url && void 0 !== d.url.protocol ? d.url.protocol : "http://",
  16167. h = d.url && CKEDITOR.tools.trim(d.url.url) || "";
  16168. g["data-cke-saved-href"] = 0 === h.indexOf("/") ? h : e + h;
  16169. break;
  16170. case "anchor":
  16171. e = d.anchor && d.anchor.id;
  16172. g["data-cke-saved-href"] = "#" + (d.anchor && d.anchor.name || e || "");
  16173. break;
  16174. case "email":
  16175. var k = d.email,
  16176. h = k.address;
  16177. switch (e) {
  16178. case "":
  16179. case "encode":
  16180. var l = encodeURIComponent(k.subject || ""),
  16181. m = encodeURIComponent(k.body || ""),
  16182. k = [];
  16183. l && k.push("subject\x3d" + l);
  16184. m && k.push("body\x3d" + m);
  16185. k = k.length ? "?" + k.join("\x26") : "";
  16186. "encode" == e ? (e = ["javascript:void(location.href\x3d'mailto:'+", f(h)], k && e.push("+'", a(k), "'"), e.push(")")) : e = ["mailto:", h, k];
  16187. break;
  16188. default:
  16189. e = h.split("@", 2), k.name = e[0], k.domain = e[1], e = ["javascript:", b(c, k)]
  16190. }
  16191. g["data-cke-saved-href"] = e.join("")
  16192. }
  16193. if (d.target)
  16194. if ("popup" == d.target.type) {
  16195. for (var e = ["window.open(this.href, '",
  16196. d.target.name || "", "', '"
  16197. ], n = "resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "), h = n.length, l = function(a) {
  16198. d.target[a] && n.push(a + "\x3d" + d.target[a])
  16199. }, k = 0; k < h; k++) n[k] += d.target[n[k]] ? "\x3dyes" : "\x3dno";
  16200. l("width");
  16201. l("left");
  16202. l("height");
  16203. l("top");
  16204. e.push(n.join(","), "'); return false;");
  16205. g["data-cke-pa-onclick"] = e.join("")
  16206. } else "notSet" != d.target.type && d.target.name && (g.target = d.target.name);
  16207. d.download && (g.download = "");
  16208. if (d.advanced) {
  16209. for (var q in u)(e = d.advanced[u[q]]) &&
  16210. (g[q] = e);
  16211. g.name && (g["data-cke-saved-name"] = g.name)
  16212. }
  16213. g["data-cke-saved-href"] && (g.href = g["data-cke-saved-href"]);
  16214. q = {
  16215. target: 1,
  16216. onclick: 1,
  16217. "data-cke-pa-onclick": 1,
  16218. "data-cke-saved-name": 1,
  16219. download: 1
  16220. };
  16221. d.advanced && CKEDITOR.tools.extend(q, u);
  16222. for (var v in g) delete q[v];
  16223. return {
  16224. set: g,
  16225. removed: CKEDITOR.tools.objectKeys(q)
  16226. }
  16227. },
  16228. showDisplayTextForElement: function(a, b) {
  16229. var c = {
  16230. img: 1,
  16231. table: 1,
  16232. tbody: 1,
  16233. thead: 1,
  16234. tfoot: 1,
  16235. input: 1,
  16236. select: 1,
  16237. textarea: 1
  16238. };
  16239. return b.widgets && b.widgets.focused ? !1 : !a || !a.getName || !a.is(c)
  16240. }
  16241. };
  16242. CKEDITOR.unlinkCommand =
  16243. function() {};
  16244. CKEDITOR.unlinkCommand.prototype = {
  16245. exec: function(a) {
  16246. var b = new CKEDITOR.style({
  16247. element: "a",
  16248. type: CKEDITOR.STYLE_INLINE,
  16249. alwaysRemoveElement: 1
  16250. });
  16251. a.removeStyle(b)
  16252. },
  16253. refresh: function(a, b) {
  16254. var c = b.lastElement && b.lastElement.getAscendant("a", !0);
  16255. c && "a" == c.getName() && c.getAttribute("href") && c.getChildCount() ? this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  16256. },
  16257. contextSensitive: 1,
  16258. startDisabled: 1,
  16259. requiredContent: "a[href]"
  16260. };
  16261. CKEDITOR.removeAnchorCommand = function() {};
  16262. CKEDITOR.removeAnchorCommand.prototype = {
  16263. exec: function(a) {
  16264. var b = a.getSelection(),
  16265. c = b.createBookmarks(),
  16266. d;
  16267. if (b && (d = b.getSelectedElement()) && (d.getChildCount() ? d.is("a") : CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, d))) d.remove(1);
  16268. else if (d = CKEDITOR.plugins.link.getSelectedLink(a)) d.hasAttribute("href") ? (d.removeAttributes({
  16269. name: 1,
  16270. "data-cke-saved-name": 1
  16271. }), d.removeClass("cke_anchor")) : d.remove(1);
  16272. b.selectBookmarks(c)
  16273. },
  16274. requiredContent: "a[name]"
  16275. };
  16276. CKEDITOR.tools.extend(CKEDITOR.config, {
  16277. linkShowAdvancedTab: !0,
  16278. linkShowTargetTab: !0
  16279. })
  16280. }(), "use strict",
  16281. function() {
  16282. function a(a, b, c) {
  16283. return n(b) && n(c) && c.equals(b.getNext(function(a) {
  16284. return !(Z(a) || aa(a) || w(a))
  16285. }))
  16286. }
  16287. function f(a) {
  16288. this.upper = a[0];
  16289. this.lower = a[1];
  16290. this.set.apply(this, a.slice(2))
  16291. }
  16292. function b(a) {
  16293. var b = a.element;
  16294. if (b && n(b) && (b = b.getAscendant(a.triggers, !0)) && a.editable.contains(b)) {
  16295. var c = l(b);
  16296. if ("true" == c.getAttribute("contenteditable")) return b;
  16297. if (c.is(a.triggers)) return c
  16298. }
  16299. return null
  16300. }
  16301. function c(a, b, c) {
  16302. t(a, b);
  16303. t(a, c);
  16304. a = b.size.bottom;
  16305. c = c.size.top;
  16306. return a && c ? 0 | (a + c) / 2 : a || c
  16307. }
  16308. function e(a, b, c) {
  16309. return b =
  16310. b[c ? "getPrevious" : "getNext"](function(b) {
  16311. return b && b.type == CKEDITOR.NODE_TEXT && !Z(b) || n(b) && !w(b) && !g(a, b)
  16312. })
  16313. }
  16314. function m(a, b, c) {
  16315. return a > b && a < c
  16316. }
  16317. function l(a, b) {
  16318. if (a.data("cke-editable")) return null;
  16319. for (b || (a = a.getParent()); a && !a.data("cke-editable");) {
  16320. if (a.hasAttribute("contenteditable")) return a;
  16321. a = a.getParent()
  16322. }
  16323. return null
  16324. }
  16325. function d(a) {
  16326. var b = a.doc,
  16327. c = F('\x3cspan contenteditable\x3d"false" style\x3d"' + R + "position:absolute;border-top:1px dashed " + a.boxColor + '"\x3e\x3c/span\x3e', b),
  16328. d = CKEDITOR.getUrl(this.path +
  16329. "images/" + (G.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") + ".png");
  16330. A(c, {
  16331. attach: function() {
  16332. this.wrap.getParent() || this.wrap.appendTo(a.editable, !0);
  16333. return this
  16334. },
  16335. lineChildren: [A(F('\x3cspan title\x3d"' + a.editor.lang.magicline.title + '" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e', b), {
  16336. base: R + "height:17px;width:17px;" + (a.rtl ? "left" : "right") + ":17px;background:url(" + d + ") center no-repeat " + a.boxColor + ";cursor:pointer;" + (G.hc ? "font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;" :
  16337. "") + (G.hidpi ? "background-size: 9px 10px;" : ""),
  16338. looks: ["top:-8px; border-radius: 2px;", "top:-17px; border-radius: 2px 2px 0px 0px;", "top:-1px; border-radius: 0px 0px 2px 2px;"]
  16339. }), A(F(Y, b), {
  16340. base: Q + "left:0px;border-left-color:" + a.boxColor + ";",
  16341. 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"]
  16342. }), A(F(Y, b), {
  16343. base: Q + "right:0px;border-right-color:" + a.boxColor + ";",
  16344. looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px",
  16345. "border-width:0 8px 8px 0;top:0px"
  16346. ]
  16347. })],
  16348. detach: function() {
  16349. this.wrap.getParent() && this.wrap.remove();
  16350. return this
  16351. },
  16352. mouseNear: function() {
  16353. t(a, this);
  16354. var b = a.holdDistance,
  16355. c = this.size;
  16356. return c && m(a.mouse.y, c.top - b, c.bottom + b) && m(a.mouse.x, c.left - b, c.right + b) ? !0 : !1
  16357. },
  16358. place: function() {
  16359. var b = a.view,
  16360. c = a.editable,
  16361. d = a.trigger,
  16362. e = d.upper,
  16363. f = d.lower,
  16364. g = e || f,
  16365. h = g.getParent(),
  16366. k = {};
  16367. this.trigger = d;
  16368. e && t(a, e, !0);
  16369. f && t(a, f, !0);
  16370. t(a, h, !0);
  16371. a.inInlineMode && y(a, !0);
  16372. h.equals(c) ? (k.left = b.scroll.x, k.right = -b.scroll.x, k.width = "") : (k.left =
  16373. g.size.left - g.size.margin.left + b.scroll.x - (a.inInlineMode ? b.editable.left + b.editable.border.left : 0), k.width = g.size.outerWidth + g.size.margin.left + g.size.margin.right + b.scroll.x, k.right = "");
  16374. e && f ? k.top = e.size.margin.bottom === f.size.margin.top ? 0 | e.size.bottom + e.size.margin.bottom / 2 : e.size.margin.bottom < f.size.margin.top ? e.size.bottom + e.size.margin.bottom : e.size.bottom + e.size.margin.bottom - f.size.margin.top : e ? f || (k.top = e.size.bottom + e.size.margin.bottom) : k.top = f.size.top - f.size.margin.top;
  16375. d.is(T) || m(k.top,
  16376. b.scroll.y - 15, b.scroll.y + 5) ? (k.top = a.inInlineMode ? 0 : b.scroll.y, this.look(T)) : d.is(M) || m(k.top, b.pane.bottom - 5, b.pane.bottom + 15) ? (k.top = a.inInlineMode ? b.editable.height + b.editable.padding.top + b.editable.padding.bottom : b.pane.bottom - 1, this.look(M)) : (a.inInlineMode && (k.top -= b.editable.top + b.editable.border.top), this.look(V));
  16377. a.inInlineMode && (k.top--, k.top += b.editable.scroll.top, k.left += b.editable.scroll.left);
  16378. for (var l in k) k[l] = CKEDITOR.tools.cssLength(k[l]);
  16379. this.setStyles(k)
  16380. },
  16381. look: function(a) {
  16382. if (this.oldLook !=
  16383. a) {
  16384. for (var b = this.lineChildren.length, c; b--;)(c = this.lineChildren[b]).setAttribute("style", c.base + c.looks[0 | a / 2]);
  16385. this.oldLook = a
  16386. }
  16387. },
  16388. wrap: new C("span", a.doc)
  16389. });
  16390. for (b = c.lineChildren.length; b--;) c.lineChildren[b].appendTo(c);
  16391. c.look(V);
  16392. c.appendTo(c.wrap);
  16393. c.unselectable();
  16394. c.lineChildren[0].on("mouseup", function(b) {
  16395. c.detach();
  16396. h(a, function(b) {
  16397. var c = a.line.trigger;
  16398. b[c.is(J) ? "insertBefore" : "insertAfter"](c.is(J) ? c.lower : c.upper)
  16399. }, !0);
  16400. a.editor.focus();
  16401. G.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  16402. b.data.preventDefault(!0)
  16403. });
  16404. c.on("mousedown", function(a) {
  16405. a.data.preventDefault(!0)
  16406. });
  16407. a.line = c
  16408. }
  16409. function h(a, b, c) {
  16410. var d = new CKEDITOR.dom.range(a.doc),
  16411. e = a.editor,
  16412. f;
  16413. G.ie && a.enterMode == CKEDITOR.ENTER_BR ? f = a.doc.createText(da) : (f = (f = l(a.element, !0)) && f.data("cke-enter-mode") || a.enterMode, f = new C(K[f], a.doc), f.is("br") || a.doc.createText(da).appendTo(f));
  16414. c && e.fire("saveSnapshot");
  16415. b(f);
  16416. d.moveToPosition(f, CKEDITOR.POSITION_AFTER_START);
  16417. e.getSelection().selectRanges([d]);
  16418. a.hotNode = f;
  16419. c && e.fire("saveSnapshot")
  16420. }
  16421. function k(a, c) {
  16422. return {
  16423. canUndo: !0,
  16424. modes: {
  16425. wysiwyg: 1
  16426. },
  16427. exec: function() {
  16428. function d(b) {
  16429. var e = G.ie && 9 > G.version ? " " : da,
  16430. f = a.hotNode && a.hotNode.getText() == e && a.element.equals(a.hotNode) && a.lastCmdDirection === !!c;
  16431. h(a, function(d) {
  16432. f && a.hotNode && a.hotNode.remove();
  16433. d[c ? "insertAfter" : "insertBefore"](b);
  16434. d.setAttributes({
  16435. "data-cke-magicline-hot": 1,
  16436. "data-cke-magicline-dir": !!c
  16437. });
  16438. a.lastCmdDirection = !!c
  16439. });
  16440. G.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  16441. a.line.detach()
  16442. }
  16443. return function(f) {
  16444. f = f.getSelection().getStartElement();
  16445. var g;
  16446. f = f.getAscendant(P, 1);
  16447. if (!u(a, f) && f && !f.equals(a.editable) && !f.contains(a.editable)) {
  16448. (g = l(f)) && "false" == g.getAttribute("contenteditable") && (f = g);
  16449. a.element = f;
  16450. g = e(a, f, !c);
  16451. var h;
  16452. n(g) && g.is(a.triggers) && g.is(N) && (!e(a, g, !c) || (h = e(a, g, !c)) && n(h) && h.is(a.triggers)) ? d(g) : (h = b(a, f), n(h) && (e(a, h, !c) ? (f = e(a, h, !c)) && n(f) && f.is(a.triggers) && d(h) : d(h)))
  16453. }
  16454. }
  16455. }()
  16456. }
  16457. }
  16458. function g(a, b) {
  16459. if (!b || b.type != CKEDITOR.NODE_ELEMENT || !b.$) return !1;
  16460. var c = a.line;
  16461. return c.wrap.equals(b) || c.wrap.contains(b)
  16462. }
  16463. function n(a) {
  16464. return a &&
  16465. a.type == CKEDITOR.NODE_ELEMENT && a.$
  16466. }
  16467. function w(a) {
  16468. if (!n(a)) return !1;
  16469. var b;
  16470. (b = q(a)) || (n(a) ? (b = {
  16471. left: 1,
  16472. right: 1,
  16473. center: 1
  16474. }, b = !(!b[a.getComputedStyle("float")] && !b[a.getAttribute("align")])) : b = !1);
  16475. return b
  16476. }
  16477. function q(a) {
  16478. return !!{
  16479. absolute: 1,
  16480. fixed: 1
  16481. }[a.getComputedStyle("position")]
  16482. }
  16483. function v(a, b) {
  16484. return n(b) ? b.is(a.triggers) : null
  16485. }
  16486. function u(a, b) {
  16487. if (!b) return !1;
  16488. for (var c = b.getParents(1), d = c.length; d--;)
  16489. for (var e = a.tabuList.length; e--;)
  16490. if (c[d].hasAttribute(a.tabuList[e])) return !0;
  16491. return !1
  16492. }
  16493. function r(a, b, c) {
  16494. b =
  16495. b[c ? "getLast" : "getFirst"](function(b) {
  16496. return a.isRelevant(b) && !b.is(ga)
  16497. });
  16498. if (!b) return !1;
  16499. t(a, b);
  16500. return c ? b.size.top > a.mouse.y : b.size.bottom < a.mouse.y
  16501. }
  16502. function p(a) {
  16503. var b = a.editable,
  16504. c = a.mouse,
  16505. d = a.view,
  16506. e = a.triggerOffset;
  16507. y(a);
  16508. var h = c.y > (a.inInlineMode ? d.editable.top + d.editable.height / 2 : Math.min(d.editable.height, d.pane.height) / 2),
  16509. b = b[h ? "getLast" : "getFirst"](function(a) {
  16510. return !(Z(a) || aa(a))
  16511. });
  16512. if (!b) return null;
  16513. g(a, b) && (b = a.line.wrap[h ? "getPrevious" : "getNext"](function(a) {
  16514. return !(Z(a) || aa(a))
  16515. }));
  16516. if (!n(b) ||
  16517. w(b) || !v(a, b)) return null;
  16518. t(a, b);
  16519. return !h && 0 <= b.size.top && m(c.y, 0, b.size.top + e) ? (a = a.inInlineMode || 0 === d.scroll.y ? T : V, new f([null, b, J, O, a])) : h && b.size.bottom <= d.pane.height && m(c.y, b.size.bottom - e, d.pane.height) ? (a = a.inInlineMode || m(b.size.bottom, d.pane.height - e, d.pane.height) ? M : V, new f([b, null, E, O, a])) : null
  16520. }
  16521. function z(a) {
  16522. var c = a.mouse,
  16523. d = a.view,
  16524. g = a.triggerOffset,
  16525. h = b(a);
  16526. if (!h) return null;
  16527. t(a, h);
  16528. var g = Math.min(g, 0 | h.size.outerHeight / 2),
  16529. k = [],
  16530. l, p;
  16531. if (m(c.y, h.size.top - 1, h.size.top + g)) p = !1;
  16532. else if (m(c.y,
  16533. h.size.bottom - g, h.size.bottom + 1)) p = !0;
  16534. else return null;
  16535. if (w(h) || r(a, h, p) || h.getParent().is(ca)) return null;
  16536. var q = e(a, h, !p);
  16537. if (q) {
  16538. if (q && q.type == CKEDITOR.NODE_TEXT) return null;
  16539. if (n(q)) {
  16540. if (w(q) || !v(a, q) || q.getParent().is(ca)) return null;
  16541. k = [q, h][p ? "reverse" : "concat"]().concat([S, O])
  16542. }
  16543. } else h.equals(a.editable[p ? "getLast" : "getFirst"](a.isRelevant)) ? (y(a), p && m(c.y, h.size.bottom - g, d.pane.height) && m(h.size.bottom, d.pane.height - g, d.pane.height) ? l = M : m(c.y, 0, h.size.top + g) && (l = T)) : l = V, k = [null, h][p ? "reverse" : "concat"]().concat([p ?
  16544. E : J, O, l, h.equals(a.editable[p ? "getLast" : "getFirst"](a.isRelevant)) ? p ? M : T : V
  16545. ]);
  16546. return 0 in k ? new f(k) : null
  16547. }
  16548. function B(a, b, c, d) {
  16549. for (var e = b.getDocumentPosition(), f = {}, g = {}, h = {}, k = {}, l = ba.length; l--;) f[ba[l]] = parseInt(b.getComputedStyle.call(b, "border-" + ba[l] + "-width"), 10) || 0, h[ba[l]] = parseInt(b.getComputedStyle.call(b, "padding-" + ba[l]), 10) || 0, g[ba[l]] = parseInt(b.getComputedStyle.call(b, "margin-" + ba[l]), 10) || 0;
  16550. c && !d || D(a, d);
  16551. k.top = e.y - (c ? 0 : a.view.scroll.y);
  16552. k.left = e.x - (c ? 0 : a.view.scroll.x);
  16553. k.outerWidth =
  16554. b.$.offsetWidth;
  16555. k.outerHeight = b.$.offsetHeight;
  16556. k.height = k.outerHeight - (h.top + h.bottom + f.top + f.bottom);
  16557. k.width = k.outerWidth - (h.left + h.right + f.left + f.right);
  16558. k.bottom = k.top + k.outerHeight;
  16559. k.right = k.left + k.outerWidth;
  16560. a.inInlineMode && (k.scroll = {
  16561. top: b.$.scrollTop,
  16562. left: b.$.scrollLeft
  16563. });
  16564. return A({
  16565. border: f,
  16566. padding: h,
  16567. margin: g,
  16568. ignoreScroll: c
  16569. }, k, !0)
  16570. }
  16571. function t(a, b, c) {
  16572. if (!n(b)) return b.size = null;
  16573. if (!b.size) b.size = {};
  16574. else if (b.size.ignoreScroll == c && b.size.date > new Date - L) return null;
  16575. return A(b.size, B(a, b, c), {
  16576. date: +new Date
  16577. }, !0)
  16578. }
  16579. function y(a, b) {
  16580. a.view.editable = B(a, a.editable, b, !0)
  16581. }
  16582. function D(a, b) {
  16583. a.view || (a.view = {});
  16584. var c = a.view;
  16585. if (!(!b && c && c.date > new Date - L)) {
  16586. var d = a.win,
  16587. c = d.getScrollPosition(),
  16588. d = d.getViewPaneSize();
  16589. A(a.view, {
  16590. scroll: {
  16591. x: c.x,
  16592. y: c.y,
  16593. width: a.doc.$.documentElement.scrollWidth - d.width,
  16594. height: a.doc.$.documentElement.scrollHeight - d.height
  16595. },
  16596. pane: {
  16597. width: d.width,
  16598. height: d.height,
  16599. bottom: d.height + c.y
  16600. },
  16601. date: +new Date
  16602. }, !0)
  16603. }
  16604. }
  16605. function x(a, b, c, d) {
  16606. for (var e = d, g = d, h = 0, k = !1, l = !1, m = a.view.pane.height, p = a.mouse; p.y + h < m && 0 < p.y -
  16607. h;) {
  16608. k || (k = b(e, d));
  16609. l || (l = b(g, d));
  16610. !k && 0 < p.y - h && (e = c(a, {
  16611. x: p.x,
  16612. y: p.y - h
  16613. }));
  16614. !l && p.y + h < m && (g = c(a, {
  16615. x: p.x,
  16616. y: p.y + h
  16617. }));
  16618. if (k && l) break;
  16619. h += 2
  16620. }
  16621. return new f([e, g, null, null])
  16622. }
  16623. CKEDITOR.plugins.add("magicline", {
  16624. init: function(a) {
  16625. var c = a.config,
  16626. l = c.magicline_triggerOffset || 30,
  16627. m = {
  16628. editor: a,
  16629. enterMode: c.enterMode,
  16630. triggerOffset: l,
  16631. holdDistance: 0 | l * (c.magicline_holdDistance || .5),
  16632. boxColor: c.magicline_color || "#ff0000",
  16633. rtl: "rtl" == c.contentsLangDirection,
  16634. tabuList: ["data-cke-hidden-sel"].concat(c.magicline_tabuList || []),
  16635. triggers: c.magicline_everywhere ?
  16636. P : {
  16637. table: 1,
  16638. hr: 1,
  16639. div: 1,
  16640. ul: 1,
  16641. ol: 1,
  16642. dl: 1,
  16643. form: 1,
  16644. blockquote: 1
  16645. }
  16646. },
  16647. v, r, t;
  16648. m.isRelevant = function(a) {
  16649. return n(a) && !g(m, a) && !w(a)
  16650. };
  16651. a.on("contentDom", function() {
  16652. var l = a.editable(),
  16653. n = a.document,
  16654. w = a.window;
  16655. A(m, {
  16656. editable: l,
  16657. inInlineMode: l.isInline(),
  16658. doc: n,
  16659. win: w,
  16660. hotNode: null
  16661. }, !0);
  16662. m.boundary = m.inInlineMode ? m.editable : m.doc.getDocumentElement();
  16663. l.is(H.$inline) || (m.inInlineMode && !q(l) && l.setStyles({
  16664. position: "relative",
  16665. top: null,
  16666. left: null
  16667. }), d.call(this, m), D(m), l.attachListener(a, "beforeUndoImage", function() {
  16668. m.line.detach()
  16669. }),
  16670. l.attachListener(a, "beforeGetData", function() {
  16671. m.line.wrap.getParent() && (m.line.detach(), a.once("getData", function() {
  16672. m.line.attach()
  16673. }, null, null, 1E3))
  16674. }, null, null, 0), l.attachListener(m.inInlineMode ? n : n.getWindow().getFrame(), "mouseout", function(b) {
  16675. if ("wysiwyg" == a.mode)
  16676. if (m.inInlineMode) {
  16677. var c = b.data.$.clientX;
  16678. b = b.data.$.clientY;
  16679. D(m);
  16680. y(m, !0);
  16681. var d = m.view.editable,
  16682. e = m.view.scroll;
  16683. c > d.left - e.x && c < d.right - e.x && b > d.top - e.y && b < d.bottom - e.y || (clearTimeout(t), t = null, m.line.detach())
  16684. } else clearTimeout(t), t = null,
  16685. m.line.detach()
  16686. }), l.attachListener(l, "keyup", function() {
  16687. m.hiddenMode = 0
  16688. }), l.attachListener(l, "keydown", function(b) {
  16689. if ("wysiwyg" == a.mode) switch (b.data.getKeystroke()) {
  16690. case 2228240:
  16691. case 16:
  16692. m.hiddenMode = 1, m.line.detach()
  16693. }
  16694. }), l.attachListener(m.inInlineMode ? l : n, "mousemove", function(b) {
  16695. r = !0;
  16696. if ("wysiwyg" == a.mode && !a.readOnly && !t) {
  16697. var c = {
  16698. x: b.data.$.clientX,
  16699. y: b.data.$.clientY
  16700. };
  16701. t = setTimeout(function() {
  16702. m.mouse = c;
  16703. t = m.trigger = null;
  16704. D(m);
  16705. r && !m.hiddenMode && a.focusManager.hasFocus && !m.line.mouseNear() && (m.element =
  16706. U(m, !0)) && ((m.trigger = p(m) || z(m) || X(m)) && !u(m, m.trigger.upper || m.trigger.lower) ? m.line.attach().place() : (m.trigger = null, m.line.detach()), r = !1)
  16707. }, 30)
  16708. }
  16709. }), l.attachListener(w, "scroll", function() {
  16710. "wysiwyg" == a.mode && (m.line.detach(), G.webkit && (m.hiddenMode = 1, clearTimeout(v), v = setTimeout(function() {
  16711. m.mouseDown || (m.hiddenMode = 0)
  16712. }, 50)))
  16713. }), l.attachListener(I ? n : w, "mousedown", function() {
  16714. "wysiwyg" == a.mode && (m.line.detach(), m.hiddenMode = 1, m.mouseDown = 1)
  16715. }), l.attachListener(I ? n : w, "mouseup", function() {
  16716. m.hiddenMode =
  16717. 0;
  16718. m.mouseDown = 0
  16719. }), a.addCommand("accessPreviousSpace", k(m)), a.addCommand("accessNextSpace", k(m, !0)), a.setKeystroke([
  16720. [c.magicline_keystrokePrevious, "accessPreviousSpace"],
  16721. [c.magicline_keystrokeNext, "accessNextSpace"]
  16722. ]), a.on("loadSnapshot", function() {
  16723. var b, c, d, e;
  16724. for (e in {
  16725. p: 1,
  16726. br: 1,
  16727. div: 1
  16728. })
  16729. for (b = a.document.getElementsByTag(e), d = b.count(); d--;)
  16730. if ((c = b.getItem(d)).data("cke-magicline-hot")) {
  16731. m.hotNode = c;
  16732. m.lastCmdDirection = "true" === c.data("cke-magicline-dir") ? !0 : !1;
  16733. return
  16734. }
  16735. }), this.backdoor = {
  16736. accessFocusSpace: h,
  16737. boxTrigger: f,
  16738. isLine: g,
  16739. getAscendantTrigger: b,
  16740. getNonEmptyNeighbour: e,
  16741. getSize: B,
  16742. that: m,
  16743. triggerEdge: z,
  16744. triggerEditable: p,
  16745. triggerExpand: X
  16746. })
  16747. }, this)
  16748. }
  16749. });
  16750. var A = CKEDITOR.tools.extend,
  16751. C = CKEDITOR.dom.element,
  16752. F = C.createFromHtml,
  16753. G = CKEDITOR.env,
  16754. I = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
  16755. H = CKEDITOR.dtd,
  16756. K = {},
  16757. J = 128,
  16758. E = 64,
  16759. S = 32,
  16760. O = 16,
  16761. T = 4,
  16762. M = 2,
  16763. V = 1,
  16764. da = " ",
  16765. ca = H.$listItem,
  16766. ga = H.$tableContent,
  16767. N = A({}, H.$nonEditable, H.$empty),
  16768. P = H.$block,
  16769. L = 100,
  16770. R = "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
  16771. Q = R + "border-color:transparent;display:block;border-style:solid;",
  16772. Y = "\x3cspan\x3e" + da + "\x3c/span\x3e";
  16773. K[CKEDITOR.ENTER_BR] = "br";
  16774. K[CKEDITOR.ENTER_P] = "p";
  16775. K[CKEDITOR.ENTER_DIV] = "div";
  16776. f.prototype = {
  16777. set: function(a, b, c) {
  16778. this.properties = a + b + (c || V);
  16779. return this
  16780. },
  16781. is: function(a) {
  16782. return (this.properties & a) == a
  16783. }
  16784. };
  16785. var U = function() {
  16786. function a(b, c) {
  16787. var d = b.$.elementFromPoint(c.x, c.y);
  16788. return d && d.nodeType ? new CKEDITOR.dom.element(d) : null
  16789. }
  16790. return function(b, c, d) {
  16791. if (!b.mouse) return null;
  16792. var e = b.doc,
  16793. f = b.line.wrap;
  16794. d = d || b.mouse;
  16795. var h = a(e, d);
  16796. c && g(b, h) && (f.hide(), h = a(e, d), f.show());
  16797. return !h || h.type != CKEDITOR.NODE_ELEMENT || !h.$ || G.ie && 9 > G.version && !b.boundary.equals(h) && !b.boundary.contains(h) ? null : h
  16798. }
  16799. }(),
  16800. Z = CKEDITOR.dom.walker.whitespaces(),
  16801. aa = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),
  16802. X = function() {
  16803. function b(e) {
  16804. var f = e.element,
  16805. g, h, k;
  16806. if (!n(f) || f.contains(e.editable) || f.isReadOnly()) return null;
  16807. k = x(e, function(a, b) {
  16808. return !b.equals(a)
  16809. }, function(a, b) {
  16810. return U(a, !0, b)
  16811. }, f);
  16812. g = k.upper;
  16813. h = k.lower;
  16814. if (a(e, g, h)) return k.set(S, 8);
  16815. if (g && f.contains(g))
  16816. for (; !g.getParent().equals(f);) g = g.getParent();
  16817. else g = f.getFirst(function(a) {
  16818. return d(e, a)
  16819. });
  16820. if (h && f.contains(h))
  16821. for (; !h.getParent().equals(f);) h = h.getParent();
  16822. else h = f.getLast(function(a) {
  16823. return d(e, a)
  16824. });
  16825. if (!g || !h) return null;
  16826. t(e, g);
  16827. t(e, h);
  16828. if (!m(e.mouse.y, g.size.top, h.size.bottom)) return null;
  16829. for (var f = Number.MAX_VALUE, l, p, q, v; h && !h.equals(g) && (p = g.getNext(e.isRelevant));) l = Math.abs(c(e, g, p) - e.mouse.y), l < f && (f = l, q = g, v = p), g = p, t(e, g);
  16830. if (!q || !v || !m(e.mouse.y, q.size.top, v.size.bottom)) return null;
  16831. k.upper = q;
  16832. k.lower = v;
  16833. return k.set(S, 8)
  16834. }
  16835. function d(a, b) {
  16836. return !(b && b.type == CKEDITOR.NODE_TEXT || aa(b) || w(b) || g(a, b) || b.type == CKEDITOR.NODE_ELEMENT && b.$ && b.is("br"))
  16837. }
  16838. return function(c) {
  16839. var d = b(c),
  16840. e;
  16841. if (e = d) {
  16842. e = d.upper;
  16843. var f = d.lower;
  16844. e = !e || !f || w(f) || w(e) || f.equals(e) || e.equals(f) || f.contains(e) || e.contains(f) ? !1 : v(c, e) && v(c, f) && a(c, e, f) ? !0 : !1
  16845. }
  16846. return e ? d : null
  16847. }
  16848. }(),
  16849. ba = ["top", "left", "right", "bottom"]
  16850. }(), CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51, CKEDITOR.config.magicline_keystrokeNext =
  16851. CKEDITOR.CTRL + CKEDITOR.SHIFT + 52,
  16852. function() {
  16853. function a(a) {
  16854. if (!a || a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) return [];
  16855. for (var b = [], c = ["style", "className"], e = 0; e < c.length; e++) {
  16856. var f = a.$.elements.namedItem(c[e]);
  16857. f && (f = new CKEDITOR.dom.element(f), b.push([f, f.nextSibling]), f.remove())
  16858. }
  16859. return b
  16860. }
  16861. function f(a, b) {
  16862. if (a && a.type == CKEDITOR.NODE_ELEMENT && "form" == a.getName() && 0 < b.length)
  16863. for (var c = b.length - 1; 0 <= c; c--) {
  16864. var e = b[c][0],
  16865. f = b[c][1];
  16866. f ? e.insertBefore(f) : e.appendTo(a)
  16867. }
  16868. }
  16869. function b(b, c) {
  16870. var d = a(b),
  16871. e = {},
  16872. k = b.$;
  16873. c || (e["class"] = k.className || "", k.className = "");
  16874. e.inline = k.style.cssText || "";
  16875. c || (k.style.cssText = "position: static; overflow: visible");
  16876. f(d);
  16877. return e
  16878. }
  16879. function c(b, c) {
  16880. var d = a(b),
  16881. e = b.$;
  16882. "class" in c && (e.className = c["class"]);
  16883. "inline" in c && (e.style.cssText = c.inline);
  16884. f(d)
  16885. }
  16886. function e(a) {
  16887. if (!a.editable().isInline()) {
  16888. var b = CKEDITOR.instances,
  16889. c;
  16890. for (c in b) {
  16891. var e = b[c];
  16892. "wysiwyg" != e.mode || e.readOnly || (e = e.document.getBody(), e.setAttribute("contentEditable", !1), e.setAttribute("contentEditable", !0))
  16893. }
  16894. a.editable().hasFocus &&
  16895. (a.toolbox.focus(), a.focus())
  16896. }
  16897. }
  16898. CKEDITOR.plugins.add("maximize", {
  16899. init: function(a) {
  16900. function f() {
  16901. var b = k.getViewPaneSize();
  16902. a.resize(b.width, b.height, null, !0)
  16903. }
  16904. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  16905. var d = a.lang,
  16906. h = CKEDITOR.document,
  16907. k = h.getWindow(),
  16908. g, n, w, q = CKEDITOR.TRISTATE_OFF;
  16909. a.addCommand("maximize", {
  16910. modes: {
  16911. wysiwyg: !CKEDITOR.env.iOS,
  16912. source: !CKEDITOR.env.iOS
  16913. },
  16914. readOnly: 1,
  16915. editorFocus: !1,
  16916. exec: function() {
  16917. var v = a.container.getFirst(function(a) {
  16918. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  16919. }),
  16920. u = a.ui.space("contents");
  16921. if ("wysiwyg" == a.mode) {
  16922. var r = a.getSelection();
  16923. g = r && r.getRanges();
  16924. n = k.getScrollPosition()
  16925. } else {
  16926. var p = a.editable().$;
  16927. g = !CKEDITOR.env.ie && [p.selectionStart, p.selectionEnd];
  16928. n = [p.scrollLeft, p.scrollTop]
  16929. }
  16930. if (this.state == CKEDITOR.TRISTATE_OFF) {
  16931. k.on("resize", f);
  16932. w = k.getScrollPosition();
  16933. for (r = a.container; r = r.getParent();) r.setCustomData("maximize_saved_styles", b(r)), r.setStyle("z-index", a.config.baseFloatZIndex - 5);
  16934. u.setCustomData("maximize_saved_styles", b(u, !0));
  16935. v.setCustomData("maximize_saved_styles",
  16936. b(v, !0));
  16937. u = {
  16938. overflow: CKEDITOR.env.webkit ? "" : "hidden",
  16939. width: 0,
  16940. height: 0
  16941. };
  16942. h.getDocumentElement().setStyles(u);
  16943. !CKEDITOR.env.gecko && h.getDocumentElement().setStyle("position", "fixed");
  16944. CKEDITOR.env.gecko && CKEDITOR.env.quirks || h.getBody().setStyles(u);
  16945. CKEDITOR.env.ie ? setTimeout(function() {
  16946. k.$.scrollTo(0, 0)
  16947. }, 0) : k.$.scrollTo(0, 0);
  16948. v.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute");
  16949. v.$.offsetLeft;
  16950. v.setStyles({
  16951. "z-index": a.config.baseFloatZIndex - 5,
  16952. left: "0px",
  16953. top: "0px"
  16954. });
  16955. v.addClass("cke_maximized");
  16956. f();
  16957. u = v.getDocumentPosition();
  16958. v.setStyles({
  16959. left: -1 * u.x + "px",
  16960. top: -1 * u.y + "px"
  16961. });
  16962. CKEDITOR.env.gecko && e(a)
  16963. } else if (this.state == CKEDITOR.TRISTATE_ON) {
  16964. k.removeListener("resize", f);
  16965. for (var r = [u, v], z = 0; z < r.length; z++) c(r[z], r[z].getCustomData("maximize_saved_styles")), r[z].removeCustomData("maximize_saved_styles");
  16966. for (r = a.container; r = r.getParent();) c(r, r.getCustomData("maximize_saved_styles")), r.removeCustomData("maximize_saved_styles");
  16967. CKEDITOR.env.ie ? setTimeout(function() {
  16968. k.$.scrollTo(w.x, w.y)
  16969. }, 0) : k.$.scrollTo(w.x,
  16970. w.y);
  16971. v.removeClass("cke_maximized");
  16972. CKEDITOR.env.webkit && (v.setStyle("display", "inline"), setTimeout(function() {
  16973. v.setStyle("display", "block")
  16974. }, 0));
  16975. a.fire("resize", {
  16976. outerHeight: a.container.$.offsetHeight,
  16977. contentsHeight: u.$.offsetHeight,
  16978. outerWidth: a.container.$.offsetWidth
  16979. })
  16980. }
  16981. this.toggleState();
  16982. if (r = this.uiItems[0]) u = this.state == CKEDITOR.TRISTATE_OFF ? d.maximize.maximize : d.maximize.minimize, r = CKEDITOR.document.getById(r._.id), r.getChild(1).setHtml(u), r.setAttribute("title", u), r.setAttribute("href", 'javascript:void("' +
  16983. u + '");');
  16984. "wysiwyg" == a.mode ? g ? (CKEDITOR.env.gecko && e(a), a.getSelection().selectRanges(g), (p = a.getSelection().getStartElement()) && p.scrollIntoView(!0)) : k.$.scrollTo(n.x, n.y) : (g && (p.selectionStart = g[0], p.selectionEnd = g[1]), p.scrollLeft = n[0], p.scrollTop = n[1]);
  16985. g = n = null;
  16986. q = this.state;
  16987. a.fire("maximize", this.state)
  16988. },
  16989. canUndo: !1
  16990. });
  16991. a.ui.addButton && a.ui.addButton("Maximize", {
  16992. label: d.maximize.maximize,
  16993. command: "maximize",
  16994. toolbar: "tools,10"
  16995. });
  16996. a.on("mode", function() {
  16997. var b = a.getCommand("maximize");
  16998. b.setState(b.state ==
  16999. CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : q)
  17000. }, null, null, 100)
  17001. }
  17002. }
  17003. })
  17004. }(),
  17005. function() {
  17006. function a(a, c, e) {
  17007. var f = CKEDITOR.cleanWord;
  17008. f ? e() : (a = CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile || c + "filter/default.js"), CKEDITOR.scriptLoader.load(a, e, null, !0));
  17009. return !f
  17010. }
  17011. function f(a) {
  17012. a.data.type = "html"
  17013. }
  17014. CKEDITOR.plugins.add("pastefromword", {
  17015. requires: "clipboard",
  17016. init: function(b) {
  17017. var c = 0,
  17018. e = this.path;
  17019. b.addCommand("pastefromword", {
  17020. canUndo: !1,
  17021. async: !0,
  17022. exec: function(a) {
  17023. var b = this;
  17024. c = 1;
  17025. a.once("beforePaste", f);
  17026. a.getClipboardData({
  17027. title: a.lang.pastefromword.title
  17028. }, function(c) {
  17029. c && a.fire("paste", {
  17030. type: "html",
  17031. dataValue: c.dataValue,
  17032. method: "paste",
  17033. dataTransfer: CKEDITOR.plugins.clipboard.initPasteDataTransfer()
  17034. });
  17035. a.fire("afterCommandExec", {
  17036. name: "pastefromword",
  17037. command: b,
  17038. returnValue: !!c
  17039. })
  17040. })
  17041. }
  17042. });
  17043. b.ui.addButton && b.ui.addButton("PasteFromWord", {
  17044. label: b.lang.pastefromword.toolbar,
  17045. command: "pastefromword",
  17046. toolbar: "clipboard,50"
  17047. });
  17048. b.on("pasteState", function(a) {
  17049. b.getCommand("pastefromword").setState(a.data)
  17050. });
  17051. b.on("paste",
  17052. function(f) {
  17053. var l = f.data,
  17054. d = l.dataValue,
  17055. h = /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,
  17056. k = {
  17057. dataValue: d
  17058. };
  17059. if (d && (c || h.test(d)) && (!1 !== b.fire("pasteFromWord", k) || c)) {
  17060. l.dontFilter = !0;
  17061. var g = a(b, e, function() {
  17062. if (g) b.fire("paste", l);
  17063. else if (!b.config.pasteFromWordPromptCleanup || c || confirm(b.lang.pastefromword.confirmCleanup)) k.dataValue = CKEDITOR.cleanWord(k.dataValue, b), b.fire("afterPasteFromWord", k), l.dataValue = k.dataValue;
  17064. c = 0
  17065. });
  17066. g && f.cancel()
  17067. }
  17068. }, null, null, 3)
  17069. }
  17070. })
  17071. }(),
  17072. function() {
  17073. var a = {
  17074. canUndo: !1,
  17075. async: !0,
  17076. exec: function(f) {
  17077. f.getClipboardData({
  17078. title: f.lang.pastetext.title
  17079. }, function(b) {
  17080. b && f.fire("paste", {
  17081. type: "text",
  17082. dataValue: b.dataValue,
  17083. method: "paste",
  17084. dataTransfer: CKEDITOR.plugins.clipboard.initPasteDataTransfer()
  17085. });
  17086. f.fire("afterCommandExec", {
  17087. name: "pastetext",
  17088. command: a,
  17089. returnValue: !!b
  17090. })
  17091. })
  17092. }
  17093. };
  17094. CKEDITOR.plugins.add("pastetext", {
  17095. requires: "clipboard",
  17096. init: function(f) {
  17097. f.addCommand("pastetext", a);
  17098. f.ui.addButton && f.ui.addButton("PasteText", {
  17099. label: f.lang.pastetext.button,
  17100. command: "pastetext",
  17101. toolbar: "clipboard,40"
  17102. });
  17103. if (f.config.forcePasteAsPlainText) f.on("beforePaste", function(a) {
  17104. "html" != a.data.type && (a.data.type = "text")
  17105. });
  17106. f.on("pasteState", function(a) {
  17107. f.getCommand("pastetext").setState(a.data)
  17108. })
  17109. }
  17110. })
  17111. }(), CKEDITOR.plugins.add("removeformat", {
  17112. init: function(a) {
  17113. a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
  17114. a.ui.addButton && a.ui.addButton("RemoveFormat", {
  17115. label: a.lang.removeformat.toolbar,
  17116. command: "removeFormat",
  17117. toolbar: "cleanup,10"
  17118. })
  17119. }
  17120. }), CKEDITOR.plugins.removeformat = {
  17121. commands: {
  17122. removeformat: {
  17123. exec: function(a) {
  17124. for (var f = a._.removeFormatRegex || (a._.removeFormatRegex = new RegExp("^(?:" + a.config.removeFormatTags.replace(/,/g, "|") + ")$", "i")), b = a._.removeAttributes || (a._.removeAttributes = a.config.removeFormatAttributes.split(",")), c = CKEDITOR.plugins.removeformat.filter, e = a.getSelection().getRanges(), m = e.createIterator(), l = function(a) {
  17125. return a.type == CKEDITOR.NODE_ELEMENT
  17126. }, d; d = m.getNextRange();) {
  17127. d.collapsed || d.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  17128. var h = d.createBookmark(),
  17129. k = h.startNode,
  17130. g = h.endNode,
  17131. n = function(b) {
  17132. for (var d = a.elementPath(b), e = d.elements, g = 1, h;
  17133. (h = e[g]) && !h.equals(d.block) && !h.equals(d.blockLimit); g++) f.test(h.getName()) && c(a, h) && b.breakParent(h)
  17134. };
  17135. n(k);
  17136. if (g)
  17137. for (n(g), k = k.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); k && !k.equals(g);)
  17138. if (k.isReadOnly()) {
  17139. if (k.getPosition(g) & CKEDITOR.POSITION_CONTAINS) break;
  17140. k = k.getNext(l)
  17141. } else n = k.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT), "img" == k.getName() && k.data("cke-realelement") || !c(a, k) || (f.test(k.getName()) ? k.remove(1) :
  17142. (k.removeAttributes(b), a.fire("removeFormatCleanup", k))), k = n;
  17143. d.moveToBookmark(h)
  17144. }
  17145. a.forceNextSelectionCheck();
  17146. a.getSelection().selectRanges(e)
  17147. }
  17148. }
  17149. },
  17150. filter: function(a, f) {
  17151. for (var b = a._.removeFormatFilters || [], c = 0; c < b.length; c++)
  17152. if (!1 === b[c](f)) return !1;
  17153. return !0
  17154. }
  17155. }, CKEDITOR.editor.prototype.addRemoveFormatFilter = function(a) {
  17156. this._.removeFormatFilters || (this._.removeFormatFilters = []);
  17157. this._.removeFormatFilters.push(a)
  17158. }, 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",
  17159. CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign", CKEDITOR.plugins.add("resize", {
  17160. init: function(a) {
  17161. function f(b) {
  17162. var e = h.width,
  17163. f = h.height,
  17164. l = e + (b.data.$.screenX - d.x) * ("rtl" == m ? -1 : 1);
  17165. b = f + (b.data.$.screenY - d.y);
  17166. k && (e = Math.max(c.resize_minWidth, Math.min(l, c.resize_maxWidth)));
  17167. g && (f = Math.max(c.resize_minHeight, Math.min(b, c.resize_maxHeight)));
  17168. a.resize(k ? e : null, f)
  17169. }
  17170. function b() {
  17171. CKEDITOR.document.removeListener("mousemove", f);
  17172. CKEDITOR.document.removeListener("mouseup",
  17173. b);
  17174. a.document && (a.document.removeListener("mousemove", f), a.document.removeListener("mouseup", b))
  17175. }
  17176. var c = a.config,
  17177. e = a.ui.spaceId("resizer"),
  17178. m = a.element ? a.element.getDirection(1) : "ltr";
  17179. !c.resize_dir && (c.resize_dir = "vertical");
  17180. void 0 === c.resize_maxWidth && (c.resize_maxWidth = 3E3);
  17181. void 0 === c.resize_maxHeight && (c.resize_maxHeight = 3E3);
  17182. void 0 === c.resize_minWidth && (c.resize_minWidth = 750);
  17183. void 0 === c.resize_minHeight && (c.resize_minHeight = 250);
  17184. if (!1 !== c.resize_enabled) {
  17185. var l = null,
  17186. d, h, k = ("both" == c.resize_dir ||
  17187. "horizontal" == c.resize_dir) && c.resize_minWidth != c.resize_maxWidth,
  17188. g = ("both" == c.resize_dir || "vertical" == c.resize_dir) && c.resize_minHeight != c.resize_maxHeight,
  17189. n = CKEDITOR.tools.addFunction(function(e) {
  17190. l || (l = a.getResizable());
  17191. h = {
  17192. width: l.$.offsetWidth || 0,
  17193. height: l.$.offsetHeight || 0
  17194. };
  17195. d = {
  17196. x: e.screenX,
  17197. y: e.screenY
  17198. };
  17199. c.resize_minWidth > h.width && (c.resize_minWidth = h.width);
  17200. c.resize_minHeight > h.height && (c.resize_minHeight = h.height);
  17201. CKEDITOR.document.on("mousemove", f);
  17202. CKEDITOR.document.on("mouseup", b);
  17203. a.document &&
  17204. (a.document.on("mousemove", f), a.document.on("mouseup", b));
  17205. e.preventDefault && e.preventDefault()
  17206. });
  17207. a.on("destroy", function() {
  17208. CKEDITOR.tools.removeFunction(n)
  17209. });
  17210. a.on("uiSpace", function(b) {
  17211. if ("bottom" == b.data.space) {
  17212. var c = "";
  17213. k && !g && (c = " cke_resizer_horizontal");
  17214. !k && g && (c = " cke_resizer_vertical");
  17215. var d = '\x3cspan id\x3d"' + e + '" class\x3d"cke_resizer' + c + " cke_resizer_" + m + '" title\x3d"' + CKEDITOR.tools.htmlEncode(a.lang.common.resize) + '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + n + ', event)"\x3e' + ("ltr" ==
  17216. m ? "◢" : "◣") + "\x3c/span\x3e";
  17217. "ltr" == m && "ltr" == c ? b.data.html += d : b.data.html = d + b.data.html
  17218. }
  17219. }, a, null, 100);
  17220. a.on("maximize", function(b) {
  17221. a.ui.space("resizer")[b.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]()
  17222. })
  17223. }
  17224. }
  17225. }), CKEDITOR.plugins.add("menubutton", {
  17226. requires: "button,menu",
  17227. onLoad: function() {
  17228. var a = function(a) {
  17229. var b = this._,
  17230. c = b.menu;
  17231. b.state !== CKEDITOR.TRISTATE_DISABLED && (b.on && c ? c.hide() : (b.previousState = b.state, c || (c = b.menu = new CKEDITOR.menu(a, {
  17232. panel: {
  17233. className: "cke_menu_panel",
  17234. attributes: {
  17235. "aria-label": a.lang.common.options
  17236. }
  17237. }
  17238. }),
  17239. c.onHide = CKEDITOR.tools.bind(function() {
  17240. var c = this.command ? a.getCommand(this.command).modes : this.modes;
  17241. this.setState(!c || c[a.mode] ? b.previousState : CKEDITOR.TRISTATE_DISABLED);
  17242. b.on = 0
  17243. }, this), this.onMenu && c.addListener(this.onMenu)), this.setState(CKEDITOR.TRISTATE_ON), b.on = 1, setTimeout(function() {
  17244. c.show(CKEDITOR.document.getById(b.id), 4)
  17245. }, 0)))
  17246. };
  17247. CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({
  17248. base: CKEDITOR.ui.button,
  17249. $: function(f) {
  17250. delete f.panel;
  17251. this.base(f);
  17252. this.hasArrow = !0;
  17253. this.click = a
  17254. },
  17255. statics: {
  17256. handler: {
  17257. create: function(a) {
  17258. return new CKEDITOR.ui.menuButton(a)
  17259. }
  17260. }
  17261. }
  17262. })
  17263. },
  17264. beforeInit: function(a) {
  17265. a.ui.addHandler(CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler)
  17266. }
  17267. }), CKEDITOR.UI_MENUBUTTON = "menubutton", "use strict", CKEDITOR.plugins.add("scayt", {
  17268. requires: "menubutton,dialog",
  17269. tabToOpen: null,
  17270. dialogName: "scaytDialog",
  17271. onLoad: function(a) {
  17272. CKEDITOR.plugins.scayt.onLoadTimestamp = (new Date).getTime();
  17273. "moono-lisa" == (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(this.path + "skins/" + CKEDITOR.skin.name + "/scayt.css")
  17274. },
  17275. init: function(a) {
  17276. var f = this,
  17277. b = CKEDITOR.plugins.scayt;
  17278. this.bindEvents(a);
  17279. this.parseConfig(a);
  17280. this.addRule(a);
  17281. CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + "dialogs/options.js"));
  17282. this.addMenuItems(a);
  17283. var c = a.lang.scayt,
  17284. e = CKEDITOR.env;
  17285. a.ui.add("Scayt", CKEDITOR.UI_MENUBUTTON, {
  17286. label: c.text_title,
  17287. title: a.plugins.wsc ? a.lang.wsc.title : c.text_title,
  17288. modes: {
  17289. wysiwyg: !(e.ie && (8 > e.version || e.quirks))
  17290. },
  17291. toolbar: "spellchecker,20",
  17292. refresh: function() {
  17293. var c = a.ui.instances.Scayt.getState();
  17294. a.scayt && (c = b.state.scayt[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
  17295. a.fire("scaytButtonState", c)
  17296. },
  17297. onRender: function() {
  17298. var b = this;
  17299. a.on("scaytButtonState", function(a) {
  17300. void 0 !== typeof a.data && b.setState(a.data)
  17301. })
  17302. },
  17303. onMenu: function() {
  17304. var c = a.scayt;
  17305. a.getMenuItem("scaytToggle").label = a.lang.scayt[c && b.state.scayt[a.name] ? "btn_disable" : "btn_enable"];
  17306. c = {
  17307. scaytToggle: CKEDITOR.TRISTATE_OFF,
  17308. scaytOptions: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  17309. scaytLangs: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  17310. scaytDict: c ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  17311. scaytAbout: c ?
  17312. CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  17313. WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  17314. };
  17315. a.config.scayt_uiTabs[0] || delete c.scaytOptions;
  17316. a.config.scayt_uiTabs[1] || delete c.scaytLangs;
  17317. a.config.scayt_uiTabs[2] || delete c.scaytDict;
  17318. return c
  17319. }
  17320. });
  17321. a.contextMenu && a.addMenuItems && (a.contextMenu.addListener(function(b, c) {
  17322. var d = a.scayt,
  17323. e, k;
  17324. d && (k = d.getSelectionNode()) && (e = f.menuGenerator(a, k), d.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" .")));
  17325. return e
  17326. }),
  17327. a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function(b) {
  17328. return function() {
  17329. var c = a.scayt;
  17330. c && c.hideBanner();
  17331. return b.apply(this)
  17332. }
  17333. }))
  17334. },
  17335. addMenuItems: function(a) {
  17336. var f = this,
  17337. b = CKEDITOR.plugins.scayt;
  17338. a.addMenuGroup("scaytButton");
  17339. for (var c = a.config.scayt_contextMenuItemsOrder.split("|"), e = 0; e < c.length; e++) c[e] = "scayt_" + c[e];
  17340. if ((c = ["grayt_description", "grayt_suggest", "grayt_control"].concat(c)) && c.length)
  17341. for (e = 0; e < c.length; e++) a.addMenuGroup(c[e], e - 10);
  17342. a.addCommand("scaytToggle", {
  17343. exec: function(a) {
  17344. var c = a.scayt;
  17345. b.state.scayt[a.name] = !b.state.scayt[a.name];
  17346. !0 === b.state.scayt[a.name] ? c || b.createScayt(a) : c && b.destroy(a)
  17347. }
  17348. });
  17349. a.addCommand("scaytAbout", {
  17350. exec: function(a) {
  17351. a.scayt.tabToOpen = "about";
  17352. a.lockSelection();
  17353. a.openDialog(f.dialogName)
  17354. }
  17355. });
  17356. a.addCommand("scaytOptions", {
  17357. exec: function(a) {
  17358. a.scayt.tabToOpen = "options";
  17359. a.lockSelection();
  17360. a.openDialog(f.dialogName)
  17361. }
  17362. });
  17363. a.addCommand("scaytLangs", {
  17364. exec: function(a) {
  17365. a.scayt.tabToOpen = "langs";
  17366. a.lockSelection();
  17367. a.openDialog(f.dialogName)
  17368. }
  17369. });
  17370. a.addCommand("scaytDict", {
  17371. exec: function(a) {
  17372. a.scayt.tabToOpen = "dictionaries";
  17373. a.lockSelection();
  17374. a.openDialog(f.dialogName)
  17375. }
  17376. });
  17377. c = {
  17378. scaytToggle: {
  17379. label: a.lang.scayt.btn_enable,
  17380. group: "scaytButton",
  17381. command: "scaytToggle"
  17382. },
  17383. scaytAbout: {
  17384. label: a.lang.scayt.btn_about,
  17385. group: "scaytButton",
  17386. command: "scaytAbout"
  17387. },
  17388. scaytOptions: {
  17389. label: a.lang.scayt.btn_options,
  17390. group: "scaytButton",
  17391. command: "scaytOptions"
  17392. },
  17393. scaytLangs: {
  17394. label: a.lang.scayt.btn_langs,
  17395. group: "scaytButton",
  17396. command: "scaytLangs"
  17397. },
  17398. scaytDict: {
  17399. label: a.lang.scayt.btn_dictionaries,
  17400. group: "scaytButton",
  17401. command: "scaytDict"
  17402. }
  17403. };
  17404. a.plugins.wsc && (c.WSC = {
  17405. label: a.lang.wsc.toolbar,
  17406. group: "scaytButton",
  17407. onClick: function() {
  17408. var b = CKEDITOR.plugins.scayt,
  17409. c = a.scayt,
  17410. d = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  17411. (d = d.replace(/\s/g, "")) ? (c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!0), a.lockSelection(), a.execCommand("checkspell")) : alert("Nothing to check!")
  17412. }
  17413. });
  17414. a.addMenuItems(c)
  17415. },
  17416. bindEvents: function(a) {
  17417. var f = CKEDITOR.plugins.scayt,
  17418. b = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE,
  17419. c = function() {
  17420. f.destroy(a)
  17421. },
  17422. e = function() {
  17423. !f.state.scayt[a.name] || a.readOnly || a.scayt || f.createScayt(a)
  17424. },
  17425. m = function() {
  17426. var c = a.editable();
  17427. c.attachListener(c, "focus", function(c) {
  17428. CKEDITOR.plugins.scayt && !a.scayt && setTimeout(e, 0);
  17429. c = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[a.name] && a.scayt;
  17430. var d, f;
  17431. if ((b || c) && a._.savedSelection) {
  17432. c = a._.savedSelection.getSelectedElement();
  17433. c = !c && a._.savedSelection.getRanges();
  17434. for (var l = 0; l < c.length; l++) f = c[l], "string" ===
  17435. typeof f.startContainer.$.nodeValue && (d = f.startContainer.getText().length, (d < f.startOffset || d < f.endOffset) && a.unlockSelection(!1))
  17436. }
  17437. }, this, null, -10)
  17438. },
  17439. l = function() {
  17440. b ? a.config.scayt_inlineModeImmediateMarkup ? e() : (a.on("blur", function() {
  17441. setTimeout(c, 0)
  17442. }), a.on("focus", e), a.focusManager.hasFocus && e()) : e();
  17443. m();
  17444. var d = a.editable();
  17445. d.attachListener(d, "mousedown", function(b) {
  17446. b = b.data.getTarget();
  17447. var c = a.widgets && a.widgets.getByElement(b);
  17448. c && (c.wrapper = b.getAscendant(function(a) {
  17449. return a.hasAttribute("data-cke-widget-wrapper")
  17450. }, !0))
  17451. }, this, null, -10)
  17452. };
  17453. a.on("contentDom", l);
  17454. a.on("beforeCommandExec", function(b) {
  17455. var c = a.scayt,
  17456. e = null,
  17457. g = !1,
  17458. l = !0;
  17459. b.data.name in f.options.disablingCommandExec && "wysiwyg" == a.mode ? c && (f.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)) : "bold" !== b.data.name && "italic" !== b.data.name && "underline" !== b.data.name && "strike" !== b.data.name && "subscript" !== b.data.name && "superscript" !== b.data.name && "enter" !== b.data.name && "cut" !== b.data.name && "language" !== b.data.name || !c || ("cut" === b.data.name && (l = !1,
  17460. g = !0), "language" === b.data.name && (e = (e = a.plugins.language.getCurrentLangElement(a)) && e.$, g = !0), a.fire("reloadMarkupScayt", {
  17461. removeOptions: {
  17462. removeInside: l,
  17463. forceBookmark: g,
  17464. selectionNode: e
  17465. },
  17466. timeout: 0
  17467. }))
  17468. });
  17469. a.on("beforeSetMode", function(b) {
  17470. if ("source" == b.data) {
  17471. if (b = a.scayt) f.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED);
  17472. a.document && a.document.getBody().removeAttribute("_jquid")
  17473. }
  17474. });
  17475. a.on("afterCommandExec", function(b) {
  17476. "wysiwyg" != a.mode || "undo" != b.data.name && "redo" != b.data.name || setTimeout(function() {
  17477. f.reloadMarkup(a.scayt)
  17478. },
  17479. 250)
  17480. });
  17481. a.on("readOnly", function(b) {
  17482. var c;
  17483. b && (c = a.scayt, !0 === b.editor.readOnly ? c && c.fire("removeMarkupInDocument", {}) : c ? f.reloadMarkup(c) : "wysiwyg" == b.editor.mode && !0 === f.state.scayt[b.editor.name] && (f.createScayt(a), b.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)))
  17484. });
  17485. a.on("beforeDestroy", c);
  17486. a.on("setData", function() {
  17487. c();
  17488. (a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || a.plugins.divarea) && l()
  17489. }, this, null, 50);
  17490. a.on("reloadMarkupScayt", function(b) {
  17491. var c = b.data && b.data.removeOptions;
  17492. b = b.data && b.data.timeout;
  17493. var e = a.scayt;
  17494. e && setTimeout(function() {
  17495. e.removeMarkupInSelectionNode(c);
  17496. f.reloadMarkup(e)
  17497. }, b || 0)
  17498. });
  17499. a.on("insertElement", function() {
  17500. a.fire("reloadMarkupScayt", {
  17501. removeOptions: {
  17502. forceBookmark: !0
  17503. }
  17504. })
  17505. }, this, null, 50);
  17506. a.on("insertHtml", function() {
  17507. a.fire("reloadMarkupScayt")
  17508. }, this, null, 50);
  17509. a.on("insertText", function() {
  17510. a.fire("reloadMarkupScayt")
  17511. }, this, null, 50);
  17512. a.on("scaytDialogShown", function(b) {
  17513. b.data.selectPage(a.scayt.tabToOpen)
  17514. })
  17515. },
  17516. parseConfig: function(a) {
  17517. var f = CKEDITOR.plugins.scayt;
  17518. f.replaceOldOptionsNames(a.config);
  17519. "boolean" !== typeof a.config.scayt_autoStartup && (a.config.scayt_autoStartup = !1);
  17520. f.state.scayt[a.name] = a.config.scayt_autoStartup;
  17521. "boolean" !== typeof a.config.grayt_autoStartup && (a.config.grayt_autoStartup = !1);
  17522. "boolean" !== typeof a.config.scayt_inlineModeImmediateMarkup && (a.config.scayt_inlineModeImmediateMarkup = !1);
  17523. f.state.grayt[a.name] = a.config.grayt_autoStartup;
  17524. a.config.scayt_contextCommands || (a.config.scayt_contextCommands = "ignore|ignoreall|add");
  17525. a.config.scayt_contextMenuItemsOrder || (a.config.scayt_contextMenuItemsOrder =
  17526. "suggest|moresuggest|control");
  17527. a.config.scayt_sLang || (a.config.scayt_sLang = "en_US");
  17528. if (void 0 === a.config.scayt_maxSuggestions || "number" != typeof a.config.scayt_maxSuggestions || 0 > a.config.scayt_maxSuggestions) a.config.scayt_maxSuggestions = 5;
  17529. if (void 0 === a.config.scayt_minWordLength || "number" != typeof a.config.scayt_minWordLength || 1 > a.config.scayt_minWordLength) a.config.scayt_minWordLength = 4;
  17530. if (void 0 === a.config.scayt_customDictionaryIds || "string" !== typeof a.config.scayt_customDictionaryIds) a.config.scayt_customDictionaryIds =
  17531. "";
  17532. if (void 0 === a.config.scayt_userDictionaryName || "string" !== typeof a.config.scayt_userDictionaryName) a.config.scayt_userDictionaryName = null;
  17533. if ("string" === typeof a.config.scayt_uiTabs && 3 === a.config.scayt_uiTabs.split(",").length) {
  17534. var b = [],
  17535. c = [];
  17536. a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");
  17537. CKEDITOR.tools.search(a.config.scayt_uiTabs, function(a) {
  17538. 1 === Number(a) || 0 === Number(a) ? (c.push(!0), b.push(Number(a))) : c.push(!1)
  17539. });
  17540. null === CKEDITOR.tools.search(c, !1) ? a.config.scayt_uiTabs = b : a.config.scayt_uiTabs = [1, 1, 1]
  17541. } else a.config.scayt_uiTabs = [1, 1, 1];
  17542. "string" != typeof a.config.scayt_serviceProtocol && (a.config.scayt_serviceProtocol = null);
  17543. "string" != typeof a.config.scayt_serviceHost && (a.config.scayt_serviceHost = null);
  17544. "string" != typeof a.config.scayt_servicePort && (a.config.scayt_servicePort = null);
  17545. "string" != typeof a.config.scayt_servicePath && (a.config.scayt_servicePath = null);
  17546. a.config.scayt_moreSuggestions || (a.config.scayt_moreSuggestions = "on");
  17547. "string" !== typeof a.config.scayt_customerId && (a.config.scayt_customerId =
  17548. "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");
  17549. "string" !== typeof a.config.scayt_srcUrl && (f = document.location.protocol, f = -1 != f.search(/https?:/) ? f : "http:", a.config.scayt_srcUrl = f + "//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js");
  17550. "boolean" !== typeof CKEDITOR.config.scayt_handleCheckDirty && (CKEDITOR.config.scayt_handleCheckDirty = !0);
  17551. "boolean" !== typeof CKEDITOR.config.scayt_handleUndoRedo && (CKEDITOR.config.scayt_handleUndoRedo = !0);
  17552. CKEDITOR.config.scayt_handleUndoRedo =
  17553. CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : !1;
  17554. "boolean" !== typeof a.config.scayt_multiLanguageMode && (a.config.scayt_multiLanguageMode = !1);
  17555. "object" !== typeof a.config.scayt_multiLanguageStyles && (a.config.scayt_multiLanguageStyles = {});
  17556. a.config.scayt_ignoreAllCapsWords && "boolean" !== typeof a.config.scayt_ignoreAllCapsWords && (a.config.scayt_ignoreAllCapsWords = !1);
  17557. a.config.scayt_ignoreDomainNames && "boolean" !== typeof a.config.scayt_ignoreDomainNames && (a.config.scayt_ignoreDomainNames = !1);
  17558. a.config.scayt_ignoreWordsWithMixedCases &&
  17559. "boolean" !== typeof a.config.scayt_ignoreWordsWithMixedCases && (a.config.scayt_ignoreWordsWithMixedCases = !1);
  17560. a.config.scayt_ignoreWordsWithNumbers && "boolean" !== typeof a.config.scayt_ignoreWordsWithNumbers && (a.config.scayt_ignoreWordsWithNumbers = !1);
  17561. if (a.config.scayt_disableOptionsStorage) {
  17562. var f = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ? a.config.scayt_disableOptionsStorage : "string" === typeof a.config.scayt_disableOptionsStorage ? [a.config.scayt_disableOptionsStorage] : void 0,
  17563. e = "all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),
  17564. m = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
  17565. l = CKEDITOR.tools.search,
  17566. d = CKEDITOR.tools.indexOf;
  17567. a.config.scayt_disableOptionsStorage = function(a) {
  17568. for (var b = [], c = 0; c < a.length; c++) {
  17569. var f = a[c],
  17570. w = !!l(a, "options");
  17571. if (!l(e, f) || w && l(m, function(a) {
  17572. if ("lang" === a) return !1
  17573. })) return;
  17574. l(m, f) && m.splice(d(m, f), 1);
  17575. if ("all" === f || w && l(a, "lang")) return [];
  17576. "options" === f && (m = ["lang"])
  17577. }
  17578. return b = b.concat(m)
  17579. }(f)
  17580. }
  17581. },
  17582. addRule: function(a) {
  17583. var f = CKEDITOR.plugins.scayt,
  17584. b = a.dataProcessor,
  17585. c = b && b.htmlFilter,
  17586. e = a._.elementsPath && a._.elementsPath.filters,
  17587. b = b && b.dataFilter,
  17588. m = a.addRemoveFormatFilter,
  17589. l = function(b) {
  17590. if (a.scayt && (b.hasAttribute(f.options.data_attribute_name) || b.hasAttribute(f.options.problem_grammar_data_attribute))) return !1
  17591. },
  17592. d = function(b) {
  17593. var c = !0;
  17594. a.scayt && (b.hasAttribute(f.options.data_attribute_name) || b.hasAttribute(f.options.problem_grammar_data_attribute)) && (c = !1);
  17595. return c
  17596. };
  17597. e && e.push(l);
  17598. b && b.addRules({
  17599. elements: {
  17600. span: function(a) {
  17601. var b = a.hasClass(f.options.misspelled_word_class) &&
  17602. a.attributes[f.options.data_attribute_name],
  17603. c = a.hasClass(f.options.problem_grammar_class) && a.attributes[f.options.problem_grammar_data_attribute];
  17604. f && (b || c) && delete a.name;
  17605. return a
  17606. }
  17607. }
  17608. });
  17609. c && c.addRules({
  17610. elements: {
  17611. span: function(a) {
  17612. var b = a.hasClass(f.options.misspelled_word_class) && a.attributes[f.options.data_attribute_name],
  17613. c = a.hasClass(f.options.problem_grammar_class) && a.attributes[f.options.problem_grammar_data_attribute];
  17614. f && (b || c) && delete a.name;
  17615. return a
  17616. }
  17617. }
  17618. });
  17619. m && m.call(a, d)
  17620. },
  17621. scaytMenuDefinition: function(a) {
  17622. var f =
  17623. this;
  17624. a = a.scayt;
  17625. return {
  17626. scayt: {
  17627. scayt_ignore: {
  17628. label: a.getLocal("btn_ignore"),
  17629. group: "scayt_control",
  17630. order: 1,
  17631. exec: function(a) {
  17632. a.scayt.ignoreWord()
  17633. }
  17634. },
  17635. scayt_ignoreall: {
  17636. label: a.getLocal("btn_ignoreAll"),
  17637. group: "scayt_control",
  17638. order: 2,
  17639. exec: function(a) {
  17640. a.scayt.ignoreAllWords()
  17641. }
  17642. },
  17643. scayt_add: {
  17644. label: a.getLocal("btn_addWord"),
  17645. group: "scayt_control",
  17646. order: 3,
  17647. exec: function(a) {
  17648. var c = a.scayt;
  17649. setTimeout(function() {
  17650. c.addWordToUserDictionary()
  17651. }, 10)
  17652. }
  17653. },
  17654. scayt_option: {
  17655. label: a.getLocal("btn_options"),
  17656. group: "scayt_control",
  17657. order: 4,
  17658. exec: function(a) {
  17659. a.scayt.tabToOpen = "options";
  17660. a.lockSelection();
  17661. a.openDialog(f.dialogName)
  17662. },
  17663. verification: function(a) {
  17664. return 1 == a.config.scayt_uiTabs[0] ? !0 : !1
  17665. }
  17666. },
  17667. scayt_language: {
  17668. label: a.getLocal("btn_langs"),
  17669. group: "scayt_control",
  17670. order: 5,
  17671. exec: function(a) {
  17672. a.scayt.tabToOpen = "langs";
  17673. a.lockSelection();
  17674. a.openDialog(f.dialogName)
  17675. },
  17676. verification: function(a) {
  17677. return 1 == a.config.scayt_uiTabs[1] ? !0 : !1
  17678. }
  17679. },
  17680. scayt_dictionary: {
  17681. label: a.getLocal("btn_dictionaries"),
  17682. group: "scayt_control",
  17683. order: 6,
  17684. exec: function(a) {
  17685. a.scayt.tabToOpen =
  17686. "dictionaries";
  17687. a.lockSelection();
  17688. a.openDialog(f.dialogName)
  17689. },
  17690. verification: function(a) {
  17691. return 1 == a.config.scayt_uiTabs[2] ? !0 : !1
  17692. }
  17693. },
  17694. scayt_about: {
  17695. label: a.getLocal("btn_about"),
  17696. group: "scayt_control",
  17697. order: 7,
  17698. exec: function(a) {
  17699. a.scayt.tabToOpen = "about";
  17700. a.lockSelection();
  17701. a.openDialog(f.dialogName)
  17702. }
  17703. }
  17704. },
  17705. grayt: {
  17706. grayt_problemdescription: {
  17707. label: "Grammar problem description",
  17708. group: "grayt_description",
  17709. order: 1,
  17710. state: CKEDITOR.TRISTATE_DISABLED,
  17711. exec: function(a) {}
  17712. },
  17713. grayt_ignore: {
  17714. label: a.getLocal("btn_ignore"),
  17715. group: "grayt_control",
  17716. order: 2,
  17717. exec: function(a) {
  17718. a.scayt.ignorePhrase()
  17719. }
  17720. }
  17721. }
  17722. }
  17723. },
  17724. buildSuggestionMenuItems: function(a, f, b) {
  17725. var c = {},
  17726. e = {},
  17727. m = b ? "word" : "phrase",
  17728. l = b ? "startGrammarCheck" : "startSpellCheck",
  17729. d = a.scayt;
  17730. if (0 < f.length && "no_any_suggestions" !== f[0])
  17731. if (b)
  17732. for (b = 0; b < f.length; b++) {
  17733. var h = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[b].replace(" ", "_");
  17734. a.addCommand(h, this.createCommand(CKEDITOR.plugins.scayt.suggestions[b], m, l));
  17735. b < a.config.scayt_maxSuggestions ? (a.addMenuItem(h, {
  17736. label: f[b],
  17737. command: h,
  17738. group: "scayt_suggest",
  17739. order: b + 1
  17740. }), c[h] = CKEDITOR.TRISTATE_OFF) : (a.addMenuItem(h, {
  17741. label: f[b],
  17742. command: h,
  17743. group: "scayt_moresuggest",
  17744. order: b + 1
  17745. }), e[h] = CKEDITOR.TRISTATE_OFF, "on" === a.config.scayt_moreSuggestions && (a.addMenuItem("scayt_moresuggest", {
  17746. label: d.getLocal("btn_moreSuggestions"),
  17747. group: "scayt_moresuggest",
  17748. order: 10,
  17749. getItems: function() {
  17750. return e
  17751. }
  17752. }), c.scayt_moresuggest = CKEDITOR.TRISTATE_OFF))
  17753. } else
  17754. for (b = 0; b < f.length; b++) h = "grayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[b].replace(" ", "_"), a.addCommand(h, this.createCommand(CKEDITOR.plugins.scayt.suggestions[b],
  17755. m, l)), a.addMenuItem(h, {
  17756. label: f[b],
  17757. command: h,
  17758. group: "grayt_suggest",
  17759. order: b + 1
  17760. }), c[h] = CKEDITOR.TRISTATE_OFF;
  17761. else c.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED, a.addCommand("no_scayt_suggest", {
  17762. exec: function() {}
  17763. }), a.addMenuItem("no_scayt_suggest", {
  17764. label: d.getLocal("btn_noSuggestions") || "no_scayt_suggest",
  17765. command: "no_scayt_suggest",
  17766. group: "scayt_suggest",
  17767. order: 0
  17768. });
  17769. return c
  17770. },
  17771. menuGenerator: function(a, f) {
  17772. var b = a.scayt,
  17773. c = this.scaytMenuDefinition(a),
  17774. e = {},
  17775. m = a.config.scayt_contextCommands.split("|"),
  17776. l = f.getAttribute(b.getLangAttribute()) ||
  17777. b.getLang(),
  17778. d, h;
  17779. d = b.isScaytNode(f);
  17780. h = b.isGraytNode(f);
  17781. d ? (c = c.scayt, e = f.getAttribute(b.getScaytNodeAttributeName()), b.fire("getSuggestionsList", {
  17782. lang: l,
  17783. word: e
  17784. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, d)) : h && (c = c.grayt, e = f.getAttribute(b.getGraytNodeAttributeName()), h = b.getProblemDescriptionText(e, l), c.grayt_problemdescription && h && (c.grayt_problemdescription.label = h), b.fire("getGrammarSuggestionsList", {
  17785. lang: l,
  17786. phrase: e
  17787. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions,
  17788. d));
  17789. if (d && "off" == a.config.scayt_contextCommands) return e;
  17790. for (var k in c) d && -1 == CKEDITOR.tools.indexOf(m, k.replace("scayt_", "")) && "all" != a.config.scayt_contextCommands || (e[k] = "undefined" != typeof c[k].state ? c[k].state : CKEDITOR.TRISTATE_OFF, "function" !== typeof c[k].verification || c[k].verification(a) || delete e[k], a.addCommand(k, {
  17791. exec: c[k].exec
  17792. }), a.addMenuItem(k, {
  17793. label: a.lang.scayt[c[k].label] || c[k].label,
  17794. command: k,
  17795. group: c[k].group,
  17796. order: c[k].order
  17797. }));
  17798. return e
  17799. },
  17800. createCommand: function(a, f, b) {
  17801. return {
  17802. exec: function(c) {
  17803. c =
  17804. c.scayt;
  17805. var e = {};
  17806. e[f] = a;
  17807. c.replaceSelectionNode(e);
  17808. "startGrammarCheck" === b && c.removeMarkupInSelectionNode({
  17809. grammarOnly: !0
  17810. });
  17811. c.fire(b)
  17812. }
  17813. }
  17814. }
  17815. }), CKEDITOR.plugins.scayt = {
  17816. charsToObserve: [{
  17817. charName: "cke-fillingChar",
  17818. charCode: function() {
  17819. var a = CKEDITOR.version.match(/^\d(\.\d*)*/),
  17820. a = a && a[0],
  17821. f;
  17822. if (a) {
  17823. f = "4.5.7";
  17824. var b, a = a.replace(/\./g, "");
  17825. f = f.replace(/\./g, "");
  17826. b = a.length - f.length;
  17827. b = 0 <= b ? b : 0;
  17828. f = parseInt(a) >= parseInt(f) * Math.pow(10, b)
  17829. }
  17830. return f ? Array(7).join(String.fromCharCode(8203)) : String.fromCharCode(8203)
  17831. }()
  17832. }],
  17833. onLoadTimestamp: "",
  17834. state: {
  17835. scayt: {},
  17836. grayt: {}
  17837. },
  17838. warningCounter: 0,
  17839. suggestions: [],
  17840. options: {
  17841. disablingCommandExec: {
  17842. source: !0,
  17843. newpage: !0,
  17844. templates: !0
  17845. },
  17846. data_attribute_name: "data-scayt-word",
  17847. misspelled_word_class: "scayt-misspell-word",
  17848. problem_grammar_data_attribute: "data-grayt-phrase",
  17849. problem_grammar_class: "gramm-problem"
  17850. },
  17851. backCompatibilityMap: {
  17852. scayt_service_protocol: "scayt_serviceProtocol",
  17853. scayt_service_host: "scayt_serviceHost",
  17854. scayt_service_port: "scayt_servicePort",
  17855. scayt_service_path: "scayt_servicePath",
  17856. scayt_customerid: "scayt_customerId"
  17857. },
  17858. alarmCompatibilityMessage: function() {
  17859. 5 > this.warningCounter && (console.warn("Note: You are using latest version of SCAYT plug-in. It is recommended to upgrade WebSpellChecker.net application to version v4.8.3.Contact us by e-mail at support@webspellchecker.net."), this.warningCounter += 1)
  17860. },
  17861. reloadMarkup: function(a) {
  17862. var f;
  17863. a && (f = a.getScaytLangList(), a.reloadMarkup ? a.reloadMarkup() : (this.alarmCompatibilityMessage(), f && f.ltr && f.rtl && a.fire("startSpellCheck, startGrammarCheck")))
  17864. },
  17865. replaceOldOptionsNames: function(a) {
  17866. for (var f in a) f in this.backCompatibilityMap && (a[this.backCompatibilityMap[f]] = a[f], delete a[f])
  17867. },
  17868. createScayt: function(a) {
  17869. var f = this,
  17870. b = CKEDITOR.plugins.scayt;
  17871. this.loadScaytLibrary(a, function(a) {
  17872. function e(a) {
  17873. return new SCAYT.CKSCAYT(a, function() {}, function() {})
  17874. }
  17875. var m = a.window && a.window.getFrame() || a.editable();
  17876. if (m) {
  17877. m = {
  17878. lang: a.config.scayt_sLang,
  17879. container: m.$,
  17880. customDictionary: a.config.scayt_customDictionaryIds,
  17881. userDictionaryName: a.config.scayt_userDictionaryName,
  17882. localization: a.langCode,
  17883. customer_id: a.config.scayt_customerId,
  17884. debug: a.config.scayt_debug,
  17885. data_attribute_name: f.options.data_attribute_name,
  17886. misspelled_word_class: f.options.misspelled_word_class,
  17887. problem_grammar_data_attribute: f.options.problem_grammar_data_attribute,
  17888. problem_grammar_class: f.options.problem_grammar_class,
  17889. "options-to-restore": a.config.scayt_disableOptionsStorage,
  17890. focused: a.editable().hasFocus,
  17891. ignoreElementsRegex: a.config.scayt_elementsToIgnore,
  17892. minWordLength: a.config.scayt_minWordLength,
  17893. multiLanguageMode: a.config.scayt_multiLanguageMode,
  17894. multiLanguageStyles: a.config.scayt_multiLanguageStyles,
  17895. graytAutoStartup: b.state.grayt[a.name],
  17896. charsToObserve: b.charsToObserve
  17897. };
  17898. a.config.scayt_serviceProtocol && (m.service_protocol = a.config.scayt_serviceProtocol);
  17899. a.config.scayt_serviceHost && (m.service_host = a.config.scayt_serviceHost);
  17900. a.config.scayt_servicePort && (m.service_port = a.config.scayt_servicePort);
  17901. a.config.scayt_servicePath && (m.service_path = a.config.scayt_servicePath);
  17902. "boolean" === typeof a.config.scayt_ignoreAllCapsWords &&
  17903. (m["ignore-all-caps-words"] = a.config.scayt_ignoreAllCapsWords);
  17904. "boolean" === typeof a.config.scayt_ignoreDomainNames && (m["ignore-domain-names"] = a.config.scayt_ignoreDomainNames);
  17905. "boolean" === typeof a.config.scayt_ignoreWordsWithMixedCases && (m["ignore-words-with-mixed-cases"] = a.config.scayt_ignoreWordsWithMixedCases);
  17906. "boolean" === typeof a.config.scayt_ignoreWordsWithNumbers && (m["ignore-words-with-numbers"] = a.config.scayt_ignoreWordsWithNumbers);
  17907. var l;
  17908. try {
  17909. l = e(m)
  17910. } catch (d) {
  17911. f.alarmCompatibilityMessage(), delete m.charsToObserve,
  17912. l = e(m)
  17913. }
  17914. l.subscribe("suggestionListSend", function(a) {
  17915. for (var b = {}, c = [], d = 0; d < a.suggestionList.length; d++) b["word_" + a.suggestionList[d]] || (b["word_" + a.suggestionList[d]] = a.suggestionList[d], c.push(a.suggestionList[d]));
  17916. CKEDITOR.plugins.scayt.suggestions = c
  17917. });
  17918. l.subscribe("selectionIsChanged", function(b) {
  17919. a.getSelection().isLocked && a.lockSelection()
  17920. });
  17921. l.subscribe("graytStateChanged", function(d) {
  17922. b.state.grayt[a.name] = d.state
  17923. });
  17924. l.addMarkupHandler && l.addMarkupHandler(function(b) {
  17925. var d = a.editable(),
  17926. e = d.getCustomData(b.charName);
  17927. e && (e.$ = b.node, d.setCustomData(b.charName, e))
  17928. });
  17929. a.scayt = l;
  17930. a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON)
  17931. } else b.state.scayt[a.name] = !1
  17932. })
  17933. },
  17934. destroy: function(a) {
  17935. a.scayt && a.scayt.destroy();
  17936. delete a.scayt;
  17937. a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF)
  17938. },
  17939. loadScaytLibrary: function(a, f) {
  17940. var b, c = function() {
  17941. CKEDITOR.fireOnce("scaytReady");
  17942. a.scayt || "function" === typeof f && f(a)
  17943. };
  17944. "undefined" === typeof window.SCAYT || "function" !== typeof window.SCAYT.CKSCAYT ? (b = a.config.scayt_srcUrl +
  17945. "?" + this.onLoadTimestamp, CKEDITOR.scriptLoader.load(b, function(a) {
  17946. a && c()
  17947. })) : window.SCAYT && "function" === typeof window.SCAYT.CKSCAYT && c()
  17948. }
  17949. }, CKEDITOR.on("dialogDefinition", function(a) {
  17950. var f = a.data.name;
  17951. a = a.data.definition.dialog;
  17952. if ("scaytDialog" === f) a.on("cancel", function(a) {
  17953. return !1
  17954. }, this, null, -1);
  17955. if ("checkspell" === f) a.on("cancel", function(a) {
  17956. a = a.sender && a.sender.getParentEditor();
  17957. var c = CKEDITOR.plugins.scayt,
  17958. e = a.scayt;
  17959. e && c.state.scayt[a.name] && e.setMarkupPaused && e.setMarkupPaused(!1);
  17960. a.unlockSelection()
  17961. },
  17962. this, null, -2);
  17963. if ("link" === f) a.on("ok", function(a) {
  17964. var c = a.sender && a.sender.getParentEditor();
  17965. c && setTimeout(function() {
  17966. c.fire("reloadMarkupScayt", {
  17967. removeOptions: {
  17968. removeInside: !0,
  17969. forceBookmark: !0
  17970. },
  17971. timeout: 0
  17972. })
  17973. }, 0)
  17974. })
  17975. }), CKEDITOR.on("scaytReady", function() {
  17976. if (!0 === CKEDITOR.config.scayt_handleCheckDirty) {
  17977. var a = CKEDITOR.editor.prototype;
  17978. a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function(a) {
  17979. return function() {
  17980. var c = null,
  17981. e = this.scayt;
  17982. if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] &&
  17983. this.scayt) {
  17984. if (c = "ready" == this.status) var f = e.removeMarkupFromString(this.getSnapshot()),
  17985. e = e.removeMarkupFromString(this._.previousValue),
  17986. c = c && e !== f
  17987. } else c = a.call(this);
  17988. return c
  17989. }
  17990. });
  17991. a.resetDirty = CKEDITOR.tools.override(a.resetDirty, function(a) {
  17992. return function() {
  17993. var c = this.scayt;
  17994. CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt ? this._.previousValue = c.removeMarkupFromString(this.getSnapshot()) : a.call(this)
  17995. }
  17996. })
  17997. }
  17998. if (!0 === CKEDITOR.config.scayt_handleUndoRedo) {
  17999. var a = CKEDITOR.plugins.undo.Image.prototype,
  18000. f = "function" == typeof a.equalsContent ? "equalsContent" : "equals";
  18001. a[f] = CKEDITOR.tools.override(a[f], function(a) {
  18002. return function(c) {
  18003. var e = c.editor.scayt,
  18004. f = this.contents,
  18005. l = c.contents,
  18006. d = null;
  18007. CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[c.editor.name] && c.editor.scayt && (this.contents = e.removeMarkupFromString(f) || "", c.contents = e.removeMarkupFromString(l) || "");
  18008. d = a.apply(this, arguments);
  18009. this.contents = f;
  18010. c.contents = l;
  18011. return d
  18012. }
  18013. })
  18014. }
  18015. }),
  18016. function() {
  18017. var a = {
  18018. preserveState: !0,
  18019. editorFocus: !1,
  18020. readOnly: 1,
  18021. exec: function(a) {
  18022. this.toggleState();
  18023. this.refresh(a)
  18024. },
  18025. refresh: function(a) {
  18026. if (a.document) {
  18027. var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass";
  18028. a.editable()[b]("cke_show_borders")
  18029. }
  18030. }
  18031. };
  18032. CKEDITOR.plugins.add("showborders", {
  18033. modes: {
  18034. wysiwyg: 1
  18035. },
  18036. onLoad: function() {
  18037. var a;
  18038. a = (CKEDITOR.env.ie6Compat ? [".%1 table.%2,", ".%1 table.%2 td, .%1 table.%2 th", "{", "border : #d3d3d3 1px dotted", "}"] : ".%1 table.%2,;.%1 table.%2 \x3e tr \x3e td, .%1 table.%2 \x3e tr \x3e th,;.%1 table.%2 \x3e tbody \x3e tr \x3e td, .%1 table.%2 \x3e tbody \x3e tr \x3e th,;.%1 table.%2 \x3e thead \x3e tr \x3e td, .%1 table.%2 \x3e thead \x3e tr \x3e th,;.%1 table.%2 \x3e tfoot \x3e tr \x3e td, .%1 table.%2 \x3e tfoot \x3e tr \x3e th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g,
  18039. "cke_show_border").replace(/%1/g, "cke_show_borders ");
  18040. CKEDITOR.addCss(a)
  18041. },
  18042. init: function(f) {
  18043. var b = f.addCommand("showborders", a);
  18044. b.canUndo = !1;
  18045. !1 !== f.config.startupShowBorders && b.setState(CKEDITOR.TRISTATE_ON);
  18046. f.on("mode", function() {
  18047. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(f)
  18048. }, null, null, 100);
  18049. f.on("contentDom", function() {
  18050. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(f)
  18051. });
  18052. f.on("removeFormatCleanup", function(a) {
  18053. a = a.data;
  18054. f.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && a.is("table") && (!a.hasAttribute("border") ||
  18055. 0 >= parseInt(a.getAttribute("border"), 10)) && a.addClass("cke_show_border")
  18056. })
  18057. },
  18058. afterInit: function(a) {
  18059. var b = a.dataProcessor;
  18060. a = b && b.dataFilter;
  18061. b = b && b.htmlFilter;
  18062. a && a.addRules({
  18063. elements: {
  18064. table: function(a) {
  18065. a = a.attributes;
  18066. var b = a["class"],
  18067. f = parseInt(a.border, 10);
  18068. f && !(0 >= f) || b && -1 != b.indexOf("cke_show_border") || (a["class"] = (b || "") + " cke_show_border")
  18069. }
  18070. }
  18071. });
  18072. b && b.addRules({
  18073. elements: {
  18074. table: function(a) {
  18075. a = a.attributes;
  18076. var b = a["class"];
  18077. b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(/^\s+|\s+$/,
  18078. ""))
  18079. }
  18080. }
  18081. })
  18082. }
  18083. });
  18084. CKEDITOR.on("dialogDefinition", function(a) {
  18085. var b = a.data.name;
  18086. if ("table" == b || "tableProperties" == b)
  18087. if (a = a.data.definition, b = a.getContents("info").get("txtBorder"), b.commit = CKEDITOR.tools.override(b.commit, function(a) {
  18088. return function(b, f) {
  18089. a.apply(this, arguments);
  18090. var l = parseInt(this.getValue(), 10);
  18091. f[!l || 0 >= l ? "addClass" : "removeClass"]("cke_show_border")
  18092. }
  18093. }), a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) a.setup = CKEDITOR.tools.override(a.setup, function(a) {
  18094. return function() {
  18095. a.apply(this,
  18096. arguments);
  18097. this.setValue(this.getValue().replace(/cke_show_border/, ""))
  18098. }
  18099. }), a.commit = CKEDITOR.tools.override(a.commit, function(a) {
  18100. return function(b, f) {
  18101. a.apply(this, arguments);
  18102. parseInt(f.getAttribute("border"), 10) || f.addClass("cke_show_border")
  18103. }
  18104. })
  18105. })
  18106. }(),
  18107. function() {
  18108. CKEDITOR.plugins.add("sourcearea", {
  18109. init: function(f) {
  18110. function b() {
  18111. var a = e && this.equals(CKEDITOR.document.getActive());
  18112. this.hide();
  18113. this.setStyle("height", this.getParent().$.clientHeight + "px");
  18114. this.setStyle("width", this.getParent().$.clientWidth +
  18115. "px");
  18116. this.show();
  18117. a && this.focus()
  18118. }
  18119. if (f.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  18120. var c = CKEDITOR.plugins.sourcearea;
  18121. f.addMode("source", function(c) {
  18122. var e = f.ui.space("contents").getDocument().createElement("textarea");
  18123. e.setStyles(CKEDITOR.tools.extend({
  18124. width: CKEDITOR.env.ie7Compat ? "99%" : "100%",
  18125. height: "100%",
  18126. resize: "none",
  18127. outline: "none",
  18128. "text-align": "left"
  18129. }, CKEDITOR.tools.cssVendorPrefix("tab-size", f.config.sourceAreaTabSize || 4)));
  18130. e.setAttribute("dir", "ltr");
  18131. e.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");
  18132. f.ui.space("contents").append(e);
  18133. e = f.editable(new a(f, e));
  18134. e.setData(f.getData(1));
  18135. CKEDITOR.env.ie && (e.attachListener(f, "resize", b, e), e.attachListener(CKEDITOR.document.getWindow(), "resize", b, e), CKEDITOR.tools.setTimeout(b, 0, e));
  18136. f.fire("ariaWidget", this);
  18137. c()
  18138. });
  18139. f.addCommand("source", c.commands.source);
  18140. f.ui.addButton && f.ui.addButton("Source", {
  18141. label: f.lang.sourcearea.toolbar,
  18142. command: "source",
  18143. toolbar: "mode,10"
  18144. });
  18145. f.on("mode", function() {
  18146. f.getCommand("source").setState("source" == f.mode ? CKEDITOR.TRISTATE_ON :
  18147. CKEDITOR.TRISTATE_OFF)
  18148. });
  18149. var e = CKEDITOR.env.ie && 9 == CKEDITOR.env.version
  18150. }
  18151. }
  18152. });
  18153. var a = CKEDITOR.tools.createClass({
  18154. base: CKEDITOR.editable,
  18155. proto: {
  18156. setData: function(a) {
  18157. this.setValue(a);
  18158. this.status = "ready";
  18159. this.editor.fire("dataReady")
  18160. },
  18161. getData: function() {
  18162. return this.getValue()
  18163. },
  18164. insertHtml: function() {},
  18165. insertElement: function() {},
  18166. insertText: function() {},
  18167. setReadOnly: function(a) {
  18168. this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly")
  18169. },
  18170. detach: function() {
  18171. a.baseProto.detach.call(this);
  18172. this.clearCustomData();
  18173. this.remove()
  18174. }
  18175. }
  18176. })
  18177. }(), CKEDITOR.plugins.sourcearea = {
  18178. commands: {
  18179. source: {
  18180. modes: {
  18181. wysiwyg: 1,
  18182. source: 1
  18183. },
  18184. editorFocus: !1,
  18185. readOnly: 1,
  18186. exec: function(a) {
  18187. "wysiwyg" == a.mode && a.fire("saveSnapshot");
  18188. a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
  18189. a.setMode("source" == a.mode ? "wysiwyg" : "source")
  18190. },
  18191. canUndo: !1
  18192. }
  18193. }
  18194. }, CKEDITOR.plugins.add("specialchar", {
  18195. availableLangs: {
  18196. af: 1,
  18197. ar: 1,
  18198. bg: 1,
  18199. ca: 1,
  18200. cs: 1,
  18201. cy: 1,
  18202. da: 1,
  18203. de: 1,
  18204. "de-ch": 1,
  18205. el: 1,
  18206. en: 1,
  18207. "en-gb": 1,
  18208. eo: 1,
  18209. es: 1,
  18210. et: 1,
  18211. eu: 1,
  18212. fa: 1,
  18213. fi: 1,
  18214. fr: 1,
  18215. "fr-ca": 1,
  18216. gl: 1,
  18217. he: 1,
  18218. hr: 1,
  18219. hu: 1,
  18220. id: 1,
  18221. it: 1,
  18222. ja: 1,
  18223. km: 1,
  18224. ko: 1,
  18225. ku: 1,
  18226. lt: 1,
  18227. lv: 1,
  18228. nb: 1,
  18229. nl: 1,
  18230. no: 1,
  18231. oc: 1,
  18232. pl: 1,
  18233. pt: 1,
  18234. "pt-br": 1,
  18235. ru: 1,
  18236. si: 1,
  18237. sk: 1,
  18238. sl: 1,
  18239. sq: 1,
  18240. sv: 1,
  18241. th: 1,
  18242. tr: 1,
  18243. tt: 1,
  18244. ug: 1,
  18245. uk: 1,
  18246. vi: 1,
  18247. zh: 1,
  18248. "zh-cn": 1
  18249. },
  18250. requires: "dialog",
  18251. init: function(a) {
  18252. var f = this;
  18253. CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js");
  18254. a.addCommand("specialchar", {
  18255. exec: function() {
  18256. var b = a.langCode,
  18257. b = f.availableLangs[b] ? b : f.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  18258. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f.path + "dialogs/lang/" + b + ".js"), function() {
  18259. CKEDITOR.tools.extend(a.lang.specialchar,
  18260. f.langEntries[b]);
  18261. a.openDialog("specialchar")
  18262. })
  18263. },
  18264. modes: {
  18265. wysiwyg: 1
  18266. },
  18267. canUndo: !1
  18268. });
  18269. a.ui.addButton && a.ui.addButton("SpecialChar", {
  18270. label: a.lang.specialchar.toolbar,
  18271. command: "specialchar",
  18272. toolbar: "insert,50"
  18273. })
  18274. }
  18275. }), CKEDITOR.config.specialChars = "! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" "),
  18276. function() {
  18277. CKEDITOR.plugins.add("stylescombo", {
  18278. requires: "richcombo",
  18279. init: function(a) {
  18280. var f = a.config,
  18281. b = a.lang.stylescombo,
  18282. c = {},
  18283. e = [],
  18284. m = [];
  18285. a.on("stylesSet", function(b) {
  18286. if (b = b.data.styles) {
  18287. for (var d, h, k, g = 0, n = b.length; g < n; g++)(d = b[g], a.blockless && d.element in CKEDITOR.dtd.$block || "string" == typeof d.type && !CKEDITOR.style.customHandlers[d.type] || (h = d.name, d = new CKEDITOR.style(d), a.filter.customConfig && !a.filter.check(d))) || (d._name = h, d._.enterMode = f.enterMode, d._.type = k = d.assignedTo || d.type, d._.weight =
  18288. g + 1E3 * (k == CKEDITOR.STYLE_OBJECT ? 1 : k == CKEDITOR.STYLE_BLOCK ? 2 : 3), c[h] = d, e.push(d), m.push(d));
  18289. e.sort(function(a, b) {
  18290. return a._.weight - b._.weight
  18291. })
  18292. }
  18293. });
  18294. a.ui.addRichCombo("Styles", {
  18295. label: b.label,
  18296. title: b.panelTitle,
  18297. toolbar: "styles,10",
  18298. allowedContent: m,
  18299. panel: {
  18300. css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
  18301. multiSelect: !0,
  18302. attributes: {
  18303. "aria-label": b.panelTitle
  18304. }
  18305. },
  18306. init: function() {
  18307. var a, c, f, k, g, m;
  18308. g = 0;
  18309. for (m = e.length; g < m; g++) a = e[g], c = a._name, k = a._.type, k != f && (this.startGroup(b["panelTitle" + String(k)]),
  18310. f = k), this.add(c, a.type == CKEDITOR.STYLE_OBJECT ? c : a.buildPreview(), c);
  18311. this.commit()
  18312. },
  18313. onClick: function(b) {
  18314. a.focus();
  18315. a.fire("saveSnapshot");
  18316. b = c[b];
  18317. var d = a.elementPath();
  18318. a[b.checkActive(d, a) ? "removeStyle" : "applyStyle"](b);
  18319. a.fire("saveSnapshot")
  18320. },
  18321. onRender: function() {
  18322. a.on("selectionChange", function(b) {
  18323. var d = this.getValue();
  18324. b = b.data.path.elements;
  18325. for (var e = 0, f = b.length, g; e < f; e++) {
  18326. g = b[e];
  18327. for (var m in c)
  18328. if (c[m].checkElementRemovable(g, !0, a)) {
  18329. m != d && this.setValue(m);
  18330. return
  18331. }
  18332. }
  18333. this.setValue("")
  18334. }, this)
  18335. },
  18336. onOpen: function() {
  18337. var e =
  18338. a.getSelection().getSelectedElement(),
  18339. e = a.elementPath(e),
  18340. d = [0, 0, 0, 0];
  18341. this.showAll();
  18342. this.unmarkAll();
  18343. for (var f in c) {
  18344. var k = c[f],
  18345. g = k._.type;
  18346. k.checkApplicable(e, a, a.activeFilter) ? d[g]++ : this.hideItem(f);
  18347. k.checkActive(e, a) && this.mark(f)
  18348. }
  18349. d[CKEDITOR.STYLE_BLOCK] || this.hideGroup(b["panelTitle" + String(CKEDITOR.STYLE_BLOCK)]);
  18350. d[CKEDITOR.STYLE_INLINE] || this.hideGroup(b["panelTitle" + String(CKEDITOR.STYLE_INLINE)]);
  18351. d[CKEDITOR.STYLE_OBJECT] || this.hideGroup(b["panelTitle" + String(CKEDITOR.STYLE_OBJECT)])
  18352. },
  18353. refresh: function() {
  18354. var b =
  18355. a.elementPath();
  18356. if (b) {
  18357. for (var d in c)
  18358. if (c[d].checkApplicable(b, a, a.activeFilter)) return;
  18359. this.setState(CKEDITOR.TRISTATE_DISABLED)
  18360. }
  18361. },
  18362. reset: function() {
  18363. c = {};
  18364. e = []
  18365. }
  18366. })
  18367. }
  18368. })
  18369. }(),
  18370. function() {
  18371. function a(a) {
  18372. return {
  18373. editorFocus: !1,
  18374. canUndo: !1,
  18375. modes: {
  18376. wysiwyg: 1
  18377. },
  18378. exec: function(b) {
  18379. if (b.editable().hasFocus) {
  18380. var c = b.getSelection(),
  18381. d;
  18382. if (d = (new CKEDITOR.dom.elementPath(c.getCommonAncestor(), c.root)).contains({
  18383. td: 1,
  18384. th: 1
  18385. }, 1)) {
  18386. var c = b.createRange(),
  18387. f = CKEDITOR.tools.tryThese(function() {
  18388. var b = d.getParent().$.cells[d.$.cellIndex +
  18389. (a ? -1 : 1)];
  18390. b.parentNode.parentNode;
  18391. return b
  18392. }, function() {
  18393. var b = d.getParent(),
  18394. b = b.getAscendant("table").$.rows[b.$.rowIndex + (a ? -1 : 1)];
  18395. return b.cells[a ? b.cells.length - 1 : 0]
  18396. });
  18397. if (f || a)
  18398. if (f) f = new CKEDITOR.dom.element(f), c.moveToElementEditStart(f), c.checkStartOfBlock() && c.checkEndOfBlock() || c.selectNodeContents(f);
  18399. else return !0;
  18400. else {
  18401. for (var k = d.getAscendant("table").$, f = d.getParent().$.cells, k = new CKEDITOR.dom.element(k.insertRow(-1), b.document), g = 0, n = f.length; g < n; g++) k.append((new CKEDITOR.dom.element(f[g],
  18402. b.document)).clone(!1, !1)).appendBogus();
  18403. c.moveToElementEditStart(k)
  18404. }
  18405. c.select(!0);
  18406. return !0
  18407. }
  18408. }
  18409. return !1
  18410. }
  18411. }
  18412. }
  18413. var f = {
  18414. editorFocus: !1,
  18415. modes: {
  18416. wysiwyg: 1,
  18417. source: 1
  18418. }
  18419. },
  18420. b = {
  18421. exec: function(a) {
  18422. a.container.focusNext(!0, a.tabIndex)
  18423. }
  18424. },
  18425. c = {
  18426. exec: function(a) {
  18427. a.container.focusPrevious(!0, a.tabIndex)
  18428. }
  18429. };
  18430. CKEDITOR.plugins.add("tab", {
  18431. init: function(e) {
  18432. for (var m = !1 !== e.config.enableTabKeyTools, l = e.config.tabSpaces || 0, d = ""; l--;) d += " ";
  18433. if (d) e.on("key", function(a) {
  18434. 9 == a.data.keyCode && (e.insertText(d), a.cancel())
  18435. });
  18436. if (m) e.on("key", function(a) {
  18437. (9 ==
  18438. a.data.keyCode && e.execCommand("selectNextCell") || a.data.keyCode == CKEDITOR.SHIFT + 9 && e.execCommand("selectPreviousCell")) && a.cancel()
  18439. });
  18440. e.addCommand("blur", CKEDITOR.tools.extend(b, f));
  18441. e.addCommand("blurBack", CKEDITOR.tools.extend(c, f));
  18442. e.addCommand("selectNextCell", a());
  18443. e.addCommand("selectPreviousCell", a(!0))
  18444. }
  18445. })
  18446. }(), CKEDITOR.dom.element.prototype.focusNext = function(a, f) {
  18447. var b = void 0 === f ? this.getTabIndex() : f,
  18448. c, e, m, l, d, h;
  18449. if (0 >= b)
  18450. for (d = this.getNextSourceNode(a, CKEDITOR.NODE_ELEMENT); d;) {
  18451. if (d.isVisible() &&
  18452. 0 === d.getTabIndex()) {
  18453. m = d;
  18454. break
  18455. }
  18456. d = d.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT)
  18457. } else
  18458. for (d = this.getDocument().getBody().getFirst(); d = d.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  18459. if (!c)
  18460. if (!e && d.equals(this)) {
  18461. if (e = !0, a) {
  18462. if (!(d = d.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  18463. c = 1
  18464. }
  18465. } else e && !this.contains(d) && (c = 1);
  18466. if (d.isVisible() && !(0 > (h = d.getTabIndex()))) {
  18467. if (c && h == b) {
  18468. m = d;
  18469. break
  18470. }
  18471. h > b && (!m || !l || h < l) ? (m = d, l = h) : m || 0 !== h || (m = d, l = h)
  18472. }
  18473. }
  18474. m && m.focus()
  18475. }, CKEDITOR.dom.element.prototype.focusPrevious = function(a,
  18476. f) {
  18477. for (var b = void 0 === f ? this.getTabIndex() : f, c, e, m, l = 0, d, h = this.getDocument().getBody().getLast(); h = h.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  18478. if (!c)
  18479. if (!e && h.equals(this)) {
  18480. if (e = !0, a) {
  18481. if (!(h = h.getPreviousSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  18482. c = 1
  18483. }
  18484. } else e && !this.contains(h) && (c = 1);
  18485. if (h.isVisible() && !(0 > (d = h.getTabIndex())))
  18486. if (0 >= b) {
  18487. if (c && 0 === d) {
  18488. m = h;
  18489. break
  18490. }
  18491. d > l && (m = h, l = d)
  18492. } else {
  18493. if (c && d == b) {
  18494. m = h;
  18495. break
  18496. }
  18497. d < b && (!m || d > l) && (m = h, l = d)
  18498. }
  18499. }
  18500. m && m.focus()
  18501. }, CKEDITOR.plugins.add("table", {
  18502. requires: "dialog",
  18503. init: function(a) {
  18504. function f(a) {
  18505. return CKEDITOR.tools.extend(a || {}, {
  18506. contextSensitive: 1,
  18507. refresh: function(a, b) {
  18508. this.setState(b.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  18509. }
  18510. })
  18511. }
  18512. if (!a.blockless) {
  18513. var b = a.lang.table;
  18514. a.addCommand("table", new CKEDITOR.dialogCommand("table", {
  18515. context: "table",
  18516. 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() : ""),
  18517. requiredContent: "table",
  18518. contentTransformations: [
  18519. ["table{width}: sizeToStyle",
  18520. "table[width]: sizeToAttribute"
  18521. ],
  18522. ["td: splitBorderShorthand"],
  18523. [{
  18524. element: "table",
  18525. right: function(a) {
  18526. a.styles && (a.styles.border && a.styles.border.match(/solid/) && (a.attributes.border = 1), "collapse" == a.styles["border-collapse"] && (a.attributes.cellspacing = 0))
  18527. }
  18528. }]
  18529. ]
  18530. }));
  18531. a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", f()));
  18532. a.addCommand("tableDelete", f({
  18533. exec: function(a) {
  18534. var b = a.elementPath().contains("table", 1);
  18535. if (b) {
  18536. var f = b.getParent(),
  18537. l = a.editable();
  18538. 1 != f.getChildCount() || f.is("td",
  18539. "th") || f.equals(l) || (b = f);
  18540. a = a.createRange();
  18541. a.moveToPosition(b, CKEDITOR.POSITION_BEFORE_START);
  18542. b.remove();
  18543. a.select()
  18544. }
  18545. }
  18546. }));
  18547. a.ui.addButton && a.ui.addButton("Table", {
  18548. label: b.toolbar,
  18549. command: "table",
  18550. toolbar: "insert,30"
  18551. });
  18552. CKEDITOR.dialog.add("table", this.path + "dialogs/table.js");
  18553. CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js");
  18554. a.addMenuItems && a.addMenuItems({
  18555. table: {
  18556. label: b.menu,
  18557. command: "tableProperties",
  18558. group: "table",
  18559. order: 5
  18560. },
  18561. tabledelete: {
  18562. label: b.deleteTable,
  18563. command: "tableDelete",
  18564. group: "table",
  18565. order: 1
  18566. }
  18567. });
  18568. a.on("doubleclick", function(a) {
  18569. a.data.element.is("table") && (a.data.dialog = "tableProperties")
  18570. });
  18571. a.contextMenu && a.contextMenu.addListener(function() {
  18572. return {
  18573. tabledelete: CKEDITOR.TRISTATE_OFF,
  18574. table: CKEDITOR.TRISTATE_OFF
  18575. }
  18576. })
  18577. }
  18578. }
  18579. }),
  18580. function() {
  18581. function a(a) {
  18582. function b(a) {
  18583. 0 < c.length || a.type != CKEDITOR.NODE_ELEMENT || !w.test(a.getName()) || a.getCustomData("selected_cell") || (CKEDITOR.dom.element.setMarker(d, a, "selected_cell", !0), c.push(a))
  18584. }
  18585. a = a.getRanges();
  18586. for (var c = [], d = {}, e = 0; e < a.length; e++) {
  18587. var f = a[e];
  18588. if (f.collapsed) f = f.getCommonAncestor(), (f = f.getAscendant("td", !0) || f.getAscendant("th", !0)) && c.push(f);
  18589. else {
  18590. var f = new CKEDITOR.dom.walker(f),
  18591. g;
  18592. for (f.guard = b; g = f.next();) g.type == CKEDITOR.NODE_ELEMENT && g.is(CKEDITOR.dtd.table) || (g = g.getAscendant("td", !0) || g.getAscendant("th", !0)) && !g.getCustomData("selected_cell") && (CKEDITOR.dom.element.setMarker(d, g, "selected_cell", !0), c.push(g))
  18593. }
  18594. }
  18595. CKEDITOR.dom.element.clearAllMarkers(d);
  18596. return c
  18597. }
  18598. function f(b, c) {
  18599. for (var d = a(b), e = d[0], f = e.getAscendant("table"), e = e.getDocument(),
  18600. g = d[0].getParent(), h = g.$.rowIndex, d = d[d.length - 1], k = d.getParent().$.rowIndex + d.$.rowSpan - 1, d = new CKEDITOR.dom.element(f.$.rows[k]), h = c ? h : k, g = c ? g : d, d = CKEDITOR.tools.buildTableMap(f), f = d[h], h = c ? d[h - 1] : d[h + 1], d = d[0].length, e = e.createElement("tr"), k = 0; f[k] && k < d; k++) {
  18601. var l;
  18602. 1 < f[k].rowSpan && h && f[k] == h[k] ? (l = f[k], l.rowSpan += 1) : (l = (new CKEDITOR.dom.element(f[k])).clone(), l.removeAttribute("rowSpan"), l.appendBogus(), e.append(l), l = l.$);
  18603. k += l.colSpan - 1
  18604. }
  18605. c ? e.insertBefore(g) : e.insertAfter(g)
  18606. }
  18607. function b(c) {
  18608. if (c instanceof CKEDITOR.dom.selection) {
  18609. var d = a(c),
  18610. e = d[0].getAscendant("table"),
  18611. f = CKEDITOR.tools.buildTableMap(e);
  18612. c = d[0].getParent().$.rowIndex;
  18613. for (var d = d[d.length - 1], g = d.getParent().$.rowIndex + d.$.rowSpan - 1, d = [], h = c; h <= g; h++) {
  18614. for (var k = f[h], l = new CKEDITOR.dom.element(e.$.rows[h]), m = 0; m < k.length; m++) {
  18615. var n = new CKEDITOR.dom.element(k[m]),
  18616. w = n.getParent().$.rowIndex;
  18617. 1 == n.$.rowSpan ? n.remove() : (--n.$.rowSpan, w == h && (w = f[h + 1], w[m - 1] ? n.insertAfter(new CKEDITOR.dom.element(w[m - 1])) : (new CKEDITOR.dom.element(e.$.rows[h + 1])).append(n,
  18618. 1)));
  18619. m += n.$.colSpan - 1
  18620. }
  18621. d.push(l)
  18622. }
  18623. f = e.$.rows;
  18624. e = new CKEDITOR.dom.element(f[g + 1] || (0 < c ? f[c - 1] : null) || e.$.parentNode);
  18625. for (h = d.length; 0 <= h; h--) b(d[h]);
  18626. return e
  18627. }
  18628. c instanceof CKEDITOR.dom.element && (e = c.getAscendant("table"), 1 == e.$.rows.length ? e.remove() : c.remove());
  18629. return null
  18630. }
  18631. function c(a, b) {
  18632. for (var c = b ? Infinity : 0, d = 0; d < a.length; d++) {
  18633. var e;
  18634. e = a[d];
  18635. for (var f = b, g = e.getParent().$.cells, h = 0, k = 0; k < g.length; k++) {
  18636. var l = g[k],
  18637. h = h + (f ? 1 : l.colSpan);
  18638. if (l == e.$) break
  18639. }
  18640. e = h - 1;
  18641. if (b ? e < c : e > c) c = e
  18642. }
  18643. return c
  18644. }
  18645. function e(b, d) {
  18646. for (var e =
  18647. a(b), f = e[0].getAscendant("table"), g = c(e, 1), e = c(e), g = d ? g : e, h = CKEDITOR.tools.buildTableMap(f), f = [], e = [], k = h.length, l = 0; l < k; l++) f.push(h[l][g]), e.push(d ? h[l][g - 1] : h[l][g + 1]);
  18648. for (l = 0; l < k; l++) f[l] && (1 < f[l].colSpan && e[l] == f[l] ? (g = f[l], g.colSpan += 1) : (g = (new CKEDITOR.dom.element(f[l])).clone(), g.removeAttribute("colSpan"), g.appendBogus(), g[d ? "insertBefore" : "insertAfter"].call(g, new CKEDITOR.dom.element(f[l])), g = g.$), l += g.rowSpan - 1)
  18649. }
  18650. function m(a, b) {
  18651. var c = a.getStartElement();
  18652. if (c = c.getAscendant("td", 1) || c.getAscendant("th",
  18653. 1)) {
  18654. var d = c.clone();
  18655. d.appendBogus();
  18656. b ? d.insertBefore(c) : d.insertAfter(c)
  18657. }
  18658. }
  18659. function l(b) {
  18660. if (b instanceof CKEDITOR.dom.selection) {
  18661. b = a(b);
  18662. var c = b[0] && b[0].getAscendant("table"),
  18663. e;
  18664. a: {
  18665. var f = 0;
  18666. e = b.length - 1;
  18667. for (var g = {}, h, k; h = b[f++];) CKEDITOR.dom.element.setMarker(g, h, "delete_cell", !0);
  18668. for (f = 0; h = b[f++];)
  18669. if ((k = h.getPrevious()) && !k.getCustomData("delete_cell") || (k = h.getNext()) && !k.getCustomData("delete_cell")) {
  18670. CKEDITOR.dom.element.clearAllMarkers(g);
  18671. e = k;
  18672. break a
  18673. }
  18674. CKEDITOR.dom.element.clearAllMarkers(g);
  18675. k = b[0].getParent();
  18676. (k = k.getPrevious()) ? e = k.getLast(): (k = b[e].getParent(), e = (k = k.getNext()) ? k.getChild(0) : null)
  18677. }
  18678. for (k = b.length - 1; 0 <= k; k--) l(b[k]);
  18679. e ? d(e, !0) : c && c.remove()
  18680. } else b instanceof CKEDITOR.dom.element && (c = b.getParent(), 1 == c.getChildCount() ? c.remove() : b.remove())
  18681. }
  18682. function d(a, b) {
  18683. var c = a.getDocument(),
  18684. d = CKEDITOR.document;
  18685. CKEDITOR.env.ie && 10 == CKEDITOR.env.version && (d.focus(), c.focus());
  18686. c = new CKEDITOR.dom.range(c);
  18687. c["moveToElementEdit" + (b ? "End" : "Start")](a) || (c.selectNodeContents(a), c.collapse(b ? !1 : !0));
  18688. c.select(!0)
  18689. }
  18690. function h(a, b, c) {
  18691. a = a[b];
  18692. if ("undefined" == typeof c) return a;
  18693. for (b = 0; a && b < a.length; b++) {
  18694. if (c.is && a[b] == c.$) return b;
  18695. if (b == c) return new CKEDITOR.dom.element(a[b])
  18696. }
  18697. return c.is ? -1 : null
  18698. }
  18699. function k(b, c, d) {
  18700. var e = a(b),
  18701. f;
  18702. if ((c ? 1 != e.length : 2 > e.length) || (f = b.getCommonAncestor()) && f.type == CKEDITOR.NODE_ELEMENT && f.is("table")) return !1;
  18703. var g;
  18704. b = e[0];
  18705. f = b.getAscendant("table");
  18706. var k = CKEDITOR.tools.buildTableMap(f),
  18707. l = k.length,
  18708. m = k[0].length,
  18709. n = b.getParent().$.rowIndex,
  18710. w = h(k, n, b);
  18711. if (c) {
  18712. var A;
  18713. try {
  18714. var C = parseInt(b.getAttribute("rowspan"),
  18715. 10) || 1;
  18716. g = parseInt(b.getAttribute("colspan"), 10) || 1;
  18717. A = k["up" == c ? n - C : "down" == c ? n + C : n]["left" == c ? w - g : "right" == c ? w + g : w]
  18718. } catch (F) {
  18719. return !1
  18720. }
  18721. if (!A || b.$ == A) return !1;
  18722. e["up" == c || "left" == c ? "unshift" : "push"](new CKEDITOR.dom.element(A))
  18723. }
  18724. c = b.getDocument();
  18725. var G = n,
  18726. C = A = 0,
  18727. I = !d && new CKEDITOR.dom.documentFragment(c),
  18728. H = 0;
  18729. for (c = 0; c < e.length; c++) {
  18730. g = e[c];
  18731. var K = g.getParent(),
  18732. J = g.getFirst(),
  18733. E = g.$.colSpan,
  18734. S = g.$.rowSpan,
  18735. K = K.$.rowIndex,
  18736. O = h(k, K, g),
  18737. H = H + E * S,
  18738. C = Math.max(C, O - w + E);
  18739. A = Math.max(A, K - n + S);
  18740. d || (E = g, (S = E.getBogus()) && S.remove(),
  18741. E.trim(), g.getChildren().count() && (K == G || !J || J.isBlockBoundary && J.isBlockBoundary({
  18742. br: 1
  18743. }) || (G = I.getLast(CKEDITOR.dom.walker.whitespaces(!0)), !G || G.is && G.is("br") || I.append("br")), g.moveChildren(I)), c ? g.remove() : g.setHtml(""));
  18744. G = K
  18745. }
  18746. if (d) return A * C == H;
  18747. I.moveChildren(b);
  18748. b.appendBogus();
  18749. C >= m ? b.removeAttribute("rowSpan") : b.$.rowSpan = A;
  18750. A >= l ? b.removeAttribute("colSpan") : b.$.colSpan = C;
  18751. d = new CKEDITOR.dom.nodeList(f.$.rows);
  18752. e = d.count();
  18753. for (c = e - 1; 0 <= c; c--) f = d.getItem(c), f.$.cells.length || (f.remove(), e++);
  18754. return b
  18755. }
  18756. function g(b, c) {
  18757. var d = a(b);
  18758. if (1 < d.length) return !1;
  18759. if (c) return !0;
  18760. var d = d[0],
  18761. e = d.getParent(),
  18762. f = e.getAscendant("table"),
  18763. g = CKEDITOR.tools.buildTableMap(f),
  18764. k = e.$.rowIndex,
  18765. l = h(g, k, d),
  18766. m = d.$.rowSpan,
  18767. n;
  18768. if (1 < m) {
  18769. n = Math.ceil(m / 2);
  18770. for (var m = Math.floor(m / 2), e = k + n, f = new CKEDITOR.dom.element(f.$.rows[e]), g = h(g, e), w, e = d.clone(), k = 0; k < g.length; k++)
  18771. if (w = g[k], w.parentNode == f.$ && k > l) {
  18772. e.insertBefore(new CKEDITOR.dom.element(w));
  18773. break
  18774. } else w = null;
  18775. w || f.append(e)
  18776. } else
  18777. for (m = n = 1, f = e.clone(), f.insertAfter(e), f.append(e = d.clone()),
  18778. w = h(g, k), l = 0; l < w.length; l++) w[l].rowSpan++;
  18779. e.appendBogus();
  18780. d.$.rowSpan = n;
  18781. e.$.rowSpan = m;
  18782. 1 == n && d.removeAttribute("rowSpan");
  18783. 1 == m && e.removeAttribute("rowSpan");
  18784. return e
  18785. }
  18786. function n(b, c) {
  18787. var d = a(b);
  18788. if (1 < d.length) return !1;
  18789. if (c) return !0;
  18790. var d = d[0],
  18791. e = d.getParent(),
  18792. f = e.getAscendant("table"),
  18793. f = CKEDITOR.tools.buildTableMap(f),
  18794. g = h(f, e.$.rowIndex, d),
  18795. k = d.$.colSpan;
  18796. if (1 < k) e = Math.ceil(k / 2), k = Math.floor(k / 2);
  18797. else {
  18798. for (var k = e = 1, l = [], m = 0; m < f.length; m++) {
  18799. var n = f[m];
  18800. l.push(n[g]);
  18801. 1 < n[g].rowSpan && (m += n[g].rowSpan - 1)
  18802. }
  18803. for (f =
  18804. 0; f < l.length; f++) l[f].colSpan++
  18805. }
  18806. f = d.clone();
  18807. f.insertAfter(d);
  18808. f.appendBogus();
  18809. d.$.colSpan = e;
  18810. f.$.colSpan = k;
  18811. 1 == e && d.removeAttribute("colSpan");
  18812. 1 == k && f.removeAttribute("colSpan");
  18813. return f
  18814. }
  18815. var w = /^(?:td|th)$/;
  18816. CKEDITOR.plugins.tabletools = {
  18817. requires: "table,dialog,contextmenu",
  18818. init: function(c) {
  18819. function h(a) {
  18820. return CKEDITOR.tools.extend(a || {}, {
  18821. contextSensitive: 1,
  18822. refresh: function(a, b) {
  18823. this.setState(b.contains({
  18824. td: 1,
  18825. th: 1
  18826. }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  18827. }
  18828. })
  18829. }
  18830. function u(a, b) {
  18831. var d = c.addCommand(a,
  18832. b);
  18833. c.addFeature(d)
  18834. }
  18835. var r = c.lang.table;
  18836. u("cellProperties", new CKEDITOR.dialogCommand("cellProperties", h({
  18837. allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",
  18838. requiredContent: "table",
  18839. contentTransformations: [
  18840. [{
  18841. element: "td",
  18842. left: function(a) {
  18843. return a.styles.background && a.styles.background.match(/^(#[a-fA-F0-9]{3,6}|rgb\([\d, ]+\)|\w+)$/)
  18844. },
  18845. right: function(a) {
  18846. a.styles["background-color"] = a.styles.background
  18847. }
  18848. }]
  18849. ]
  18850. })));
  18851. CKEDITOR.dialog.add("cellProperties",
  18852. this.path + "dialogs/tableCell.js");
  18853. u("rowDelete", h({
  18854. requiredContent: "table",
  18855. exec: function(a) {
  18856. a = a.getSelection();
  18857. d(b(a))
  18858. }
  18859. }));
  18860. u("rowInsertBefore", h({
  18861. requiredContent: "table",
  18862. exec: function(a) {
  18863. a = a.getSelection();
  18864. f(a, !0)
  18865. }
  18866. }));
  18867. u("rowInsertAfter", h({
  18868. requiredContent: "table",
  18869. exec: function(a) {
  18870. a = a.getSelection();
  18871. f(a)
  18872. }
  18873. }));
  18874. u("columnDelete", h({
  18875. requiredContent: "table",
  18876. exec: function(b) {
  18877. b = b.getSelection();
  18878. b = a(b);
  18879. var c = b[0],
  18880. e = b[b.length - 1];
  18881. b = c.getAscendant("table");
  18882. for (var f = CKEDITOR.tools.buildTableMap(b), g, h, k = [], l =
  18883. 0, m = f.length; l < m; l++)
  18884. for (var n = 0, q = f[l].length; n < q; n++) f[l][n] == c.$ && (g = n), f[l][n] == e.$ && (h = n);
  18885. for (l = g; l <= h; l++)
  18886. for (n = 0; n < f.length; n++) e = f[n], c = new CKEDITOR.dom.element(b.$.rows[n]), e = new CKEDITOR.dom.element(e[l]), e.$ && (1 == e.$.colSpan ? e.remove() : --e.$.colSpan, n += e.$.rowSpan - 1, c.$.cells.length || k.push(c));
  18887. h = b.$.rows[0] && b.$.rows[0].cells;
  18888. g = new CKEDITOR.dom.element(h[g] || (g ? h[g - 1] : b.$.parentNode));
  18889. k.length == m && b.remove();
  18890. g && d(g, !0)
  18891. }
  18892. }));
  18893. u("columnInsertBefore", h({
  18894. requiredContent: "table",
  18895. exec: function(a) {
  18896. a =
  18897. a.getSelection();
  18898. e(a, !0)
  18899. }
  18900. }));
  18901. u("columnInsertAfter", h({
  18902. requiredContent: "table",
  18903. exec: function(a) {
  18904. a = a.getSelection();
  18905. e(a)
  18906. }
  18907. }));
  18908. u("cellDelete", h({
  18909. requiredContent: "table",
  18910. exec: function(a) {
  18911. a = a.getSelection();
  18912. l(a)
  18913. }
  18914. }));
  18915. u("cellMerge", h({
  18916. allowedContent: "td[colspan,rowspan]",
  18917. requiredContent: "td[colspan,rowspan]",
  18918. exec: function(a) {
  18919. d(k(a.getSelection()), !0)
  18920. }
  18921. }));
  18922. u("cellMergeRight", h({
  18923. allowedContent: "td[colspan]",
  18924. requiredContent: "td[colspan]",
  18925. exec: function(a) {
  18926. d(k(a.getSelection(), "right"), !0)
  18927. }
  18928. }));
  18929. u("cellMergeDown",
  18930. h({
  18931. allowedContent: "td[rowspan]",
  18932. requiredContent: "td[rowspan]",
  18933. exec: function(a) {
  18934. d(k(a.getSelection(), "down"), !0)
  18935. }
  18936. }));
  18937. u("cellVerticalSplit", h({
  18938. allowedContent: "td[rowspan]",
  18939. requiredContent: "td[rowspan]",
  18940. exec: function(a) {
  18941. d(n(a.getSelection()))
  18942. }
  18943. }));
  18944. u("cellHorizontalSplit", h({
  18945. allowedContent: "td[colspan]",
  18946. requiredContent: "td[colspan]",
  18947. exec: function(a) {
  18948. d(g(a.getSelection()))
  18949. }
  18950. }));
  18951. u("cellInsertBefore", h({
  18952. requiredContent: "table",
  18953. exec: function(a) {
  18954. a = a.getSelection();
  18955. m(a, !0)
  18956. }
  18957. }));
  18958. u("cellInsertAfter", h({
  18959. requiredContent: "table",
  18960. exec: function(a) {
  18961. a = a.getSelection();
  18962. m(a)
  18963. }
  18964. }));
  18965. c.addMenuItems && c.addMenuItems({
  18966. tablecell: {
  18967. label: r.cell.menu,
  18968. group: "tablecell",
  18969. order: 1,
  18970. getItems: function() {
  18971. var b = c.getSelection(),
  18972. d = a(b);
  18973. return {
  18974. tablecell_insertBefore: CKEDITOR.TRISTATE_OFF,
  18975. tablecell_insertAfter: CKEDITOR.TRISTATE_OFF,
  18976. tablecell_delete: CKEDITOR.TRISTATE_OFF,
  18977. tablecell_merge: k(b, null, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18978. tablecell_merge_right: k(b, "right", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18979. tablecell_merge_down: k(b,
  18980. "down", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18981. tablecell_split_vertical: n(b, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18982. tablecell_split_horizontal: g(b, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  18983. tablecell_properties: 0 < d.length ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  18984. }
  18985. }
  18986. },
  18987. tablecell_insertBefore: {
  18988. label: r.cell.insertBefore,
  18989. group: "tablecell",
  18990. command: "cellInsertBefore",
  18991. order: 5
  18992. },
  18993. tablecell_insertAfter: {
  18994. label: r.cell.insertAfter,
  18995. group: "tablecell",
  18996. command: "cellInsertAfter",
  18997. order: 10
  18998. },
  18999. tablecell_delete: {
  19000. label: r.cell.deleteCell,
  19001. group: "tablecell",
  19002. command: "cellDelete",
  19003. order: 15
  19004. },
  19005. tablecell_merge: {
  19006. label: r.cell.merge,
  19007. group: "tablecell",
  19008. command: "cellMerge",
  19009. order: 16
  19010. },
  19011. tablecell_merge_right: {
  19012. label: r.cell.mergeRight,
  19013. group: "tablecell",
  19014. command: "cellMergeRight",
  19015. order: 17
  19016. },
  19017. tablecell_merge_down: {
  19018. label: r.cell.mergeDown,
  19019. group: "tablecell",
  19020. command: "cellMergeDown",
  19021. order: 18
  19022. },
  19023. tablecell_split_horizontal: {
  19024. label: r.cell.splitHorizontal,
  19025. group: "tablecell",
  19026. command: "cellHorizontalSplit",
  19027. order: 19
  19028. },
  19029. tablecell_split_vertical: {
  19030. label: r.cell.splitVertical,
  19031. group: "tablecell",
  19032. command: "cellVerticalSplit",
  19033. order: 20
  19034. },
  19035. tablecell_properties: {
  19036. label: r.cell.title,
  19037. group: "tablecellproperties",
  19038. command: "cellProperties",
  19039. order: 21
  19040. },
  19041. tablerow: {
  19042. label: r.row.menu,
  19043. group: "tablerow",
  19044. order: 1,
  19045. getItems: function() {
  19046. return {
  19047. tablerow_insertBefore: CKEDITOR.TRISTATE_OFF,
  19048. tablerow_insertAfter: CKEDITOR.TRISTATE_OFF,
  19049. tablerow_delete: CKEDITOR.TRISTATE_OFF
  19050. }
  19051. }
  19052. },
  19053. tablerow_insertBefore: {
  19054. label: r.row.insertBefore,
  19055. group: "tablerow",
  19056. command: "rowInsertBefore",
  19057. order: 5
  19058. },
  19059. tablerow_insertAfter: {
  19060. label: r.row.insertAfter,
  19061. group: "tablerow",
  19062. command: "rowInsertAfter",
  19063. order: 10
  19064. },
  19065. tablerow_delete: {
  19066. label: r.row.deleteRow,
  19067. group: "tablerow",
  19068. command: "rowDelete",
  19069. order: 15
  19070. },
  19071. tablecolumn: {
  19072. label: r.column.menu,
  19073. group: "tablecolumn",
  19074. order: 1,
  19075. getItems: function() {
  19076. return {
  19077. tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF,
  19078. tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF,
  19079. tablecolumn_delete: CKEDITOR.TRISTATE_OFF
  19080. }
  19081. }
  19082. },
  19083. tablecolumn_insertBefore: {
  19084. label: r.column.insertBefore,
  19085. group: "tablecolumn",
  19086. command: "columnInsertBefore",
  19087. order: 5
  19088. },
  19089. tablecolumn_insertAfter: {
  19090. label: r.column.insertAfter,
  19091. group: "tablecolumn",
  19092. command: "columnInsertAfter",
  19093. order: 10
  19094. },
  19095. tablecolumn_delete: {
  19096. label: r.column.deleteColumn,
  19097. group: "tablecolumn",
  19098. command: "columnDelete",
  19099. order: 15
  19100. }
  19101. });
  19102. c.contextMenu && c.contextMenu.addListener(function(a, b, c) {
  19103. return (a = c.contains({
  19104. td: 1,
  19105. th: 1
  19106. }, 1)) && !a.isReadOnly() ? {
  19107. tablecell: CKEDITOR.TRISTATE_OFF,
  19108. tablerow: CKEDITOR.TRISTATE_OFF,
  19109. tablecolumn: CKEDITOR.TRISTATE_OFF
  19110. } : null
  19111. })
  19112. },
  19113. getSelectedCells: a
  19114. };
  19115. CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools)
  19116. }(), CKEDITOR.tools.buildTableMap = function(a) {
  19117. a =
  19118. a.$.rows;
  19119. for (var f = -1, b = [], c = 0; c < a.length; c++) {
  19120. f++;
  19121. !b[f] && (b[f] = []);
  19122. for (var e = -1, m = 0; m < a[c].cells.length; m++) {
  19123. var l = a[c].cells[m];
  19124. for (e++; b[f][e];) e++;
  19125. for (var d = isNaN(l.colSpan) ? 1 : l.colSpan, l = isNaN(l.rowSpan) ? 1 : l.rowSpan, h = 0; h < l; h++) {
  19126. b[f + h] || (b[f + h] = []);
  19127. for (var k = 0; k < d; k++) b[f + h][e + k] = a[c].cells[m]
  19128. }
  19129. e += d - 1
  19130. }
  19131. }
  19132. return b
  19133. },
  19134. function() {
  19135. function a(a) {
  19136. function b() {
  19137. for (var g = c(), h = CKEDITOR.tools.clone(a.config.toolbarGroups) || f(a), k = 0; k < h.length; k++) {
  19138. var m = h[k];
  19139. if ("/" != m) {
  19140. "string" == typeof m && (m = h[k] = {
  19141. name: m
  19142. });
  19143. var u, r = m.groups;
  19144. if (r)
  19145. for (var p = 0; p < r.length; p++) u = r[p], (u = g[u]) && d(m, u);
  19146. (u = g[m.name]) && d(m, u)
  19147. }
  19148. }
  19149. return h
  19150. }
  19151. function c() {
  19152. var b = {},
  19153. d, f, g;
  19154. for (d in a.ui.items) f = a.ui.items[d], g = f.toolbar || "others", g = g.split(","), f = g[0], g = parseInt(g[1] || -1, 10), b[f] || (b[f] = []), b[f].push({
  19155. name: d,
  19156. order: g
  19157. });
  19158. for (f in b) b[f] = b[f].sort(function(a, b) {
  19159. return a.order == b.order ? 0 : 0 > b.order ? -1 : 0 > a.order ? 1 : a.order < b.order ? -1 : 1
  19160. });
  19161. return b
  19162. }
  19163. function d(b, c) {
  19164. if (c.length) {
  19165. b.items ? b.items.push(a.ui.create("-")) : b.items = [];
  19166. for (var d; d = c.shift();) d =
  19167. "string" == typeof d ? d : d.name, k && -1 != CKEDITOR.tools.indexOf(k, d) || (d = a.ui.create(d)) && a.addFeature(d) && b.items.push(d)
  19168. }
  19169. }
  19170. function h(a) {
  19171. var b = [],
  19172. c, e, f;
  19173. for (c = 0; c < a.length; ++c) e = a[c], f = {}, "/" == e ? b.push(e) : CKEDITOR.tools.isArray(e) ? (d(f, CKEDITOR.tools.clone(e)), b.push(f)) : e.items && (d(f, CKEDITOR.tools.clone(e.items)), f.name = e.name, b.push(f));
  19174. return b
  19175. }
  19176. var k = a.config.removeButtons,
  19177. k = k && k.split(","),
  19178. g = a.config.toolbar;
  19179. "string" == typeof g && (g = a.config["toolbar_" + g]);
  19180. return a.toolbar = g ? h(g) : b()
  19181. }
  19182. function f(a) {
  19183. return a._.toolbarGroups ||
  19184. (a._.toolbarGroups = [{
  19185. name: "document",
  19186. groups: ["mode", "document", "doctools"]
  19187. }, {
  19188. name: "clipboard",
  19189. groups: ["clipboard", "undo"]
  19190. }, {
  19191. name: "editing",
  19192. groups: ["find", "selection", "spellchecker"]
  19193. }, {
  19194. name: "forms"
  19195. }, "/", {
  19196. name: "basicstyles",
  19197. groups: ["basicstyles", "cleanup"]
  19198. }, {
  19199. name: "paragraph",
  19200. groups: ["list", "indent", "blocks", "align", "bidi"]
  19201. }, {
  19202. name: "links"
  19203. }, {
  19204. name: "insert"
  19205. }, "/", {
  19206. name: "styles"
  19207. }, {
  19208. name: "colors"
  19209. }, {
  19210. name: "tools"
  19211. }, {
  19212. name: "others"
  19213. }, {
  19214. name: "about"
  19215. }])
  19216. }
  19217. var b = function() {
  19218. this.toolbars = [];
  19219. this.focusCommandExecuted = !1
  19220. };
  19221. b.prototype.focus = function() {
  19222. for (var a = 0, b; b = this.toolbars[a++];)
  19223. for (var c = 0, d; d = b.items[c++];)
  19224. if (d.focus) {
  19225. d.focus();
  19226. return
  19227. }
  19228. };
  19229. var c = {
  19230. modes: {
  19231. wysiwyg: 1,
  19232. source: 1
  19233. },
  19234. readOnly: 1,
  19235. exec: function(a) {
  19236. a.toolbox && (a.toolbox.focusCommandExecuted = !0, CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() {
  19237. a.toolbox.focus()
  19238. }, 100) : a.toolbox.focus())
  19239. }
  19240. };
  19241. CKEDITOR.plugins.add("toolbar", {
  19242. requires: "button",
  19243. init: function(e) {
  19244. var f, l = function(a, b) {
  19245. var c, g = "rtl" == e.lang.dir,
  19246. n = e.config.toolbarGroupCycling,
  19247. w = g ? 37 : 39,
  19248. g = g ? 39 : 37,
  19249. n = void 0 === n || n;
  19250. switch (b) {
  19251. case 9:
  19252. case CKEDITOR.SHIFT + 9:
  19253. for (; !c || !c.items.length;)
  19254. if (c = 9 == b ? (c ? c.next : a.toolbar.next) || e.toolbox.toolbars[0] : (c ? c.previous : a.toolbar.previous) || e.toolbox.toolbars[e.toolbox.toolbars.length - 1], c.items.length)
  19255. for (a = c.items[f ? c.items.length - 1 : 0]; a && !a.focus;)(a = f ? a.previous : a.next) || (c = 0);
  19256. a && a.focus();
  19257. return !1;
  19258. case w:
  19259. c = a;
  19260. do c = c.next, !c && n && (c = a.toolbar.items[0]); while (c && !c.focus);
  19261. c ? c.focus() : l(a, 9);
  19262. return !1;
  19263. case 40:
  19264. return a.button && a.button.hasArrow ? (e.once("panelShow",
  19265. function(a) {
  19266. a.data._.panel._.currentBlock.onKeyDown(40)
  19267. }), a.execute()) : l(a, 40 == b ? w : g), !1;
  19268. case g:
  19269. case 38:
  19270. c = a;
  19271. do c = c.previous, !c && n && (c = a.toolbar.items[a.toolbar.items.length - 1]); while (c && !c.focus);
  19272. c ? c.focus() : (f = 1, l(a, CKEDITOR.SHIFT + 9), f = 0);
  19273. return !1;
  19274. case 27:
  19275. return e.focus(), !1;
  19276. case 13:
  19277. case 32:
  19278. return a.execute(), !1
  19279. }
  19280. return !0
  19281. };
  19282. e.on("uiSpace", function(c) {
  19283. if (c.data.space == e.config.toolbarLocation) {
  19284. c.removeListener();
  19285. e.toolbox = new b;
  19286. var f = CKEDITOR.tools.getNextId(),
  19287. k = ['\x3cspan id\x3d"', f, '" class\x3d"cke_voice_label"\x3e',
  19288. e.lang.toolbar.toolbars, "\x3c/span\x3e", '\x3cspan id\x3d"' + e.ui.spaceId("toolbox") + '" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"', f, '" onmousedown\x3d"return false;"\x3e'
  19289. ],
  19290. f = !1 !== e.config.toolbarStartupExpanded,
  19291. g, m;
  19292. e.config.toolbarCanCollapse && e.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && k.push('\x3cspan class\x3d"cke_toolbox_main"' + (f ? "\x3e" : ' style\x3d"display:none"\x3e'));
  19293. for (var w = e.toolbox.toolbars, q = a(e), v = q.length, u = 0; u < v; u++) {
  19294. var r, p = 0,
  19295. z, B = q[u],
  19296. t = "/" !== B && ("/" === q[u + 1] || u ==
  19297. v - 1),
  19298. y;
  19299. if (B)
  19300. if (g && (k.push("\x3c/span\x3e"), m = g = 0), "/" === B) k.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');
  19301. else {
  19302. y = B.items || B;
  19303. for (var D = 0; D < y.length; D++) {
  19304. var x = y[D],
  19305. A;
  19306. if (x) {
  19307. var C = function(a) {
  19308. a = a.render(e, k);
  19309. F = p.items.push(a) - 1;
  19310. 0 < F && (a.previous = p.items[F - 1], a.previous.next = a);
  19311. a.toolbar = p;
  19312. a.onkey = l;
  19313. a.onfocus = function() {
  19314. e.toolbox.focusCommandExecuted || e.focus()
  19315. }
  19316. };
  19317. if (x.type == CKEDITOR.UI_SEPARATOR) m = g && x;
  19318. else {
  19319. A = !1 !== x.canGroup;
  19320. if (!p) {
  19321. r = CKEDITOR.tools.getNextId();
  19322. p = {
  19323. id: r,
  19324. items: []
  19325. };
  19326. z = B.name &&
  19327. (e.lang.toolbar.toolbarGroups[B.name] || B.name);
  19328. k.push('\x3cspan id\x3d"', r, '" class\x3d"cke_toolbar' + (t ? ' cke_toolbar_last"' : '"'), z ? ' aria-labelledby\x3d"' + r + '_label"' : "", ' role\x3d"toolbar"\x3e');
  19329. z && k.push('\x3cspan id\x3d"', r, '_label" class\x3d"cke_voice_label"\x3e', z, "\x3c/span\x3e");
  19330. k.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');
  19331. var F = w.push(p) - 1;
  19332. 0 < F && (p.previous = w[F - 1], p.previous.next = p)
  19333. }
  19334. A ? g || (k.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'), g = 1) : g && (k.push("\x3c/span\x3e"),
  19335. g = 0);
  19336. m && (C(m), m = 0);
  19337. C(x)
  19338. }
  19339. }
  19340. }
  19341. g && (k.push("\x3c/span\x3e"), m = g = 0);
  19342. p && k.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')
  19343. }
  19344. }
  19345. e.config.toolbarCanCollapse && k.push("\x3c/span\x3e");
  19346. if (e.config.toolbarCanCollapse && e.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  19347. var G = CKEDITOR.tools.addFunction(function() {
  19348. e.execCommand("toolbarCollapse")
  19349. });
  19350. e.on("destroy", function() {
  19351. CKEDITOR.tools.removeFunction(G)
  19352. });
  19353. e.addCommand("toolbarCollapse", {
  19354. readOnly: 1,
  19355. exec: function(a) {
  19356. var b = a.ui.space("toolbar_collapser"),
  19357. c = b.getPrevious(),
  19358. d = a.ui.space("contents"),
  19359. e = c.getParent(),
  19360. f = parseInt(d.$.style.height, 10),
  19361. g = e.$.offsetHeight,
  19362. h = b.hasClass("cke_toolbox_collapser_min");
  19363. h ? (c.show(), b.removeClass("cke_toolbox_collapser_min"), b.setAttribute("title", a.lang.toolbar.toolbarCollapse)) : (c.hide(), b.addClass("cke_toolbox_collapser_min"), b.setAttribute("title", a.lang.toolbar.toolbarExpand));
  19364. b.getFirst().setText(h ? "▲" : "◀");
  19365. d.setStyle("height", f - (e.$.offsetHeight - g) + "px");
  19366. a.fire("resize", {
  19367. outerHeight: a.container.$.offsetHeight,
  19368. contentsHeight: d.$.offsetHeight,
  19369. outerWidth: a.container.$.offsetWidth
  19370. })
  19371. },
  19372. modes: {
  19373. wysiwyg: 1,
  19374. source: 1
  19375. }
  19376. });
  19377. e.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse");
  19378. k.push('\x3ca title\x3d"' + (f ? e.lang.toolbar.toolbarCollapse : e.lang.toolbar.toolbarExpand) + '" id\x3d"' + e.ui.spaceId("toolbar_collapser") + '" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');
  19379. f || k.push(" cke_toolbox_collapser_min");
  19380. k.push('" onclick\x3d"CKEDITOR.tools.callFunction(' + G + ')"\x3e', '\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e',
  19381. "\x3c/a\x3e")
  19382. }
  19383. k.push("\x3c/span\x3e");
  19384. c.data.html += k.join("")
  19385. }
  19386. });
  19387. e.on("destroy", function() {
  19388. if (this.toolbox) {
  19389. var a, b = 0,
  19390. c, e, f;
  19391. for (a = this.toolbox.toolbars; b < a.length; b++)
  19392. for (e = a[b].items, c = 0; c < e.length; c++) f = e[c], f.clickFn && CKEDITOR.tools.removeFunction(f.clickFn), f.keyDownFn && CKEDITOR.tools.removeFunction(f.keyDownFn)
  19393. }
  19394. });
  19395. e.on("uiReady", function() {
  19396. var a = e.ui.space("toolbox");
  19397. a && e.focusManager.add(a, 1)
  19398. });
  19399. e.addCommand("toolbarFocus", c);
  19400. e.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
  19401. e.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
  19402. e.ui.addHandler(CKEDITOR.UI_SEPARATOR, {
  19403. create: function() {
  19404. return {
  19405. render: function(a, b) {
  19406. b.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');
  19407. return {}
  19408. }
  19409. }
  19410. }
  19411. })
  19412. }
  19413. });
  19414. CKEDITOR.ui.prototype.addToolbarGroup = function(a, b, c) {
  19415. var d = f(this.editor),
  19416. h = 0 === b,
  19417. k = {
  19418. name: a
  19419. };
  19420. if (c) {
  19421. if (c = CKEDITOR.tools.search(d, function(a) {
  19422. return a.name == c
  19423. })) {
  19424. !c.groups && (c.groups = []);
  19425. if (b && (b = CKEDITOR.tools.indexOf(c.groups, b), 0 <= b)) {
  19426. c.groups.splice(b + 1, 0, a);
  19427. return
  19428. }
  19429. h ? c.groups.splice(0, 0, a) : c.groups.push(a);
  19430. return
  19431. }
  19432. b = null
  19433. }
  19434. b && (b = CKEDITOR.tools.indexOf(d, function(a) {
  19435. return a.name == b
  19436. }));
  19437. h ? d.splice(0, 0, a) : "number" == typeof b ? d.splice(b + 1, 0, k) : d.push(a)
  19438. }
  19439. }(), CKEDITOR.UI_SEPARATOR = "separator", CKEDITOR.config.toolbarLocation = "top", "use strict",
  19440. function() {
  19441. var a = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90],
  19442. f = {
  19443. 8: 1,
  19444. 46: 1
  19445. };
  19446. CKEDITOR.plugins.add("undo", {
  19447. init: function(c) {
  19448. function e(a) {
  19449. g.enabled && !1 !== a.data.command.canUndo && g.save()
  19450. }
  19451. function f() {
  19452. g.enabled = c.readOnly ? !1 : "wysiwyg" == c.mode;
  19453. g.onChange()
  19454. }
  19455. var g = c.undoManager = new b(c),
  19456. l = g.editingHandler = new m(g),
  19457. w = c.addCommand("undo", {
  19458. exec: function() {
  19459. g.undo() && (c.selectionChange(), this.fire("afterUndo"))
  19460. },
  19461. startDisabled: !0,
  19462. canUndo: !1
  19463. }),
  19464. q = c.addCommand("redo", {
  19465. exec: function() {
  19466. g.redo() && (c.selectionChange(), this.fire("afterRedo"))
  19467. },
  19468. startDisabled: !0,
  19469. canUndo: !1
  19470. });
  19471. c.setKeystroke([
  19472. [a[0], "undo"],
  19473. [a[1], "redo"],
  19474. [a[2], "redo"]
  19475. ]);
  19476. g.onChange = function() {
  19477. w.setState(g.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  19478. q.setState(g.redoable() ? CKEDITOR.TRISTATE_OFF :
  19479. CKEDITOR.TRISTATE_DISABLED)
  19480. };
  19481. c.on("beforeCommandExec", e);
  19482. c.on("afterCommandExec", e);
  19483. c.on("saveSnapshot", function(a) {
  19484. g.save(a.data && a.data.contentOnly)
  19485. });
  19486. c.on("contentDom", l.attachListeners, l);
  19487. c.on("instanceReady", function() {
  19488. c.fire("saveSnapshot")
  19489. });
  19490. c.on("beforeModeUnload", function() {
  19491. "wysiwyg" == c.mode && g.save(!0)
  19492. });
  19493. c.on("mode", f);
  19494. c.on("readOnly", f);
  19495. c.ui.addButton && (c.ui.addButton("Undo", {
  19496. label: c.lang.undo.undo,
  19497. command: "undo",
  19498. toolbar: "undo,10"
  19499. }), c.ui.addButton("Redo", {
  19500. label: c.lang.undo.redo,
  19501. command: "redo",
  19502. toolbar: "undo,20"
  19503. }));
  19504. c.resetUndo = function() {
  19505. g.reset();
  19506. c.fire("saveSnapshot")
  19507. };
  19508. c.on("updateSnapshot", function() {
  19509. g.currentImage && g.update()
  19510. });
  19511. c.on("lockSnapshot", function(a) {
  19512. a = a.data;
  19513. g.lock(a && a.dontUpdate, a && a.forceUpdate)
  19514. });
  19515. c.on("unlockSnapshot", g.unlock, g)
  19516. }
  19517. });
  19518. CKEDITOR.plugins.undo = {};
  19519. var b = CKEDITOR.plugins.undo.UndoManager = function(a) {
  19520. this.strokesRecorded = [0, 0];
  19521. this.locked = null;
  19522. this.previousKeyGroup = -1;
  19523. this.limit = a.config.undoStackSize || 20;
  19524. this.strokesLimit = 25;
  19525. this.editor = a;
  19526. this.reset()
  19527. };
  19528. b.prototype = {
  19529. type: function(a, c) {
  19530. var e = b.getKeyGroup(a),
  19531. f = this.strokesRecorded[e] + 1;
  19532. c = c || f >= this.strokesLimit;
  19533. this.typing || (this.hasUndo = this.typing = !0, this.hasRedo = !1, this.onChange());
  19534. c ? (f = 0, this.editor.fire("saveSnapshot")) : this.editor.fire("change");
  19535. this.strokesRecorded[e] = f;
  19536. this.previousKeyGroup = e
  19537. },
  19538. keyGroupChanged: function(a) {
  19539. return b.getKeyGroup(a) != this.previousKeyGroup
  19540. },
  19541. reset: function() {
  19542. this.snapshots = [];
  19543. this.index = -1;
  19544. this.currentImage = null;
  19545. this.hasRedo = this.hasUndo = !1;
  19546. this.locked = null;
  19547. this.resetType()
  19548. },
  19549. resetType: function() {
  19550. this.strokesRecorded = [0, 0];
  19551. this.typing = !1;
  19552. this.previousKeyGroup = -1
  19553. },
  19554. refreshState: function() {
  19555. this.hasUndo = !!this.getNextImage(!0);
  19556. this.hasRedo = !!this.getNextImage(!1);
  19557. this.resetType();
  19558. this.onChange()
  19559. },
  19560. save: function(a, b, e) {
  19561. var f = this.editor;
  19562. if (this.locked || "ready" != f.status || "wysiwyg" != f.mode) return !1;
  19563. var l = f.editable();
  19564. if (!l || "ready" != l.status) return !1;
  19565. l = this.snapshots;
  19566. b || (b = new c(f));
  19567. if (!1 === b.contents) return !1;
  19568. if (this.currentImage)
  19569. if (b.equalsContent(this.currentImage)) {
  19570. if (a ||
  19571. b.equalsSelection(this.currentImage)) return !1
  19572. } else !1 !== e && f.fire("change");
  19573. l.splice(this.index + 1, l.length - this.index - 1);
  19574. l.length == this.limit && l.shift();
  19575. this.index = l.push(b) - 1;
  19576. this.currentImage = b;
  19577. !1 !== e && this.refreshState();
  19578. return !0
  19579. },
  19580. restoreImage: function(a) {
  19581. var b = this.editor,
  19582. c;
  19583. a.bookmarks && (b.focus(), c = b.getSelection());
  19584. this.locked = {
  19585. level: 999
  19586. };
  19587. this.editor.loadSnapshot(a.contents);
  19588. a.bookmarks ? c.selectBookmarks(a.bookmarks) : CKEDITOR.env.ie && (c = this.editor.document.getBody().$.createTextRange(), c.collapse(!0),
  19589. c.select());
  19590. this.locked = null;
  19591. this.index = a.index;
  19592. this.currentImage = this.snapshots[this.index];
  19593. this.update();
  19594. this.refreshState();
  19595. b.fire("change")
  19596. },
  19597. getNextImage: function(a) {
  19598. var b = this.snapshots,
  19599. c = this.currentImage,
  19600. e;
  19601. if (c)
  19602. if (a)
  19603. for (e = this.index - 1; 0 <= e; e--) {
  19604. if (a = b[e], !c.equalsContent(a)) return a.index = e, a
  19605. } else
  19606. for (e = this.index + 1; e < b.length; e++)
  19607. if (a = b[e], !c.equalsContent(a)) return a.index = e, a;
  19608. return null
  19609. },
  19610. redoable: function() {
  19611. return this.enabled && this.hasRedo
  19612. },
  19613. undoable: function() {
  19614. return this.enabled && this.hasUndo
  19615. },
  19616. undo: function() {
  19617. if (this.undoable()) {
  19618. this.save(!0);
  19619. var a = this.getNextImage(!0);
  19620. if (a) return this.restoreImage(a), !0
  19621. }
  19622. return !1
  19623. },
  19624. redo: function() {
  19625. if (this.redoable() && (this.save(!0), this.redoable())) {
  19626. var a = this.getNextImage(!1);
  19627. if (a) return this.restoreImage(a), !0
  19628. }
  19629. return !1
  19630. },
  19631. update: function(a) {
  19632. if (!this.locked) {
  19633. a || (a = new c(this.editor));
  19634. for (var b = this.index, e = this.snapshots; 0 < b && this.currentImage.equalsContent(e[b - 1]);) --b;
  19635. e.splice(b, this.index - b + 1, a);
  19636. this.index = b;
  19637. this.currentImage = a
  19638. }
  19639. },
  19640. updateSelection: function(a) {
  19641. if (!this.snapshots.length) return !1;
  19642. var b = this.snapshots,
  19643. c = b[b.length - 1];
  19644. return c.equalsContent(a) && !c.equalsSelection(a) ? (this.currentImage = b[b.length - 1] = a, !0) : !1
  19645. },
  19646. lock: function(a, b) {
  19647. if (this.locked) this.locked.level++;
  19648. else if (a) this.locked = {
  19649. level: 1
  19650. };
  19651. else {
  19652. var e = null;
  19653. if (b) e = !0;
  19654. else {
  19655. var f = new c(this.editor, !0);
  19656. this.currentImage && this.currentImage.equalsContent(f) && (e = f)
  19657. }
  19658. this.locked = {
  19659. update: e,
  19660. level: 1
  19661. }
  19662. }
  19663. },
  19664. unlock: function() {
  19665. if (this.locked && !--this.locked.level) {
  19666. var a = this.locked.update;
  19667. this.locked = null;
  19668. if (!0 === a) this.update();
  19669. else if (a) {
  19670. var b =
  19671. new c(this.editor, !0);
  19672. a.equalsContent(b) || this.update()
  19673. }
  19674. }
  19675. }
  19676. };
  19677. b.navigationKeyCodes = {
  19678. 37: 1,
  19679. 38: 1,
  19680. 39: 1,
  19681. 40: 1,
  19682. 36: 1,
  19683. 35: 1,
  19684. 33: 1,
  19685. 34: 1
  19686. };
  19687. b.keyGroups = {
  19688. PRINTABLE: 0,
  19689. FUNCTIONAL: 1
  19690. };
  19691. b.isNavigationKey = function(a) {
  19692. return !!b.navigationKeyCodes[a]
  19693. };
  19694. b.getKeyGroup = function(a) {
  19695. var c = b.keyGroups;
  19696. return f[a] ? c.FUNCTIONAL : c.PRINTABLE
  19697. };
  19698. b.getOppositeKeyGroup = function(a) {
  19699. var c = b.keyGroups;
  19700. return a == c.FUNCTIONAL ? c.PRINTABLE : c.FUNCTIONAL
  19701. };
  19702. b.ieFunctionalKeysBug = function(a) {
  19703. return CKEDITOR.env.ie && b.getKeyGroup(a) == b.keyGroups.FUNCTIONAL
  19704. };
  19705. var c = CKEDITOR.plugins.undo.Image = function(a, b) {
  19706. this.editor = a;
  19707. a.fire("beforeUndoImage");
  19708. var c = a.getSnapshot();
  19709. CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, ""));
  19710. this.contents = c;
  19711. b || (this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(!0));
  19712. a.fire("afterUndoImage")
  19713. },
  19714. e = /\b(?:href|src|name)="[^"]*?"/gi;
  19715. c.prototype = {
  19716. equalsContent: function(a) {
  19717. var b = this.contents;
  19718. a = a.contents;
  19719. CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) && (b = b.replace(e, ""), a = a.replace(e, ""));
  19720. return b !=
  19721. a ? !1 : !0
  19722. },
  19723. equalsSelection: function(a) {
  19724. var b = this.bookmarks;
  19725. a = a.bookmarks;
  19726. if (b || a) {
  19727. if (!b || !a || b.length != a.length) return !1;
  19728. for (var c = 0; c < b.length; c++) {
  19729. var e = b[c],
  19730. f = a[c];
  19731. if (e.startOffset != f.startOffset || e.endOffset != f.endOffset || !CKEDITOR.tools.arrayCompare(e.start, f.start) || !CKEDITOR.tools.arrayCompare(e.end, f.end)) return !1
  19732. }
  19733. }
  19734. return !0
  19735. }
  19736. };
  19737. var m = CKEDITOR.plugins.undo.NativeEditingHandler = function(a) {
  19738. this.undoManager = a;
  19739. this.ignoreInputEvent = !1;
  19740. this.keyEventsStack = new l;
  19741. this.lastKeydownImage = null
  19742. };
  19743. m.prototype = {
  19744. onKeydown: function(d) {
  19745. var e = d.data.getKey();
  19746. if (229 !== e)
  19747. if (-1 < CKEDITOR.tools.indexOf(a, d.data.getKeystroke())) d.data.preventDefault();
  19748. else if (this.keyEventsStack.cleanUp(d), d = this.undoManager, this.keyEventsStack.getLast(e) || this.keyEventsStack.push(e), this.lastKeydownImage = new c(d.editor), b.isNavigationKey(e) || this.undoManager.keyGroupChanged(e))
  19749. if (d.strokesRecorded[0] || d.strokesRecorded[1]) d.save(!1, this.lastKeydownImage, !1), d.resetType()
  19750. },
  19751. onInput: function() {
  19752. if (this.ignoreInputEvent) this.ignoreInputEvent = !1;
  19753. else {
  19754. var a = this.keyEventsStack.getLast();
  19755. a || (a = this.keyEventsStack.push(0));
  19756. this.keyEventsStack.increment(a.keyCode);
  19757. this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit && (this.undoManager.type(a.keyCode, !0), this.keyEventsStack.resetInputs())
  19758. }
  19759. },
  19760. onKeyup: function(a) {
  19761. var e = this.undoManager;
  19762. a = a.data.getKey();
  19763. var f = this.keyEventsStack.getTotalInputs();
  19764. this.keyEventsStack.remove(a);
  19765. if (!(b.ieFunctionalKeysBug(a) && this.lastKeydownImage && this.lastKeydownImage.equalsContent(new c(e.editor, !0))))
  19766. if (0 < f) e.type(a);
  19767. else if (b.isNavigationKey(a)) this.onNavigationKey(!0)
  19768. },
  19769. onNavigationKey: function(a) {
  19770. var b = this.undoManager;
  19771. !a && b.save(!0, null, !1) || b.updateSelection(new c(b.editor));
  19772. b.resetType()
  19773. },
  19774. ignoreInputEventListener: function() {
  19775. this.ignoreInputEvent = !0
  19776. },
  19777. attachListeners: function() {
  19778. var a = this.undoManager.editor,
  19779. c = a.editable(),
  19780. e = this;
  19781. c.attachListener(c, "keydown", function(a) {
  19782. e.onKeydown(a);
  19783. if (b.ieFunctionalKeysBug(a.data.getKey())) e.onInput()
  19784. }, null, null, 999);
  19785. c.attachListener(c, CKEDITOR.env.ie ?
  19786. "keypress" : "input", e.onInput, e, null, 999);
  19787. c.attachListener(c, "keyup", e.onKeyup, e, null, 999);
  19788. c.attachListener(c, "paste", e.ignoreInputEventListener, e, null, 999);
  19789. c.attachListener(c, "drop", e.ignoreInputEventListener, e, null, 999);
  19790. c.attachListener(c.isInline() ? c : a.document.getDocumentElement(), "click", function() {
  19791. e.onNavigationKey()
  19792. }, null, null, 999);
  19793. c.attachListener(this.undoManager.editor, "blur", function() {
  19794. e.keyEventsStack.remove(9)
  19795. }, null, null, 999)
  19796. }
  19797. };
  19798. var l = CKEDITOR.plugins.undo.KeyEventsStack = function() {
  19799. this.stack = []
  19800. };
  19801. l.prototype = {
  19802. push: function(a) {
  19803. a = this.stack.push({
  19804. keyCode: a,
  19805. inputs: 0
  19806. });
  19807. return this.stack[a - 1]
  19808. },
  19809. getLastIndex: function(a) {
  19810. if ("number" != typeof a) return this.stack.length - 1;
  19811. for (var b = this.stack.length; b--;)
  19812. if (this.stack[b].keyCode == a) return b;
  19813. return -1
  19814. },
  19815. getLast: function(a) {
  19816. a = this.getLastIndex(a);
  19817. return -1 != a ? this.stack[a] : null
  19818. },
  19819. increment: function(a) {
  19820. this.getLast(a).inputs++
  19821. },
  19822. remove: function(a) {
  19823. a = this.getLastIndex(a); - 1 != a && this.stack.splice(a, 1)
  19824. },
  19825. resetInputs: function(a) {
  19826. if ("number" == typeof a) this.getLast(a).inputs =
  19827. 0;
  19828. else
  19829. for (a = this.stack.length; a--;) this.stack[a].inputs = 0
  19830. },
  19831. getTotalInputs: function() {
  19832. for (var a = this.stack.length, b = 0; a--;) b += this.stack[a].inputs;
  19833. return b
  19834. },
  19835. cleanUp: function(a) {
  19836. a = a.data.$;
  19837. a.ctrlKey || a.metaKey || this.remove(17);
  19838. a.shiftKey || this.remove(16);
  19839. a.altKey || this.remove(18)
  19840. }
  19841. }
  19842. }(), CKEDITOR.plugins.add("wsc", {
  19843. requires: "dialog",
  19844. parseApi: function(a) {
  19845. a.config.wsc_onFinish = "function" === typeof a.config.wsc_onFinish ? a.config.wsc_onFinish : function() {};
  19846. a.config.wsc_onClose = "function" === typeof a.config.wsc_onClose ?
  19847. a.config.wsc_onClose : function() {}
  19848. },
  19849. parseConfig: function(a) {
  19850. a.config.wsc_customerId = a.config.wsc_customerId || CKEDITOR.config.wsc_customerId || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";
  19851. a.config.wsc_customDictionaryIds = a.config.wsc_customDictionaryIds || CKEDITOR.config.wsc_customDictionaryIds || "";
  19852. a.config.wsc_userDictionaryName = a.config.wsc_userDictionaryName || CKEDITOR.config.wsc_userDictionaryName || "";
  19853. a.config.wsc_customLoaderScript = a.config.wsc_customLoaderScript || CKEDITOR.config.wsc_customLoaderScript;
  19854. a.config.wsc_interfaceLang = a.config.wsc_interfaceLang;
  19855. CKEDITOR.config.wsc_cmd = a.config.wsc_cmd || CKEDITOR.config.wsc_cmd || "spell";
  19856. CKEDITOR.config.wsc_version = "v4.3.0-master-d769233";
  19857. CKEDITOR.config.wsc_removeGlobalVariable = !0
  19858. },
  19859. onLoad: function(a) {
  19860. "moono-lisa" == (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(this.path + "skins/" + CKEDITOR.skin.name + "/wsc.css")
  19861. },
  19862. init: function(a) {
  19863. var f = CKEDITOR.env;
  19864. this.parseConfig(a);
  19865. this.parseApi(a);
  19866. a.addCommand("checkspell", new CKEDITOR.dialogCommand("checkspell")).modes = {
  19867. wysiwyg: !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname && !(f.ie && (8 > f.version || f.quirks))
  19868. };
  19869. "undefined" == typeof a.plugins.scayt && a.ui.addButton && a.ui.addButton("SpellChecker", {
  19870. label: a.lang.wsc.toolbar,
  19871. click: function(a) {
  19872. var c = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  19873. (c = c.replace(/\s/g, "")) ? a.execCommand("checkspell"): alert("Nothing to check!")
  19874. },
  19875. toolbar: "spellchecker,10"
  19876. });
  19877. CKEDITOR.dialog.add("checkspell", this.path +
  19878. (CKEDITOR.env.ie && 7 >= CKEDITOR.env.version ? "dialogs/wsc_ie.js" : window.postMessage ? "dialogs/wsc.js" : "dialogs/wsc_ie.js"))
  19879. }
  19880. }),
  19881. function() {
  19882. function a(a) {
  19883. function b(a) {
  19884. var c = !1;
  19885. g.attachListener(g, "keydown", function() {
  19886. var b = d.getBody().getElementsByTag(a);
  19887. if (!c) {
  19888. for (var e = 0; e < b.count(); e++) b.getItem(e).setCustomData("retain", !0);
  19889. c = !0
  19890. }
  19891. }, null, null, 1);
  19892. g.attachListener(g, "keyup", function() {
  19893. var b = d.getElementsByTag(a);
  19894. c && (1 != b.count() || b.getItem(0).getCustomData("retain") || b.getItem(0).hasAttribute("data-cke-temp") ||
  19895. b.getItem(0).remove(1), c = !1)
  19896. })
  19897. }
  19898. var c = this.editor,
  19899. d = a.document,
  19900. h = d.body,
  19901. k = d.getElementById("cke_actscrpt");
  19902. k && k.parentNode.removeChild(k);
  19903. (k = d.getElementById("cke_shimscrpt")) && k.parentNode.removeChild(k);
  19904. (k = d.getElementById("cke_basetagscrpt")) && k.parentNode.removeChild(k);
  19905. h.contentEditable = !0;
  19906. CKEDITOR.env.ie && (h.hideFocus = !0, h.disabled = !0, h.removeAttribute("disabled"));
  19907. delete this._.isLoadingData;
  19908. this.$ = h;
  19909. d = new CKEDITOR.dom.document(d);
  19910. this.setup();
  19911. this.fixInitialSelection();
  19912. var g = this;
  19913. CKEDITOR.env.ie &&
  19914. !CKEDITOR.env.edge && d.getDocumentElement().addClass(d.$.compatMode);
  19915. CKEDITOR.env.ie && !CKEDITOR.env.edge && c.enterMode != CKEDITOR.ENTER_P ? b("p") : CKEDITOR.env.edge && c.enterMode != CKEDITOR.ENTER_DIV && b("div");
  19916. if (CKEDITOR.env.webkit || CKEDITOR.env.ie && 10 < CKEDITOR.env.version) d.getDocumentElement().on("mousedown", function(a) {
  19917. a.data.getTarget().is("html") && setTimeout(function() {
  19918. c.editable().focus()
  19919. })
  19920. });
  19921. f(c);
  19922. try {
  19923. c.document.$.execCommand("2D-position", !1, !0)
  19924. } catch (n) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && "CSS1Compat" ==
  19925. c.document.$.compatMode) && this.attachListener(this, "keydown", function(a) {
  19926. var b = a.data.getKeystroke();
  19927. if (33 == b || 34 == b)
  19928. if (CKEDITOR.env.ie) setTimeout(function() {
  19929. c.getSelection().scrollIntoView()
  19930. }, 0);
  19931. else if (c.window.$.innerHeight > this.$.offsetHeight) {
  19932. var d = c.createRange();
  19933. d[33 == b ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
  19934. d.select();
  19935. a.data.preventDefault()
  19936. }
  19937. });
  19938. CKEDITOR.env.ie && this.attachListener(d, "blur", function() {
  19939. try {
  19940. d.$.selection.empty()
  19941. } catch (a) {}
  19942. });
  19943. CKEDITOR.env.iOS && this.attachListener(d,
  19944. "touchend",
  19945. function() {
  19946. a.focus()
  19947. });
  19948. h = c.document.getElementsByTag("title").getItem(0);
  19949. h.data("cke-title", h.getText());
  19950. CKEDITOR.env.ie && (c.document.$.title = this._.docTitle);
  19951. CKEDITOR.tools.setTimeout(function() {
  19952. "unloaded" == this.status && (this.status = "ready");
  19953. c.fire("contentDom");
  19954. this._.isPendingFocus && (c.focus(), this._.isPendingFocus = !1);
  19955. setTimeout(function() {
  19956. c.fire("dataReady")
  19957. }, 0)
  19958. }, 0, this)
  19959. }
  19960. function f(a) {
  19961. function b() {
  19962. var d;
  19963. a.editable().attachListener(a, "selectionChange", function() {
  19964. var b = a.getSelection().getSelectedElement();
  19965. b && (d && (d.detachEvent("onresizestart", c), d = null), b.$.attachEvent("onresizestart", c), d = b.$)
  19966. })
  19967. }
  19968. function c(a) {
  19969. a.returnValue = !1
  19970. }
  19971. if (CKEDITOR.env.gecko) try {
  19972. var d = a.document.$;
  19973. d.execCommand("enableObjectResizing", !1, !a.config.disableObjectResizing);
  19974. d.execCommand("enableInlineTableEditing", !1, !a.config.disableNativeTableHandles)
  19975. } catch (f) {} else CKEDITOR.env.ie && 11 > CKEDITOR.env.version && a.config.disableObjectResizing && b(a)
  19976. }
  19977. function b() {
  19978. var a = [];
  19979. if (8 <= CKEDITOR.document.$.documentMode) {
  19980. a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");
  19981. var b = [],
  19982. c;
  19983. for (c in CKEDITOR.dtd.$removeEmpty) b.push("html.CSS1Compat " + c + "[contenteditable\x3dfalse]");
  19984. a.push(b.join(",") + "{display:inline-block}")
  19985. } else CKEDITOR.env.gecko && (a.push("html{height:100% !important}"), a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));
  19986. a.push("html{cursor:text;*cursor:auto}");
  19987. a.push("img,input,textarea{cursor:default}");
  19988. return a.join("\n")
  19989. }
  19990. var c;
  19991. CKEDITOR.plugins.add("wysiwygarea", {
  19992. init: function(a) {
  19993. a.config.fullPage && a.addFeature({
  19994. allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]",
  19995. requiredContent: "body"
  19996. });
  19997. a.addMode("wysiwyg", function(b) {
  19998. function f(d) {
  19999. d && d.removeListener();
  20000. a.editable(new c(a, h.$.contentWindow.document.body));
  20001. a.setData(a.getData(1), b)
  20002. }
  20003. var d = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();",
  20004. d = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ? "javascript:void(function(){" + encodeURIComponent(d) + "}())" : "",
  20005. h = CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"' + d + '" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');
  20006. h.setStyles({
  20007. width: "100%",
  20008. height: "100%"
  20009. });
  20010. h.addClass("cke_wysiwyg_frame").addClass("cke_reset");
  20011. d = a.ui.space("contents");
  20012. d.append(h);
  20013. var k = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.gecko;
  20014. if (k) h.on("load", f);
  20015. var g = a.title,
  20016. n = a.fire("ariaEditorHelpLabel", {}).label;
  20017. g && (CKEDITOR.env.ie && n && (g += ", " + n), h.setAttribute("title", g));
  20018. if (n) {
  20019. var g = CKEDITOR.tools.getNextId(),
  20020. w = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + g + '" class\x3d"cke_voice_label"\x3e' + n + "\x3c/span\x3e");
  20021. d.append(w, 1);
  20022. h.setAttribute("aria-describedby",
  20023. g)
  20024. }
  20025. a.on("beforeModeUnload", function(a) {
  20026. a.removeListener();
  20027. w && w.remove()
  20028. });
  20029. h.setAttributes({
  20030. tabIndex: a.tabIndex,
  20031. allowTransparency: "true"
  20032. });
  20033. !k && f();
  20034. a.fire("ariaWidget", h)
  20035. })
  20036. }
  20037. });
  20038. CKEDITOR.editor.prototype.addContentsCss = function(a) {
  20039. var b = this.config,
  20040. c = b.contentsCss;
  20041. CKEDITOR.tools.isArray(c) || (b.contentsCss = c ? [c] : []);
  20042. b.contentsCss.push(a)
  20043. };
  20044. c = CKEDITOR.tools.createClass({
  20045. $: function() {
  20046. this.base.apply(this, arguments);
  20047. this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(b) {
  20048. CKEDITOR.tools.setTimeout(a,
  20049. 0, this, b)
  20050. }, this);
  20051. this._.docTitle = this.getWindow().getFrame().getAttribute("title")
  20052. },
  20053. base: CKEDITOR.editable,
  20054. proto: {
  20055. setData: function(a, c) {
  20056. var f = this.editor;
  20057. if (c) this.setHtml(a), this.fixInitialSelection(), f.fire("dataReady");
  20058. else {
  20059. this._.isLoadingData = !0;
  20060. f._.dataStore = {
  20061. id: 1
  20062. };
  20063. var d = f.config,
  20064. h = d.fullPage,
  20065. k = d.docType,
  20066. g = CKEDITOR.tools.buildStyleHtml(b()).replace(/<style>/, '\x3cstyle data-cke-temp\x3d"1"\x3e');
  20067. h || (g += CKEDITOR.tools.buildStyleHtml(f.config.contentsCss));
  20068. var n = d.baseHref ? '\x3cbase href\x3d"' +
  20069. d.baseHref + '" data-cke-temp\x3d"1" /\x3e' : "";
  20070. h && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) {
  20071. f.docType = k = a;
  20072. return ""
  20073. }).replace(/<\?xml\s[^\?]*\?>/i, function(a) {
  20074. f.xmlDeclaration = a;
  20075. return ""
  20076. }));
  20077. a = f.dataProcessor.toHtml(a);
  20078. h ? (/<body[\s|>]/.test(a) || (a = "\x3cbody\x3e" + a), /<html[\s|>]/.test(a) || (a = "\x3chtml\x3e" + a + "\x3c/html\x3e"), /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (a = a.replace(/<head[^>]*>/, "$\x26\x3ctitle\x3e\x3c/title\x3e")) : a = a.replace(/<html[^>]*>/, "$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),
  20079. n && (a = a.replace(/<head[^>]*?>/, "$\x26" + n)), a = a.replace(/<\/head\s*>/, g + "$\x26"), a = k + a) : a = d.docType + '\x3chtml dir\x3d"' + d.contentsLangDirection + '" lang\x3d"' + (d.contentsLanguage || f.langCode) + '"\x3e\x3chead\x3e\x3ctitle\x3e' + this._.docTitle + "\x3c/title\x3e" + n + g + "\x3c/head\x3e\x3cbody" + (d.bodyId ? ' id\x3d"' + d.bodyId + '"' : "") + (d.bodyClass ? ' class\x3d"' + d.bodyClass + '"' : "") + "\x3e" + a + "\x3c/body\x3e\x3c/html\x3e";
  20080. CKEDITOR.env.gecko && (a = a.replace(/<body/, '\x3cbody contenteditable\x3d"true" '), 2E4 > CKEDITOR.env.version &&
  20081. (a = a.replace(/<body[^>]*>/, "$\x26\x3c!-- cke-content-start --\x3e")));
  20082. d = '\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"' + (CKEDITOR.env.ie ? ' defer\x3d"defer" ' : "") + "\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction(" + this._.frameLoadedHandler + ",window);wasLoaded\x3d1;}" + (CKEDITOR.env.ie ? "onload();" : 'document.addEventListener("DOMContentLoaded", onload, false );') + "\x3c/script\x3e";
  20083. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (d += '\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
  20084. n && CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (d += '\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');
  20085. a = a.replace(/(?=\s*<\/(:?head)>)/, d);
  20086. this.clearCustomData();
  20087. this.clearListeners();
  20088. f.fire("contentDomUnload");
  20089. var w = this.getDocument();
  20090. try {
  20091. w.write(a)
  20092. } catch (q) {
  20093. setTimeout(function() {
  20094. w.write(a)
  20095. }, 0)
  20096. }
  20097. }
  20098. },
  20099. getData: function(a) {
  20100. if (a) return this.getHtml();
  20101. a = this.editor;
  20102. var b = a.config,
  20103. c = b.fullPage,
  20104. d = c && a.docType,
  20105. f = c && a.xmlDeclaration,
  20106. k = this.getDocument(),
  20107. c = c ? k.getDocumentElement().getOuterHtml() : k.getBody().getHtml();
  20108. CKEDITOR.env.gecko && b.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/<br>(?=\s*(:?$|<\/body>))/, ""));
  20109. c = a.dataProcessor.toDataFormat(c);
  20110. f && (c = f + "\n" + c);
  20111. d && (c = d + "\n" + c);
  20112. return c
  20113. },
  20114. focus: function() {
  20115. this._.isLoadingData ? this._.isPendingFocus = !0 : c.baseProto.focus.call(this)
  20116. },
  20117. detach: function() {
  20118. var a = this.editor,
  20119. b = a.document,
  20120. f;
  20121. try {
  20122. f = a.window.getFrame()
  20123. } catch (d) {}
  20124. c.baseProto.detach.call(this);
  20125. this.clearCustomData();
  20126. b.getDocumentElement().clearCustomData();
  20127. CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
  20128. f && f.getParent() ? (f.clearCustomData(), (a = f.removeCustomData("onResize")) && a.removeListener(), f.remove()) : CKEDITOR.warn("editor-destroy-iframe")
  20129. }
  20130. }
  20131. })
  20132. }(), CKEDITOR.config.disableObjectResizing = !1, CKEDITOR.config.disableNativeTableHandles = !0, CKEDITOR.config.disableNativeSpellChecker = !0, 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",
  20133. CKEDITOR.config.skin = "moono-lisa",
  20134. function() {
  20135. var a = function(a, b) {
  20136. var c = CKEDITOR.getUrl("plugins/" + b);
  20137. a = a.split(",");
  20138. for (var e = 0; e < a.length; e++) CKEDITOR.skin.icons[a[e]] = {
  20139. path: c,
  20140. offset: -a[++e],
  20141. bgsize: a[++e]
  20142. }
  20143. };
  20144. 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,,copyformatting,456,,creatediv,480,,docprops-rtl,504,,docprops,528,,embed,552,,embedsemantic,576,,find-rtl,600,,find,624,,replace,648,,flash,672,,button,696,,checkbox,720,,form,744,,hiddenfield,768,,imagebutton,792,,radio,816,,select-rtl,840,,select,864,,textarea-rtl,888,,textarea,912,,textfield-rtl,936,,textfield,960,,horizontalrule,984,,iframe,1008,,image,1032,,indent-rtl,1056,,indent,1080,,outdent-rtl,1104,,outdent,1128,,justifyblock,1152,,justifycenter,1176,,justifyleft,1200,,justifyright,1224,,language,1248,,anchor-rtl,1272,,anchor,1296,,link,1320,,unlink,1344,,bulletedlist-rtl,1368,,bulletedlist,1392,,numberedlist-rtl,1416,,numberedlist,1440,,mathjax,1464,,maximize,1488,,newpage-rtl,1512,,newpage,1536,,pagebreak-rtl,1560,,pagebreak,1584,,pastefromword-rtl,1608,,pastefromword,1632,,pastetext-rtl,1656,,pastetext,1680,,placeholder,1704,,preview-rtl,1728,,preview,1752,,print,1776,,removeformat,1800,,save,1824,,scayt,1848,,selectall,1872,,showblocks-rtl,1896,,showblocks,1920,,smiley,1944,,source-rtl,1968,,source,1992,,sourcedialog-rtl,2016,,sourcedialog,2040,,specialchar,2064,,table,2088,,templates-rtl,2112,,templates,2136,,uicolor,2160,,redo-rtl,2184,,redo,2208,,undo-rtl,2232,,undo,2256,,simplebox,4560,auto,spellchecker,2304,",
  20145. "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,copyformatting,456,auto,creatediv,480,auto,docprops-rtl,504,auto,docprops,528,auto,embed,552,auto,embedsemantic,576,auto,find-rtl,600,auto,find,624,auto,replace,648,auto,flash,672,auto,button,696,auto,checkbox,720,auto,form,744,auto,hiddenfield,768,auto,imagebutton,792,auto,radio,816,auto,select-rtl,840,auto,select,864,auto,textarea-rtl,888,auto,textarea,912,auto,textfield-rtl,936,auto,textfield,960,auto,horizontalrule,984,auto,iframe,1008,auto,image,1032,auto,indent-rtl,1056,auto,indent,1080,auto,outdent-rtl,1104,auto,outdent,1128,auto,justifyblock,1152,auto,justifycenter,1176,auto,justifyleft,1200,auto,justifyright,1224,auto,language,1248,auto,anchor-rtl,1272,auto,anchor,1296,auto,link,1320,auto,unlink,1344,auto,bulletedlist-rtl,1368,auto,bulletedlist,1392,auto,numberedlist-rtl,1416,auto,numberedlist,1440,auto,mathjax,1464,auto,maximize,1488,auto,newpage-rtl,1512,auto,newpage,1536,auto,pagebreak-rtl,1560,auto,pagebreak,1584,auto,pastefromword-rtl,1608,auto,pastefromword,1632,auto,pastetext-rtl,1656,auto,pastetext,1680,auto,placeholder,1704,auto,preview-rtl,1728,auto,preview,1752,auto,print,1776,auto,removeformat,1800,auto,save,1824,auto,scayt,1848,auto,selectall,1872,auto,showblocks-rtl,1896,auto,showblocks,1920,auto,smiley,1944,auto,source-rtl,1968,auto,source,1992,auto,sourcedialog-rtl,2016,auto,sourcedialog,2040,auto,specialchar,2064,auto,table,2088,auto,templates-rtl,2112,auto,templates,2136,auto,uicolor,2160,auto,redo-rtl,2184,auto,redo,2208,auto,undo-rtl,2232,auto,undo,2256,auto,simplebox,2280,auto,spellchecker,2304,auto",
  20146. "icons.png")
  20147. }())
  20148. })();